changeset 5125:b5df3737028a ben-lisp-object

merge
author Ben Wing <ben@xemacs.org>
date Wed, 24 Feb 2010 01:58:04 -0600 (2010-02-24)
parents 623d57b7fbe8 (current diff) 9624523604c5 (diff)
children 2a462149bd6a
files configure etc/gdbinit.in lib-src/make-msgfile.c lib-src/make-po.c lisp/ChangeLog man/term.texi modules/ldap/eldap.c modules/postgresql/postgresql.c nt/ad2c.sed nt/x11.patch src/ChangeLog src/alloc.c src/buffer.c src/buffer.h src/bytecode.c src/bytecode.h src/casetab.c src/charset.h src/chartab.c src/console-impl.h src/console-stream.c src/console-tty.c src/console-x-impl.h src/console.c src/data.c src/database.c src/device-gtk.c src/device-msw.c src/device-tty.c src/device-x.c src/device.c src/dialog-msw.c src/dynarr.c src/elhash.c src/emacs.c src/eval.c src/event-gtk.h src/event-stream.c src/events.c src/events.h src/extents.c src/faces.c src/faces.h src/file-coding.c src/floatfns.c src/fns.c src/font-mgr.c src/font-mgr.h src/frame-gtk.c src/frame-msw.c src/frame-x.c src/frame.c src/frame.h src/glyphs.c src/glyphs.h src/gui.c src/inline.c src/keymap.c src/keymap.h src/lisp.h src/lrecord.h src/lstream.c src/marker.c src/mule-charset.c src/number.c src/number.h src/objects-tty.c src/objects.c src/objects.h src/opaque.c src/print.c src/process-nt.c src/process.c src/process.h src/rangetab.c src/s/cygwin.sc src/select-common.h src/specifier.c src/specifier.h src/symbols.c src/symeval.h src/syntax.c src/toolbar-common.c src/toolbar-common.h src/tooltalk.c src/ui-gtk.c src/ui-gtk.h src/window.c src/xemacs.def.in.in src/xgccache.c src/xgccache.h tests/DLL/dltest.c
diffstat 379 files changed, 33110 insertions(+), 23510 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,150 @@
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (TAB):
+	Various warnings that used to be present had mistakenly gotten
+	turned off. Turn them back on.
+
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (AC_LANG):
+	* configure.ac (TAB):
+	Add AC_LANG(C++) defs in a way very similar to AC_LANG(C), inserting
+	our own flags, compiler, etc.
+
+	When using g++, if we found ndbm, check whether we can compile a
+	file using g++ and ndbm.h, calling some DBM routines.  Currently, this
+	fails because the prototypes in ndbm.h are incomplete, omitting the
+	arguments, which doesn't work with g++.  When ndbm.h is bad, we don't
+	include it and instead provide our own prototypes; otherwise, we
+	define TRUST_NDBM_H_PROTOTYPES, which signals to use the ones in
+	ndbm.h.
+
+2010-01-31  Ben Wing  <ben@xemacs.org>
+
+	* configure.ac (TAB):
+	Say "This Xft feature" rather than just "This feature" to make it
+	possible to more safely filter out the warning in my `runcc'
+	script without the possibility of filtering out genuinely
+	important warnings.
+	* configure: Regenerate.
+
+2010-01-23  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (XE_COMPLEX_ARG):
+	Expand the help for --with-debug to describe more specifically what
+	exactly gets turned on.  Expand the help for --with-error-checking
+	to describe all the possible arguments, including `all', `none',
+	`noFOO', multiple arguments, etc.
+
+	Change so that `--with-error-checking' is the same as
+	`--with-error-checking=all'.  Currently, `--with-error-checking' has
+	no effect at all!  It just means "leave all error-checking for
+	specific classes to their default values", which are "maybe", and
+	get converted to "yes" or "no" depending on whether we are running
+	a beta XEmacs.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* configure: Rebuild.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* aclocal.m4 (XE_SHLIB_STUFF):
+	Use -export-all-symbols instead of -export-dynamic on PE targets
+	(Cygwin and MinGW).
+	
+	* configure.ac (XE_EXPAND_VARIABLE):
+	* configure.ac (TAB):
+	Create variable XEMACS_CC_GPP to check whether we're running g++.
+	Don't just check for an executable called `g++' -- it might be
+	called g++-4 or whatever.  Instead, check for either named `g++*'
+	or claiming to be g++ when called with --version.  Rewrite code do
+	use the variable.
+
+	Add -fno-strict-aliasing to optimization flags when GCC and
+	optimized, and in all cases with g++, since under these circumstances
+	strict aliasing is otherwise assumed, and XEmacs can't easily be
+	made to respect its restrictions.
+
+	* configure: Regenerate.
+	
+	
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (TAB):
+	USE_XFT* -> HAVE_XFT*.
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* PROBLEMS:
+	Add description of crash on recent Cygwin 1.7 when using C++, NEWGC
+        and optimization.
+
+2010-01-16  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* configure: Regenerate, now we no longer look for rint().
+
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	* Makefile.in.in (GENERATED_HEADERS):
+	* Makefile.in.in (.PHONY):
+	* Makefile.in.in (src/.gdbinit):
+	* configure:
+	* configure.ac (TAB):
+	etc/gdbinit.in has been moved to src/.gdbinit.in.in.  Reflect
+	this -- generate src/.gdbinit.in from src/.gdbinit.in.in, and
+	use the normal mechanism for doing so instead of copying it
+	specially.
+
+	Add target for `config-changed' and pass down to `src'.
+	Move some PHONY declarations to just before the actual targets.
+
+2010-01-16  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* configure: Regenerate, now we no longer look for rint().
+
+2010-01-13  Jerry James  <james@xemacs.org>
+
+	* configure.ac: Update comment about Cygwin and pdump.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in (fix-perms):
+	Add target for fix-perms.  Run it to correct permissions.
+
+	* INSTALL:
+	* PROBLEMS:
+	* configure:
+	* configure.ac (XE_COMPLEX_ARG):
+	* configure.ac (XE_EXPAND_VARIABLE):
+	* configure.ac (TAB):
+	Rename all instances of enable-FOO to with-FOO.  enable-FOO has long
+	been aliased to with-FOO and we still preserve this, but formerly
+	we randomly used enable-FOO but with-BAR.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (TAB):
+	Add check for cygwin_conv_path().
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* configure:
+	* configure.ac (TAB):
+	Define USE_GPLUSPLUS when compiling with g++.
+
+2010-01-06  Jerry James  <james@xemacs.org>
+
+	* configure.ac: Add --with-valgrind option.
+	* configure: Regenerate.
+
 2009-12-21  Jerry James  <james@xemacs.org>
 
 	* INSTALL: Remove references to OffiX.
--- a/INSTALL	Wed Jan 20 07:05:57 2010 -0600
+++ b/INSTALL	Wed Feb 24 01:58:04 2010 -0600
@@ -460,10 +460,10 @@
 and is intended for use only by the developers. It may be obtained
 from <URL:http://www.letters.com/dmalloc/>.
 
-The `--enable-debug' and `--enable-error-checking' options are primarily
-useful to the developers.  `--enable-debug' incorporates code for
+The `--with-debug' and `--with-error-checking' options are primarily
+useful to the developers.  `--with-debug' incorporates code for
 performing various tests, but does not impose a speed penalty.
-`--enable-error-checking' adds additional tests to many of the commonly
+`--with-error-checking' adds additional tests to many of the commonly
 used macros, and imposes a speed penalty.  Using either or both of these
 options can make bug reports more useful to the developers.
 
--- a/Makefile.in.in	Wed Jan 20 07:05:57 2010 -0600
+++ b/Makefile.in.in	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-## Copyright (C) 2003, 2005 Ben Wing. 
+## Copyright (C) 2003, 2005, 2010 Ben Wing. 
 
 ## DIST: This is the distribution Makefile for XEmacs.  configure can
 ## DIST: make most of the changes to this file you might want, so try
@@ -243,7 +243,7 @@
 ## instead, we have written out explicit code in the `install' targets.
 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
 COPYDESTS = ${etcdir} ${lispdir}
-GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/config.h lwlib/config.h src/sheap-adjust.h src/xemacs.def etc/PROBLEMS
+GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/config.h lwlib/config.h src/sheap-adjust.h src/xemacs.def etc/PROBLEMS src/.gdbinit
 
 ## MAKE_SUBDIR will always be of the form lib-src ... src, where
 ## `...' includes various other directories that may be inserted by
@@ -282,9 +282,15 @@
 depend ${srcdir}/src/depend:
 	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) depend
 
+.PHONY: config-changed
+config-changed:
+	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
+
+.PHONY: check
 check:
 	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
 
+.PHONY: check-features
 check-features: all
 	cd ./src && $(MAKE) $(RECURSIVE_MAKE_ARGS) $@
 
@@ -355,6 +361,9 @@
 src/xemacs.def: $(srcdir)/src/xemacs.def.in.in
 	./config.status && touch $@
 
+src/.gdbinit: ${srcdir}/src/.gdbinit.in.in
+	./config.status && touch $@
+
 etc/PROBLEMS: $(srcdir)/PROBLEMS
 	cp $^ $@
 
@@ -367,7 +376,6 @@
 ## On AIX, use tar xBf.
 
 .PHONY: install-only install install-arch-dep install-arch-indep gzip.el mkdir
-.PHONY: check check-features
 
 ## We delete each directory in ${COPYDESTS} before we copy into it;
 ## that way, we can reinstall over directories that have been put in
@@ -738,3 +746,9 @@
 	for f in `file lib-src/* src/${PROGNAME} | grep ELF | sed -e 's/:.*//'`; do \
 	  mcs -da "$${ident} `echo $${f} | sed 's/.*\///'`" $${f}; \
 	done
+
+## Fix up permissions on source/build files
+.PHONY: fix-perms
+FRC.fix-perms:
+fix-perms: FRC.fix-perms
+	cd ${srcdir} && sh lib-src/fix-perms.sh
--- a/PROBLEMS	Wed Jan 20 07:05:57 2010 -0600
+++ b/PROBLEMS	Wed Feb 24 01:58:04 2010 -0600
@@ -60,7 +60,7 @@
 *** How do I configure to get the buffer tabs/progress bars?
 
 These features depend on support for "native widgets".  Use the
---enable-widgets option to configure.  Configuration of widgets is
+--with-widgets option to configure.  Configuration of widgets is
 automatic for "modern" toolkits (MS Windows, GTK, and Motif), but if
 you are using Xt and the Athena widgets, you will probably want to
 specify a "3d" widget set.  See configure --usage, and don't forget to
@@ -301,7 +301,7 @@
 Larry Auton <lda@control.att.com> writes:
 Beware of not specifying
 
-	--enable-dialogs=athena
+	--with-dialogs=athena
 
 if it builds with the motif dialogs [boom!] you're a dead man.
 
@@ -324,7 +324,7 @@
   defined in string.h - basically anything the compiler knows how to
   inline.)
 
-*** On AIX 4.3, you must specify --enable-dialogs=athena with configure
+*** On AIX 4.3, you must specify --with-dialogs=athena with configure
 
 *** The libXt shipped with AIX 4.3 up to 4.3.2 is broken.  This causes
     xemacs -nw to fail in various ways.  The official APAR is this:
@@ -392,7 +392,7 @@
 are caused by using GNU ld.  There are several workarounds available:
 
 In XEmacs 21.2 or later, configure using the new portable dumper
-(--enable-pdump).
+(--with-pdump).
 
 Alternatively, you can link using the Sun version of ld, which is
 normally held in /usr/ccs/bin.  This can be done by one of:
@@ -559,7 +559,7 @@
   passes the result to something that things foo_struct is a bit bigger,
   trashing memory....
 
-Here's typical crash backtrace.  With --enable-pdump, this occurs
+Here's typical crash backtrace.  With --with-pdump, this occurs
 usually at startup under X windows and xemacs -nw at least starts, while
 without --pdump a similar crash is observed during build.
 
@@ -582,7 +582,7 @@
 
 The MIPSpro Compiler (at least version 7.2.1) can't seem to handle the
 union type properly, and fails to compile src/glyphs.c.  To avoid this
-problem, always build --enable-union-type=no (but that's the default, so
+problem, always build --with-union-type=no (but that's the default, so
 you should only see this problem if you're an XEmacs maintainer).
 
 *** Linking with -rpath on IRIX.
@@ -711,7 +711,7 @@
 	/path_to_xemacs_source/configure --with-gcc=no \
 	  --with-site-includes=/usr/local/include \
           --with-site-libraries=/usr/local/lib \
-	  --with-xpm --with-xface --enable-sound=nas
+	  --with-xpm --with-xface --with-sound=nas
 
 This version now supports ELF builds.  I highly recommend this to
 reduce the in-core footprint of XEmacs.  This is now how I compile
@@ -720,7 +720,7 @@
 	/path_to_XEmacs_source/configure --with-gcc=no \
 	  --with-site-includes=/usr/local/include
           --with-site-libraries=/usr/local/lib \
-	  --with-xpm --with-xface --enable-sound=nas --with-dynamic
+	  --with-xpm --with-xface --with-sound=nas --with-dynamic
 
 The compiler known as icc [ supplied with the OpenServer 5 Development
 System ] generates a working binary, but it takes forever to generate
@@ -733,7 +733,7 @@
 	/path_to_XEmacs_source/configure --with-gcc=no \
 	  --with-site-includes=/usr/local/include \
           --with-site-libraries=/usr/local/lib \
-	  --with-xpm --with-xface --enable-sound=nas --with-dynamic \
+	  --with-xpm --with-xface --with-sound=nas --with-dynamic \
           --with-compiler="icc"
 
 NOTE I have the xpm, xface, and audio libraries and includes in
@@ -801,6 +801,8 @@
 
 *** Signal 11 when building or running a dumped XEmacs.
 
+Possibility #1:
+
 This appears to happen when using the traditional dumping mechanism and
 the system malloc.  Andy Piper writes:
 
@@ -810,6 +812,13 @@
 
 Try configuring with pdump or without system malloc.
 
+Possibility #2:
+
+Crashes when running a dumped XEmacs 21.5.29 have been observed circa
+January, 2010 in Cygwin 1.7 when configuring with C++, NEWGC and optimization
+(i.e. `--with-compiler=gcc --with-xemacs-compiler=g++ --with-mc-alloc
+--with-optimization').  Turning any one of these off produces a working build. 
+
 *** Syntax errors running configure scripts, make failing with exit code 127
     in inexplicable situations, etc.
 
@@ -1394,7 +1403,7 @@
 undefined symbols.
 
 The only known case in which this happens is if you are using gcc, you
-configured with --enable-error-checking=all and --enable-modules, and
+configured with --with-error-checking=all and --with-modules, and
 you compiled with no optimization.  If you encounter this problem in any
 other situation, please inform xemacs-beta@xemacs.org.
 
@@ -1647,14 +1656,14 @@
 that sorts the ELF reloc sections in the executable, giving dramatic
 speedups in startup for large executables.  It also confuses the
 traditional unexec code in XEmacs, leading to the core dump.  The
-solution is to use the --enable-pdump or --with-ldflags='-z nocombreloc'
+solution is to use the --with-pdump or --with-ldflags='-z nocombreloc'
 options to configure.  Recent 21.4 and 12.5 autodetect this in
 configure.
 
 Red Hat and SuSE (at least) distributed a prerelease version of ld
 (versions around 2.11.90.x.y) where autodetection is impossible.  The
 recommended procedure is to upgrade to binutils >= 2.12 and rerun
-configure.  Otherwise you must apply the flags by hand.  --enable-pdump
+configure.  Otherwise you must apply the flags by hand.  --with-pdump
 is recommended.
 
 *** I want XEmacs to use the Alt key, not the XXX key, for Meta commands
--- a/aclocal.m4	Wed Jan 20 07:05:57 2010 -0600
+++ b/aclocal.m4	Wed Feb 24 01:58:04 2010 -0600
@@ -513,10 +513,17 @@
 dnl usually need to be prefix with ${wl} or some other such thing.
 dnl
 
-if test "$xe_gnu_ld" = yes; then
-  if test "$ld_shlibs" = yes; then
+if test "$xe_gnu_ld" = yes -a "$ld_shlibs" = yes; then
+  case "$xehost_os" in
+  *cygwin* | *mingw* )
+    # -export-all-symbols is the PE equivalent of ELF-specific -export-dynamic
+    ld_dynamic_link_flags="${wl}-export-all-symbols"
+    ;;
+
+  *)  
     ld_dynamic_link_flags="${wl}-export-dynamic"
-  fi
+    ;;
+  esac
 fi
 
 if test -z "$ld_dynamic_link_flags"; then
--- a/configure	Wed Jan 20 07:05:57 2010 -0600
+++ b/configure	Wed Feb 24 01:58:04 2010 -0600
@@ -1,12 +1,14 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for XEmacs 21.5.
+# Generated by GNU Autoconf 2.65 for XEmacs 21.5.
 #
 # Report bugs to <xemacs-beta@xemacs.org>.
 #
+#
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
-# Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
 #
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
@@ -573,7 +575,8 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -709,6 +712,9 @@
 MAKE_SUBDIR
 INSTALL_ARCH_DEP_SUBDIR
 SRC_SUBDIR_DEPS
+ac_ct_CXX
+CXXFLAGS
+CXX
 have_esd_config
 ALLOCA
 canna_libs
@@ -1017,6 +1023,8 @@
 with_quantify
 enable_purify
 with_purify
+enable_valgrind
+with_valgrind
 with_x
 '
       ac_precious_vars='build_alias
@@ -1030,7 +1038,10 @@
 CPP
 YACC
 YFLAGS
-XMKMF'
+XMKMF
+CXX
+CXXFLAGS
+CCC'
 
 
 # Initialize some variables set by options.
@@ -1664,9 +1675,9 @@
                           flags inserted for warnings, debugging or
                           optimization; setting this does not disable the
                           insertion of those flags. Use configure settings
-                          such as `--with-optimization=no' or
-                          `enable-debug=no' to turn them off, or override them
-                          with `--with-cflags-optimization',
+                          such as `--with-optimization=no' or `with-debug=no'
+                          to turn them off, or override them with
+                          `--with-cflags-optimization',
                           `--with-cflags-debugging', or `with-cflags-warning'.
   --with-cflags-warning=FLAGS
                           Override compiler flags used to control warnings.
@@ -1778,8 +1789,7 @@
                           emulate Motif (mostly) but are faster. *WARNING* The
                           Motif menubar is currently broken. Lucid menubars
                           are the default.
-  --with-scrollbars=TYPE
-                          Use TYPE scrollbars 'yes', '`no', `lucid', `motif',
+  --with-scrollbars=TYPE  Use TYPE scrollbars 'yes', '`no', `lucid', `motif',
                           `athena', `gtk', or `msw'). Lucid scrollbars are the
                           default.
   --with-dialogs=TYPE     Use TYPE dialog boxes 'yes', '`no', `lucid',
@@ -1797,8 +1807,7 @@
                           GTK). *WARNING* The Drag'n'drop support is under
                           development and is considered experimental.
   --with-cde              Compile in support for CDE drag and drop.
-  --with-external-widget
-                          Support XEmacs server for text widgets in other
+  --with-external-widget  Support XEmacs server for text widgets in other
                           applications.
 
 TTY (character terminal) options
@@ -1859,8 +1868,8 @@
                           (proprietary). Requires Mule.
   --with-xfs              Enable XFontSet support for internationalized
                           menubar. Incompatible with `--with-xim=motif' and
-                          `--with-xft'. `--with-menubars=lucid'   (the
-                          default) is desirable.
+                          `--with-xft'. `--with-menubars=lucid' (the default)
+                          is desirable.
 
 File-related options
 --------------------
@@ -1870,8 +1879,7 @@
                           type when reading a file. Applies to those platforms
                           where auto-detection is off by default (non-Mule
                           Unix). Has no effect otherwise.
-  --with-clash-detection
-                          Disable use of lock files to detect multiple edits
+  --with-clash-detection  Disable use of lock files to detect multiple edits
                           of the same file.
   --with-zlib             Support inflate (de)compression internally.
 
@@ -1950,13 +1958,37 @@
 Debugging options
 -----------------
 
-  --with-debug            Enable additional debugging information. No time
-                          cost.
-  --with-error-checking=TESTS
+  --with-debug            Enable additional debugging information. No
+                          noticeable time cost (unlike
+                          `--with-error-checking'). This turns adds `-g' to
+                          the compiler options so that debug information is
+                          compiled into the XEmacs executable. It also turns
+                          on assert checks in the source code (i.e. same as
+                          `--with-assertions'); enables Lisp commands for
+                          determining detailed memory usage statistics (same
+                          as `--with-memory-usage-stats'); adds various Lisp
+                          variables and functions that allow one to display
+                          internal structures, show the internal workings of
+                          certain subsystems, and exit to the debugger; causes
+                          Lisp errors during building to exit to the debugger
+                          or dump core; and adds debugging-related C functions
+                          meant to be called from a debugger.
+  --with-error-checking=CLASS|all|none
                           Compile with internal error-checking added. Causes
-                          noticeable loss of speed. Valid TESTS are
-                          `byte_code', `display', `extents', `gc', `glyphs',
-                          `malloc', `structures' `text', `types'.
+                          noticeable loss of speed. Valid classes are
+                          `byte_code', `display' (redisplay), `extents', `gc'
+                          (garbage collection), `glyphs', `malloc' (memory
+                          allocation), `structures' (C structures), `text'
+                          (text handling and conversion), `types' (correct
+                          Lisp-object type for type-specific operations).
+                          `all' or `none' can be given to set all or no
+                          classes, respectively. Any of the classes can be
+                          prefixed with `no' to turn the class off. A
+                          comma-separated list of classes can also be given.
+                          For example, `all,nogc' turns on all but
+                          garbage-collection-related checking. Omitting any
+                          argument or specifying just `yes' is the same as
+                          `all'.
   --with-assertions       Compile in runtime assertions.
   --with-memory-usage-stats
                           Enable LISP memory usage API.
@@ -1974,6 +2006,7 @@
                           trigger bugs in some compilers.
   --with-quantify         Support performance debugging using Quantify.
   --with-purify           Support memory debugging using Purify.
+  --with-valgrind         Support memory debugging using Valgrind.
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1986,7 +2019,7 @@
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   YACC        The `Yet Another C Compiler' implementation to use. Defaults to
@@ -1995,6 +2028,8 @@
               This script will default YFLAGS to the empty string to avoid a
               default value of `-d' given by some make applications.
   XMKMF       Path to xmkmf, Makefile generator for X Window System
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2063,7 +2098,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 XEmacs configure 21.5
-generated by GNU Autoconf 2.64
+generated by GNU Autoconf 2.65
 
 Copyright (C) 2009 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -2156,7 +2191,7 @@
 	ac_retval=1
 fi
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
 
@@ -2193,7 +2228,7 @@
     ac_retval=1
 fi
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
 
@@ -2328,7 +2363,7 @@
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
 
@@ -2405,7 +2440,7 @@
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
@@ -2800,15 +2835,53 @@
 
   fi
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  return $ac_retval
+  as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by XEmacs $as_me 21.5, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
 
@@ -3061,7 +3134,7 @@
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test -r "$ac_site_file"; then
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
@@ -3070,9 +3143,9 @@
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
@@ -4360,7 +4433,7 @@
     eval "enable_sound_$y=\$_sound_${y}_default"
     unset _sound_${y}_default
 done
-enable_sound_nas=""
+with_sound_nas=""
 fi;
 # If --with-native-sound-lib or --without-native-sound-lib were given then copy the value to the
 # equivalent enable_native-sound-lib variable.
@@ -4612,7 +4685,7 @@
 unset _with_database_args _database_found x y _require_database
 
 
-if test "$enable_database_dbm"  = "yes" -a "$enable_database_gdbm" = "yes"; then
+if test "$with_database_dbm"  = "yes" -a "$with_database_gdbm" = "yes"; then
 	(echo "$progname: Usage error:"
 echo " " "Only one of \`dbm' and \`gdbm' may be specified
 with the \`--with-database' option."
@@ -4927,7 +5000,7 @@
   withval="$with_kkcc"
 
 else
-  enable_kkcc=yes
+  with_kkcc=yes
 fi;
 
 # If --with-newgc or --without-newgc were given then copy the value to the
@@ -5031,7 +5104,7 @@
     eval "enable_vdb_$y=\$_vdb_${y}_default"
     unset _vdb_${y}_default
 done
-enable_vdb="auto"
+with_vdb="auto"
 fi;
 
 # If --with-modules or --without-modules were given then copy the value to the
@@ -5081,7 +5154,7 @@
 
 
 else
-  enable_bignum="no"
+  with_bignum="no"
 fi;
 
 # If --with-workshop or --without-workshop were given then copy the value to the
@@ -5149,6 +5222,9 @@
   withval="$with_debug"
 
 fi;
+if test "$with_error_checking" = "yes"; then
+  with_error_checking=all
+fi
 _error_checking_notfirst=""
 _error_checking_byte_code_default=""
 _error_checking_display_default=""
@@ -5335,6 +5411,22 @@
   withval="$with_purify"
 
 fi;
+# If --with-valgrind or --without-valgrind were given then copy the value to the
+# equivalent enable_valgrind variable.
+if test "${with_valgrind+set}" = set; then
+  enable_valgrind="$with_valgrind"
+fi;
+# If -enable-valgrind or --disable-valgrind were given then copy the value to the
+# equivalent with_valgrind variable.
+if test "${enable_valgrind+set}" = set; then
+  with_valgrind="$enable_valgrind"
+fi;
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" = set; then
+  enableval="$with_valgrind"
+  withval="$with_valgrind"
+
+fi;
 
 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then
   test "$with_system_malloc" = "default" && with_system_malloc=yes
@@ -5662,33 +5754,33 @@
 
 
 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
-test "${enable_error_checking_extents:=$beta}"    = yes && $as_echo "#define ERROR_CHECK_EXTENTS 1" >>confdefs.h
-
-test "${enable_error_checking_types:=$beta}"      = yes && $as_echo "#define ERROR_CHECK_TYPES 1" >>confdefs.h
-
-test "${enable_error_checking_text:=$beta}"       = yes && $as_echo "#define ERROR_CHECK_TEXT 1" >>confdefs.h
-
-test "${enable_error_checking_gc:=$beta}"         = yes && $as_echo "#define ERROR_CHECK_GC 1" >>confdefs.h
-
-test "${enable_error_checking_malloc:=$beta}"     = yes && $as_echo "#define ERROR_CHECK_MALLOC 1" >>confdefs.h
-
-test "${enable_error_checking_byte_code:=$beta}"  = yes && $as_echo "#define ERROR_CHECK_BYTE_CODE 1" >>confdefs.h
-
-test "${enable_error_checking_glyphs:=$beta}"     = yes && $as_echo "#define ERROR_CHECK_GLYPHS 1" >>confdefs.h
-
-test "${enable_error_checking_display:=$beta}"    = yes && $as_echo "#define ERROR_CHECK_DISPLAY 1" >>confdefs.h
-
-test "${enable_error_checking_structures:=$beta}" = yes && $as_echo "#define ERROR_CHECK_STRUCTURES 1" >>confdefs.h
-
-if test "${enable_debug:=$beta}" = "yes"; then
-  enable_assertions=yes
-  enable_memory_usage_stats=yes
+test "${with_error_checking_extents:=$beta}"    = yes && $as_echo "#define ERROR_CHECK_EXTENTS 1" >>confdefs.h
+
+test "${with_error_checking_types:=$beta}"      = yes && $as_echo "#define ERROR_CHECK_TYPES 1" >>confdefs.h
+
+test "${with_error_checking_text:=$beta}"       = yes && $as_echo "#define ERROR_CHECK_TEXT 1" >>confdefs.h
+
+test "${with_error_checking_gc:=$beta}"         = yes && $as_echo "#define ERROR_CHECK_GC 1" >>confdefs.h
+
+test "${with_error_checking_malloc:=$beta}"     = yes && $as_echo "#define ERROR_CHECK_MALLOC 1" >>confdefs.h
+
+test "${with_error_checking_byte_code:=$beta}"  = yes && $as_echo "#define ERROR_CHECK_BYTE_CODE 1" >>confdefs.h
+
+test "${with_error_checking_glyphs:=$beta}"     = yes && $as_echo "#define ERROR_CHECK_GLYPHS 1" >>confdefs.h
+
+test "${with_error_checking_display:=$beta}"    = yes && $as_echo "#define ERROR_CHECK_DISPLAY 1" >>confdefs.h
+
+test "${with_error_checking_structures:=$beta}" = yes && $as_echo "#define ERROR_CHECK_STRUCTURES 1" >>confdefs.h
+
+if test "${with_debug:=$beta}" = "yes"; then
+  with_assertions=yes
+  with_memory_usage_stats=yes
   $as_echo "#define DEBUG_XEMACS 1" >>confdefs.h
 
 fi
-test "$enable_assertions"         = "yes" && $as_echo "#define USE_ASSERTIONS 1" >>confdefs.h
-
-test "$enable_memory_usage_stats" = "yes" && $as_echo "#define MEMORY_USAGE_STATS 1" >>confdefs.h
+test "$with_assertions"         = "yes" && $as_echo "#define USE_ASSERTIONS 1" >>confdefs.h
+
+test "$with_memory_usage_stats" = "yes" && $as_echo "#define MEMORY_USAGE_STATS 1" >>confdefs.h
 
 
 
@@ -5844,14 +5936,14 @@
 
 
 
-if test -z "$enable_pdump"; then
+if test -z "$with_pdump"; then
   case "$opsys" in
-    linux* )  enable_pdump=yes ;;              darwin )  enable_pdump=yes ;;              cygwin* ) enable_pdump=yes ;;              * )       enable_pdump=no ;;
-  esac
-fi
-
-if test "$enable_newgc" = "yes"; then
-  if test "$enable_vdb" = "auto"; then
+    linux* )  with_pdump=yes ;;              darwin )  with_pdump=yes ;;              cygwin* ) with_pdump=yes ;;              * )       with_pdump=no ;;
+  esac
+fi
+
+if test "$with_newgc" = "yes"; then
+  if test "$with_vdb" = "auto"; then
     case "$opsys" in
       darwin )  case "$machine" in
 		  i[3-9]86 ) check_vdb_posix=yes ;;
@@ -5865,7 +5957,7 @@
       * )       check_vdb_posix=yes ;;
     esac
   else
-    case "$enable_vdb" in
+    case "$with_vdb" in
       mach )  $as_echo "#define VDB_MACH 1" >>confdefs.h
   have_vdb_mach=yes ;;
       win32 ) $as_echo "#define VDB_WIN32 1" >>confdefs.h
@@ -5922,7 +6014,7 @@
 
 fi
 
-if test "$enable_clash_detection" != "no"; then
+if test "$with_clash_detection" != "no"; then
   $as_echo "#define CLASH_DETECTION 1" >>confdefs.h
 
 fi
@@ -6279,32 +6371,30 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
+
+int
+main ()
+{
 
   ;
   return 0;
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -6366,10 +6456,10 @@
 else
   ac_file=''
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
 if test -z "$ac_file"; then :
-  $as_echo "$as_me: failed program was:" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -6377,51 +6467,18 @@
 { as_fn_set_status 77
 as_fn_error "C compiler cannot create executables
 See \`config.log' for more details." "$LINENO" 5; }; }
-fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
 if { { ac_try="$ac_link"
@@ -6454,13 +6511,72 @@
 as_fn_error "cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." "$LINENO" 5; }
 fi
-rm -f conftest$ac_cv_exeext
+rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
 if test "${ac_cv_objext+set}" = set; then :
@@ -7519,8 +7635,8 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
@@ -8067,8 +8183,8 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
@@ -8615,8 +8731,8 @@
 ... rest of stderr output deleted ...
          10q' conftest.err >conftest.er1
     cat conftest.er1 >&5
-    rm -f conftest.er1 conftest.err
-  fi
+  fi
+  rm -f conftest.er1 conftest.err
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
@@ -8892,6 +9008,24 @@
 : ${XEMACS_CC:="$CC"}
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using g++" >&5
+$as_echo_n "checking whether we are using g++... " >&6; }
+
+XEMACS_CC_GPP=no
+case "$XEMACS_CC" in
+  *g++* ) XEMACS_CC_GPP=yes ;;
+esac
+
+if test "$XEMACS_CC_GPP" = "no" -a "$GCC" = "yes"; then
+  case "`$XEMACS_CC --version`" in
+    g++* ) XEMACS_CC_GPP=yes ;;
+  esac
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XEMACS_CC_GPP" >&5
+$as_echo "$XEMACS_CC_GPP" >&6; }
+
+
 test -n "$CPP" -a -d "$CPP" && CPP=
 
 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
@@ -9325,9 +9459,9 @@
 _ACEOF
 
 
-test -z "$unexec" && enable_pdump=yes
-
-if test "$enable_pdump" = "yes"; then
+test -z "$unexec" && with_pdump=yes
+
+if test "$with_pdump" = "yes"; then
   ordinary_link="yes"
   ld="${ordinary_ld}"
   start_files=
@@ -9336,20 +9470,20 @@
   lib_gcc=
 fi
 
-test -z "$enable_kkcc" && enable_kkcc=yes
-
-if test -z "$enable_dump_in_exec"; then
-  if test "$enable_pdump" = "yes"; then
-    if test "$enable_newgc" = "yes"; then
-      enable_dump_in_exec=no
+test -z "$with_kkcc" && with_kkcc=yes
+
+if test -z "$with_dump_in_exec"; then
+  if test "$with_pdump" = "yes"; then
+    if test "$with_newgc" = "yes"; then
+      with_dump_in_exec=no
     else
-      enable_dump_in_exec=yes
-    fi
-  fi
-fi
-
-if test "$enable_newgc" = "yes"; then
-  enable_kkcc=yes
+      with_dump_in_exec=yes
+    fi
+  fi
+fi
+
+if test "$with_newgc" = "yes"; then
+  with_kkcc=yes
 fi
 
 test "$verbose" = "yes" && \
@@ -9420,26 +9554,15 @@
 
 xemacs_cc_cc_mismatch=no
 if test "$CC" != "$XEMACS_CC"; then
-  case "$XEMACS_CC" in
-  *g++* )
-    if test "$GCC" != "yes"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CC and g++ are mismatched; XE_CFLAGS may be wrong" >&5
+  if test "$XEMACS_CC_GPP" = "yes" -a "$GCC" != "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CC and g++ are mismatched; XE_CFLAGS may be wrong" >&5
 $as_echo "$as_me: WARNING: CC and g++ are mismatched; XE_CFLAGS may be wrong" >&2;}
-      xemacs_cc_cc_mismatch=yes
-    fi
-    ;;
-  esac
-  if test -n "$GCC"; then
-    case $XEMACS_CC in
-    *g++* )
-      # it's as expected, do nothing
-      ;;
-    * )
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong" >&5
+    xemacs_cc_cc_mismatch=yes
+  fi
+  if test -n "$GCC" -a "$XEMACS_CC_GPP" != "yes" ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong" >&5
 $as_echo "$as_me: WARNING: gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong" >&2;}
-      xemacs_cc_cc_mismatch=yes
-      ;;
-    esac
+    xemacs_cc_cc_mismatch=yes
   fi
   fi
 
@@ -9462,10 +9585,10 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for preferred optimization flags" >&5
 $as_echo_n "checking for preferred optimization flags... " >&6; }
-if test "$with_optimization" = "yes" ; then
-  if test "$cflags_optimization_specified" = "no"; then
+if test "$cflags_optimization_specified" = "no"; then
+  if test "$with_optimization" = "yes" ; then
             if test "$GCC" = "yes"; then
-      with_cflags_optimization="-O3"
+                                    with_cflags_optimization="-O3 -fno-strict-aliasing"
     elif test "$__SUNPRO_C" = "yes"; then
       case "$opsys" in
         sol2    ) with_cflags_optimization="-xO4" ;;
@@ -9478,9 +9601,9 @@
       with_cflags_optimization="-O3 -Ob2"
         else
       with_cflags_optimization="-O" ;    fi
-  fi
-else
-  with_cflags_optimization=
+  elif test "$XEMACS_CC_GPP" = "yes" ; then
+                with_cflags_optimization="-fno-strict-aliasing"
+  fi
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_cflags_optimization}" >&5
@@ -9523,18 +9646,24 @@
     test "$__GCC" -ge 3 && with_cflags_warning="$with_cflags_warning -Wpacked"
             test "$have_glibc" != "yes" && \
       with_cflags_warning="$with_cflags_warning -Wpointer-arith"
-                                        if test "$with_xemacs_compiler" = "g++"; then
-      xe_cflags_warning="$with_cflags_warning -Weffc++"
-    elif test "$__GCC" -ge 3; then
-      xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+                                                                with_cflags_warning_c="-Wshadow -Wmissing-declarations"
+    with_cflags_warning_c="$with_cflags_warning_c -Wmissing-prototypes -Wstrict-prototypes"
+    with_cflags_warning_cxx="-Weffc++"
+    with_cflags_warning_c_xe=""
+                                if test "$__GCC" -ge 3; then
+      with_cflags_warning_c_xe="$with_cflags_warning_c_xe -Wunused-parameter"
       if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
-        with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement"
+        with_cflags_warning_c="$with_cflags_warning_c -Wdeclaration-after-statement"
       fi
     fi
-    with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
-    with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes"
-          elif test "$__ICC" = "yes"; then
-    with_cflags_warning="-Wall -w1 -we147"
+                            if test "$XEMACS_CC_GPP" = "yes"; then
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_cxx"
+    else
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_c $with_cflags_warning_c_xe"
+    fi
+    with_cflags_warning="$with_cflags_warning $with_cflags_warning_c"
+  elif test "$__ICC" = "yes"; then
+        with_cflags_warning="-Wall -w1 -we147"
     fi
 fi
 test -z "$xe_cflags_warning" && xe_cflags_warning="$with_cflags_warning"
@@ -9642,7 +9771,7 @@
 $as_echo "no" >&6; }
 fi
 
-if test "$enable_pdump" != "yes"; then
+if test "$with_pdump" != "yes"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"-z nocombreloc\" linker flag" >&5
 $as_echo_n "checking for \"-z nocombreloc\" linker flag... " >&6; }
   case "`ld --help 2>&1`" in
@@ -9726,10 +9855,10 @@
 test -n "$objects_system"  && extra_objs="$extra_objs $objects_system" &&  if test "$verbose" = "yes"; then
    echo "    xemacs will be linked with \"$objects_system\""
  fi
-test -n "$unexec"          && test ! "$enable_pdump" = "yes" && extra_objs="$extra_objs $unexec" &&  if test "$verbose" = "yes"; then
+test -n "$unexec"          && test ! "$with_pdump" = "yes" && extra_objs="$extra_objs $unexec" &&  if test "$verbose" = "yes"; then
    echo "    xemacs will be linked with \"$unexec\""
  fi
-test "$enable_pdump" = "yes" && extra_objs="$extra_objs dumper.o" &&  if test "$verbose" = "yes"; then
+test "$with_pdump" = "yes" && extra_objs="$extra_objs dumper.o" &&  if test "$verbose" = "yes"; then
    echo "    xemacs will be linked with \"dumper.o\""
  fi
 
@@ -11949,25 +12078,25 @@
 
       for feature in scrollbars toolbars menubars dialogs widgets
       do
-        eval "feature_value=\${enable_${feature}}"
+        eval "feature_value=\${with_${feature}}"
 	case "${feature_value}" in
 	yes|no|gtk|"" )
 	    ;;
 	* )
 	  feature_conflict_with_gtk=yes
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-${feature}=${feature_value} is incompatible with --with-gtk" >&5
-$as_echo "$as_me: WARNING: --enable-${feature}=${feature_value} is incompatible with --with-gtk" >&2;} ;;
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-${feature}=${feature_value} is incompatible with --with-gtk" >&5
+$as_echo "$as_me: WARNING: --with-${feature}=${feature_value} is incompatible with --with-gtk" >&2;} ;;
 	esac
       done
       if test "${feature_conflict_with_gtk}" = "yes"; then
 	{ echo "Error:" "One or more GUI toolkit features conflict with GTK" >&2; exit 1; }
       fi
 
-      test "${enable_scrollbars}" != "no" && enable_scrollbars=gtk
-      test "${enable_toolbars}" != "no" && enable_toolbars=gtk
-      test "${enable_menubars}" != "no" && enable_menubars=gtk
-      test "${enable_dialogs}" != "no" && enable_dialogs=gtk
-      test "${enable_widgets}" != "no" && enable_widgets=gtk
+      test "${with_scrollbars}" != "no" && with_scrollbars=gtk
+      test "${with_toolbars}" != "no" && with_toolbars=gtk
+      test "${with_menubars}" != "no" && with_menubars=gtk
+      test "${with_dialogs}" != "no" && with_dialogs=gtk
+      test "${with_widgets}" != "no" && with_widgets=gtk
 
             OLD_CFLAGS="${CFLAGS}"
       OLD_CPPFLAGS="${CPPFLAGS}"
@@ -13249,8 +13378,8 @@
 
 
   if test "${x11_release}" = "4"; then
-    case "$enable_widgets" in
-      "" | "no") enable_widgets=no ;;
+    case "$with_widgets" in
+      "" | "no") with_widgets=no ;;
       *) { echo "Error:" "Widget support requires X11R5 or greater" >&2; exit 1; } ;;
     esac
   fi
@@ -13625,7 +13754,7 @@
             with_fontconfig=yes
       $as_echo "#define HAVE_FONTCONFIG 1" >>confdefs.h
 
-      $as_echo "#define USE_XFT 1" >>confdefs.h
+      $as_echo "#define HAVE_XFT 1" >>confdefs.h
 
                   unset xft_includes_found
     fi
@@ -13689,11 +13818,11 @@
     fi
     if test "$window_system" != x11; then
       window_system=msw
-      test "$enable_scrollbars" != "no" && enable_scrollbars=msw
-      test "$enable_menubars"   != "no" && enable_menubars=msw
-      test "$enable_toolbars"   != "no" && enable_toolbars=msw
-      test "$enable_dialogs"    != "no" && enable_dialogs=msw
-      test "$enable_widgets"    != "no" && enable_widgets=msw
+      test "$with_scrollbars" != "no" && with_scrollbars=msw
+      test "$with_menubars"   != "no" && with_menubars=msw
+      test "$with_toolbars"   != "no" && with_toolbars=msw
+      test "$with_dialogs"    != "no" && with_dialogs=msw
+      test "$with_widgets"    != "no" && with_widgets=msw
     fi
         if test "$cross_compiling" = yes; then :
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -13725,14 +13854,14 @@
 if test "$window_system" = "none"; then
   for feature in menubars scrollbars toolbars dialogs dragndrop xface
   do
-    if eval "test -n \"\$enable_${feature}\" -a \"\$enable_${feature}\" != no" ; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-$feature ignored:  Not valid without window system support" >&5
-$as_echo "$as_me: WARNING: --enable-$feature ignored:  Not valid without window system support" >&2;}
-    fi
-    eval "enable_${feature}=no"
-  done
-else
-  test -z "$enable_toolbars" && enable_toolbars=yes
+    if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-$feature ignored:  Not valid without window system support" >&5
+$as_echo "$as_me: WARNING: --with-$feature ignored:  Not valid without window system support" >&2;}
+    fi
+    eval "with_${feature}=no"
+  done
+else
+  test -z "$with_toolbars" && with_toolbars=yes
 fi
 
 if test "$with_msw" != "yes"; then
@@ -13749,7 +13878,7 @@
 fi
 
 if test "$with_x11" != "yes"; then
-            for feature in with_tooltalk with_cde with_wmcommand with_xim enable_sound_nas
+            for feature in with_tooltalk with_cde with_wmcommand with_xim with_sound_nas
   do
     if eval "test -n \"\$${feature}\" -a \"\$${feature}\" != \"no\"" ; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --$feature ignored:  Not valid without X support" >&5
@@ -13866,14 +13995,14 @@
 
 
 
-if test "$with_xemacs_compiler" = "g++"; then
+if test "$XEMACS_CC_GPP" = "yes"; then
   LIBSTDCPP=-lstdc++
 else
   LIBSTDCPP=
 fi
 
 
-if test "$enable_modules" != "no"; then
+if test "$with_modules" != "no"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for module support" >&5
 $as_echo_n "checking for module support... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
@@ -14538,10 +14667,17 @@
 fi # End of if cc_produces_so = no
 
 
-if test "$xe_gnu_ld" = yes; then
-  if test "$ld_shlibs" = yes; then
+if test "$xe_gnu_ld" = yes -a "$ld_shlibs" = yes; then
+  case "$xehost_os" in
+  *cygwin* | *mingw* )
+    # -export-all-symbols is the PE equivalent of ELF-specific -export-dynamic
+    ld_dynamic_link_flags="${wl}-export-all-symbols"
+    ;;
+
+  *)
     ld_dynamic_link_flags="${wl}-export-dynamic"
-  fi
+    ;;
+  esac
 fi
 
 if test -z "$ld_dynamic_link_flags"; then
@@ -14630,22 +14766,22 @@
 fi
 done
 
-    enable_modules=yes
+    with_modules=yes
     MOD_CC="../../lib-src/ellcc"
     MODCFLAGS="\$(CFLAGS) --mode=compile --mod-output=\$@ -I../../src -I\$(srcdir)/../../src"
     INSTALLPATH="\$(moduledir)"
     MOD_INSTALL_PROGRAM=${INSTALL_PROGRAM}
     OBJECT_TO_BUILD="\$(MODNAME).ell"
   else
-    if test "$enable_modules" = "yes"; then
+    if test "$with_modules" = "yes"; then
       { echo "Error:" "Required module support cannot be provided." >&2; exit 1; }
     else
       echo "    No module support."
     fi
-    enable_modules=no
-  fi
-fi
-if test "$enable_modules" != "yes"; then
+    with_modules=no
+  fi
+fi
+if test "$with_modules" != "yes"; then
   MOD_CC="$XEMACS_CC"
   MODCFLAGS="\$(XE_CFLAGS) -I../../src -I\$(srcdir)/../../src"
   INSTALLPATH=""
@@ -14654,7 +14790,7 @@
 fi
 MODARCHDIR=
 MAKE_DOCFILE="../../lib-src/make-docfile"
-with_modules=$enable_modules
+with_modules=$with_modules
 
 
 
@@ -15090,7 +15226,7 @@
   LIBS="$save_LIBS"
   MAKE_SUBDIR="$MAKE_SUBDIR modules/ldap" &&  if test "$verbose" = "yes"; then echo "    Appending \"modules/ldap\" to \$MAKE_SUBDIR"; fi
   need_modules_common=yes
-  if test "$enable_modules" = "yes"; then
+  if test "$with_modules" = "yes"; then
     INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR modules/ldap" &&  if test "$verbose" = "yes"; then echo "    Appending \"modules/ldap\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
   fi
 fi
@@ -15263,7 +15399,7 @@
     postgresql_libs="$pq_libs $postgresql_libs" &&  if test "$verbose" = "yes"; then echo "    Prepending \"$pq_libs\" to \$postgresql_libs"; fi
     MAKE_SUBDIR="$MAKE_SUBDIR modules/postgresql" &&  if test "$verbose" = "yes"; then echo "    Appending \"modules/postgresql\" to \$MAKE_SUBDIR"; fi
     need_modules_common=yes
-    if test "$enable_modules" = "yes"; then
+    if test "$with_modules" = "yes"; then
       INSTALL_ARCH_DEP_SUBDIR="$INSTALL_ARCH_DEP_SUBDIR modules/postgresql" &&  if test "$verbose" = "yes"; then echo "    Appending \"modules/postgresql\" to \$INSTALL_ARCH_DEP_SUBDIR"; fi
     fi
   elif test "$with_postgresql" = "yes"; then
@@ -15965,12 +16101,12 @@
 $as_echo "" >&6; }
 fi
 
-case "$enable_widgets" in
+case "$with_widgets" in
   "" | "yes" | "athena")	detect_athena=yes ;;
    *)				detect_athena=no ;;
 esac
 
-case "$enable_dialogs" in
+case "$with_dialogs" in
   "" | "yes" | "athena")	detect_athena=yes ;;
 esac
 
@@ -16400,8 +16536,8 @@
   * )        lucid_prefers_motif="yes" ;;
 esac
 
-case "$enable_menubars" in "" | "yes" | "athena" )
-  enable_menubars="lucid" ;;
+case "$with_menubars" in "" | "yes" | "athena" )
+  with_menubars="lucid" ;;
 esac
 if test "$with_xft_menubars" != "no" ; then
   if test "$with_xft_emacs" = "yes" -a "$with_menubars" != "no" ; then
@@ -16410,55 +16546,55 @@
     with_xft_menubars="no"
   fi
 fi
-case "$enable_dialogs" in "" | "yes" | "lucid" )
+case "$with_dialogs" in "" | "yes" | "lucid" )
   if test "$lucid_prefers_motif" = "yes"; then
-    if   test "$have_motif"     = "yes"; then enable_dialogs="motif"
-    elif test "$have_xaw"       = "yes"; then enable_dialogs="athena"
-    elif test "$with_msw"       = "yes"; then enable_dialogs="msw"
-    else enable_dialogs=no
-    fi
-  else
-    if   test "$have_xaw"       = "yes"; then enable_dialogs="athena"
-    elif test "$have_motif"     = "yes"; then enable_dialogs="motif"
-    elif test "$with_msw"       = "yes"; then enable_dialogs="msw"
-    else enable_dialogs=no
+    if   test "$have_motif"     = "yes"; then with_dialogs="motif"
+    elif test "$have_xaw"       = "yes"; then with_dialogs="athena"
+    elif test "$with_msw"       = "yes"; then with_dialogs="msw"
+    else with_dialogs=no
+    fi
+  else
+    if   test "$have_xaw"       = "yes"; then with_dialogs="athena"
+    elif test "$have_motif"     = "yes"; then with_dialogs="motif"
+    elif test "$with_msw"       = "yes"; then with_dialogs="msw"
+    else with_dialogs=no
     fi
   fi ;;
 esac
-case "$enable_scrollbars" in "" | "yes" )
-  enable_scrollbars="lucid" ;;
-esac
-case "$enable_widgets" in "" | "yes" | "lucid")
+case "$with_scrollbars" in "" | "yes" )
+  with_scrollbars="lucid" ;;
+esac
+case "$with_widgets" in "" | "yes" | "lucid")
   if test "$lucid_prefers_motif" = "yes"; then
-    if   test "$have_motif" = "yes"; then enable_widgets="motif"
-    elif test "$have_xaw"   = "yes"; then enable_widgets="athena"
-    elif test "$with_msw"   = "yes"; then enable_widgets="msw"
-    else enable_widgets=no
-    fi
-  else
-    if   test "$have_xaw"   = "yes"; then enable_widgets="athena"
-    elif test "$have_motif" = "yes"; then enable_widgets="motif"
-    elif test "$with_msw"   = "yes"; then enable_widgets="msw"
-    else enable_widgets=no
+    if   test "$have_motif" = "yes"; then with_widgets="motif"
+    elif test "$have_xaw"   = "yes"; then with_widgets="athena"
+    elif test "$with_msw"   = "yes"; then with_widgets="msw"
+    else with_widgets=no
+    fi
+  else
+    if   test "$have_xaw"   = "yes"; then with_widgets="athena"
+    elif test "$have_motif" = "yes"; then with_widgets="motif"
+    elif test "$with_msw"   = "yes"; then with_widgets="msw"
+    else with_widgets=no
     fi
   fi ;;
 esac
 if test "$with_xft_tabs" != "no" ; then
-  if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then
+  if test "$with_xft_emacs" = "yes" -a "$with_widgets" != "no" ; then
     with_xft_tabs="yes"
   else
     with_xft_tabs="no"
   fi
 fi
 if test "$with_xft_gauges" != "no" ; then
-  if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then
+  if test "$with_xft_emacs" = "yes" -a "$with_widgets" != "no" ; then
     with_xft_gauges="yes"
   else
     with_xft_gauges="no"
   fi
 fi
 
-all_widgets="$enable_menubars $enable_scrollbars $enable_dialogs $enable_toolbars $enable_widgets"
+all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
 
 case "$all_widgets" in
   *athena* )
@@ -16533,12 +16669,12 @@
   need_motif=yes ;;
 esac
 
-test "$enable_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
-test "$enable_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
-test "$enable_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
-test "$enable_widgets"   != "no" && test "$enable_widgets" != "msw" && \
+test "$with_menubars"   = "lucid" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
+test "$with_menubars"   = "motif" && lwlib_objs="$lwlib_objs xlwmenu.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwmenu.o\" to \$lwlib_objs"; fi
+test "$with_scrollbars" = "lucid" && lwlib_objs="$lwlib_objs xlwscrollbar.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwscrollbar.o\" to \$lwlib_objs"; fi
+test "$with_widgets"   != "no" && test "$with_widgets" != "msw" && \
 	lwlib_objs="$lwlib_objs xlwtabs.o xlwgcs.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwtabs.o xlwgcs.o\" to \$lwlib_objs"; fi
-case "$enable_widgets" in athena* )
+case "$with_widgets" in athena* )
 	lwlib_objs="$lwlib_objs xlwradio.o xlwcheckbox.o xlwgauge.o" &&  if test "$verbose" = "yes"; then echo "    Appending \"xlwradio.o xlwcheckbox.o xlwgauge.o\" to \$lwlib_objs"; fi;;
 esac
 case "$all_widgets" in *lucid* )
@@ -16549,61 +16685,61 @@
 
 
 
-test "$enable_scrollbars" = "athena" && $as_echo "#define LWLIB_SCROLLBARS_ATHENA 1" >>confdefs.h
-
-test "$enable_dialogs"    = "athena" && $as_echo "#define LWLIB_DIALOGS_ATHENA 1" >>confdefs.h
+test "$with_scrollbars" = "athena" && $as_echo "#define LWLIB_SCROLLBARS_ATHENA 1" >>confdefs.h
+
+test "$with_dialogs"    = "athena" && $as_echo "#define LWLIB_DIALOGS_ATHENA 1" >>confdefs.h
 
 
 if test "$athena_3d" = "yes"; then
-  test "$enable_scrollbars" = "athena" && $as_echo "#define LWLIB_SCROLLBARS_ATHENA3D 1" >>confdefs.h
-
-  test "$enable_dialogs"    = "athena" && $as_echo "#define LWLIB_DIALOGS_ATHENA3D 1" >>confdefs.h
-
-fi
-
-case "$enable_widgets" in athena* ) $as_echo "#define LWLIB_WIDGETS_ATHENA 1" >>confdefs.h
+  test "$with_scrollbars" = "athena" && $as_echo "#define LWLIB_SCROLLBARS_ATHENA3D 1" >>confdefs.h
+
+  test "$with_dialogs"    = "athena" && $as_echo "#define LWLIB_DIALOGS_ATHENA3D 1" >>confdefs.h
+
+fi
+
+case "$with_widgets" in athena* ) $as_echo "#define LWLIB_WIDGETS_ATHENA 1" >>confdefs.h
 ;; esac
-test "$enable_widgets" != "no" && test "$enable_widgets" != "msw" && \
+test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
 	$as_echo "#define LWLIB_TABS_LUCID 1" >>confdefs.h
 
 
-test "$enable_menubars"   != "no"    && $as_echo "#define HAVE_MENUBARS 1" >>confdefs.h
-
-test "$enable_scrollbars" != "no"    && $as_echo "#define HAVE_SCROLLBARS 1" >>confdefs.h
-
-test "$enable_dialogs"    != "no"    && $as_echo "#define HAVE_DIALOGS 1" >>confdefs.h
-
-test "$enable_toolbars"   != "no"    && $as_echo "#define HAVE_TOOLBARS 1" >>confdefs.h
-
-test "$enable_widgets"    != "no"    && $as_echo "#define HAVE_WIDGETS 1" >>confdefs.h
-
-
-test "$enable_menubars"   = "lucid"  && $as_echo "#define LWLIB_MENUBARS_LUCID 1" >>confdefs.h
-
-test "$enable_scrollbars" = "lucid"  && $as_echo "#define LWLIB_SCROLLBARS_LUCID 1" >>confdefs.h
-
-
-test "$enable_menubars"   = "motif"  && $as_echo "#define LWLIB_MENUBARS_MOTIF 1" >>confdefs.h
-
-test "$enable_scrollbars" = "motif"  && $as_echo "#define LWLIB_SCROLLBARS_MOTIF 1" >>confdefs.h
-
-test "$enable_dialogs"    = "motif"  && $as_echo "#define LWLIB_DIALOGS_MOTIF 1" >>confdefs.h
-
-test "$enable_widgets"    = "motif"  && $as_echo "#define LWLIB_WIDGETS_MOTIF 1" >>confdefs.h
-
-
-test "$with_xft_menubars" = "yes"  && $as_echo "#define USE_XFT_MENUBARS 1" >>confdefs.h
-
-test "$with_xft_tabs" = "yes"  && $as_echo "#define USE_XFT_TABS 1" >>confdefs.h
-
-test "$with_xft_gauges" = "yes"  && $as_echo "#define USE_XFT_GAUGES 1" >>confdefs.h
-
-
-
-test -z "$enable_mule" && enable_mule=no
-
-
-if test "$enable_default_eol_detection" = "yes"; then
+test "$with_menubars"   != "no"    && $as_echo "#define HAVE_MENUBARS 1" >>confdefs.h
+
+test "$with_scrollbars" != "no"    && $as_echo "#define HAVE_SCROLLBARS 1" >>confdefs.h
+
+test "$with_dialogs"    != "no"    && $as_echo "#define HAVE_DIALOGS 1" >>confdefs.h
+
+test "$with_toolbars"   != "no"    && $as_echo "#define HAVE_TOOLBARS 1" >>confdefs.h
+
+test "$with_widgets"    != "no"    && $as_echo "#define HAVE_WIDGETS 1" >>confdefs.h
+
+
+test "$with_menubars"   = "lucid"  && $as_echo "#define LWLIB_MENUBARS_LUCID 1" >>confdefs.h
+
+test "$with_scrollbars" = "lucid"  && $as_echo "#define LWLIB_SCROLLBARS_LUCID 1" >>confdefs.h
+
+
+test "$with_menubars"   = "motif"  && $as_echo "#define LWLIB_MENUBARS_MOTIF 1" >>confdefs.h
+
+test "$with_scrollbars" = "motif"  && $as_echo "#define LWLIB_SCROLLBARS_MOTIF 1" >>confdefs.h
+
+test "$with_dialogs"    = "motif"  && $as_echo "#define LWLIB_DIALOGS_MOTIF 1" >>confdefs.h
+
+test "$with_widgets"    = "motif"  && $as_echo "#define LWLIB_WIDGETS_MOTIF 1" >>confdefs.h
+
+
+test "$with_xft_menubars" = "yes"  && $as_echo "#define HAVE_XFT_MENUBARS 1" >>confdefs.h
+
+test "$with_xft_tabs" = "yes"  && $as_echo "#define HAVE_XFT_TABS 1" >>confdefs.h
+
+test "$with_xft_gauges" = "yes"  && $as_echo "#define HAVE_XFT_GAUGES 1" >>confdefs.h
+
+
+
+test -z "$with_mule" && with_mule=no
+
+
+if test "$with_default_eol_detection" = "yes"; then
   $as_echo "#define HAVE_DEFAULT_EOL_DETECTION 1" >>confdefs.h
 
 fi
@@ -16611,7 +16747,7 @@
 canna_libs=
 wnn_libs=
 
-if test "$enable_mule" = "yes" ; then
+if test "$with_mule" = "yes" ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mule-related features" >&5
 $as_echo_n "checking for Mule-related features... " >&6; }
   $as_echo "#define MULE 1" >>confdefs.h
@@ -16874,7 +17010,7 @@
   with_xfs=no
 fi
 
-    if test "$with_xfs" = "yes" && test "$enable_menubars" = "lucid"; then
+    if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
       $as_echo "#define USE_XFONTSET 1" >>confdefs.h
 
       if test "$with_xim" = "no" ; then
@@ -17436,6 +17572,21 @@
 
 fi
 
+case "$opsys" in
+  *cygwin* ) for ac_func in cygwin_conv_path
+do :
+  ac_fn_c_check_func "$LINENO" "cygwin_conv_path" "ac_cv_func_cygwin_conv_path"
+if test "x$ac_cv_func_cygwin_conv_path" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_CYGWIN_CONV_PATH 1
+_ACEOF
+
+fi
+done
+
+	 ;;
+esac
+
 
 for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp fsync ftime ftruncate getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setsid sigblock sighold sigprocmask snprintf strerror strlwr strupr symlink tzset ulimit umask usleep vlimit vsnprintf waitpid wcscmp wcslen
 do :
@@ -18687,9 +18838,9 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
 $as_echo "" >&6; }
 
-test -n "$with_native_sound_lib" && enable_sound_native=yes
-
-if test "$enable_sound_native" != "no"; then
+test -n "$with_native_sound_lib" && with_sound_native=yes
+
+if test "$with_sound_native" != "no"; then
     if test -n "$with_native_sound_lib"; then
     ac_fn_c_check_header_mongrel "$LINENO" "multimedia/audio_device.h" "ac_cv_header_multimedia_audio_device_h" "$ac_includes_default"
 if test "x$ac_cv_header_multimedia_audio_device_h" = x""yes; then :
@@ -18924,23 +19075,23 @@
   fi
 
   if test "$sound_found" = "yes"; then
-    enable_sound_native=yes
-  else
-    if test "$enable_sound_native" = "yes" ; then
+    with_sound_native=yes
+  else
+    if test "$with_sound_native" = "yes" ; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No native libraries found.  Disabling native sound support." >&5
 $as_echo "$as_me: WARNING: No native libraries found.  Disabling native sound support." >&2;}
     fi
-    enable_sound_native=no
-  fi
-fi
-
-if test "$enable_sound_native" = "yes"; then
+    with_sound_native=no
+  fi
+fi
+
+if test "$with_sound_native" = "yes"; then
   $as_echo "#define HAVE_NATIVE_SOUND 1" >>confdefs.h
 
   test -n "$with_native_sound_lib" && LIBS="$with_native_sound_lib $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"$with_native_sound_lib\" to \$LIBS"; fi
 fi
 
-if test "$enable_sound_alsa" != "no"; then
+if test "$with_sound_alsa" != "no"; then
   ac_fn_c_check_header_mongrel "$LINENO" "alsa/input.h" "ac_cv_header_alsa_input_h" "$ac_includes_default"
 if test "x$ac_cv_header_alsa_input_h" = x""yes; then :
 
@@ -18988,7 +19139,7 @@
 
 
   if test "$have_alsa_sound" = "yes"; then
-    enable_sound_alsa=yes
+    with_sound_alsa=yes
     $as_echo "#define HAVE_ALSA_SOUND 1" >>confdefs.h
 
     extra_objs="$extra_objs alsaplay.o" &&  if test "$verbose" = "yes"; then
@@ -18996,13 +19147,13 @@
  fi
     LIBS="-lasound $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-lasound\" to \$LIBS"; fi
   else
-    test "$enable_sound_alsa" = "yes" && \
+    test "$with_sound_alsa" = "yes" && \
       { echo "Error:" "Required ALSA sound support cannot be provided." >&2; exit 1; }
-    enable_sound_alsa=no
-  fi
-fi
-
-if test "$enable_sound_nas" != "no"; then
+    with_sound_alsa=no
+  fi
+fi
+
+if test "$with_sound_nas" != "no"; then
   ac_fn_c_check_header_mongrel "$LINENO" "audio/audiolib.h" "ac_cv_header_audio_audiolib_h" "$ac_includes_default"
 if test "x$ac_cv_header_audio_audiolib_h" = x""yes; then :
 
@@ -19050,7 +19201,7 @@
 
 
   if test "$have_nas_sound" = "yes"; then
-    enable_sound_nas=yes
+    with_sound_nas=yes
     $as_echo "#define HAVE_NAS_SOUND 1" >>confdefs.h
 
     extra_objs="$extra_objs nas.o" &&  if test "$verbose" = "yes"; then
@@ -19072,13 +19223,13 @@
 rm -f conftest*
 
   else
-    test "$enable_sound_nas" = "yes" && \
+    test "$with_sound_nas" = "yes" && \
       { echo "Error:" "Required NAS sound support cannot be provided." >&2; exit 1; }
-    enable_sound_nas=no
-  fi
-fi
-
-if test "$enable_sound_esd" != "no"; then
+    with_sound_nas=no
+  fi
+fi
+
+if test "$with_sound_esd" != "no"; then
   # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -19131,7 +19282,7 @@
   fi
 
   if test "$have_esd_sound" = "yes"; then
-    enable_sound_esd=yes
+    with_sound_esd=yes
     need_miscplay=yes
     extra_objs="$extra_objs esd.o" &&  if test "$verbose" = "yes"; then
    echo "    xemacs will be linked with \"esd.o\""
@@ -19139,9 +19290,9 @@
     $as_echo "#define HAVE_ESD_SOUND 1" >>confdefs.h
 
   else
-    test "$enable_sound_esd" = "yes" && \
+    test "$with_sound_esd" = "yes" && \
       { echo "Error:" "Required ESD sound support cannot be provided." >&2; exit 1; }
-    enable_sound_esd=no
+    with_sound_esd=no
   fi
 fi
 
@@ -19464,13 +19615,13 @@
   done
 fi
 
-test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \
+test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
   != "no no no" && { $as_echo "$as_me:${as_lineno-$LINENO}: checking for database support" >&5
 $as_echo_n "checking for database support... " >&6; } && \
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
 $as_echo "" >&6; }
 
-if test "$enable_database_gdbm $enable_database_dbm" != "no no"; then
+if test "$with_database_gdbm $with_database_dbm" != "no no"; then
   ndbm_h_file=""
   for ac_header in ndbm.h gdbm/ndbm.h
 do :
@@ -19487,14 +19638,14 @@
 done
 
   if test "x$ndbm_h_file" = "x"; then
-    test "$enable_database_gdbm" = "yes" -o \
-         "$enable_database_dbm"  = "yes" && \
+    test "$with_database_gdbm" = "yes" -o \
+         "$with_database_dbm"  = "yes" && \
       { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
-    enable_database_gdbm=no enable_database_dbm=no]
-  fi
-fi
-
-if test "$enable_database_gdbm" != "no"; then
+    with_database_gdbm=no with_database_dbm=no]
+  fi
+fi
+
+if test "$with_database_gdbm" != "no"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbm_open in -lgdbm" >&5
 $as_echo_n "checking for dbm_open in -lgdbm... " >&6; }
 if test "${ac_cv_lib_gdbm_dbm_open+set}" = set; then :
@@ -19533,7 +19684,7 @@
 $as_echo "$ac_cv_lib_gdbm_dbm_open" >&6; }
 if test "x$ac_cv_lib_gdbm_dbm_open" = x""yes; then :
 
-   enable_database_gdbm=yes enable_database_dbm=no libdbm=-lgdbm
+   with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm
 else
 
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbm_open in -lgdbm_compat" >&5
@@ -19574,24 +19725,24 @@
 $as_echo "$ac_cv_lib_gdbm_compat_dbm_open" >&6; }
 if test "x$ac_cv_lib_gdbm_compat_dbm_open" = x""yes; then :
 
-       enable_database_gdbm=yes enable_database_dbm=no libdbm="-lgdbm_compat -lgdbm"
-else
-
-   if test "$enable_database_gdbm" = "yes"; then
+       with_database_gdbm=yes with_database_dbm=no libdbm="-lgdbm_compat -lgdbm"
+else
+
+   if test "$with_database_gdbm" = "yes"; then
      { echo "Error:" "Required GNU DBM support cannot be provided." >&2; exit 1; }
    fi
-   enable_database_gdbm=no
-fi
-
-
-fi
-
-fi
-
-if test "$enable_database_dbm" != "no"; then
+   with_database_gdbm=no
+fi
+
+
+fi
+
+fi
+
+if test "$with_database_dbm" != "no"; then
   ac_fn_c_check_func "$LINENO" "dbm_open" "ac_cv_func_dbm_open"
 if test "x$ac_cv_func_dbm_open" = x""yes; then :
-  enable_database_dbm=yes libdbm=
+  with_database_dbm=yes libdbm=
 else
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbm_open in -ldbm" >&5
@@ -19631,12 +19782,12 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbm_dbm_open" >&5
 $as_echo "$ac_cv_lib_dbm_dbm_open" >&6; }
 if test "x$ac_cv_lib_dbm_dbm_open" = x""yes; then :
-  enable_database_dbm=yes libdbm=-ldbm
-else
-
-      test "$enable_database_dbm" = "yes" && \
+  with_database_dbm=yes libdbm=-ldbm
+else
+
+      test "$with_database_dbm" = "yes" && \
         { echo "Error:" "Required DBM support cannot be provided." >&2; exit 1; }
-      enable_database_dbm=no
+      with_database_dbm=no
 fi
 
 fi
@@ -19644,14 +19795,328 @@
 fi
 
 test -n "$libdbm" && LIBS=""$libdbm" $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \""$libdbm"\" to \$LIBS"; fi
-if test "$enable_database_gdbm" = "yes" -o \
-        "$enable_database_dbm"  = "yes"; then
+if test "$with_database_gdbm" = "yes" -o \
+        "$with_database_dbm"  = "yes"; then
   cat >>confdefs.h <<_ACEOF
 #define NDBM_H_FILE "$ndbm_h_file"
 _ACEOF
 
   $as_echo "#define HAVE_DBM 1" >>confdefs.h
 
+        if test "$XEMACS_CC_GPP" = "yes"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
+$as_echo "" >&6; }
+    ac_ext=c
+xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
+xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
+xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
+ac_cpp='$CPP '"$xe_cppflags"
+ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
+ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+    ac_ext=c
+xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
+xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
+xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
+ac_cpp='$CPP '"$xe_cppflags"
+ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
+ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
+xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
+xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
+ac_cpp='$CPP '"$xe_cppflags"
+ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
+ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "$ndbm_h_file"
+int
+main ()
+{
+dbm_close((DBM *) 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ndbm.h is compatible with g++" >&5
+$as_echo_n "checking whether ndbm.h is compatible with g++... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       $as_echo "#define TRUST_NDBM_H_PROTOTYPES 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ndbm.h is compatible with g++" >&5
+$as_echo_n "checking whether ndbm.h is compatible with g++... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    ac_ext=c
+xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
+xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
+xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
+ac_cpp='$CPP '"$xe_cppflags"
+ac_compile='$CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  else
+    $as_echo "#define TRUST_NDBM_H_PROTOTYPES 1" >>confdefs.h
+
+  fi
   $as_unset ndbm_h_file
 fi
 
@@ -19684,7 +20149,7 @@
 fi
 
 
-if test "$enable_database_berkdb" != "no"; then
+if test "$with_database_berkdb" != "no"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley db.h" >&5
 $as_echo_n "checking for Berkeley db.h... " >&6; }
   for header in "db/db.h" "db.h"; do
@@ -19722,12 +20187,12 @@
   done
   if test -z "$db_h_file"
   then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }; enable_database_berkdb=no
+$as_echo "no" >&6; }; with_database_berkdb=no
   else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $db_h_file" >&5
 $as_echo "$db_h_file" >&6; }
   fi
 
-  if test "$enable_database_berkdb" != "no"; then
+  if test "$with_database_berkdb" != "no"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Berkeley DB version" >&5
 $as_echo_n "checking for Berkeley DB version... " >&6; }
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -19787,7 +20252,7 @@
 ac_fn_c_check_func "$LINENO" "$dbfunc" "$as_ac_var"
 eval as_val=\$$as_ac_var
    if test "x$as_val" = x""yes; then :
-  enable_database_berkdb=yes need_libdb=no
+  with_database_berkdb=yes need_libdb=no
 else
 
     as_ac_Lib=`$as_echo "ac_cv_lib_db_$dbfunc" | $as_tr_sh`
@@ -19830,14 +20295,14 @@
 $as_echo "$ac_res" >&6; }
 eval as_val=\$$as_ac_Lib
    if test "x$as_val" = x""yes; then :
-  enable_database_berkdb=yes need_libdb=yes
-fi
-
-fi
-
-  fi
-
-    if test "$enable_database_berkdb" = "yes" -a "$dbver" = "4"; then
+  with_database_berkdb=yes need_libdb=yes
+fi
+
+fi
+
+  fi
+
+    if test "$with_database_berkdb" = "yes" -a "$dbver" = "4"; then
     rm -f $tempcname
     echo "#include <$db_h_file>" > $tempcname
     echo "configure___ dbfunc=db_create" >> $tempcname
@@ -19886,12 +20351,12 @@
 $as_echo "$ac_res" >&6; }
 eval as_val=\$$as_ac_Lib
    if test "x$as_val" = x""yes; then :
-  enable_database_berkdb=yes need_libdb=yes
-fi
-
-  fi
-
-  if test "$enable_database_berkdb" = "yes"; then
+  with_database_berkdb=yes need_libdb=yes
+fi
+
+  fi
+
+  if test "$with_database_berkdb" = "yes"; then
     cat >>confdefs.h <<_ACEOF
 #define DB_H_FILE "$db_h_file"
 _ACEOF
@@ -19899,11 +20364,11 @@
     $as_echo "#define HAVE_BERKELEY_DB 1" >>confdefs.h
 
     test "$need_libdb" = "yes" && LIBS="-ldb $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-ldb\" to \$LIBS"; fi
-  else enable_database_berkdb=no
-  fi
-fi
-
-if test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \
+  else with_database_berkdb=no
+  fi
+fi
+
+if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
      != "no no no"; then
   $as_echo "#define HAVE_DATABASE 1" >>confdefs.h
 
@@ -19965,7 +20430,7 @@
   LIBS="-Bstatic -lut -Bdynamic $LIBS" &&  if test "$verbose" = "yes"; then echo "    Prepending \"-Bstatic -lut -Bdynamic\" to \$LIBS"; fi
 fi
 
-if test "$enable_bignum" = "gmp"; then
+if test "$with_bignum" = "gmp"; then
   ac_fn_c_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default"
 if test "x$ac_cv_header_gmp_h" = x""yes; then :
 
@@ -20021,7 +20486,7 @@
   else
     { echo "Error:" "Required GMP numeric support cannot be provided." >&2; exit 1; }
   fi
-elif test "$enable_bignum" = "mp"; then
+elif test "$with_bignum" = "mp"; then
   for library in "" "-lcrypto"; do
     ac_fn_c_check_header_mongrel "$LINENO" "mp.h" "ac_cv_header_mp_h" "$ac_includes_default"
 if test "x$ac_cv_header_mp_h" = x""yes; then :
@@ -20186,7 +20651,7 @@
 fi
 
 
-if test "$enable_modules" = "yes"; then
+if test "$with_modules" = "yes"; then
   ld_libs_module=
 else
 
@@ -20252,12 +20717,12 @@
 ld_libs_all="$T"
 
 
-if test "$enable_modules" = "no"; then
+if test "$with_modules" = "no"; then
   MAKE_SUBDIR="$MAKE_SUBDIR src" &&  if test "$verbose" = "yes"; then echo "    Appending \"src\" to \$MAKE_SUBDIR"; fi
 fi
 
 
-internal_makefile_list="Makefile.in"
+internal_makefile_list="Makefile.in src/.gdbinit.in"
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
@@ -20304,10 +20769,6 @@
 fi
 
 
-if test -f "$srcdir/etc/gdbinit.in"; then
-  test "$verbose" = "yes" && echo "creating src/.gdbinit.in"
-  cp $srcdir/etc/gdbinit.in src/.gdbinit.in
-fi
 
 if test -f "$srcdir/etc/dbxrc.in"; then
   test "$verbose" = "yes" && echo "creating src/.dbxrc.in"
@@ -20615,37 +21076,41 @@
 					      $as_echo "#define USE_SYSTEM_MALLOC 1" >>confdefs.h
 
 fi
-test "$GCC"                = "yes" && $as_echo "#define USE_GCC 1" >>confdefs.h
-
-test "$enable_external_widget" = "yes" && $as_echo "#define EXTERNAL_WIDGET 1" >>confdefs.h
-
-test "$enable_kkcc"        = "yes" && $as_echo "#define USE_KKCC 1" >>confdefs.h
-
-test "$enable_newgc"       = "yes" && $as_echo "#define NEW_GC 1" >>confdefs.h
-
-test "$have_vdb_posix"     = "yes" && $as_echo "#define VDB_POSIX 1" >>confdefs.h
-
-test "$have_vdb_fake"      = "yes" && $as_echo "#define VDB_FAKE 1" >>confdefs.h
-
-test "$enable_quick_build" = "yes" && $as_echo "#define QUICK_BUILD 1" >>confdefs.h
-
-test "$with_purify"        = "yes" && $as_echo "#define PURIFY 1" >>confdefs.h
-
-test "$with_quantify"      = "yes" && $as_echo "#define QUANTIFY 1" >>confdefs.h
-
-test "$with_pop"           = "yes" && $as_echo "#define MAIL_USE_POP 1" >>confdefs.h
-
-test "$with_kerberos"      = "yes" && $as_echo "#define KERBEROS 1" >>confdefs.h
-
-test "$with_hesiod"        = "yes" && $as_echo "#define HESIOD 1" >>confdefs.h
-
-test "$enable_union_type"  = "yes" && $as_echo "#define USE_UNION_TYPE 1" >>confdefs.h
-
-test "$enable_pdump"       = "yes" && $as_echo "#define PDUMP 1" >>confdefs.h
-
-test "$enable_dump_in_exec" = "yes" && $as_echo "#define DUMP_IN_EXEC 1" >>confdefs.h
-
-test "$with_ipv6_cname"    = "yes" && $as_echo "#define IPV6_CANONICALIZE 1" >>confdefs.h
+test "$GCC"                  = "yes" && $as_echo "#define USE_GCC 1" >>confdefs.h
+
+test "$XEMACS_CC_GPP"        = "yes" && $as_echo "#define USE_GPLUSPLUS 1" >>confdefs.h
+
+test "$with_external_widget" = "yes" && $as_echo "#define EXTERNAL_WIDGET 1" >>confdefs.h
+
+test "$with_kkcc"            = "yes" && $as_echo "#define USE_KKCC 1" >>confdefs.h
+
+test "$with_newgc"           = "yes" && $as_echo "#define NEW_GC 1" >>confdefs.h
+
+test "$have_vdb_posix"       = "yes" && $as_echo "#define VDB_POSIX 1" >>confdefs.h
+
+test "$have_vdb_fake"        = "yes" && $as_echo "#define VDB_FAKE 1" >>confdefs.h
+
+test "$with_quick_build"     = "yes" && $as_echo "#define QUICK_BUILD 1" >>confdefs.h
+
+test "$with_purify"          = "yes" && $as_echo "#define PURIFY 1" >>confdefs.h
+
+test "$with_quantify"        = "yes" && $as_echo "#define QUANTIFY 1" >>confdefs.h
+
+test "$with_valgrind"        = "yes" && $as_echo "#define USE_VALGRIND 1" >>confdefs.h
+
+test "$with_pop"             = "yes" && $as_echo "#define MAIL_USE_POP 1" >>confdefs.h
+
+test "$with_kerberos"        = "yes" && $as_echo "#define KERBEROS 1" >>confdefs.h
+
+test "$with_hesiod"          = "yes" && $as_echo "#define HESIOD 1" >>confdefs.h
+
+test "$with_union_type"      = "yes" && $as_echo "#define USE_UNION_TYPE 1" >>confdefs.h
+
+test "$with_pdump"           = "yes" && $as_echo "#define PDUMP 1" >>confdefs.h
+
+test "$with_dump_in_exec"    = "yes" && $as_echo "#define DUMP_IN_EXEC 1" >>confdefs.h
+
+test "$with_ipv6_cname"      = "yes" && $as_echo "#define IPV6_CANONICALIZE 1" >>confdefs.h
 
 
 
@@ -20719,7 +21184,7 @@
 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
 case "$ld_switch_site" in
   *nocombreloc*) echo "  Linking with \`-z nocombreloc'.
-    - Consider configuring with --enable-pdump." ;;
+    - Consider configuring with --with-pdump." ;;
 esac
 
 echo "
@@ -20759,39 +21224,39 @@
   echo "    - Athena headers location:                    $athena_h_path"
   echo "    - Athena library to link:                     $athena_lib"
 fi
-case "$enable_menubars" in
+case "$with_menubars" in
   gtk   ) echo "  Using GTK menubars."   ;;
   lucid ) echo "  Using Lucid menubars." ;;
   motif ) echo "  Using Motif menubars."
           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
           echo "             We recommend using the Lucid menubar instead."
-          echo "             Re-run configure with --enable-menubars='lucid'." ;;
+          echo "             Re-run configure with --with-menubars='lucid'." ;;
     msw ) echo "  Using MS-Windows menubars." ;;
 esac
 if test "$with_xft_menubars" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in menubars."
-  echo "      WARNING: This feature will be replaced with a face."
-fi
-case "$enable_scrollbars" in
+  echo "      WARNING: This Xft feature will be replaced with a face."
+fi
+case "$with_scrollbars" in
   gtk    ) echo "  Using GTK scrollbars."        ;;
   lucid  ) echo "  Using Lucid scrollbars."      ;;
   motif  ) echo "  Using Motif scrollbars."      ;;
   athena ) echo "  Using Athena scrollbars."     ;;
      msw ) echo "  Using MS-Windows scrollbars." ;;
 esac
-case "$enable_dialogs" in
+case "$with_dialogs" in
   gtk    ) echo "  Using GTK dialog boxes." ;;
   motif  ) echo "  Using Motif dialog boxes."
            if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
              echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
              echo "             We recommend using the Athena dialog boxes instead."
-             echo "             Install libXaw and re-run configure with --enable-dialogs='athena'."
+             echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
              echo "             Read the PROBLEMS file for more information."
            fi; fi ;;
   athena ) echo "  Using Athena dialog boxes."     ;;
      msw ) echo "  Using MS-Windows dialog boxes." ;;
 esac
-case "$enable_widgets" in
+case "$with_widgets" in
   gtk    ) echo "  Using GTK native widgets."        ;;
   motif  ) echo "  Using Motif native widgets."      ;;
   athena ) echo "  Using Athena native widgets."     ;;
@@ -20799,12 +21264,12 @@
 esac
 if test "$with_xft_tabs" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in tab controls."
-  echo "      WARNING: This feature will be replaced with a face."
+  echo "      WARNING: This Xft feature will be replaced with a face."
 fi
 if test "$with_xft_gauges" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in progress bars."
-  echo "      WARNING: This feature will be replaced with a face."
-  echo "      WARNING: This feature not yet implemented; setting ignored."
+  echo "      WARNING: This Xft feature will be replaced with a face."
+  echo "      WARNING: This Xft feature not yet implemented; setting ignored."
 fi
 if test "$with_dragndrop" = yes; then
   echo "  Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
@@ -20851,17 +21316,17 @@
 
 echo "
 Sound:"
-test "$enable_sound_native" = yes && echo "  Compiling in support for sound (native)."
-test "$enable_sound_alsa" = yes && echo "  Compiling in support for ALSA (Advanced Linux Sound Architecture)."
-test "$enable_sound_nas" = yes && echo "  Compiling in support for NAS (network audio system)."
+test "$with_sound_native" = yes && echo "  Compiling in support for sound (native)."
+test "$with_sound_alsa" = yes && echo "  Compiling in support for ALSA (Advanced Linux Sound Architecture)."
+test "$with_sound_nas" = yes && echo "  Compiling in support for NAS (network audio system)."
 test "$old_nas" = yes && echo "    - NAS library lacks error trapping; will play synchronously."
-test "$enable_sound_esd" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
+test "$with_sound_esd" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
 
 echo "
 Databases:"
-test "$enable_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
-test "$enable_database_dbm"    = yes && echo "  Compiling in support for DBM."
-test "$enable_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
+test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
+test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
+test "$with_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
 test "$with_ldap" = yes && echo "  Compiling in support for LDAP."
 if test "$with_postgresql" = yes; then
   echo "  Compiling in support for PostgreSQL."
@@ -20871,7 +21336,7 @@
 
 echo "
 Internationalization:"
-test "$enable_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
+test "$with_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
 test "$with_xim" != no && echo "  Compiling in support for XIM (X11R5+ I18N input method)."
 test "$with_xim" = motif && echo "    - Using Motif to provide XIM support."
 test "$with_xim" = xlib && echo "    - Using raw Xlib to provide XIM support."
@@ -20896,10 +21361,10 @@
 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
 test "$with_dnet" = yes && echo "  Compiling in support for DNET."
-test "$enable_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
-test "$enable_bignum" = "gmp" && echo "  Compiling in support for more number types using the GNU MP library."
-test "$enable_bignum" = "mp" && echo "  Compiling in support for more number types using the BSD MP library."
-if test "$enable_union_type" = yes ; then
+test "$with_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
+test "$with_bignum" = "gmp" && echo "  Compiling in support for more number types using the GNU MP library."
+test "$with_bignum" = "mp" && echo "  Compiling in support for more number types using the BSD MP library."
+if test "$with_union_type" = yes ; then
   echo "  Using the union type for Lisp_Objects."
   echo "  WARNING: ---------------------------------------------------------"
   echo "  WARNING: This tends to trigger compiler bugs, especially when"
@@ -20909,7 +21374,7 @@
   echo "  WARNING: More recent versions may be safer, or not."
   echo "  WARNING: ---------------------------------------------------------"
 fi
-if test "$enable_kkcc" = yes ; then
+if test "$with_kkcc" = yes ; then
   echo "  Using the new GC mark algorithms (KKCC)."
   echo "  WARNING: ---------------------------------------------------------"
   echo "  WARNING: The new algorithms are experimental. They are enabled by"
@@ -20917,7 +21382,7 @@
   echo "  WARNING: turn it off."
   echo "  WARNING: ---------------------------------------------------------"
 fi
-test "$enable_newgc" = yes && echo "  Using the new incremental garbage collector and the new allocator."
+test "$with_newgc" = yes && echo "  Using the new incremental garbage collector and the new allocator."
 if test "$have_vdb_posix" = yes ; then
   if test "$have_vdb_sigaction" = yes ; then
     echo "  Using POSIX sigaction() to install fault handler."
@@ -20931,14 +21396,14 @@
 if test "$have_vdb_mach" = yes ; then
   echo "  Using mach exception mechanism as vdb fault handler."
 fi
-if test "$have_vdb_fake" = yes && test "$enable_vdb" == fake; then
+if test "$have_vdb_fake" = yes && test "$with_vdb" == fake; then
   echo "  Virtual dirty bit write barrier manually disabled."
 fi
-test "$enable_pdump" = yes && echo "  Using the new portable dumper."
-test "$enable_dump_in_exec" = yes && echo "  Dumping into executable."
-test "$enable_debug" = yes && echo "  Compiling in support for extra debugging code."
+test "$with_pdump" = yes && echo "  Using the new portable dumper."
+test "$with_dump_in_exec" = yes && echo "  Dumping into executable."
+test "$with_debug" = yes && echo "  Compiling in support for extra debugging code."
 test "$usage_tracking" = yes && echo "  Compiling in support for active usage tracking (Sun internal)."
-if test "$enable_error_checking_extents $enable_error_checking_types $enable_error_checking_text $enable_error_checking_gc $enable_error_checking_malloc $enable_error_checking_glyphs $enable_error_checking_byte_code $enable_error_checking_display $enable_error_checking_structures" \
+if test "$with_error_checking_extents $with_error_checking_types $with_error_checking_text $with_error_checking_gc $with_error_checking_malloc $with_error_checking_glyphs $with_error_checking_byte_code $with_error_checking_display $with_error_checking_structures" \
   != "no no no no no no no no no"; then
   echo "  Compiling in support for runtime error checking."
   echo "  WARNING: ---------------------------------------------------------"
@@ -20946,6 +21411,7 @@
   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
   echo "  WARNING: ---------------------------------------------------------"
 fi
+test "$with_valgrind" = yes && echo "  Compiling in support for memory debugging with Valgrind."
 echo ""
 ) | tee -a Installation
 echo ""
@@ -20977,7 +21443,7 @@
 done
 ac_config_files="$ac_config_files src/paths.h src/xemacs.def.in lib-src/config.values"
 
-test "$enable_modules" = "yes" && ac_config_files="$ac_config_files lib-src/ellcc.h"
+test "$with_modules" = "yes" && ac_config_files="$ac_config_files lib-src/ellcc.h"
 
 
 
@@ -21495,7 +21961,7 @@
 # values after options handling.
 ac_log="
 This file was extended by XEmacs $as_me 21.5, which was
-generated by GNU Autoconf 2.64.  Invocation command line was
+generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -21535,6 +22001,7 @@
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
   -q, --quiet, --silent
                    do not print progress messages
   -d, --debug      don't remove temporary files
@@ -21557,10 +22024,11 @@
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 XEmacs config.status 21.5
-configured by $0, generated by GNU Autoconf 2.64,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.65,
+  with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2009 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
@@ -21596,6 +22064,8 @@
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
@@ -21790,7 +22260,7 @@
 t delim
 :nl
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -21804,7 +22274,7 @@
 t nl
 :delim
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
--- a/configure.ac	Wed Jan 20 07:05:57 2010 -0600
+++ b/configure.ac	Wed Feb 24 01:58:04 2010 -0600
@@ -15,6 +15,19 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&AS_MESSAGE_LOG_FD'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ])
+# AC_LANG(C++)
+# ----------
+# Similar to AC_LANG(C) but we use XEMACS_CC, which may be g++.
+m4_define([AC_LANG(C++)],
+[ac_ext=c
+xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
+xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
+xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
+ac_cpp='$CPP '"$xe_cppflags"
+ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
+ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&AS_MESSAGE_LOG_FD'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+])
 dnl
 dnl -------------------------------------------------------------------------
 dnl Autoconf startup.
@@ -544,18 +557,18 @@
 dnl
 dnl I think these will be caught by autoconf internal checks,
 dnl only --with-* are unchecked
-dnl --external-widget         --enable-external-widget
+dnl --external-widget         --with-external-widget
 dnl --native-sound-lib=LIB    --with-native-sound-lib
 dnl --mail-locking=TYPE       --with-mail-locking
 dnl --rel-alloc               --with-rel-alloc
-dnl --use-number-lib          --enable-bignum
-dnl --debug                   --enable-debug
-dnl --error-checking          --enable-error-checking
-dnl --memory-usage-stats      --enable-memory-usage-stats
-dnl --quick-build             --enable-quick-build
-dnl --use-union-type          --enable-union-type
-dnl --pdump                   --enable-pdump
-dnl --use-kkcc                --enable-kkcc
+dnl --use-number-lib          --with-bignum
+dnl --debug                   --with-debug
+dnl --error-checking          --with-error-checking
+dnl --memory-usage-stats      --with-memory-usage-stats
+dnl --quick-build             --with-quick-build
+dnl --use-union-type          --with-union-type
+dnl --pdump                   --with-pdump
+dnl --use-kkcc                --with-kkcc
 dnl
 dnl parse flags
 XE_HELP_SUBSECTION([Compilation options])
@@ -574,7 +587,7 @@
 	[], [])
 XE_MERGED_ARG([cflags],
 	AS_HELP_STRING([--with-cflags=FLAGS],
-	[Compiler flags.  These flags will be placed after any flags inserted for warnings, debugging or optimization; setting this does not disable the insertion of those flags.  Use configure settings such as `--with-optimization=no' or `enable-debug=no' to turn them off, or override them with `--with-cflags-optimization', `--with-cflags-debugging', or `with-cflags-warning'.]),
+	[Compiler flags.  These flags will be placed after any flags inserted for warnings, debugging or optimization; setting this does not disable the insertion of those flags.  Use configure settings such as `--with-optimization=no' or `with-debug=no' to turn them off, or override them with `--with-cflags-optimization', `--with-cflags-debugging', or `with-cflags-warning'.]),
 	[], [])
 XE_MERGED_ARG([cflags-warning],
 	AS_HELP_STRING([--with-cflags-warning=FLAGS],[Override compiler flags used to control warnings.
@@ -709,7 +722,7 @@
 	AS_HELP_STRING([--with-msw],[Support MS Windows as a window system (only under Cygwin and MinGW).  `--with-msw=no' may be needed on *nix systems with Wine installed.]),
 	[], [])
 XE_MERGED_ARG([toolbars],
-	AS_HELP_STRING([--enable-toolbars],[Enable toolbar support. Default: yes.]),
+	AS_HELP_STRING([--with-toolbars],[Enable toolbar support. Default: yes.]),
 	[], [])
 XE_MERGED_ARG([wmcommand],
 	AS_HELP_STRING([--with-wmcommand],[Compile without realized leader window which will
@@ -719,22 +732,22 @@
 	AS_HELP_STRING([--with-athena=TYPE],[Use TYPE Athena widgets (`xaw', `3d', `next', `95', or `xpm').]),
 [],[],[xaw,3d,next,95,xpm])dnl
 XE_KEYWORD_ARG([menubars],
-	AS_HELP_STRING([--enable-menubars=TYPE],[Use TYPE menubars ('yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').  The Lucid
+	AS_HELP_STRING([--with-menubars=TYPE],[Use TYPE menubars ('yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').  The Lucid
                         widgets emulate Motif (mostly) but are faster.
                         *WARNING*  The Motif menubar is currently broken.
                         Lucid menubars are the default.]),
 	[], [],[yes,no,lucid,motif,athena,gtk,msw])
 XE_KEYWORD_ARG([scrollbars],
-	AS_HELP_STRING([--enable-scrollbars=TYPE],[Use TYPE scrollbars 'yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').
+	AS_HELP_STRING([--with-scrollbars=TYPE],[Use TYPE scrollbars 'yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').
                         Lucid scrollbars are the default.]),
 	[], [],[yes,no,lucid,motif,athena,gtk,msw])
 XE_KEYWORD_ARG([dialogs],
-	AS_HELP_STRING([--enable-dialogs=TYPE],[Use TYPE dialog boxes 'yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').
+	AS_HELP_STRING([--with-dialogs=TYPE],[Use TYPE dialog boxes 'yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').
                         There are no true Lucid dialogs; Motif dialogs will be
                         used if Motif can be found, else Athena is used.]),
 	[], [],[yes,no,lucid,motif,athena,gtk,msw])
 XE_KEYWORD_ARG([widgets],
-	AS_HELP_STRING([--enable-widgets=TYPE],[Use TYPE native widgets ('yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').
+	AS_HELP_STRING([--with-widgets=TYPE],[Use TYPE native widgets ('yes', '`no', `lucid', `motif', `athena', `gtk', or `msw').
                         Other widget types are currently unsupported.
                         There are no true Lucid widgets; Motif widgets will be
                         used if Motif can be found, else Athena is used.]),
@@ -749,7 +762,7 @@
 	AS_HELP_STRING([--with-cde],[Compile in support for CDE drag and drop.]),
 	[], [])
 XE_MERGED_ARG([external-widget],
-	AS_HELP_STRING([--enable-external-widget],[Support XEmacs server for text widgets in other applications.]),
+	AS_HELP_STRING([--with-external-widget],[Support XEmacs server for text widgets in other applications.]),
 	[], [])
 dnl
 XE_HELP_SUBSECTION([TTY (character terminal) options])
@@ -795,7 +808,7 @@
 dnl
 XE_HELP_SUBSECTION([Sound options])
 XE_COMPLEX_ARG([sound],
-	AS_HELP_STRING([--enable-sound=TYPE],[Compile with sound support.
+	AS_HELP_STRING([--with-sound=TYPE],[Compile with sound support.
                         Valid types are `native', `alsa', `nas' and `esd'.
                         Prefix a type with 'no' to disable.
                         The first type can be `none' or `all'.  `none' means
@@ -805,7 +818,7 @@
                         all sound support except for ESD which defaults to
                         off.]),
 	[],
-	[enable_sound_nas=""],
+	[with_sound_nas=""],
 	[XE_COMPLEX_OPTION([native],[""]),
 	 XE_COMPLEX_OPTION([alsa],[""]),
 	 XE_COMPLEX_OPTION([nas],[""]),
@@ -816,7 +829,7 @@
 dnl
 XE_HELP_SUBSECTION([Internationalization options])
 XE_MERGED_ARG([mule],
-	AS_HELP_STRING([--enable-mule],[Compile with Mule (Multi-Lingual Emacs) support,
+	AS_HELP_STRING([--with-mule],[Compile with Mule (Multi-Lingual Emacs) support,
                         needed to support non-Latin-1 (including Asian)
                         languages.]),
 	[], [])
@@ -837,18 +850,18 @@
 XE_MERGED_ARG([xfs],
 	AS_HELP_STRING([--with-xfs],[Enable XFontSet support for internationalized
                         menubar.  Incompatible with `--with-xim=motif' and `--with-xft'.
-                        `--enable-menubars=lucid' (the default) is desirable.]),
+                        `--with-menubars=lucid' (the default) is desirable.]),
 	[], [])
 dnl
 XE_HELP_SUBSECTION([File-related options])
 XE_MERGED_ARG([default-eol-detection],
-	AS_HELP_STRING([--enable-default-eol-detection],[Turns on by default auto-detection of end-of-line type
+	AS_HELP_STRING([--with-default-eol-detection],[Turns on by default auto-detection of end-of-line type
 			when reading a file.  Applies to those platforms where
 			auto-detection is off by default (non-Mule Unix).  Has
 			no effect otherwise.]),
 	[], [])
 XE_MERGED_ARG([clash-detection],
-	AS_HELP_STRING([--enable-clash-detection],[Disable use of lock files to detect multiple edits
+	AS_HELP_STRING([--with-clash-detection],[Disable use of lock files to detect multiple edits
 			of the same file.]),
 	[], [])
 XE_MERGED_ARG([zlib],
@@ -857,11 +870,11 @@
 dnl
 XE_HELP_SUBSECTION([Database options])
 XE_COMPLEX_ARG([database],
-	AS_HELP_STRING([--enable-database=TYPE],[Compile with database support.  Valid types are
+	AS_HELP_STRING([--with-database=TYPE],[Compile with database support.  Valid types are
                         `no' or a comma-separated list of one or more
                         of `berkdb' and either `dbm' or `gdbm'.]),
 	[
-if test "$enable_database_dbm"  = "yes" -a "$enable_database_gdbm" = "yes"; then
+if test "$with_database_dbm"  = "yes" -a "$with_database_gdbm" = "yes"; then
 	USAGE_ERROR("Only one of \`dbm' and \`gdbm' may be specified
 with the \`--with-database' option.")
 fi
@@ -921,40 +934,40 @@
 	AS_HELP_STRING([--with-debug-malloc],[Use a debugging malloc.]),
 	[], [])
 XE_MERGED_ARG([pdump],
-	AS_HELP_STRING([--enable-pdump],[Enable portable LISP preloader.]),
+	AS_HELP_STRING([--with-pdump],[Enable portable LISP preloader.]),
 	[], [])
 XE_MERGED_ARG([dump-in-exec],
-	AS_HELP_STRING([--enable-dump-in-exec],[Enable dumping into executable (enabled by default
+	AS_HELP_STRING([--with-dump-in-exec],[Enable dumping into executable (enabled by default
 			for `pdump', not enabled by default in combination 
 			with `newgc').]),
 	[], [])
 XE_MERGED_ARG([kkcc],
-	AS_HELP_STRING([--enable-kkcc],[Enable experimental new GC mark algorithms.]),
-	[], [enable_kkcc=yes])
+	AS_HELP_STRING([--with-kkcc],[Enable experimental new GC mark algorithms.]),
+	[], [with_kkcc=yes])
 
 XE_MERGED_ARG([newgc],
-	AS_HELP_STRING([--enable-newgc],[Enable new incremental garbage collector and new allocator.]),
+	AS_HELP_STRING([--with-newgc],[Enable new incremental garbage collector and new allocator.]),
 	[], [])
 XE_COMPLEX_ARG([vdb],
-	AS_HELP_STRING([--enable-vdb=TYPE],[Override auto-detection of 
+	AS_HELP_STRING([--with-vdb=TYPE],[Override auto-detection of 
 			virtual-dirty-bit write-barrier implementation for the
 			new garbage collector. TYPE must be one of "auto" (for 
 			auto-detection), "posix", "win32", "mach", or "fake" 
 			(uses the new garbage collector but disables 
 			incremental collections). The default is to
 			use auto-detection.]),
-	[], [enable_vdb="auto"],[auto,posix,win32,mach,fake,no])
+	[], [with_vdb="auto"],[auto,posix,win32,mach,fake,no])
 dnl
 XE_HELP_SUBSECTION([Emacs Lisp options])
 XE_MERGED_ARG([modules],
-	AS_HELP_STRING([--enable-modules],[Compile in experimental support for dynamically
+	AS_HELP_STRING([--with-modules],[Compile in experimental support for dynamically
                         loaded libraries (Dynamic Shared Objects).]),
 	[], [])
 XE_KEYWORD_ARG([bignum],
-	AS_HELP_STRING([--enable-bignum=TYPE],[Compile in support for bignums, ratios, or bigfloats
+	AS_HELP_STRING([--with-bignum=TYPE],[Compile in support for bignums, ratios, or bigfloats
                         using library support.  TYPE must be one of "gmp"
                         (for GNU MP), "mp" (for BSD MP), or "no" (disabled).]),
-	[], [enable_bignum="no"],[no,gmp,mp])
+	[], [with_bignum="no"],[no,gmp,mp])
 dnl
 XE_HELP_SUBSECTION([Platform Specific options])
 XE_MERGED_ARG([workshop],
@@ -970,14 +983,36 @@
 dnl
 XE_HELP_SUBSECTION([Debugging options])
 XE_MERGED_ARG([debug],
-	AS_HELP_STRING([--enable-debug],[Enable additional debugging information.  No time cost.]),
+	AS_HELP_STRING([--with-debug],[Enable additional debugging information.  No noticeable time cost (unlike
+`--with-error-checking').  This turns adds `-g' to the compiler options so that
+debug information is compiled into the XEmacs executable.  It also turns on
+assert checks in the source code (i.e. same as `--with-assertions'); enables
+Lisp commands for determining detailed memory usage statistics (same as
+`--with-memory-usage-stats'); adds various Lisp variables and functions
+that allow one to display internal structures, show the internal workings
+of certain subsystems, and exit to the debugger; causes Lisp errors during
+building to exit to the debugger or dump core; and adds debugging-related
+C functions meant to be called from a debugger.]),
 	[], [])
-dnl Keep TESTS sorted to help with syncing doc to reality.
+dnl If just --with-error-checking or --with-error-checking=yes is given,
+dnl it should be the same as --with-error-checking=all.  Currently it's
+dnl the same as saying nothing at all.
+if test "$with_error_checking" = "yes"; then
+  with_error_checking=all
+fi
 XE_COMPLEX_ARG([error-checking],
-	AS_HELP_STRING([--enable-error-checking=TESTS],[Compile with internal error-checking added.
-                        Causes noticeable loss of speed.  Valid TESTS
-                        are `byte_code', `display', `extents', `gc', `glyphs', `malloc', `structures' `text', `types'.]),
-	[], [],
+	AS_HELP_STRING([--with-error-checking[=CLASS|all|none]],[Compile with internal error-checking added.
+Causes noticeable loss of speed.  Valid classes are `byte_code', `display'
+(redisplay), `extents', `gc' (garbage collection), `glyphs', `malloc'
+(memory allocation), `structures' (C structures), `text' (text handling and
+conversion), `types' (correct Lisp-object type for type-specific
+operations).  `all' or `none' can be given to set all or no classes,
+respectively.  Any of the classes can be prefixed with `no' to turn the
+class off.  A comma-separated list of classes can also be given.  For
+example, `all,nogc' turns on all but garbage-collection-related checking.
+Omitting any argument or specifying just `yes' is the same as `all'.]),
+		[], [],
+dnl Keep TESTS sorted to help with syncing doc to reality.
 [XE_COMPLEX_OPTION([byte_code],[""]),
  XE_COMPLEX_OPTION([display],[""]),
  XE_COMPLEX_OPTION([extents],[""]),
@@ -988,13 +1023,13 @@
  XE_COMPLEX_OPTION([text],[""]),
  XE_COMPLEX_OPTION([types],[""])])
 XE_MERGED_ARG([assertions],
-	AS_HELP_STRING([--enable-assertions],[Compile in runtime assertions.]),
+	AS_HELP_STRING([--with-assertions],[Compile in runtime assertions.]),
 	[], [])
 XE_MERGED_ARG([memory-usage-stats],
-	AS_HELP_STRING([--enable-memory-usage-stats],[Enable LISP memory usage API.]),
+	AS_HELP_STRING([--with-memory-usage-stats],[Enable LISP memory usage API.]),
 	[], [])
 XE_MERGED_ARG([quick-build],
-	AS_HELP_STRING([--enable-quick-build],[Speed up the build cycle by leaving out steps where
+	AS_HELP_STRING([--with-quick-build],[Speed up the build cycle by leaving out steps where
                         XEmacs will still work (more or less) without them.
                         Potentially dangerous if you don't know what you're
                         doing. This (1) doesn't garbage-collect after loading
@@ -1006,7 +1041,7 @@
                         to be rebuilt.]),
 	[], [])
 XE_MERGED_ARG([union-type],
-	AS_HELP_STRING([--enable-union-type],[Use union definition of Lisp_Object type.  Known to trigger bugs in some compilers.]),
+	AS_HELP_STRING([--with-union-type],[Use union definition of Lisp_Object type.  Known to trigger bugs in some compilers.]),
 	[], [])
 XE_MERGED_ARG([quantify],
 	AS_HELP_STRING([--with-quantify],[Support performance debugging using Quantify.]),
@@ -1014,6 +1049,9 @@
 XE_MERGED_ARG([purify],
 	AS_HELP_STRING([--with-purify],[Support memory debugging using Purify.]),
 	[], [])
+XE_MERGED_ARG([valgrind],
+	AS_HELP_STRING([--with-valgrind],[Support memory debugging using Valgrind.]),
+	[], [])
 dnl -------------------------------------------------------------------------
 dnl Final command line argument checks.
 
@@ -1220,27 +1258,27 @@
 dnl Error checking and debugging flags
 dnl ----------------------------------
 dnl Error checking default to "yes" in beta versions, to "no" in releases.
-dnl Same goes for --enable-debug and --extra-verbosity.
+dnl Same goes for --with-debug and --extra-verbosity.
 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi
-test "${enable_error_checking_extents:=$beta}"    = yes && AC_DEFINE(ERROR_CHECK_EXTENTS)
-test "${enable_error_checking_types:=$beta}"      = yes && AC_DEFINE(ERROR_CHECK_TYPES)
-test "${enable_error_checking_text:=$beta}"       = yes && AC_DEFINE(ERROR_CHECK_TEXT)
-test "${enable_error_checking_gc:=$beta}"         = yes && AC_DEFINE(ERROR_CHECK_GC)
-test "${enable_error_checking_malloc:=$beta}"     = yes && AC_DEFINE(ERROR_CHECK_MALLOC)
-test "${enable_error_checking_byte_code:=$beta}"  = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE)
-test "${enable_error_checking_glyphs:=$beta}"     = yes && AC_DEFINE(ERROR_CHECK_GLYPHS)
-test "${enable_error_checking_display:=$beta}"    = yes && AC_DEFINE(ERROR_CHECK_DISPLAY)
-test "${enable_error_checking_structures:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_STRUCTURES)
-dnl enable_debug=yes must be set when error checking is present.  This should be
+test "${with_error_checking_extents:=$beta}"    = yes && AC_DEFINE(ERROR_CHECK_EXTENTS)
+test "${with_error_checking_types:=$beta}"      = yes && AC_DEFINE(ERROR_CHECK_TYPES)
+test "${with_error_checking_text:=$beta}"       = yes && AC_DEFINE(ERROR_CHECK_TEXT)
+test "${with_error_checking_gc:=$beta}"         = yes && AC_DEFINE(ERROR_CHECK_GC)
+test "${with_error_checking_malloc:=$beta}"     = yes && AC_DEFINE(ERROR_CHECK_MALLOC)
+test "${with_error_checking_byte_code:=$beta}"  = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE)
+test "${with_error_checking_glyphs:=$beta}"     = yes && AC_DEFINE(ERROR_CHECK_GLYPHS)
+test "${with_error_checking_display:=$beta}"    = yes && AC_DEFINE(ERROR_CHECK_DISPLAY)
+test "${with_error_checking_structures:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_STRUCTURES)
+dnl with_debug=yes must be set when error checking is present.  This should be
 dnl fixed up.
-dnl enable_debug implies other options
-if test "${enable_debug:=$beta}" = "yes"; then
-  enable_assertions=yes
-  enable_memory_usage_stats=yes
+dnl with_debug implies other options
+if test "${with_debug:=$beta}" = "yes"; then
+  with_assertions=yes
+  with_memory_usage_stats=yes
   AC_DEFINE(DEBUG_XEMACS)
 fi
-test "$enable_assertions"         = "yes" && AC_DEFINE(USE_ASSERTIONS)
-test "$enable_memory_usage_stats" = "yes" && AC_DEFINE(MEMORY_USAGE_STATS)
+test "$with_assertions"         = "yes" && AC_DEFINE(USE_ASSERTIONS)
+test "$with_memory_usage_stats" = "yes" && AC_DEFINE(MEMORY_USAGE_STATS)
 
 dnl ------------------------------
 dnl Determine the s&m files to use
@@ -1435,17 +1473,17 @@
 dnl $opsys detection complete; defaults depending on $opsys follow
 dnl --------------------------------------------------------------
 
-if test -z "$enable_pdump"; then
+if test -z "$with_pdump"; then
   case "$opsys" in
-    linux* )  enable_pdump=yes ;;          dnl glibc 2.3.1 seems to hose unexec
-    darwin )  enable_pdump=yes ;;          dnl No "native" working dumper available
-    cygwin* ) enable_pdump=yes ;;          dnl unexec is broken
-    * )       enable_pdump=no ;;
+    linux* )  with_pdump=yes ;;          dnl glibc 2.3.1 seems to hose unexec
+    darwin )  with_pdump=yes ;;          dnl No "native" working dumper available
+    cygwin* ) with_pdump=yes ;;          dnl No "native" dumper available
+    * )       with_pdump=no ;;
   esac
 fi
 
-if test "$enable_newgc" = "yes"; then
-  if test "$enable_vdb" = "auto"; then
+if test "$with_newgc" = "yes"; then
+  if test "$with_vdb" = "auto"; then
     case "$opsys" in
       darwin )  case "$machine" in
 		  i[[3-9]]86 ) check_vdb_posix=yes ;;
@@ -1458,7 +1496,7 @@
       * )       check_vdb_posix=yes ;;
     esac
   else
-    case "$enable_vdb" in
+    case "$with_vdb" in
       mach )  AC_DEFINE(VDB_MACH)  have_vdb_mach=yes ;;
       win32 ) AC_DEFINE(VDB_WIN32) have_vdb_win32=yes ;;
       posix ) check_vdb_posix=yes ;;
@@ -1509,7 +1547,7 @@
   AC_DEFINE(SUNPRO)
 fi
 
-if test "$enable_clash_detection" != "no"; then
+if test "$with_clash_detection" != "no"; then
   AC_DEFINE(CLASH_DETECTION)
 fi
 
@@ -1588,6 +1626,31 @@
 test -n "$with_xemacs_compiler" && XEMACS_CC="$with_xemacs_compiler"
 : ${XEMACS_CC:="$CC"}
 
+dnl Are we using g++?
+
+AC_MSG_CHECKING(whether we are using g++)
+
+dnl Is it named g++*?
+XEMACS_CC_GPP=no
+case "$XEMACS_CC" in
+  *g++* ) XEMACS_CC_GPP=yes ;;
+esac
+
+dnl If it's known to be in the GCC family, does it claim to be g++?  We don't
+dnl run this test unless we know it's GCC-like, because not all compilers
+dnl accept --version.
+dnl
+dnl It's not clear we need both tests, but it doesn't hurt.  g++ might not
+dnl have always output "g++" as the first thing in its version string, and
+dnl might not always in the future.
+if test "$XEMACS_CC_GPP" = "no" -a "$GCC" = "yes"; then
+  case "`$XEMACS_CC --version`" in
+    g++* ) XEMACS_CC_GPP=yes ;;
+  esac
+fi
+
+AC_MSG_RESULT($XEMACS_CC_GPP)
+
 dnl Figure out what C preprocessor to use.
 
 dnl On Sun systems, people sometimes set up the variable CPP
@@ -1791,9 +1854,9 @@
 dnl If the s&m files don't define a system-specific dumper, simply use pdump.
 dnl Sometime in the future, we'll remove all definitions of UNEXEC
 dnl from all the s&m files.
-test -z "$unexec" && enable_pdump=yes
-
-if test "$enable_pdump" = "yes"; then
+test -z "$unexec" && with_pdump=yes
+
+if test "$with_pdump" = "yes"; then
   ordinary_link="yes"
   ld="${ordinary_ld}"
   start_files=
@@ -1803,22 +1866,22 @@
 fi
 
 dnl Enable KKCC by default
-test -z "$enable_kkcc" && enable_kkcc=yes
+test -z "$with_kkcc" && with_kkcc=yes
 
 dnl Dump into executable
-if test -z "$enable_dump_in_exec"; then
-  if test "$enable_pdump" = "yes"; then
-    if test "$enable_newgc" = "yes"; then
-      enable_dump_in_exec=no
+if test -z "$with_dump_in_exec"; then
+  if test "$with_pdump" = "yes"; then
+    if test "$with_newgc" = "yes"; then
+      with_dump_in_exec=no
     else
-      enable_dump_in_exec=yes
+      with_dump_in_exec=yes
     fi
   fi
 fi
 
 dnl New incremental garbage collector
-if test "$enable_newgc" = "yes"; then
-  enable_kkcc=yes
+if test "$with_newgc" = "yes"; then
+  with_kkcc=yes
 fi
 
 dnl For debugging...
@@ -1874,24 +1937,13 @@
 
 xemacs_cc_cc_mismatch=no
 if test "$CC" != "$XEMACS_CC"; then
-  case "$XEMACS_CC" in
-  *g++* )
-    if test "$GCC" != "yes"; then
-      AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong])
-      xemacs_cc_cc_mismatch=yes
-    fi
-    ;;
-  esac
-  if test -n "$GCC"; then
-    case $XEMACS_CC in
-    *g++* )
-      # it's as expected, do nothing
-      ;;
-    * )
-      AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
-      xemacs_cc_cc_mismatch=yes
-      ;;
-    esac
+  if test "$XEMACS_CC_GPP" = "yes" -a "$GCC" != "yes"; then
+    AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong])
+    xemacs_cc_cc_mismatch=yes
+  fi
+  if test -n "$GCC" -a "$XEMACS_CC_GPP" != "yes" ; then
+    AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
+    xemacs_cc_cc_mismatch=yes
   fi
   dnl #### Add other detectable mismatches here.
 fi
@@ -1916,12 +1968,17 @@
 fi
 
 AC_MSG_CHECKING([for preferred optimization flags])
-if test "$with_optimization" = "yes" ; then
-  if test "$cflags_optimization_specified" = "no"; then
+if test "$cflags_optimization_specified" = "no"; then
+  if test "$with_optimization" = "yes" ; then
     dnl Following values of cflags_optimization are known to work well.
     dnl Should we take debugging options into consideration?
     if test "$GCC" = "yes"; then
-      with_cflags_optimization="-O3"
+      dnl If you want to remove the -fno-strict-aliasing, then you will have
+      dnl to rewrite all cases of "type-punning" expressions like
+      dnl (* (foo *) (&bar)), which occur all over XEmacs, by making `bar' a
+      dnl union (use an anonymous union if you're willing to put in an ifdef
+      dnl for anon-union support, falling back to the type-punned expression.
+      with_cflags_optimization="-O3 -fno-strict-aliasing"
     elif test "$__SUNPRO_C" = "yes"; then
       case "$opsys" in
         sol2    ) with_cflags_optimization="-xO4" ;;
@@ -1937,9 +1994,12 @@
     else
       with_cflags_optimization="-O" ;dnl The only POSIX-approved flag
     fi
+  elif test "$XEMACS_CC_GPP" = "yes" ; then
+    dnl Fuck me!  g++ v4 turns on strict aliasing by default, even without
+    dnl optimization.  See comment above about why we can't have strict
+    dnl aliasing currently in XEmacs.
+    with_cflags_optimization="-fno-strict-aliasing"
   fi
-else
-  with_cflags_optimization=
 fi
 
 AC_MSG_RESULT([${with_cflags_optimization}])
@@ -1993,28 +2053,52 @@
     dnl Ulrich Drepper has rejected patches to fix the glibc header files.
     test "$have_glibc" != "yes" && \
       with_cflags_warning="$with_cflags_warning -Wpointer-arith"
+    dnl
     dnl Warning flags that may differ for gcc and g++ (xemacs_compiler)
+    dnl
     dnl With g++, -Wshadow produces five zillion utterly random warnings --
     dnl a local var named `buffer' conflicts with `struct buffer' for
     dnl example.  Even with gcc, -Wshadow is questionable because of its
     dnl complaints about parameters with the same names as global functions.
-    dnl There is no -Wmissing-declarations under g++.
+    dnl There is no -Wmissing-declarations, -Wmissing-prototypes, or
+    dnl -Wstrict-prototypes under g++.
     dnl But gcc warns about -Weffc++ in C compiles.
+    dnl
+    dnl with_cflags_warning_c is for C-only warnings.
+    dnl with_cflags_warning_cxx is for C++-only warnings.
+    dnl with_cflags_warning_c_xe is for C-only warnings and only when
+    dnl   compiling the source tree (i.e. when --xemacs-compiler is used).
+    with_cflags_warning_c="-Wshadow -Wmissing-declarations"
+    with_cflags_warning_c="$with_cflags_warning_c -Wmissing-prototypes -Wstrict-prototypes"
+    with_cflags_warning_cxx="-Weffc++"
+    with_cflags_warning_c_xe=""
+    dnl -Wunused-parameter only appeared in gcc 3.
+    dnl -Wdeclaration-after-statement only appeared in gcc 3.4, and is C-only.
+    dnl -Wunused-parameter is too annoying for use in lib-src, partly because
+    dnl the UNUSED() decl is in compiler.h and we don't include that in any
+    dnl of the lib-src files.
     dnl With g++, there is no effective way to use -Wunused-parameter without
     dnl some very ugly code changes.
-    if test "$with_xemacs_compiler" = "g++"; then
-      xe_cflags_warning="$with_cflags_warning -Weffc++"
-    elif test "$__GCC" -ge 3; then
-      xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
+    if test "$__GCC" -ge 3; then
+      with_cflags_warning_c_xe="$with_cflags_warning_c_xe -Wunused-parameter"
       if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
-        with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement"
+        with_cflags_warning_c="$with_cflags_warning_c -Wdeclaration-after-statement"
       fi
     fi
-    with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations"
-    with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes"
-    dnl **** If more gcc/g++ flags are added, from here on must handle
-    dnl **** with_cflags_warning and xe_cflags_warning in parallel
+    dnl **** If more gcc/g++ flags are added, add them above, not below
+    dnl
+    dnl Now set warnings for the source tree (xe_cflags_warning) and for
+    dnl lib-src (with_cflags_warning).  Note that if we didn't set
+    dnl xe_cflags_warning, it would automatically be initialized from
+    dnl with_cflags_warning.
+    if test "$XEMACS_CC_GPP" = "yes"; then
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_cxx"
+    else
+      xe_cflags_warning="$with_cflags_warning $with_cflags_warning_c $with_cflags_warning_c_xe"
+    fi
+    with_cflags_warning="$with_cflags_warning $with_cflags_warning_c"
   elif test "$__ICC" = "yes"; then
+    dnl This will apply to both source tree and lib-src
     with_cflags_warning="-Wall -w1 -we147"
   dnl ### Add optimal with_cflags_warning support for other compilers HERE!
   fi
@@ -2122,7 +2206,7 @@
 dnl a usage message, that's often good enough.  Please report it, though.
 dnl #### Should make this Solaris-friendly.
 dnl Link with -z nocombreloc for now.
-if test "$enable_pdump" != "yes"; then
+if test "$with_pdump" != "yes"; then
   AC_MSG_CHECKING([for "-z nocombreloc" linker flag])
   case "`ld --help 2>&1`" in
     *-z\ nocombreloc* ) AC_MSG_RESULT(yes)
@@ -2141,8 +2225,8 @@
 dnl Add s&m-determined objects (including unexec) to link line
 test -n "$objects_machine" && XE_ADD_OBJS($objects_machine)
 test -n "$objects_system"  && XE_ADD_OBJS($objects_system)
-test -n "$unexec"          && test ! "$enable_pdump" = "yes" && XE_ADD_OBJS($unexec)
-test "$enable_pdump" = "yes" && XE_ADD_OBJS(dumper.o)
+test -n "$unexec"          && test ! "$with_pdump" = "yes" && XE_ADD_OBJS($unexec)
+test "$with_pdump" = "yes" && XE_ADD_OBJS(dumper.o)
 
 dnl Feed s&m crud to src/Makefile
 
@@ -2499,7 +2583,7 @@
 dnl Try this again when 2.1 hits the streets.
 dnl Avoid using free-hook.c if support exists for malloc debugging in libc
 dnl have_libmcheck=no
-dnl if test "$enable_error_checking_malloc" = "yes" -a \
+dnl if test "$with_error_checking_malloc" = "yes" -a \
 dnl    "$have_glibc" = "yes" -a \
 dnl    "$doug_lea_malloc" = "yes"; then
 dnl   AC_CHECK_HEADERS(mcheck.h)
@@ -2823,24 +2907,24 @@
 
       for feature in scrollbars toolbars menubars dialogs widgets
       do
-        eval "feature_value=\${enable_${feature}}"
+        eval "feature_value=\${with_${feature}}"
 	case "${feature_value}" in
 	yes|no|gtk|"" )
 	    ;;
 	* )
 	  feature_conflict_with_gtk=yes
-	  AC_MSG_WARN([--enable-${feature}=${feature_value} is incompatible with --with-gtk]) ;;
+	  AC_MSG_WARN([--with-${feature}=${feature_value} is incompatible with --with-gtk]) ;;
 	esac
       done
       if test "${feature_conflict_with_gtk}" = "yes"; then
 	XE_DIE(["One or more GUI toolkit features conflict with GTK"])
       fi
 
-      test "${enable_scrollbars}" != "no" && enable_scrollbars=gtk
-      test "${enable_toolbars}" != "no" && enable_toolbars=gtk
-      test "${enable_menubars}" != "no" && enable_menubars=gtk
-      test "${enable_dialogs}" != "no" && enable_dialogs=gtk
-      test "${enable_widgets}" != "no" && enable_widgets=gtk
+      test "${with_scrollbars}" != "no" && with_scrollbars=gtk
+      test "${with_toolbars}" != "no" && with_toolbars=gtk
+      test "${with_menubars}" != "no" && with_menubars=gtk
+      test "${with_dialogs}" != "no" && with_dialogs=gtk
+      test "${with_widgets}" != "no" && with_widgets=gtk
 
       dnl Check for libglade support (it rocks)
       OLD_CFLAGS="${CFLAGS}"
@@ -3054,8 +3138,8 @@
   AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
 
   if test "${x11_release}" = "4"; then
-    case "$enable_widgets" in
-      "" | "no") enable_widgets=no ;;
+    case "$with_widgets" in
+      "" | "no") with_widgets=no ;;
       *) XE_DIE("Widget support requires X11R5 or greater") ;;
     esac
   fi
@@ -3160,9 +3244,9 @@
       dnl #### detect fontconfig properly!!!!
       with_fontconfig=yes
       AC_DEFINE(HAVE_FONTCONFIG)
-      AC_DEFINE(USE_XFT)
+      AC_DEFINE(HAVE_XFT)
       dnl Due to interactions with other libraries, must postpone AC_DEFINE
-      dnl of USE_XFT_MENUBARS, USE_XFT_TABS, and USE_XFT_GAUGES.
+      dnl of HAVE_XFT_MENUBARS, HAVE_XFT_TABS, and HAVE_XFT_GAUGES.
       unset xft_includes_found
     fi
   fi
@@ -3191,11 +3275,11 @@
     fi
     if test "$window_system" != x11; then
       window_system=msw
-      test "$enable_scrollbars" != "no" && enable_scrollbars=msw
-      test "$enable_menubars"   != "no" && enable_menubars=msw
-      test "$enable_toolbars"   != "no" && enable_toolbars=msw
-      test "$enable_dialogs"    != "no" && enable_dialogs=msw
-      test "$enable_widgets"    != "no" && enable_widgets=msw
+      test "$with_scrollbars" != "no" && with_scrollbars=msw
+      test "$with_menubars"   != "no" && with_menubars=msw
+      test "$with_toolbars"   != "no" && with_toolbars=msw
+      test "$with_dialogs"    != "no" && with_dialogs=msw
+      test "$with_widgets"    != "no" && with_widgets=msw
     fi
     dnl check for our special version of select
     AC_RUN_IFELSE([AC_LANG_SOURCE([#include <fcntl.h>
@@ -3213,13 +3297,13 @@
 if test "$window_system" = "none"; then
   for feature in menubars scrollbars toolbars dialogs dragndrop xface
   do
-    if eval "test -n \"\$enable_${feature}\" -a \"\$enable_${feature}\" != no" ; then
-       AC_MSG_WARN([--enable-$feature ignored:  Not valid without window system support])
+    if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
+       AC_MSG_WARN([--with-$feature ignored:  Not valid without window system support])
     fi
-    eval "enable_${feature}=no"
+    eval "with_${feature}=no"
   done
 else
-  test -z "$enable_toolbars" && enable_toolbars=yes
+  test -z "$with_toolbars" && with_toolbars=yes
 fi
 
 dnl ### Test for features that require mswindows support - currently none
@@ -3243,7 +3327,7 @@
   dnl if test "$with_tty" = "no" ; then
   dnl   AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.])
   dnl fi
-  for feature in with_tooltalk with_cde with_wmcommand with_xim enable_sound_nas
+  for feature in with_tooltalk with_cde with_wmcommand with_xim with_sound_nas
   do
     if eval "test -n \"\$${feature}\" -a \"\$${feature}\" != \"no\"" ; then
        AC_MSG_WARN([--$feature ignored:  Not valid without X support])
@@ -3309,7 +3393,7 @@
 dnl If g++ is used, we have to explicitly link modules with -lstdc++ on Cygwin
 dnl to avoid undefined symbol errors.  This will never hurt, so just do it on
 dnl all platforms in case others have the same brain damage.
-if test "$with_xemacs_compiler" = "g++"; then
+if test "$XEMACS_CC_GPP" = "yes"; then
   LIBSTDCPP=-lstdc++
 else
   LIBSTDCPP=
@@ -3317,7 +3401,7 @@
 AC_SUBST(LIBSTDCPP)
 
 dnl This must come before the detection code for anything that is in a module
-if test "$enable_modules" != "no"; then
+if test "$with_modules" != "no"; then
   AC_MSG_CHECKING([for module support])
   AC_MSG_RESULT()
 
@@ -3395,22 +3479,22 @@
     XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR)
     test -n "$libdl" && XE_PREPEND(-l${libdl}, LIBS)
     AC_CHECK_FUNCS(dlerror _dlerror)
-    enable_modules=yes
+    with_modules=yes
     MOD_CC="../../lib-src/ellcc"
     MODCFLAGS="\$(CFLAGS) --mode=compile --mod-output=\$@ -I../../src -I\$(srcdir)/../../src"
     INSTALLPATH="\$(moduledir)"
     MOD_INSTALL_PROGRAM=${INSTALL_PROGRAM}
     OBJECT_TO_BUILD="\$(MODNAME).ell"
   else
-    if test "$enable_modules" = "yes"; then
+    if test "$with_modules" = "yes"; then
       XE_DIE("Required module support cannot be provided.")
     else
       echo "    No module support."
     fi
-    enable_modules=no
+    with_modules=no
   fi
 fi
-if test "$enable_modules" != "yes"; then
+if test "$with_modules" != "yes"; then
   MOD_CC="$XEMACS_CC"
   MODCFLAGS="\$(XE_CFLAGS) -I../../src -I\$(srcdir)/../../src"
   INSTALLPATH=""
@@ -3419,7 +3503,7 @@
 fi
 MODARCHDIR=
 MAKE_DOCFILE="../../lib-src/make-docfile"
-AC_SUBST(with_modules, $enable_modules)
+AC_SUBST(with_modules, $with_modules)
 AC_SUBST(MOD_CC)
 AC_SUBST(MODARCHDIR)
 AC_SUBST(MAKE_DOCFILE)
@@ -3535,7 +3619,7 @@
   LIBS="$save_LIBS"
   XE_APPEND(modules/ldap, MAKE_SUBDIR)
   need_modules_common=yes
-  if test "$enable_modules" = "yes"; then
+  if test "$with_modules" = "yes"; then
     XE_APPEND(modules/ldap, INSTALL_ARCH_DEP_SUBDIR)
   fi
 fi
@@ -3586,7 +3670,7 @@
     XE_PREPEND([$pq_libs], postgresql_libs)
     XE_APPEND(modules/postgresql, MAKE_SUBDIR)
     need_modules_common=yes
-    if test "$enable_modules" = "yes"; then
+    if test "$with_modules" = "yes"; then
       XE_APPEND(modules/postgresql, INSTALL_ARCH_DEP_SUBDIR)
     fi
   elif test "$with_postgresql" = "yes"; then
@@ -3802,12 +3886,12 @@
   AC_MSG_RESULT()
 fi
 
-case "$enable_widgets" in
+case "$with_widgets" in
   "" | "yes" | "athena")	detect_athena=yes ;;
    *)				detect_athena=no ;;
 esac
 
-case "$enable_dialogs" in
+case "$with_dialogs" in
   "" | "yes" | "athena")	detect_athena=yes ;;
 esac
 
@@ -3971,8 +4055,8 @@
   * )        lucid_prefers_motif="yes" ;;
 esac
 
-case "$enable_menubars" in "" | "yes" | "athena" )
-  enable_menubars="lucid" ;;
+case "$with_menubars" in "" | "yes" | "athena" )
+  with_menubars="lucid" ;;
 esac
 dnl this is not in xft reloaded #3
 if test "$with_xft_menubars" != "no" ; then
@@ -3982,42 +4066,42 @@
     with_xft_menubars="no"
   fi
 fi
-case "$enable_dialogs" in "" | "yes" | "lucid" )
+case "$with_dialogs" in "" | "yes" | "lucid" )
   if test "$lucid_prefers_motif" = "yes"; then
-    if   test "$have_motif"     = "yes"; then enable_dialogs="motif"
-    elif test "$have_xaw"       = "yes"; then enable_dialogs="athena"
-    elif test "$with_msw"       = "yes"; then enable_dialogs="msw"
-    else enable_dialogs=no
+    if   test "$have_motif"     = "yes"; then with_dialogs="motif"
+    elif test "$have_xaw"       = "yes"; then with_dialogs="athena"
+    elif test "$with_msw"       = "yes"; then with_dialogs="msw"
+    else with_dialogs=no
     fi
   else
-    if   test "$have_xaw"       = "yes"; then enable_dialogs="athena"
-    elif test "$have_motif"     = "yes"; then enable_dialogs="motif"
-    elif test "$with_msw"       = "yes"; then enable_dialogs="msw"
-    else enable_dialogs=no
+    if   test "$have_xaw"       = "yes"; then with_dialogs="athena"
+    elif test "$have_motif"     = "yes"; then with_dialogs="motif"
+    elif test "$with_msw"       = "yes"; then with_dialogs="msw"
+    else with_dialogs=no
     fi
   fi ;;
 esac
-case "$enable_scrollbars" in "" | "yes" )
-  enable_scrollbars="lucid" ;;
+case "$with_scrollbars" in "" | "yes" )
+  with_scrollbars="lucid" ;;
 esac
-case "$enable_widgets" in "" | "yes" | "lucid")
+case "$with_widgets" in "" | "yes" | "lucid")
   if test "$lucid_prefers_motif" = "yes"; then
-    if   test "$have_motif" = "yes"; then enable_widgets="motif"
-    elif test "$have_xaw"   = "yes"; then enable_widgets="athena"
-    elif test "$with_msw"   = "yes"; then enable_widgets="msw"
-    else enable_widgets=no
+    if   test "$have_motif" = "yes"; then with_widgets="motif"
+    elif test "$have_xaw"   = "yes"; then with_widgets="athena"
+    elif test "$with_msw"   = "yes"; then with_widgets="msw"
+    else with_widgets=no
     fi
   else
-    if   test "$have_xaw"   = "yes"; then enable_widgets="athena"
-    elif test "$have_motif" = "yes"; then enable_widgets="motif"
-    elif test "$with_msw"   = "yes"; then enable_widgets="msw"
-    else enable_widgets=no
+    if   test "$have_xaw"   = "yes"; then with_widgets="athena"
+    elif test "$have_motif" = "yes"; then with_widgets="motif"
+    elif test "$with_msw"   = "yes"; then with_widgets="msw"
+    else with_widgets=no
     fi
   fi ;;
 esac
 dnl this is not in xft reloaded #3
 if test "$with_xft_tabs" != "no" ; then
-  if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then
+  if test "$with_xft_emacs" = "yes" -a "$with_widgets" != "no" ; then
     with_xft_tabs="yes"
   else
     with_xft_tabs="no"
@@ -4025,14 +4109,14 @@
 fi
 dnl this is not in xft reloaded #3
 if test "$with_xft_gauges" != "no" ; then
-  if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then
+  if test "$with_xft_emacs" = "yes" -a "$with_widgets" != "no" ; then
     with_xft_gauges="yes"
   else
     with_xft_gauges="no"
   fi
 fi
 
-all_widgets="$enable_menubars $enable_scrollbars $enable_dialogs $enable_toolbars $enable_widgets"
+all_widgets="$with_menubars $with_scrollbars $with_dialogs $with_toolbars $with_widgets"
 
 case "$all_widgets" in
   *athena* )
@@ -4078,12 +4162,12 @@
   need_motif=yes ;;
 esac
 
-test "$enable_menubars"   = "lucid" && XE_APPEND(xlwmenu.o, lwlib_objs)
-test "$enable_menubars"   = "motif" && XE_APPEND(xlwmenu.o, lwlib_objs)
-test "$enable_scrollbars" = "lucid" && XE_APPEND(xlwscrollbar.o, lwlib_objs)
-test "$enable_widgets"   != "no" && test "$enable_widgets" != "msw" && \
+test "$with_menubars"   = "lucid" && XE_APPEND(xlwmenu.o, lwlib_objs)
+test "$with_menubars"   = "motif" && XE_APPEND(xlwmenu.o, lwlib_objs)
+test "$with_scrollbars" = "lucid" && XE_APPEND(xlwscrollbar.o, lwlib_objs)
+test "$with_widgets"   != "no" && test "$with_widgets" != "msw" && \
 	XE_APPEND(xlwtabs.o xlwgcs.o, lwlib_objs)
-case "$enable_widgets" in athena* )
+case "$with_widgets" in athena* )
 	XE_APPEND(xlwradio.o xlwcheckbox.o xlwgauge.o, lwlib_objs);;
 esac
 case "$all_widgets" in *lucid* )
@@ -4093,50 +4177,50 @@
 
 AC_SUBST(lwlib_objs)
 
-test "$enable_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA)
-test "$enable_dialogs"    = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA)
+test "$with_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA)
+test "$with_dialogs"    = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA)
 
 if test "$athena_3d" = "yes"; then
-  test "$enable_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D)
-  test "$enable_dialogs"    = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA3D)
-fi
-
-case "$enable_widgets" in athena* ) AC_DEFINE(LWLIB_WIDGETS_ATHENA);; esac
-test "$enable_widgets" != "no" && test "$enable_widgets" != "msw" && \
+  test "$with_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D)
+  test "$with_dialogs"    = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA3D)
+fi
+
+case "$with_widgets" in athena* ) AC_DEFINE(LWLIB_WIDGETS_ATHENA);; esac
+test "$with_widgets" != "no" && test "$with_widgets" != "msw" && \
 	AC_DEFINE(LWLIB_TABS_LUCID)
 
-test "$enable_menubars"   != "no"    && AC_DEFINE(HAVE_MENUBARS)
-test "$enable_scrollbars" != "no"    && AC_DEFINE(HAVE_SCROLLBARS)
-test "$enable_dialogs"    != "no"    && AC_DEFINE(HAVE_DIALOGS)
-test "$enable_toolbars"   != "no"    && AC_DEFINE(HAVE_TOOLBARS)
-test "$enable_widgets"    != "no"    && AC_DEFINE(HAVE_WIDGETS)
-
-test "$enable_menubars"   = "lucid"  && AC_DEFINE(LWLIB_MENUBARS_LUCID)
-test "$enable_scrollbars" = "lucid"  && AC_DEFINE(LWLIB_SCROLLBARS_LUCID)
-
-test "$enable_menubars"   = "motif"  && AC_DEFINE(LWLIB_MENUBARS_MOTIF)
-test "$enable_scrollbars" = "motif"  && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF)
-test "$enable_dialogs"    = "motif"  && AC_DEFINE(LWLIB_DIALOGS_MOTIF)
-test "$enable_widgets"    = "motif"  && AC_DEFINE(LWLIB_WIDGETS_MOTIF)
-
-test "$with_xft_menubars" = "yes"  && AC_DEFINE(USE_XFT_MENUBARS)
-test "$with_xft_tabs" = "yes"  && AC_DEFINE(USE_XFT_TABS)
-test "$with_xft_gauges" = "yes"  && AC_DEFINE(USE_XFT_GAUGES)
+test "$with_menubars"   != "no"    && AC_DEFINE(HAVE_MENUBARS)
+test "$with_scrollbars" != "no"    && AC_DEFINE(HAVE_SCROLLBARS)
+test "$with_dialogs"    != "no"    && AC_DEFINE(HAVE_DIALOGS)
+test "$with_toolbars"   != "no"    && AC_DEFINE(HAVE_TOOLBARS)
+test "$with_widgets"    != "no"    && AC_DEFINE(HAVE_WIDGETS)
+
+test "$with_menubars"   = "lucid"  && AC_DEFINE(LWLIB_MENUBARS_LUCID)
+test "$with_scrollbars" = "lucid"  && AC_DEFINE(LWLIB_SCROLLBARS_LUCID)
+
+test "$with_menubars"   = "motif"  && AC_DEFINE(LWLIB_MENUBARS_MOTIF)
+test "$with_scrollbars" = "motif"  && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF)
+test "$with_dialogs"    = "motif"  && AC_DEFINE(LWLIB_DIALOGS_MOTIF)
+test "$with_widgets"    = "motif"  && AC_DEFINE(LWLIB_WIDGETS_MOTIF)
+
+test "$with_xft_menubars" = "yes"  && AC_DEFINE(HAVE_XFT_MENUBARS)
+test "$with_xft_tabs" = "yes"  && AC_DEFINE(HAVE_XFT_TABS)
+test "$with_xft_gauges" = "yes"  && AC_DEFINE(HAVE_XFT_GAUGES)
 
 dnl ----------------------
 dnl Mule-dependent options
 dnl ----------------------
 
-test -z "$enable_mule" && enable_mule=no
-
-dnl if test "$enable_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then
+test -z "$with_mule" && with_mule=no
+
+dnl if test "$with_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then
 dnl	echo "Attempt to Build with Mule without Mule/Lisp"
 dnl	echo "Please install the XEmacs/Mule tarball or"
 dnl	echo "rerun configure with --with-mule=no"
 dnl	exit 1
 dnl fi
 
-if test "$enable_default_eol_detection" = "yes"; then
+if test "$with_default_eol_detection" = "yes"; then
   AC_DEFINE(HAVE_DEFAULT_EOL_DETECTION)
 fi
 
@@ -4144,7 +4228,7 @@
 canna_libs=
 wnn_libs=
 
-if test "$enable_mule" = "yes" ; then
+if test "$with_mule" = "yes" ; then
   AC_MSG_CHECKING([for Mule-related features])
   AC_DEFINE(MULE)
 
@@ -4187,7 +4271,7 @@
   if test "$with_xfs" = "yes" ; then
     AC_MSG_CHECKING([for XFontSet])
     AC_CHECK_LIB(X11, XmbDrawString, [:], with_xfs=no)
-    if test "$with_xfs" = "yes" && test "$enable_menubars" = "lucid"; then
+    if test "$with_xfs" = "yes" && test "$with_menubars" = "lucid"; then
       AC_DEFINE(USE_XFONTSET)
       if test "$with_xim" = "no" ; then
         XE_ADD_OBJS(input-method-xlib.o)
@@ -4270,7 +4354,7 @@
   fi
 AC_SUBST(canna_libs)
 
-else dnl "$enable_mule" = "no"
+else dnl "$with_mule" = "no"
   for feature in xim canna wnn; do
     if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then
       AC_MSG_WARN([--with-${feature} ignored:  Not valid without Mule support])
@@ -4288,6 +4372,12 @@
   XE_COMPUTE_RUNPATH()
 fi
 
+dnl Check for UTF-8 path-conversion functions in Cygwin 1.7 and on
+case "$opsys" in
+  *cygwin* ) AC_CHECK_FUNCS(cygwin_conv_path)
+	 ;;
+esac
+
 dnl ----------------------------------------------------------------
 dnl Check for POSIX functions.
 dnl ----------------------------------------------------------------
@@ -4713,9 +4803,9 @@
 AC_MSG_RESULT()
 
 dnl Autodetect native sound
-test -n "$with_native_sound_lib" && enable_sound_native=yes
-
-if test "$enable_sound_native" != "no"; then
+test -n "$with_native_sound_lib" && with_sound_native=yes
+
+if test "$with_sound_native" != "no"; then
   dnl Maybe sound is already on include path...
   if test -n "$with_native_sound_lib"; then
     AC_CHECK_HEADER(multimedia/audio_device.h,
@@ -4817,42 +4907,42 @@
   fi
 
   if test "$sound_found" = "yes"; then
-    enable_sound_native=yes
+    with_sound_native=yes
   else
-    if test "$enable_sound_native" = "yes" ; then
+    if test "$with_sound_native" = "yes" ; then
       AC_MSG_WARN([No native libraries found.  Disabling native sound support.])
     fi
-    enable_sound_native=no     
+    with_sound_native=no     
   fi
 fi
 
-if test "$enable_sound_native" = "yes"; then
+if test "$with_sound_native" = "yes"; then
   AC_DEFINE(HAVE_NATIVE_SOUND)
   test -n "$with_native_sound_lib" && XE_PREPEND($with_native_sound_lib, LIBS)
 fi
 
 dnl ALSA sound support
-if test "$enable_sound_alsa" != "no"; then
+if test "$with_sound_alsa" != "no"; then
   AC_CHECK_HEADER([alsa/input.h], [
     AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_sound=yes)])
   if test "$have_alsa_sound" = "yes"; then
-    enable_sound_alsa=yes
+    with_sound_alsa=yes
     AC_DEFINE(HAVE_ALSA_SOUND)
     XE_ADD_OBJS(alsaplay.o)
     XE_PREPEND(-lasound, LIBS)
   else
-    test "$enable_sound_alsa" = "yes" && \
+    test "$with_sound_alsa" = "yes" && \
       XE_DIE("Required ALSA sound support cannot be provided.")
-    enable_sound_alsa=no
+    with_sound_alsa=no
   fi
 fi
 
 dnl NAS Sound support
-if test "$enable_sound_nas" != "no"; then
+if test "$with_sound_nas" != "no"; then
   AC_CHECK_HEADER(audio/audiolib.h, [
     AC_CHECK_LIB(audio, AuOpenServer, have_nas_sound=yes)])
   if test "$have_nas_sound" = "yes"; then
-    enable_sound_nas=yes
+    with_sound_nas=yes
     AC_DEFINE(HAVE_NAS_SOUND)
     XE_ADD_OBJS(nas.o)
     XE_PREPEND(-laudio, libs_x)
@@ -4860,14 +4950,14 @@
     dnl then we force safer behavior.
     AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[old_nas=yes; AC_DEFINE(NAS_NO_ERROR_JUMP)])
   else
-    test "$enable_sound_nas" = "yes" && \
+    test "$with_sound_nas" = "yes" && \
       XE_DIE("Required NAS sound support cannot be provided.")
-    enable_sound_nas=no
+    with_sound_nas=no
   fi
 fi
 
 dnl ESD Sound support
-if test "$enable_sound_esd" != "no"; then
+if test "$with_sound_esd" != "no"; then
   AC_CHECK_PROG(have_esd_config, esd-config, yes, no)
   if test "$have_esd_config" = "yes"; then
     save_c_switch_site="$c_switch_site" save_LIBS="$LIBS"
@@ -4879,14 +4969,14 @@
   fi
 
   if test "$have_esd_sound" = "yes"; then
-    enable_sound_esd=yes
+    with_sound_esd=yes
     need_miscplay=yes
     XE_ADD_OBJS(esd.o)
     AC_DEFINE(HAVE_ESD_SOUND)
   else
-    test "$enable_sound_esd" = "yes" && \
+    test "$with_sound_esd" = "yes" && \
       XE_DIE("Required ESD sound support cannot be provided.")
-    enable_sound_esd=no
+    with_sound_esd=no
   fi
 fi
 
@@ -4984,51 +5074,68 @@
 dnl On FreeBSD, both DB and DBM are part of libc.
 dnl By default, we check for DBM support in libgdbm, then libc, then libdbm.
 
-test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \
+test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
   != "no no no" && AC_MSG_CHECKING([for database support]) && \
   AC_MSG_RESULT()
 
 dnl Check for ndbm.h, required for either kind of DBM support.
 dnl #### Should we check for gdbm.h, too?  (Seen on MacPorts.)
-if test "$enable_database_gdbm $enable_database_dbm" != "no no"; then
+if test "$with_database_gdbm $with_database_dbm" != "no no"; then
   ndbm_h_file=""
   AC_CHECK_HEADERS([ndbm.h gdbm/ndbm.h],[ndbm_h_file=$ac_header; break;],[],[])
   if test "x$ndbm_h_file" = "x"; then
-    test "$enable_database_gdbm" = "yes" -o \
-         "$enable_database_dbm"  = "yes" && \
+    test "$with_database_gdbm" = "yes" -o \
+         "$with_database_dbm"  = "yes" && \
       XE_DIE("Required DBM support cannot be provided.")
-    enable_database_gdbm=no enable_database_dbm=no]
+    with_database_gdbm=no with_database_dbm=no]
   fi
 fi
 
 dnl Check for DBM support in libgdbm.
-if test "$enable_database_gdbm" != "no"; then
+if test "$with_database_gdbm" != "no"; then
   AC_CHECK_LIB(gdbm, dbm_open, [
-   enable_database_gdbm=yes enable_database_dbm=no libdbm=-lgdbm], [
+   with_database_gdbm=yes with_database_dbm=no libdbm=-lgdbm], [
        AC_CHECK_LIB(gdbm_compat, dbm_open, [
-       enable_database_gdbm=yes enable_database_dbm=no libdbm="-lgdbm_compat -lgdbm"], [
-   if test "$enable_database_gdbm" = "yes"; then
+       with_database_gdbm=yes with_database_dbm=no libdbm="-lgdbm_compat -lgdbm"], [
+   if test "$with_database_gdbm" = "yes"; then
      XE_DIE("Required GNU DBM support cannot be provided.")
    fi
-   enable_database_gdbm=no], -lgdbm)
+   with_database_gdbm=no], -lgdbm)
   ])
 fi
 
 dnl Check for DBM support in libc and libdbm.
-if test "$enable_database_dbm" != "no"; then
-  AC_CHECK_FUNC(dbm_open, [enable_database_dbm=yes libdbm=], [
-    AC_CHECK_LIB(dbm, dbm_open, [enable_database_dbm=yes libdbm=-ldbm], [
-      test "$enable_database_dbm" = "yes" && \
+if test "$with_database_dbm" != "no"; then
+  AC_CHECK_FUNC(dbm_open, [with_database_dbm=yes libdbm=], [
+    AC_CHECK_LIB(dbm, dbm_open, [with_database_dbm=yes libdbm=-ldbm], [
+      test "$with_database_dbm" = "yes" && \
         XE_DIE("Required DBM support cannot be provided.")
-      enable_database_dbm=no])])
+      with_database_dbm=no])])
 fi
 
 dnl Tell make about the DBM support we detected.
 test -n "$libdbm" && XE_PREPEND("$libdbm", LIBS)
-if test "$enable_database_gdbm" = "yes" -o \
-        "$enable_database_dbm"  = "yes"; then
+if test "$with_database_gdbm" = "yes" -o \
+        "$with_database_dbm"  = "yes"; then
   AC_DEFINE_UNQUOTED(NDBM_H_FILE,"$ndbm_h_file")
   AC_DEFINE(HAVE_DBM)
+  dnl gdbm's ndbm.h has old-style prototypes with missing arguments.
+  dnl These just don't cut it for c++.  So if we're using c++, then
+  dnl test whether we can make a dbm call, using dbm_close(DBM *).
+  if test "$XEMACS_CC_GPP" = "yes"; then
+    AC_MSG_RESULT()
+    AC_LANG_PUSH(C++)
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "$ndbm_h_file"],
+    [dbm_close((DBM *) 0);])],
+      [AC_MSG_CHECKING(whether ndbm.h is compatible with g++)
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(TRUST_NDBM_H_PROTOTYPES)],
+      [AC_MSG_CHECKING(whether ndbm.h is compatible with g++)
+       AC_MSG_RESULT(no)])
+    AC_LANG_POP()
+  else
+    AC_DEFINE(TRUST_NDBM_H_PROTOTYPES)
+  fi
   $as_unset ndbm_h_file
 fi
 
@@ -5036,7 +5143,7 @@
 AC_CHECK_TYPES([u_int8_t, u_int16_t, u_int32_t])
 
 dnl Check for Berkeley DB.
-if test "$enable_database_berkdb" != "no"; then
+if test "$with_database_berkdb" != "no"; then
   AC_MSG_CHECKING(for Berkeley db.h)
   for header in "db/db.h" "db.h"; do
     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
@@ -5065,11 +5172,11 @@
 ])], db_h_file="$header"; break)
   done
   if test -z "$db_h_file"
-  then AC_MSG_RESULT(no); enable_database_berkdb=no
+  then AC_MSG_RESULT(no); with_database_berkdb=no
   else AC_MSG_RESULT($db_h_file)
   fi
 
-  if test "$enable_database_berkdb" != "no"; then
+  if test "$with_database_berkdb" != "no"; then
     AC_MSG_CHECKING(for Berkeley DB version)
     AC_EGREP_CPP(yes,
 [#include <$db_h_file>
@@ -5090,12 +5197,12 @@
     AC_MSG_RESULT(3); dbfunc=db_create; dbver=3])],[
     AC_MSG_RESULT(2); dbfunc=db_open; dbver=2])],[
     AC_MSG_RESULT(1); dbfunc=dbopen; dbver=1])
-    AC_CHECK_FUNC($dbfunc,     enable_database_berkdb=yes need_libdb=no, [
-    AC_CHECK_LIB(db, $dbfunc,  enable_database_berkdb=yes need_libdb=yes)])
+    AC_CHECK_FUNC($dbfunc,     with_database_berkdb=yes need_libdb=no, [
+    AC_CHECK_LIB(db, $dbfunc,  with_database_berkdb=yes need_libdb=yes)])
   fi
 
   dnl Berk db 4.1 decorates public functions with version information
-  if test "$enable_database_berkdb" = "yes" -a "$dbver" = "4"; then
+  if test "$with_database_berkdb" = "yes" -a "$dbver" = "4"; then
     rm -f $tempcname
     echo "#include <$db_h_file>" > $tempcname
     echo "configure___ dbfunc=db_create" >> $tempcname
@@ -5104,18 +5211,18 @@
 	| sed -n -e "s/[[ TAB]]*=[[ TAB\"]]*/='/" -e "s/[[ TAB\"]]*\$/'/" -e "s/^configure___//p"`
     rm -f $tempcname
     AC_MSG_WARN("db_create is really $dbfunc")
-    AC_CHECK_LIB(db, $dbfunc,  enable_database_berkdb=yes need_libdb=yes)
+    AC_CHECK_LIB(db, $dbfunc,  with_database_berkdb=yes need_libdb=yes)
   fi
 
-  if test "$enable_database_berkdb" = "yes"; then
+  if test "$with_database_berkdb" = "yes"; then
     AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file")
     AC_DEFINE(HAVE_BERKELEY_DB)
     test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS)
-  else enable_database_berkdb=no
+  else with_database_berkdb=no
   fi
 fi
 
-if test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \
+if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
      != "no no no"; then
   AC_DEFINE(HAVE_DATABASE)
 fi
@@ -5133,7 +5240,7 @@
 fi
 
 dnl Enhanced number support
-if test "$enable_bignum" = "gmp"; then
+if test "$with_bignum" = "gmp"; then
   AC_CHECK_HEADER(gmp.h, [
     AC_CHECK_LIB(gmp, __gmpz_init, have_mpz_init=yes)])
   if test "$have_mpz_init" = "yes"; then
@@ -5143,7 +5250,7 @@
   else
     XE_DIE("Required GMP numeric support cannot be provided.")
   fi
-elif test "$enable_bignum" = "mp"; then
+elif test "$with_bignum" = "mp"; then
   for library in "" "-lcrypto"; do
     AC_CHECK_HEADER(mp.h, [
       AC_CHECK_LIB(mp, mp_mfree, have_mp_mfree=yes; break, [
@@ -5202,7 +5309,7 @@
 
 dnl We ignore (C|LD)_SWITCH_X_(MACHINE|SYSTEM)
 dnl Use XE_SPACE instead of plain assignment statements to remove extraneous blanks
-if test "$enable_modules" = "yes"; then
+if test "$with_modules" = "yes"; then
   ld_libs_module=
 else
   XE_SPACE(ld_libs_module, $ldap_libs $postgresql_libs $canna_libs)
@@ -5221,13 +5328,13 @@
 XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general $ld_libs_module)
 
 dnl For no-module builds, make the src dir last
-if test "$enable_modules" = "no"; then
+if test "$with_modules" = "no"; then
   XE_APPEND(src, MAKE_SUBDIR)
 fi
 
 dnl Compute lists of Makefiles and subdirs
 AC_SUBST(SRC_SUBDIR_DEPS)
-internal_makefile_list="Makefile.in"
+internal_makefile_list="Makefile.in src/.gdbinit.in"
 SUBDIR_MAKEFILES=''
 test -d lock || mkdir lock
 for dir in $MAKE_SUBDIR; do
@@ -5277,11 +5384,8 @@
 
 dnl Unlike TAGS, debugger init files depend on config.h.
 dnl Regenerate them locally on every configure.
-dnl Create a .gdbinit useful for debugging XEmacs
-if test -f "$srcdir/etc/gdbinit.in"; then
-  test "$verbose" = "yes" && echo "creating src/.gdbinit.in"
-  cp $srcdir/etc/gdbinit.in src/.gdbinit.in
-fi
+dnl .gdbinit is now handled like xemacs.def or other src files, and
+dnl its source is in src/.gdbinit.in.in.
 
 dnl Create a .dbxrc useful for debugging XEmacs
 if test -f "$srcdir/etc/dbxrc.in"; then
@@ -5481,22 +5585,24 @@
 elif test "$with_debug_malloc"  = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC)
 					      AC_DEFINE(USE_SYSTEM_MALLOC)
 fi
-test "$GCC"                = "yes" && AC_DEFINE(USE_GCC)
-test "$enable_external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
-test "$enable_kkcc"        = "yes" && AC_DEFINE(USE_KKCC)
-test "$enable_newgc"       = "yes" && AC_DEFINE(NEW_GC)
-test "$have_vdb_posix"     = "yes" && AC_DEFINE(VDB_POSIX)
-test "$have_vdb_fake"      = "yes" && AC_DEFINE(VDB_FAKE)
-test "$enable_quick_build" = "yes" && AC_DEFINE(QUICK_BUILD)
-test "$with_purify"        = "yes" && AC_DEFINE(PURIFY)
-test "$with_quantify"      = "yes" && AC_DEFINE(QUANTIFY)
-test "$with_pop"           = "yes" && AC_DEFINE(MAIL_USE_POP)
-test "$with_kerberos"      = "yes" && AC_DEFINE(KERBEROS)
-test "$with_hesiod"        = "yes" && AC_DEFINE(HESIOD)
-test "$enable_union_type"  = "yes" && AC_DEFINE(USE_UNION_TYPE)
-test "$enable_pdump"       = "yes" && AC_DEFINE(PDUMP)
-test "$enable_dump_in_exec" = "yes" && AC_DEFINE(DUMP_IN_EXEC)
-test "$with_ipv6_cname"    = "yes" && AC_DEFINE(IPV6_CANONICALIZE)
+test "$GCC"                  = "yes" && AC_DEFINE(USE_GCC)
+test "$XEMACS_CC_GPP"        = "yes" && AC_DEFINE(USE_GPLUSPLUS)
+test "$with_external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
+test "$with_kkcc"            = "yes" && AC_DEFINE(USE_KKCC)
+test "$with_newgc"           = "yes" && AC_DEFINE(NEW_GC)
+test "$have_vdb_posix"       = "yes" && AC_DEFINE(VDB_POSIX)
+test "$have_vdb_fake"        = "yes" && AC_DEFINE(VDB_FAKE)
+test "$with_quick_build"     = "yes" && AC_DEFINE(QUICK_BUILD)
+test "$with_purify"          = "yes" && AC_DEFINE(PURIFY)
+test "$with_quantify"        = "yes" && AC_DEFINE(QUANTIFY)
+test "$with_valgrind"        = "yes" && AC_DEFINE(USE_VALGRIND)
+test "$with_pop"             = "yes" && AC_DEFINE(MAIL_USE_POP)
+test "$with_kerberos"        = "yes" && AC_DEFINE(KERBEROS)
+test "$with_hesiod"          = "yes" && AC_DEFINE(HESIOD)
+test "$with_union_type"      = "yes" && AC_DEFINE(USE_UNION_TYPE)
+test "$with_pdump"           = "yes" && AC_DEFINE(PDUMP)
+test "$with_dump_in_exec"    = "yes" && AC_DEFINE(DUMP_IN_EXEC)
+test "$with_ipv6_cname"      = "yes" && AC_DEFINE(IPV6_CANONICALIZE)
 
 
 
@@ -5578,7 +5684,7 @@
 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
 case "$ld_switch_site" in
   *nocombreloc*) echo "  Linking with \`-z nocombreloc'.
-    - Consider configuring with --enable-pdump." ;;
+    - Consider configuring with --with-pdump." ;;
 esac
 
 echo "
@@ -5618,39 +5724,39 @@
   echo "    - Athena headers location:                    $athena_h_path"
   echo "    - Athena library to link:                     $athena_lib"
 fi
-case "$enable_menubars" in
+case "$with_menubars" in
   gtk   ) echo "  Using GTK menubars."   ;;
   lucid ) echo "  Using Lucid menubars." ;;
   motif ) echo "  Using Motif menubars."
           echo "  *WARNING*  The Motif menubar implementation is currently buggy."
           echo "             We recommend using the Lucid menubar instead."
-          echo "             Re-run configure with --enable-menubars='lucid'." ;;
+          echo "             Re-run configure with --with-menubars='lucid'." ;;
     msw ) echo "  Using MS-Windows menubars." ;;
 esac
 if test "$with_xft_menubars" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in menubars."
-  echo "      WARNING: This feature will be replaced with a face."
-fi
-case "$enable_scrollbars" in
+  echo "      WARNING: This Xft feature will be replaced with a face."
+fi
+case "$with_scrollbars" in
   gtk    ) echo "  Using GTK scrollbars."        ;;
   lucid  ) echo "  Using Lucid scrollbars."      ;;
   motif  ) echo "  Using Motif scrollbars."      ;;
   athena ) echo "  Using Athena scrollbars."     ;;
      msw ) echo "  Using MS-Windows scrollbars." ;;
 esac
-case "$enable_dialogs" in
+case "$with_dialogs" in
   gtk    ) echo "  Using GTK dialog boxes." ;;
   motif  ) echo "  Using Motif dialog boxes."
            if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then
              echo "  *WARNING*  The Motif dialog boxes cause problems on AIX 4.3 and higher."
              echo "             We recommend using the Athena dialog boxes instead."
-             echo "             Install libXaw and re-run configure with --enable-dialogs='athena'."
+             echo "             Install libXaw and re-run configure with --with-dialogs='athena'."
              echo "             Read the PROBLEMS file for more information."
            fi; fi ;;
   athena ) echo "  Using Athena dialog boxes."     ;;
      msw ) echo "  Using MS-Windows dialog boxes." ;;
 esac
-case "$enable_widgets" in
+case "$with_widgets" in
   gtk    ) echo "  Using GTK native widgets."        ;;
   motif  ) echo "  Using Motif native widgets."      ;;
   athena ) echo "  Using Athena native widgets."     ;;
@@ -5658,12 +5764,12 @@
 esac
 if test "$with_xft_tabs" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in tab controls."
-  echo "      WARNING: This feature will be replaced with a face."
+  echo "      WARNING: This Xft feature will be replaced with a face."
 fi
 if test "$with_xft_gauges" = "yes"; then
   echo "    - Using Xft to render antialiased fonts in progress bars."
-  echo "      WARNING: This feature will be replaced with a face."
-  echo "      WARNING: This feature not yet implemented; setting ignored."
+  echo "      WARNING: This Xft feature will be replaced with a face."
+  echo "      WARNING: This Xft feature not yet implemented; setting ignored."
 fi
 if test "$with_dragndrop" = yes; then
   echo "  Compiling in support for Drag'n'Drop (EXPERIMENTAL)."
@@ -5710,17 +5816,17 @@
 
 echo "
 Sound:"
-test "$enable_sound_native" = yes && echo "  Compiling in support for sound (native)."
-test "$enable_sound_alsa" = yes && echo "  Compiling in support for ALSA (Advanced Linux Sound Architecture)."
-test "$enable_sound_nas" = yes && echo "  Compiling in support for NAS (network audio system)."
+test "$with_sound_native" = yes && echo "  Compiling in support for sound (native)."
+test "$with_sound_alsa" = yes && echo "  Compiling in support for ALSA (Advanced Linux Sound Architecture)."
+test "$with_sound_nas" = yes && echo "  Compiling in support for NAS (network audio system)."
 test "$old_nas" = yes && echo "    - NAS library lacks error trapping; will play synchronously."
-test "$enable_sound_esd" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
+test "$with_sound_esd" = yes && echo "  Compiling in support for ESD (Enlightened Sound Daemon)."
 
 echo "
 Databases:"
-test "$enable_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
-test "$enable_database_dbm"    = yes && echo "  Compiling in support for DBM."
-test "$enable_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
+test "$with_database_berkdb" = yes && echo "  Compiling in support for Berkeley database."
+test "$with_database_dbm"    = yes && echo "  Compiling in support for DBM."
+test "$with_database_gdbm"   = yes && echo "  Compiling in support for GNU DBM."
 test "$with_ldap" = yes && echo "  Compiling in support for LDAP."
 if test "$with_postgresql" = yes; then
   echo "  Compiling in support for PostgreSQL."
@@ -5730,7 +5836,7 @@
 
 echo "
 Internationalization:"
-test "$enable_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
+test "$with_mule" = yes && echo "  Compiling in support for Mule (multi-lingual Emacs)."
 test "$with_xim" != no && echo "  Compiling in support for XIM (X11R5+ I18N input method)."
 test "$with_xim" = motif && echo "    - Using Motif to provide XIM support."
 test "$with_xim" = xlib && echo "    - Using raw Xlib to provide XIM support."
@@ -5755,10 +5861,10 @@
 test "$with_workshop" = yes && echo "  Compiling in support for Sun WorkShop."
 test "$with_socks" = yes && echo "  Compiling in support for SOCKS."
 test "$with_dnet" = yes && echo "  Compiling in support for DNET."
-test "$enable_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
-test "$enable_bignum" = "gmp" && echo "  Compiling in support for more number types using the GNU MP library."
-test "$enable_bignum" = "mp" && echo "  Compiling in support for more number types using the BSD MP library."
-if test "$enable_union_type" = yes ; then
+test "$with_modules" = "yes" && echo "  Compiling in support for dynamic shared object modules."
+test "$with_bignum" = "gmp" && echo "  Compiling in support for more number types using the GNU MP library."
+test "$with_bignum" = "mp" && echo "  Compiling in support for more number types using the BSD MP library."
+if test "$with_union_type" = yes ; then
   echo "  Using the union type for Lisp_Objects."
   echo "  WARNING: ---------------------------------------------------------"
   echo "  WARNING: This tends to trigger compiler bugs, especially when"
@@ -5768,7 +5874,7 @@
   echo "  WARNING: More recent versions may be safer, or not."
   echo "  WARNING: ---------------------------------------------------------"
 fi
-if test "$enable_kkcc" = yes ; then
+if test "$with_kkcc" = yes ; then
   echo "  Using the new GC mark algorithms (KKCC)."
   echo "  WARNING: ---------------------------------------------------------"
   echo "  WARNING: The new algorithms are experimental. They are enabled by"
@@ -5776,7 +5882,7 @@
   echo "  WARNING: turn it off."
   echo "  WARNING: ---------------------------------------------------------"
 fi
-test "$enable_newgc" = yes && echo "  Using the new incremental garbage collector and the new allocator."
+test "$with_newgc" = yes && echo "  Using the new incremental garbage collector and the new allocator."
 if test "$have_vdb_posix" = yes ; then
   if test "$have_vdb_sigaction" = yes ; then 
     echo "  Using POSIX sigaction() to install fault handler."
@@ -5790,14 +5896,14 @@
 if test "$have_vdb_mach" = yes ; then
   echo "  Using mach exception mechanism as vdb fault handler."
 fi
-if test "$have_vdb_fake" = yes && test "$enable_vdb" == fake; then
+if test "$have_vdb_fake" = yes && test "$with_vdb" == fake; then
   echo "  Virtual dirty bit write barrier manually disabled."
 fi
-test "$enable_pdump" = yes && echo "  Using the new portable dumper."
-test "$enable_dump_in_exec" = yes && echo "  Dumping into executable."
-test "$enable_debug" = yes && echo "  Compiling in support for extra debugging code."
+test "$with_pdump" = yes && echo "  Using the new portable dumper."
+test "$with_dump_in_exec" = yes && echo "  Dumping into executable."
+test "$with_debug" = yes && echo "  Compiling in support for extra debugging code."
 test "$usage_tracking" = yes && echo "  Compiling in support for active usage tracking (Sun internal)."
-if test "$enable_error_checking_extents $enable_error_checking_types $enable_error_checking_text $enable_error_checking_gc $enable_error_checking_malloc $enable_error_checking_glyphs $enable_error_checking_byte_code $enable_error_checking_display $enable_error_checking_structures" \
+if test "$with_error_checking_extents $with_error_checking_types $with_error_checking_text $with_error_checking_gc $with_error_checking_malloc $with_error_checking_glyphs $with_error_checking_byte_code $with_error_checking_display $with_error_checking_structures" \
   != "no no no no no no no no no"; then
   echo "  Compiling in support for runtime error checking."
   echo "  WARNING: ---------------------------------------------------------"
@@ -5805,6 +5911,7 @@
   echo "  WARNING: Error checking is on by default for XEmacs beta releases."
   echo "  WARNING: ---------------------------------------------------------"
 fi
+test "$with_valgrind" = yes && echo "  Compiling in support for memory debugging with Valgrind."
 echo ""
 ) | tee -a Installation
 dnl echo "The above configure report is appended to \"Installation\" file."
@@ -5845,7 +5952,7 @@
   AC_CONFIG_FILES($file)
 done
 AC_CONFIG_FILES(src/paths.h src/xemacs.def.in lib-src/config.values)
-test "$enable_modules" = "yes" && AC_CONFIG_FILES(lib-src/ellcc.h)
+test "$with_modules" = "yes" && AC_CONFIG_FILES(lib-src/ellcc.h)
 
 
 dnl Normally []'s are used for quoting but this will cause problems
--- a/etc/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,21 @@
+2010-01-28  Jerry James  <james@xemacs.org>
+
+	* tests/external-widget/Makefile: Add copyright and license
+	boilerplate text based on Ben's recollection.
+	* tests/external-widget/test-ew-motif.c: Ditto.
+	* tests/external-widget/test-ew-xlib.c: Ditto.
+	* unicode/other/lao.txt: Ditto.
+
+2010-01-26  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* HELLO: Encode the Arabic in arabic-iso8859-6 once more; delete
+	the old, experimentally-encoded Thai.
+
+2010-01-04  Jerry James  <james@xemacs.org>
+
+	* Emacs.ad: Change /usr/lib/X11 to /usr/share/X11.
+	* xemacs.1: Ditto.
+
 2009-12-18  Jerry James  <james@xemacs.org>
 
 	* idd/drop: Remove.
--- a/etc/Emacs.ad	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/Emacs.ad	Wed Feb 24 01:58:04 2010 -0600
@@ -9,7 +9,7 @@
 ! changes to .../etc/Emacs.ad made after XEmacs has been built will have no
 ! effect.
 ! 
-! However, you may copy .../etc/Emacs.ad to /usr/lib/X11/app-defaults/Emacs
+! However, you may copy .../etc/Emacs.ad to /usr/share/X11/app-defaults/Emacs
 ! (or whatever the standard app-defaults directory is at your site) to cause
 ! it to be consulted at run-time.  (Do this only for site-wide customizations:
 ! personal customizations should be put into ~/.Xresources instead.)
--- a/etc/HELLO	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/HELLO	Wed Feb 24 01:58:04 2010 -0600
@@ -5,7 +5,7 @@
 
 ---------------------------------------------------------
 Amharic	($(3"c!<!N"^(B)	$(3!A!,!>(B
-Arabic (%Gةّيبرعلا%@)	%Gمكيلع%@ %Gمالّسلا%@
+Arabic ([2],GIqjHQYdG[0](B)	[2],GecjdY[0](B [2],GeGdqSdG[0](B
 Croatian (Hrvatski)	Bog (Bok), Dobar dan
 Czech (,Bh(Besky)		Dobr,B}(B den
 Danish (Dansk)		Hej, Goddag
@@ -30,7 +30,6 @@
 Spanish (Espa,Aq(Bol)	,A!(BHola!
 Swedish (Svenska)	Hej, Goddag
 Tajik			,LAP[^\(B
-Thai ($(?@0R0I0R0d070B0(B)		$(?J0G8J04H$0C8:0(B, $(?J0G8J04H$2P0(B
 
 Tigrigna ($(3"8#r!N"^(B)	$(3!Q!,!<"8(B
 Turkish (T,A|(Brk,Ag(Be)	Merhaba
--- a/etc/gdbinit.in	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,542 +0,0 @@
-## gdb init file for XEmacs              -*- ksh -*-
-## This is the source for src/.gdbinit.  Edit it, and rerun configure.
-## (Running config.status is not enough.)
-## The generated file depends on src/config.h (currently only in one place).
-
-## To insert comments that will remain in the generated file, we use the
-## imake XCOMM convention.  Lines beginning with "XCOMM " exactly (no
-## leading whitespace, one trailing ASCII space, case sensitive) will be
-## transformed to gdb command file comments in the generated file.
-
-XCOMM gdb init file for XEmacs
-XCOMM AUTOMATICALLY GENERATED FROM etc/gdbinit.in BY configure -- DO NOT EDIT.
-XCOMM See etc/gdbinit.in for licensing information and usage hints.
-XCOMM Copyright (C) 1998 Free Software Foundation, Inc.
-
-## This file is part of XEmacs.
-
-## XEmacs is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by the
-## Free Software Foundation; either version 2, or (at your option) any
-## later version.
-
-## XEmacs is distributed in the hope that it will be useful, but WITHOUT
-## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-## for more details.
-
-## You should have received a copy of the GNU General Public License
-## along with XEmacs; see the file COPYING.  If not, write to
-## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-## Boston, MA  02110-1301  USA
-
-## Author: Martin Buchholz
-
-## Other contributors you could ask for help: Ivan Golubev, Jerry James,
-## Stephen Turnbull.
-
-## Some useful commands for debugging emacs with gdb 4.16 or better.
-##
-## Since this file is called `.gdbinit', it will be read by gdb
-## automatically when gdb is run in the build directory, which is where
-## developers usually debug their xemacs.  You can also source this
-## file from your ~/.gdbinit, if you like.
-##
-## Configure xemacs with --debug, and compile with -g.
-##
-## See also the question of the XEmacs FAQ, titled
-## "How to Debug an XEmacs problem with a debugger".
-##
-## This can be used to debug XEmacs no matter how the following are
-## specified:
-
-## USE_UNION_TYPE
-
-## (the above all have configure equivalents)
-
-## Some functions defined here require a running process, but most
-## don't.  Considerable effort has been expended to this end.
-
-## See the dbg_ C support code in src/alloc.c that allows the functions
-## defined in this file to work correctly.
-
-#define NOT_C_CODE
-#include "config.h"
-
-set print union off
-set print pretty off
-
-#ifdef VDB_POSIX
-handle SIGSEGV SIGBUS nostop noprint
-#endif
-
-set $Lisp_Type_Int = -2
-set $Lisp_Type_Record = 0
-set $Lisp_Type_Char = 2
-
-define decode_object
-  set $obj = (unsigned long) $arg0
-  if $obj & 1
-  ## It's an int
-    set $val = $obj >> 1
-    set $type = $Lisp_Type_Int
-  else
-    set $type = $obj & dbg_typemask
-    if $type == $Lisp_Type_Char
-      set $val = ($obj & dbg_valmask) >> dbg_gctypebits
-    else
-      ## It's a record pointer
-      set $val = $obj
-    end
-  end
-
-  if $type == $Lisp_Type_Record
-    set $lheader = ((struct lrecord_header *) $val)
-    set $lrecord_type = ($lheader->type)
-    set $imp = ((struct lrecord_implementation *) lrecord_implementations_table[(int) $lrecord_type])
-  else
-    set $lrecord_type = -1
-    set $lheader = -1
-    set $imp = -1
-  end
-end
-
-document decode_object
-Usage: decode_object lisp_object
-Extract implementation information from a Lisp Object.
-Defines variables $val, $type and $imp.
-end
-
-define xint
-decode_object $arg0
-print ((long) $val)
-end
-
-define xtype
-  decode_object $arg0
-  if $type == $Lisp_Type_Int
-    echo int\n
-  else
-  if $type == $Lisp_Type_Char
-    echo char\n
-  else
-    printf "record type: %s\n", $imp->name
-  end
-  end
-end
-
-document xtype
-Usage: xtype lisp_object
-Print the Lisp type of a lisp object.
-end
-
-define lisp-shadows
-  run -batch -vanilla -f list-load-path-shadows
-end
-
-document lisp-shadows
-Usage: lisp-shadows
-Run xemacs to check for lisp shadows
-end
-
-define environment-to-run-temacs
-  unset env EMACSLOADPATH
-  set env EMACSBOOTSTRAPLOADPATH=../lisp/:..
-  set env EMACSBOOTSTRAPMODULEPATH=../modules/:..
-end
-
-define run-temacs
-  environment-to-run-temacs
-  run -nd -batch -l ../lisp/loadup.el run-temacs -q
-end
-
-document run-temacs
-Usage: run-temacs
-Run temacs interactively, like xemacs.
-Use this with debugging tools (like purify) that cannot deal with dumping,
-or when temacs builds successfully, but xemacs does not.
-end
-
-define check-xemacs
-  run -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated
-end
-
-document check-xemacs
-Usage: check-xemacs
-Run the test suite.  Equivalent to 'make check'.
-end
-
-define check-temacs
-  environment-to-run-temacs
-  run -nd -batch -l ../lisp/loadup.el run-temacs -q -batch -l ../tests/automated/test-harness.el -f batch-test-emacs ../tests/automated
-end
-
-document check-temacs
-Usage: check-temacs
-Run the test suite on temacs.  Equivalent to 'make check-temacs'.
-Use this with debugging tools (like purify) that cannot deal with dumping,
-or when temacs builds successfully, but xemacs does not.
-end
-
-define update-elc
-  environment-to-run-temacs
-  run -nd -batch -l ../lisp/update-elc.el
-end
-
-document update-elc
-Usage: update-elc
-Run the core lisp byte compilation part of the build procedure.
-Use when debugging temacs, not xemacs!
-Use this when temacs builds successfully, but xemacs does not.
-end
-
-define dmp
-  environment-to-run-temacs
-  run -nd -batch -l ../lisp/loadup.el dump
-end
-
-document dmp
-Usage: dmp
-Run the dumping part of the build procedure.
-Use when debugging temacs, not xemacs!
-Use this when temacs builds successfully, but xemacs does not.
-end
-
-define ldp
-  printf "%s", "Lisp => "
-  call debug_print($arg0)
-end
-
-document ldp
-Usage: ldp lisp_object
-Print a Lisp Object value using the Lisp printer.
-Requires a running xemacs process.
-end
-
-define lbt
-call debug_backtrace()
-end
-
-document lbt
-Usage: lbt
-Print the current Lisp stack trace.
-Requires a running xemacs process.
-end
-
-
-define leval
-ldp Feval(Fcar(Fread_from_string(build_string($arg0),Qnil,Qnil)))
-end
-
-document leval
-Usage: leval "SEXP"
-Eval a lisp expression.
-Requires a running xemacs process.
-
-Example:
-(gdb) leval "(+ 1 2)"
-Lisp ==> 3
-end
-
-
-define wtype
-print $arg0->core.widget_class->core_class.class_name
-end
-
-define xtname
-print XrmQuarkToString(((Object)($arg0))->object.xrm_name)
-end
-
-## GDB's command language makes you want to ...
-
-define pptype
-  set $type_ptr = ($arg0 *) $val
-  print $type_ptr
-  print *$type_ptr
-end
-
-define pstructtype
-  set $type_ptr = (struct $arg0 *) $val
-  print $type_ptr
-  print *$type_ptr
-end
-
-define pobj
-  decode_object $arg0
-  if $type == $Lisp_Type_Int
-    printf "Integer: %d\n", $val
-  else
-  if $type == $Lisp_Type_Char
-    if $val > 32 && $val < 128
-      printf "Char: %c\n", $val
-    else
-      printf "Char: %d\n", $val
-    end
-  else
-  if $lrecord_type == lrecord_type_string
-    pptype Lisp_String
-  else
-  if $lrecord_type == lrecord_type_cons
-    pptype Lisp_Cons
-  else
-  if $lrecord_type == lrecord_type_symbol
-    pptype Lisp_Symbol
-    printf "Symbol name: %s\n", ((Lisp_String *)$type_ptr->name)->data_
-  else
-  if $lrecord_type == lrecord_type_vector
-    pptype Lisp_Vector
-    printf "Vector of length %d\n", $type_ptr->size
-    ##print *($type_ptr->data) @ $type_ptr->size
-  else
-  if $lrecord_type == lrecord_type_bit_vector
-    pptype Lisp_Bit_Vector
-  else
-  if $lrecord_type == lrecord_type_buffer
-    pstructtype buffer
-  else
-  if $lrecord_type == lrecord_type_char_table
-    pptype Lisp_Char_Table
-  else
-  if $lrecord_type == lrecord_type_char_table_entry
-    pptype Lisp_Char_Table_Entry
-  else
-  if $lrecord_type == lrecord_type_charset
-    pptype Lisp_Charset
-  else
-  if $lrecord_type == lrecord_type_coding_system
-    pptype Lisp_Coding_System
-  else
-  if $lrecord_type == lrecord_type_color_instance
-    pptype Lisp_Color_Instance
-  else
-  if $lrecord_type == lrecord_type_command_builder
-    pptype command_builder
-  else
-  if $lrecord_type == lrecord_type_compiled_function
-    pptype Lisp_Compiled_Function
-  else
-  if $lrecord_type == lrecord_type_console
-    pstructtype console
-  else
-  if $lrecord_type == lrecord_type_database
-    pptype Lisp_Database
-  else
-  if $lrecord_type == lrecord_type_device
-    pstructtype device
-  else
-  if $lrecord_type == lrecord_type_event
-    pptype Lisp_Event
-  else
-  if $lrecord_type == lrecord_type_extent
-    pstructtype extent
-  else
-  if $lrecord_type == lrecord_type_extent_auxiliary
-    pstructtype extent_auxiliary
-  else
-  if $lrecord_type == lrecord_type_extent_info
-    pstructtype extent_info
-  else
-  if $lrecord_type == lrecord_type_face
-    pptype Lisp_Face
-  else
-  if $lrecord_type == lrecord_type_float
-    pptype Lisp_Float
-  else
-  if $lrecord_type == lrecord_type_font_instance
-    pptype Lisp_Font_Instance
-  else
-  if $lrecord_type == lrecord_type_frame
-    pstructtype frame
-  else
-  if $lrecord_type == lrecord_type_glyph
-    pptype Lisp_Glyph
-  else
-  if $lrecord_type == lrecord_type_gui_item
-    pptype Lisp_Gui_Item
-  else
-  if $lrecord_type == lrecord_type_hash_table
-    pptype Lisp_Hash_Table
-  else
-  if $lrecord_type == lrecord_type_image_instance
-    pptype Lisp_Image_Instance
-  else
-  if $lrecord_type == lrecord_type_keymap
-    pptype Lisp_Keymap
-  else
-  if $lrecord_type == lrecord_type_lcrecord_list
-    pstructtype lcrecord_list
-  else
-  if $lrecord_type == lrecord_type_ldap
-    pptype Lisp_LDAP
-  else
-  if $lrecord_type == lrecord_type_lstream
-    pstructtype lstream
-  else
-  if $lrecord_type == lrecord_type_marker
-    pptype Lisp_Marker
-  else
-  if $lrecord_type == lrecord_type_opaque
-    pptype Lisp_Opaque
-  else
-  if $lrecord_type == lrecord_type_opaque_ptr
-    pptype Lisp_Opaque_Ptr
-  else
-  if $lrecord_type == lrecord_type_popup_data
-    pptype popup_data
-  else
-  if $lrecord_type == lrecord_type_process
-    pptype Lisp_Process
-  else
-  if $lrecord_type == lrecord_type_range_table
-    pptype Lisp_Range_Table
-  else
-  if $lrecord_type == lrecord_type_specifier
-    pptype Lisp_Specifier
-  else
-  if $lrecord_type == lrecord_type_subr
-    pptype Lisp_Subr
-  else
-  if $lrecord_type == lrecord_type_symbol_value_buffer_local
-    pstructtype symbol_value_buffer_local
-  else
-  if $lrecord_type == lrecord_type_symbol_value_forward
-    pstructtype symbol_value_forward
-  else
-  if $lrecord_type == lrecord_type_symbol_value_lisp_magic
-    pstructtype symbol_value_lisp_magic
-  else
-  if $lrecord_type == lrecord_type_symbol_value_varalias
-    pstructtype symbol_value_varalias
-  else
-  if $lrecord_type == lrecord_type_timeout
-    pptype Lisp_Timeout
-  else
-  if $lrecord_type == lrecord_type_toolbar_button
-    pstructtype toolbar_button
-  else
-  if $lrecord_type == lrecord_type_tooltalk_message
-    pptype Lisp_Tooltalk_Message
-  else
-  if $lrecord_type == lrecord_type_tooltalk_pattern
-    pptype Lisp_Tooltalk_Pattern
-  else
-  if $lrecord_type == lrecord_type_weak_list
-    pstructtype weak_list
-  else
-  if $lrecord_type == lrecord_type_window
-    pstructtype window
-  else
-  if $lrecord_type == lrecord_type_window_configuration
-    pstructtype window_config
-  else
-  if $lrecord_type == lrecord_type_fc_pattern
-    pstructtype fc_pattern
-  else
-  if $lrecord_type == lrecord_type_fc_config
-    pstructtype fc_config
-  else
-    echo Unknown Lisp Object type\n
-    print $arg0
-  ## Barf, gag, retch
-  end
-  end 
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  ## Repeat after me... gdb sux, gdb sux, gdb sux...
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  ## Are we having fun yet??
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-  end
-end
-
-document pobj
-Usage: pobj lisp_object
-Print the internal C representation of a Lisp Object.
-end
-
-## -------------------------------------------------------------
-## functions to test the debugging support itself.
-## If you change this file, make sure the following still work...
-## -------------------------------------------------------------
-define test_xtype
-  printf "Vemacs_major_version: "
-  xtype Vemacs_major_version
-  printf "Vhelp_char: "
-  xtype Vhelp_char
-  printf "Qnil: "
-  xtype Qnil
-  printf "Qunbound: "
-  xtype Qunbound
-  printf "Vobarray: "
-  xtype Vobarray
-  printf "Vall_weak_lists: "
-  xtype Vall_weak_lists
-  printf "Vxemacs_codename: "
-  xtype Vxemacs_codename
-end
-
-define test_pobj
-  printf "Vemacs_major_version: "
-  pobj Vemacs_major_version
-  printf "Vhelp_char: "
-  pobj Vhelp_char
-  printf "Qnil: "
-  pobj Qnil
-  printf "Qunbound: "
-  pobj Qunbound
-  printf "Vobarray: "
-  pobj Vobarray
-  printf "Vall_weak_lists: "
-  pobj Vall_weak_lists
-  printf "Vxemacs_codename: "
-  pobj Vxemacs_codename
-end
-
--- a/etc/tests/external-widget/Makefile	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/tests/external-widget/Makefile	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,23 @@
+##   Makefile for external widget test code.
+##   Copyright (C) 1993 Ben Wing.
+
+## This file is part of XEmacs.
+
+## XEmacs is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+
+## XEmacs is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with XEmacs; see the file COPYING.  If not, write to
+## the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+## Boston, MA 02110-1301, USA.
+
 CFLAGS += -Xc -g -DTOOLTALK
 EMACSHOME = ../../..
 EMACSLIBDIR = $(EMACSHOME)/editor/src
--- a/etc/tests/external-widget/test-ew-motif.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/tests/external-widget/test-ew-motif.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,23 @@
+/* Test external widget code in Motif.
+   Copyright (C) 1993 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 #include <Xm/Xm.h>
 #include <Xm/RowColumn.h>
 #include <Xm/Scale.h>
--- a/etc/tests/external-widget/test-ew-xlib.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/tests/external-widget/test-ew-xlib.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,24 @@
-/*
- * Copyright 1989 O'Reilly and Associates, Inc.
- * See ../Copyright for complete rights and liability information.
- */
+/* Test external widget code in Motif.
+   Copyright (C) 1989 O'Reilly and Associates, Inc.
+   Copyright (C) 1993 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xos.h>
--- a/etc/unicode/other/lao.txt	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/unicode/other/lao.txt	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,23 @@
+##   Unicode for Lao
+##   Copyright (C) 2002 Ben Wing.
+
+## This file is part of XEmacs.
+
+## XEmacs is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+
+## XEmacs is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with XEmacs; see the file COPYING.  If not, write to
+## the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+## Boston, MA 02110-1301, USA.
+
 ## Made up based on the comment in lao.el:
 
 ## ;; ISO10646's 0x0E80..0x0EDF are mapped to 0x20..0x7F.
--- a/etc/xemacs.1	Wed Jan 20 07:05:57 2010 -0600
+++ b/etc/xemacs.1	Wed Feb 24 01:58:04 2010 -0600
@@ -288,7 +288,7 @@
 Sets the color of the text.
 
 See the file
-.I /usr/lib/X11/rgb.txt
+.I /usr/share/X11/rgb.txt
 for a list of valid
 color names.
 .TP
--- a/lib-src/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,68 @@
+2010-02-11  Vin Shelton  <acs@xemacs.org>
+ 
+ 	* winclient.c: Bump connection retries to 20 because some people
+	have long startup files.
+	(openConversation): If CreateProcess cannot find
+ 	xemacs.exe, try again with the name of the version-specific
+ 	executable.  This is useful because the cygwin version of XEmacs
+ 	doesn't install an xemacs.exe executable.
+	(parseCommandLine): Fix tracker issue 675 - add current	directory
+	to filenames under cygwin. 
+
+2010-01-26  Ben Wing  <ben@xemacs.org>
+
+	* make-msgfile.lex: Vague hacking on this file, insert a comment
+	about what should be done if we ever want this to work.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* fakemail.c (args_size):
+	* fakemail.c (parse_header):
+	* ootags.c (C_entries):
+	Fix warnings about possible use of uninitialized vars.
+
+2010-02-01  Vin Shelton  <acs@xemacs.org>
+
+	* make-mswin-unicode.pl: Add description of override.
+
+2010-01-30  Ben Wing  <ben@xemacs.org>
+
+	* make-mswin-unicode.pl:
+	Make it possible to specify an overridden prototype in cases where
+	either Cygwin or Visual Studio has errors in their headers that
+	can be corrected by falling back to a less qualified type (typically
+	without const).
+
+2010-01-28  Jerry James  <james@xemacs.org>
+
+	* Makefile.in.in: Remove make-msgfile and make-po rules.
+	* make-msgfile.c: Removed, obsolete code.
+	* make-po.c: Removed, obsolete code.
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* make-mswin-unicode.pl:
+	Process the command `review'.  Cause an error to happen if we try to
+	use the command, indicating that the command needs review to determine
+	how to handle it.
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* make-mswin-unicode.pl:
+	Various fixes to get this to work when using the Cygwin header files
+	in /usr/include/w32api instead of the VC++ ones:
+	-- Use /usr/include/w32api as default; don't assume that a passed-in
+	   directory always ends in .../include.
+	-- Add `const' to list of known type modifiers.
+	-- If function already seen, warn but don't generate twice.
+	-- Eliminate `extern' from return type modifiers.
+	-- Cosmetic: When eliminating APIENTRY, also eliminate following
+	   whitespace.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* fix-perms.sh: New file.
+
 2009-12-21  Jerry James  <james@xemacs.org>
 
 	* Makefile.in.in: Remove rules for building yow.
--- a/lib-src/Makefile.in.in	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/Makefile.in.in	Wed Feb 24 01:58:04 2010 -0600
@@ -126,8 +126,6 @@
 
 PRIVATE_INSTALLABLES = ${PRIVATE_INSTALLABLE_EXES} ${PRIVATE_INSTALLABLE_SCRIPTS}
 
-## These need to be conditional on I18N3: make-msgfile make-po
-
 ## ----------------------------------------------------------------
 ## Things that XEmacs uses during the build process itself.
 ## Not installed.
@@ -375,12 +373,6 @@
 hexl: ${srcdir}/hexl.c
 	$(CC) $(cflags) ${srcdir}/hexl.c $(ldflags) -o $@
 
-make-msgfile: ${srcdir}/make-msgfile.c
-	$(CC) $(cflags) ${srcdir}/make-msgfile.c $(ldflags) -o $@
-
-make-po: ${srcdir}/make-po.c
-	$(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@
-
 make-dump-id: ${srcdir}/make-dump-id.c
 	$(CC) $(cflags) ${srcdir}/make-dump-id.c $(ldflags) -o $@
 
--- a/lib-src/fakemail.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/fakemail.c	Wed Feb 24 01:58:04 2010 -0600
@@ -512,7 +512,7 @@
   register int size = 0;
   do
     {
-      char *field;
+      char *field = NULL;
       register char *keyword = get_keyword (the_header->text->string, &field);
       if ((strcmp (keyword, "TO") == 0) ||
 	  (strcmp (keyword, "CC") == 0) ||
@@ -535,7 +535,7 @@
   register header old = the_header;
   do
     {
-      char *field;
+      char *field = NULL;
       register char *keyword = get_keyword (the_header->text->string, &field);
       if (strcmp (keyword, "TO") == 0)
 	where = add_field (the_header->text->continuation, field, where);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/fix-perms.sh	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,87 @@
+#!/bin/sh
+### fix-perms.sh --- Correct the permissions on XEmacs source/build files
+
+# Copyright (C) 2010 Ben Wing.
+
+# Author: Ben Wing
+# Keywords: internal
+
+# This file is part of XEmacs.
+
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# XEmacs is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+### Commentary:
+
+# This program sets the executable bit on all scripts and executable files
+# in the XEmacs source tree, including those that are built.
+
+### Code:
+
+# List of executable source files in various directories (root, lib-src, etc)
+# other than .sh files.  Note that we are free to list files in
+# subdirectories here rather than creating a separate item list"
+ROOT_EXES="configure config.guess install-sh move-if-change \
+            modules/canna/configure"
+LIB_SRC_EXES="ad2c gnuattach gnudoit rcs2log vcdiff *.pl"
+ETC_EXES=""
+
+LIB_SRC_BUILT_EXES="`cd lib-src; ls -1 *.c | sed 's/\.c$//g'`"
+LIB_SRC_BUILT_EXES="minitar ctags $LIB_SRC_BUILT_EXES"
+SRC_BUILT_EXES="temacs xemacs"
+
+find . -type f -print0 | xargs -0 chmod a-x
+
+for dir in . lib-src etc ; do
+  if [ "$dir" = "." ]; then
+    exes="$ROOT_EXES"
+  elif [ "$dir" = "lib-src" ]; then
+    exes="$LIB_SRC_EXES"
+  elif [ "$dir" = "etc" ]; then
+    exes="$ETC_EXES"
+  else
+    echo "Error! Don't know how to handle directory '$dir'"; exit 2
+  fi
+  pwd=`pwd`
+  cd $dir
+  for x in $exes *.sh ; do
+    if [ ! -f $x ]; then
+      echo "Warning: file '$dir/$x' doesn't exist"
+    else
+      chmod a+x $x
+    fi
+  done
+  cd "$pwd"
+done
+
+# Now do the built executables.  Don't warn or anything if we don't find
+# anything, since they may not be built.
+for dir in lib-src src ; do
+  if [ "$dir" = "src" ]; then
+    exes="$SRC_BUILT_EXES"
+  elif [ "$dir" = "lib-src" ]; then
+    exes="$LIB_SRC_BUILT_EXES"
+  else
+    echo "Error! Don't know how to handle directory '$dir'"; exit 2
+  fi
+  pwd=`pwd`
+  cd $dir
+  for x in $exes *.exe ; do
+    if [ -f $x ]; then
+      chmod a+x $x
+    fi
+  done
+  cd "$pwd"
+done
--- a/lib-src/make-msgfile.c	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-/* #### Old code!  Replaced with make-msgfile.lex. */
-
-
-/* Scan specified C and Lisp files, extracting the following messages:
-
-     C files:
-	GETTEXT (...)
-	DEFER_GETTEXT (...)
-	DEFUN interactive prompts
-     Lisp files:
-	(gettext ...)
-	(dgettext "domain-name" ...)
-	(defer-gettext ...)
-	(interactive ...)
-
-  The arguments given to this program are all the C and Lisp source files
-  of XEmacs.  .el and .c files are allowed.  There is no support for .elc
-  files at this time, but they may be specified; the corresponding .el file
-  will be used.  Similarly, .o files can also be specified, and the corresponding
-  .c file will be used.  This helps the makefile pass the correct list of files.
-
-  The results, which go to standard output or to a file specified with -a or -o
-  (-a to append, -o to start from nothing), are quoted strings wrapped in
-  gettext(...).  The results can be passed to xgettext to produce a .po message
-  file.
-*/
-
-#include <stdio.h>
-#include <string.h>
-
-#define LINESIZE 256
-#define GET_LINE	fgets (line, LINESIZE, infile)
-#define CHECK_EOL(p)	if (*(p) == '\0')  (p) = GET_LINE
-#define SKIP_BLANKS(p)	while ((*p) == ' ' || (*p) == '\t')  (p)++
-
-enum filetype { C_FILE, LISP_FILE, INVALID_FILE };
-/* some brain-dead headers define this ... */
-#undef FALSE
-#undef TRUE
-enum boolean { FALSE, TRUE };
-
-FILE *infile;
-FILE *outfile;
-char line[LINESIZE];
-
-
-void scan_file (char *filename);
-void process_C_file (void);
-void process_Lisp_file (void);
-char *copy_up_to_paren (register char *p);
-char *copy_quoted_string (register char *p);
-enum boolean no_interactive_prompt (register char *q);
-char *skip_blanks (register char *p);
-
-
-main (int argc, char *argv[])
-{
-  register int i;
-
-  outfile = stdout;
-
-  /* If first two args are -o FILE, output to FILE. */
-  i = 1;
-  if (argc > i + 1 && strcmp (argv[i], "-o") == 0) {
-    outfile = fopen (argv[++i], "w");
-    ++i;
-  }
-  /* ...Or if args are -a FILE, append to FILE. */
-  if (argc > i + 1 && strcmp (argv[i], "-a") == 0) {
-    outfile = fopen (argv[++i], "a");
-    ++i;
-  }
-  if (!outfile) {
-    fprintf (stderr, "Unable to open output file %s\n", argv[--i]);
-    return;
-  }
-
-  for (; i < argc; i++)
-    scan_file (argv[i]);
-
-  return 0;
-}
-
-
-void scan_file (char *filename)
-{
-  enum filetype type = INVALID_FILE;
-  register char *p = filename + strlen (filename);
-
-  if (strcmp (p - 4, ".elc") == 0) {
-    *--p = '\0';				/* Use .el file instead */
-    type = LISP_FILE;
-  } else if (strcmp (p - 3, ".el") == 0)
-    type = LISP_FILE;
-  else if (strcmp (p - 2, ".o") == 0) {
-    *--p = 'c';					/* Use .c file instead */
-    type = C_FILE;
-  } else if (strcmp (p - 2, ".c") == 0)
-    type = C_FILE;
-
-  if (type == INVALID_FILE) {
-    fprintf (stderr, "File %s being ignored\n", filename);
-    return;
-  }
-  infile = fopen (filename, "r");
-  if (!infile) {
-    fprintf (stderr, "Unable to open input file %s\n", filename);
-    return;
-  }
-
-  fprintf (outfile, "/* %s */\n", filename);
-  if (type == C_FILE)
-    process_C_file ();
-  else
-    process_Lisp_file ();
-  fputc ('\n', outfile);
-
-  fclose (infile);
-}
-
-
-void process_C_file (void)
-{
-  register char *p;
-  char *gettext, *defun;
-
-  while (p = GET_LINE) {
-    gettext = strstr (p, "GETTEXT");
-    defun = strstr (p, "DEFUN");
-    if (gettext || defun) {
-      if (gettext) {
-	p = gettext;
-	p += 7;			/* Skip over "GETTEXT" */
-      }
-      else if (defun) {
-	p = defun;
-	p += 5;			/* Skip over "DEFUN" */
-      }
-
-      p = skip_blanks (p);
-      if (*p++ != '(')
-	continue;
-
-      if (defun) {
-	register int i;
-
-	for (i = 0; i < 5; i++)	/* Skip over commas to doc string */
-	  while (*p++ != ',')
-	    CHECK_EOL (p);
-	if (*p == '\n')
-	  p = GET_LINE;
-      }
-
-      p = skip_blanks (p);
-      if (*p != '\"')		/* Make sure there is a quoted string */
-	continue;
-
-      if (defun && no_interactive_prompt (p))
-	continue;
-
-      fprintf (outfile, "gettext(");
-      if (gettext)
-	p = copy_up_to_paren (p);
-      else
-	p = copy_quoted_string (p);
-      fprintf (outfile, ")\n");
-    }
-  }
-}
-
-
-void process_Lisp_file (void)
-{
-  register char *p;
-  char *gettext, *interactive;
-  enum boolean dgettext = FALSE;
-
-  while (p = GET_LINE) {
-    gettext = strstr (p, "gettext");
-    interactive = strstr (p, "(interactive");
-    if (gettext || interactive) {
-      if (!interactive)
-	p = gettext;
-      else if (!gettext)
-	p = interactive;
-      else if (gettext < interactive) {
-	p = gettext;
-	interactive = NULL;
-      } else {
-	p = interactive;
-	gettext = NULL;
-      }
-
-      if (gettext) {
-	if (p > line && *(p-1) == 'd')
-	  dgettext = TRUE;
-	p += 7;		/* Skip over "gettext" */
-      } else
-	p += 12;	/* Skip over "(interactive" */
-
-      p = skip_blanks (p);
-      if (*p != '\"')		/* Make sure there is a quoted string */
-	continue;
-
-      if (dgettext) {		/* Skip first quoted string (domain name) */
-	while (*++p != '"')
-	  ;  /* null statement */
-	++p;
-	p = skip_blanks (p);
-	if (*p != '\"')		/* Check for second quoted string (message) */
-	  continue;
-      }
-
-      if (interactive && no_interactive_prompt (p))
-	continue;
-
-      fprintf (outfile, "gettext(");
-      p = copy_up_to_paren (p);
-      fprintf (outfile, ")\n");
-    }
-  }
-}
-
-
-/* Assuming p points to some character beyond an opening parenthesis, copy
-   everything to outfile up to but not including the closing parenthesis.
-*/
-char *copy_up_to_paren (register char *p)
-{
-  for (;;) {
-    SKIP_BLANKS (p);	/* We don't call skip_blanks() in order to */
-    CHECK_EOL (p);	/* preserve blanks at the beginning of the line */
-    if (*p == ')')
-      break;
-
-    if (*p == '\"')
-      p = copy_quoted_string (p);
-    else
-      fputc (*p++, outfile);
-  }
-  return p;
-}
-
-
-/* Assuming p points to a quote character, copy the quoted string to outfile.
-*/
-char *copy_quoted_string (register char *p)
-{
-  do {
-    if (*p == '\\')
-      fputc (*p++, outfile);
-    fputc (*p++, outfile);
-    CHECK_EOL (p);
-  } while (*p != '\"');
-
-  fputc (*p++, outfile);
-  return p;
-}
-
-
-/* Return TRUE if the interactive specification consists only
-   of code letters and no prompt.
-*/
-enum boolean no_interactive_prompt (register char *q)
-{
-  while (++q, *q == '*' || *q == '@')
-    ; /* null statement */
-  if (*q == '\"')
-    return TRUE;
- skip_code_letter:
-  if (*++q == '\"')
-    return TRUE;
-  if (*q == '\\' && *++q == 'n') {
-    ++q;
-    goto skip_code_letter;
-  }
-  return FALSE;
-}
-
-
-char *skip_blanks (register char *p)
-{
-  while (*p == ' ' || *p == '\t' || *p == '\n') {
-    p++;
-    CHECK_EOL (p);
-  }
-  return p;
-}
--- a/lib-src/make-msgfile.lex	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/make-msgfile.lex	Wed Feb 24 01:58:04 2010 -0600
@@ -4,6 +4,7 @@
 
 /* Localizable-message snarfing.
    Copyright (C) 1994, 1995 Amdahl Corporation.
+   Copyright (C) 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -25,6 +26,27 @@
 /* Written by Ben Wing, November 1994.  Some code based on earlier
    make-msgfile.c. */
 
+/* #### A comment:
+
+   Directly writing a lex file isn't right.  We want to be able to specify
+   functions to snarf in simpler ways, e.g.
+
+BEGIN_C_FUNCS
+
+weird_doc (arg, snarf, snarf, arg);
+signal_error (arg, snarf, arg);
+etc.
+
+END_C_FUNCS
+
+   In this case, `arg' indicates an arbitrary argument and `snarf' indicates
+   that when a quoted string is seen, it should be snarfed.
+
+   Then either we write a program to read this script and directly snarf
+   messages, or we write a program to convert the script into lex. 
+
+--ben, 1/26/10 */
+
 /* See text.c for a proposal about how this whole system should work. */
 
 /* Note: there is still much work to be done on this.
@@ -84,25 +106,34 @@
 %s DO_C DO_LISP DEFUN
 %s DEFUN2 DEFUN3 LDEF
 
-W	[ \t\n]
-Any	(.|"\n")
-Q	"\""
-NQ	[^"]
-NT	[^A-Za-z_0-9]
-LP	"("
-RP	")"
-BS	"\\"
-Esc	({BS}{Any})
-Wh	({W}*)
-LCom	(";"({Esc}|.)*)
-LWh	(({W}|{Lcom})*)
-Open	({Wh}{LP})
-OpWQ	({Open}{Wh}{Q})
-String	({Q}({Esc}|{NQ})*{Q})
-Arg	([^,]*",")
-StringArg	({Wh}{String}{Wh}",")
-OpenString	({Open}{StringArg})
-LispToken	(({Esc}|[-A-Za-z0-9!@$%^&*_=+|{}`~,<.>/?])+)
+W		[ \t\n]
+Any		.|\n
+Q		\"
+Cm      	,
+NQ		[^\"]
+NT		[^A-Za-z_0-9]
+LP		"("
+RP		")"
+NQP     	[^\"()]
+NQPCm   	[^,\"()]
+BS		"\\"
+Esc		({BS}{Any})
+Wh		({W}*)
+LCom		(;({Esc}|.)*)
+LWh		({W}|{LCom})*
+Open		{Wh}{LP}
+OpWQ		{Open}{Wh}{Q}
+String		{Q}({Esc}|{NQ})*{Q}
+ParenExpr5	"("({String}|{NQP})*")"
+ParenExpr4	"("({String}|{NQP}|{ParenExpr5})*")"
+ParenExpr3	"("({String}|{NQP}|{ParenExpr4})*")"
+ParenExpr2	"("({String}|{NQP}|{ParenExpr3})*")"
+ParenExpr	"("({String}|{NQP}|{ParenExpr5})*")"
+Arg		({NQPCm}|{String}|{ParenExpr})*
+ArgCm		{Arg}{Cm}
+StringArg	{Wh}{String}{Wh}","
+OpenString	{Open}{StringArg}
+LispToken	({Esc}|[-A-Za-z0-9!@$%^&*_=+|{}`~,<.>/?])+
 %%
 
 <DO_C>{NT}"GETTEXT"{OpWQ} { snarf (); }
@@ -128,16 +159,17 @@
 <DO_C>{NT}"stdout_out"{OpWQ} { snarf (); }
 <DO_C>{NT}"stderr_out"{OpWQ} { snarf (); }
 <DO_C>{NT}"with_output_to_temp_buffer"{OpWQ} { snarf (); }
+<DO_C>{NT}"weird_doc"{Open}{ArgCm}{Wh}{Q} { snarf (); /* #### FIXME snarf next arg() */}
 
-<DO_C>{NT}"DEFVAR_BOOL"{OpenString}{Arg}{Wh}{Q} { snarf (); }
-<DO_C>{NT}"DEFVAR_LISP"{OpenString}{Arg}{Wh}{Q} { snarf (); }
-<DO_C>{NT}"DEFVAR_SPECIFIER"{OpenString}{Arg}{Wh}{Q} { snarf (); }
-<DO_C>{NT}"DEFVAR_INT"{OpenString}{Arg}{Wh}{Q} { snarf (); }
-<DO_C>{NT}"DEFVAR_BUFFER_LOCAL"{OpenString}{Arg}{Wh}{Q} { snarf (); }
-<DO_C>{NT}"DEFVAR_BUFFER_DEFAULTS"{OpenString}{Arg}{Wh}{Q} { snarf (); }
-<DO_C>{NT}"deferror"{Open}{Arg}{StringArg}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"DEFVAR_BOOL"{OpenString}{ArgCm}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"DEFVAR_LISP"{OpenString}{ArgCm}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"DEFVAR_SPECIFIER"{OpenString}{ArgCm}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"DEFVAR_INT"{OpenString}{ArgCm}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"DEFVAR_BUFFER_LOCAL"{OpenString}{ArgCm}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"DEFVAR_BUFFER_DEFAULTS"{OpenString}{ArgCm}{Wh}{Q} { snarf (); }
+<DO_C>{NT}"deferror"{Open}{ArgCm}{StringArg}{Wh}{Q} { snarf (); }
 
-<DO_C>{NT}"barf_or_query_if_file_exists"{Open}{Arg}{Wh}{Q} {
+<DO_C>{NT}"barf_or_query_if_file_exists"{Open}{ArgCm}{Wh}{Q} {
   /* #### see comment above about use of Arg */
   snarf ();
 }
@@ -153,7 +185,7 @@
 <DO_C>{Q} { BEGIN C_QUOTE; }
 <DO_C>{Any} { }
 
-<DEFUN>{StringArg}{Arg}{Arg}{Arg}{Arg}{Wh} { BEGIN DEFUN2; }
+<DEFUN>{StringArg}{ArgCm}{ArgCm}{ArgCm}{ArgCm}{Wh} { BEGIN DEFUN2; }
 <DEFUN>{Any} { bad_c_defun (); }
 
 <DEFUN2>{Q} {
@@ -163,7 +195,7 @@
 }
 <DEFUN2>[^,]* {
   /* This function doesn't have an interactive specification.
-     Don't use {Arg} in the specification because DEFUN3 looks
+     Don't use {ArgCm} in the specification because DEFUN3 looks
      for the comma. */
   BEGIN DEFUN3;
 }
--- a/lib-src/make-mswin-unicode.pl	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/make-mswin-unicode.pl	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
 
 ### make-mswin-unicode --- generate Unicode-encapsulation code for MS Windows
 
-## Copyright (C) 2001, 2002, 2004 Ben Wing.
+## Copyright (C) 2001, 2002, 2004, 2010 Ben Wing.
 
 ## Author: Ben Wing <ben@xemacs.org>
 ## Maintainer: Ben Wing <ben@xemacs.org>
@@ -63,11 +63,16 @@
 yes indicates a function to be automatically Unicode-encapsulated.
    (All parameters either need no special processing or are LPTSTR or
    LPCTSTR.)
+override indidates a function where the prototype can be overridden
+   due to errors in Cygwin or Visual Studio.
 soon indicates a function that should be automatically Unicode-encapsulated,
    but we're not ready to process it yet.
 no indicates a function we don't support (it will be #defined to cause
    a compile error, with the text after the function included in the
    erroneous definition to indicate why we don't support it).
+review indicates a function that we still need to review to determine whether
+   or how to support it.  This has the same effect as `no', with a comment
+   indicating that the function needs review.
 skip indicates a function we support manually; only a comment about this
    will be generated.
 split indicates a function with a split structure (different versions
@@ -102,6 +107,9 @@
 my ($cout, $hout, $dir) = ($options{"c-output"},
                           $options{"h-output"},
                           $options{"includedir"});
+
+$dir = '/usr/include/w32api' if !$dir && -f '/usr/include/w32api/windows.h';
+
 if (!$dir)
   {
     for my $sdkroot (("WindowsSdkDir", "MSSdk", "MSVCDIR"))
@@ -115,8 +123,9 @@
       {
         die "Can't find the Windows SDK headers; run vcvars32.bat from your MSVC installation, or setenv.cmd from the Platform SDK installation";
       }
-    $dir.='/include';
   }
+$dir.='/include' if ((-f $dir.'/include/WINDOWS.H') ||
+		     (-f $dir.'/include/windows.h'));
 die "Can't find MSVC include files in \"$dir\"" unless ((-f $dir.'/WINDOWS.H') || (-f $dir.'/windows.h'));
 
 open (COUT, ">$cout") or die "Can't open C output file $cout: $!";
@@ -149,6 +158,43 @@
 my $current_file;
 my @current_bracket;
 
+my ($ws_re, $must_ws_re, $tok_ch) =
+  ("\\s*", "\\s+", "\\w");
+# unfortunately there is no surefire way short of
+# parsing all include files for typedefs to
+# distinguish types from parameters, and prototypes
+# appear in the include files both with and without
+# parameters -- the latter kinds appear in a very
+# different style and were obviously added later.  so
+# we rely on the fact that defined types are all
+# upper-case, and parameters generally are not, and
+# special-case the exceptions.
+my $typeword_re =
+  # note the negative lookahead assertions: the first
+  # one excludes the words "X" and "Y" from type
+  # words, since they appear as parameter names in
+  # CreateWindowEx; the second prevents "void
+  # *Argument" from being parsed as a type "void *A"
+  # followed by a parameter "rgument".
+  "(?:(?!(?:X\\b|Y\\b))(?:unsigned|int|long|const|short|va_list|[A-Z_0-9]+)(?!${tok_ch}))";
+my $typetoken_re = "(?:$typeword_re$ws_re\\**$ws_re)";
+# Regexp matching a particular argument
+my $arg_re = "(?:(?:$typetoken_re+)(?:${tok_ch}+)?(?: OPTIONAL)?)";
+# Same, but with groups to match the type and name
+my $argmatch_re = "(?:($typetoken_re+)(${tok_ch}+)?(?: OPTIONAL)?)";
+# regexp matching a parenthesized argument list in a prototype
+my $args_re = "\\(((?:${ws_re}${arg_re}${ws_re},)*${ws_re}${arg_re}${ws_re})\\)";
+# regexp matching a return type in a protype
+my $rettype_re = "(SHSTDAPI_\\(${tok_ch}+\\)|${tok_ch}" . "[A-Za-z_0-9 \t\n\r\f]*?${tok_ch})";
+# regexp matching a function name
+my $funname_re = "(${tok_ch}+)";
+# Regexp matching a function prototype, $1 = rettype, $2 = name, $3 = args
+my $fun_re = "${rettype_re}${ws_re}${funname_re}${ws_re}${args_re};";
+# Regexp matching a particular Unicode function (ending in ...W)
+my $wfun_re = "${rettype_re}${ws_re}${funname_re}W${ws_re}${args_re};";
+
+# print "regexp: $wfun_re\n";
+
 while (<>)
   {
     chomp;
@@ -169,7 +215,7 @@
       {
 	next if (m!^//!);
 	next if (/^[ \t]*$/);
-	if (/(file|yes|soon|no|skip|split|begin-bracket|end-bracket)(?: (.*))?/)
+	if (/(file|yes|soon|no|review|skip|split|begin-bracket|end-bracket|override)(?: (.*))?/)
 	  {
 	    my ($command, $parms) = ($1, $2);
 	    if ($command eq "file")
@@ -193,6 +239,15 @@
 	      {
 		pop @current_bracket;
 	      }
+	    elsif ($command eq "override")
+	      {
+		die "Cannot parse prototype $parms" unless $parms =~ /$wfun_re(?: ?(.*))?/;
+		my ($rettype, $fun, $args, $reason) = ($1, $2, $3, $4);
+		$files{$current_file}{$fun} =
+		  [$command, $reason, $rettype, $fun, $args];
+		$bracket{$current_file}{$fun} =
+		  $current_bracket[$#current_bracket];
+	      }
 	    else
 	      {
 		my ($fun, $reason) = split /\s+/, $parms, 2;
@@ -226,37 +281,26 @@
 
 ";
 
-    my ($ws_re, $must_ws_re, $tok_ch) =
-      ("\\s*", "\\s+", "\\w");
-    # unfortunately there is no surefire way short of
-    # parsing all include files for typedefs to
-    # distinguish types from parameters, and prototypes
-    # appear in the include files both with and without
-    # parameters -- the latter kinds appear in a very
-    # different style and were obviously added later.  so
-    # we rely on the fact that defined types are all
-    # upper-case, and parameters generally are not, and
-    # special-case the exceptions.
-    my $typeword_re =
-      # note the negative lookahead assertions: the first
-      # one excludes the words "X" and "Y" from type
-      # words, since they appear as parameter names in
-      # CreateWindowEx; the second prevents "void
-      # *Argument" from being parsed as a type "void *A"
-      # followed by a parameter "rgument".
-      "(?:(?!(?:X\\b|Y\\b))(?:unsigned|int|long|short|va_list|[A-Z_0-9]+)(?!${tok_ch}))";
-    my $typetoken_re = "(?:$typeword_re$ws_re\\**$ws_re)";
-    my $arg_re = "(?:($typetoken_re+)(${tok_ch}+)?(?: OPTIONAL)?)";
-    my $fun_re = "(SHSTDAPI_\\(${tok_ch}+\\)|${tok_ch}" . "[A-Za-z_0-9 \t\n\r\f]*?${tok_ch})${ws_re}(${tok_ch}+)W${ws_re}\\(((${ws_re}${arg_re}${ws_re},)*${ws_re}${arg_re}${ws_re})\\);";
-
-    # print "regexp: $fun_re\n";
-    while ($slurp =~ /$fun_re/g)
+    while ($slurp =~ /$wfun_re/g)
       {
 	my ($rettype, $fun, $args) = ($1, $2, $3);
+
+	if ($processed{$fun})
+	  {
+	    print "Warning: Function $fun already seen\n";
+	    next;
+	  }
+
 	$processed{$fun} = 1;
+
 	print "Processing: $fun";
 
-	my ($command, $reason) = ($files{$file}{$fun}[0], $files{$file}{$fun}[1]);
+	#my ($command, $reason) = ($files{$file}{$fun}[0], $files{$file}{$fun}[1]);
+	# Fuck perl!  There seems to be no way to write something like
+	# my ($command, $reason) = @$files{$file}{$fun};
+	# You have to use a temporary var.
+	my $filesarr = $files{$file}{$fun};
+	my ($command, $reason) = @$filesarr;
 	if (!defined ($command))
 	  {
 	    print " (no command found)\n";
@@ -270,8 +314,11 @@
 		print HOUT "#if $bracket\n";
 		print COUT "#if $bracket\n\n";
 	      }
-	    if ($command eq "no")
+	    if ($command eq "no" || $command eq "review")
 	      {
+		$reason = "Function needs review to determine how to handle it"
+		  if !defined ($reason) && $command eq "review";
+
 		if (!defined ($reason))
 		  {
 		    print "WARNING: No reason given for `no' with function $fun\n";
@@ -309,8 +356,21 @@
 		  {
 		    ($split_struct, $reason) = split /\s+/, $reason, 2;
 		  }
+		elsif ($command eq "override")
+		  {
+		    my ($nrettype, $nfun, $nargs) = @$filesarr[2 .. 4];
+		    $reason = "$reason.\n   NOTE: " if $reason;
+		    $reason = "${reason}Prototype manually overridden.
+         Header file claims:
+           $rettype $fun($args)
+         Overridden with:
+           $nrettype $nfun($nargs)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+";
+		    ($rettype, $fun, $args) = ($nrettype, $nfun, $nargs);
+		  }
 		my $argno = 0;
-		while ($args =~ /$arg_re/g)
+		while ($args =~ /$argmatch_re/g)
 		  {
 		    $argno++;
 		    my ($argtype, $argname) = ($1, $2);
@@ -334,8 +394,9 @@
 		}
 		$rettype =~ s/\bSHSTDAPI_\((.*)\)/$1/;
 		$rettype =~ s/\s*WIN\w*?API\s*//g;
-		$rettype =~ s/\bAPIENTRY\b//;
+		$rettype =~ s/\bAPIENTRY\b\s*//;
 		$rettype =~ s/\bSHSTDAPI\b/HRESULT/;
+		$rettype =~ s/\bextern\b\s*//;
 		if ($rettype =~ /LPC?WSTR/)
 		  {
 		    $split_rettype = 1;
--- a/lib-src/make-po.c	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-/* Generate .po file from doc-string file.
-
-   Scan specified doc-string file, creating .po format messages for processing
-   with msgfmt.  The results go to standard output or to a file specified
-   with -a or -o (-a to append, -o to start from nothing).
-
-   Kludge to make up for shortcoming in make-docfile and Snarf-documentation:
-   If arg before input filename is -p, we are scanning an add-on
-   package, which requires slightly different processing.
-*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
-#endif
-
-/* #define BUFSIZE    8192 */
-/* #define BUFSIZE    16384 */
-#define BUFSIZE    32768
-#define NEWSTRING  31      /* Character signalling start of new doc string */
-#define LINEEND    "\\n"
-#define ENDSTRING  "\"\n"
-#define LINEBEGIN  "       \""
-#define LINEBREAK  ENDSTRING LINEBEGIN
-
-/* some brain-dead headers define this ... */
-#undef FALSE
-#undef TRUE
-enum boolean { FALSE, TRUE };
-
-
-/***********************/
-/* buffer pseudo-class */
-/***********************/
-
-typedef struct _buffer
-{
-  size_t index;  /* current position in buf[] */
-  size_t size;   /* size of buf */
-  char *buf;
-} buffer_struct;
-
-#define BUF_NULL  {0, 0, NULL}
-
-int  buf_init  (buffer_struct *buffer, size_t size);
-void buf_free  (buffer_struct *buffer);
-void buf_clear (buffer_struct *buffer);
-int  buf_putc  (buffer_struct *buffer, int c);
-int  buf_print (buffer_struct *buffer, const char *s);
-
-
-/********************/
-/* global variables */
-/********************/
-
-FILE *infile  = NULL;
-FILE *outfile = NULL;
-buffer_struct buf = BUF_NULL;
-
-
-void scan_file (enum boolean package);
-void initialize (void);
-void clean_exit (int status);
-void buf_putc_safe (int c);
-void buf_print_safe (const char *s);
-void terminate_string (void);
-
-main (int argc, char *argv[])
-{
-  register int i;
-  enum boolean package = FALSE;  /* TRUE if scanning add-on package */
-
-  initialize ();
-
-  outfile = stdout;
-
-  /* If first two args are -o FILE, output to FILE. */
-  i = 1;
-  if (argc > i + 1 && strcmp (argv[i], "-o") == 0) {
-    outfile = fopen (argv[++i], "w");
-    ++i;
-  }
-  /* ...Or if args are -a FILE, append to FILE. */
-  if (argc > i + 1 && strcmp (argv[i], "-a") == 0) {
-    outfile = fopen (argv[++i], "a");
-    ++i;
-  }
-  if (!outfile) {
-    fprintf (stderr, "Unable to open output file %s\n", argv[--i]);
-    return 1;
-  }
-
-  if (argc > i && !strcmp (argv[i], "-p")) {
-    package = TRUE;
-    ++i;
-  }
-
-  infile = fopen (argv[i], "r");
-  if (!infile) {
-    fprintf (stderr, "Unable to open input file %s\n", argv[i]);
-    return 1;
-  }
-
-  scan_file (package);
-  clean_exit (EXIT_SUCCESS);
-}
-
-
-void scan_file (enum boolean package)
-{
-  register int c;   /* Character read in */
-
-  fprintf (outfile, "###############\n");
-  fprintf (outfile, "# DOC strings #\n");
-  fprintf (outfile, "###############\n");
-
-  while (c = getc (infile), !feof (infile)) {
-    if (c == NEWSTRING) {
-      /* If a string was being processed, terminate it. */
-      if (buf.index > 0)
-	terminate_string ();
-
-      /* Skip function or variable name. */
-      while (c != '\n')
-	c = getc (infile);
-      c = getc (infile);
-
-      /* Begin a new string. */
-      fprintf (outfile, "msgid  \"");
-      buf_print_safe ("msgstr \"");
-    }
-
-    if (c == '\n') {
-      /* Peek at next character. */
-      c = getc (infile);
-      ungetc (c, infile);
-
-      /* For add-on (i.e., non-preloaded) documentation, ignore the last
-	 carriage return of a string. */
-      if (!(package && c == NEWSTRING)) {
-	fprintf (outfile, LINEEND);
-	buf_print_safe (LINEEND);
-      }
-
-      /* If not end of string, continue it on the next line. */
-      if (c != NEWSTRING) {
-	fprintf (outfile, LINEBREAK);
-	buf_print_safe (LINEBREAK);
-      }
-    }
-    else {
-
-      /* If character is \ or ", precede it by a backslash. */
-      if (c == '\\' || c == '\"') {
-	putc ('\\', outfile);
-	buf_putc_safe ('\\');
-      }
-
-      putc (c, outfile);
-      buf_putc_safe (c);
-    }
-  }
-  terminate_string ();
-}
-
-
-/* initialize sets up the global variables.
-*/
-void initialize (void)
-{
-  if (buf_init (&buf, BUFSIZE) != 0)
-    clean_exit (EXIT_FAILURE);
-}
-
-
-/* clean_exit returns any resources and terminates the program.
-   An error message is printed if status is EXIT_FAILURE.
-*/
-void clean_exit (int status)
-{
-  if (buf.size > 0)
-    buf_free (&buf);
-  if (outfile)
-    fclose (outfile);
-  if (infile)
-    fclose (infile);
-
-  if (status == EXIT_FAILURE)
-    fprintf (stderr, "make-po abnormally terminated\n");
-  exit (status);
-}
-
-
-/* buf_putc_safe writes the character c on the global buffer buf,
-   checking to make sure that the operation was successful.
-*/
-void buf_putc_safe (int c)
-{
-  register int status;
-  
-  status = buf_putc (&buf, c);
-  if (status == EOF)
-    clean_exit (EXIT_FAILURE);
-}
-
-
-/* buf_putc_safe writes the string s on the global buffer buf,
-   checking to make sure that the operation was successful.
-*/
-void buf_print_safe (const char *s)
-{
-  register int status;
-
-  status = buf_print (&buf, s);
-  if (status < 0)
-    clean_exit (EXIT_FAILURE);
-}
-
-
-/* terminate_string terminates the current doc string and outputs the buffer.
-*/
-void terminate_string (void)
-  {
-    fprintf (outfile, ENDSTRING);
-
-    /* Make the "translation" different from the original string. */
-    buf_print_safe ("_X");
-
-    buf_print_safe (ENDSTRING);
-    fprintf (outfile, "%s", buf.buf);
-    buf_clear (&buf);
-  }
-
-
-/*********************************/
-/* buffer pseudo-class functions */
-/*********************************/
-
-/* buf_init initializes a buffer to the specified size.
-   It returns non-zero if the attempt fails.
-*/
-int buf_init (buffer_struct *buffer, size_t size)
-{
-  buffer->buf = malloc (size);
-  if (buffer->buf == NULL)
-    return 1;
-
-  buffer->size = size;
-  buf_clear (buffer);
-  return 0;
-}
-
-
-/* buf_free releases the memory allocated for the buffer.
-*/
-void buf_free (buffer_struct *buffer)
-{
-  free (buffer->buf);
-  buffer->size = 0;
-}
-
-
-/* buf_clear resets a buffer to an empty string.
-*/
-void buf_clear (buffer_struct *buffer)
-{
-  buffer->index = 0;
-  buffer->buf[0] = '\0';
-}
-
-
-/* buf_putc writes the character c on the buffer.
-   It returns the character written, or EOF for error.
-*/
-int buf_putc (buffer_struct *buffer, int c)
-{
-  if (buffer->index >= buffer->size)
-    return EOF;
-
-  buffer->buf[buffer->index++] = c;
-  return c;
-}
-
-
-/* buf_print writes the string s on the buffer.
-   It returns the number of characters written, or negative if an error occurred.
-*/
-int buf_print (buffer_struct *buffer, const char *s)
-{
-  register int len;
-
-  len = strlen (s);
-  if (buffer->index + len >= buffer->size)
-    return -1;
-
-  sprintf (&(buffer->buf[buffer->index]), s);
-  buffer->index += len;
-  return len;
-}
--- a/lib-src/ootags.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/ootags.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2639,7 +2639,7 @@
   int parlev;			/* current parenthesis level */
   bool incomm, inquote, inchar, quotednl, midtoken;
   bool cplpl, cjava;
-  token savetok;		/* token saved during preprocessor handling */
+  token savetok = {0};		/* token saved during preprocessor handling */
 
 
   tokoff = toklen = 0;		/* keep compiler quiet */
--- a/lib-src/winclient.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lib-src/winclient.c	Wed Feb 24 01:58:04 2010 -0600
@@ -32,6 +32,11 @@
 #include <ctype.h>
 #include <errno.h>
 
+#ifdef __CYGWIN__
+#include <stdlib.h>
+#include <unistd.h>
+#endif
+
 static void error (const char* s1, const char* s2);
 static void fatal (const char *s1, const char *s2);
 static void * xmalloc (size_t size);
@@ -40,7 +45,7 @@
 /* -- Post-Include Defines -------------------------------------------------- */
 
 /* Timeouts & delays */
-#define CONNECT_RETRIES		10
+#define CONNECT_RETRIES		20
 #define CONNECT_DELAY		500		/* ms */
 #define TRANSACTION_TIMEOUT	5000		/* ms */
 #define MAX_INPUT_IDLE_WAIT     INFINITE	/* ms */
@@ -51,7 +56,8 @@
 #define COMMAND_FORMAT	"[open(\"%s%s\")]"
 
 /* XEmacs program name */
-#define PROGRAM_TO_RUN	"xemacs.exe"
+#define GENERIC_PROGRAM		EMACS_PROGNAME ".exe"
+#define VERSIONED_PROGRAM	EMACS_PROGNAME "-" EMACS_VERSION ".exe"
 
 /* -- Constants ------------------------------------------------------------- */
 
@@ -107,7 +113,7 @@
   HCONV hConv;
   int   ret = 0;
   UINT  uiRet;
-  
+
   /* Initialise the DDEML library */
   uiRet = DdeInitialize (&idInst,
 			 (PFNCALLBACK) ddeCallback,
@@ -134,7 +140,7 @@
       /* Close the conversation */
       closeConversation (hConv);
     }
-  
+
   DdeUninitialize (idInst);
 
   return ret;
@@ -164,7 +170,7 @@
 
       goto error;
     }
-  
+
   /* Get the topic name */
   hszTopic = DdeCreateStringHandle (idInst,
 				    TOPIC_NAME,
@@ -186,11 +192,13 @@
       STARTUPINFO         sti;
       PROCESS_INFORMATION pi;
       int                 n;
-      
+
       /* Try to start the program */
       ZeroMemory (&sti, sizeof (sti));
       sti.cb = sizeof (sti);
-      if (!CreateProcess (NULL, PROGRAM_TO_RUN, NULL, NULL, FALSE, 0,
+      if (!CreateProcess (NULL, GENERIC_PROGRAM, NULL, NULL, FALSE, 0,
+			  NULL, NULL, &sti, &pi) &&
+	  !CreateProcess (NULL, VERSIONED_PROGRAM, NULL, NULL, FALSE, 0,
 			  NULL, NULL, &sti, &pi))
 	{
 	  MessageBox (NULL, "Could not start process.",
@@ -205,12 +213,12 @@
       /* Close the handles */
       CloseHandle (pi.hThread);
       CloseHandle (pi.hProcess);
-      
+
       /* Try to connect */
       for (n = 0; n < CONNECT_RETRIES; n++)
 	{
 	  Sleep (CONNECT_DELAY);
-	  
+	
 	  hConv = DdeConnect (idInst, hszService, hszTopic, NULL);
 
 	  if (hConv)
@@ -232,7 +240,7 @@
   DdeFreeStringHandle (idInst, hszTopic);
 
   return hConv;
-  
+
  error:
   if (hConv)
     DdeDisconnect (hConv);
@@ -268,11 +276,11 @@
 {
   char            *buf = NULL;
   unsigned        len;
-  
+
   /* Calculate the buffer length */
   len = strlen (lpszFileName1) + strlen (lpszFileName2)
     + strlen (COMMAND_FORMAT);
-  
+
   /* Allocate a buffer */
   buf = (char *) xmalloc (len);
 
@@ -286,15 +294,14 @@
 
   /* Build the command */
   len = wsprintf (buf, COMMAND_FORMAT, lpszFileName1, lpszFileName2);
+  len++;
 
-  len++;
-  
   /* OK. We're connected. Send the message. */
   DdeClientTransaction (buf, len, hConv, NULL,
 			0, XTYP_EXECUTE, TRANSACTION_TIMEOUT, NULL);
 
   free (buf);
-  
+
   return 0;
 }
 
@@ -319,14 +326,14 @@
   /* If this is the end, return NULL */
   if (!*p)
     return NULL;
-  
+
   /* Remember where we are */
   start = p;
-  
+
   /* Find the next whitespace character outside quotes */
   if (*p == '"')
     all_in_quotes = 1;
-  
+
   while (*p && !quit)
     {
       switch (*p)
@@ -339,7 +346,7 @@
 	case '\\':
 	  if (!in_quotes)
 	    all_in_quotes = 0;
-	  
+	
 	  p++;
 
 	  if (!*p)
@@ -368,13 +375,13 @@
       start++;
       length -= 2;
     }
-  
+
   /* Copy */
   buf = (char *) xmalloc (length + 1);
 
   if (!buf)
     return NULL;
-  
+
   strncpy (buf, start, length);
   buf[length] = '\0';
 
@@ -405,6 +412,38 @@
   /* Retrieve arguments */
   while ((arg = getNextArg ((const char**)&lpszCommandLine, &len)) != NULL)
     {
+      fullpath = NULL;
+#ifdef __CYGWIN__
+      /* If the filename is not an absolute path,
+	 add the current directory to the pathname */
+      if (*arg != '/')
+	{
+	  len = pathconf(".", _PC_PATH_MAX);
+	  fullpath = (char *) xmalloc (len+1);
+	  if (!fullpath)
+	    {
+		MessageBox (NULL, "Not enough memory.", "winclient",
+			    MB_ICONEXCLAMATION | MB_OK);
+		ret = 1;
+		break;
+	    }
+	  if (!getcwd(fullpath, (size_t)len))
+	    {
+	      MessageBox (NULL, "Could not retrieve current directory.",
+			  "winclient", MB_ICONEXCLAMATION | MB_OK);
+	      ret = 1;
+	      break;
+	    }
+          /* Append trailing slash */
+	  strcat(fullpath, "/");
+	  ret = doFile (hConv, fullpath, arg);
+	}
+      else
+	{
+	  /* The arg has already been expanded, so pass it as it is */
+	  ret = doFile (hConv, "", arg);
+	}
+#else
       /* First find the canonical path name */
       fullpath = filepart = NULL;
       pathlen = GetFullPathName (arg, 0, fullpath, &filepart);
@@ -415,10 +454,7 @@
 	{
 	  MessageBox (NULL, "Not enough memory.", "winclient",
 		      MB_ICONEXCLAMATION | MB_OK);
-	  
 	  ret = 1;
-	  free (arg);
-	  
 	  break;
 	}
 
@@ -448,9 +484,10 @@
 
 	  FindClose (hFindFile);
 	}
-
+#endif
       /* Release the path name buffers */
-      free (fullpath);
+      if (fullpath)
+	free (fullpath);
       free (arg);
 
       if (ret)
--- a/lisp/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,236 @@
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* help.el (describe-function-1):
+	Don't use compiled-function-annotation to retrieve the file name
+	for a function since it doesn't provide this info and load-history
+	already does provide it.
+
+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* make-docfile.el (format-decode): Remove this temporary function
+	definition, now we check the symbol is bound in fileio.c
+	* version.el (format-decode): Ditto.
+	* format.el (car-less-than-car, cdr-less-than-cdr): Move these
+	here from fileio.c, now they are only called once format.el is
+	available.
+
+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* setup-paths.el (paths-find-emacs-roots)
+	(paths-construct-info-path):
+	* packages.el (packages-find-installation-package-directories):
+	#'union doesn't guarantee that it will preserve the relative order
+	of elements in its arguments; use #'delete-duplicates
+	instead. Thank you for the bug reports, Robert Pluim, Stephen
+	Turnbull.
+
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* unicode.el:
+	* unicode.el (for):
+	Convert file to utf-8.
+
+2010-02-03  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-extra.el (some, every):
+	Move these functions to C.
+	* cl-macs.el (notany, notevery): Add compiler macros for these
+	functions, no longer proclaim them inline (which would involve
+	specbinding that's not necessary with the compiler macros).
+
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* code-init.el:
+	* code-init.el (set-eol-detection):
+	* code-init.el (coding-system-current-system-configuration):
+	* code-init.el (coding-system-default-configuration-table): New.
+	* code-init.el (no-mule-no-eol-detection):
+	* code-init.el (define-coding-system-default-configuration): New.
+	* code-init.el (coding-system-variable-default-value-table): Removed.
+	* code-init.el (no-mule-eol-detection):
+	* code-init.el (coding-system-default-configuration-list): Removed.
+	* code-init.el (coding-system-default-variable-list):
+	* code-init.el (get-coding-system-variable):
+	* code-init.el (set-coding-system-variable):
+	* code-init.el (coding-system-variable-default-value):
+	* code-init.el (reset-coding-categories-to-default):
+	Significant clean-up, add Cygwin-UTF-8 support.
+
+	1. Shorten the names of the coding system variables to follow
+	   what used to be considered the "abbreviations":
+
+	   default-process-coding-system-read	->	process-read
+	   default-process-coding-system-write	->	process-write
+	   buffer-file-coding-system-for-read	->	bfcs-for-read
+	   default-buffer-file-coding-system	->	default-bfcs
+	   no-conversion-coding-system-mapping	->	no-conv-cs
+
+	2. Instead of listing all the defaults in a big, strangely organized
+	   table, use a new function
+	   `define-coding-system-default-configuration' to define a
+	   particular configuration.  This uses a hash table stored in
+	   `coding-system-default-configuration-table'.  Rewrite
+	   `coding-system-variable-default-value' appropriately.
+
+	3. Rename configurations to eliminate `unix' from the name:
+
+	   unix-no-mule-no-eol-detection      ->     no-mule-no-eol-detection
+	   unix-no-mule-eol-detection	      ->     no-mule-eol-detection
+	   unix-mule			      ->     mule
+
+	   This is because these are really for all systems but Windows,
+	   not just Unix.
+
+	4. Add configuration `cygwin-utf-8', enabled when (featurep
+	   'cygwin-use-utf-8).  Uses `utf-8' for all defaults except for
+	   `bfcs-for-read', which is `undecided'.
+
+2010-01-28  Ben Wing  <ben@xemacs.org>
+
+	* lisp-mode.el: Finish documenting `lisp-indent-specform',
+	on Mike Sperber's request.
+
+2010-01-17  Ben Wing  <ben@xemacs.org>
+
+	* bytecomp-runtime.el:
+	* bytecomp-runtime.el (error-unless-tests-match): New.
+	* bytecomp-runtime.el (byte-compile-file-being-compiled): New.
+	* bytecomp-runtime.el (compiled-if): New.
+	* bytecomp-runtime.el (compiled-when): New.
+	Add functions for dealing with conditional compilation of different code
+	depending on the presence or absence of features.  Necessary for some
+	Mule code where code is run during compilation (macros or eval-when-compile)
+	but, depending on how the code is written, the code itself will crash
+	either with or without Unicode-internal.
+
+	compiled-if and compiled-when are the basic functions for conditional
+	compilation.  They automatically trigger an error message upon file
+	loading	if, at that time, the test expression that selected which code
+	to compile does	not have the same value as at compile time.
+
+2010-01-25  Ben Wing  <ben@xemacs.org>
+
+	* mule/cyrillic.el (koi8-c):
+	Fix bug in #83 mapping.
+	* mule/vietnamese.el (viscii):
+	Fix bug in #A6 mapping.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* simple.el (capitalize-string-as-title):
+	Use `with-string-as-buffer-contents' instead of emulating it.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* syntax.el:
+	* syntax.el (make-syntax-table):
+	Expand doc string.
+
+2010-01-22  Ben Wing  <ben@xemacs.org>
+
+	* lisp-mode.el:
+	* lisp-mode.el (lisp-indent-function):
+	If the function begins with `with-', assume it is a macro or
+	special form whose last argument is a body.  Call
+	`lisp-indent-specform' with a flag indicating that it should indent
+	all arguments as a body instead of with normal (full) indent.
+	* lisp-mode.el (lisp-indent-specform):
+	Add an optional flag argument indicating that all non-distinguished
+	arguments, not just the first, should be indented as a body.  This
+	is useful when the number of distinguished (i.e. pre-body) arguments
+	isn't known, and is used for this purpose by `lisp-indent-function'.
+	
+
+2010-01-20  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* simple.el (handle-pre-motion-command-current-command-is-motion):
+	This function is called a *lot*, make it faster, making
+	keysyms-equal inline, calling #'characterp (which doesn't have a
+	bytecode) much more rarely, and not throwing and catching. This
+	won't make much difference in practice, but does eliminate losts
+	of noise from profiling, e.g. at startup.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* loadup.el:
+	* loadup.el (featurep):
+	* loadup.el (member):
+	When featurep `debug-xemacs' (configure --with-debug), set
+	debug-on-error, so that we get an exit-to-debugger/assertion
+	failure upon Lisp error during loadup.  Unset before dumping.
+
+2010-01-10  Ben Wing  <ben@xemacs.org>
+
+	* mule/mule-cmds.el (get-native-coding-system-from-language-environment):
+	Under Cygwin, force utf-8 if we are using Cygwin 1.7 or later
+	(making use of the magic feature 'cygwin-use-utf-8).
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* unicode.el:
+	* unicode.el (utf-8):
+	Don't define `utf-8' coding system here, because it's too late.
+	We need it during early startup code at dump time so we create it
+	in C in unicode.c.
+
+2010-01-10  Didier Verna  <didier@xemacs.org>
+
+	* x-faces.el (x-init-face-from-resources)
+	(x-init-device-faces)
+	(x-init-frame-faces): Cosmetic changes (comments formatting).
+
+2010-01-09  Didier Verna  <didier@xemacs.org>
+
+	* x-faces.el (x-init-global-faces): Deactivate obsolete code.
+	* x-faces.el (x-init-device-faces): Ditto.
+	* x-faces.el (x-init-frame-faces): Ditto.
+
+2010-01-09  Didier Verna  <didier@xemacs.org>
+
+	* glyphs.el (init-glyphs): Recognize bitmaps/ directory as
+	containing bitmap files.
+
+2010-01-09  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* subr.el (with-trapping-errors): 
+	Fix a bug here, where I used a normal quote instead of a
+	backquote. Thank you the byte-compiler.
+
+2010-01-08  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* indent.el (indent-region):
+	Make COLUMN optional as in GNU, merging Andreas Roehler's change
+	of http://mid.gmane.org/4B46F5FC.2070506@online.de ; thank you
+	Andreas!
+
+2010-01-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (map):
+	Add a compiler macro for this function, for cases where CL-TYPE is
+	constant and understood.
+
+2010-01-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* unicode.el (load-unicode-tables):
+	* mule/mule-msw-init-late.el:
+	* mule/mule-category.el (predefined-category-list):
+	* mule/arabic.el:
+	Move arabic-iso8859-6 back to C, it needs to be there, otherwise
+	X11 character input lookup fails.
+
+2010-01-06  Didier Verna  <didier@xemacs.org>
+
+	* cl-extra.el (get-properties): New.
+
+2009-12-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* list-mode.el (next-list-mode-item, switch-to-completions): Use
+	next-single-char-property-change,
+	previous-single-char-property-change now
+	next-single-property-change no longer pays attention to extents
+	not created using the text property functions. Fix for issue 546,
+	bug dates from changeset 8c96bdabcaf9.
+
 2009-12-21  Jerry James  <james@xemacs.org>
 
 	* dragdrop.el (offix-start-drag): Remove.
@@ -12,64 +245,345 @@
 
 2009-12-21  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/arabic.el (arabic-iso8859-6): 
+	* mule/arabic.el (arabic-iso8859-6):
 	Move the creation of this character set to this (dumped) file,
-	since it's needed for input on X11. 
-	* mule/iso-with-esc.el: 
+	since it's needed for input on X11.
+	* mule/iso-with-esc.el:
 	Remove arabic-iso8859-6 and its Unicode map from this file.
-	* unicode.el (load-unicode-tables): 
+	* unicode.el (load-unicode-tables):
 	Load arabic-iso8859-6 on startup again.
 
+2009-12-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (cl-do-arglist):
+	* cl-compat.el (keyword-of):
+	Remove support in our generated code for emacs versions where
+	keywords are not self-quoting.
+
+2010-02-03  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Delete a couple of XEmacs-specific functions that duplicate CL
+	functions.
+
+	* find-paths.el (paths-filter, paths-uniq-append):
+	Remove #'paths-filter, a reimplementation of #'remove-if-not, and
+	#'paths-uniq-append, a reimplementation of #'union with test
+	#'equal.
+	(paths-decode-directory-path): Don't use #'path-filter here.
+	* packages.el (packages-package-hierarchy-directory-names):
+	Don't use #'path-filter here.
+	(packages-find-installation-package-directories):
+	Use #'union, not #'paths-uniq-append here.
+	* setup-paths.el (paths-find-invocation-roots)
+	(paths-find-emacs-roots, paths-construct-info-path)
+	(paths-construct-info-path):
+	Replace #'paths-filter with #'remove-if-not, #'paths-uniq-append
+	with #'union. 
+
+2010-02-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* loadhist.el (symbol-file):
+	If #'built-in-symbol-file returns a Lisp file name, and
+	source-lisp is readable, construct a full pathname to include
+	that. Otherwise use lisp-directory, as we used to.
+	* loadup.el:
+	Delete load-history entries for those files in
+	preloaded-file-list; unloading the associated features makes very
+	little sense, and the symbol file information can be had from DOC.
+
+2010-02-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (equalp):
+	Remove special treatment for an #'equalp with a single character
+	constant argument, it was incorrect (it used #'downcase instead of
+	#'canoncase).
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* cl-extra.el:
+	* cl-extra.el (cl-string-vector-equalp): Removed.
+	* cl-extra.el (cl-bit-vector-vector-equalp): Removed.
+	* cl-extra.el (cl-vector-array-equalp): Removed.
+	* cl-extra.el (cl-hash-table-contents-equalp): Removed.
+	* cl-extra.el (equalp): Removed.
+	* cl-extra.el (cl-mapcar-many):
+	Comment out the whole `equalp' implementation for the moment;
+	remove once we're sure the C implementation works.
+	
+	* cl-macs.el:
+	* cl-macs.el (equalp):
+	Simplify the compiler-macro for `equalp' -- once it's in C,
+	we don't need to try so hard to expand it.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* obsolete.el:
+	* loadhist.el (symbol-file):
+	* help.el (describe-function-1):
+	* bytecomp.el: (byte-compile-save-current-buffer):
+	* byte-optimize.el (byte-optimize-form-code-walker):
+	* subr.el (subr-arity):
+	Change "special form" to "special operator" in these files, it's
+	the more logical term.
+
+	* subr.el (special-form-p): Provide this alias for
+	#'special-operator-p. 
+
+2010-01-30  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* loadup.el:
+	If any filename in load-history starts with the value of
+	source-lisp, delete that part of the string, so that
+	#'find-function works better with dumped functions in an installed
+	XEmacs (it will look in lisp-directory instead, where it will
+	probably succeed).
+
+2010-01-29  Ben Wing  <ben@xemacs.org>
+
+	* mule/cyrillic.el (for):
+	Upper and lowercase mappings were reversed for some old-Cyrillic
+	chars.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl.el (mapcar*): Delete; this is now in fns.c.
+	Use #'mapc, not #'mapc-internal in a couple of places.
+	* cl-macs.el (mapc, mapcar*, map): Delete these compiler macros
+	now the corresponding functions are in fns.c; there's no run-time
+	advantage to the macros.
+	* cl-extra.el (coerce): Extend the possible conversions here a
+	little; it's not remotely comprehensive yet, though it does allow
+	running slightly more Common Lisp code than previously.
+	(cl-mapcar-many): Delete.
+	(map, maplist, mapc, mapl, mapcan, mapcon): Move these to fns.c.
+	* bytecomp.el (byte-compile-maybe-mapc):
+	Use #'mapc itself, not #'mapc-internal, now the former is in C.
+	(mapcar*): Use #'byte-compile-maybe-mapc as this function's
+	byte-compile method, now a #'mapc that can take more than one
+	sequence is in C.
+	* obsolete.el (cl-mapc): Move this compatibility alias to this file.
+	* update-elc.el (do-autoload-commands): Use #'mapc, not
+	#'mapc-internal here. 
+	
+2010-01-26  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule/vietnamese.el (viscii): Correct the mapping here, #xA6 is
+	actually *SMALL* LETTER A WITH CIRCUMFLEX AND HOOK ABOVE.
+	* mule/cyrillic.el (koi8-c): Correct the mapping here, #x8C is
+	actually ?\u04D9. Add a case mapping for it.
+
+2010-01-24  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Correct the semantics of #'member*, #'eql, #'assoc* in the
+	presence of bignums; change the integerp byte code to fixnump
+	semantics.
+
+	* bytecomp.el (fixnump, integerp, byte-compile-integerp): 
+	Change the integerp byte code to fixnump; add a byte-compile
+	method to integerp using fixnump and numberp and avoiding a
+	funcall most of the time, since in the non-core contexts where
+	integerp is used, it's mostly distinguishing between fixnums and
+	things that are not numbers at all.
+	* byte-optimize.el (side-effect-free-fns, byte-after-unbind-ops)
+	(byte-compile-side-effect-and-error-free-ops):
+	Replace the integerp bytecode with fixnump; add fixnump to the
+	side-effect-free-fns. Add the other extended number type
+	predicates to the list in passing.
+
+	* obsolete.el (floatp-safe): Mark this as obsolete.
+
+	* cl.el (eql): Go into more detail in the docstring here. Don't
+	bother checking whether both arguments are numbers; one is enough,
+	#'equal will fail correctly if they have distinct types.
+	(subst): Replace a call to #'integerp (deciding whether to use
+	#'memq or not) with one to #'fixnump.
+	Delete most-positive-fixnum, most-negative-fixnum from this file;
+	they're now always in C, so they can't be modified from Lisp.
+	* cl-seq.el (member*, assoc*, rassoc*):
+	Correct these functions in the presence of bignums.
+	* cl-macs.el (cl-make-type-test): The type test for a fixnum is
+	now fixnump. Ditch floatp-safe, use floatp instead.
+	(eql): Correct this compiler macro in the presence of bignums.
+	(assoc*): Correct this compiler macro in the presence of bignums.
+
+	* simple.el (undo): 
+	Change #'integerp to #'fixnump here, since we use #'delq with the
+	same value as ELT a few lines down.
+
+2010-01-20  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* simple.el (handle-pre-motion-command-current-command-is-motion):
+	This function is called a *lot*, make it faster, making
+	keysyms-equal inline, calling #'characterp (which doesn't have a
+	bytecode) much more rarely, and not throwing and catching. This
+	won't make much difference in practice, but does eliminate losts
+	of noise from profiling, e.g. at startup.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* loadup.el:
+	* loadup.el (featurep):
+	* loadup.el (member):
+	When featurep `debug-xemacs' (configure --with-debug), set
+	debug-on-error, so that we get an exit-to-debugger/assertion
+	failure upon Lisp error during loadup.  Unset before dumping.
+
+2010-01-10  Ben Wing  <ben@xemacs.org>
+
+	* mule/mule-cmds.el (get-native-coding-system-from-language-environment):
+	Under Cygwin, force utf-8 if we are using Cygwin 1.7 or later
+	(making use of the magic feature 'cygwin-use-utf-8).
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* unicode.el:
+	* unicode.el (utf-8):
+	Don't define `utf-8' coding system here, because it's too late.
+	We need it during early startup code at dump time so we create it
+	in C in unicode.c.
+
+2010-01-10  Didier Verna  <didier@xemacs.org>
+
+	* x-faces.el (x-init-face-from-resources)
+	(x-init-device-faces)
+	(x-init-frame-faces): Cosmetic changes (comments formatting).
+
+2010-01-09  Didier Verna  <didier@xemacs.org>
+
+	* x-faces.el (x-init-global-faces): Deactivate obsolete code.
+	* x-faces.el (x-init-device-faces): Ditto.
+	* x-faces.el (x-init-frame-faces): Ditto.
+
+2010-01-09  Didier Verna  <didier@xemacs.org>
+
+	* glyphs.el (init-glyphs): Recognize bitmaps/ directory as
+	containing bitmap files.
+
+2010-01-09  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* subr.el (with-trapping-errors): 
+	Fix a bug here, where I used a normal quote instead of a
+	backquote. Thank you the byte-compiler.
+
+2010-01-08  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* indent.el (indent-region):
+	Make COLUMN optional as in GNU, merging Andreas Roehler's change
+	of http://mid.gmane.org/4B46F5FC.2070506@online.de ; thank you
+	Andreas!
+
+2010-01-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (map):
+	Add a compiler macro for this function, for cases where CL-TYPE is
+	constant and understood.
+
+2010-01-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* unicode.el (load-unicode-tables):
+	* mule/mule-msw-init-late.el:
+	* mule/mule-category.el (predefined-category-list):
+	* mule/arabic.el:
+	Move arabic-iso8859-6 back to C, it needs to be there, otherwise
+	X11 character input lookup fails.
+
+2010-01-06  Didier Verna  <didier@xemacs.org>
+
+	* cl-extra.el (get-properties): New.
+
+2009-12-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* list-mode.el (next-list-mode-item, switch-to-completions): Use
+	next-single-char-property-change,
+	previous-single-char-property-change now
+	next-single-property-change no longer pays attention to extents
+	not created using the text property functions. Fix for issue 546,
+	bug dates from changeset 8c96bdabcaf9.
+
+2009-12-21  Jerry James  <james@xemacs.org>
+
+	* dragdrop.el (offix-start-drag): Remove.
+	(offix-start-drag-region): Remove.
+	* mouse.el (mouse-begin-drag-n-drop): Remove OffiX support.
+
+2009-12-21  Adrian Aichner  <adrian@xemacs.org>
+
+	* package-get.el (package-get-download-sites): Remove
+	dk.xemacs.org from list of package download sites.
+	* package-get.el (package-get-pre-release-download-sites): Ditto.
+
+2009-12-21  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule/arabic.el (arabic-iso8859-6):
+	Move the creation of this character set to this (dumped) file,
+	since it's needed for input on X11.
+	* mule/iso-with-esc.el:
+	Remove arabic-iso8859-6 and its Unicode map from this file.
+	* unicode.el (load-unicode-tables):
+	Load arabic-iso8859-6 on startup again.
+
+2009-12-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-macs.el (cl-do-arglist):
+	* cl-compat.el (keyword-of):
+	Remove support in our generated code for emacs versions where
+	keywords are not self-quoting.
+
+2009-12-21  Michael Sperber  <mike@xemacs.org>
+
+	* gnuserv.el (gnuserv-program): Specifically look for gnuserv in
+	`exec-directory'.
+
 2009-12-18  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* alist.el (modify-alist): 
-	* autoload.el (update-autoload-files, autoload-print-form): 
+	* alist.el (modify-alist):
+	* autoload.el (update-autoload-files, autoload-print-form):
 	* bytecomp.el (batch-byte-compile-1)
 	(byte-compile-multiple-value-call, byte-compile-funcall)
 	(byte-compile-insert, byte-compile-concat, byte-compile-list)
-	(byte-compile-normal-call, byte-compile-flush-pending): 
-	* cl-macs.el (letf): 
+	(byte-compile-normal-call, byte-compile-flush-pending):
+	* cl-macs.el (letf):
 	* cl.el:
-	* disass.el (disassemble-1): 
-	* easy-mmode.el (easy-mmode-define-syntax): 
-	* faces.el (set-face-parent): 
-	* files.el (cd): 
+	* disass.el (disassemble-1):
+	* easy-mmode.el (easy-mmode-define-syntax):
+	* faces.el (set-face-parent):
+	* files.el (cd):
 	* finder.el (finder-list-matches, finder-list-keywords)
-	(finder-compile-keywords): 
+	(finder-compile-keywords):
 	* frame.el (frame-notice-user-settings)
-	(frame-remove-geometry-props): 
+	(frame-remove-geometry-props):
 	* ldap.el (ldap-delete-entries, ldap-modify-entries)
-	(ldap-add-entries): 
-	* loadhist.el (unload-feature): 
-	* map-ynp.el (map-y-or-n-p): 
-	* menubar-items.el (default-menubar): 
+	(ldap-add-entries):
+	* loadhist.el (unload-feature):
+	* map-ynp.el (map-y-or-n-p):
+	* menubar-items.el (default-menubar):
 	* mouse.el (default-mouse-track-next-move-rect)
 	(default-mouse-track-next-move-rect)
 	(default-mouse-track-cleanup-hook)
-	(default-mouse-track-cleanup-extent): 
+	(default-mouse-track-cleanup-extent):
 	* mule/ethio-util.el (ethio-fidel-to-sera-buffer)
-	(ethio-modify-vowel): 
-	* obsolete.el: 
-	* package-get.el (package-get-update-all): 
+	(ethio-modify-vowel):
+	* obsolete.el:
+	* package-get.el (package-get-update-all):
 	* package-ui.el (pui-list-packages)
-	(pui-install-selected-packages, pui-install-selected-packages): 
+	(pui-install-selected-packages, pui-install-selected-packages):
 	* select.el (select-make-extent-for-selection)
-	(dehilight-selection): 
-	* simple.el (clone-buffer): 
-	* term/tvi970.el: 
-	* term/wyse50.el: 
-	* unicode.el: 
-	(load-unicode-tables): 
+	(dehilight-selection):
+	* simple.el (clone-buffer):
+	* term/tvi970.el:
+	* term/wyse50.el:
+	* unicode.el:
+	(load-unicode-tables):
 	* x-font-menu.el (fc-make-font-menu-entry)
-	(x-reset-device-font-menus-xft): 
-	* x-misc.el (x-init-specifier-from-resources): 
+	(x-reset-device-font-menus-xft):
+	* x-misc.el (x-init-specifier-from-resources):
 	Eliminate byte-compile warnings, with the exception of Stephen's
 	various non-defined fontconfig functions, as I don't know if he
 	plans to add them and is keeping the warnings around as a
 	reminder. The warnings actually eliminated involve i) using mapcar
 	instead of mapc where the result is discarded and ii) using a
 	lambda quoted as data in a context where it is unequivocally used
-	as a function. 
+	as a function.
 
 2009-12-17  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -81,11 +595,30 @@
 	that they are *that* fast, for most of the coding systems they're
 	used a minority of the time.
 
+2010-01-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* syntax.el (map-syntax-table):
+	* subr.el (map-plist):
+	* startup.el (load-init-file):
+	* minibuf.el (read-from-minbuffer):
+	* cus-edit.el (custom-load-custom-defines-1):
+	* cmdloop.el (execute-extended-command):
+	Replace symbol names using underscore, whether to avoid dynamic
+	scope problems or to ensure helpful arguments to
+	#'call-with-condition-handler, with uninterned symbols.
+
 2009-12-05  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* font.el (x-font-create-object): Check for Xft before using it.
 	This fixes the symptom in openSUSE bug #558764.
 
+2010-01-09  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* descr-text.el (describe-char-unihan-field-descriptions):
+	* cl-macs.el:
+	Use keywords, not ordinary symbols, in the hash table read syntax,
+	for compatibility with Common Lisp and recent GNU Emacs.
+
 2009-11-10  Jerry James  <james@xemacs.org>
 
 	* device.el (device-type): Remove (mostly imaginary) support for
@@ -103,20 +636,20 @@
 
 2009-11-15  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* custom.el (custom-quote): 
+	* custom.el (custom-quote):
 	Define this as an alias for `quote-maybe', which is in C and more
 	comprehensive; packages still use this name in places.
 	(customize-mark-to-save, customize-mark-as-set): Use
 	`quote-maybe', not `custom-quote'.
 	* cus-edit.el (customize-set-variable, customize-save-variable)
 	(custom-variable-value-create, custom-variable-set)
-	(custom-variable-pre-save): 
+	(custom-variable-pre-save):
 	Remove a version of `custom-quote' specific to this file; use
 	`quote-maybe' universally instead.
 
 2009-11-14  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* bytecomp.el (byte-compile-funarg-n): 
+	* bytecomp.el (byte-compile-funarg-n):
 	New macro, used to create the various byte-compile-funarg
 	functions, which check for quoted lambdas in given positions.
 	(byte-compile-funarg, byte-compile-funarg-2)
@@ -126,21 +659,21 @@
 	to this problem.
 	Be much more comprehensive in the functions that we use
 	byte-compile-funarg and related function to compile, especially
-	including functions from cl-seq.el. 
+	including functions from cl-seq.el.
 
 2009-11-14  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-macs.el (letf): 
+	* cl-macs.el (letf):
 	Check whether arguments to #'values are bound, and make them
 	unbound after evaluating BODY; document the limitations of this
 	macro.
 
 2009-11-14  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* faces.el (init-other-random-faces): 
+	* faces.el (init-other-random-faces):
 	If the modeline face is using its fallbacks, avoid that, specify
 	the corresponding problems instead. Fixes problems described in
-	http://mid.gmane.org/3ggprc2diyt.wl_Ron.Isaacson@morganstanley.com 
+	http://mid.gmane.org/3ggprc2diyt.wl_Ron.Isaacson@morganstanley.com
 
 2009-11-09  Didier Verna  <didier@xemacs.org>
 
@@ -151,14 +684,27 @@
 
 2009-11-08  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* bytecomp.el (save-window-excursion): 
+	* bytecomp.el (save-window-excursion):
 	Remove the compiler form for this bytecode, we no longer generate
 	calls to it. Keep the information about the bytecode's numeric
 	value, we want that for disassembling code.
 
+2009-11-08  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* cl-extra.el (cl-string-vector-equalp)
+	(cl-bit-vector-vector-equalp, cl-vector-array-equalp)
+	(cl-hash-table-contents-equalp): New functions, to implement
+	equalp treating arrays with identical contents as equivalent, as
+	specified by Common Lisp.
+	(equalp): Revise this function to implement array equivalence,
+	and the hash-table equalp behaviour specified by CL.
+	* cl-macs.el (equalp): Add a compiler macro for this function,
+	used when one of the arguments is constant, and as such, its type
+	is known at compile time.
+
 2009-11-01  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-extra.el (equalp): 
+	* cl-extra.el (equalp):
 	Don't error if handed a string and a non-string.
 
 2009-11-01  Stephen Turnbull  <stephen@xemacs.org>
@@ -214,7 +760,7 @@
 
 2009-10-30  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-macs.el (regexp-quote): 
+	* cl-macs.el (regexp-quote):
 	If STRING is constant, call regexp-quote at compile time.
 
 2009-10-24  Aidan Kehoe  <kehoea@parhasard.net>
@@ -225,32 +771,32 @@
 	New function; return t if file names under PATH should be treated
 	case-insensitively.
 	* minibuf.el (read-file-name-1, read-file-name-internal-1)
-	(read-file-name-internal-1): 
-	* package-admin.el (package-admin-check-manifest): 
+	(read-file-name-internal-1):
+	* package-admin.el (package-admin-check-manifest):
 	Use file-system-ignore-case-p instead of checking system-type
 	directly in these functions. (Even though minibuf.el is dumped
 	before files.el, the function is only called in interactive usage,
-	there's no dump time order dependency here.) 
+	there's no dump time order dependency here.)
 
 2009-10-19  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* bytecomp.el (byte-compile-default-warnings): 
+	* bytecomp.el (byte-compile-default-warnings):
 	Add two new warning types, discarded-consing (basically use of
 	mapcar instead of mapc where its result is discarded) and
 	quoted-lambda (use of a lambda expression quoted as data in a
 	function context).
-	(byte-compile-warnings): Document the new warnings. 
+	(byte-compile-warnings): Document the new warnings.
 	(byte-compile-fset, byte-compile-funarg): Implement the
-	quoted-lambda warning option. 
+	quoted-lambda warning option.
 	(byte-compile-mapcar): Renamed to byte-compile-maybe-mapc.
-	(byte-compile-maybe-mapc, byte-compile-maplist): 
-	Implement the discarded-consing warning option. 
+	(byte-compile-maybe-mapc, byte-compile-maplist):
+	Implement the discarded-consing warning option.
 	Add more functions that should be compiled using
 	byte-compile-funarg, notably mapvector, mapc-internal,
-	map-char-table. 
-	* cl-macs.el (mapcar*): 
+	map-char-table.
+	* cl-macs.el (mapcar*):
 	If we know at compile time that there are no CL options being
-	used, use the mapcar subr, not the byte-coded function. 
+	used, use the mapcar subr, not the byte-coded function.
 
 2009-10-12  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -262,13 +808,13 @@
 	mapc-internal call instead, and warn, because the programmer
 	probably can't rely on always being compiled by an XEmacs that
 	does this. Similarly for maplist and mapl; and use
-	byte-compile-funarg for map, mapl, mapcan, mapcon. 
+	byte-compile-funarg for map, mapl, mapcan, mapcon.
 
 2009-10-12  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-macs.el (delete-duplicates): 
+	* cl-macs.el (delete-duplicates):
 	Fix another bug in the delete-duplicates compiler macro, thank you
-	the byte compiler. 
+	the byte compiler.
 
 2009-10-07  Andreas Roehler  <andreas.roehler@online.de>
 
@@ -305,7 +851,7 @@
 
 2009-10-03  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-macs.el (delete-duplicates): 
+	* cl-macs.el (delete-duplicates):
 	Make this compiler macro aware that CL-SEQ is a sequence, which
 	may not necessarily be a list.
 
@@ -323,66 +869,66 @@
 
 2009-09-27  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cus-edit.el (custom-variable-prompt): 
+	* cus-edit.el (custom-variable-prompt):
 	nil is a symbol, check that variable-at-point is non-nil before
 	checking if it's a symbol when deciding on the prompt used in this
-	function. 
+	function.
 
 2009-09-22  Andreas Roehler  <andreas.roehler@online.de>
 
 	* lisp.el (beginning-of-defun-raw):
-	new variable: beginning-of-defun-function, 
+	new variable: beginning-of-defun-function,
 	beginning-of-defun may call FUNCTION determining start position
 	* lisp.el (end-of-defun):
-	new variable: end-of-defun-function,	
+	new variable: end-of-defun-function,
 	end-of-defun may call FUNCTION determining the end position
 
 2009-09-20  Aidan Kehoe  <kehoea@parhasard.net>
 
 	Add arglist information to docstrings for autoloaded functions and
 	macros.
-	* hyper-apropos.el (hyper-apropos-get-doc): 
+	* hyper-apropos.el (hyper-apropos-get-doc):
 	Treat autoload docstrings like subr docstrings; correct the regexp
 	used.
-	* help.el (describe-function-show-arglist): 
-	This no longer treats autoloads specially. 
-	(function-arglist): Treat autoload docstrings like subr docstrings. 
+	* help.el (describe-function-show-arglist):
+	This no longer treats autoloads specially.
+	(function-arglist): Treat autoload docstrings like subr docstrings.
 	(function-documentation): Treat documentation strings that are
 	zero-length after the arglist has been removed as indicating a
 	lack of documentation.
-	* cl-macs.el (case): 
-	(ecase): 
-	(typecase): 
-	(etypecase): 
-	(block): 
-	(return): 
-	(return-from): 
-	(progv): 
-	(lexical-let): 
-	(lexical-let*): 
-	(remf): 
-	(callf): 
-	(callf2): 
-	(define-modify-macro): 
-	(deftype): 
-	(define-compiler-macro): 
+	* cl-macs.el (case):
+	(ecase):
+	(typecase):
+	(etypecase):
+	(block):
+	(return):
+	(return-from):
+	(progv):
+	(lexical-let):
+	(lexical-let*):
+	(remf):
+	(callf):
+	(callf2):
+	(define-modify-macro):
+	(deftype):
+	(define-compiler-macro):
 	Rely on the autoload code to always show an arglist for these
 	functions, don't supply an ad-hoc one in the docstring.
 	These changes are for the most obvious functions; there are some
 	missed that would require changing argument names in the docstring
 	or in the function bodies.
-	* autoload.el (make-autoload): 
+	* autoload.el (make-autoload):
 	Add arg list information to the doc string, using the same
 	approach as for subrs.
 
 2009-09-20  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* help.el (function-arglist): 
-	Show the double-quotes in the sample output, correctly. 
-	Bind print-gensym to nil, now we're using uninterned symbols. 
+	* help.el (function-arglist):
+	Show the double-quotes in the sample output, correctly.
+	Bind print-gensym to nil, now we're using uninterned symbols.
 	Don't #'mapcar + #'intern to create uppercase symbols, use #'loop
 	and #'make-symbol instead.
-	* cl-macs.el (cl-upcase-arg): 
+	* cl-macs.el (cl-upcase-arg):
 	Don't intern the upcased symbols we're using for cosmetic reasons.
 	Trust #'true-list-p in #'cl-function-arglist to detect
 	circularity.
@@ -395,82 +941,82 @@
 
 2009-09-20  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/make-coding-system.el (make-coding-system): 
+	* mule/make-coding-system.el (make-coding-system):
 	Require a minimum of two, not four, arguments; thank you for the
 	problem report, Adam Sj�gren!
 
 2009-09-19  Aidan Kehoe  <kehoea@parhasard.net>
 
 	Move the #'query-coding-region implementation to C.
-	* coding.el: 
+	* coding.el:
 	Consolidate code that depends on the presence or absence of Mule
-	at the end of this file. 
+	at the end of this file.
 	(default-query-coding-region, query-coding-region):
-	Move these functions to C. 
+	Move these functions to C.
 	(default-query-coding-region-safe-charset-skip-chars-map):
 	Remove this variable, the corresponding C variable is
-	Vdefault_query_coding_region_chartab_cache in file-coding.c. 
+	Vdefault_query_coding_region_chartab_cache in file-coding.c.
 	(query-coding-string): Update docstring to reflect actual multiple
 	values, be more careful about not modifying a range table that
 	we're currently mapping over.
 	(encode-coding-char): Make the implementation of this simpler.
 	(featurep 'mule): Autoload #'make-coding-system from
 	mule/make-coding-system.el if we're a mule build; provide an
-	appropriate compiler macro. 
+	appropriate compiler macro.
 	Do various non-mule compatibility things if we're not a mule
-	build. 
-	* update-elc.el (additional-dump-dependencies): 
+	build.
+	* update-elc.el (additional-dump-dependencies):
 	Add mule/make-coding-system as a dump time dependency if we're a
-	mule build. 
-	* unicode.el (ccl-encode-to-ucs-2): 
-	(decode-char): 
-	(encode-char): 
+	mule build.
+	* unicode.el (ccl-encode-to-ucs-2):
+	(decode-char):
+	(encode-char):
 	Move these earlier in the file, for the sake of some byte compile
-	warnings. 
-	(unicode-query-coding-region): 	
+	warnings.
+	(unicode-query-coding-region):
 	Move this to unicode.c
 	* mule/make-coding-system.el:
 	New file, not dumped. Contains the functionality to rework the
 	arguments necessary for fixed-width coding systems, and contains
 	the implementation of #'make-coding-system, which now calls
 	#'make-coding-system-internal.
-	* mule/vietnamese.el (viscii): 
-	* mule/latin.el (iso-8859-2): 
-	(windows-1250): 
-	(iso-8859-3): 
-	(iso-8859-4): 
-	(iso-8859-14): 
-	(iso-8859-15): 
-	(iso-8859-16): 
-	(iso-8859-9): 
-	(macintosh): 
-	(windows-1252): 
-	* mule/hebrew.el (iso-8859-8): 
-	* mule/greek.el (iso-8859-7): 
-	(windows-1253): 
-	* mule/cyrillic.el (iso-8859-5): 
-	(koi8-r): 
-	(koi8-u): 
-	(windows-1251): 
-	(alternativnyj): 
-	(koi8-ru): 
-	(koi8-t): 
-	(koi8-c): 
-	(koi8-o): 
-	* mule/arabic.el (iso-8859-6): 	
-	(windows-1256): 
+	* mule/vietnamese.el (viscii):
+	* mule/latin.el (iso-8859-2):
+	(windows-1250):
+	(iso-8859-3):
+	(iso-8859-4):
+	(iso-8859-14):
+	(iso-8859-15):
+	(iso-8859-16):
+	(iso-8859-9):
+	(macintosh):
+	(windows-1252):
+	* mule/hebrew.el (iso-8859-8):
+	* mule/greek.el (iso-8859-7):
+	(windows-1253):
+	* mule/cyrillic.el (iso-8859-5):
+	(koi8-r):
+	(koi8-u):
+	(windows-1251):
+	(alternativnyj):
+	(koi8-ru):
+	(koi8-t):
+	(koi8-c):
+	(koi8-o):
+	* mule/arabic.el (iso-8859-6):
+	(windows-1256):
 	Move all these coding systems to being of type fixed-width, not of
 	type CCL. This allows the distinct query-coding-region for them to
 	be in C, something which will eventually allow us to implement
 	query-coding-region for the mswindows-multibyte coding systems.
-	* mule/general-late.el (posix-charset-to-coding-system-hash): 
+	* mule/general-late.el (posix-charset-to-coding-system-hash):
 	Document why we're pre-emptively persuading the byte compiler that
 	the ELC for this file needs to be written using escape-quoted.
 	Call #'set-unicode-query-skip-chars-args, now the Unicode
-	query-coding-region implementation is in C. 
-	* mule/thai-xtis.el (tis-620): 
+	query-coding-region implementation is in C.
+	* mule/thai-xtis.el (tis-620):
 	Don't bother checking whether we're XEmacs or not here.
-	* mule/mule-coding.el: 
+	* mule/mule-coding.el:
 	Move the eight bit fixed-width functionality from this file to
 	make-coding-system.el.
 
@@ -485,44 +1031,44 @@
 	* simple.el (handle-pre-motion-command-current-command-is-motion):
 	If KEY is a character, ascertain that once, not every iteration of
 	the loop.
-	* mule/mule-cmds.el (finish-set-language-environment): 
+	* mule/mule-cmds.el (finish-set-language-environment):
 	Don't call #'string-match on a one-character string, use functions
 	that have bytecodes instead, since this is called so often on
-	startup. 
+	startup.
 
 2009-08-31  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* byte-optimize.el (byte-optimize-form-code-walker): 
+	* byte-optimize.el (byte-optimize-form-code-walker):
 	Be careful about discarding multiple values when optimising
-	#'prog1 calls. 
-	(byte-optimize-or): 
+	#'prog1 calls.
+	(byte-optimize-or):
 	Preserve any trailing nil, as this is a supported way to
 	explicitly discard multiple values.
 	(byte-optimize-cond-1):
 	Discard multiple values with a singleton followed by no more
 	clauses.
-	* bytecomp.el (progn): 
+	* bytecomp.el (progn):
 	(prog1):
 	(prog2):
 	Be careful about discarding multiple values in the byte-hunk
-	handler of these three forms. 
+	handler of these three forms.
 	* bytecomp.el (byte-compile-prog1, byte-compile-prog2):
 	Don't call #'values explicitly, use `(or ,(pop form) nil) instead,
 	since that compiles to bytecode, not a funcall.
-	* bytecomp.el (byte-compile-values): 
+	* bytecomp.el (byte-compile-values):
 	With one non-const argument, byte-compile to `(or ,(second form)
 	nil), not an explicit #'values call.
-	* bytecomp.el (byte-compile-insert-header): 
+	* bytecomp.el (byte-compile-insert-header):
 	Be nicer in the error message to emacs versions that don't
 	understand our bytecode.
 
 2009-08-27  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* cl.el (bytecomp-load-hook): New.
-	* bytecomp.el (bytecomp-load-hook): Use id. 
+	* bytecomp.el (bytecomp-load-hook): Use id.
 	Merge Dave Love's 2000-02-02 GNU (GPLv2) change, forcing the
 	byte-compiler to be more consistent about loading cl-macs at
-	compile time. 
+	compile time.
 
 2009-08-19  Malcolm Purvis  <malcolmp@xemacs.org>
 
@@ -537,7 +1083,7 @@
 
 2009-08-16  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* faces.el (xpm-color-symbols): 
+	* faces.el (xpm-color-symbols):
 	Call (featurep 'x) when faces.elc is dumped, not repeatedly
 	(myriad times) at image instantiation time.
 
@@ -548,17 +1094,17 @@
 
 2009-08-14  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* minibuf.el (read-from-minibuffer): 
+	* minibuf.el (read-from-minibuffer):
 	Use buffer (format " *Minibuf-%d*" (minibuffer-depth)), regardless
-	of depth. 
+	of depth.
 
 2009-08-11  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-extra.el (ceiling*, floor*, round*, truncate*): 
+	* cl-extra.el (ceiling*, floor*, round*, truncate*):
 	Implement these in terms of the C functions; mark them as
-	obsolete. 
+	obsolete.
 	(mod*, rem*): Use #'nth-value with the C functions, not #'nth with
-	the CL emulation functions. 
+	the CL emulation functions.
 
 2009-08-11  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -568,10 +1114,10 @@
 	-- Four new bytecodes, and special compiler functions to compile
 	multiple-value-call, multiple-value-list-internal, values,
 	values-list, and, since it now needs to pass back multiple values
-	and is a special form, throw. 
+	and is a special form, throw.
 	-- There's a new compiler variable, byte-compile-checks-on-load,
 	which is a list of forms that are evaluated at the very start of a
-	file, with an error thrown if any of them give nil. 
+	file, with an error thrown if any of them give nil.
 	-- The header is now inserted *after* compilation, giving a chance
 	for the compilation process to influence what those checks
 	are. There is still a check done before compilation for non-ASCII
@@ -580,73 +1126,73 @@
 	Space is reserved for checks; comments describing the version of
 	the byte compiler generating the file are inserted if space
 	remains for them.
-	* bytecomp.el (byte-compile-version): 
+	* bytecomp.el (byte-compile-version):
 	Update this, we're a newer version of the byte compiler.
-	* byte-optimize.el (byte-optimize-funcall): 
+	* byte-optimize.el (byte-optimize-funcall):
 	Correct a comment.
-	* bytecomp.el (byte-compile-lapcode): 
+	* bytecomp.el (byte-compile-lapcode):
 	Discard the arg with byte-multiple-value-call.
-	* bytecomp.el (byte-compile-checks-and-comments-space): 
+	* bytecomp.el (byte-compile-checks-and-comments-space):
 	New variable, describe how many octets to reserve for checks at
-	the start of byte-compiled files. 
-	* cl-compat.el: 
+	the start of byte-compiled files.
+	* cl-compat.el:
 	Remove the fake multiple-value implementation. Have the functions
-	that use it use the real multiple-value implementation instead. 
-	* cl-macs.el (cl-block-wrapper, cl-block-throw): 
+	that use it use the real multiple-value implementation instead.
+	* cl-macs.el (cl-block-wrapper, cl-block-throw):
 	Revise the byte-compile properties of these symbols to work now
 	we've made throw into a special form; keep the byte-compile
 	properties as anonymous lambdas, since we don't have docstrings
-	for them. 
+	for them.
 	* cl-macs.el (multiple-value-bind, multiple-value-setq)
-	(multiple-value-list, nth-value): 
+	(multiple-value-list, nth-value):
 	Update these functions to work with the C support for multiple
 	values.
-	* cl-macs.el (values): 
+	* cl-macs.el (values):
 	Modify the setf handler for this to call
 	#'multiple-value-list-internal appropriately.
-	* cl-macs.el (cl-setf-do-store): 
+	* cl-macs.el (cl-setf-do-store):
 	If the store form is a cons, treat it specially as wrapping the
 	store value.
-	* cl.el (cl-block-wrapper): 
+	* cl.el (cl-block-wrapper):
 	Make this an alias of #'and, not #'identity, since it needs to
 	pass back multiple values.
-	* cl.el (multiple-value-apply): 
-	We no longer support this, mark it obsolete. 
-	* lisp-mode.el (eval-interactive-verbose): 
-	Remove a useless space in the docstring. 
-	* lisp-mode.el (eval-interactive): 
+	* cl.el (multiple-value-apply):
+	We no longer support this, mark it obsolete.
+	* lisp-mode.el (eval-interactive-verbose):
+	Remove a useless space in the docstring.
+	* lisp-mode.el (eval-interactive):
 	Update this function and its docstring. It now passes back a list,
 	basically wrapping any eval calls with multiple-value-list. This
-	allows multiple values to be printed by default in *scratch*. 
-	* lisp-mode.el (prin1-list-as-multiple-values): 
+	allows multiple values to be printed by default in *scratch*.
+	* lisp-mode.el (prin1-list-as-multiple-values):
 	New function, printing a list as multiple values in the manner of
 	Bruno Haible's clisp, separating each entry with " ;\n".
 	* lisp-mode.el (eval-last-sexp):
 	Call #'prin1-list-as-multiple-values on the return value of
-	#'eval-interactive. 
-	* lisp-mode.el (eval-defun): 
+	#'eval-interactive.
+	* lisp-mode.el (eval-defun):
 	Call #'prin1-list-as-multiple-values on the return value of
-	#'eval-interactive. 
-	* mouse.el (mouse-eval-sexp): 
+	#'eval-interactive.
+	* mouse.el (mouse-eval-sexp):
 	Deal with lists corresponding to multiple values from
 	#'eval-interactive. Call #'cl-prettyprint, which is always
 	available, instead of sometimes calling #'pprint and sometimes
-	falling back to prin1. 
-	* obsolete.el (obsolete-throw): 
+	falling back to prin1.
+	* obsolete.el (obsolete-throw):
 	New function, called from eval.c when #'funcall encounters an
 	attempt to call #'throw (now a special form) as a function. Only
-	needed for compatibility with 21.4 byte-code. 
+	needed for compatibility with 21.4 byte-code.
 
 2009-08-10  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* help.el (function-arglist, function-documentation): 
+	* help.el (function-arglist, function-documentation):
 	Deal more gracefully with tabs in the function arglist; in
 	function-documentation, when stripping the arglist, pay attention
 	to the fact that they may span multiple lines.
 
 2009-08-09  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* faces.el (set-face-background-pixmap-file): 
+	* faces.el (set-face-background-pixmap-file):
 	Remove some extra parentheses revealed by change set 7757334005ae.
 
 2009-08-07  Mike Sperber  <mike@xemacs.org>
@@ -674,48 +1220,48 @@
 
 2009-07-18  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* files.el (find-file-create-switch-thunk): 
+	* files.el (find-file-create-switch-thunk):
 	Check that #'buffer-file-name gives non-nil before trying to
 	determine whether that file exists; avoids problems in
 	dired. Thank you Mats Lidell!
 
 2009-07-13  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* code-files.el (insert-file-contents): 
+	* code-files.el (insert-file-contents):
 	Set the buffer coding system even on error; especially important
-	when dealing with nonexistent files. 
+	when dealing with nonexistent files.
 	If the `coding-system' property of an undecided coding system is
 	itself undecided, don't use that as a value for
-	buffer-file-coding-system. 
+	buffer-file-coding-system.
 
 2009-07-12  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* files.el (after-find-file): 
+	* files.el (after-find-file):
 	If the answer to "The directory containing %s does not exist.
 	Create?" is no, kill the current buffer, since the user probably
 	just misspelled the directory name. Thank you Rodney Sparapani!
 
 2009-07-12  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* files.el (find-file-create-switch-thunk): 
+	* files.el (find-file-create-switch-thunk):
 	New macro, used to mark buffers created within #'find-file (and
 	related) modified if the associated file doesn't exist.
-	(find-alternate-file-other-window): 
-	Correct this, pass CODESYS to find-file-other-window. 
-	(find-file-read-only): 
-	Correct behaviour of this function in the presence of wildcards. 
-	(find-file): 
-	(find-file-other-window): 
-	(find-file-other-frame): 
-	(find-file-read-only-other-window): 
-	(find-file-read-only-other-frame): 
-	(find-alternate-file): 
+	(find-alternate-file-other-window):
+	Correct this, pass CODESYS to find-file-other-window.
+	(find-file-read-only):
+	Correct behaviour of this function in the presence of wildcards.
+	(find-file):
+	(find-file-other-window):
+	(find-file-other-frame):
+	(find-file-read-only-other-window):
+	(find-file-read-only-other-frame):
+	(find-alternate-file):
 	Simplify these functions, use #'find-file-create-switch-thunk'
-	instead of explicit #'switch-to-buffer calls. 
+	instead of explicit #'switch-to-buffer calls.
 
 2009-07-11  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* code-files.el (insert-file-contents): 
+	* code-files.el (insert-file-contents):
 	Take advantage of more sensible behaviour from
 	#'insert-file-contents-internal, allowing us to actually follow
 	the documented coding system behaviour for nonexistent files (that
@@ -729,19 +1275,19 @@
 
 2009-06-14  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* help.el (describe-function-1): 
+	* help.el (describe-function-1):
 	Check macro-p, not macrop, when describing whether a symbol has an
 	associated macro or an associated function. Relevant with
-	autoloaded macros. 
-	(function-arglist): 
+	autoloaded macros.
+	(function-arglist):
 	Accept multi-line arglists in built-in functions, as found in
 	#'write-region-internal. #'dontusethis-set-symbol-value-handler
-	is still broken for other reasons. 
+	is still broken for other reasons.
 
 2009-06-07  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* code-files.el (insert-file-contents): 
-        Autodetection may return undecided as a coding system. If the file
+	* code-files.el (insert-file-contents):
+	Autodetection may return undecided as a coding system. If the file
 	was zero-length, this is kosher, and we should set
 	buffer-file-coding-system to its default; if it is not
 	zero-length, we still need to set b-f-c-s, but we warn that the
@@ -749,21 +1295,21 @@
 	failing is something very distinct from what we use it to mean
 	here.) See
 	http://mid.gmane.org/18986.53111.800393.660612@parhasard.net and
-	the related thread. 
+	the related thread.
 
 2009-06-06  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* files.el (cd): 
+	* files.el (cd):
 	Make CDPATH handling portable, accept entries without trailing
 	slashes within it. Some style corrections from Stephen Turnbull,
-	thank you Stephen. 
+	thank you Stephen.
 
 2009-05-29  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* bytecomp.el (byte-compile-lambda): 
+	* bytecomp.el (byte-compile-lambda):
 	Even if we are going to store uncompiled interactive forms in the
 	compiled-function object, byte compile (and discard) the code, for
-	the sake of the warnings generated. 
+	the sake of the warnings generated.
 
 2009-05-18  Stephen J. Turnbull  <stephen@xemacs.org>
 
@@ -787,65 +1333,65 @@
 
 2009-03-01  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* x-compose.el: 
-	Document an XIM bug, and how one might work around it. 
-	(define-compose-map): 
+	* x-compose.el:
+	Document an XIM bug, and how one might work around it.
+	(define-compose-map):
 	Revise this macro, call it with compose-caron-map,
 	compose-macron-map, compose-breve-map, compose-dot-map,
 	compose-doubleacute-map, compose-ogonek-map, compose-hook-map,
-	compose-horn-map as well as the previous existing maps. 
-	(compose-map): 
+	compose-horn-map as well as the previous existing maps.
+	(compose-map):
 	Add entries for caron, macron, doubleacute, ogonek, breve and
-	abovedot to this map. 
+	abovedot to this map.
 	Add an assert, this code assumes that a non-Mule build has no
-	character codes above U+00FF. 
+	character codes above U+00FF.
 	Incorporate all the precomposed Latin characters in
 	UnicodeData.txt that we can into the maps, deciding at runtime on
 	which exactly depending on whether this is a non-Mule or a Mule
 	build.
-	Remove a commented-out old X11 bug workaround. 
+	Remove a commented-out old X11 bug workaround.
 	Use #'flet instead of defun + unintern for
 	#'alias-colon-to-doublequote.
 	Correct #'electric-diacritic to work with the keyboard macro
-	versions of the maps. 
-	(compose-help): 
+	versions of the maps.
+	(compose-help):
 	This has been turned off since 1994; no-one appears to have
 	noticed, since the normal help mechanism offers similar
-	functionality and is actually maintained. Removed entirely. 
-	Remove a superflous setting of a default value for ctl-arrow. 
-	* x-init.el (x-initialize-compose): 
+	functionality and is actually maintained. Removed entirely.
+	Remove a superflous setting of a default value for ctl-arrow.
+	* x-init.el (x-initialize-compose):
 	Support the new dead key maps we just added to x-compose.el with
-	autoloads here. 
+	autoloads here.
 
 2009-02-22  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* bytecomp.el (byte-compile-force-escape-quoted): New variable,
 	used to force `byte-compile-insert-header' to treat the output as
-	having characters above ?\xFF. 
-	(byte-compile-from-buffer): 
+	having characters above ?\xFF.
+	(byte-compile-from-buffer):
 	If the compiled output contains characters above ?\xFF, and
 	byte-compile-dynamic-docstrings or byte-compile-dynamic is non-nil
 	(or we're using an inappropriate coding system) recompile the
 	file, turning off the dynamic features and using a more
-	appropriate header. 
+	appropriate header.
 	(byte-compile-insert-header): Pay attention to
-	byte-compile-force-escape-quoted. 
+	byte-compile-force-escape-quoted.
 
 2009-02-18  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (check-coding-systems-region): 
+	* coding.el (check-coding-systems-region):
 	Return null on success, not t. See
 	http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1723
 
 2009-02-17  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/mule-cmds.el (finish-set-language-environment): 
+	* mule/mule-cmds.el (finish-set-language-environment):
 	Correct this function,�don't try to format non-control characters
 	with ^ followed by their value plus (char-int ?@).
 
 2009-02-17  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* unicode.el (unicode-query-coding-region): 
+	* unicode.el (unicode-query-coding-region):
 	Avoid eval-when-compile where that gives incorrect results when
 	compiled on a non-Mule XEmacs but run on a Mule XEmacs.  Fixes
 	problems seen by
@@ -854,7 +1400,7 @@
 	(An equivalent way to get the efficiency of the eval-when-compile
 	would be to provide two defvars, evaluated at dump time, but this
 	code will be in C soon enough, and we can use the relevant
-	preprocessor constants there.)	
+	preprocessor constants there.)
 
 2009-02-02  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -865,144 +1411,144 @@
 
 2009-02-02  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/latin.el (macintosh): 
-	Add GNU Emacs' name for this coding system as an alias. 
+	* mule/latin.el (macintosh):
+	Add GNU Emacs' name for this coding system as an alias.
 
 2009-02-13  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/mule-cmds.el (init-mule-at-startup): 
+	* mule/mule-cmds.el (init-mule-at-startup):
 	Actually use leim-list-file-name, don't load a hardcoded
-	leim-list.el in this function. 
+	leim-list.el in this function.
 
 2009-02-11  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (query-coding-string): 
-	Correct the order of arguments passed to #'query-coding-region. 
-	(unencodable-char-position): 
+	* coding.el (query-coding-string):
+	Correct the order of arguments passed to #'query-coding-region.
+	(unencodable-char-position):
 	Handle string offsets correctly, they're one less than buffer
-	offsets. Handle START and END correctly if passed a string. 
+	offsets. Handle START and END correctly if passed a string.
 
 2009-02-08  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* cl-macs.el (delete-duplicates): 
+	* cl-macs.el (delete-duplicates):
 	Add a new compiler macro, inlining this function if it's called
 	with a literal #'eq or #'equal test arguments and no other
 	keywords.
-	* font-lock.el (font-lock-unique): 
-	Remove this function. 
-	* font-lock.el (font-lock-prepend-text-property): 
-	(font-lock-append-text-property): 
+	* font-lock.el (font-lock-unique):
+	Remove this function.
+	* font-lock.el (font-lock-prepend-text-property):
+	(font-lock-append-text-property):
 	Use #'delete-duplicates instead of #'font-lock-unique.
 	* font.el (font-unique):
 	Remove this function.
-	* font.el (font-combine-fonts-internal): 
-	(x-font-families-for-device): 
-	(xft-font-families-for-device): 
-	(ns-font-families-for-device): 
+	* font.el (font-combine-fonts-internal):
+	(x-font-families-for-device):
+	(xft-font-families-for-device):
+	(ns-font-families-for-device):
 	Use #'delete-duplicates instead of #'font-unique.
-	* fontconfig.el (fc-delete-duplicates): 
-	* fontconfig.el (fc-filter): 
-	Remove these functions. 	
-	* fontconfig.el (fc-find-available-font-families): 
+	* fontconfig.el (fc-delete-duplicates):
+	* fontconfig.el (fc-filter):
+	Remove these functions.
+	* fontconfig.el (fc-find-available-font-families):
 	Replace #'fc-delete-duplicates with #'delete-duplicates,
 	#'fc-filter with #'delete-if-not.
-	* format.el (format-make-relatively-unique): 
+	* format.el (format-make-relatively-unique):
 	Document that this is equivalent to #'nset-exclusive-or with a
 	test of #'equal.
 
 2009-02-07  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* descr-text.el (describe-text-sexp):
-	pp is in packages, use cl-prettyprint instead. 
-	* mule/mule-coding.el (make-8-bit-generate-helper): 
+	pp is in packages, use cl-prettyprint instead.
+	* mule/mule-coding.el (make-8-bit-generate-helper):
 	Don't uselessly bind args-out-of-range, thank you the byte
-	compiler. 	
-	* mule/mule-coding.el (8-bit-fixed-query-coding-region): 
+	compiler.
+	* mule/mule-coding.el (8-bit-fixed-query-coding-region):
 	Don't uselessly bind previous-fail, thank you the byte compiler.
-	* tty-init.el (make-device-early-tty-entry-point): 
-	Set make-device-early-tty-entry-point-called-p, not 
-	pre-tty-win-initted, thank you the byte compiler. 
-	* unicode.el (unicode-query-coding-region): 
+	* tty-init.el (make-device-early-tty-entry-point):
+	Set make-device-early-tty-entry-point-called-p, not
+	pre-tty-win-initted, thank you the byte compiler.
+	* unicode.el (unicode-query-coding-region):
 	Don't uselessly bind invalid-sequence-p, thank you the
-	byte-compiler. 
+	byte-compiler.
 
 2009-02-07  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (query-coding-clear-highlights): 
+	* coding.el (query-coding-clear-highlights):
 	Rename the BUFFER argument to BUFFER-OR-STRING, describe it as
-	possibly being a string in its documentation. 
-	(default-query-coding-region): 
+	possibly being a string in its documentation.
+	(default-query-coding-region):
 	Add a new IGNORE-INVALID-SEQUENCESP argument, document that this
-	function does not support it. 
+	function does not support it.
 	Bind case-fold-search to nil, we don't want this to influence what the
 	function thinks is encodable or not.
 	(query-coding-region):
 	Add a new IGNORE-INVALID-SEQUENCESP argument, document what it
-	does; reflect this new argument in the associated compiler macro. 
-	(query-coding-string): 
+	does; reflect this new argument in the associated compiler macro.
+	(query-coding-string):
 	Add a new IGNORE-INVALID-SEQUENCESP argument, document what it
 	does. Support the HIGHLIGHT argument correctly.
-	* unicode.el (unicode-query-coding-region): 
+	* unicode.el (unicode-query-coding-region):
 	Add a new IGNORE-INVALID-SEQUENCESP argument, document what it
-	does, implement this. Document a potential problem. 
+	does, implement this. Document a potential problem.
 	Use #'query-coding-clear-highlights instead of reimplementing it
-	ourselves. 
-	Remove some debugging messages. 
-	* mule/arabic.el (iso-8859-6): 
-	* mule/cyrillic.el (iso-8859-5): 
-	* mule/greek.el (iso-8859-7): 
-	* mule/hebrew.el (iso-8859-8): 
-	* mule/latin.el (iso-8859-2): 
-	* mule/latin.el (iso-8859-3): 
-	* mule/latin.el (iso-8859-4): 
-	* mule/latin.el (iso-8859-14): 
-	* mule/latin.el (iso-8859-15): 
-	* mule/latin.el (iso-8859-16): 
-	* mule/latin.el (iso-8859-9): 
-	* mule/latin.el (windows-1252): 
-	* mule/mule-coding.el (iso-8859-1): 
-	Avoid the assumption that characters not given an explicit mapping 
-	in these coding systems map to the ISO 8859-1 characters 
-	corresponding to the octets on disk; this makes it much more 
-	reasonable to implement the IGNORE-INVALID-SEQUENCESP argument to 
-	query-coding-region. 
-	* mule/mule-cmds.el (set-language-info): 
-	Correct the docstring. 
-	* mule/mule-cmds.el (finish-set-language-environment): 
-	Treat invalid Unicode sequences produced from 
-	invalid-sequence-coding-system and corresponding to control 
-	characters the same as control characters in redisplay. 
-	* mule/mule-cmds.el: 
-	Document that encode-coding-char is available in coding.el 
-	* mule/mule-coding.el (make-8-bit-generate-helper): 
-	Change to return the both the encode-program generated and the 
-	relevant non-ASCII charset; update the docstring to reflect this. 
-	* mule/mule-coding.el 
-	(make-8-bit-generate-encode-program-and-skip-chars-strings): 
-	Rename this function; have it return skip-chars-strings as well as 
-	the encode program. Have these skip-chars-strings use ranges for 
-	charsets, where possible. 
-	* mule/mule-coding.el (make-8-bit-create-decode-encode-tables): 
-	Revise this to allow people to specify explicitly characters that 
-	should be undefined (= corresponding to keys in 
-	unicode-error-default-translation-table), and treating unspecified 
-	octets above #x7f as undefined by default. 
-	* mule/mule-coding.el (8-bit-fixed-query-coding-region): 
-	Add a new IGNORE-INVALID-SEQUENCESP argument, implement support 
-	for it using the 8-bit-fixed-invalid-sequences-skip-chars coding 
-	system property; remove some debugging messages. 
-	* mule/mule-coding.el (make-8-bit-coding-system): 
-	This function is dumped, autoloading it makes no sense. 
+	ourselves.
+	Remove some debugging messages.
+	* mule/arabic.el (iso-8859-6):
+	* mule/cyrillic.el (iso-8859-5):
+	* mule/greek.el (iso-8859-7):
+	* mule/hebrew.el (iso-8859-8):
+	* mule/latin.el (iso-8859-2):
+	* mule/latin.el (iso-8859-3):
+	* mule/latin.el (iso-8859-4):
+	* mule/latin.el (iso-8859-14):
+	* mule/latin.el (iso-8859-15):
+	* mule/latin.el (iso-8859-16):
+	* mule/latin.el (iso-8859-9):
+	* mule/latin.el (windows-1252):
+	* mule/mule-coding.el (iso-8859-1):
+	Avoid the assumption that characters not given an explicit mapping
+	in these coding systems map to the ISO 8859-1 characters
+	corresponding to the octets on disk; this makes it much more
+	reasonable to implement the IGNORE-INVALID-SEQUENCESP argument to
+	query-coding-region.
+	* mule/mule-cmds.el (set-language-info):
+	Correct the docstring.
+	* mule/mule-cmds.el (finish-set-language-environment):
+	Treat invalid Unicode sequences produced from
+	invalid-sequence-coding-system and corresponding to control
+	characters the same as control characters in redisplay.
+	* mule/mule-cmds.el:
+	Document that encode-coding-char is available in coding.el
+	* mule/mule-coding.el (make-8-bit-generate-helper):
+	Change to return the both the encode-program generated and the
+	relevant non-ASCII charset; update the docstring to reflect this.
+	* mule/mule-coding.el
+	(make-8-bit-generate-encode-program-and-skip-chars-strings):
+	Rename this function; have it return skip-chars-strings as well as
+	the encode program. Have these skip-chars-strings use ranges for
+	charsets, where possible.
+	* mule/mule-coding.el (make-8-bit-create-decode-encode-tables):
+	Revise this to allow people to specify explicitly characters that
+	should be undefined (= corresponding to keys in
+	unicode-error-default-translation-table), and treating unspecified
+	octets above #x7f as undefined by default.
+	* mule/mule-coding.el (8-bit-fixed-query-coding-region):
+	Add a new IGNORE-INVALID-SEQUENCESP argument, implement support
+	for it using the 8-bit-fixed-invalid-sequences-skip-chars coding
+	system property; remove some debugging messages.
+	* mule/mule-coding.el (make-8-bit-coding-system):
+	This function is dumped, autoloading it makes no sense.
 	Document what happens when characters above #x7f are not
-	specified, implement this. 
-	* mule/vietnamese.el: 
-	Correct spelling. 
+	specified, implement this.
+	* mule/vietnamese.el:
+	Correct spelling.
 
 2009-02-04  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* help.el: 
-	(describe-function-1): 
-	* byte-optimize.el: 
+	* help.el:
+	(describe-function-1):
+	* byte-optimize.el:
 	Remove any reference to mocklisp as an active technology.
 
 2009-02-04  Aidan Kehoe  <kehoea@parhasard.net>
@@ -1015,8 +1561,8 @@
 
 2009-02-04  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (force-coding-system-equivalency): 
-	Document this macro and the motivation for it. 
+	* coding.el (force-coding-system-equivalency):
+	Document this macro and the motivation for it.
 
 2009-01-15  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -1034,31 +1580,31 @@
 
 2009-02-04  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (query-coding-region): 
+	* coding.el (query-coding-region):
 	Revert this to being a defun, add a compiler macro without
-	needless binding. 
-	(query-coding-string): 
-	Correct a bug here, string indices are zero- not one-based. 
+	needless binding.
+	(query-coding-string):
+	Correct a bug here, string indices are zero- not one-based.
 	* mule/general-late.el (unicode-query-coding-skip-chars-arg):
-	Correct the algorithm used to initialise this variable. 
+	Correct the algorithm used to initialise this variable.
 
 2009-02-04  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* help.el (describe-function-1): 
+	* help.el (describe-function-1):
 	Distinguish between special forms and subrs; don't bind
 	autoload-file, #'symbol-file returns it like any other function
 	file name.
 
 2009-01-31  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/mule-cmds.el (finish-set-language-environment): 
+	* mule/mule-cmds.el (finish-set-language-environment):
 	Treat control characters specially in the
 	invalid-sequence-coding-system handling, display them using the
-	caret notation. 
+	caret notation.
 
 2009-01-31  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* frame.el (display-graphic-p): 
+	* frame.el (display-graphic-p):
 	Call #'display-device on the DISPLAY argument, ensuring that the
 	argument to #'device-on-window-system-p is correct.
 
@@ -1071,7 +1617,7 @@
 
 2009-01-13  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/mule-cmds.el (set-language-environment-coding-systems): 
+	* mule/mule-cmds.el (set-language-environment-coding-systems):
 	Fix a cosmetic bug; the relationship between
 	file-name-coding-system and the file-name coding system alias
 	established in coding.el wasn't being maintained. See Katsumi
@@ -1092,118 +1638,118 @@
 
 2008-12-30  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* make-docfile.el: 
+	* make-docfile.el:
 	Use absolute source file names when checking if DOC is out of
 	date, don't use relative paths that may not be related to the
-	current directory.	
+	current directory.
 
 2008-12-28  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (query-coding-region): 
-	(query-coding-string): 
+	* coding.el (query-coding-region):
+	(query-coding-string):
 	Make these defsubsts, they're short enough and they're called
 	explicitly rarely enough that it make some sense. The alternative
-	would be compiler macros that avoid the binding of the arguments. 
-	(unencodable-char-position): 
-	Document where the docstring and API are from. 
+	would be compiler macros that avoid the binding of the arguments.
+	(unencodable-char-position):
+	Document where the docstring and API are from.
 	Correct a special case for zero--check-argument-type returns nil
 	when it succeeds, we can't usefully chain its result in an and
-	here. 
+	here.
 	(check-coding-systems-region): New. API taken from GNU; docstring
-	and implementation are independent. 
-	(encode-coding-char): 
+	and implementation are independent.
+	(encode-coding-char):
 	Add an optional third argument, as used by recent GNU. Document
-	the origen of the docstring. 
+	the origen of the docstring.
 	(default-query-coding-region): Add a short docstring to the
-	non-Mule implementation of this function. 
-	* unicode.el: 
+	non-Mule implementation of this function.
+	* unicode.el:
 	Don't set the query-coding-function property for unicode coding
 	systems if we're on non-mule. Unintern
 	unicode-query-coding-region, unicode-query-coding-skip-chars-arg
-	in the same context. 
+	in the same context.
 
 2008-12-30  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* frame.el (display-mouse-p): 
-	(display-popup-menus-p): 
-	(display-images-p): 
-	(display-selections-p): 
-	(display-visual-class): 
+	* frame.el (display-mouse-p):
+	(display-popup-menus-p):
+	(display-images-p):
+	(display-selections-p):
+	(display-visual-class):
 	Make all these functions more general, do not hard code device
-	type symbols where that is inappropriate. 
+	type symbols where that is inappropriate.
 
 2008-12-28  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (default-query-coding-region): 
+	* coding.el (default-query-coding-region):
 	Declare using defun*, so we can #'return-from to it on
 	encountering a safe-charsets value of t. Comment out a few
-	debug messages. 
-	(query-coding-region): 
+	debug messages.
+	(query-coding-region):
 	Correct the docstring, it deals with a region, not a string.
-	(unencodable-char-position): 
+	(unencodable-char-position):
 	Correct the implementation for non-nil COUNT, special-case a zero
 	value for count, treat it as one. Don't rely on dynamic scope when
 	calling the main lambda.
-	* unicode.el (unicode-query-coding-region): 
-	Comment out some debug messages here. 
-	* mule/mule-coding.el (8-bit-fixed-query-coding-region): 
-	Comment out some debug messages here. 
-
-	* code-init.el (raw-text): 
-	Add a safe-charsets property to this coding system. 
-	* mule/korean.el (iso-2022-int-1): 
-	* mule/korean.el (euc-kr): 
-	* mule/korean.el (iso-2022-kr): 
-	Add safe-charsets properties for these coding systems. 
-	* mule/japanese.el (iso-2022-jp): 
-	* mule/japanese.el (jis7): 
-	* mule/japanese.el (jis8): 
-	* mule/japanese.el (shift-jis): 
-	* mule/japanese.el (iso-2022-jp-1978-irv): 
-	* mule/japanese.el (euc-jp): 
-	Add safe-charsets properties for all these coding systems. 
-	* mule/iso-with-esc.el: 
+	* unicode.el (unicode-query-coding-region):
+	Comment out some debug messages here.
+	* mule/mule-coding.el (8-bit-fixed-query-coding-region):
+	Comment out some debug messages here.
+
+	* code-init.el (raw-text):
+	Add a safe-charsets property to this coding system.
+	* mule/korean.el (iso-2022-int-1):
+	* mule/korean.el (euc-kr):
+	* mule/korean.el (iso-2022-kr):
+	Add safe-charsets properties for these coding systems.
+	* mule/japanese.el (iso-2022-jp):
+	* mule/japanese.el (jis7):
+	* mule/japanese.el (jis8):
+	* mule/japanese.el (shift-jis):
+	* mule/japanese.el (iso-2022-jp-1978-irv):
+	* mule/japanese.el (euc-jp):
+	Add safe-charsets properties for all these coding systems.
+	* mule/iso-with-esc.el:
 	Add safe-charsets properties to all the coding systems in
 	here. Comment on the downside of a safe-charsets value of t for
 	iso-latin-1-with-esc.
-	* mule/hebrew.el (ctext-hebrew): 
-	Add a safe-charsets property for this coding system. 
-	* mule/devanagari.el (in-is13194-devanagari): 
-	Add a safe-charsets property for this coding system. 
-	* mule/chinese.el (cn-gb-2312): 
-	* mule/chinese.el (hz-gb-2312): 
-	* mule/chinese.el (big5): 
-	Add safe-charsets properties for these coding systems. 
-	* mule/latin.el (iso-8859-14): 
+	* mule/hebrew.el (ctext-hebrew):
+	Add a safe-charsets property for this coding system.
+	* mule/devanagari.el (in-is13194-devanagari):
+	Add a safe-charsets property for this coding system.
+	* mule/chinese.el (cn-gb-2312):
+	* mule/chinese.el (hz-gb-2312):
+	* mule/chinese.el (big5):
+	Add safe-charsets properties for these coding systems.
+	* mule/latin.el (iso-8859-14):
 	Add an implementation for this, using #'make-8-bit-coding-system.
-	* mule/mule-coding.el (ctext): 
-	* mule/mule-coding.el (iso-2022-8bit-ss2): 
-	* mule/mule-coding.el (iso-2022-7bit-ss2): 
-	* mule/mule-coding.el (iso-2022-jp-2): 
-	* mule/mule-coding.el (iso-2022-7bit): 
-	* mule/mule-coding.el (iso-2022-8): 
-	* mule/mule-coding.el (escape-quoted): 
-	* mule/mule-coding.el (iso-2022-lock): 
-	Add safe-charsets properties for all these coding systems. 
+	* mule/mule-coding.el (ctext):
+	* mule/mule-coding.el (iso-2022-8bit-ss2):
+	* mule/mule-coding.el (iso-2022-7bit-ss2):
+	* mule/mule-coding.el (iso-2022-jp-2):
+	* mule/mule-coding.el (iso-2022-7bit):
+	* mule/mule-coding.el (iso-2022-8):
+	* mule/mule-coding.el (escape-quoted):
+	* mule/mule-coding.el (iso-2022-lock):
+	Add safe-charsets properties for all these coding systems.
 
 2008-12-27  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* loadhist.el (symbol-file): 
+	* loadhist.el (symbol-file):
 	Use #'defun*, not #'defun, to allow the checks for autoloaded
 	functions and variables to call #'return-from correctly. Use
-	#'return-from instead of #'return throughout the function. 
+	#'return-from instead of #'return throughout the function.
 
 2008-12-27  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* loadup.el (load-history): 
+	* loadup.el (load-history):
 	Add the contents of current-load-list to load-history before
 	clearing it. Move the variable declarations earlier in the file to
-	a format understood by make-docfile.c. 
+	a format understood by make-docfile.c.
 	* custom.el (custom-declare-variable): Add the variable's symbol
 	to the current file's load history entry correctly, don't use a
 	cons. Eliminate a comment that we don't need to worry about, we
 	don't need to check the `initialized' C variable in Lisp.
-	* bytecomp.el (byte-compile-output-file-form): 
+	* bytecomp.el (byte-compile-output-file-form):
 	Merge Andreas Schwab's pre-GPLv3 GNU change of 19970831 here;
 	treat #'custom-declare-variable correctly, generating the
 	docstrings in a format understood by make-docfile.c.
@@ -1214,25 +1760,25 @@
 	it relative to lisp-directory if the filename corresponds to a
 	Lisp file, and relative to (concat source-directory "/src/")
 	otherwise.
-	* make-docfile.el (preloaded-file-list): 
+	* make-docfile.el (preloaded-file-list):
 	Rationalise some let bindings a little. Use the "-d" argument to
 	make-docfile.c to supply Lisp paths relative to lisp-directory,
 	not absolutely. Add in loadup.el explicitly to the list of files
 	to be processed by make-docfile.c--it doesn't make sense to add it
 	to preloaded-file-list, since that is used for purposes of
-	byte-compilation too. 
+	byte-compilation too.
 
 2008-12-22  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* loadhist.el (symbol-file): 
+	* loadhist.el (symbol-file):
 	Add support for differentiating between variables and functions to
-	#'symbol-file. 
-	* help.el (describe-function-1): 
-	(describe-variable): 
+	#'symbol-file.
+	* help.el (describe-function-1):
+	(describe-variable):
 	Call #'symbol-function explicitly with a 'defun or 'defvar
 	argument, depending on whether we're looking for a variable or a
-	function. 
-	* cus-face.el (custom-declare-face): 
+	function.
+	* cus-face.el (custom-declare-face):
 	Record information about the face in the load history; code taken
 	from GNU, pre-GPLv3 revision 1.45.
 
@@ -1259,13 +1805,13 @@
 	* window.el (only-window-p): New.
 	Check if WINDOW is the only window in some context, normally its
 	frame.
-	(one-window-p): 
+	(one-window-p):
 	Implemented this in terms of #'only-window-p, calling it on the
-	selected window. 
-	(window-buffer-height): Uncomment this, make it work. 
-	(count-screen-lines): Support a BUFFER argument. 
+	selected window.
+	(window-buffer-height): Uncomment this, make it work.
+	(count-screen-lines): Support a BUFFER argument.
 	(fit-window-to-buffer): Uncomment this, correct its implementation
-	to work with XEmacs. 
+	to work with XEmacs.
 	* help.el (temp-buffer-resize-mode): New. Name taken from GNU,
 	implementation our own.
 	* (resize-temp-buffer-window): New. GNU-compatible alias for
@@ -1275,32 +1821,32 @@
 	* frame.el: Point to #'temp-buffer-resize-mode in a comment.
 	Some of this code is from GNU; help.el CVS version 1.327 of
 	2007-03-21, window.el CVS version 1.122, of 2007-06-24. Both these
-	are GPLV2 or later. 
+	are GPLV2 or later.
 
 2008-08-27  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* subr.el (skip-chars-quote): 
+	* subr.el (skip-chars-quote):
 	Correct the implementation, following the docstring of
 	#'skip-char-forward more closely rather than the documentation of
-	character classes in the Lispref. 
+	character classes in the Lispref.
 
 2008-08-23  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* custom.el: Move #'custom-variable-p to C, since it's now called
-	from #'user-variable-p. 
+	from #'user-variable-p.
 
 2008-08-23  Aidan Kehoe  <kehoea@parhasard.net>
-	
-	* mule/mule-coding.el (make-8-bit-coding-system): 
-	* mule/general-late.el (posix-charset-to-coding-system-hash): 
-	Use #'skip-chars-quote as appropriate. 
+
+	* mule/mule-coding.el (make-8-bit-coding-system):
+	* mule/general-late.el (posix-charset-to-coding-system-hash):
+	Use #'skip-chars-quote as appropriate.
 
 2008-08-09  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* subr.el (skip-chars-quote): New.
 	Given STRING, return a string that means that all characters in
 	STRING will be skipped when passed to #'skip-chars-forward,
-	#'skip-chars-backward. 
+	#'skip-chars-backward.
 
 2008-08-09  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -1308,10 +1854,10 @@
 
 2008-08-08  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* unicode.el: 
-	* mule/mule-cmds.el: 
-	* mule/latin.el: 
-	* mule/cyrillic.el: 
+	* unicode.el:
+	* mule/mule-cmds.el:
+	* mule/latin.el:
+	* mule/cyrillic.el:
 	Rework the various identifiers using error-sequence to use
 	invalid-sequence instead.
 
@@ -1321,58 +1867,58 @@
 	in x-init.el, since we want it even on non-X builds to use the
 	support for displaying Unicode error sequences according to the
 	current locale.
-	* mule/mule-cmds.el (set-language-info): 
+	* mule/mule-cmds.el (set-language-info):
 	Document error-sequence-coding-system, used to describe how to
-	display characters that are not valid Unicode on disk. 
-	* mule/mule-cmds.el (finish-set-language-environment): 
-	Implement error-sequence-coding-system. 
-	* unicode.el (unicode-error-sequence-warning-face): 
+	display characters that are not valid Unicode on disk.
+	* mule/mule-cmds.el (finish-set-language-environment):
+	Implement error-sequence-coding-system.
+	* unicode.el (unicode-error-sequence-warning-face):
 	New face, to make it possible to distinguish invalid Unicode
 	sequences from the characters given by the valid Unicode
-	sequences. 
-	* mule/cyrillic.el ("Russian"): 
-	("Ukrainian"): 
-	("Bulgarian"): 
-	("Belarusian"): 
+	sequences.
+	* mule/cyrillic.el ("Russian"):
+	("Ukrainian"):
+	("Bulgarian"):
+	("Belarusian"):
 	("Cyrillic-ALT"): Add support for error-sequence-coding-system for
 	all these languages.
-	* mule/latin.el: 
+	* mule/latin.el:
 	Add support for error-sequence-coding-system for the
 	Latin-alphabet language environments.
 
 2008-08-05  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/iso-with-esc.el (greek-iso-8bit-with-esc): 
-	(arabic-iso-8bit-with-esc): 
+	* mule/iso-with-esc.el (greek-iso-8bit-with-esc):
+	(arabic-iso-8bit-with-esc):
 	Add these two here. Move the implementation of the
 	'arabic-iso8859-6  character set here, with commentary on why that
-	is reasonable. 
-	* mule/arabic.el (iso-8859-6): 
+	is reasonable.
+	* mule/arabic.el (iso-8859-6):
 	Add iso-8859-6, windows-1256 implementations using
 	make-8-bit-coding-system. Remove our non-standard Mule character
-	sets. 
+	sets.
 	* unicode.el (load-unicode-tables): Remove Arabic since it's no
 	longer dumped.
 	* mule/mule-msw-init-late.el: Remove Arabic.
 	* mule/mule-category.el (predefined-category-list): Remove
-	Arabic. 
+	Arabic.
 
 2008-07-26  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* x-init.el (x-initialize-compose): 
+	* x-init.el (x-initialize-compose):
 	Rewrite to use #'loop, as does similar code in x-win-sun.el,
 	x-win-xfree86.el. Locally bind function-key-map to the correct
 	value for the device's console.
-	* x-win-xfree86.el (x-win-init-xfree86): 
+	* x-win-xfree86.el (x-win-init-xfree86):
 	Locally bind function-key-map to the correct value for the
 	device's console.
-	* x-win-sun.el (x-win-init-sun): 
+	* x-win-sun.el (x-win-init-sun):
 	Locally bind function-key-map to the correct value for the
 	device's console.
 
 2008-07-20  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* descr-text.el (describe-char-unicode-data): 
+	* descr-text.el (describe-char-unicode-data):
 	Correct three calls to #'error; it doesn't take #'message style
 	format strings and arguments.
 
@@ -1380,11 +1926,11 @@
 
 	* descr-text.el (describe-property-list): Move the (require
 	'hyper-apropos) call to top level, this isn't the only function
-	that uses the relevant face. 
+	that uses the relevant face.
 	(describe-char): Wrap the Unihan field descriptions if they are
 	longer than the windows width minus 50.
 	Rename the created buffer to reflect the character's position as
-	well as its value. 
+	well as its value.
 
 2008-07-07  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -1392,7 +1938,7 @@
 	various Lisp functions should be called during device creation,
 	not relying on the startup code to decide this. Also, rename
 	initial-window-system to initial-device-type (which makes more
-	sense in this scheme), always set it. 
+	sense in this scheme), always set it.
 
 	* startup.el (command-line):
 	Use initial-device-type, not initial-window-system; just call
@@ -1419,49 +1965,49 @@
 	what device-specific things need doing. Don't use
 	create-console-hook in core code.
 	* x-win-xfree86.el (x-win-init-xfree86): Take a DEVICE argument;
-	use it. 
-	* x-win-sun.el (x-win-init-sun): Take a DEVICE argument; use it. 
+	use it.
+	* x-win-sun.el (x-win-init-sun): Take a DEVICE argument; use it.
 	* mule/mule-x-init.el: Remove #'init-mule-x-win, an empty
-	function. 
+	function.
 
 	* tty-init.el (make-device-early-tty-entry-point-called-p): New.
 	Rename pre-tty-win-initted.
 	(make-device-early-tty-entry-point): New.
 	Rename init-pre-tty-win.
 	(make-frame-after-init-entry-point): New.
-	Rename init-post-tty-win to better reflect when it's called. 
+	Rename init-post-tty-win to better reflect when it's called.
 
 	* gtk-init.el (gtk-early-lisp-options-file): New.
-	Move this path to a documented variable. 
+	Move this path to a documented variable.
 	(gtk-command-switch-alist): Wrap the docstring to fewer than 79
-	columns. 
+	columns.
 	(make-device-early-gtk-entry-point-called-p): New.
 	(make-device-late-gtk-entry-point-called-p): New.
 	Renamed gtk-pre-win-initted, gtk-post-win-initted to these.
-	(make-device-early-gtk-entry-point): New. 
+	(make-device-early-gtk-entry-point): New.
 	(make-device-late-gtk-entry-point): New.
 	Renamed init-pre-gtk-win, init-post-gtk-win to these.
 	Have make-device-late-gtk-entry-point take a device argument, and use
 	it; have make-device-early-gtk-entry-point load the GTK-specific
-	startup code, instead of doing that in C. 
+	startup code, instead of doing that in C.
 	(init-gtk-win): Deleted, functionality moved to the GTK device
-	creation code. 	
+	creation code.
 	(gtk-define-dead-key): Have it take a DEVICE argument; use this
-	argument. 
-	(gtk-initialize-compose): Ditto. 
-
-	* coding.el (set-terminal-coding-system): 
-	Correct the docstring; the function isn't broken. 
+	argument.
+	(gtk-initialize-compose): Ditto.
+
+	* coding.el (set-terminal-coding-system):
+	Correct the docstring; the function isn't broken.
 
 2008-06-29  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* descr-text.el (describe-char-unicode-data): 
+	* descr-text.el (describe-char-unicode-data):
 	Don't leak the Unihan database handle when looking up non-Han
-	characters. 
+	characters.
 
 2008-06-04  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* descr-text.el (describe-property-list): 
+	* descr-text.el (describe-property-list):
 	#'require hyper-apropos, since we use hyper-apropos-face
 
 2008-05-25  Aidan Kehoe  <kehoea@parhasard.net>
@@ -1470,27 +2016,27 @@
 	Taken from GNU's GPLV2 version of 2007-02-14, with modifications
 	for XEmacs support and extensions for Unihan.txt support and
 	db/dbm caches.
-	* simple.el (what-cursor-position): 
+	* simple.el (what-cursor-position):
 	Support an optional prefix argument, as does GNU, calling
 	#'describe-char to giving more detail on the character at point,
 	notably from UnicodeData and (in our case, optionally) Unihan.txt.
-	* syntax.el (syntax-after): 
-	Make this available for the sake of #'describe-char. 
+	* syntax.el (syntax-after):
+	Make this available for the sake of #'describe-char.
 	* mule/mule-cmds.el (iso-2022-control-alist):
 	Make this available, for the sake of #'encoded-string-description
-	and #'describe-char. 
+	and #'describe-char.
 	* mule/mule-cmds.el (encoded-string-description):
 	Make this available, for the sake of #'describe-char.
-	* unicode.el (unicode-error-default-translation-table): 
+	* unicode.el (unicode-error-default-translation-table):
 	Make this a char table of type generic, not of type char. Makes it
 	possible to have the relevant logic in #'describe-char reasonably
 	clear; also, and this is undocumented, makes it much easier to
 	implement #'frob-unicode-errors-region. I should document this,
-	and revise #'frob-unicode-errors-region. 
+	and revise #'frob-unicode-errors-region.
 
 2008-05-21  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* mule/mule-coding.el (make-8-bit-choose-category): 
+	* mule/mule-coding.el (make-8-bit-choose-category):
 	Merge my change of 2008-05-14 to the query-coding-region code.
 
 2008-05-14  Stephen J. Turnbull  <stephen@xemacs.org>
@@ -1500,7 +2046,7 @@
 2008-05-14  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* subr.el (add-to-list): Implement the same logic with a more
-	concise syntax; thank you Stephen, in 
+	concise syntax; thank you Stephen, in
 	http://mid.gmane.org/87ablomdwx.fsf@uwakimon.sk.tsukuba.ac.jp .
 
 2008-02-25  bpalmer  <bpalmer@gmail.com>
@@ -1516,22 +2062,22 @@
 
 2008-05-13  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* printer.el (generic-print-region): 
-	(generic-print-buffer): 
+	* printer.el (generic-print-region):
+	(generic-print-buffer):
 	Use #'valid-device-type-p instead of #'valid-specifier-tag-p to
 	check if the msprinter device is available, now that msprinter is
-	always available as a specifier tag. 
+	always available as a specifier tag.
 
 2008-05-11  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* disp-table.el (make-display-table): 
+	* disp-table.el (make-display-table):
 	Update the example code to make it more general, and more
 	compatible with GNU. Also, I previously said #xFF when I meant
 	?\xFF; correct this.
-	* mule/cyril-util.el (standard-display-cyrillic-translit): 
+	* mule/cyril-util.el (standard-display-cyrillic-translit):
 	Make the selection of the default language more sensible; change
 	the API a little to make a sensible default Cyrillic language
-	available, checking current-language-environment. 
+	available, checking current-language-environment.
 
 2007-07-21  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -1540,11 +2086,11 @@
 	* mule/cyril-util.el (cyrillic-encode-alternativnyj-char):
 	Removed.  No-one uses these functions in google.com/codesearch,
 	GNU have a comment doubting their utility, and their
-	implementation is trivial. 
+	implementation is trivial.
 	* mule/cyril-util.el (cyrillic-language-alist):
 	Reformatted.
 	* mule/cyril-util.el (standard-display-table)): Removed. It wasn't
-	used anyway. 
+	used anyway.
 	* mule/cyril-util.el (standard-display-cyrillic-translit):
 	Rewrite it to work with character tables as display tables, and
 	not to abort with an error.
@@ -1553,11 +2099,11 @@
 
 	* disp-table.el:
 	* disp-table.el (make-display-table): Moved earlier in the file in
-	a weak attempt at making syncing with GNU easier. 
+	a weak attempt at making syncing with GNU easier.
 	* disp-table.el (frob-display-table):
 	Autoload it, accept TAG-SET, for editing specifiers.
 	* disp-table.el (describe-display-table):
-	Have it handle character sets. 	
+	Have it handle character sets.
 	* disp-table.el (standard-display-8bit-1):
 	* disp-table.el (standard-display-8bit):
 	* disp-table.el (standard-display-default-1):
@@ -1568,13 +2114,13 @@
 	* disp-table.el (standard-display-european):
 	Rework them all to use put-char-table, remove-char-table instead
 	of aset. Limit standard-display-g1, standard-display-graphic to
-	TTYs; have standard-display-underline work on X11 too. 
-	
+	TTYs; have standard-display-underline work on X11 too.
+
 	* font.el (font-caps-display-table):
 	Use put-char-table instead of aset when editing a display table.
 	* x-init.el:
 	* x-init.el (tab):
-	Create the initial display table as a char-table, not a vector. 
+	Create the initial display table as a char-table, not a vector.
 
 2008-01-20  Aidan Kehoe  <kehoea@parhasard.net>
 
@@ -1586,15 +2132,15 @@
 2008-05-07  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* mule/latin.el (windows-1250): Add the Central European Windows
-	coding system. 
+	coding system.
 	* mule/mule-win32-init.el: Don't use the Windows-specific CP1250
-	implementation, rely on that in latin.el instead. 
+	implementation, rely on that in latin.el instead.
 
 2008-05-11  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* coding.el (query-coding-clear-highlights): 
+	* coding.el (query-coding-clear-highlights):
 	New function--clear any face information added by
-	`query-coding-region'. 
+	`query-coding-region'.
 	(default-query-coding-region): Use it.
 
 2008-04-13  Henry S. Thompson <ht@inf.ed.ac.uk>, Mike Sperber  <mike@xemacs.org>
@@ -1604,10 +2150,10 @@
 	alist mapping the window objects from the original window
 	configuration to the window objects corresponding to them in the
 	restored configuration.
-	(set-window-configuration): 
-	(saved-window): 
-	(root-window->saved-window): 
-	(really-set-window-configuration): 
+	(set-window-configuration):
+	(saved-window):
+	(root-window->saved-window):
+	(really-set-window-configuration):
 	(restore-saved-window): Record the mapping for above functions.
 
 2008-04-12  Henry S. Thompson <ht@inf.ed.ac.uk>
@@ -1616,10 +2162,10 @@
 	these to the original definitions of `split-window' and
 	`delete-window', and use them in the window-configuration code to
 	make sure it doesn't get affected by advice to these functions.
-	
+
 2008-04-10  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* help.el (describe-function-1): 
+	* help.el (describe-function-1):
 	Rely on #'symbol-file to tell which file an autoloaded function
 	belongs to, don't special-case them.
 
@@ -1682,55 +2228,55 @@
 
 	* info.el (Info-suffix-list):
 	Support LZMA compression, as used--oddly--by Mandriva Linux.
-	* coding.el (decode-coding-string): 
+	* coding.el (decode-coding-string):
 	(encode-coding-string): Accept GNU's NOCOPY argument for
-	these. Todo; write compiler macros to use it. 
+	these. Todo; write compiler macros to use it.
 	(query-coding-warning-face): New face, to show unencodable
-	characters. 
-	(default-query-coding-region-safe-charset-skip-chars-map): 
-	New variable, a cache used by #'default-query-coding-region. 
+	characters.
+	(default-query-coding-region-safe-charset-skip-chars-map):
+	New variable, a cache used by #'default-query-coding-region.
 	(default-query-coding-region): Default implementation of
 	#'query-coding-region, using the safe-charsets and safe-chars
-	coding systemproperties. 
+	coding systemproperties.
 	(query-coding-region): New function; can a given coding system
-	encode a given region? 
+	encode a given region?
 	(query-coding-string): New function; can a given coding system
-	encode a given string? 
+	encode a given string?
 	(unencodable-char-position): Function API taken from GNU; return
-	the first unencodable position given a string and coding system. 
+	the first unencodable position given a string and coding system.
 	(encode-coding-char): Function API taken from GNU; return CHAR
 	encoded using CODING-SYSTEM, or nil if CODING-SYSTEM would trash
-	CHAR. 
+	CHAR.
 	((unless (featurep 'mule)): Override the default
-	query-coding-region implementation on non-Mule. 
+	query-coding-region implementation on non-Mule.
 	* mule/mule-coding.el (make-8-bit-generate-helper): Eliminate a
-	duplicate comment. 
-	(make-8-bit-choose-category): Simplify implementation. 
+	duplicate comment.
+	(make-8-bit-choose-category): Simplify implementation.
 	(8-bit-fixed-query-coding-region): Implementation of
 	#'query-coding-region for coding systems created with
-	#'make-8-bit-coding-system. 
+	#'make-8-bit-coding-system.
 	(make-8-bit-coding-system): Initialise the #'query-coding-region
-	implementation for these character sets. 
+	implementation for these character sets.
 	(make-8-bit-coding-system): Ditto for the compiler macro version
-	of this function. 
+	of this function.
 	* unicode.el (unicode-query-coding-skip-chars-arg): New variable,
 	used by unicode-query-coding-region, initialised in
-	mule/general-late.el. 
+	mule/general-late.el.
 	(unicode-query-coding-region): New function, the
-	#'query-coding-region implementation for Unicode coding systems. 
+	#'query-coding-region implementation for Unicode coding systems.
 	Initialise the query-coding-function property for the Unicode
 	coding systems to #'unicode-query-coding-region.
 	* mule/mule-charset.el (charset-skip-chars-string): New
 	function. Return a #'skip-chars-forward argument that skips all
-	characters in CHARSET. 
+	characters in CHARSET.
 	(map-charset-chars): Function synced from GNU, modified to work
 	with XEmacs. Map FUNC across the int value charset ranges of
-	CHARSET. 
+	CHARSET.
 
 2008-01-21  Aidan Kehoe  <kehoea@parhasard.net>
 
-	* info.el (Info-suffix-list): 
-	Support LZMA compression, as used--oddly--by Mandriva Linux. 
+	* info.el (Info-suffix-list):
+	Support LZMA compression, as used--oddly--by Mandriva Linux.
 
 2008-01-17  Mike Sperber  <mike@xemacs.org>
 
--- a/lisp/byte-optimize.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/byte-optimize.el	Wed Feb 24 01:58:04 2010 -0600
@@ -370,8 +370,8 @@
 (defun byte-optimize-form-code-walker (form for-effect)
   ;;
   ;; For normal function calls, We can just mapcar the optimizer the cdr.  But
-  ;; we need to have special knowledge of the syntax of the special forms
-  ;; like let and defun (that's why they're special forms :-).  (Actually,
+  ;; we need to have special knowledge of the syntax of the special operators
+  ;; like let and defun (that's why they're special operators :-).  (Actually,
   ;; the important aspect is that they are subrs that don't evaluate all of
   ;; their args.)
   ;;
@@ -1209,12 +1209,12 @@
 (let ((side-effect-free-fns
        '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan
 	 assoc assq
-	 boundp buffer-file-name buffer-local-variables buffer-modified-p
-	 buffer-substring
+	 bigfloat-get-precision boundp buffer-file-name buffer-local-variables
+	 buffer-modified-p buffer-substring
 	 capitalize car-less-than-car car cdr ceiling concat
 	 ;; coordinates-in-window-p not in XEmacs
 	 copy-marker cos count-lines
-	 default-boundp default-value documentation downcase
+	 default-boundp default-value denominator documentation downcase
 	 elt exp expt fboundp featurep
 	 file-directory-p file-exists-p file-locked-p file-name-absolute-p
 	 file-newer-than-file-p file-readable-p file-symlink-p file-writable-p
@@ -1233,7 +1233,7 @@
 	 int-to-string
 	 length log log10 logand logb logior lognot logxor lsh
 	 marker-buffer max member memq min mod
-	 next-window nth nthcdr number-to-string
+	 next-window nth nthcdr number-to-string numerator
 	 parse-colon-path plist-get previous-window
 	 radians-to-degrees rassq regexp-quote reverse round
 	 sin sqrt string< string= string-equal string-lessp string-to-char
@@ -1252,7 +1252,8 @@
 	 ))
       (side-effect-and-error-free-fns
        '(arrayp atom
-	 bobp bolp buffer-end buffer-list buffer-size buffer-string bufferp
+	 bigfloatp bignump bobp bolp buffer-end buffer-list buffer-size
+	 buffer-string bufferp
 	 car-safe case-table-p cdr-safe char-or-string-p char-table-p
 	 characterp commandp cons
 	 consolep console-live-p consp
@@ -1260,7 +1261,7 @@
 	 ;; XEmacs: extent functions, frame-live-p, various other stuff
 	 devicep device-live-p
 	 dot dot-marker eobp eolp eq eql equal eventp extentp
-	 extent-live-p floatp framep frame-live-p
+	 extent-live-p fixnump floatingp floatp framep frame-live-p
 	 get-largest-window get-lru-window
 	 hash-table-p
 	 identity ignore integerp integer-or-marker-p interactive-p
@@ -1271,14 +1272,14 @@
 	 natnump nlistp not null number-or-marker-p numberp
 	 one-window-p ;; overlayp not in XEmacs
 	 point point-marker point-min point-max processp
-	 range-table-p
+	 rationalp ratiop range-table-p realp
 	 selected-window sequencep stringp subrp symbolp syntax-table-p
 	 user-full-name user-login-name user-original-login-name
 	 user-real-login-name user-real-uid user-uid
 	 vector vectorp
 	 window-configuration-p window-live-p windowp
 	 ;; Functions defined by cl
-	 eql floatp-safe list* subst acons equalp random-state-p
+	 eql list* subst acons equalp random-state-p
 	 copy-tree sublis
 	 )))
   (dolist (fn side-effect-free-fns)
@@ -1456,7 +1457,7 @@
 
 (defconst byte-after-unbind-ops
    '(byte-constant byte-dup
-     byte-symbolp byte-consp byte-stringp byte-listp byte-numberp byte-integerp
+     byte-symbolp byte-consp byte-stringp byte-listp byte-numberp byte-fixnump
      byte-eq byte-not
      byte-cons byte-list1 byte-list2	; byte-list3 byte-list4
      byte-interactive-p)
@@ -1469,7 +1470,7 @@
 
 (defconst byte-compile-side-effect-and-error-free-ops
   '(byte-constant byte-dup byte-symbolp byte-consp byte-stringp byte-listp
-    byte-integerp byte-numberp byte-eq byte-equal byte-not byte-car-safe
+    byte-fixnump byte-numberp byte-eq byte-equal byte-not byte-car-safe
     byte-cdr-safe byte-cons byte-list1 byte-list2 byte-point byte-point-max
     byte-point-min byte-following-char byte-preceding-char
     byte-current-column byte-eolp byte-eobp byte-bolp byte-bobp
--- a/lisp/bytecomp-runtime.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/bytecomp-runtime.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 ;;; bytecomp-runtime.el --- byte-compiler support for inlining
 
 ;; Copyright (C) 1992, 1997 Free Software Foundation, Inc.
-;; Copyright (C) 2002 Ben Wing.
+;; Copyright (C) 2002, 2010 Ben Wing.
 
 ;; Author: Jamie Zawinski <jwz@jwz.org>
 ;; Author: Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -493,6 +493,60 @@
   `(with-byte-compiler-warnings-suppressed 'obsolete ,@body))
 
 
+
+(defmacro error-unless-tests-match (test &optional source)
+  "Signal an error unless TEST matches when being compiled and loaded.
+This is for use in a file that will be byte-compiled.  Unless TEST has the
+same nilness or non-nilness when the file is compiled and loaded, an error
+will be signalled.  SOURCE is the name of the source file."
+  (let ((source (eval source)))
+    `(unless (eq (not ,test) ,(not (eval test)))
+       (error ,(format "This file was compiled with `%s' %s,
+but it was %s when run.  This file needs to be compiled with
+the same value for the expression as when it is run.  Please delete
+%s and rebuild."
+		       test (if (eval test) "true" "false")
+		       (if (eval test) "false" "true")
+		       (cond
+			((null source) "the .elc for this file")
+			((string-match "\.elc$" source) source)
+			((string-match "\.el$" source) (concat source "c"))
+			(t (concat source ".elc"))))))))
+
+(defun byte-compile-file-being-compiled ()
+  "When byte-compiling a file, return the name of the file being compiled.
+Return nil otherwise."
+  (or
+   ;;The first of these, but not the second, seems to work noninteractively;
+   ;;vice-versa interactively.  This is because interactively a *Compile Log*
+   ;;buffer is created and byte-compile-log-1 inserts a "Compiling file ..."
+   ;;message into thelog buffer, and then sets byte-compile-current-file to 
+   ;;nil to indicate that the message shouldn't be printed again.
+   (and-boundp 'byte-compile-current-file byte-compile-current-file)
+   (and-boundp 'byte-compile-log-buffer
+     (with-current-buffer byte-compile-log-buffer
+       (save-excursion
+	 (and (re-search-backward "Compiling file \\(.*\\) at " nil t)
+	      (match-string 1)))))))
+
+
+(defmacro compiled-if (test if &rest else)
+  "Like a regular `if' statement but the TEST will be evalled at compile time.
+If TEST doesn't match at compile time and load time, an error will be
+signalled."
+  (let ((being-compiled (byte-compile-file-being-compiled)))
+    `(progn
+      (error-unless-tests-match ,test ,being-compiled)
+      ,(if (eval test)
+	   if
+	 `(progn ,else)))))
+
+(defmacro compiled-when (test &rest when)
+  "Like a regular `when' statement but the TEST will be evalled at compile time.
+See `compiled-if'."
+  `(compiled-if ,test (progn ,@when)))
+
+
 ;;; Interface to file-local byte-compiler parameters.
 ;;; Redefined in bytecomp.el.
 
--- a/lisp/bytecomp.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/bytecomp.el	Wed Feb 24 01:58:04 2010 -0600
@@ -734,7 +734,7 @@
 (byte-defop 165 -1 byte-quo)
 (byte-defop 166 -1 byte-rem)
 (byte-defop 167  0 byte-numberp)
-(byte-defop 168  0 byte-integerp)
+(byte-defop 168  0 byte-fixnump)
 
 ;; unused: 169
 
@@ -3101,7 +3101,7 @@
 (byte-defop-compiler car-safe		1)
 (byte-defop-compiler cdr-safe		1)
 (byte-defop-compiler numberp		1)
-(byte-defop-compiler integerp		1)
+(byte-defop-compiler fixnump		1)
 (byte-defop-compiler skip-chars-forward     1-2+1)
 (byte-defop-compiler skip-chars-backward    1-2+1)
 (byte-defop-compiler (eql byte-eq) 	2)
@@ -3563,7 +3563,7 @@
 	   (byte-compile-warn
 	    "Discarding the result of #'%s; maybe you meant #'mapc?"
 	    (car form)))
-       (setq form (cons 'mapc-internal (cdr form))))
+       (setq form (cons 'mapc (cdr form))))
   (byte-compile-funarg form))
 
 (defun byte-compile-maplist (form)
@@ -3768,7 +3768,7 @@
 (byte-defop-compiler-1 map-plist byte-compile-funarg)
 (byte-defop-compiler-1 map-range-table byte-compile-funarg)
 (byte-defop-compiler-1 map-syntax-table byte-compile-funarg)
-(byte-defop-compiler-1 mapcar* byte-compile-funarg)
+(byte-defop-compiler-1 mapcar* byte-compile-maybe-mapc)
 
 (byte-defop-compiler-1 remove-if byte-compile-funarg)
 (byte-defop-compiler-1 remove-if-not byte-compile-funarg)
@@ -3817,6 +3817,8 @@
 (byte-defop-compiler-1 let)
 (byte-defop-compiler-1 let*)
 
+(byte-defop-compiler-1 integerp)
+
 (defun byte-compile-progn (form)
   (byte-compile-body-do-effect (cdr form)))
 
@@ -3999,6 +4001,55 @@
 	(byte-compile-warn-about-unused-variables))
     (byte-compile-out 'byte-unbind (length (car (cdr form))))))
 
+;; We've renamed the integerp bytecode to fixnump, and changed its semantics
+;; accordingly.  This means #'integerp itself can't be as fast as it used to
+;; be, since it no longer has a bytecode to itself.  As it happens, though,
+;; most of the non-core calls to #'integerp are in contexts where it is
+;; either going to receive a fixnum, or something non-numeric entirely; the
+;; contexts where it needs to distinguish between an integer and a float are
+;; very rare. So, we can have (integerp X) compile to:
+;;
+;; (or (fixnump X) (and (numberp X) (funcall #'integerp X)))
+;;
+;; without the multiple evaluation of X, and where #'fixnump and #'numberp
+;; both have bytecodes. We ignore for-effect, because byte-optimize.el will
+;; delete this call in its presence.
+;;
+;; This approach is byte-code compatible with 21.4 and with earlier 21.5
+;; (except that earlier 21.5 with bignum support will confuse Bfixnump and
+;; Bintegerp; which it did in dealing with byte-compiled code from 21.4
+;; anyway).
+
+(defun byte-compile-integerp (form)
+  (if (/= 2 (length form))
+      (byte-compile-subr-wrong-args form 1)
+    (let ((donetag (byte-compile-make-tag))
+	  (wintag (byte-compile-make-tag))
+	  (failtag (byte-compile-make-tag)))
+      (byte-compile-constant 'integerp)
+      (byte-compile-form (second form))
+      (byte-compile-out 'byte-dup 0)
+      (byte-compile-out 'byte-fixnump 0)
+      (byte-compile-goto 'byte-goto-if-not-nil wintag)
+      (byte-compile-out 'byte-dup 0)
+      (byte-compile-out 'byte-numberp 0)
+      (byte-compile-goto 'byte-goto-if-nil failtag)
+      (byte-compile-out 'byte-call 1)
+      ;; At this point, the only thing from this function remaining on the
+      ;; stack is the return value of the called #'integerp, which reflects
+      ;; exactly what we want. Go directly to donetag, do not discard
+      ;; anything.
+      (byte-compile-goto 'byte-goto donetag)
+      (byte-compile-out-tag failtag)
+      (byte-compile-discard)
+      (byte-compile-discard)
+      (byte-compile-constant nil)
+      (byte-compile-goto 'byte-goto donetag)
+      (byte-compile-out-tag wintag)
+      (byte-compile-discard)
+      (byte-compile-discard)
+      (byte-compile-constant t)
+      (byte-compile-out-tag donetag))))
 
 ;;(byte-defop-compiler-1 /= byte-compile-negated)
 (byte-defop-compiler-1 atom byte-compile-negated)
@@ -4021,7 +4072,7 @@
 	       (car form)))
 	  (cdr form))))
 
-;;; other tricky macro-like special-forms
+;;; other tricky macro-like special-operators
 
 (byte-defop-compiler-1 catch)
 (byte-defop-compiler-1 unwind-protect)
@@ -4116,7 +4167,7 @@
 
 (defun byte-compile-save-current-buffer (form)
   (if (byte-compile-version-cond byte-compile-emacs19-compatibility)
-      ;; `save-current-buffer' special form is not available in XEmacs 19.
+      ;; `save-current-buffer' special operator is not available in XEmacs 19.
       (byte-compile-form
        `(let ((_byte_compiler_save_buffer_emulation_closure_ (current-buffer)))
 	  (unwind-protect
--- a/lisp/cl-compat.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cl-compat.el	Wed Feb 24 01:58:04 2010 -0600
@@ -57,7 +57,7 @@
   (list* 'defconst x (list 'quote x) (and doc (list doc))))
 
 (defun keyword-of (sym)
-  (or (keywordp sym) (keywordp (intern (format ":%s" sym)))))
+  (or (keywordp sym) (keywordp (read (format ":%s" sym)))))
 
 ;;; Routines for parsing keyword arguments.
 
--- a/lisp/cl-extra.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cl-extra.el	Wed Feb 24 01:58:04 2010 -0600
@@ -75,164 +75,158 @@
 	   (memq type '(integer ratio bigfloat))
 	   (coerce-number x type)))
 	;; XEmacs addition: bit-vector coercion
-	((eq type 'bit-vector) (if (bit-vector-p x) x
-				 (apply 'bit-vector (append x nil))))
+	((or (eq type 'bit-vector)
+	     (eq type 'simple-bit-vector))
+	 (if (bit-vector-p x) x (apply 'bit-vector (append x nil))))
 	;; XEmacs addition: weak-list coercion
 	((eq type 'weak-list)
 	 (if (weak-list-p x) x
 	   (let ((wl (make-weak-list)))
 	     (set-weak-list-list wl (if (listp x) x (append x nil)))
 	     wl)))
+	((and
+	  (consp type)
+	  (or (eq (car type) 'vector)
+	      (eq (car type) 'simple-array)
+	      (eq (car type) 'simple-vector))
+	  (cond
+	   ((equal (cdr-safe type) '(*))
+	    (coerce x 'vector))
+	   ((equal (cdr-safe type) '(bit))
+	    (coerce x 'bit-vector))
+	   ((equal (cdr-safe type) '(character))
+	    (coerce x 'string)))))
 	((typep x type) x)
 	(t (error "Can't coerce %s to type %s" x type))))
 
 
-;;; Predicates.
-
-(defun equalp (x y)
-  "Return t if two Lisp objects have similar structures and contents.
-This is like `equal', except that it accepts numerically equal
-numbers of different types (float vs. integer), and also compares
-strings case-insensitively."
-  (cond ((eq x y) t)
-	((stringp x)
-	 ;; XEmacs change: avoid downcase
-	 (and (stringp y)
-	      (eq t (compare-strings x nil nil y nil nil t))))
-	;; XEmacs addition: compare characters
-	((characterp x)
-	 (and (characterp y)
-	      (or (char-equal x y)
-		  (char-equal (downcase x) (downcase y)))))
-	((numberp x)
-	 (and (numberp y) (= x y)))
-	((consp x)
-	 (while (and (consp x) (consp y) (equalp (car x) (car y)))
-	   (setq x (cdr x) y (cdr y)))
-	 (and (not (consp x)) (equalp x y)))
-	((vectorp x)
-	 (and (vectorp y) (= (length x) (length y))
-	      (let ((i (length x)))
-		(while (and (>= (setq i (1- i)) 0)
-			    (equalp (aref x i) (aref y i))))
-		(< i 0))))
-	(t (equal x y))))
-
-
-;;; Control structures.
-
-(defun cl-mapcar-many (cl-func cl-seqs)
-  (if (cdr (cdr cl-seqs))
-      (let* ((cl-res nil)
-	     (cl-n (apply 'min (mapcar 'length cl-seqs)))
-	     (cl-i 0)
-	     (cl-args (copy-sequence cl-seqs))
-	     cl-p1 cl-p2)
-	(setq cl-seqs (copy-sequence cl-seqs))
-	(while (< cl-i cl-n)
-	  (setq cl-p1 cl-seqs cl-p2 cl-args)
-	  (while cl-p1
-	    (setcar cl-p2
-		    (if (consp (car cl-p1))
-			(prog1 (car (car cl-p1))
-			  (setcar cl-p1 (cdr (car cl-p1))))
-		      (aref (car cl-p1) cl-i)))
-	    (setq cl-p1 (cdr cl-p1) cl-p2 (cdr cl-p2)))
-	  (push (apply cl-func cl-args) cl-res)
-	  (setq cl-i (1+ cl-i)))
-	(nreverse cl-res))
-    (let ((cl-res nil)
-	  (cl-x (car cl-seqs))
-	  (cl-y (nth 1 cl-seqs)))
-      (let ((cl-n (min (length cl-x) (length cl-y)))
-	    (cl-i -1))
-	(while (< (setq cl-i (1+ cl-i)) cl-n)
-	  (push (funcall cl-func
-			    (if (consp cl-x) (pop cl-x) (aref cl-x cl-i))
-			    (if (consp cl-y) (pop cl-y) (aref cl-y cl-i)))
-		   cl-res)))
-      (nreverse cl-res))))
-
-(defun map (cl-type cl-func cl-seq &rest cl-rest)
-  "Map a function across one or more sequences, returning a sequence.
-TYPE is the sequence type to return, FUNC is the function, and SEQS
-are the argument sequences."
-  (let ((cl-res (apply 'mapcar* cl-func cl-seq cl-rest)))
-    (and cl-type (coerce cl-res cl-type))))
+;;;;; Predicates.
+;;
+;;;; I'd actually prefer not to have this inline, the space
+;;;; vs. amount-it's-called trade-off isn't reasonable, but that would
+;;;; introduce bytecode problems with the compiler macro in cl-macs.el.
+;;(defsubst cl-string-vector-equalp (cl-string cl-vector)
+;;  "Helper function for `equalp', which see."
+;;;  (check-argument-type #'stringp cl-string)
+;;;  (check-argument-type #'vector cl-vector)
+;;  (let ((cl-i (length cl-string))
+;;	cl-char cl-other)
+;;    (when (= cl-i (length cl-vector))
+;;      (while (and (>= (setq cl-i (1- cl-i)) 0)
+;;		  (or (eq (setq cl-char (aref cl-string cl-i))
+;;			  (setq cl-other (aref cl-vector cl-i)))
+;;		      (and (characterp cl-other) ; Note we want to call this
+;;						 ; as rarely as possible, it
+;;						 ; doesn't have a bytecode.
+;;			   (eq (downcase cl-char) (downcase cl-other))))))
+;;      (< cl-i 0))))
+;;
+;;;; See comment on cl-string-vector-equalp above.
+;;(defsubst cl-bit-vector-vector-equalp (cl-bit-vector cl-vector)
+;;  "Helper function for `equalp', which see."
+;;;  (check-argument-type #'bit-vector-p cl-bit-vector)
+;;;  (check-argument-type #'vectorp cl-vector)
+;;  (let ((cl-i (length cl-bit-vector))
+;;	cl-other)
+;;    (when (= cl-i (length cl-vector))
+;;      (while (and (>= (setq cl-i (1- cl-i)) 0)
+;;		  (numberp (setq cl-other (aref cl-vector cl-i)))
+;;		  ;; Differs from clisp here.
+;;		  (= (aref cl-bit-vector cl-i) cl-other)))
+;;      (< cl-i 0))))
+;;
+;;;; These two helper functions call equalp recursively, the two above have no
+;;;; need to.
+;;(defsubst cl-vector-array-equalp (cl-vector cl-array)
+;;  "Helper function for `equalp', which see."
+;;;  (check-argument-type #'vector cl-vector)
+;;;  (check-argument-type #'arrayp cl-array)
+;;  (let ((cl-i (length cl-vector)))
+;;    (when (= cl-i (length cl-array))
+;;      (while (and (>= (setq cl-i (1- cl-i)) 0)
+;;		  (equalp (aref cl-vector cl-i) (aref cl-array cl-i))))
+;;      (< cl-i 0))))
+;;
+;;(defsubst cl-hash-table-contents-equalp (cl-hash-table-1 cl-hash-table-2)
+;;  "Helper function for `equalp', which see."
+;;  (symbol-macrolet
+;;      ;; If someone has gone and fished the uninterned symbol out of this
+;;      ;; function's constants vector, and subsequently stored it as a value
+;;      ;; in a hash table, it's their own damn fault when
+;;      ;; `cl-hash-table-contents-equalp' gives the wrong answer.
+;;      ((equalp-default '#:equalp-default))
+;;    (loop
+;;      for x-key being the hash-key in cl-hash-table-1
+;;      using (hash-value x-value)
+;;      with y-value = nil
+;;      always (and (not (eq equalp-default
+;;			   (setq y-value (gethash x-key cl-hash-table-2
+;;						  equalp-default))))
+;;		  (equalp y-value x-value)))))
+;;
+;;(defun equalp (x y)
+;;  "Return t if two Lisp objects have similar structures and contents.
+;;
+;;This is like `equal', except that it accepts numerically equal
+;;numbers of different types (float, integer, bignum, bigfloat), and also
+;;compares strings and characters case-insensitively.
+;;
+;;Arrays (that is, strings, bit-vectors, and vectors) of the same length and
+;;with contents that are `equalp' are themselves `equalp'.
+;;
+;;Two hash tables are `equalp' if they have the same test (see
+;;`hash-table-test'), if they have the same number of entries, and if, for
+;;each entry in one hash table, its key is equivalent to a key in the other
+;;hash table using the hash table test, and its value is `equalp' to the other
+;;hash table's value for that key."
+;;  (cond ((eq x y))
+;;	((stringp x)
+;;	 (if (stringp y)
+;;	     (eq t (compare-strings x nil nil y nil nil t))
+;;	   (if (vectorp y)
+;;	       (cl-string-vector-equalp x y)
+;;	     ;; bit-vectors and strings are only equalp if they're
+;;	     ;; zero-length:
+;;	     (and (equal "" x) (equal #* y)))))
+;;	((numberp x)
+;;	 (and (numberp y) (= x y)))
+;;	((consp x)
+;;	 (while (and (consp x) (consp y) (equalp (car x) (car y)))
+;;	   (setq x (cdr x) y (cdr y)))
+;;	 (and (not (consp x)) (equalp x y)))
+;;	(t
+;;	 ;; From here on, the type tests don't (yet) have bytecodes.
+;;	 (let ((x-type (type-of x)))
+;;	   (cond ((eq 'vector x-type)
+;;		  (if (stringp y)
+;;		      (cl-string-vector-equalp y x)
+;;		    (if (vectorp y)
+;;			(cl-vector-array-equalp x y)
+;;		      (if (bit-vector-p y)
+;;			  (cl-bit-vector-vector-equalp y x)))))
+;;		 ((eq 'character x-type)
+;;		  (and (characterp y)
+;;		       ;; If the characters are actually identical, the
+;;		       ;; first eq test will have caught them above; we only
+;;		       ;; need to check them case-insensitively here.
+;;		       (eq (downcase x) (downcase y))))
+;;		 ((eq 'hash-table x-type)
+;;		  (and (hash-table-p y)
+;;		       (eq (hash-table-test x) (hash-table-test y))
+;;		       (= (hash-table-count x) (hash-table-count y))
+;;		       (cl-hash-table-contents-equalp x y)))
+;;		 ((eq 'bit-vector x-type)
+;;		  (if (bit-vector-p y)
+;;		      (equal x y)
+;;		    (if (vectorp y)
+;;			(cl-bit-vector-vector-equalp x y)
+;;		      ;; bit-vectors and strings are only equalp if they're
+;;		      ;; zero-length:
+;;		      (and (equal "" y) (equal #* x)))))
+;;		 (t (equal x y)))))))
 
-(defun maplist (cl-func cl-list &rest cl-rest)
-  "Map FUNC to each sublist of LIST or LISTS.
-Like `mapcar', except applies to lists and their cdr's rather than to
-the elements themselves."
-  (if cl-rest
-      (let ((cl-res nil)
-	    (cl-args (cons cl-list (copy-sequence cl-rest)))
-	    cl-p)
-	(while (not (memq nil cl-args))
-	  (push (apply cl-func cl-args) cl-res)
-	  (setq cl-p cl-args)
-	  (while cl-p (setcar cl-p (cdr (pop cl-p)) )))
-	(nreverse cl-res))
-    (let ((cl-res nil))
-      (while cl-list
-	(push (funcall cl-func cl-list) cl-res)
-	(setq cl-list (cdr cl-list)))
-      (nreverse cl-res))))
-
-;; XEmacs change: in Emacs, this function is named cl-mapc.
-(defun mapc (cl-func cl-seq &rest cl-rest)
-  "Like `mapcar', but does not accumulate values returned by the function."
-  (if cl-rest
-      (apply 'map nil cl-func cl-seq cl-rest)
-    ;; XEmacs change: in the simplest case we call mapc-internal,
-    ;; which really doesn't accumulate any results.
-    (mapc-internal cl-func cl-seq))
-  cl-seq)
-
-;; XEmacs addition: FSF compatibility
-(defalias 'cl-mapc 'mapc)
-
-(defun mapl (cl-func cl-list &rest cl-rest)
-  "Like `maplist', but does not accumulate values returned by the function."
-  (if cl-rest
-      (apply 'maplist cl-func cl-list cl-rest)
-    (let ((cl-p cl-list))
-      (while cl-p (funcall cl-func cl-p) (setq cl-p (cdr cl-p)))))
-  cl-list)
-
-(defun mapcan (cl-func cl-seq &rest cl-rest)
-  "Like `mapcar', but nconc's together the values returned by the function."
-  (apply 'nconc (apply 'mapcar* cl-func cl-seq cl-rest)))
-
-(defun mapcon (cl-func cl-list &rest cl-rest)
-  "Like `maplist', but nconc's together the values returned by the function."
-  (apply 'nconc (apply 'maplist cl-func cl-list cl-rest)))
-
-(defun some (cl-pred cl-seq &rest cl-rest)
-  "Return true if PREDICATE is true of any element of SEQ or SEQs.
-If so, return the true (non-nil) value returned by PREDICATE."
-  (if (or cl-rest (nlistp cl-seq))
-      (catch 'cl-some
-	(apply 'map nil
-	       (function (lambda (&rest cl-x)
-			   (let ((cl-res (apply cl-pred cl-x)))
-			     (if cl-res (throw 'cl-some cl-res)))))
-	       cl-seq cl-rest) nil)
-    (let ((cl-x nil))
-      (while (and cl-seq (not (setq cl-x (funcall cl-pred (pop cl-seq))))))
-      cl-x)))
-
-(defun every (cl-pred cl-seq &rest cl-rest)
-  "Return true if PREDICATE is true of every element of SEQ or SEQs."
-  (if (or cl-rest (nlistp cl-seq))
-      (catch 'cl-every
-	(apply 'map nil
-	       (function (lambda (&rest cl-x)
-			   (or (apply cl-pred cl-x) (throw 'cl-every nil))))
-	       cl-seq cl-rest) t)
-    (while (and cl-seq (funcall cl-pred (car cl-seq)))
-      (setq cl-seq (cdr cl-seq)))
-    (null cl-seq)))
+;; XEmacs; #'map, #'mapc, #'mapl, #'maplist, #'mapcon, #'some and #'every
+;; are now in C, together with #'map-into, which was never in this file.
 
 (defun notany (cl-pred cl-seq &rest cl-rest)
   "Return true if PREDICATE is false of every element of SEQ or SEQs."
@@ -408,7 +402,7 @@
 	     symbols (cdr symbols))
        (push `(make-obsolete ',(intern (format "%s*" symbol))
 	       ',symbol "21.5.29")
-	     result) 
+	     result)
        (push
 	`(defun ,(intern (format "%s*" symbol)) (number &optional divisor)
 	  ,(format "See `%s'. This returns a list, not multiple values."
@@ -605,6 +599,18 @@
 ;; XEmacs change: we have a builtin remprop
 (defalias 'cl-remprop 'remprop)
 
+(defun get-properties (plist indicator-list)
+  "Find a property from INDICATOR-LIST in PLIST.
+Return 3 values:
+- the first property found,
+- its value,
+- the tail of PLIST beginning with the found entry."
+  (do ((plst plist (cddr plst)))
+      ((null plst) (values nil nil nil))
+    (cond ((atom (cdr plst))
+	   (error "Malformed property list: %S." plist))
+	  ((memq (car plst) indicator-list)
+	   (return (values (car plst) (cadr plst) plst))))))
 
 
 ;;; Hash tables.
@@ -671,7 +677,7 @@
 (defun cl-do-prettyprint ()
   (skip-chars-forward " ")
   (if (looking-at "(")
-      (let ((skip (or (looking-at "((") 
+      (let ((skip (or (looking-at "((")
 		      ;; XEmacs: be selective about trailing stuff after prog
 		      (looking-at "(prog[nv12\\(ress-feedback\\|n-with-message\\)]")
 		      (looking-at "(unwind-protect ")
--- a/lisp/cl-macs.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cl-macs.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 ;;; cl-macs.el --- Common Lisp extensions for XEmacs Lisp (part four)
 
 ;; Copyright (C) 1993, 2003, 2004 Free Software Foundation, Inc.
-;; Copyright (C) 2002 Ben Wing.
+;; Copyright (C) 2002, 2010 Ben Wing.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Version: 2.02
@@ -440,12 +440,19 @@
 	(while (and args (not (memq (car args) lambda-list-keywords)))
 	  (let ((arg (pop args)))
 	    (or (consp arg) (setq arg (list arg)))
-	    (let* ((karg (if (consp (car arg)) (caar arg)
-			   (intern (format ":%s" (car arg)))))
+	    (let* ((karg (if (consp (car arg))
+			     ;; It's possible to use non-keywords here, as
+			     ;; in the KEYWORD-ARGUMENT-NAME-PACKAGE Common
+			     ;; Lisp issue:
+			     (caar arg)
+			   ;; Use read instead of intern in case we ever
+			   ;; actually get packages and keywords are no
+			   ;; longer in obarray:
+			   (read (concat ":" (symbol-name (car arg))))))
 		   (varg (if (consp (car arg)) (cadar arg) (car arg)))
 		   (def (if (cdr arg) (cadr arg)
 			  (or (car bind-defs) (cadr (assq varg bind-defs)))))
-		   (look (list 'memq (list 'quote karg) restarg)))
+		   (look (list 'memq (quote-maybe karg) restarg)))
 	      (and def bind-enquote (setq def (list 'quote def)))
 	      (if (cddr arg)
 		  (let* ((temp (or (nth 2 arg) (gensym)))
@@ -467,12 +474,7 @@
 					  'quote
 					  (list nil (cl-const-expr-val def)))
 				       (list 'list nil def))))))))
-	      (push karg keys)
-	      ;; XEmacs addition
-	      (if (= (aref (symbol-name karg) 0) ?:)
-		  (progn (set karg karg)
-			 (push (list 'setq karg (list 'quote karg))
-			       bind-inits)))))))
+	      (push karg keys)))))
       (setq keys (nreverse keys))
       (or (and (eq (car args) '&allow-other-keys) (pop args))
 	  (null keys) (= safety 0)
@@ -487,7 +489,7 @@
 				(list 'setq var (list 'cdr (list 'cdr var))))
 			  (list (list 'car
 				      (list 'cdr
-					    (list 'memq (cons 'quote allow)
+					    (list 'memq (car allow)
 						  restarg)))
 				(list 'setq var nil))
 			  (list t
@@ -2596,7 +2598,7 @@
 ;; I've just done) in the body of this function, and the following gives the
 ;; wrong behaviour for gethash:
 ;; 
-;; (setq my-hash-table #s(hash-table test equal data ())
+;; (setq my-hash-table #s(hash-table :test equal :data ())
 ;;       print-gensym t)
 ;; => t
 ;; (gethash "my-key" my-hash-table (gensym))
@@ -3024,9 +3026,9 @@
 	     (cl-make-type-test val (funcall (get type 'cl-deftype-handler))))
 	    ((memq type '(nil t)) type)
 	    ((eq type 'null) `(null ,val))
-	    ((eq type 'float) `(floatp-safe ,val))
+	    ((eq type 'float) `(floatp ,val))
 	    ((eq type 'real) `(numberp ,val))
-	    ((eq type 'fixnum) `(integerp ,val))
+	    ((eq type 'fixnum) `(fixnump ,val))
 	    ;; XEmacs change: we do not have char-valid-p
 	    ((memq type '(character string-char)) `(characterp ,val))
 	    (t
@@ -3203,12 +3205,12 @@
 (define-compiler-macro eql (&whole form a b)
   (cond ((eq (cl-const-expr-p a) t)
 	 (let ((val (cl-const-expr-val a)))
-	   (if (and (numberp val) (not (integerp val)))
+	   (if (and (numberp val) (not (fixnump val)))
 	       (list 'equal a b)
 	     (list 'eq a b))))
 	((eq (cl-const-expr-p b) t)
 	 (let ((val (cl-const-expr-val b)))
-	   (if (and (numberp val) (not (integerp val)))
+	   (if (and (numberp val) (not (fixnump val)))
 	       (list 'equal a b)
 	     (list 'eq a b))))
 	((cl-simple-expr-p a 5)
@@ -3224,20 +3226,25 @@
 
 (define-compiler-macro member* (&whole form a list &rest keys)
   (let ((test (and (= (length keys) 2) (eq (car keys) :test)
-		   (cl-const-expr-val (nth 1 keys)))))
+		   (cl-const-expr-val (nth 1 keys))))
+	a-val)
     (cond ((eq test 'eq) (list 'memq a list))
 	  ((eq test 'equal) (list 'member a list))
 	  ((or (null keys) (eq test 'eql))
 	   (if (eq (cl-const-expr-p a) t)
-	       (list (if (floatp-safe (cl-const-expr-val a)) 'member 'memq)
+	       (list (if (and (numberp (setq a-val (cl-const-expr-val a)))
+			      (not (fixnump a-val)))
+			 'member
+		       'memq)
 		     a list)
 	     (if (eq (cl-const-expr-p list) t)
 		 (let ((p (cl-const-expr-val list)) (mb nil) (mq nil))
 		   (if (not (cdr p))
 		       (and p (list 'eql a (list 'quote (car p))))
 		     (while p
-		       (if (floatp-safe (car p)) (setq mb t)
-			 (or (integerp (car p)) (symbolp (car p)) (setq mq t)))
+		       (if (and (numberp (car p)) (not (fixnump (car p))))
+			   (setq mb t)
+			 (or (fixnump (car p)) (symbolp (car p)) (setq mq t)))
 		       (setq p (cdr p)))
 		     (if (not mb) (list 'memq a list)
 		       (if (not mq) (list 'member a list) form))))
@@ -3246,11 +3253,13 @@
 
 (define-compiler-macro assoc* (&whole form a list &rest keys)
   (let ((test (and (= (length keys) 2) (eq (car keys) :test)
-		   (cl-const-expr-val (nth 1 keys)))))
+		   (cl-const-expr-val (nth 1 keys))))
+	a-val)
     (cond ((eq test 'eq) (list 'assq a list))
 	  ((eq test 'equal) (list 'assoc a list))
 	  ((and (eq (cl-const-expr-p a) t) (or (null keys) (eq test 'eql)))
-	   (if (floatp-safe (cl-const-expr-val a))
+	   (if (and (numberp (setq a-val (cl-const-expr-val a)))
+		    (not (fixnump a-val)))
 	       (list 'assoc a list) (list 'assq a list)))
 	  (t form))))
 
@@ -3328,18 +3337,6 @@
           (t
            form))))
 
-;; XEmacs change, the GNU mapc doesn't accept the Common Lisp args, so this
-;; change isn't helpful.
-(define-compiler-macro mapc (&whole form cl-func cl-seq &rest cl-rest)
-  (if cl-rest
-      form
-    (cons 'mapc-internal (cdr form))))
-
-(define-compiler-macro mapcar* (&whole form cl-func cl-x &rest cl-rest)
-  (if cl-rest
-      form
-    (cons 'mapcar (cdr form))))
-
 ;; XEmacs; it's perfectly reasonable, and often much clearer to those
 ;; reading the code, to call regexp-quote on a constant string, which is
 ;; something we can optimise here easily.
@@ -3348,6 +3345,212 @@
       (regexp-quote string)
     form))
 
+;; NOTE: `equalp' is now a primitive, although as of yet it still doesn't
+;; have a byte-compiler opcode for it.  The compiler-macro for `equalp' used
+;; to try and remove as much as possible of the logic of the Lisp `equalp' as
+;; possible whenever one of the arguments is a constant, boiling things down
+;; to a few if-statements and some calls to various no-longer-defined
+;; helper functions.  Besides the fact that the helper functions aren't
+;; defined, there's little point in doing any of that expansion, since it will
+;; end up executing in Lisp what would otherwise be done in C by a direct
+;; call to `equalp'.  The only exception is when the reduction is quite
+;; simple and is to functions that do have op-codes; that may gain something.
+;; However, if `equalp' becomes an opcode itself, consider removing everything
+;; here except maybe when the call can directly be reduced to `equal' or `eq'.
+;;
+;; --ben
+
+(define-compiler-macro equalp (&whole form x y) 
+  "Expand calls to `equalp' where X or Y is a constant expression.
+
+Much of the processing that `equalp' does is dependent on the types of both
+of its arguments, and with type information for one of them, we can
+eliminate much of the body of the function at compile time.
+
+Where both X and Y are constant expressions, `equalp' is evaluated at
+compile time by byte-optimize.el--this compiler macro passes FORM through to
+the byte optimizer in those cases."
+  ;; Cases where both arguments are constant are handled in
+  ;; byte-optimize.el, we only need to handle those cases where one is
+  ;; constant here.
+  (let* ((equalp-sym (eval-when-compile (gensym)))
+	(let-form '(progn))
+	(original-y y)
+	equalp-temp checked)
+  (macrolet
+      ((unordered-check (check)
+	 `(prog1
+	     (setq checked
+		   (or ,check
+		       (prog1 ,(sublis '((x . y) (y . x)) check :test #'eq)
+			 (setq equalp-temp x x y y equalp-temp))))
+	   (when checked
+	     (unless (symbolp y)
+	       (setq let-form `(let ((,equalp-sym ,y))) y equalp-sym))))))
+    ;; In the bodies of the below clauses, x is always a constant expression
+    ;; of the type we're interested in, and y is always a symbol that refers
+    ;; to the result non-constant side of the comparison. 
+    (cond ((unordered-check (and (arrayp x) (not (cl-const-expr-p y))))
+	   ;; Strings and other arrays. A vector containing the same
+	   ;; character elements as a given string is equalp to that string;
+	   ;; a bit-vector can only be equalp to a string if both are
+	   ;; zero-length.
+	   (cond
+	    ((member x '("" #* []))
+	     ;; No need to protect against multiple evaluation here:
+	     `(and (member ,original-y '("" #* [])) t))
+	    (t form)))
+	  ((unordered-check (and (numberp x) (not (cl-const-expr-p y))))
+	   `(,@let-form
+	     (and (numberp ,y)
+		  (= ,x ,y))))
+	  ((unordered-check (and (hash-table-p x) (not (cl-const-expr-p y))))
+	   form)
+	  ((unordered-check
+	    ;; Symbols; eq. 
+	    (and (not (cl-const-expr-p y))
+		 (or (memq x '(nil t))
+		     (and (eq (car-safe x) 'quote) (symbolp (second x))))))
+	   (cons 'eq (cdr form)))
+
+	  ;; This clause is wrong -- e.g. when comparing a constant char-table
+	  ;; against a non-constant expression that evaluates to a char-table,
+	  ;; or some for range tables or certain other types, `equalp' is
+	  ;; not the same as `equal'.  We could insert the known list of
+	  ;; types with special `equalp' property, but it's fragile and may
+	  ;; not be much of an optimization, esp. since these types don't
+	  ;; occur that often are often big.
+	  ;;((unordered-check
+	  ;;  ;; Compare conses at runtime, there's no real upside to
+	  ;;  ;; unrolling the function -> they fall through to the next
+	  ;;  ;; clause in this function.
+	  ;;  (and (cl-const-expr-p x) (not (consp x))
+	  ;;       (not (cl-const-expr-p y))))
+	  ;; ;; All other types; use equal.
+	  ;; (cons 'equal (cdr form)))
+	  
+	  ;; Neither side is a constant expression, do all our evaluation at
+	  ;; runtime (or both are, and equalp will be called from
+	  ;; byte-optimize.el).
+	  (t form)))))
+
+;;(define-compiler-macro equalp (&whole form x y) 
+;;  "Expand calls to `equalp' where X or Y is a constant expression.
+;;
+;;Much of the processing that `equalp' does is dependent on the types of both
+;;of its arguments, and with type information for one of them, we can
+;;eliminate much of the body of the function at compile time.
+;;
+;;Where both X and Y are constant expressions, `equalp' is evaluated at
+;;compile time by byte-optimize.el--this compiler macro passes FORM through to
+;;the byte optimizer in those cases."
+;;  ;; Cases where both arguments are constant are handled in
+;;  ;; byte-optimize.el, we only need to handle those cases where one is
+;;  ;; constant here.
+;;  (let* ((equalp-sym (eval-when-compile (gensym)))
+;;	(let-form '(progn))
+;;	(check-bit-vector t)
+;;	(check-string t)
+;;	(original-y y)
+;;	equalp-temp checked)
+;;  (macrolet
+;;      ((unordered-check (check)
+;;	 `(prog1
+;;	     (setq checked
+;;		   (or ,check
+;;		       (prog1 ,(sublis '((x . y) (y . x)) check :test #'eq)
+;;			 (setq equalp-temp x x y y equalp-temp))))
+;;	   (when checked
+;;	     (unless (symbolp y)
+;;	       (setq let-form `(let ((,equalp-sym ,y))) y equalp-sym))))))
+;;    ;; In the bodies of the below clauses, x is always a constant expression
+;;    ;; of the type we're interested in, and y is always a symbol that refers
+;;    ;; to the result non-constant side of the comparison. 
+;;    (cond ((unordered-check (and (arrayp x) (not (cl-const-expr-p y))))
+;;	   ;; Strings and other arrays. A vector containing the same
+;;	   ;; character elements as a given string is equalp to that string;
+;;	   ;; a bit-vector can only be equalp to a string if both are
+;;	   ;; zero-length.
+;;	   (cond
+;;	    ((member x '("" #* []))
+;;	     ;; No need to protect against multiple evaluation here:
+;;	     `(and (member ,original-y '("" #* [])) t))
+;;	    ((stringp x)
+;;	     `(,@let-form
+;;	       (if (stringp ,y)
+;;		   (eq t (compare-strings ,x nil nil
+;;					  ,y nil nil t))
+;;		 (if (vectorp ,y) 
+;;		     (cl-string-vector-equalp ,x ,y)))))
+;;	    ((bit-vector-p x)
+;;	     `(,@let-form
+;;	       (if (bit-vector-p ,y)
+;;		   ;; No need to call equalp on each element here:
+;;		   (equal ,x ,y)
+;;		 (if (vectorp ,y) 
+;;		     (cl-bit-vector-vector-equalp ,x ,y)))))
+;;	    (t
+;;	     (loop
+;;	       for elt across x
+;;	       ;; We may not need to check the other argument if it's a
+;;	       ;; string or bit vector, depending on the contents of x:
+;;	       always (progn
+;;			(unless (characterp elt) (setq check-string nil))
+;;			(unless (and (numberp elt) (or (= elt 0) (= elt 1)))
+;;			  (setq check-bit-vector nil))
+;;			(or check-string check-bit-vector)))
+;;	     `(,@let-form
+;;	       (cond
+;;		,@(if check-string
+;;		      `(((stringp ,y) 
+;;			 (cl-string-vector-equalp ,y ,x))))
+;;		,@(if check-bit-vector 
+;;		      `(((bit-vector-p ,y)
+;;			 (cl-bit-vector-vector-equalp ,y ,x))))
+;;		((vectorp ,y)
+;;		 (cl-vector-array-equalp ,x ,y)))))))
+;;	  ((unordered-check (and (characterp x) (not (cl-const-expr-p y))))
+;;	   `(,@let-form
+;;	     (or (eq ,x ,y)
+;;		  ;; eq has a bytecode, char-equal doesn't.
+;;		 (and (characterp ,y)
+;;		      (eq (downcase ,x) (downcase ,y))))))
+;;	  ((unordered-check (and (numberp x) (not (cl-const-expr-p y))))
+;;	   `(,@let-form
+;;	     (and (numberp ,y)
+;;		  (= ,x ,y))))
+;;	  ((unordered-check (and (hash-table-p x) (not (cl-const-expr-p y))))
+;;	   ;; Hash tables; follow the CL spec.
+;;	   `(,@let-form
+;;	     (and (hash-table-p ,y)
+;;		  (eq ',(hash-table-test x) (hash-table-test ,y))
+;;		  (= ,(hash-table-count x) (hash-table-count ,y))
+;;		  (cl-hash-table-contents-equalp ,x ,y))))
+;;	  ((unordered-check
+;;	    ;; Symbols; eq. 
+;;	    (and (not (cl-const-expr-p y))
+;;		 (or (memq x '(nil t))
+;;		     (and (eq (car-safe x) 'quote) (symbolp (second x))))))
+;;	   (cons 'eq (cdr form)))
+;;	  ((unordered-check
+;;	    ;; Compare conses at runtime, there's no real upside to
+;;	    ;; unrolling the function -> they fall through to the next
+;;	    ;; clause in this function.
+;;	    (and (cl-const-expr-p x) (not (consp x))
+;;		 (not (cl-const-expr-p y))))
+;;	   ;; All other types; use equal.
+;;	   (cons 'equal (cdr form)))
+;;	  ;; Neither side is a constant expression, do all our evaluation at
+;;	  ;; runtime (or both are, and equalp will be called from
+;;	  ;; byte-optimize.el).
+;;	  (t form)))))
+
+(define-compiler-macro notany (&whole form &rest cl-rest)
+  (cons 'not (cons 'some (cdr cl-rest))))
+
+(define-compiler-macro notevery (&whole form &rest cl-rest)
+  (cons 'not (cons 'every (cdr cl-rest))))
+
 (mapc
  #'(lambda (y)
      (put (car y) 'side-effect-free t)
@@ -3375,7 +3578,7 @@
    (cddadr cdr cdadr) (cdddar cdr cddar) (cddddr cdr cdddr)))
 
 ;;; Things that are inline.
-(proclaim '(inline floatp-safe acons map concatenate notany notevery
+(proclaim '(inline acons map concatenate
 ;; XEmacs omission: gethash is builtin
 		   cl-set-elt revappend nreconc))
 
@@ -3387,7 +3590,7 @@
 
 ;;; Things that are side-effect-and-error-free.  Moved to byte-optimize.el
 ;(mapcar (function (lambda (x) (put x 'side-effect-free 'error-free)))
-;	'(eql floatp-safe list* subst acons equalp random-state-p
+;	'(eql list* subst acons equalp random-state-p
 ;	  copy-tree sublis))
 
 
--- a/lisp/cl-seq.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cl-seq.el	Wed Feb 24 01:58:04 2010 -0600
@@ -664,7 +664,7 @@
 	(while (and cl-list (not (cl-check-test cl-item (car cl-list))))
 	  (setq cl-list (cdr cl-list)))
 	cl-list)
-    (if (and (numberp cl-item) (not (integerp cl-item)))
+    (if (and (numberp cl-item) (not (fixnump cl-item)))
 	(member cl-item cl-list)
       (memq cl-item cl-list))))
 
@@ -697,7 +697,7 @@
 			(not (cl-check-test cl-item (car (car cl-alist))))))
 	  (setq cl-alist (cdr cl-alist)))
 	(and cl-alist (car cl-alist)))
-    (if (and (numberp cl-item) (not (integerp cl-item)))
+    (if (and (numberp cl-item) (not (fixnump cl-item)))
 	(assoc cl-item cl-alist)
       (assq cl-item cl-alist))))
 
@@ -714,7 +714,7 @@
 (defun rassoc* (cl-item cl-alist &rest cl-keys)
   "Find the first item whose cdr matches ITEM in LIST.
 Keywords supported:  :test :test-not :key"
-  (if (or cl-keys (numberp cl-item))
+  (if (or cl-keys (and (numberp cl-item) (not (fixnump cl-item))))
       (cl-parsing-keywords (:test :test-not :key :if :if-not) ()
 	(while (and cl-alist
 		    (or (not (consp (car cl-alist)))
--- a/lisp/cl.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cl.el	Wed Feb 24 01:58:04 2010 -0600
@@ -123,10 +123,17 @@
 ;;; Predicates.
 
 (defun eql (a b)    ; See compiler macro in cl-macs.el
-  "Return t if the two args are the same Lisp object.
-Floating-point numbers of equal value are `eql', but they may not be `eq'."
-  (or (eq a b)
-      (and (numberp a) (numberp b) (equal a b))))
+  "Return t if the arguments are the same Lisp object, or numerically equal.
+
+They must be of the same type; the difference between `eq' and `eql' is most
+relevant when it comes to the non-fixnum number types.  In this
+implementation, fixnums of the same numeric value are always `eq', but this
+is not true for other numeric types, among them floats, bignums and ratios,
+if available.
+
+See also `=' (which doesn't require that its arguments be of the same type,
+but only accepts numeric arguments, characters and markers) and `equal'."
+  (or (eq a b) (and (numberp a) (equal a b))))
 
 ;;; Generalized variables.  These macros are defined here so that they
 ;;; can safely be used in .emacs files.
@@ -317,11 +324,7 @@
 
 ;;; Numbers.
 
-;; XEmacs change: use floatp, which is right even in the presence of ratios
-;; and bigfloats
-(defun floatp-safe (object)
-  "Return t if OBJECT is a floating point number."
-  (floatp object))
+;; XEmacs change: ditch floatp-safe.
 
 (defun plusp (number)
   "Return t if NUMBER is positive."
@@ -344,15 +347,6 @@
 
 (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time)))
 
-;; XEmacs: These constants are defined in C when 'number-types is provided.
-;; They are always defined in C on Emacs.  Maybe we should, too.
-(unless (featurep 'number-types)
-;;; We use `eval' in case VALBITS differs from compile-time to load-time.
-  (defconst most-positive-fixnum (eval '(lsh -1 -1))
-    "The integer closest in value to positive infinity.")
-  (defconst most-negative-fixnum (eval '(- -1 (lsh -1 -1)))
-    "The integer closest in value to negative infinity."))
-
 ;;; The following are set by code in cl-extra.el
 (defconst most-positive-float nil
   "The float closest in value to positive infinity.")
@@ -372,21 +366,6 @@
 
 (defalias 'copy-seq 'copy-sequence)
 
-(defun mapcar* (cl-func cl-x &rest cl-rest)
-  "Apply FUNCTION to each element of SEQ, and make a list of the results.
-If there are several SEQs, FUNCTION is called with that many arguments,
-and mapping stops as soon as the shortest list runs out.  With just one
-SEQ, this is like `mapcar'.  With several, it is like the Common Lisp
-`mapcar' function extended to arbitrary sequence types."
-  (if cl-rest
-      (if (or (cdr cl-rest) (nlistp cl-x) (nlistp (car cl-rest)))
-	  (cl-mapcar-many cl-func (cons cl-x cl-rest))
-	(let ((cl-res nil) (cl-y (car cl-rest)))
-	  (while (and cl-x cl-y)
-	    (push (funcall cl-func (pop cl-x) (pop cl-y)) cl-res))
-	  (nreverse cl-res)))
-    (mapcar cl-func cl-x)))
-
 (defalias 'svref 'aref)
 
 ;;; List functions.
@@ -616,7 +595,7 @@
   "Substitute NEW for OLD everywhere in TREE (non-destructively).
 Return a copy of TREE with all elements `eql' to OLD replaced by NEW.
 Keywords supported:  :test :test-not :key"
-  (if (or cl-keys (and (numberp cl-old) (not (integerp cl-old))))
+  (if (or cl-keys (and (numberp cl-old) (not (fixnump cl-old))))
       (apply 'sublis (list (cons cl-old cl-new)) cl-tree cl-keys)
     (cl-do-subst cl-new cl-old cl-tree)))
 
@@ -644,9 +623,9 @@
 ;; XEmacs change: omit the autoload rules; we handle those a different way
 
 ;;; Define data for indentation and edebug.
-(mapc-internal
+(mapc
  #'(lambda (entry)
-     (mapc-internal
+     (mapc
       #'(lambda (func)
 	  (put func 'lisp-indent-function (nth 1 entry))
 	  (put func 'lisp-indent-hook (nth 1 entry))
--- a/lisp/cmdloop.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cmdloop.el	Wed Feb 24 01:58:04 2010 -0600
@@ -344,35 +344,36 @@
   (if (and teach-extended-commands-p
 	   (interactive-p))
       ;; Remember the keys, run the command, and show the keys (if
-      ;; any).  The funny variable names are a poor man's guarantee
-      ;; that we don't get tripped by this-command doing something
-      ;; funny.  Quoth our forefathers: "We want lexical scope!"
-      (let ((_execute_command_keys_ (where-is-internal this-command))
-	    (_execute_command_name_ this-command)) ; the name can change
-	(command-execute this-command t)
-	(when _execute_command_keys_
-	  ;; Normally the region is adjusted in post_command_hook;
-	  ;; however, it is not called until after we finish.  It
-	  ;; looks ugly for the region to get updated after the
-	  ;; delays, so we do it now.  The code below is a Lispified
-	  ;; copy of code in event-stream.c:post_command_hook().
-	  (if (and (not zmacs-region-stays)
-		   (or (not (eq (selected-window) (minibuffer-window)))
-		       (eq (zmacs-region-buffer) (current-buffer))))
-	      (zmacs-deactivate-region)
-	    (zmacs-update-region))
-	  ;; Wait for a while, so the user can see a message printed,
-	  ;; if any.
-	  (when (sit-for 1)
-	    (display-message
-		'no-log
-	      (format (if (cdr _execute_command_keys_)
-			  "Command `%s' is bound to keys: %s"
-			"Command `%s' is bound to key: %s")
-		      _execute_command_name_
-		      (sorted-key-descriptions _execute_command_keys_)))
-	    (sit-for teach-extended-commands-timeout)
-	    (clear-message 'no-log))))
+      ;; any).  The symbol-macrolet avoids some lexical-scope lossage.
+      (symbol-macrolet
+	  ((execute-command-keys #:execute-command-keys)
+	   (execute-command-name #:execute-command-name))
+	(let ((execute-command-keys (where-is-internal this-command))
+	      (execute-command-name this-command)) ; the name can change
+	  (command-execute this-command t)
+	  (when execute-command-keys
+	    ;; Normally the region is adjusted in post_command_hook;
+	    ;; however, it is not called until after we finish.  It
+	    ;; looks ugly for the region to get updated after the
+	    ;; delays, so we do it now.  The code below is a Lispified
+	    ;; copy of code in event-stream.c:post_command_hook().
+	    (if (and (not zmacs-region-stays)
+		     (or (not (eq (selected-window) (minibuffer-window)))
+			 (eq (zmacs-region-buffer) (current-buffer))))
+		(zmacs-deactivate-region)
+	      (zmacs-update-region))
+	    ;; Wait for a while, so the user can see a message printed,
+	    ;; if any.
+	    (when (sit-for 1)
+	      (display-message
+		  'no-log
+		(format (if (cdr execute-command-keys)
+			    "Command `%s' is bound to keys: %s"
+			  "Command `%s' is bound to key: %s")
+			execute-command-name
+			(sorted-key-descriptions execute-command-keys)))
+	      (sit-for teach-extended-commands-timeout)
+	      (clear-message 'no-log)))))
     ;; Else, just run the command.
     (command-execute this-command t)))
 
--- a/lisp/code-init.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/code-init.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 ;;; code-init.el --- Handle coding system default values
 
-;; Copyright (C) 2001, 2002, 2003 Ben Wing.
+;; Copyright (C) 2001, 2002, 2003, 2010 Ben Wing.
 
 ;; This file is part of XEmacs.
 
@@ -21,6 +21,8 @@
 
 ;;; Commentary:
 
+;; Author: Ben wing, 2001?
+
 ;; Placed in a separate file so it can be loaded after the various
 ;; coding systems have been created, because we'll be using them at
 ;; load time.
@@ -60,62 +62,112 @@
 default, but this may change.  NOTE: You *REALLY* should not turn off EOL
 detection on Windows!  Your files will have lots of annoying ^M's in them
 if you do this."
-  (dolist (x '(buffer-file-coding-system-for-read
+  (dolist (x '(bfcs-for-read
 	       keyboard
-	       default-process-coding-system-read
-	       no-conversion-coding-system-mapping))
+	       process-read
+	       no-conv-cs))
     (set-coding-system-variable
      x (coding-system-change-eol-conversion (get-coding-system-variable x)
 					    (if flag nil 'lf)))))
 
 (defun coding-system-current-system-configuration ()
-  (cond ((memq system-type '(windows-nt cygwin32))
+  "Function to decide which default coding system configuration applies."
+  (cond ((featurep 'cygwin-use-utf-8) 'cygwin-utf-8)
+	((memq system-type '(windows-nt cygwin32))
 	 (if (featurep 'mule) 'windows-mule 'windows-no-mule))
-	((featurep 'mule) 'unix-mule)
-	(eol-detection-enabled-p 'unix-no-mule-eol-detection)
-	(t 'unix-no-mule-no-eol-detection)))
+	((featurep 'mule) 'mule)
+	(eol-detection-enabled-p 'no-mule-eol-detection)
+	(t 'no-mule-no-eol-detection)))
+
+(defvar coding-system-default-configuration-table (make-hash-table))
+
+(defun define-coding-system-default-configuration (name doc props)
+  (puthash name (nconc `(doc ,doc) props)
+	   coding-system-default-configuration-table))
 
 ;; NOTE NOTE NOTE: These values may get overridden when the language
 ;; environment is initialized (set-language-environment-coding-systems).
-(defvar coding-system-variable-default-value-table
-  '((buffer-file-coding-system-for-read
-     binary raw-text undecided raw-text undecided)
-    (default-buffer-file-coding-system
-      ;; #### iso-2022-8 with no eol specified?  can that be OK?
-      binary binary iso-2022-8 raw-text-dos mswindows-multibyte-dos)
-    (native
-     binary binary binary raw-text-dos mswindows-multibyte-system-default-dos)
-    (keyboard
-     binary raw-text undecided-unix raw-text undecided-unix)
-    ;; the `terminal' coding system is used for output to stderr.  such
-    ;; streams do automatic lf->crlf encoding in the C library, so we need
-    ;; to not do the same translations ourselves.
-    (terminal
-     binary binary binary binary mswindows-multibyte-unix)
-    (default-process-coding-system-read
-      binary raw-text undecided raw-text undecided)
-    (default-process-coding-system-write
-      binary binary binary raw-text mswindows-multibyte-system-default)
-    (no-conversion-coding-system-mapping
-     binary raw-text raw-text raw-text mswindows-multibyte)
-    ))
+(define-coding-system-default-configuration
+  'no-mule-no-eol-detection
+  "No Mule support, EOL detection not enabled."
+  '(bfcs-for-read	binary
+    default-bfcs	binary
+    process-read	binary
+    process-write	binary
+    keyboard		binary
+    native		binary
+    no-conv-cs		binary
+    terminal		binary))
+
+(define-coding-system-default-configuration
+  'no-mule-eol-detection
+  "No Mule support, EOL detection enabled."
+  '(bfcs-for-read	raw-text
+    default-bfcs	binary
+    process-read	raw-text
+    process-write	binary
+    keyboard		raw-text
+    native		binary
+    no-conv-cs		raw-text
+    terminal		binary))
+
+(define-coding-system-default-configuration
+  'mule
+  "Mule support enabled."
+  '(bfcs-for-read	undecided
+    default-bfcs	iso-2022-8
+    process-read	undecided
+    process-write	binary
+    keyboard		undecided-unix
+    native		binary
+    no-conv-cs		raw-text
+    terminal		binary))
 
-(defvar coding-system-default-configuration-list
-  '(unix-no-mule-no-eol-detection
-    unix-no-mule-eol-detection
-    unix-mule
-    windows-no-mule
-    windows-mule))
+(define-coding-system-default-configuration
+  'windows-no-mule
+  "Microsoft Windows, no Mule support."
+  '(bfcs-for-read	raw-text
+    default-bfcs	raw-text-dos
+    process-read	raw-text
+    process-write	raw-text
+    keyboard		raw-text
+    native		raw-text-dos
+    no-conv-cs		raw-text
+    terminal		binary))
+
+(define-coding-system-default-configuration
+  'windows-mule
+  "Microsoft Windows, Mule support enabled."
+  '(bfcs-for-read	undecided
+    default-bfcs	mswindows-multibyte-dos
+    process-read	undecided
+    process-write	mswindows-multibyte-system-default
+    keyboard		undecided-unix
+    native		mswindows-multibyte-system-default-dos
+    no-conv-cs		mswindows-multibyte
+    terminal		mswindows-multibyte-unix))
+
+(define-coding-system-default-configuration
+  'cygwin-utf-8
+  "Mule support enabled."
+  '(bfcs-for-read	undecided
+    default-bfcs	utf-8
+    process-read	utf-8
+    process-write	utf-8
+    keyboard		utf-8
+    native		utf-8
+    no-conv-cs		utf-8
+    terminal		utf-8))
 
 (defvar coding-system-default-variable-list
-  '(buffer-file-coding-system-for-read
-    default-buffer-file-coding-system
+  '(bfcs-for-read
+    default-bfcs
     native
     keyboard
     terminal
-    default-process-coding-system-read
-    default-process-coding-system-write
-    no-conversion-coding-system-mapping))
+    process-read
+    process-write
+    no-conv-cs))
 
 (defun get-coding-system-variable (var)
   "Return the value of a basic coding system variable.
@@ -124,15 +176,15 @@
 `coding-system-variable-default-value' for a list of the possible values of
 VAR."
   (case var
-    (buffer-file-coding-system-for-read buffer-file-coding-system-for-read)
-    (default-buffer-file-coding-system
+    (bfcs-for-read buffer-file-coding-system-for-read)
+    (default-bfcs
       (default-value 'buffer-file-coding-system))
     (native (coding-system-aliasee 'native))
     (keyboard (coding-system-aliasee 'keyboard))
     (terminal (coding-system-aliasee 'terminal))
-    (default-process-coding-system-read (car default-process-coding-system))
-    (default-process-coding-system-write (cdr default-process-coding-system))
-    (no-conversion-coding-system-mapping
+    (process-read (car default-process-coding-system))
+    (process-write (cdr default-process-coding-system))
+    (no-conv-cs
      (coding-category-system 'no-conversion))
     (t (error 'invalid-constant "Invalid coding system variable" var))))
 
@@ -143,20 +195,20 @@
 `coding-system-variable-default-value' for a list of the possible values of
 VAR."
   (case var
-    (buffer-file-coding-system-for-read
+    (bfcs-for-read
      (set-buffer-file-coding-system-for-read value))
-    (default-buffer-file-coding-system
+    (default-bfcs
       (set-default-buffer-file-coding-system value))
     (native (define-coding-system-alias 'native value))
     (keyboard (set-keyboard-coding-system value))
     (terminal (set-terminal-coding-system value))
-    (default-process-coding-system-read
+    (process-read
       (setq default-process-coding-system
 	    (cons value (cdr default-process-coding-system))))
-    (default-process-coding-system-write
+    (process-write
       (setq default-process-coding-system
 	    (cons (car default-process-coding-system) value)))
-    (no-conversion-coding-system-mapping
+    (no-conv-cs
      (set-coding-category-system 'no-conversion value))
     (t (error 'invalid-constant "Invalid coding system variable" var))))
 
@@ -170,28 +222,29 @@
 The table of default values looks like this: (see below for abbreviations)
 
 
-               Unix    Unix+EOL  Unix+Mule       MSW           MSW+Mule
------------------------------------------------------------------------------
-bfcs-for-read  binary  raw-text  undecided       raw-text      undecided
-default bfcs   binary  binary    iso-2022-8      raw-text-dos  MSW-MB-dos
-native         binary  binary    binary          raw-text-dos  MSW-MB-SD-dos
-keyboard       binary  raw-text  undecided-unix  raw-text      undecided-unix
-terminal       binary  binary    binary          binary        MSW-MB-unix
-process-read   binary  raw-text  undecided       raw-text      undecided
-process-write  binary  binary    binary          raw-text      MSW-MB-SD
-no-conv-cs     binary  raw-text  raw-text        raw-text      MSW-MB
+              NoMule NoMuleEOL Mule       MSW          MSWMule       CygUTF 
+------------------------------------------------------------------------------
+bfcs-for-read binary raw-text undecided   raw-text     undecided     undecided
+default-bfcs  binary binary   iso-2022-8  raw-text-dos MSW-MB-dos    utf-8
+native        binary binary   binary      raw-text-dos MSW-MB-SD-dos utf-8
+keyboard      binary raw-text undecided-  raw-text     undecided-    utf-8
+                                unix                     unix
+terminal      binary binary   binary      binary       MSW-MB-unix   utf-8
+process-read  binary raw-text undecided   raw-text     undecided     utf-8
+process-write binary binary   binary      raw-text     MSW-MB-SD     utf-8
+no-conv-cs    binary raw-text raw-text    raw-text     MSW-MB        utf-8
 
 
-VAR can be one of: (abbreviations in parens)
+VAR can be one of:
 
-`buffer-file-coding-system-for-read' (bfcs-for-read)
+`bfcs-for-read'
 
   Lisp variable of the same name; the default coding system used when
   reading in a file, in the absence of more specific settings. (See
   `insert-file-contents' for a description of exactly how a file's
   coding system is determined when it's read in.)
 
-`default-buffer-file-coding-system' (default bfcs)
+`default-bfcs'
 
   Default value of `buffer-file-coding-system', the buffer-local
   variable specifying a file's coding system to be used when it is
@@ -201,58 +254,61 @@
   system used to read the file in; the default value applies to newly
   created files.
 
-`native' (native)
+`native'
 
   The coding system named `native'.  Changed using
   `define-coding-system-alias'.  Used internally when passing
   text to or from system API's, unless the particular
   API specifies another coding system.
 
-`keyboard' (keyboard)
+`keyboard'
 
  #### fill in
 
-`terminal' (terminal)
+`terminal'
 
  #### fill in
 
-`default-process-coding-system-read' (process-read)
+`process-read'
 
  #### fill in
 
-`default-process-coding-system-write' (process-write)
+`process-write'
 
  #### fill in
 
-`no-conversion-coding-system-mapping' (no-conv-cs)
+`no-conv-cs'
 
   Coding system used when category `no-conversion' is detected.
 
 
 CONFIG is one of: (abbreviations in parens)
 
-`unix-no-mule-no-eol-detection' (Unix)
+`no-mule-no-eol-detection' (NoMule)
 
-Unix, no Mule support, no automatic EOL detection. (Controlled by
+Non-Windows, no Mule support, no automatic EOL detection. (Controlled by
 `eol-detection-enabled-p', which is set by the command-line flag
 -enable-eol-detection or the configure flag --with-default-eol-detection.)
 
-`unix-no-mule-eol-detection' (Unix+EOL)
+`unix-no-mule-eol-detection' (NoMuleEOL)
 
-Unix, no Mule support, automatic EOL detection.
+Non-Windows, no Mule support, automatic EOL detection.
 
-`unix-mule' (Unix+Mule)
+`unix-mule' (Mule)
 
-Unix, Mule support.
+Non-Windows, Mule support.
 
 `windows-no-mule' (MSW)
 
-MS Windows or Cygwin, no Mule support.
+MS Windows or old Cygwin, no Mule support.
+
+`windows-mule' (MSWMule)
 
-`windows-mule'. (MSW+Mule)
+MS Windows or old Cygwin, Mule support.
 
-MS Windows or Cygwin, Mule support.
+`cygwin-utf-8' (CygUTF)
 
+Cygwin 1.7 or later, which uses UTF-8 consistently.
 
 The following coding system abbreviations are also used in the table:
 
@@ -260,12 +316,12 @@
 MSW-MB = mswindows-multibyte-system-default
 "
   (setq config (or config (coding-system-current-system-configuration)))
-  (let ((defs (cdr (assq var coding-system-variable-default-value-table))))
-    (or defs (error 'invalid-constant "Invalid coding system variable" var))
-    (let ((pos (position config coding-system-default-configuration-list)))
-      (or pos (error 'invalid-constant "Invalid coding system configuration"
+  (or (memq var coding-system-default-variable-list)
+      (error 'invalid-constant "Invalid coding system variable" var))
+  (let ((props (gethash config coding-system-default-configuration-table)))
+    (or props (error 'invalid-constant "Invalid coding system configuration"
 		     config))
-      (nth pos defs))))
+    (getf props var)))
 
 (defun reset-coding-system-defaults (&optional config)
   "Reset all basic coding system variables are set to their default values.
@@ -332,7 +388,7 @@
     )
   (set-coding-category-system
    'no-conversion
-   (coding-system-variable-default-value 'no-conversion-coding-system-mapping))
+   (coding-system-variable-default-value 'no-conv-cs))
   (set-coding-category-system 'ucs-4 'ucs-4)
   (set-coding-category-system 'utf-8 'utf-8)
   (set-coding-category-system 'utf-8-bom 'utf-8-bom)
--- a/lisp/cus-edit.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/cus-edit.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1779,31 +1779,39 @@
 	   ;; Use call-with-condition-handler so the error can be seen
 	   ;; with the stack intact.
 	   (call-with-condition-handler
-	       #'(lambda (__custom_load_cd1__)
-		   (when (and
-			  custom-define-current-source-file
-			  (progn
-			    (setq source (expand-file-name
-					  custom-define-current-source-file
-					  dir))
-			    (let ((nondir (file-name-nondirectory source)))
-			      (and (file-exists-p source)
-				   (not (assoc source load-history))
-				   (not (assoc nondir load-history))
-				   (not (and (boundp 'preloaded-file-list)
-					     (member nondir
-						     preloaded-file-list)))))))
-		     (if custom-warn-when-reloading-necessary
-			 (lwarn 'custom-defines 'warning
-			   "Error while loading custom-defines, fetching source and reloading ...\n
+	       ((macro
+		 . (lambda (lambda-expression)
+		     ;; Be more serious about information hiding here:
+		     (nsublis
+		      '((custom-load-handler-arg . #:custom-load-g9JBHiZHD))
+		      lambda-expression)))
+		#'(lambda (custom-load-handler-arg)
+		    (when (and
+			   custom-define-current-source-file
+			   (progn
+			     (setq source (expand-file-name
+					   custom-define-current-source-file
+					   dir))
+			     (let ((nondir (file-name-nondirectory source)))
+			       (and (file-exists-p source)
+				    (not (assoc source load-history))
+				    (not (assoc nondir load-history))
+				    (not (and (boundp 'preloaded-file-list)
+					      (member nondir
+						      preloaded-file-list)))))))
+		      (if custom-warn-when-reloading-necessary
+			  (lwarn 'custom-defines 'warning
+			    "Error while loading custom-defines, fetching \
+source and reloading ...\n
 Error: %s\n
 Source file: %s\n\n
 Backtrace follows:\n\n%s"
-			   (error-message-string __custom_load_cd1__)
-			   source
-			   (backtrace-in-condition-handler-eliminating-handler
-			    '__custom_load_cd1__)))
-		     (return-from custom-load nil)))
+			    (error-message-string custom-load-handler-arg)
+			    source
+			    (backtrace-in-condition-handler-eliminating-handler
+			     'custom-load-handler-arg
+)))
+		      (return-from custom-load nil))))
 	       #'(lambda ()
 		   (load (expand-file-name "custom-defines" dir))))))
       ;; we get here only from the `return-from'; see above
--- a/lisp/descr-text.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/descr-text.el	Wed Feb 24 01:58:04 2010 -0600
@@ -291,7 +291,7 @@
   "The DB format to use for the `describe-char' cache, or nil if no cache.")
 
 (defvar describe-char-unihan-field-descriptions
-  #s(hash-table test equal data 
+  #s(hash-table :test equal :data 
                 ("kAccountingNumeric"
                      "Value as an an accounting numeral"
                  "kBigFive"
--- a/lisp/find-paths.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/find-paths.el	Wed Feb 24 01:58:04 2010 -0600
@@ -352,25 +352,6 @@
       (setq directories (cdr directories)))
     (reverse reverse-directories)))
 
-(defun paths-uniq-append (list-1 list-2)
-  "Append LIST-1 and LIST-2, omitting EQUAL duplicates."
-  (let ((reverse-survivors '()))
-    (while list-2
-      (if (null (member (car list-2) list-1))
-	  (setq reverse-survivors (cons (car list-2) reverse-survivors)))
-      (setq list-2 (cdr list-2)))
-    (append list-1
-	    (reverse reverse-survivors))))
-
-(defun paths-filter (predicate list)
-  "Delete all matches of PREDICATE from LIST."
-  (let ((reverse-result '()))
-    (while list
-      (if (funcall predicate (car list))
-	  (setq reverse-result (cons (car list) reverse-result)))
-      (setq list (cdr list)))
-    (nreverse reverse-result)))
-
 (defun paths-decode-directory-path (string &optional drop-empties)
   "Split STRING at path separators into a directory list.
 Non-\"\" components are converted into directory form.
@@ -384,9 +365,7 @@
 			(file-name-as-directory component)))
 		  components)))
     (if drop-empties
-	(paths-filter #'(lambda (component)
-			  (null (string-equal "" component)))
-		      directories)
+        (delete "" directories)
       directories)))
 
 ;;; find-paths.el ends here
--- a/lisp/glyphs.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/glyphs.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1142,7 +1142,8 @@
   (if (featurep 'x)
     (set-console-type-image-conversion-list 'x
      `(,@(if (featurep 'xpm) '(("\\.xpm\\'" [xpm :file nil] 2)))
-	 ("\\.xbm\\'" [xbm :file nil] 2)
+       ("\\.xbm\\'" [xbm :file nil] 2)
+       ("/bitmaps/" [xbm :file nil] 2)
        ,@(if (featurep 'xpm) '(("\\`/\\* XPM \\*/" [xpm :data nil] 2)))
        ,@(if (featurep 'xface) '(("\\`X-Face:" [xface :data nil] 2)))
        ,@(if (featurep 'gif) '(("\\.gif\\'" [gif :file nil] 2)
@@ -1164,6 +1165,7 @@
 	 'tty
          '(("\\.xpm\\'" [string :data nil] 2)
            ("\\.xbm\\'" [string :data nil] 2)
+	   ("/bitmaps/" [string :data nil] 2)
            ;; #define could also mean a bitmap as well as a version 1 XPM. Who
            ;; cares.
            ("^#define" [string :data "[xpm]"])
--- a/lisp/gnuserv.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/gnuserv.el	Wed Feb 24 01:58:04 2010 -0600
@@ -181,7 +181,7 @@
 		(function :tag "Other"))
   :group 'gnuserv)
 
-(defcustom gnuserv-program "gnuserv"
+(defcustom gnuserv-program (expand-file-name "gnuserv" exec-directory)
   "*Program to use as the editing server."
   :type 'string
   :group 'gnuserv)
--- a/lisp/help.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/help.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1385,15 +1385,8 @@
 			   (symbol-name def)))
 		(format "an alias for `%s', " (symbol-name def)))))
       (setq def (symbol-function def)))
-    (if (and (fboundp 'compiled-function-annotation)
-	     (compiled-function-p def))
-	(setq file-name (declare-fboundp (compiled-function-annotation def))))
     (if (eq 'macro (car-safe def))
 	(setq fndef (cdr def)
-	      file-name (and (compiled-function-p (cdr def))
-			     (fboundp 'compiled-function-annotation)
-			     (declare-fboundp
-			      (compiled-function-annotation (cdr def))))
 	      macrop t)
       (setq fndef def))
     (if aliases (princ aliases))
@@ -1414,8 +1407,8 @@
       (cond ((or (stringp def) (vectorp def))
              (princ "a keyboard macro.")
 	     (setq kbd-macro-p t))
-            ((special-form-p fndef)
-             (funcall int "built-in special form" nil 'neither))
+            ((special-operator-p fndef)
+             (funcall int "built-in special operator" nil 'neither))
             ((subrp fndef)
              (funcall int "built-in" nil macrop))
             ((compiled-function-p fndef)
--- a/lisp/indent.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/indent.el	Wed Feb 24 01:58:04 2010 -0600
@@ -289,7 +289,7 @@
   "Short cut function to indent region using `indent-according-to-mode'.
 A value of nil means really run `indent-according-to-mode' on each line.")
 
-(defun indent-region (start end column)
+(defun indent-region (start end &optional column)
   "Indent each nonblank line in the region.
 With no argument, indent each line using `indent-according-to-mode',
 or use `indent-region-function' to do the whole region if that's non-nil.
--- a/lisp/lisp-mode.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/lisp-mode.el	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1985, 1996, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Tinker Systems.
-;; Copyright (C) 2002 Ben Wing.
+;; Copyright (C) 2002, 2010 Ben Wing.
 
 ;; Maintainer: FSF
 ;; Keywords: lisp, languages, dumped
@@ -846,7 +846,11 @@
 	       (lisp-indent-specform method state
 				     indent-point normal-indent))
 	      (method
-		(funcall method state indent-point)))))))
+		(funcall method state indent-point))
+	      ((and (> (length function) 5)
+		    (string-match "\\`with-" function))
+	       (lisp-indent-specform 0 state indent-point normal-indent
+				     t)))))))
 
 (defun lisp-indent-quoteform (state indent-point)
   (goto-char (car (cdr state)))
@@ -859,7 +863,36 @@
 (defvar lisp-body-indent 2
   "Number of columns to indent the second line of a `(def...)' form.")
 
-(defun lisp-indent-specform (count state indent-point normal-indent)
+;; Calculate the appropriate indentation for a special form (e.g. defun) or
+;; a macro that behaves like a special form (e.g. with-temp-buffer).
+;; Return value is as for `calculate-lisp-indent' (q.v.).
+;;
+;; COUNT is the number of "distinguished" forms (e.g. arguments before the
+;; "body", in a macro taking a body as its last argument).
+;;
+;; INDENT-POINT is usually the value of (point) at the beginning of the
+;; line containing the form to be indented.
+;;
+;; STATE is the result of calling (parse-partial-sexp (point) INDENT-POINT)
+;; when (point) is sitting on (i.e. just before) the outermost containing
+;; left paren for the form to be indented.
+;;
+;; NORMAL-INDENT is the amount of "full" indentation used for arguments
+;; that aren't given some special indentation (usually less), and normally
+;; it lines up with the first word after the function name.  forms are
+;; indented as follows:
+;;
+;; -- The first and second distinguished forms are given 2 times body indent
+;;    (determined by `lisp-body-indent')
+;; -- Other distinguished forms are given normal indent
+;; -- The first nondistinguished form (the body, usually) is given body indent
+;; -- Normally, any further nondistinguished forms are given normal indent
+;; -- However, if INDENT-REMAINING-AS-BODY was specified, any further
+;;    nondistinguished forms are given body indent.  This is useful when the
+;;    number of distinguished forms isn't known or may vary.
+
+(defun lisp-indent-specform (count state indent-point normal-indent
+			     &optional indent-remaining-as-body)
   (let ((containing-form-start (elt state 1))
         (i count)
         body-indent containing-form-column)
@@ -900,7 +933,8 @@
       ;; or if this is the first undistinguished form and the preceding
       ;; distinguished form has indentation at least as great as body-indent.
       (if (or (and (= i 0) (= count 0))
-              (and (= count 0) (<= body-indent normal-indent)))
+              (and (or (= count 0) indent-remaining-as-body)
+		   (<= body-indent normal-indent)))
           body-indent
           normal-indent))))
 
--- a/lisp/list-mode.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/list-mode.el	Wed Feb 24 01:58:04 2010 -0600
@@ -174,8 +174,9 @@
       (if extent (goto-char (extent-end-position extent)))
       ;; Move to start of next one.
       (or (extent-at (point) (current-buffer) 'list-mode-item)
-	  (goto-char (next-single-property-change (point) 'list-mode-item
-						  nil end))))
+	  (goto-char (next-single-char-property-change (point)
+						       'list-mode-item
+						       nil end))))
     (setq n (1- n)))
   (while (and (< n 0) (not (bobp)))
     (let ((extent (extent-at (point) (current-buffer) 'list-mode-item))
@@ -186,7 +187,7 @@
       (if (setq extent (extent-at (point) (current-buffer) 'list-mode-item
 				  nil 'before))
 	  (goto-char (extent-start-position extent))
-	(goto-char (previous-single-property-change
+	(goto-char (previous-single-char-property-change
 		    (point) 'list-mode-item nil end))
 	(if (setq extent (extent-at (point) (current-buffer) 'list-mode-item
 				    nil 'before))
@@ -648,7 +649,7 @@
   (if (not (get-buffer-window "*Completions*"))
       nil
     (select-window (get-buffer-window "*Completions*"))
-    (goto-char (next-single-property-change (point-min) 'list-mode-item nil
-					    (point-max)))))
+    (goto-char (next-single-char-property-change (point-min) 'list-mode-item
+						 nil (point-max)))))
 
 ;;; list-mode.el ends here
--- a/lisp/loadhist.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/loadhist.el	Wed Feb 24 01:58:04 2010 -0600
@@ -46,7 +46,7 @@
 This is a file name, or nil if the source was a buffer with no associated file.
 
 If TYPE is nil or omitted, any kind of definition is acceptable.
-If TYPE is `defun', then function, subr, special form or macro definitions
+If TYPE is `defun', then function, subr, special operator or macro definitions
 are acceptable.
 If TYPE is `defvar', then variable definitions are acceptable.
 
@@ -90,7 +90,10 @@
         ;; This is a bit heuristic, but shouldn't realistically be a
         ;; problem:
         (if (string-match "\.elc?$" built-in-file)
-            (concat lisp-directory built-in-file)
+            (concat (if (file-readable-p source-lisp)
+			source-lisp
+		      lisp-directory)
+		    built-in-file)
           (concat source-directory "/src/" built-in-file))))))
 
 (defun feature-symbols (feature)
--- a/lisp/loadup.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/loadup.el	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1996 Richard Mlynarik.
-;; Copyright (C) 1995, 1996, 2003 Ben Wing.
+;; Copyright (C) 1995, 1996, 2003, 2005 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: internal, dumped
@@ -44,6 +44,12 @@
 ;; Help debug problems.
 (setq stack-trace-on-error t
       load-always-display-messages t)
+(when (featurep 'debug-xemacs)
+  ;; Immediately dump core upon an unhandled error, rather than just quitting
+  ;; the program.  This can also be achieved by setting an environment variable
+  ;; XEMACSDEBUG to contain '(setq debug-on-error t)', e.g.
+  ;; export XEMACSDEBUG='(setq debug-on-error t)'
+  (setq debug-on-error t))
 
 ;(princ (format "command-line-args: %s\n" command-line-args))
 ;(princ (format "configure-lisp-directory: %S\n" configure-lisp-directory))
@@ -212,8 +218,12 @@
 ;; See also "site-load" above.
 (when (stringp site-start-file)
   (load "site-init" t))
-;; Add information from this file to the load history:
-(setq load-history (cons (nreverse current-load-list) load-history)
+
+;; Add information from this file to the load history. Delete information
+;; for those files in preloaded-file-list; the symbol file information can
+;; be taken from DOC, and #'unload-feature makes very little sense for
+;; dumped functionality.
+(setq load-history (cons (nreverse current-load-list) (last load-history))
       ;; Clear current-load-list; this (and adding information to
       ;; load-history) is normally done in lread.c after reading the
       ;; entirety of a file, something which never happens for loadup.el.
@@ -239,7 +249,8 @@
     (really-free))
   ;; Make sure we don't dump with debugging messages turned on.
   (setq stack-trace-on-error nil
-	load-always-display-messages nil)
+	load-always-display-messages nil
+	debug-on-error nil)
   (dump-emacs
    (cond
     ((featurep 'infodock) "infodock")
--- a/lisp/make-docfile.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/make-docfile.el	Wed Feb 24 01:58:04 2010 -0600
@@ -78,11 +78,6 @@
 
 ;; (message (concat "Options: " (prin1-to-string options)))
 
-;; insert-file-contents-internal calls out to `format-decode' afterwards,
-;; so it must be defined.  if non-zero, it tries to do a bunch more stuff
-;; so say, "NOOOOOOOOOOOOO!  Basta!  Ca soufit!   Enough, already, OK?"
-(defun format-decode (fuck me harder) 0)
-
 ;; Next process the list of C files.
 (defun process-args (args)
   (while args
--- a/lisp/minibuf.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/minibuf.el	Wed Feb 24 01:58:04 2010 -0600
@@ -344,13 +344,16 @@
 
 (define-error 'input-error "Keyboard input error" 'io-error)
 
-(defun read-from-minibuffer (prompt &optional initial-contents
-                                    keymap
-                                    readp
-                                    history
-				    abbrev-table
-				    default)
-  "Read a string from the minibuffer, prompting with string PROMPT.
+((macro
+  . (lambda (read-from-minibuffer-definition)
+      (nsublis
+       ;; `M-x doctor' makes (the interned) history a local variable, use an
+       ;; uninterned symbol here so we don't interact with it.
+       '((history . #:history))
+       read-from-minibuffer-definition)))
+ (defun read-from-minibuffer (prompt &optional initial-contents keymap
+			      readp history abbrev-table default)
+   "Read a string from the minibuffer, prompting with string PROMPT.
 If optional second arg INITIAL-CONTENTS is non-nil, it is a string
   to be inserted into the minibuffer before reading input.
   If INITIAL-CONTENTS is (STRING . POSITION), the initial input
@@ -376,50 +379,45 @@
 
 See also the variable `completion-highlight-first-word-only' for
   control over completion display."
-  (if (and (not enable-recursive-minibuffers)
-           (> (minibuffer-depth) 0)
-           (eq (selected-window) (minibuffer-window)))
-      (error "Command attempted to use minibuffer while in minibuffer"))
+   (if (and (not enable-recursive-minibuffers)
+	    (> (minibuffer-depth) 0)
+	    (eq (selected-window) (minibuffer-window)))
+       (error "Command attempted to use minibuffer while in minibuffer"))
 
-  (if (and minibuffer-max-depth
-	   (> minibuffer-max-depth 0)
-           (>= (minibuffer-depth) minibuffer-max-depth))
-      (minibuffer-max-depth-exceeded))
+   (if (and minibuffer-max-depth
+	    (> minibuffer-max-depth 0)
+	    (>= (minibuffer-depth) minibuffer-max-depth))
+       (minibuffer-max-depth-exceeded))
 
-  ;; catch this error before the poor user has typed something...
-  (if history
-      (if (symbolp history)
-	  (or (boundp history)
-	      (error "History list %S is unbound" history))
-	(or (boundp (car history))
-	    (error "History list %S is unbound" (car history)))))
+   ;; catch this error before the poor user has typed something...
+   (if history
+       (if (symbolp history)
+	   (or (boundp history)
+	       (error "History list %S is unbound" history))
+	 (or (boundp (car history))
+	     (error "History list %S is unbound" (car history)))))
 
-  (if (noninteractive)
-      (progn
-        ;; XEmacs in -batch mode calls minibuffer: print the prompt.
-        (message "%s" (gettext prompt))
-        ;;#### force-output
+   (if (noninteractive)
+       (progn
+	 ;; XEmacs in -batch mode calls minibuffer: print the prompt.
+	 (message "%s" (gettext prompt))
+	 ;;#### force-output
 
-        ;;#### Should this even be falling though to the code below?
-        ;;#### How does this stuff work now, anyway?
-        ))
-  (let* ((dir default-directory)
-         (owindow (selected-window))
-	 (oframe (selected-frame))
-         (window (minibuffer-window))
-         (buffer (get-buffer-create (format " *Minibuf-%d*"
-					    (minibuffer-depth))))
-         (frame (window-frame window))
-         (mconfig (if (eq frame (selected-frame))
-                      nil (current-window-configuration frame)))
-         (oconfig (current-window-configuration))
-	 ;; dynamic scope sucks sucks sucks sucks sucks sucks.
-	 ;; `M-x doctor' makes history a local variable, and thus
-	 ;; our binding above is buffer-local and doesn't apply
-	 ;; once we switch buffers!!!!  We demand better scope!
-	 (_history_ history)
-	 (minibuffer-default default))
-    (unwind-protect
+	 ;;#### Should this even be falling though to the code below?
+	 ;;#### How does this stuff work now, anyway?
+	 ))
+   (let* ((dir default-directory)
+	  (owindow (selected-window))
+	  (oframe (selected-frame))
+	  (window (minibuffer-window))
+	  (buffer (get-buffer-create (format " *Minibuf-%d*"
+					     (minibuffer-depth))))
+	  (frame (window-frame window))
+	  (mconfig (if (eq frame (selected-frame))
+		       nil (current-window-configuration frame)))
+	  (oconfig (current-window-configuration))
+	  (minibuffer-default default))
+     (unwind-protect
          (progn
            (set-buffer (reset-buffer buffer))
            (setq default-directory dir)
@@ -462,14 +460,14 @@
 		       (current-buffer)))
                  (current-prefix-arg current-prefix-arg)
 ;;                 (help-form minibuffer-help-form)
-                 (minibuffer-history-variable (cond ((not _history_)
+                 (minibuffer-history-variable (cond ((not history)
                                                      'minibuffer-history)
-                                                    ((consp _history_)
-                                                     (car _history_))
+                                                    ((consp history)
+                                                     (car history))
                                                     (t
-                                                     _history_)))
-                 (minibuffer-history-position (cond ((consp _history_)
-                                                     (cdr _history_))
+                                                     history)))
+                 (minibuffer-history-position (cond ((consp history)
+                                                     (cdr history))
                                                     (t
                                                      0)))
                  (minibuffer-scroll-window owindow))
@@ -479,16 +477,16 @@
 		 (setq local-abbrev-table abbrev-table
 		       abbrev-mode t))
 	     ;; This is now run from read-minibuffer-internal
-             ;(if minibuffer-setup-hook
-             ;    (run-hooks 'minibuffer-setup-hook))
-             ;(message nil)
+					;(if minibuffer-setup-hook
+					;    (run-hooks 'minibuffer-setup-hook))
+					;(message nil)
              (if (eq 't
                      (catch 'exit
                        (if (> (recursion-depth) (minibuffer-depth))
                            (let ((standard-output t)
                                  (standard-input t))
                              (read-minibuffer-internal prompt))
-                           (read-minibuffer-internal prompt))))
+			 (read-minibuffer-internal prompt))))
                  ;; Translate an "abort" (throw 'exit 't)
                  ;;  into a real quit
                  (signal 'quit '())
@@ -538,21 +536,20 @@
 				  (cons histval list))))))
                  (if err (signal (car err) (cdr err)))
                  val))))
-      ;; stupid display code requires this for some reason
-      (set-buffer buffer)
-      (buffer-disable-undo buffer)
-      (setq buffer-read-only nil)
-      (erase-buffer)
+       ;; stupid display code requires this for some reason
+       (set-buffer buffer)
+       (buffer-disable-undo buffer)
+       (setq buffer-read-only nil)
+       (erase-buffer)
 
-      ;; restore frame configurations
-      (if (and mconfig (frame-live-p oframe)
-	       (eq frame (selected-frame)))
-	  ;; if we changed frames (due to surrogate minibuffer),
-	  ;; and we're still on the new frame, go back to the old one.
-	  (select-frame oframe))
-      (if mconfig (set-window-configuration mconfig))
-      (set-window-configuration oconfig))))
-
+       ;; restore frame configurations
+       (if (and mconfig (frame-live-p oframe)
+		(eq frame (selected-frame)))
+	   ;; if we changed frames (due to surrogate minibuffer),
+	   ;; and we're still on the new frame, go back to the old one.
+	   (select-frame oframe))
+       (if mconfig (set-window-configuration mconfig))
+       (set-window-configuration oconfig)))))
 
 (defun minibuffer-max-depth-exceeded ()
   ;;
--- a/lisp/mule/arabic.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/mule/arabic.el	Wed Feb 24 01:58:04 2010 -0600
@@ -28,35 +28,6 @@
 
 ;;; Code:
 
-;; ISO 8859-6 is such a useless character set that it seems a waste of
-;; codespace to dump it. Let me count the ways: 
-;; 
-;; 1. It doesn't support Persian or Urdu, let alone Sinhalese, despite
-;;    plenty of unallocated code points.
-;;
-;; 2. It doesn't encode all the vowel diacritics (the Harakaat) despite that
-;;    they are necessary, even for the Arabs, for basic things like
-;;    dictionary entries, children's books, and occasional disambiguation.
-;;
-;; 3. The Arabs don't use it, they use Windows-1256, which also supports
-;;    Persian, at least, as well as the French characters necessary in
-;;    Lebanon and North Africa.
-
-;; But; it's necessary for input on X11.
-
-(make-charset
- 'arabic-iso8859-6 
- "Right-Hand Part of Latin/Arabic Alphabet (ISO/IEC 8859-6): ISO-IR-127"
- '(dimension 1
-   registry "ISO8859-6"
-   chars 96
-   columns 1
-   direction r2l
-   final ?G
-   graphic 1
-   short-name "RHP of ISO8859/6"
-   long-name "RHP of Arabic (ISO 8859-6): ISO-IR-127"))
-
 (make-coding-system
  'iso-8859-6 'fixed-width "ISO 8859-6 (Arabic)"
  '(unicode-map
--- a/lisp/mule/cyrillic.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/mule/cyrillic.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1166,7 +1166,7 @@
   do
   (put-case-table-pair upper lower case-table))
 
-;; Support fot the languages of the Caucasus.
+;; Support for the languages of the Caucasus. Never widely used.
 (make-coding-system
  'koi8-c 'fixed-width "KOI-8, Caucasus."
  '(unicode-map
@@ -1182,7 +1182,7 @@
     (#x89 ?\u04B9) ;; CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
     (#x8A ?\u04BB) ;; CYRILLIC SMALL LETTER SHHA
     (#x8B ?\u2580) ;; UPPER HALF BLOCK
-    (#x8C ?\u049D) ;; CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
+    (#x8C ?\u04D9) ;; CYRILLIC SMALL LETTER SCHWA
     (#x8D ?\u04E3) ;; CYRILLIC SMALL LETTER I WITH MACRON
     (#x8E ?\u04E9) ;; CYRILLIC SMALL LETTER BARRED O
     (#x8F ?\u04EF) ;; CYRILLIC SMALL LETTER U WITH MACRON
@@ -1304,16 +1304,17 @@
 
 (loop
   for (upper lower)
-  in '((?\u04E9 ?\u04E8) ;; BARRED O
-       (?\u04B9 ?\u04B8) ;; CHE WITH VERTICAL STROKE
-       (?\u0452 ?\u0402) ;; DJE
-       (?\u0455 ?\u0405) ;; DZE
-       (?\u04A3 ?\u04A2) ;; EN WITH DESCENDER
-       (?\u049D ?\u049C) ;; KA WITH VERTICAL STROKE
-       (?\u04BB ?\u04BA) ;; SHHA
-       (?\u04AF ?\u04AE) ;; STRAIGHT U
-       (?\u04B1 ?\u04B0) ;; STRAIGHT U WITH STROKE
-       (?\u0497 ?\u0496)) ;; ZHE WITH DESCENDER
+  in '((?\u04E8 ?\u04E9) ;; BARRED O
+       (?\u04B8 ?\u04B9) ;; CHE WITH VERTICAL STROKE
+       (?\u0402 ?\u0452) ;; DJE
+       (?\u0405 ?\u0455) ;; DZE
+       (?\u04A2 ?\u04A3) ;; EN WITH DESCENDER
+       (?\u049C ?\u049D) ;; KA WITH VERTICAL STROKE
+       (?\u04BA ?\u04BB) ;; SHHA
+       (?\u04D8 ?\u04D9) ;; SCHWA
+       (?\u04AE ?\u04AF) ;; STRAIGHT U
+       (?\u04B0 ?\u04B1) ;; STRAIGHT U WITH STROKE
+       (?\u0496 ?\u0497)) ;; ZHE WITH DESCENDER
   with case-table = (standard-case-table)
   do
   (put-case-table-pair upper lower case-table))
--- a/lisp/mule/mule-category.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/mule/mule-category.el	Wed Feb 24 01:58:04 2010 -0600
@@ -244,6 +244,7 @@
     (latin-iso8859-4	?l)
     (latin-iso8859-9	?l)
     (cyrillic-iso8859-5 ?y "Cyrillic character set")
+    (arabic-iso8859-6	?b "Arabic character set")
     (greek-iso8859-7	?g "Greek character set")
     (hebrew-iso8859-8	?w "Hebrew character set")
     (katakana-jisx0201	?k "Japanese 1-byte Katakana character set")
--- a/lisp/mule/mule-cmds.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/mule/mule-cmds.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1191,21 +1191,24 @@
 can't set the text encoding used to communicate with the OS.  To get around
 this, we use Unicode whenever available, i.e. on Windows NT always and on
 Windows 9x whenever a Unicode version of a system call is available.)"
-  (if (eq system-type 'windows-nt)
-      ;; should not apply to Cygwin, I don't think
-      'mswindows-multibyte-system-default
-    (let ((ncod (get-language-info langenv 'native-coding-system)))
-      (if (or (functionp ncod) (not (listp ncod)))
-	  (setq ncod (list ncod)))
-      (let ((native
-	     (dolist (try-native ncod)
-	       (let ((result
-		      (if (functionp try-native)
-			  (funcall try-native locale)
-			try-native)))
-		 (if result (return result))))))
-	(or native (car (get-language-info langenv 'coding-system))
-	    'raw-text)))))
+  (cond ((eq system-type 'windows-nt)
+	 ;; should not apply to Cygwin, I don't think
+	 'mswindows-multibyte-system-default)
+	((featurep 'cygwin-use-utf-8)
+	 'utf-8)
+	(t
+	 (let ((ncod (get-language-info langenv 'native-coding-system)))
+	   (if (or (functionp ncod) (not (listp ncod)))
+	       (setq ncod (list ncod)))
+	   (let ((native
+		  (dolist (try-native ncod)
+		    (let ((result
+			   (if (functionp try-native)
+			       (funcall try-native locale)
+			     try-native)))
+		      (if result (return result))))))
+	     (or native (car (get-language-info langenv 'coding-system))
+		 'raw-text))))))
 
 (defun get-coding-system-from-locale (locale)
   "Return the coding system corresponding to a locale string."
--- a/lisp/mule/mule-msw-init-late.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/mule/mule-msw-init-late.el	Wed Feb 24 01:58:04 2010 -0600
@@ -37,6 +37,7 @@
 	   (greek-iso8859-7 . "Greek") 
 	   (latin-iso8859-9 . "Turkish")
 	   (hebrew-iso8859-8 . "Hebrew")
+	   (arabic-iso8859-6 . "Arabic")
 	   (latin-iso8859-4 . "Baltic")
 	   (vietnamese-viscii-lower . "Viet Nam")
 	   (vietnamese-viscii-upper . "Viet Nam")
--- a/lisp/mule/vietnamese.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/mule/vietnamese.el	Wed Feb 24 01:58:04 2010 -0600
@@ -111,7 +111,7 @@
     (#xA3 ?\u1EB7) ;; SMALL LETTER A WITH BREVE AND DOT BELOW
     (#xA4 ?\u1EA5) ;; SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
     (#xA5 ?\u1EA7) ;; SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-    (#xA6 ?\u1EA8) ;; CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+    (#xA6 ?\u1EA9) ;; SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
     (#xA7 ?\u1EAD) ;; SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
     (#xA8 ?\u1EBD) ;; SMALL LETTER E WITH TILDE
     (#xA9 ?\u1EB9) ;; SMALL LETTER E WITH DOT BELOW
--- a/lisp/obsolete.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/obsolete.el	Wed Feb 24 01:58:04 2010 -0600
@@ -275,6 +275,9 @@
 ;; being called on the values of functions known to return keymaps,
 ;; or known to return vectors of events instead of strings...
 
+;;; Yes there is; make compiler macros for aref, assq, nconc, checking that
+;;; the car of the relevant argument is sane.
+
 (make-obsolete-variable 'executing-macro 'executing-kbd-macro)
 
 (define-compatible-function-alias 'interactive-form 
@@ -395,7 +398,7 @@
 
 (make-obsolete 'function-called-at-point 'function-at-point)
 
-;; As of 21.5, #'throw is a special form. This makes bytecode using it
+;; As of 21.5, #'throw is a special operator. This makes bytecode using it
 ;; compiled for 21.4 fail; making this function available works around that.
 (defun obsolete-throw (tag value)
   "Ugly compatibility hack.
@@ -408,5 +411,7 @@
  'obsolete-throw
  "it says `obsolete' in the name, you know you shouldn't be using this.")
 
+(define-compatible-function-alias 'cl-mapc 'mapc)
+
 (provide 'obsolete)
 ;;; obsolete.el ends here
--- a/lisp/packages.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/packages.el	Wed Feb 24 01:58:04 2010 -0600
@@ -106,11 +106,10 @@
   "Returns a list package hierarchy directory names.
 These are the valid immediate directory names of package
 directories, directories with higher priority first"
-  (paths-filter #'(lambda (x) x)
-		`("site-packages"
-		  ,(when (featurep 'infodock) "infodock-packages")
-		  ,(when (featurep 'mule) "mule-packages")
-		  "xemacs-packages")))
+  (delq nil `("site-packages"
+              ,(when (featurep 'infodock) "infodock-packages")
+              ,(when (featurep 'mule) "mule-packages")
+              "xemacs-packages")))
 
 (defun package-get-key-1 (info key)
   "Locate keyword `key' in list."
@@ -386,8 +385,10 @@
 (defun packages-find-installation-package-directories (roots)
   "Find the package directories in the XEmacs installation.
 ROOTS is a list of installation roots."
-  (paths-uniq-append (paths-find-version-directories roots (list "") nil nil nil t)
-		     (paths-find-site-directories roots (list "") nil)))
+  (delete-duplicates
+   (nconc (paths-find-version-directories roots (list "") nil nil nil t)
+          (paths-find-site-directories roots (list "") nil))
+   :test #'equal))
 
 (defun packages-find-package-hierarchies (package-directories &optional envvar default)
   "Find package hierarchies in a list of package directories.
--- a/lisp/setup-paths.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/setup-paths.el	Wed Feb 24 01:58:04 2010 -0600
@@ -127,8 +127,7 @@
 	 (maybe-root-2 (file-name-as-directory
 			(paths-construct-path '(".." "..") executable-directory))))
 
-    (paths-filter root-p
-		  (list maybe-root-1 maybe-root-2))))
+    (delete-if-not root-p (list maybe-root-1 maybe-root-2))))
 
 (defun paths-find-emacs-roots (invocation-directory
 			       invocation-name
@@ -143,17 +142,19 @@
 				       invocation-name
 				       root-p))
 	 (potential-installation-roots
-	  (paths-uniq-append
-	   (and configure-exec-prefix-directory
-		(list (file-name-as-directory
-		       configure-exec-prefix-directory)))
-	   (and configure-prefix-directory
-		(list (file-name-as-directory
-		       configure-prefix-directory)))))
+	  (delete-duplicates
+           (append
+            (and configure-exec-prefix-directory
+                 (list (file-name-as-directory
+                        configure-exec-prefix-directory)))
+            (and configure-prefix-directory
+                 (list (file-name-as-directory
+                        configure-prefix-directory))))
+           :test #'equal))
 	 (installation-roots
-	  (paths-filter root-p potential-installation-roots)))
-    (paths-uniq-append invocation-roots
-		       installation-roots)))
+	  (remove-if-not root-p potential-installation-roots)))
+    (delete-duplicates (nconc invocation-roots installation-roots)
+                       :test #'equal)))
 
 (defun paths-find-site-lisp-directory (roots)
   "Find the site Lisp directory of the XEmacs hierarchy.
@@ -261,23 +262,27 @@
 LAST-PACKAGE-HIERARCHIES are lists of package hierarchy roots,
 respectively."
   (let ((info-path-envval (getenv "INFOPATH")))
-    (paths-uniq-append
-     (append
-      (let ((info-directory
-	     (paths-find-version-directory roots (list "info")
-					   nil nil
-					   configure-info-directory)))
-	(and info-directory
-	     (list info-directory)))
-      (packages-find-package-info-path early-package-hierarchies)
-      (packages-find-package-info-path late-package-hierarchies)
-      (packages-find-package-info-path last-package-hierarchies)
-      (and info-path-envval
-	   (paths-decode-directory-path info-path-envval 'drop-empties)))
-     (and (null info-path-envval)
-	  (paths-uniq-append
-	   (paths-directories-which-exist configure-info-path)
-	   (paths-directories-which-exist paths-default-info-directories))))))
+    (delete-duplicates
+     (nconc
+      (append
+       (let ((info-directory
+              (paths-find-version-directory roots (list "info")
+                                            nil nil
+                                            configure-info-directory)))
+         (and info-directory
+              (list info-directory)))
+       (packages-find-package-info-path early-package-hierarchies)
+       (packages-find-package-info-path late-package-hierarchies)
+       (packages-find-package-info-path last-package-hierarchies)
+       (and info-path-envval
+            (paths-decode-directory-path info-path-envval 'drop-empties)))
+      (and (null info-path-envval)
+           (delete-duplicates
+            (nconc
+             (paths-directories-which-exist configure-info-path)
+             (paths-directories-which-exist paths-default-info-directories))
+           :test #'equal)))
+     :test #'equal)))
 
 (defun paths-find-doc-directory (roots)
   "Find the documentation directory.
--- a/lisp/simple.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/simple.el	Wed Feb 24 01:58:04 2010 -0600
@@ -957,7 +957,7 @@
     (let ((tail buffer-undo-list)
 	  done)
       (while (and tail (not done) (not (null (car tail))))
-	(if (integerp (car tail))
+	(if (fixnump (car tail))
 	    (progn
 	      (setq done t)
 	      (setq buffer-undo-list (delq (car tail) buffer-undo-list))))
@@ -2086,25 +2086,35 @@
 
 (defun handle-pre-motion-command-current-command-is-motion ()
   (and (key-press-event-p last-input-event)
-       (let ((key (event-key last-input-event))
-	     (mods (delq 'shift (event-modifiers last-input-event))))
-	 ;(princ (format "key: %s mods: %s\n" key mods) 'external-debugging-output)
-	 (catch 'handle-pre-motion-command-current-command-is-motion
-	   (flet ((keysyms-equal (a b)
-		    (if (characterp b)
-			(setq b (intern (char-to-string (downcase b)))))
-		    (eq a b)))
-             (setq key (if (characterp key)
-                           (intern (char-to-string (downcase key)))
-                         key))
-	     (dolist (keysym motion-keys-for-shifted-motion)
-	       (when (if (listp keysym)
-		         (and (equal mods (butlast keysym))
-			      (keysyms-equal key (car (last keysym))))
-	                (keysyms-equal key keysym))
-		 (throw 'handle-pre-motion-command-current-command-is-motion
-			t)))
-	     nil)))))
+       (macrolet
+	   ((keysyms-equal (&rest args)
+	      `((lambda (a b)
+		  (when (and
+			 ;; As of now, none of the elements of
+			 ;; motion-keys-for-shifted-motion are non-symbols;
+			 ;; this redundant check saves a few hundred
+			 ;; funcalls on startup.
+			 (not (symbolp b)) 
+			 (characterp b))
+		    (setf (car char-list) b
+			  b (intern (concat char-list nil))))
+		  (eq a b))
+		,@args)))
+         (loop
+           for keysym in motion-keys-for-shifted-motion
+           with key = (event-key last-input-event)
+           with mods = (delq 'shift (event-modifiers last-input-event))
+           with char-list = '(?a) ;; Some random character; the list will be
+				  ;; modified in the constants vector over
+				  ;; time.
+           initially (if (and (not (symbolp key)) (characterp key))
+			 (setf (car char-list) key
+			       key (intern (concat char-list nil))))
+           thereis (if (listp keysym)
+		       (and (equal mods (butlast keysym))
+			    (keysyms-equal
+			     key (car (last keysym))))
+		     (keysyms-equal key keysym))))))
 
 (defun handle-pre-motion-command ()
   (if (and
@@ -3825,13 +3835,8 @@
 (defun capitalize-string-as-title (string)
   "Capitalize the words in the string, except for small words (as in titles).
 The words not capitalized are specified in `uncapitalized-title-words'."
-  (let ((buffer (get-buffer-create " *capitalize-string-as-title*")))
-    (unwind-protect
-	(progn
-	  (insert-string string buffer)
-	  (capitalize-region-as-title 1 (point-max buffer) buffer)
-	  (buffer-string buffer))
-      (kill-buffer buffer))))
+  (with-string-as-buffer-contents string
+    (capitalize-region-as-title (point-min) (point-max))))
 
 (defun capitalize-region-as-title (b e &optional buffer)
   "Capitalize the words in the region, except for small words (as in titles).
--- a/lisp/startup.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/startup.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1046,9 +1046,15 @@
 	    (load-user-init-file))
 	(condition-case nil
 	    (call-with-condition-handler
-		#'(lambda (__load_init_file_arg__)
+	       ((macro
+		 . (lambda (lambda-expression)
+		     ;; Be serious about information hiding here:
+		     (nsublis
+		      '((load-init-handler-arg . #:load-init-gZK6A36gTed))
+		      lambda-expression)))
+		#'(lambda (load-init-handler-arg)
 		    (let ((errstr (error-message-string
-				   __load_init_file_arg__)))
+				   load-init-handler-arg)))
 		      (message "Error in init file: %s" errstr)
 		      (lwarn 'initialization 'error
 			"\
@@ -1066,8 +1072,8 @@
 exact problem."
 			user-init-file errstr
 			(backtrace-in-condition-handler-eliminating-handler
-			 '__load_init_file_arg__)))
-		    (setq init-file-had-error t))
+			 'load-init-handler-arg)))
+		    (setq init-file-had-error t)))
 		#'(lambda ()
 		    (if load-user-init-file-p
 			(load-user-init-file))
--- a/lisp/subr.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/subr.el	Wed Feb 24 01:58:04 2010 -0600
@@ -218,6 +218,7 @@
 (define-function 'remove-directory 'delete-directory)
 (define-function 'set-match-data 'store-match-data)
 (define-function 'send-string-to-terminal 'external-debugging-output)
+(define-function 'special-form-p 'special-operator-p)
 
 ;; XEmacs:
 (defun local-variable-if-set-p (sym buffer)
@@ -1118,14 +1119,26 @@
       (setq plist (cddr plist)))
     (nreverse alist)))
 
-(defun map-plist (_mp_fun _mp_plist)
-  "Map _MP_FUN (a function of two args) over each key/value pair in _MP_PLIST.
+((macro
+  . (lambda (map-plist-definition)
+      "Replace the variable names in MAP-PLIST-DEFINITION with uninterned
+symbols, avoiding the risk of interference with variables in other functions
+introduced by dynamic scope."
+      (if-fboundp 'nsublis 
+	  (nsublis
+	   '((mp-function . #:function)
+	     (plist . #:plist)
+	     (result . #:result))
+	   map-plist-definition)
+	map-plist-definition)))
+ (defun map-plist (mp-function plist)
+   "Map FUNCTION (a function of two args) over each key/value pair in PLIST.
 Return a list of the results."
-  (let (_mp_result)
-    (while _mp_plist
-      (push (funcall _mp_fun (car _mp_plist) (cadr _mp_plist)) _mp_result)
-      (setq _mp_plist (cddr _mp_plist)))
-    (nreverse _mp_result)))
+   (let (result)
+     (while plist
+       (push (funcall mp-function (car plist) (cadr plist)) result)
+      (setq plist (cddr plist)))
+    (nreverse result))))
 
 (defun destructive-plist-to-alist (plist)
   "Convert property list PLIST into the equivalent association-list form.
@@ -1464,7 +1477,9 @@
 	(no-backtrace nil)
 	(class ''general)
 	(level ''warning)
-	(resignal nil))
+	(resignal nil)
+	(cte-cc-var '#:cte-cc-var)
+	(call-trapping-errors-arg '#:call-trapping-errors-Ldc9FC5Hr))
     (let* ((keys '(operation error-form no-backtrace class level resignal))
 	   (keys-with-colon
 	    (mapcar #'(lambda (sym)
@@ -1473,11 +1488,11 @@
 	(let* ((key-with-colon (pop keys-body))
 	       (key (intern (substring (symbol-name key-with-colon) 1))))
 	  (set key (pop keys-body)))))
-    `(condition-case ,(if resignal '__cte_cc_var__ nil)
+    `(condition-case ,(if resignal cte-cc-var nil)
 	 (call-with-condition-handler
-	     #'(lambda (__call_trapping_errors_arg__)
+	     #'(lambda (,call-trapping-errors-arg)
 		 (let ((errstr (error-message-string
-				__call_trapping_errors_arg__)))
+				,call-trapping-errors-arg)))
 		   ,(if no-backtrace
 			`(lwarn ,class ,level
 			   (if (warning-level-<
@@ -1490,12 +1505,12 @@
 			 "Error in %s: %s\n\nBacktrace follows:\n\n%s"
 			 ,operation errstr
 			 (backtrace-in-condition-handler-eliminating-handler
-			  '__call_trapping_errors_arg__)))))
+			  ',call-trapping-errors-arg)))))
 	     #'(lambda ()
 		 (progn ,@keys-body)))
        (error
 	,error-form
-	,@(if resignal '((signal (car __cte_cc_var__) (cdr __cte_cc_var__)))))
+	,@(if resignal `((signal (car ,cte-cc-var) (cdr ,cte-cc-var)))))
        )))
 
 ;;;; Miscellanea.
@@ -1749,17 +1764,32 @@
 SUBR must be a built-in function (not just a symbol that refers to one).
 The returned value is a pair (MIN . MAX).  MIN is the minimum number
 of args.  MAX is the maximum number or the symbol `many', for a
-function with `&rest' args, or `unevalled' for a special form.
+function with `&rest' args, or `unevalled' for a special operator.
 
-See also `special-form-p', `subr-min-args', `subr-max-args',
+See also `special-operator-p', `subr-min-args', `subr-max-args',
 `function-allows-args'. "
   (check-argument-type #'subrp subr)
   (cons (subr-min-args subr)
         (cond
-         ((special-form-p subr)
+         ((special-operator-p subr)
           'unevalled)
          ((null (subr-max-args subr))
           'many)
          (t (subr-max-args subr)))))
 
+;; XEmacs; move these here from C. Would be nice to drop them entirely, but
+;; they're used reasonably often, since they've been around for a long time
+;; and they're portable to GNU.
+
+;; Used in fileio.c if format-annotate-function has a function binding
+;; (which it won't have before this file is loaded):
+(defun car-less-than-car (a b)
+  "Return t if the car of A is numerically less than the car of B."
+  (< (car a) (car b)))
+
+;; Used in packages.
+(defun cdr-less-than-cdr (a b)
+  "Return t if (cdr A) is numerically less than (cdr B)."
+  (< (cdr a) (cdr b)))
+
 ;;; subr.el ends here
--- a/lisp/syntax.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/syntax.el	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1993, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Sun Microsystems.
-;; Copyright (C) 2005 Ben Wing.
+;; Copyright (C) 2005, 2010 Ben Wing.
 
 ;; This file is part of XEmacs.
 
@@ -36,7 +36,20 @@
 
 (defun make-syntax-table (&optional oldtable)
   "Return a new syntax table.
-It inherits all characters from the standard syntax table."
+
+It inherits all characters from the standard syntax table.
+
+A syntax table is a char table of type `syntax' (see `make-char-table').
+The valid values are integers (intended to be syntax codes as generated by
+`syntax-string-to-code'), and the default result given by `get-char-table'
+is the syntax code for `word'. (Note: In 21.4 and prior, it was the code
+for `inherit'.)
+
+To modify a syntax table, you should normally use `modify-syntax-entry'
+rather than directly modify the table with `put-char-table'.
+
+See `modify-syntax-entry' for a description of the character codes used
+to indicate the various syntax classes."
   (make-char-table 'syntax))
 
 (defun syntax-after (pos)
@@ -205,21 +218,35 @@
 	  (wrong-type-argument 'syntax-table-p syntax-table))))
   nil)
 
-(defun map-syntax-table (__function __syntax_table &optional __range)
-  "Map FUNCTION over entries in SYNTAX-TABLE, collapsing inheritance.
+((macro
+  . (lambda (map-syntax-definition)
+      "Replace the variable names in MAP-SYNTAX-DEFINITION with uninterned
+symbols, at byte-compile time.  This avoids the risk of variable names
+within the functions called from MAP-SYNTAX-DEFINITION being shared with
+MAP-SYNTAX-DEFINITION, and as such subject to modification, one of the
+common downsides of dynamic scope."
+      (nsublis
+       '((syntax-table . #:syntax-table)
+	 (m-s-function . #:function)
+	 (range . #:range)
+	 (key . #:key)
+	 (value . #:value))
+       map-syntax-definition)))
+ (defun map-syntax-table (m-s-function syntax-table &optional range)
+   "Map FUNCTION over entries in SYNTAX-TABLE, collapsing inheritance.
 This is similar to `map-char-table', but works only on syntax tables, and
  collapses any entries that call for inheritance by invisibly substituting
  the inherited values from the standard syntax table."
-  (check-argument-type 'syntax-table-p __syntax_table)
-  (map-char-table #'(lambda (__key __value)
-		      (if (eq ?@ (char-syntax-from-code __value))
-			  (map-char-table #'(lambda (__key __value)
-					      (funcall __function
-						       __key __value))
-					  (standard-syntax-table)
-					  __key)
-			(funcall __function __key __value)))
-		  __syntax_table __range))
+   (check-argument-type 'syntax-table-p syntax-table)
+   (map-char-table #'(lambda (key value)
+		       (if (eq ?@ (char-syntax-from-code value))
+			   (map-char-table
+			    #'(lambda (key value)
+				(funcall m-s-function key value))
+			    (standard-syntax-table)
+			    key)
+			 (funcall m-s-function key value)))
+		   syntax-table range)))
 
 ;(defun test-xm ()
 ;  (let ((o (copy-syntax-table))
--- a/lisp/unicode.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/unicode.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-;;; unicode.el --- Unicode support -*- coding: iso-2022-7bit; -*-
+;;; unicode.el --- Unicode support -*- coding: utf-8; -*-
 
 ;; Copyright (C) 2001, 2002 Ben Wing.
 
@@ -154,7 +154,7 @@
       '(ascii control-1 latin-iso8859-1 latin-iso8859-2 latin-iso8859-15
 	greek-iso8859-7 hebrew-iso8859-8 ipa cyrillic-iso8859-5
 	latin-iso8859-16 latin-iso8859-3 latin-iso8859-4 latin-iso8859-9
-	vietnamese-viscii-lower vietnamese-viscii-upper 
+	vietnamese-viscii-lower vietnamese-viscii-upper arabic-iso8859-6
 	jit-ucs-charset-0 japanese-jisx0208 japanese-jisx0208-1978
 	japanese-jisx0212 japanese-jisx0213-1 japanese-jisx0213-2
 	chinese-gb2312 chinese-sisheng chinese-big5-1 chinese-big5-2
@@ -333,33 +333,14 @@
 supported.  "
    unicode-type ucs-4 little-endian t))
 
-(make-coding-system
- 'utf-8 'unicode
- "UTF-8"
- '(mnemonic "UTF8"
-   documentation "
-UTF-8 Unicode encoding -- ASCII-compatible 8-bit variable-width encoding
-sharing the following principles with the Mule-internal encoding:
-
-  -- All ASCII characters (codepoints 0 through 127) are represented
-     by themselves (i.e. using one byte, with the same value as the
-     ASCII codepoint), and these bytes are disjoint from bytes
-     representing non-ASCII characters.
+;; Now defined in unicode.c.
 
-     This means that any 8-bit clean application can safely process
-     UTF-8-encoded text as it were ASCII, with no corruption (e.g. a
-     '/' byte is always a slash character, never the second byte of
-     some other character, as with Big5, so a pathname encoded in
-     UTF-8 can safely be split up into components and reassembled
-     again using standard ASCII processes).
-
-  -- Leading bytes and non-leading bytes in the encoding of a
-     character are disjoint, so moving backwards is easy.
-
-  -- Given only the leading byte, you know how many following bytes
-     are present.
-"
-   unicode-type utf-8))
+;;(make-coding-system
+;; 'utf-8 'unicode
+;; "UTF-8"
+;; '(mnemonic "UTF8"
+;;   documentation "..."
+;;   unicode-type utf-8))
 
 (make-coding-system
  'utf-8-bom 'unicode
@@ -443,14 +424,14 @@
        (#x2534 ?|) ;; U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL
        (#x253c ?|) ;; U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
        (#x02da ?^) ;; U+02DA RING ABOVE
-       (#x2122 ?\xa9) ;; U+2122 TRADE MARK SIGN, ?,A)(B
+       (#x2122 ?\xa9) ;; U+2122 TRADE MARK SIGN, ?©
 
-       (#x0132 ?\xe6) ;; U+0132 LATIN CAPITAL LIGATURE IJ, ?,Af(B
-       (#x013f ?\xe6) ;; U+013F LATIN CAPITAL LETTER L WITH MIDDLE DOT, ?,Af(B
+       (#x0132 ?\xe6) ;; U+0132 LATIN CAPITAL LIGATURE IJ, ?æ
+       (#x013f ?\xe6) ;; U+013F LATIN CAPITAL LETTER L WITH MIDDLE DOT, ?æ
 
-       (#x0133 ?\xe6) ;; U+0133 LATIN SMALL LIGATURE IJ, ?,Af(B
-       (#x0140 ?\xe6) ;; U+0140 LATIN SMALL LETTER L WITH MIDDLE DOT, ?,Af(B
-       (#x0149 ?\xe6) ;; U+0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPH,?,Af(B
+       (#x0133 ?\xe6) ;; U+0133 LATIN SMALL LIGATURE IJ, ?æ
+       (#x0140 ?\xe6) ;; U+0140 LATIN SMALL LETTER L WITH MIDDLE DOT, ?æ
+       (#x0149 ?\xe6) ;; U+0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPH,?æ
 
        (#x2194 ?|) ;; U+2194 LEFT RIGHT ARROW
        (#x2660 ?*) ;; U+2660 BLACK SPADE SUIT
@@ -459,12 +440,12 @@
        (#x2592 ?|) ;; U+2592 MEDIUM SHADE
        (#x2195 ?|) ;; U+2195 UP DOWN ARROW
 
-       (#x2113 ?\xb9) ;; U+2113 SCRIPT SMALL L, ?,A9(B
-       (#x215b ?\xbe) ;; U+215B VULGAR FRACTION ONE EIGHTH, ?,A>(B
-       (#x215c ?\xbe) ;; U+215C VULGAR FRACTION THREE EIGHTHS, ?,A>(B
-       (#x215d ?\xbe) ;; U+215D VULGAR FRACTION FIVE EIGHTHS, ?,A>(B
-       (#x215e ?\xbe) ;; U+215E VULGAR FRACTION SEVEN EIGHTHS, ?,A>(B
-       (#x207f ?\xbe) ;; U+207F SUPERSCRIPT LATIN SMALL LETTER N, ?,A>(B
+       (#x2113 ?\xb9) ;; U+2113 SCRIPT SMALL L, ?¹
+       (#x215b ?\xbe) ;; U+215B VULGAR FRACTION ONE EIGHTH, ?¾
+       (#x215c ?\xbe) ;; U+215C VULGAR FRACTION THREE EIGHTHS, ?¾
+       (#x215d ?\xbe) ;; U+215D VULGAR FRACTION FIVE EIGHTHS, ?¾
+       (#x215e ?\xbe) ;; U+215E VULGAR FRACTION SEVEN EIGHTHS, ?¾
+       (#x207f ?\xbe) ;; U+207F SUPERSCRIPT LATIN SMALL LETTER N, ?¾
   
        ;; These are not in WGL 4, but are IPA characters that should not
        ;; be double width. They are the only IPA characters that both
@@ -474,7 +455,7 @@
        (#x2197 ?|) ;; U+2197 NORTH EAST ARROW
        (#x2199 ?|) ;; U+2199 SOUTH WEST ARROW
        (#x2191 ?|) ;; U+2191 UPWARDS ARROW
-       (#x207f ?\xb9)) ;; U+207F SUPERSCRIPT LATIN SMALL LETTER N, ?,A9(B
+       (#x207f ?\xb9)) ;; U+207F SUPERSCRIPT LATIN SMALL LETTER N, ?¹
   with decoded = nil
   with syntax-table = (standard-syntax-table)
   initially (unless (featurep 'mule) (return))
--- a/lisp/update-elc.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/update-elc.el	Wed Feb 24 01:58:04 2010 -0600
@@ -382,7 +382,7 @@
 				(append '("-f" "batch-byte-compile-one-file")
 					(list arg))))
 			  bootstrap-other))))
-	     (mapc-internal
+	     (mapc
 	      #'(lambda (arg)
 		  (setq update-elc-files-to-compile
 			(delete arg update-elc-files-to-compile)))
--- a/lisp/version.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/version.el	Wed Feb 24 01:58:04 2010 -0600
@@ -152,9 +152,6 @@
   (save-current-buffer
     (set-buffer (get-buffer-create (generate-new-buffer-name
 				    " *temp*")))
-    ;; insert-file-contents-internal bogusly calls
-    ;; format-decode without checking if it's defined.
-    (fset 'format-decode #'(lambda (f l &optional v) l))
     (insert-file-contents-internal
      (expand-file-name "Installation" build-directory)
      ;; Relies on our working out the system coding system
@@ -164,7 +161,6 @@
      ;; mule/general-late.el, after all the dumped coding systems have been
      ;; loaded.
      'binary)
-    (fmakunbound 'format-decode)
     (prog1 (buffer-substring)
       (kill-buffer (current-buffer))))
   "Description of XEmacs installation.
@@ -175,4 +171,4 @@
 occasionally used, in a way the XEmacs developers don't endorse, to work out
 version information.  ")
 
-;;; version.el ends here
\ No newline at end of file
+;;; version.el ends here
--- a/lisp/x-faces.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/lisp/x-faces.el	Wed Feb 24 01:58:04 2010 -0600
@@ -646,55 +646,46 @@
 
 ;;; internal routines
 
-;;; x-init-face-from-resources is responsible for initializing a
-;;; newly-created face from the resource database.
+;;; x-init-face-from-resources is responsible for initializing a newly-created
+;;; face from the resource database.
 ;;;
-;;; When a new frame is created, it is called from `x-init-frame-faces'
-;;; called from `init-frame-faces' called from init_frame_faces()
-;;; from Fmake_frame().  In this case it is called once for each existing
-;;; face, with the newly-created frame as the argument.  It then initializes
-;;; the newly-created faces on that frame.
+;;; When a new frame is created, it is called from `x-init-frame-faces' called
+;;; from `init-frame-faces' called from init_frame_faces() from Fmake_frame(). 
+;;; In this case it is called once for each existing face, with the
+;;; newly-created frame as the argument. It then initializes the newly-created
+;;; faces on that frame.
 ;;;
-;;; It's also called from `init-device-faces' and
-;;; `init-global-faces'.
+;;; It's also called from `init-device-faces' and `init-global-faces'.
 ;;;
-;;; This had better not signal an error.  The frame is in an intermediate
-;;; state where signalling an error or entering the debugger would likely
-;;; result in a crash.
+;;; This had better not signal an error. The frame is in an intermediate state
+;;; where signalling an error or entering the debugger would likely result in
+;;; a crash.
 
-;; When we initialise a face from an X resource, note that we did so. 
-;;
-;; Now in specifier.el so run-time checks for it on non-X builds don't
-;; error.
-
-; (define-specifier-tag 'x-resource)
+;; When we initialise a face from an X resource, note that we did so. Now in
+;; specifier.el so run-time checks for it on non-X builds don't error.
+;; (define-specifier-tag 'x-resource)
 
 (defun x-init-face-from-resources (face &optional locale set-anyway)
+  ;; These are things like "attributeForeground" instead of simply
+  ;; "foreground" because people tend to do things like "*foreground", which
+  ;; would cause all faces to be fully qualified, making faces inherit
+  ;; attributes in a non-useful way. So we've made them slightly less obvious
+  ;; to specify in order to make them work correctly in more random
+  ;; environments.
 
-  ;;
-  ;; These are things like "attributeForeground" instead of simply
-  ;; "foreground" because people tend to do things like "*foreground",
-  ;; which would cause all faces to be fully qualified, making faces
-  ;; inherit attributes in a non-useful way.  So we've made them slightly
-  ;; less obvious to specify in order to make them work correctly in
-  ;; more random environments.
-  ;;
   ;; I think these should be called "face.faceForeground" instead of
-  ;; "face.attributeForeground", but they're the way they are for
-  ;; hysterical reasons. (jwz)
-
+  ;; "face.attributeForeground", but they're the way they are for hysterical
+  ;; reasons. (jwz)
   (let* ((append (if set-anyway nil 'append))
-	 ;; Some faces are initialized before XEmacs is dumped.
-	 ;; In order for the X resources to be able to override
-	 ;; those settings, such initialization always uses the
-	 ;; `default' tag.  We remove all specifier specs
-	 ;; containing the `default' tag in the locale before
+	 ;; Some faces are initialized before XEmacs is dumped. In order for
+	 ;; the X resources to be able to override those settings, such
+	 ;; initialization always uses the `default' tag. We remove all
+	 ;; specifier specs containing the `default' tag in the locale before
 	 ;; adding new specs.
 	 (tag-set '(default))
-	 ;; The tag order matters here.  The spec removal
-	 ;; function uses the list cdrs.  We want to remove (x
-	 ;; default) and (default) specs, not (default x) and (x)
-	 ;; specs.
+	 ;; The tag order matters here. The spec removal function uses the
+	 ;; list cdrs. We want to remove (x default) and (default) specs, not
+	 ;; (default x) and (x) specs.
 	 (x-tag-set '(x default))
 	 (tty-tag-set '(tty default))
          (our-tag-set '(x x-resource))
@@ -725,10 +716,10 @@
 	       (concat name ".attributeStrikethru")
 	       "Face.AttributeStrikethru"
 	       'boolean locale))
-	 ;; we still resource for these TTY-only resources so that
-	 ;; you can specify resources for TTY frames/devices.  This is
-	 ;; useful when you start up your XEmacs on an X display and later
-	 ;; open some TTY frames.
+	 ;; we still resource for these TTY-only resources so that you can
+	 ;; specify resources for TTY frames/devices. This is useful when you
+	 ;; start up your XEmacs on an X display and later open some TTY
+	 ;; frames.
 	 (hp (x-get-resource-and-maybe-bogosity-check
 	      (concat name ".attributeHighlight")
 	      "Face.AttributeHighlight"
@@ -758,12 +749,10 @@
 	      tty-tag-set (cons device-class tty-tag-set)
               our-tag-set (cons device-class our-tag-set)))
 
-    ;;
-    ;; If this is the default face, then any unspecified properties should
-    ;; be defaulted from the global properties.  Can't do this for
+    ;; For the default and gui-element faces, some unspecified properties
+    ;; should be defaulted from the global properties. Can't do this for
     ;; frames or devices because then, common resource specs like
     ;; "*Foreground: black" will have unwanted effects.
-    ;;
     (if (and (or (eq (face-name face) 'default)
 		 (eq (face-name face) 'gui-element))
 	     (or (null locale) (eq locale 'global)))
@@ -776,35 +765,32 @@
 	  (or bg (setq bg (x-get-resource
 			   "background" "Background" 'string locale nil
 			   'warn)))))
-    ;;
+
     ;; "*cursorColor: foo" is equivalent to setting the background of the
     ;; text-cursor face.
-    ;;
     (if (and (eq (face-name face) 'text-cursor)
 	     (or (null locale) (eq locale 'global)))
 	(setq bg (or (x-get-resource
 		      "cursorColor" "CursorColor" 'string locale nil 'warn)
 		     bg)))
-    ;; #### should issue warnings?  I think this should be
-    ;; done when the instancing actually happens, but I'm not
-    ;; sure how it should actually be dealt with.
+    ;; #### NOTE: should issue warnings? I think this should be done when the
+    ;; instancing actually happens, but I'm not sure how it should actually be
+    ;; dealt with.
     (when fn
       (if device-class
-	  ;; Always use the x-tag-set to remove specs, since we don't
-	  ;; know whether the predumped face was initialized with an
-	  ;; 'x tag or not.
+	  ;; Always use the x-tag-set to remove specs, since we don't know
+	  ;; whether the predumped face was initialized with an 'x tag or not.
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-font face)
 							locale
 							x-tag-set)
-	;; If there's no device class then we're initializing
-	;; globally.  This means we should override global
-	;; defaults for all X device classes.
+	;; If there's no device class then we're initializing globally. This
+	;; means we should override global defaults for all X device classes.
 	(remove-specifier (face-font face) locale x-tag-set nil))
       (set-face-font face fn locale our-tag-set append)
 
-      ;; And retain some of the fallbacks in the generated default face,
-      ;; since we don't want to try andale-mono's ISO-10646-1 encoding for
-      ;; Amharic or Thai.
+      ;; And retain some of the fallbacks in the generated default face, since
+      ;; we don't want to try andale-mono's ISO-10646-1 encoding for Amharic
+      ;; or Thai.
       (when (and (specifierp (face-font face))
                  (consp (specifier-fallback (face-font face))))
         (loop
@@ -817,9 +803,9 @@
                           (list (cons tag-set instantiator))))
               append))))
 		     
-    ;; Kludge-o-rooni.  Set the foreground and background resources for
-    ;; X devices only -- otherwise things tend to get all messed up
-    ;; if you start up an X frame and then later create a TTY frame.
+    ;; Kludge-o-rooni. Set the foreground and background resources for X
+    ;; devices only -- otherwise things tend to get all messed up if you start
+    ;; up an X frame and then later create a TTY frame.
     (when fg
       (if device-class
 	  (remove-specifier-specs-matching-tag-set-cdrs (face-foreground face)
@@ -905,118 +891,112 @@
     (remove-specifier specifier locale tag-set t)
     (setq tag-set (cdr tag-set))))
 
-;;; x-init-global-faces is responsible for ensuring that the
-;;; default face has some reasonable fallbacks if nothing else is
-;;; specified.
-;;;
+;;; x-init-global-faces is responsible for ensuring that the default face has
+;;; some reasonable fallbacks if nothing else is specified.
 (defun x-init-global-faces ()
-  (or (face-foreground 'default 'global)
-      (set-face-foreground 'default "black" 'global '(x default)))
-  (or (face-background 'default 'global)
-      (set-face-background 'default "gray80" 'global '(x default))))
+  ;; #### NOTE: this code is probably an oldy: faces.c ensures that we have
+  ;; working fallback values so there is no need to initialize anything here. 
+  ;; -- dvl
+  ;;   (or (face-foreground 'default 'global)
+  ;;       (set-face-foreground 'default "black" 'global '(x default)))
+  ;;   (or (face-background 'default 'global)
+  ;;       (set-face-background 'default "gray80" 'global '(x default))
+  )
 
-;;; x-init-device-faces is responsible for initializing default
-;;; values for faces on a newly created device.
-;;;
+;;; x-init-device-faces is responsible for initializing default values for
+;;; faces on a newly created device.
 (defun x-init-device-faces (device)
-  ;;
   ;; If the "default" face didn't have a font specified, try to pick one.
-  ;;
+
   ;; (or
   ;; (face-font-instance 'default device)
-  ;;
+
   ;; [[ No font specified in the resource database; try to cope. ]]
-  ;;
-  ;; NOTE: In reality, this will never happen.  The fallbacks will always
-  ;; be tried, and the last fallback is "*", which should get any font.  No
-  ;; need to put the same checks here as in the fallbacks.  These comments
+
+  ;; #### NOTE: In reality, this will never happen. The fallbacks will always
+  ;; be tried, and the last fallback is "*", which should get any font. No
+  ;; need to put the same checks here as in the fallbacks. These comments
   ;; appear to be pre-19.12. --ben
 
   ;; [[ At first I wanted to do this by just putting a font-spec in the
-  ;; fallback resources passed to XtAppInitialize(), but that fails
-  ;; if there is an Emacs app-defaults file which doesn't specify a
-  ;; font: apparently the fallback resources are not consulted when
-  ;; there is an app-defaults file, which seems pretty bogus to me.
-  ;;
-  ;; We should also probably try "*xtDefaultFont", but I think that it
-  ;; might be legal to specify that as "xtDefaultFont:", that is, at
-  ;; top level, instead of "*xtDefaultFont:", that is, applicable to
-  ;; every application.  `x-get-resource' can't handle that right now.
-  ;; Anyway, xtDefaultFont is probably variable-width.
-  ;;
-  ;; Some who have LucidaTypewriter think it's a better font than Courier,
-  ;; but it has the bug that there are no italic and bold italic versions.
-  ;; We could hair this code up to try and mix-and-match fonts to get a
-  ;; full complement, but really, why bother.  It's just a default. ]]
-  ;;
-  ;; [[ We default to looking for iso8859 fonts.  Using a wildcard for the
-  ;; encoding would be bad, because that can cause English speakers to get
-  ;; Kanji fonts by default.  It is safe to assume that people using a
-  ;; language other than English have both set $LANG, and have specified
-  ;; their `font' and `fontList' resources.  In any event, it's better to
-  ;; err on the side of the English speaker in this case because they are
-  ;; much less likely to have encountered this problem, and are thus less
-  ;; likely to know what to do about it. ]]
+  ;; fallback resources passed to XtAppInitialize(), but that fails if there
+  ;; is an Emacs app-defaults file which doesn't specify a font: apparently
+  ;; the fallback resources are not consulted when there is an app-defaults
+  ;; file, which seems pretty bogus to me.
+
+  ;; We should also probably try "*xtDefaultFont", but I think that it might
+  ;; be legal to specify that as "xtDefaultFont:", that is, at top level,
+  ;; instead of "*xtDefaultFont:", that is, applicable to every application. 
+  ;; `x-get-resource' can't handle that right now. Anyway, xtDefaultFont is
+  ;; probably variable-width.
+
+  ;; Some who have LucidaTypewriter think it's a better font than Courier, but
+  ;; it has the bug that there are no italic and bold italic versions. We
+  ;; could hair this code up to try and mix-and-match fonts to get a full
+  ;; complement, but really, why bother. It's just a default. ]]
 
+  ;; [[ We default to looking for iso8859 fonts. Using a wildcard for the
+  ;; encoding would be bad, because that can cause English speakers to get
+  ;; Kanji fonts by default. It is safe to assume that people using a language
+  ;; other than English have both set $LANG, and have specified their `font'
+  ;; and `fontList' resources. In any event, it's better to err on the side of
+  ;; the English speaker in this case because they are much less likely to
+  ;; have encountered this problem, and are thus less likely to know what to
+  ;; do about it. ]]
 
-  ;;
-  ;; If the "default" face didn't have both colors specified, then pick
-  ;; some, taking into account whether one of the colors was specified.
-  ;;
-  (let ((fg (face-foreground-instance 'default device))
-	(bg (face-background-instance 'default device)))
-    (if (not (and fg bg))
-	(if (or (and fg (equalp (color-instance-name fg) "white"))
-		(and bg (equalp (color-instance-name bg) "black")))
-	    (progn
-	      (or fg (set-face-foreground 'default "white" device))
-	      (or bg (set-face-background 'default "black" device)))
-	  (or fg (set-face-foreground 'default "white" device))
-	  (or bg (set-face-background 'default "black" device)))))
+  ;; #### NOTE: this code is probably an oldy as well (as per Ben's comment
+  ;; above): faces.c ensures that we have working fallback values so there is
+  ;; no need to initialize anything here. -- dvl
 
-  ;; Don't look at reverseVideo now or initialize the modeline.  This
-  ;; is done on a per-frame basis at the appropriate time.
+  ;;  (let ((fg (face-foreground-instance 'default device))
+  ;;	(bg (face-background-instance 'default device)))
+  ;;    (if (not (and fg bg))
+  ;;	(if (or (and fg (equalp (color-instance-name fg) "white"))
+  ;;		(and bg (equalp (color-instance-name bg) "black")))
+  ;;	    (progn
+  ;;	      (or fg (set-face-foreground 'default "white" device))
+  ;;	      (or bg (set-face-background 'default "black" device)))
+  ;;	  (or fg (set-face-foreground 'default "white" device))
+  ;;	  (or bg (set-face-background 'default "black" device)))))
+  
+  ;; Don't look at reverseVideo now or initialize the modeline. This is done
+  ;; on a per-frame basis at the appropriate time.
 
-  ;;
-  ;; Now let's try to pick some reasonable defaults for a few other faces.
-  ;; This kind of stuff should normally go on the create-frame-hook, but
-  ;; this way we won't be in danger of the user screwing things up by not
-  ;; adding hooks in a safe way.
-  ;;
+  ;; Now let's try to pick some reasonable defaults for a few other faces. 
+  ;; This kind of stuff should normally go on the create-frame-hook, but this
+  ;; way we won't be in danger of the user screwing things up by not adding
+  ;; hooks in a safe way.
   (x-init-pointer-shape device)  ; from x-mouse.el
     )
 
 ;;; This is called from `init-frame-faces', which is called from
-;;; init_frame_faces() which is called from Fmake_frame(), to perform
-;;; any device-specific initialization.
-;;;
+;;; init_frame_faces() which is called from Fmake_frame(), to perform any
+;;; device-specific initialization.
 (defun x-init-frame-faces (frame)
-  ;;
-  ;; The faces already got initialized (by init-frame-faces) from
-  ;; the resource database or global, non-frame faces.  The default,
-  ;; bold, bold-italic, and italic faces (plus various other random faces)
-  ;; got set up then.  But modeline didn't so that reverseVideo can be
-  ;; frame-specific.
-  ;;
+  ;; The faces already got initialized (by init-frame-faces) from the resource
+  ;; database or global, non-frame faces. The default, bold, bold-italic, and
+  ;; italic faces (plus various other random faces) got set up then. But
+  ;; modeline didn't so that reverseVideo can be frame-specific.
 
-  ;;
-  ;; If reverseVideo was specified, swap the foreground and background
-  ;; of the default and modeline faces.
-  ;;
+  ;; If reverseVideo was specified, swap the foreground and background of the
+  ;; default and modeline faces.
   (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame
 			      nil 'warn))
-	 ;; First make sure the modeline has fg and bg, inherited from the
-	 ;; current default face - for the case where only one is specified,
-	 ;; so that invert-face doesn't do something weird.
-	 (or (face-foreground 'modeline frame)
-	     (set-face-foreground 'modeline
-				  (face-foreground-instance 'default frame)
-				  frame))
-	 (or (face-background 'modeline frame)
-	     (set-face-background 'modeline
-				  (face-background-instance 'default frame)
-				  frame))
-	 ;; Now invert both of them.  If they end up looking the same,
+	 ;; #### NOTE: again, this is probably yet another oldy: faces.c
+	 ;; ensures sane fallbacks for the modeline face. Besides, this face
+	 ;; does not inherit from the default face, but from the gui-element
+	 ;; one.-- dvl
+
+	 ;;	 (or (face-foreground 'modeline frame)
+	 ;;	     (set-face-foreground 'modeline
+	 ;;				  (face-foreground-instance 'default frame)
+	 ;;				  frame))
+	 ;;	 (or (face-background 'modeline frame)
+	 ;;	     (set-face-background 'modeline
+	 ;;				  (face-background-instance 'default frame)
+	 ;;				  frame))
+
+	 ;; Now invert both of them. If they end up looking the same,
 	 ;; make-frame-initial-faces will invert the modeline again later.
 	 (invert-face 'default frame)
 	 (invert-face 'modeline frame)
--- a/lwlib/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,52 @@
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* xt-wrappers.h:
+	* xt-wrappers.h (Xt_SET_VALUE):
+	* xt-wrappers.h (Xt_GET_VALUE):
+	Rename var to avoid shadowing problems.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* xlwgauge.c (GaugeResize):
+	* xlwgauge.c (GaugeSize):
+	Fix warnings about possible use of uninitialized vars.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* lwlib-colors.c:
+	* lwlib-colors.h:
+	* lwlib-fonts.c:
+	* lwlib-fonts.h:
+	* xlwmenu.c:
+	* xlwmenu.c (xlwMenuResources):
+	* xlwmenu.c (x_xft_text_width):
+	* xlwmenu.c (label_button_draw):
+	* xlwmenu.c (push_button_size):
+	* xlwmenu.c (push_button_draw):
+	* xlwmenu.c (make_drawing_gcs):
+	* xlwmenu.c (extract_font_extents):
+	* xlwmenu.c (default_font_of_font_list):
+	* xlwmenu.c (XlwMenuInitialize):
+	* xlwmenu.c (XlwMenuDestroy):
+	* xlwmenu.c (XlwMenuSetValues):
+	* xlwmenuP.h:
+	* xlwmenuP.h (_XlwMenu_part):
+	* xlwtabs.c:
+	* xlwtabs.c (TabsInit):
+	* xlwtabs.c (TabsDestroy):
+	* xlwtabs.c (TabsSetValues):
+	* xlwtabs.c (DrawTab):
+	* xlwtabs.c (TabWidth):
+	* xlwtabs.c (TabsAllocFgGC):
+	* xlwtabs.c (TabsAllocGreyGC):
+	* xlwtabsP.h:
+	USE_XFT* -> HAVE_XFT*.
+
+2010-01-28  Jerry James  <james@xemacs.org>
+
+	* lwlib-internal.h: Add copyright and license boilerplate text
+	based on Ben's recollections.
+
 2009-12-09  Jerry James  <james@xemacs.org>
 
 	* lwlib-Xlw.c: Include needed Xmu headers instead of obsolete xmu.h.
--- a/lwlib/lwlib-colors.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/lwlib-colors.c	Wed Feb 24 01:58:04 2010 -0600
@@ -328,7 +328,7 @@
 #endif
 
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 
 XftColor
 xft_convert_color (Display *dpy, Colormap cmap, Visual *visual, int c, int dim)
@@ -356,6 +356,6 @@
   return result;
 }
 
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* end of lwlib-colors.c */
--- a/lwlib/lwlib-colors.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/lwlib-colors.h	Wed Feb 24 01:58:04 2010 -0600
@@ -39,7 +39,7 @@
 int x_allocate_nearest_color (Display *display, Colormap screen_colormap,
 			      Visual *visual, XColor *color_def);
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define _XFT_NO_COMPAT_
 /* shut up GCC */
 #define face_index face_index_arg
@@ -54,6 +54,6 @@
 
 XftColor xft_convert_color (Display *dpy, Colormap cmap, Visual *visual,
 			    int c, int dim);
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 #endif /* INCLUDED_lwlib_colors_h_ */
--- a/lwlib/lwlib-fonts.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/lwlib-fonts.c	Wed Feb 24 01:58:04 2010 -0600
@@ -45,7 +45,7 @@
  * code for handling Xft
  */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 
 /* helper function to correctly open Xft/core fonts by name
    #### Can't we use FcParseName here?
@@ -112,6 +112,6 @@
   return res;
 }
 
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* End of lwlib-fonts.c */
--- a/lwlib/lwlib-fonts.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/lwlib-fonts.h	Wed Feb 24 01:58:04 2010 -0600
@@ -29,7 +29,7 @@
 
 /* get headers */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define _XFT_NO_COMPAT_
 /* shut up GCC */
 #define face_index face_index_arg
@@ -41,11 +41,11 @@
 #if XFT_MAJOR < 2
 #error Xft versions < 2 not supported
 #endif
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* Xt name macros */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #ifndef XtNxftFont
 #define XtNxftFont "xftFont"
 #define XtCXftFont "XftFont"
@@ -54,16 +54,16 @@
 #define XtNfcFontName "fcFontName"
 #define XtCFcFontName "FcFontName"
 #endif
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 /* code 'n' stuff */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define FCSTRLEN 512
 
 /* non-Lisp prototypes */
 /* #### change this back to _open_name */
 XftFont *xft_open_font_by_name (Display *dpy, char *name);
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 #endif /* INCLUDED_lwlib_fonts_h_ */
--- a/lwlib/lwlib-internal.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/lwlib-internal.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,24 @@
+/* Implementation-specific definitions for the Lucid Widget Library.
+   Copyright (C) 1992 Lucid, Inc.
+   Copyright (C) 2000 Ben Wing.
+
+This file is part of the Lucid Widget Library.
+
+The Lucid Widget Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+The Lucid Widget Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 #ifndef INCLUDED_lwlib_internal_h_
 #define INCLUDED_lwlib_internal_h_
 
--- a/lwlib/xlwgauge.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/xlwgauge.c	Wed Feb 24 01:58:04 2010 -0600
@@ -314,7 +314,7 @@
 
 	if( gw->gauge.nlabels > 1 )
 	{
-	  Dimension	lwm, lw0, lw1 ;	/* width of max, left, right labels */
+	  Dimension	lwm, lw0=0, lw1 ;/* width of max, left, right labels */
 	  Dimension	lh ;
 
 	  MaxLabel(gw,&lwm,&lh, &lw0,&lw1) ;
@@ -1017,7 +1017,7 @@
 	 */
 	if( gw->gauge.nlabels > 0 )
 	{
-	  Dimension	lwm, lw0, lw1 ;	/* width of max, left, right labels */
+	  Dimension	lwm, lw0=0, lw1 ;/* width of max, left, right labels */
 	  Dimension	lh ;
 
 	  MaxLabel(gw,&lwm,&lh, &lw0,&lw1) ;
--- a/lwlib/xlwmenu.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/xlwmenu.c	Wed Feb 24 01:58:04 2010 -0600
@@ -46,7 +46,7 @@
 #endif /* XmVersion < 1.2 */
 #endif
 
-/* #### we may want to turn off USE_XFT here if !USE_XFT_MENUBARS
+/* #### we may want to turn off HAVE_XFT here if !HAVE_XFT_MENUBARS
    In fact, maybe that's the right interface overall? */
 #include "lwlib-fonts.h"
 #include "lwlib-colors.h"
@@ -98,7 +98,7 @@
 #define pmres(name,cls,member) \
   Xt_RESOURCE (name, cls, XtRPixmap, Pixmap, offset(member), XtRImmediate, None)
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   /* There are three font list resources, so that we can accept either of
      the resources *fontList: or *font:, and so that we can tell the
      difference between them being specified, and being defaulted to a
@@ -113,7 +113,7 @@
 #else
   fontres (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, font,
 	   "XtDefaultFont"),
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   fontres (XtNfcFontName, XtCFcFontName, XtRString, String, fcFontName,
 	   "sans-serif-12:bold"),
   /* #### This needs to be fixed to give a proper type and converter for
@@ -191,7 +191,7 @@
 static void Drag  (Widget w, XEvent *ev, String *params, Cardinal *num_params);
 static void Select(Widget w, XEvent *ev, String *params, Cardinal *num_params);
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 static XFontStruct *default_font_of_font_list (XmFontList);
 #endif
 
@@ -330,14 +330,14 @@
 /* Size code */
 static int
 string_width (XlwMenuWidget mw,
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	      XmString s
 #else
 	      char *s
 #endif
 	      )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   Dimension width, height;
   XmStringExtent (mw->menu.font_list, s, &width, &height);
   return width;
@@ -347,7 +347,7 @@
   XmbTextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl);
   return rl.width;
 # else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XGlyphInfo glyphinfo;
   XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s,
 		   strlen (s), &glyphinfo);
@@ -384,21 +384,21 @@
 
 static int
 string_width_u (XlwMenuWidget mw,
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	      XmString string
 #else
 	      char *string
 #endif
 	      )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   Dimension width, height;
   XmString newstring;
 #else
 # ifdef USE_XFONTSET
   XRectangle ri, rl;
 # else /* ! USE_XFONTSET */
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XGlyphInfo glyphinfo;
 #else
   XCharStruct xcs;
@@ -411,7 +411,7 @@
   char *chars;
   int i, j;
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   chars = "";
   if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
     chars = "";
@@ -428,7 +428,7 @@
 	    newchars[j++] = chars[i];
   newchars[j] = '\0';
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   newstring = XmStringLtoRCreate (newchars, XmFONTLIST_DEFAULT_TAG);
   XmStringExtent (mw->menu.font_list, newstring, &width, &height);
   XmStringFree (newstring);
@@ -439,7 +439,7 @@
   XmbTextExtents (mw->menu.font_set, newchars, j, &ri, &rl);
   return rl.width;
 # else /* ! USE_XFONTSET */
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars,
 		   j, &glyphinfo);
   return glyphinfo.xOff;
@@ -613,7 +613,7 @@
   return result;
 }
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 
 static XmString
 resource_widget_value (XlwMenuWidget mw, widget_value *val)
@@ -764,7 +764,7 @@
 #define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
 		   ? ((unsigned long) (x)) : ((unsigned long) (y)))
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 static int
 x_xft_text_width (Display *dpy, XftFont *xft_font, char *run, int len)
 {
@@ -782,20 +782,20 @@
 string_draw (XlwMenuWidget mw,
 	     Window window,
 	     int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	     XftColor *color,
 	     XftColor *colorBg,
 #else
 	     GC gc,
 #endif
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	     XmString string
 #else
 	     char *string
 #endif
 )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XmStringDraw (XtDisplay (mw), window,
 		mw->menu.font_list,
 		string, gc,
@@ -805,7 +805,7 @@
 		0, /* ???? layout_direction */
 		0);
 #else
-# ifdef USE_XFT_MENUBARS
+# ifdef HAVE_XFT_MENUBARS
   Display *display = XtDisplay (mw);
   Visual *visual = DefaultVisualOfScreen (XtScreen (mw));
   Colormap cmap = mw->core.colormap;
@@ -828,7 +828,7 @@
   XDrawString (XtDisplay (mw), window, gc,
 	       x, y + mw->menu.font_ascent, string, strlen (string));
 #  endif /* USE_XFONTSET */
-# endif /* USE_XFT_MENUBARS */
+# endif /* HAVE_XFT_MENUBARS */
 #endif /* NEED_MOTIF */
 }
 
@@ -837,7 +837,7 @@
 	XlwMenuWidget mw,
 	Window window,
 	int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	XftColor *color,
 	XftColor *colorBg,
 #else
@@ -848,7 +848,7 @@
 	int end
 )
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	Dimension width, height;
 	XmString newstring;
 	int c;
@@ -885,7 +885,7 @@
 		mw->menu.font_set, &string[start], end - start, &ri, &rl);
 	return rl.width;
 # else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	if (end <= start)
 		return 0;
 	else
@@ -937,12 +937,12 @@
 string_draw_u (XlwMenuWidget mw,
 	       Window window,
 	       int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	       XftColor *color, XftColor *colorBg, GC gc,
 #else
 	       GC gc,
 #endif
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 	       XmString string
 #else
 	       char *string
@@ -952,7 +952,7 @@
   int i, s = 0;
   char *chars;
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   chars = "";
   if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
     chars = "";
@@ -963,7 +963,7 @@
       if (chars[i] == '%' && chars[i+1] == '_') {
 	  int w;
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  x += string_draw_range (mw, window, x, y, color, colorBg, chars, s, i);
 	  w = string_draw_range (mw, window, x, y, color, colorBg, chars, i+2, i+3);
 #else
@@ -980,19 +980,19 @@
 	  i += 2;
       }
   }
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   x += string_draw_range (mw, window, x, y, color, colorBg, chars, s, i);
 #else
   x += string_draw_range (mw, window, x, y, gc, chars, s, i);
 #endif
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XtFree (chars);
 #endif
 }
 
 static void /* XXX */
 binding_draw (XlwMenuWidget mw, Window w, int x, int y,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	      XftColor *color,
 	      XftColor *colorBg,
 #else
@@ -1000,12 +1000,12 @@
 #endif
 	      char *value)
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XmString xm_value = XmStringCreateLtoR(value, XmSTRING_DEFAULT_CHARSET);
   string_draw (mw, w, x, y, gc, xm_value);
   XmStringFree (xm_value);
 #else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   string_draw (mw, w, x, y, color, colorBg, value);
 #else
   string_draw (mw, w, x, y, gc, value);
@@ -1652,7 +1652,7 @@
   int y_offset = mw->menu.shadow_thickness + mw->menu.vertical_margin;
   GC gc;
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftColor color, colorBg;
   Display *display = XtDisplay (mw);
   Colormap cmap = mw->core.colormap;
@@ -1667,7 +1667,7 @@
 
   if (highlighted && (in_menubar || val->contents)) 
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.highlight_foreground;
       pixelBg = mw->core.background_pixel;
 #endif
@@ -1675,7 +1675,7 @@
     }
   else if (in_menubar || val->contents)
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.foreground;
       pixelBg = mw->core.background_pixel;
 #endif
@@ -1683,13 +1683,13 @@
     }
   else
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.title_foreground;
       pixelBg = mw->core.background_pixel;
 #endif
       gc = mw->menu.title_gc;
     }
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   color = xft_convert_color (display, cmap, visual, pixel, 0);
   colorBg = xft_convert_color (display, cmap, visual, pixelBg, 0);
 #endif
@@ -1698,7 +1698,7 @@
   string_draw_u (mw,    /* XXX */
 		 window,
 		 x + label_offset, y + y_offset,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 		 &color, &colorBg, gc,
 #else
 	       gc,
@@ -1724,7 +1724,7 @@
   if (!in_menubar && val->key)
     {
       int w;
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
       XmString key = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET);
       w = string_width (mw, key);
       XmStringFree (key);
@@ -1753,7 +1753,7 @@
   shadow_type type;
   Boolean menu_pb = in_menubar && (menu_item_type (val) == BUTTON_TYPE);
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftColor color, colorBg;
   Display *display = XtDisplay (mw);
   Colormap cmap = mw->core.colormap;
@@ -1771,7 +1771,7 @@
     {
       if (val->enabled)
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       pixel = mw->menu.highlight_foreground;
       pixelBg = mw->core.background_pixel;
 #endif
@@ -1779,7 +1779,7 @@
     }
       else
     {
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       dim = 1;
       pixel = mw->menu.foreground;
       pixelBg = mw->core.background_pixel;
@@ -1791,7 +1791,7 @@
     {
       if (val->enabled)
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  pixel = mw->menu.button_foreground;
 	  pixelBg = mw->core.background_pixel;
 #endif
@@ -1799,7 +1799,7 @@
 	}
       else
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  dim = 1;
 	  pixel = mw->menu.button_foreground;
 	  pixelBg = mw->core.background_pixel;
@@ -1811,7 +1811,7 @@
     {
       if (val->enabled)
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  pixel = mw->menu.foreground;
 	  pixelBg = mw->core.background_pixel;
 #endif
@@ -1819,7 +1819,7 @@
 	}
       else
 	{
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 	  dim = 1;
 	  pixel = mw->menu.foreground;
 	  pixelBg = mw->core.background_pixel;
@@ -1828,7 +1828,7 @@
 	}
     }
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   color = xft_convert_color (display, cmap, visual, pixel, dim);
   colorBg = xft_convert_color (display, cmap, visual, pixelBg, 0);
 #endif
@@ -1836,7 +1836,7 @@
   string_draw_u (mw,
 		 window,
 		 x + label_offset, y + y_offset,
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 		 &color, &colorBg, gc,
 #else
 		 gc,
@@ -1855,7 +1855,7 @@
       binding_draw (mw, window,
 		    x + binding_offset + mw->menu.column_spacing,
 		    y + y_offset, 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 		    &color, &colorBg,
 #else
 		    gc,
@@ -2806,16 +2806,16 @@
 make_drawing_gcs (XlwMenuWidget mw)
 {
   XGCValues xgcv;
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   unsigned long flags = (GCForeground | GCBackground);
 #else
   unsigned long flags = (GCFont | GCForeground | GCBackground);
 #endif
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   xgcv.font = default_font_of_font_list (mw->menu.font_list)->fid;
 #else
-#ifndef USE_XFT_MENUBARS
+#ifndef HAVE_XFT_MENUBARS
   xgcv.font = mw->menu.font->fid;
 #endif
 #endif
@@ -3064,7 +3064,7 @@
 static void
 extract_font_extents (XlwMenuWidget mw)
 {
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   /* Find the maximal ascent/descent of the fonts in the font list
      so that all menu items can be the same height... */
   mw->menu.font_ascent  = 0;
@@ -3149,7 +3149,7 @@
           mw->menu.font_descent = font->descent;
   }
 # else /* ! USE_XFONTSET */
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   mw->menu.font_ascent  = mw->menu.renderFont->ascent;
   mw->menu.font_descent = mw->menu.renderFont->descent;
 #else
@@ -3160,7 +3160,7 @@
 #endif /* NEED_MOTIF */
 }
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
 static XFontStruct *
 default_font_of_font_list (XmFontList font_list)
 {
@@ -3230,7 +3230,7 @@
     XCreatePixmapFromBitmapData (display, window, (char *) gray_bits,
 				 gray_width, gray_height, 1, 0, 1);
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   /* #### Even if it's a kludge!!!, we should consider doing the same for
      X Font Sets. */
   /* The menu.font_list slot came from the *fontList resource (Motif standard.)
@@ -3252,7 +3252,7 @@
     mw->menu.font_list = mw->menu.fallback_font_list;
 #endif
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   /* #### kludge for name change */
   if (!mw->menu.fcFontName)
     mw->menu.fcFontName = mw->menu.xftFontName;
@@ -3363,7 +3363,7 @@
   XFreePixmap (XtDisplay (mw), mw->menu.gray_pixmap);
   mw->menu.gray_pixmap = (Pixmap) -1;
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   XftFontClose (XtDisplay (mw), mw->menu.renderFont);
 #endif
 
@@ -3409,12 +3409,12 @@
   if (newmw->core.background_pixel != oldmw->core.background_pixel
       || newmw->menu.foreground != oldmw->menu.foreground
       /* For the XEditResource protocol, which may want to change the font. */
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
       || newmw->menu.font_list          != oldmw->menu.font_list
       || newmw->menu.font_list_2        != oldmw->menu.font_list_2
       || newmw->menu.fallback_font_list != oldmw->menu.fallback_font_list
 #else
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
       || newmw->menu.renderFont != oldmw->menu.renderFont
 #else
       || newmw->menu.font != oldmw->menu.font
--- a/lwlib/xlwmenuP.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/xlwmenuP.h	Wed Feb 24 01:58:04 2010 -0600
@@ -4,7 +4,7 @@
 #include "xlwmenu.h"
 #include <X11/CoreP.h>
 
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 #include <X11/Xft/Xft.h>
 #endif
 
@@ -27,13 +27,13 @@
 {
   /* slots set by the resources */
 
-#if defined(NEED_MOTIF) && !defined(USE_XFT_MENUBARS)
+#if defined(NEED_MOTIF) && !defined(HAVE_XFT_MENUBARS)
   XmFontList	font_list;
   XmFontList	font_list_2;
   XmFontList	fallback_font_list;
 #else
   XFontStruct *	font;
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
   String fcFontName;
   String xftFontName;
   XftFont *renderFont;
@@ -57,7 +57,7 @@
   Pixel 	top_shadow_color;
   Pixel 	bottom_shadow_color;
   Pixel 	select_color;
-#ifdef USE_XFT_MENUBARS
+#ifdef HAVE_XFT_MENUBARS
 #endif
   Pixmap	top_shadow_pixmap;
   Pixmap	bottom_shadow_pixmap;
--- a/lwlib/xlwtabs.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/xlwtabs.c	Wed Feb 24 01:58:04 2010 -0600
@@ -152,7 +152,7 @@
        selectInsensitive,  XtRImmediate, True),
   res (XtNfont, XtCFont, XtRFontStruct, XFontStruct *, 
        font,  XtRString, XtDefaultFont),
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
   /* #### Maybe use "-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1" here?
      or XtDefaultFont? */
   res (XtNfcFontName, XtCFcFontName, XtRString, String,
@@ -430,7 +430,7 @@
 
 static int debug_tabs = 0;	/* increase for more verbosity */
 
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 /* #### duplicated from xlwmenu.c -- CLEAN THIS SHIT UP!
    Undeclared so define at top. */
 #define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
@@ -484,7 +484,7 @@
      */
     newTw->tabs.tab_height = 2 * newTw->tabs.internalHeight + SHADWID ;
 
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
     /* #### kludge for name change */
     if (!newTw->tabs.fcFontName)
       newTw->tabs.fcFontName = newTw->tabs.xftFontName;
@@ -501,11 +501,11 @@
       newTw->tabs.tab_height += newTw->tabs.renderFont->ascent +
 				newTw->tabs.renderFont->descent;
 #endif /* XFT_USE_HEIGHT_NOT_ASCENT_DESCENT */
-#else  /* ! USE_XFT_TABS */
+#else  /* ! HAVE_XFT_TABS */
     if (newTw->tabs.font != NULL)
       newTw->tabs.tab_height += newTw->tabs.font->max_bounds.ascent +
 				newTw->tabs.font->max_bounds.descent;
-#endif /* ! USE_XFT_TABS */
+#endif /* ! HAVE_XFT_TABS */
 
     /* if size not explicitly set, set it to our preferred size now. */
 
@@ -579,9 +579,9 @@
 TabsDestroy(Widget w)
 {
 	TabsWidget tw = (TabsWidget) w;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	XftFontClose (XtDisplay (w), tw->tabs.renderFont);
-#endif /* ! USE_XFT_TABS */
+#endif /* ! HAVE_XFT_TABS */
 	TabsFreeGCs (tw) ;
 }
 
@@ -684,7 +684,7 @@
 	int	i ;
 
 	if(
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
             tw->tabs.renderFont != curtw->tabs.renderFont  ||
 #else
 	    tw->tabs.font != curtw->tabs.font  ||
@@ -694,7 +694,7 @@
 	{
 	  tw->tabs.tab_height = 2 * tw->tabs.internalHeight + SHADWID;
 
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  if (tw->tabs.renderFont != NULL)
 #if XFT_USE_HEIGHT_NOT_ASCENT_DESCENT
 	    tw->tabs.tab_height += tw->tabs.renderFont->height;
@@ -702,11 +702,11 @@
 	    tw->tabs.tab_height += tw->tabs.renderFont->ascent +
 				   tw->tabs.renderFont->descent;
 #endif /* XFT_USE_HEIGHT_NOT_ASCENT_DESCENT */
-#else  /* ! USE_XFT_TABS */
+#else  /* ! HAVE_XFT_TABS */
 	  if (tw->tabs.font != NULL)
 	    tw->tabs.tab_height += tw->tabs.font->max_bounds.ascent +
 				   tw->tabs.font->max_bounds.descent;
-#endif /* ! USE_XFT_TABS */
+#endif /* ! HAVE_XFT_TABS */
 
 	  /* Tab size has changed.  Resize all tabs and request a new size */
 	  for(i=0, childP=tw->composite.children;
@@ -723,7 +723,7 @@
 
 	if( tw->core.background_pixel != curtw->core.background_pixel ||
 	    tw->core.background_pixmap != curtw->core.background_pixmap ||
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	    tw->tabs.renderFont != curtw->tabs.renderFont
 #else
 	    tw->tabs.font != curtw->tabs.font
@@ -1644,7 +1644,7 @@
 	  Window	win = XtWindow((Widget)tw) ;
 	  String	lbl = tab->tabs.label != NULL ?
 			      tab->tabs.label : XtName(child) ;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  XftColor color;
 	  XftColor colorBG;
 	  Colormap cmap = tw->core.colormap;
@@ -1662,7 +1662,7 @@
 	  if (XtIsSensitive(child))
 	  {
 	    gc = tw->tabs.foregroundGC;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	    color = xft_convert_color (dpy, cmap, visual,
 				       tab->tabs.foreground, 0);
 #else
@@ -1684,7 +1684,7 @@
 	      tab->tabs.greyAlloc = True;
 	    }
 	    gc = tw->tabs.greyGC;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	    color = xft_convert_color (dpy, cmap, visual, tab->tabs.grey, 0);
 #else
 	    XSetForeground(dpy, gc, tab->tabs.grey);
@@ -1709,14 +1709,14 @@
 	  }
 
 	  if (lbl != NULL &&
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      tw->tabs.renderFont != NULL
 #else
 	      tw->tabs.font != NULL
 #endif
 	      )
 	    {
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      XftDraw *xftDraw = XftDrawCreate (dpy, win, visual, cmap);
 	      XftFont *renderFont = tw->tabs.renderFont;
 	      XGlyphInfo glyphinfo;
@@ -1984,7 +1984,7 @@
 	TabsWidget	tw = (TabsWidget)XtParent(w) ;
 	String		lbl = tab->tabs.label != NULL ?
 				tab->tabs.label : XtName(w);
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	XftFont		*font = tw->tabs.renderFont;
 #else
 	XFontStruct	*font = tw->tabs.font;
@@ -2003,7 +2003,7 @@
 
 	if( lbl != NULL && font != NULL )
 	{
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  tab->tabs.width += x_xft_text_width (XtDisplay(tw), font,
 					       (FcChar8 *) lbl,
 					       (int)strlen(lbl)) + iw;
@@ -2444,7 +2444,7 @@
 
 	values.background = tw->core.background_pixel;
 	values.font =
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  None;
 #else
 	  tw->tabs.font->fid;
@@ -2454,13 +2454,13 @@
 
 	tw->tabs.foregroundGC =
 	  XtAllocateGC(w, w->core.depth,
-#ifndef USE_XFT_TABS
+#ifndef HAVE_XFT_TABS
 		       GCFont|
 #endif
 		       GCBackground|GCLineStyle,
 		       &values,
 		       GCForeground,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 		       GCFont|
 #endif
 		       GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
@@ -2475,7 +2475,7 @@
 
 	values.background = tw->core.background_pixel;
 	values.font =
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	  None;
 #else
 	  tw->tabs.font->fid;
@@ -2488,12 +2488,12 @@
 
 	  tw->tabs.greyGC =
 	    XtAllocateGC(w, w->core.depth,
-#ifndef USE_XFT_TABS
+#ifndef HAVE_XFT_TABS
 	      GCFont|
 #endif
 	      GCBackground|GCStipple|GCFillStyle, &values,
 	      GCForeground,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      GCFont|
 #endif
 	      GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
@@ -2503,14 +2503,14 @@
 	{
 	  tw->tabs.greyGC =
 	    XtAllocateGC(w, w->core.depth,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      0L,
 #else
 	      GCFont,
 #endif
 	      &values,
 	      GCForeground,
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 	      GCFont|
 #endif
 	      GCBackground|GCSubwindowMode|GCGraphicsExposures|GCDashOffset|
--- a/lwlib/xlwtabsP.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/xlwtabsP.h	Wed Feb 24 01:58:04 2010 -0600
@@ -41,7 +41,7 @@
 #endif
 
 #include "xlwtabs.h"
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
 #include <X11/Xft/Xft.h>
 #endif
 
@@ -73,7 +73,7 @@
 typedef struct {
     /* resources */
     XFontStruct	*font ;
-#ifdef USE_XFT_TABS
+#ifdef HAVE_XFT_TABS
     XftFont	*renderFont;
     String	fcFontName;
     String	xftFontName;
--- a/lwlib/xt-wrappers.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/lwlib/xt-wrappers.h	Wed Feb 24 01:58:04 2010 -0600
@@ -89,15 +89,15 @@
 /* Convenience macros for getting/setting one resource value. */
 
 #define Xt_SET_VALUE(widget, resource, value) do {	\
-  Arg al;						\
-  Xt_SET_ARG (al, resource, value);			\
-  XtSetValues (widget, &al, 1);				\
+  Arg al__;						\
+  Xt_SET_ARG (al__, resource, value);			\
+  XtSetValues (widget, &al__, 1);			\
 } while (0)
 
 #define Xt_GET_VALUE(widget, resource, location) do {	\
-  Arg al;						\
-  Xt_SET_ARG (al, resource, location);			\
-  XtGetValues (widget, &al, 1);				\
+  Arg al__;						\
+  Xt_SET_ARG (al__, resource, location);		\
+  XtGetValues (widget, &al__, 1);			\
 } while (0)
 
 #endif /* INCLUDED_xt_wrappers_h_ */
--- a/man/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,198 @@
+2010-02-17  Jerry James  <james@xemacs.org>
+
+	* term.texi: Move to the eterm package.
+	* Makefile: Remove all rules relating to term.texi.
+
+2010-02-10  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* xemacs-faq.texi (Top): Update menu.
+	(Legacy Versions): Update next pointer.
+	(Bleeding Edge):
+	(Q11.0.1):
+	(Q11.0.2):
+	(Q11.0.3):
+	(Q11.0.4):
+	(Q11.0.5):
+	(Q11.1.1):
+	(Q11.2.1):
+	(Q11.2.2):
+	(Q11.2.3):
+	(Q11.2.4):
+	(Q11.2.5):
+	(Q11.2.6):
+	(Q11.2.7):
+	New nodes, describing repositories and VCS usage.
+
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* internals/internals.texi (How Lisp Objects Are Represented in C):
+	* internals/internals.texi (Allocation of Objects in XEmacs Lisp):
+	DEC Alpha is hardly the only 64-bit processor any more.
+	Also, ERROR_CHECK_TYPECHECK is now ERROR_CHECK_TYPES.
+
+2010-02-08  Jerry James  <james@xemacs.org>
+
+	* emodules.texi: Relicense as GPL v2 or later, using J. Kean
+	Johnston's blanket permission for such relicensing of his works.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* internals/internals.texi (A Summary of the Various XEmacs Modules):
+	* internals/internals.texi (Conversion to and from External Data):
+	* internals/internals.texi (General Guidelines for Writing Mule-Aware Code):
+	Correct names of files renamed common -> xlike.
+	Fix up outdated explanation of old-style DFC conversion macros.
+	Add a section on the different types of character and their uses,
+	taken from a long comment in lisp.h.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* internals/internals.texi (lrecords):
+	* internals/internals.texi (The DFC API):
+	* internals/internals.texi (Conversion to and from External Data):
+	* internals/internals.texi (Mule-izing Code):
+	* internals/internals.texi (Pervasive changes throughout XEmacs sources):
+	* internals/internals.texi (Ben's README):
+	* internals/internals.texi (Future Work -- Localized Text/Messages):
+	* emodules.texi (Defining Variables):
+	Rename:
+
+	write_c_string -> write_cistring
+	build_intstring -> build_istring
+	build_string -> build_cistring
+	build_ext_string -> build_extstring
+	make_ext_string -> make_extstring
+	buffer_insert_c_string -> buffer_insert_ascstring
+	intern_int -> intern_istring
+
+	See comment in src/ChangeLog about this.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* internals/internals.texi (Top):
+	* internals/internals.texi (Evaluation; Stack Frames; Bindings):
+	* internals/internals.texi (Ben's README):
+	* internals/internals.texi (Consoles; Devices; Frames; Windows):
+	* internals/internals.texi (Window Hierarchy):
+	* internals/internals.texi (The Window Object):
+	* internals/internals.texi (Modules for the Basic Displayable Lisp Objects):
+	* internals/internals.texi (Window-System Support):
+	* internals/internals.texi (Creating a Window-System Type):
+	* internals/internals.texi (Discussion -- Garbage Collection):
+	Update the part at the top about how to maintain the file with
+	more tips.
+
+	Add a chapter on "window-system support" describing in a general
+	way how the support for different window systems/device types
+	works, including the separation between device-independent and
+	device-dependent parts, device methods, the specific device types
+	and the "xlike" pseudo-type.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* xemacs/programs.texi (Defuns): 
+	* lispref/variables.texi (Local Variables, Defining Variables)
+	(Setting Variables, Default Value):
+	* lispref/symbols.texi (Definitions): 
+	* lispref/searching.texi (Saving Match Data): 
+	* lispref/positions.texi (Excursions, Narrowing):
+	* lispref/objects.texi (Primitive Function Type): 
+	* lispref/macros.texi (Defining Macros, Backquote): 
+	* lispref/lispref.texi (Top): 
+	* lispref/intro.texi (A Sample Function Description):
+	* lispref/help.texi (Help Functions):
+	* lispref/functions.texi (What Is a Function, Simple Lambda)
+	(Defining Functions, Calling Functions, Anonymous Functions):
+	* lispref/frames.texi (Input Focus):
+	* lispref/eval.texi (Forms, Function Indirection)
+	(Special Operators, Quoting):
+	* lispref/edebug-inc.texi (Instrumenting)
+	(Specification Examples):
+	* lispref/debugging.texi (Internals of Debugger):
+	* lispref/control.texi (Control Structures, Sequencing):
+	(Conditionals, Combining Conditions, Iteration):
+	(Catch and Throw, Handling Errors):
+	* lispref/commands.texi (Defining Commands, Using Interactive):
+	Terminology change; special operator -> special form. 
+
+	Don't attempt to change this in texinfo.texi or cl.texi, which use
+	macros I don't understand.
+
+	* lispref/macros.texi (Defining Macros): Give an anonymous macro
+	example here. 
+	* lispref/positions.texi (Excursions):
+	Correct some documentation that called a couple of macros special
+	forms.
+	* lispref/searching.texi (Saving Match Data):
+	Drop some documentation of how to write code that works with Emacs
+	18.
+	* lispref/specifiers.texi (Adding Specifications):
+	Correct this; #'let-specifier is a macro, not a special operator.
+	* lispref/windows.texi (Window Configurations)
+	(Selecting Windows): 
+	Correct this, #'save-selected-window and #'save-window-excursion
+	are macros, not special operators.
+
+2010-01-28  Jerry James  <loganjerry@gmail.com>
+
+	* external-widget.texi: Add copyright and license boilerplate text
+	based on Ben's recollections.
+	* lispref/internationalization.texi (Documentation String Extraction):
+	Removed, as it refers to the obsolete make-po program.
+
+2010-01-23  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Generally: be careful to say fixnum, not integer, when talking
+	about fixed-precision integral types. I'm sure I've missed
+	instances, both here and in the docstrings, but this is a decent
+	start.
+
+	* lispref/text.texi (Columns): 
+	Document where only fixnums, not integers generally, are accepted.
+	(Registers):
+	Remove some ancient char-int confoundance here.
+	* lispref/strings.texi (Creating Strings, Creating Strings):
+	Be more exact in describing where fixnums but not integers in
+	general are accepted.
+	(Creating Strings): Use a more contemporary example to illustrate
+	how concat deals with lists including integers about #xFF.  Delete
+	some obsolete documentation on same.
+	(Char Table Types): Document that only fixnums are accepted as
+	values in syntax tables.
+	* lispref/searching.texi (String Search, Search and Replace):
+	Be exact in describing where fixnums but not integers in general
+	are accepted.
+	* lispref/range-tables.texi (Range Tables): Be exact in describing
+	them; only fixnums are accepted to describe ranges.
+	* lispref/os.texi (Killing XEmacs, User Identification)
+	(Time of Day, Time Conversion):
+	Be more exact about using fixnum where only fixed-precision
+	integers are accepted.
+	* lispref/objects.texi (Integer Type): Be more exact (and
+	up-to-date) about the possible values for
+	integers. Cross-reference to documentation of the bignum extension.
+	(Equality Predicates):
+	(Range Table Type):
+	(Array Type): Use fixnum, not integer, to describe a
+	fixed-precision integer.
+	(Syntax Table Type): Correct some English syntax here.
+	* lispref/numbers.texi (Numbers): Change the phrasing here to use
+	fixnum to mean the fixed-precision integers normal in emacs.
+	Document that our terminology deviates from that of Common Lisp,
+	and that we're working on it.
+	(Compatibility Issues): Reiterate the Common Lisp versus Emacs
+	Lisp compatibility issues.
+	(Comparison of Numbers, Arithmetic Operations):
+	* lispref/commands.texi (Command Loop Info, Working With Events): 
+	* lispref/buffers.texi (Modification Time): 
+	Be more exact in describing where fixnums but not integers in
+	general are accepted.
+
+2010-01-06  Jerry James  <james@xemacs.org>
+
+	* internals/internals.texi (Debugging and Testing): Document
+	valgrind configuration and use.
+
 2009-12-21  Jerry James  <james@xemacs.rg>
 
 	* internals/internals.texi (A Summary of the Various XEmacs Modules):
@@ -17,6 +212,14 @@
 	Remove references to xmu.c and xmu.h.
 	(Modules for Interfacing with X Windows): Ditto.
 
+2010-01-09  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* lispref/objects.texi (Hash Table Type):
+	* lispref/hash-tables.texi (Introduction to Hash Tables):
+	Use keywords, not ordinary symbols, in the hash table read syntax;
+	document that we do accept the ordinary symbols for the sake of
+	backward-compatiblity.
+
 2009-11-10  Jerry James  <james@xemacs.org>
 
 	* internals/internals.texi (XEmacs from the Perspective of Building):
@@ -33,6 +236,11 @@
 	* xemacs-faq.texi (Q1.2.2: What versions of Unix does XEmacs run on?):
 	Ditto.
 
+2009-11-08  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* lispref/objects.texi (Equality Predicates): 
+	Document #'equalp here, as well as #'equal and #'eq. 
+
 2009-10-05  Jerry James  <james@xemacs.org>
 
 	* beta.texi (Building XEmacs from a full distribution): Remove
--- a/man/Makefile	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/Makefile	Wed Feb 24 01:58:04 2010 -0600
@@ -54,7 +54,6 @@
 	$(INFODIR)/lispref.info \
 	$(INFODIR)/new-users-guide.info \
 	$(INFODIR)/standards.info \
-	$(INFODIR)/term.info \
 	$(INFODIR)/termcap.info \
 	$(INFODIR)/texinfo.info \
 	$(INFODIR)/widget.info \
@@ -72,7 +71,6 @@
 	$(HTMLDIR)/internals.html \
 	$(HTMLDIR)/new-users-guide.html \
 	$(HTMLDIR)/standards.html \
-	$(HTMLDIR)/term.html \
 	$(HTMLDIR)/termcap.html \
 	$(HTMLDIR)/texinfo.html \
 	$(HTMLDIR)/widget.html \
@@ -90,7 +88,6 @@
 	internals.dvi \
 	new-users-guide.dvi \
 	standards.dvi \
-	term.dvi \
 	termcap.dvi \
 	texinfo.dvi \
 	widget.dvi \
@@ -108,7 +105,6 @@
        internals.pdf \
        new-users-guide.pdf \
        standards.pdf \
-       term.pdf \
        termcap.pdf \
        texinfo.pdf \
        widget.pdf \
@@ -264,9 +260,6 @@
 $(INFODIR)/standards.info : standards.texi
 	$(MAKEINFO) -o $(INFODIR)/standards.info standards.texi
 
-$(INFODIR)/term.info : term.texi
-	$(MAKEINFO) -o $(INFODIR)/term.info term.texi
-
 $(INFODIR)/termcap.info : termcap.texi
 	$(MAKEINFO) -o $(INFODIR)/termcap.info termcap.texi
 
@@ -375,9 +368,6 @@
 $(HTMLDIR)/standards.html : standards.texi
 	$(TEXI2HTML_SPLIT) standards.texi
 
-$(HTMLDIR)/term.html : term.texi
-	$(TEXI2HTML_SPLIT) term.texi
-
 $(HTMLDIR)/termcap.html : termcap.texi
 	$(TEXI2HTML_SPLIT) termcap.texi
 
--- a/man/cl.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/cl.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -680,7 +680,7 @@
 (compile load eval) @dots{})}.
 @end defspec
 
-Emacs 19 includes two special forms related to @code{eval-when}.
+Emacs 19 includes two special operators related to @code{eval-when}.
 One of these, @code{eval-when-compile}, is not quite equivalent to
 any @code{eval-when} construct and is described below.  This package
 defines a version of @code{eval-when-compile} for the benefit of
@@ -990,7 +990,7 @@
 assignments are done in parallel rather than sequentially.
 
 @defspec psetq [symbol form]@dots{}
-This special form (actually a macro) is used to assign to several
+This macro is used to assign to several
 variables simultaneously.  Given only one @var{symbol} and @var{form},
 it has the same effect as @code{setq}.  Given several @var{symbol}
 and @var{form} pairs, it evaluates all the @var{form}s in advance
--- a/man/emodules.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/emodules.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -32,6 +32,8 @@
 @set emacs XEmacs
 @end ifclear
 
+@c TODO: Merge the info-only and TeX-only license text, since they are
+@c identical.
 @ifinfo
 This file documents the module loading technology of @value{emacs}.
 
@@ -41,35 +43,22 @@
 manual provided the copyright notice and this permission notice are
 preserved on all copies.
 
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission notice
-identical to this one except for the removal of this paragraph (this
-paragraph not being relevant to the printed manual).
+This file is part of XEmacs.
 
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
 
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation
-approved by the Foundation.
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
 
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included exactly as
-in the original, and provided that the entire resulting derived work is
-distributed under the terms of a permission notice identical to this
-one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA.
 @end ifinfo
 
 @c Combine indices.
@@ -97,22 +86,22 @@
 Version 1.0 @*
 September, 1998.@*
 
-Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
 
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included
-exactly as in the original, and provided that the entire resulting
-derived work is distributed under the terms of a permission notice
-identical to this one.
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
 
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that the section entitled ``GNU General Public License'' may be
-included in a translation approved by the Free Software Foundation
-instead of in the original English.
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA.
 @end titlepage
 @page
 
@@ -1058,7 +1047,7 @@
 */);
 
   sample_boolean = 0;
-  Vsample_string = build_string("My string");
+  Vsample_string = build_ascstring ("My string");
 @}
 @end cartouche
 @end example
--- a/man/external-widget.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/external-widget.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -7,6 +7,27 @@
 @direntry
 * External Widget: (external-widget).   External Client Widget.
 @end direntry
+
+This file describes the external client widget for XEmacs.
+
+Copyright @copyright{} 1993 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02110-1301, USA.
 @end ifinfo
 
 @node Top, Using an External Client Widget,, (dir)
--- a/man/internals/internals.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/internals/internals.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -129,13 +129,37 @@
 @end ifinfo
 
 @ignore
-Don't update this by hand!!!!!!
-Use C-u C-c C-u m (aka C-u M-x texinfo-master-list).
-NOTE: This command does not include the Index:: menu entry.
+Tips for maintaining this file:
+
+1. Updating the forward, back and up pointers in a @@node line:
+---------------------------------------------------------------
+
+Don't do it by hand!
+
+Use C-c C-u C-e (aka M-x texinfo-every-node-update).
+
+2. Updating the menus:
+----------------------
+
+This section describes how to update the menus at the end of chapters,
+sections with subsections, etc., and the master menu near the top of
+the file:
+
+Don't do it by hand!
+
+Use C-u C-c C-u m (aka C-u M-x texinfo-master-menu).
+N
+OTE: This command does not include the Index:: menu entry.
 You must add it by hand.
 
-Here are some useful Lisp routines for quickly Texinfo-izing text that
-has been formatted into ASCII lists and tables.
+3. Converting plain text into Texinfo:
+--------------------------------------
+
+3a. Here are some useful Lisp routines for quickly Texinfo-izing text
+    that has been formatted into ASCII lists and tables.
+
+Note: to define these routines, put point after the end of the definition
+and type C-x C-e.
 
 (defun list-to-texinfo (b e)
   "Convert the selected region from an ASCII list to a Texinfo list."
@@ -249,8 +273,8 @@
     (beginning-of-line)
     (insert "@end table\n")))
 
-A useful Lisp routine for adding markup based on conventions used in plain
-text files; see doc string below.
+3b. A useful Lisp routine for adding markup based on conventions used
+    in plain text files; see doc string below.
 
 (defun convert-text-to-texinfo (&optional no-narrow)
   "Convert text to Texinfo.
@@ -259,10 +283,10 @@
 in text: @code{} surrounded by ` and ' or followed by a (); @strong{}
 surrounded by *'s; @file{} something that looks like a file name."
   (interactive)
-  (if (region-active-p)
+  (if (and (not no-narrow) (region-active-p))
       (save-restriction
 	(narrow-to-region (region-beginning) (region-end))
-	(convert-comments-to-texinfo t))
+	(convert-text-to-texinfo t))
     (let ((p (point))
 	  (case-replace nil))
       (query-replace-regexp "`\\([^']+\\)'\\([^']\\)" "@code{\\1}\\2" nil)
@@ -274,31 +298,38 @@
       (query-replace-regexp "\\(\\(\\s_\\|\\sw\\)+\\.[A-Za-z]+\\)\\([^A-Za-z.}]\\)" "@file{\\1}\\3" nil)
       )))
 
-Macro the generate the "Future Work" section from a title; put
-point at beginning.
+4. Adding new sections:
+-----------------------
+
+NOTE: These are in the form of macros. #### FIXME Convert them to
+proper functions.  To edit these macros, define them and then use
+M-x edit-kbd-macro.
+
+Macro to generate the "Future Work" section from a title; put
+point at the beginning of the title.
 
 (defalias 'make-future (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> <home> <up> <C-right> <right> Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Future SPC Work SPC - - SPC <end> RET @cindex SPC future SPC work, SPC <f4> C-r , RET C-x C-x M-l RET @cindex SPC <f4> <home> <C-right> <S-end> M-l , SPC future SPC work RET"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y <home> <up> <C-right> <right> Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Future SPC Work SPC - - SPC <end> RET @cindex SPC future SPC work, SPC C-y C-r , RET C-x C-x M-l RET @cindex SPC C-y <home> <C-right> <S-end> M-l , SPC future SPC work RET"))
 
 Similar but generates a "Discussion" section.
 
 (defalias 'make-discussion (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> <home> <up> <C-right> <right> Discussion SPC - - SPC <home> <down> <C-right> <right> Discussion SPC - - SPC <end> RET @cindex SPC discussion, SPC <f4> C-r , RET C-x C-x M-l RET @cindex SPC <f4> <home> <C-right> <S-end> M-l , SPC discussion RET"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y <home> <up> <C-right> <right> Discussion SPC - - SPC <home> <down> <C-right> <right> Discussion SPC - - SPC <end> RET @cindex SPC discussion, SPC C-y C-r , RET C-x C-x M-l RET @cindex SPC C-y <home> <C-right> <S-end> M-l , SPC discussion RET"))
 
 Similar but generates an "Old Future Work" section.
 
 (defalias 'make-old-future (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> <home> <up> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <end> RET @cindex SPC old SPC future SPC work, SPC <f4> C-r , RET C-x C-x M-l RET @cindex SPC <f4> <home> <C-right> <S-end> M-l , SPC old SPC future SPC work RET"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y <home> <up> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <home> <down> <C-right> <right> Old SPC Future SPC Work SPC - - SPC <end> RET @cindex SPC old SPC future SPC work, SPC C-y C-r , RET C-x C-x M-l RET @cindex SPC C-y <home> <C-right> <S-end> M-l , SPC old SPC future SPC work RET"))
 
 Similar but generates a general section.
 
 (defalias 'make-section (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @section SPC <f4> RET @cindex SPC C-SPC C-g <f4> C-x C-x M-l <home> <down>"))
+"<S-end> M-w <home> @node SPC <end> RET @section SPC C-y RET @cindex SPC C-SPC C-g C-y C-x C-x M-l <home> <down>"))
 
 Similar but generates a general subsection.
 
 (defalias 'make-subsection (read-kbd-macro
-"<S-end> <f3> <home> @node SPC <end> RET @subsection SPC <f4> RET @cindex SPC C-SPC C-g <f4> C-x C-x M-l <home> <down>"))
+"<S-end> M-w <home> @node SPC <end> RET @subsection SPC C-y RET @cindex SPC C-SPC C-g C-y C-x C-x M-l <home> <down>"))
 @end ignore
 
 @menu
@@ -328,6 +359,7 @@
 * Text::                        
 * Multilingual Support::        
 * Consoles; Devices; Frames; Windows::  
+* Window-System Support::       
 * The Redisplay Mechanism::     
 * Extents::                     
 * Faces::                       
@@ -451,7 +483,7 @@
 
 * Evaluation::                  
 * Dynamic Binding; The specbinding Stack; Unwind-Protects::  
-* Simple Special Forms::        
+* Simple Special Operators::    
 * Catch and Throw::             
 * Error Trapping::              
 
@@ -558,9 +590,12 @@
 * Point::                       
 * Window Hierarchy::            
 * The Window Object::           
-* Creating a New Console/Device/Frame Type::  
 * Modules for the Basic Displayable Lisp Objects::  
 
+Window-System Support
+
+* Creating a Window-System Type::  
+
 The Redisplay Mechanism
 
 * Critical Redisplay Sections::  
@@ -740,8 +775,8 @@
 
 Discussion -- Garbage Collection
 
-* Discussion -- KKCC::
-* Discussion -- Incremental Collector::
+* Discussion -- KKCC::          
+* Discussion -- Incremental Collector::  
 * Discussion -- Pure Space::    
 * Discussion -- Hashtable-Based Marking and Cleanup::  
 * Discussion -- The Anti-Cons::  
@@ -3148,7 +3183,7 @@
 @item @file{scrollbar.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{scrollbar.h} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{search.c} @tab @ref{Modules for Standard Editing Operations}.
-@item @file{select-common.h} @tab
+@item @file{select-xlike-inc.c} @tab
 @item @file{select-gtk.c} @tab
 @item @file{select-msw.c} @tab @ref{Modules for Interfacing with X Windows}.
 @item @file{select-x.c} @tab @ref{Modules for Interfacing with X Windows}.
@@ -3194,8 +3229,8 @@
 @item @file{tests.c} @tab
 @item @file{text.c} @tab
 @item @file{text.h} @tab
-@item @file{toolbar-common.c} @tab
-@item @file{toolbar-common.h} @tab
+@item @file{toolbar-xlike.c} @tab
+@item @file{toolbar-xlike.h} @tab
 @item @file{toolbar-gtk.c} @tab
 @item @file{toolbar-msw.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
 @item @file{toolbar-x.c} @tab @ref{Modules for other Display-Related Lisp Objects}.
@@ -3518,7 +3553,7 @@
 This module contains all of the functions to handle the flow of control.
 This includes the mechanisms of defining functions, calling functions,
 traversing stack frames, and binding variables; the control primitives
-and other special forms such as @code{while}, @code{if}, @code{eval},
+and other special operators such as @code{while}, @code{if}, @code{eval},
 @code{let}, @code{and}, @code{or}, @code{progn}, etc.; handling of
 non-local exits, unwind-protects, and exception handlers; entering the
 debugger; methods for the subr Lisp object type; etc.  It does
@@ -5323,7 +5358,7 @@
 C macros.  The only way to really understand how to write new C code is
 to read the source, but we can explain some things here.
 
-An example of a special form is the definition of @code{prog1}, from
+An example of a special operator is the definition of @code{prog1}, from
 @file{eval.c}.  (An ordinary function would have the same general
 appearance.)
 
@@ -5404,7 +5439,7 @@
 @item max_args
 This is the maximum number of arguments that the function accepts, if
 there is a fixed maximum.  Alternatively, it can be @code{UNEVALLED},
-indicating a special form that receives unevaluated arguments, or
+indicating a special operator that receives unevaluated arguments, or
 @code{MANY}, indicating an unlimited number of evaluated arguments (the
 C equivalent of @code{&rest}).  Both @code{UNEVALLED} and @code{MANY}
 are macros.  If @var{max_args} is a number, it may not be less than
@@ -5457,7 +5492,7 @@
 or errors.
 
 A Lisp function with @w{@var{max_args} = @code{UNEVALLED}} is a
-@w{@dfn{special form}}; its arguments are not evaluated.  Instead it
+@w{@dfn{special operator}}; its arguments are not evaluated.  Instead it
 receives one argument of type @code{Lisp_Object}, a (Lisp) list of the
 unevaluated arguments, conventionally named @code{(args)}.
 
@@ -6225,6 +6260,13 @@
 temacs -batch -l loadup.el run-temacs @var{xemacs-args...}
 @end example
 
+@cindex Valgrind
+To make an XEmacs that can tell valgrind to do a memory leak check at
+runtime, configure @code{--with-valgrind}.  If XEmacs has been
+configured @code{--with-newgc}, then valgrind must be invoked with
+@code{--vex-iropt-precise-memory-exns=yes} in order to handle signals
+properly.
+
 @cindex error checking
 Before you go through the trouble, are you compiling with all
 debugging and error-checking off?  If not, try that first.  Be warned
@@ -7559,10 +7601,9 @@
 @cindex objects are represented in C, how Lisp
 @cindex represented in C, how Lisp objects are
 
-Lisp objects are represented in C using a 32-bit or 64-bit machine word
-(depending on the processor; i.e. DEC Alphas use 64-bit Lisp objects and
-most other processors use 32-bit Lisp objects).  The representation
-stuffs a pointer together with a tag, as follows:
+Lisp objects are represented in C using a 32-bit or 64-bit machine
+word (depending on the processor).  The representation stuffs a
+pointer together with a tag, as follows:
 
 @example
  [ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 ]
@@ -7582,18 +7623,17 @@
 
 Lisp objects use the typedef @code{Lisp_Object}, but the actual C type
 used for the Lisp object can vary.  It can be either a simple type
-(@code{long} on the DEC Alpha, @code{int} on other machines) or a
-structure whose fields are bit fields that line up properly (actually, a
-union of structures is used).  Generally the simple integral type is
-preferable because it ensures that the compiler will actually use a
-machine word to represent the object (some compilers will use more
-general and less efficient code for unions and structs even if they can
-fit in a machine word).  The union type, however, has the advantage of
-stricter type checking.  If you accidentally pass an integer where a Lisp
-object is desired, you get a compile error.  The choice of which type
-to use is determined by the preprocessor constant @code{USE_UNION_TYPE}
-which is defined via the @code{--use-union-type} option to
-@code{configure}.
+(generally @code{long}) or a structure whose fields are bit fields
+that line up properly (actually, a union of structures is used).
+Generally the simple integral type is preferable because it ensures
+that the compiler will actually use a machine word to represent the
+object (some compilers will use more general and less efficient code
+for unions and structs even if they can fit in a machine word).  The
+union type, however, has the advantage of stricter type checking.  If
+you accidentally pass an integer where a Lisp object is desired, you
+get a compile error.  The choice of which type to use is determined by
+the preprocessor constant @code{USE_UNION_TYPE} which is defined via
+the @code{--use-union-type} option to @code{configure}.
 
 Various macros are used to convert between Lisp_Objects and the
 corresponding C type.  Macros of the form @code{XINT()}, @code{XCHAR()},
@@ -7606,7 +7646,7 @@
 negative numbers) the shift to remove the tag bit is enough.  This is
 the case on all the systems we support.
 
-Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the converter
+Note that when @code{ERROR_CHECK_TYPES} is defined, the converter
 macros become more complicated---they check the tag bits and/or the
 type field in the first four bytes of a record type to ensure that the
 object is really of the correct type.  This is great for catching places
@@ -7623,7 +7663,7 @@
 can use the function @code{make_int()}, which constructs and
 @emph{returns} an integer Lisp object.  Note that the
 @code{XSET@var{TYPE}()} macros are also affected by
-@code{ERROR_CHECK_TYPECHECK} and make sure that the structure is of the
+@code{ERROR_CHECK_TYPES} and make sure that the structure is of the
 right type in the case of record types, where the type is contained in
 the structure.
 
@@ -7634,15 +7674,11 @@
 else use @code{Fcar()} and @code{Fcdr()}.  Trust other C code, but not
 Lisp code.  On the other hand, if XEmacs has an internal logic error,
 it's better to crash immediately, so sprinkle @code{assert()}s and
-``unreachable'' @code{abort()}s liberally about the source code.  Where
-performance is an issue, use @code{type_checking_assert},
-@code{bufpos_checking_assert}, and @code{gc_checking_assert}, which do
-nothing unless the corresponding configure error checking flag was
-specified.
-
-Note that in some cases @samp{assert}s will expand to nothing in a
-context where that produces an empty statement.  Some compilers will
-warn about this.
+``unreachable'' @code{abort()}s liberally about the source code.
+Where performance is an issue, use @code{type_checking_assert},
+@code{bufpos_checking_assert}, @code{gc_checking_assert}, and the
+like, which do nothing unless the corresponding configure error
+checking flag was specified.
 
 @node Allocation of Objects in XEmacs Lisp, The Lisp Reader and Compiler, How Lisp Objects Are Represented in C, Top
 @chapter Allocation of Objects in XEmacs Lisp
@@ -8636,7 +8672,7 @@
 Sub-objects are printed using @code{print_internal()}, which takes
 exactly the same arguments as are passed to the print method.
 
-Literal C strings should be printed using @code{write_c_string()},
+Literal C strings should be printed using @code{write_cistring()},
 or @code{write_string_1()} for non-null-terminated strings.
 
 Functions that do not have a readable representation should check the
@@ -8947,7 +8983,7 @@
 @menu
 * Evaluation::                  
 * Dynamic Binding; The specbinding Stack; Unwind-Protects::  
-* Simple Special Forms::        
+* Simple Special Operators::    
 * Catch and Throw::             
 * Error Trapping::              
 @end menu
@@ -9083,7 +9119,7 @@
 an array).  @code{apply1()} uses @code{Fapply()} while the others use
 @code{Ffuncall()} to do the real work.
 
-@node Dynamic Binding; The specbinding Stack; Unwind-Protects, Simple Special Forms, Evaluation, Evaluation; Stack Frames; Bindings
+@node Dynamic Binding; The specbinding Stack; Unwind-Protects, Simple Special Operators, Evaluation, Evaluation; Stack Frames; Bindings
 @section Dynamic Binding; The specbinding Stack; Unwind-Protects
 @cindex dynamic binding; the specbinding stack; unwind-protects
 @cindex binding; the specbinding stack; unwind-protects, dynamic
@@ -9141,9 +9177,10 @@
 the symbol's value).
 @end enumerate
 
-@node Simple Special Forms, Catch and Throw, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings
-@section Simple Special Forms
-@cindex special forms, simple
+@node Simple Special Operators, Catch and Throw, Dynamic Binding; The specbinding Stack; Unwind-Protects, Evaluation; Stack Frames; Bindings
+@section Simple Special Operators
+@cindex special operators, simple
+@cindex special forms
 
 @code{or}, @code{and}, @code{if}, @code{cond}, @code{progn},
 @code{prog1}, @code{prog2}, @code{setq}, @code{quote}, @code{function},
@@ -9159,7 +9196,7 @@
 compiler knows how to convert calls to these functions directly into
 byte code.
 
-@node Catch and Throw, Error Trapping, Simple Special Forms, Evaluation; Stack Frames; Bindings
+@node Catch and Throw, Error Trapping, Simple Special Operators, Evaluation; Stack Frames; Bindings
 @section Catch and Throw
 @cindex catch and throw
 @cindex throw, catch and
@@ -11795,7 +11832,7 @@
 of conversions involving raw data and/or Lisp strings, especially when
 the output is an @code{alloca()}ed string. (When the destination is a
 Lisp_String, there are other functions that should be used instead --
-@code{build_ext_string()} and @code{make_ext_string()}, for example.) The convenience
+@code{build_extstring()} and @code{make_extstring()}, for example.) The convenience
 macros are of two types -- the older kind that store the result into a
 specified variable, and the newer kind that return the result.  The newer
 kind of macros don't exist when the output is sized data, because that
@@ -12857,20 +12894,19 @@
 many types of conversions involving raw data and/or Lisp strings,
 especially when the output is an @code{alloca()}ed string. (When the
 destination is a Lisp string, there are other functions that should be
-used instead -- @code{build_ext_string()} and @code{make_ext_string()},
-for example.) The convenience macros are of two types -- the older kind
-that store the result into a specified variable, and the newer kind that
-return the result.  The newer kind of macros don't exist when the output
-is sized data, because that would have two return values.  NOTE: All
-convenience macros are ultimately defined in terms of
-@code{TO_EXTERNAL_FORMAT} and @code{TO_INTERNAL_FORMAT}.  Thus, any
-comments above about the workings of these macros also apply to all
-convenience macros.
-
-A typical old-style convenience macro is
-
-@example
-  C_STRING_TO_EXTERNAL (in, out, codesys);
+used instead -- @code{build_extstring()} and @code{make_extstring()},
+for example.) Most convenience macros return the result as the return
+value.  However, when two values need to be returned (that is, the
+output is sized data), both values are stored into variables that are
+passed into the macros as parameters.  NOTE: All convenience macros
+are ultimately defined in terms of @code{TO_EXTERNAL_FORMAT} and
+@code{TO_INTERNAL_FORMAT}.  Thus, any comments above about the
+workings of these macros also apply to all convenience macros.
+
+A typical convenience macro is
+
+@example
+  out = ITEXT_TO_EXTERNAL (in, codesys);
 @end example
 
 This is equivalent to
@@ -12879,14 +12915,13 @@
   TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys);
 @end example
 
-but is easier to write and somewhat clearer, since it clearly identifies
-the arguments without the clutter of having the preprocessor types mixed
-in.
-
-The new-style equivalent is @code{NEW_C_STRING_TO_EXTERNAL (src,
-codesys)}, which @emph{returns} the converted data (still in
-@code{alloca()} space).  This is far more convenient for most
-operations.
+but is easier to write and somewhat clearer, since it clearly
+identifies the arguments without the clutter of having the
+preprocessor types mixed in.  Furthermore, it @emph{returns} the
+converted data (still in @code{alloca()} space) rather than
+@emph{storing} it, which is far more convenient for most operations
+as there is no need to declare an extra temporary variable to hold
+the return value.
 
 @node General Guidelines for Writing Mule-Aware Code, An Example of Mule-Aware Code, Conversion to and from External Data, Coding for Mule
 @subsection General Guidelines for Writing Mule-Aware Code
@@ -12905,9 +12940,69 @@
 format, use @code{Ibyte}.  If you want a Lisp-visible character, use a
 @code{Lisp_Object} and @code{make_char}.  If you want a pointer to move
 through the internal text, use @code{Ibyte *}.  Also note that you
-almost certainly do not need @code{Ichar *}.  Other typedefs to clarify
-the use of @code{char} are @code{Char_ASCII}, @code{Char_Binary},
-@code{UChar_Binary}, and @code{CIbyte}.
+almost certainly do not need @code{Ichar *}.
+
+All uses of @code{char} should be replaced with one of the following:
+
+@table @code
+@item Ibyte
+Pointer to internally-formatted text.  The data representing the text
+in a buffer is logically a set of Ibytes.
+@item CIbyte
+Used when you are working with internal data but for whatever reason
+need to have it declared a @code{char *}.  Examples are function arguments
+whose values are most commonly literal strings, or where you have to
+apply a stdlib string function to internal data.
+
+In general, you should avoid this where possible and use Ascbyte if the
+text is just ASCII (e.g. string literals) or otherwise Ibyte, for
+consistency.  For example, the new Mule workspace contains Ibyte
+versions of the stdlib string functions.
+@item Extbyte, UExtbyte
+Pointer to text in some external format, which can be defined as all
+formats other than the internal one.  The data representing a string
+in "external" format (binary or any external encoding) is logically a
+set of Extbytes.  Extbyte is guaranteed to be just a char, so for
+example strlen (Extbyte *) is OK.  Extbyte is only a documentation
+device for referring to external text.
+@item Ascbyte, UAscbyte
+pure ASCII text, consisting of bytesf in a string in entirely US-ASCII
+format: (Nothing outside the range 00 - 7F).
+@item Binbyte, CBinbyte, SBinbyte
+Binary data that is not meant to be interpreted as text.
+@item Rawbyte, CRawbyte
+General data in memory, where we don't care about whether it's text or
+binary; often used when computing memory-based/byte-based offsets of
+pointers.  In general, there should be no manipulation of the memory
+pointed to by these pointers other than just copying it around.
+@item Boolbyte
+A byte used to represent a boolean value: 0 or 1.
+Normally use plain Boolint, and only use Boolbyte to save space.
+@item Bitbyte
+A byte composed of bitfields.  Hardly ever used.
+@item Chbyte, UChbyte, SChbyte
+A no-semantics @code{char}.  Used (pretty-much) ONLY for casting
+arguments to functions accepting a @code{char *}, @code{unsigned char
+*}, etc. where the other types don't exactly apply and what you are
+logically concerned with is the type of the function's argument and
+not its semantics.
+
+DO NOT DO NOT DO NOT DO NOT use this as a sloppy replacement for one of
+the other types.  If you're not using this as part of casting an
+argument to a function call, and you're not Ben Wing, you're using it
+wrong.  Go find another one of the types.
+@end table
+
+Note the significance of the prefixed versions of the above types:
+
+@table @code
+@item U
+@code{unsigned char}
+@item S
+@code{signed char}
+@item C
+plain @code{char}
+@end table
 
 @item Be careful not to confuse @code{Charcount}, @code{Bytecount}, @code{Charbpos} and @code{Bytebpos}.
 The whole point of using different types is to avoid confusion about the
@@ -13018,13 +13113,13 @@
 @item
 Check all uses of @code{XSTRING_DATA}.
 @item
-Check all uses of @code{build_string} and @code{make_string}.
+Check all uses of @code{build_cistring} and @code{make_string}.
 @item
 Check all uses of @code{tolower} and @code{toupper}.
 @item
 Check object print methods.
 @item
-Check for use of functions such as @code{write_c_string},
+Check for use of functions such as @code{write_cistring},
 @code{write_fmt_string}, @code{stderr_out}, @code{stdout_out}.
 @item
 Check all occurrences of @code{char} and correct to one of the other
@@ -14342,15 +14437,15 @@
 strings, which is quite often.
 
 @item
-new fun @code{build_intstring()} takes an @code{Intbyte *}.  also new
-funs @code{build_msg_intstring} (like @code{build_intstring()}) and
-@code{build_msg_string} (like @code{build_string()}) to do a
+new fun @code{build_istring()} takes an @code{Intbyte *}.  also new
+funs @code{build_msg_intstring} (like @code{build_istring()}) and
+@code{build_msg_string} (like @code{build_cistring()}) to do a
 @code{GETTEXT()} before building the string.  (elimination of old
 @code{build_translated_string()}, replaced by
 @code{build_msg_string()}).
 
 @item
-function @code{intern_int()} for @code{Intbyte *} arguments, like
+function @code{intern_istring()} for @code{Intbyte *} arguments, like
 @code{intern()}.
 
 @item
@@ -15336,10 +15431,10 @@
 menu item to revert to most recent auto save.
 
 @item
-consider renaming @code{build_string} -> @code{build_intstring} and
-@code{build_c_string} to @code{build_string}. (consistent with
+consider renaming @code{build_cistring} -> @code{build_istring} and
+@code{build_c_string} to @code{build_cistring}. (consistent with
 @code{build_msg_string} et al; many more @code{build_c_string} than
-@code{build_string})
+@code{build_cistring})
 @end itemize
 
 @heading oct 20, 2001
@@ -17133,7 +17228,7 @@
 
 
 
-@node Consoles; Devices; Frames; Windows, The Redisplay Mechanism, Multilingual Support, Top
+@node Consoles; Devices; Frames; Windows, Window-System Support, Multilingual Support, Top
 @chapter Consoles; Devices; Frames; Windows
 @cindex consoles; devices; frames; windows
 @cindex devices; frames; windows, consoles;
@@ -17145,7 +17240,6 @@
 * Point::                       
 * Window Hierarchy::            
 * The Window Object::           
-* Creating a New Console/Device/Frame Type::  
 * Modules for the Basic Displayable Lisp Objects::  
 @end menu
 
@@ -17315,7 +17409,7 @@
 artifact that should be fixed.)
 @end enumerate
 
-@node The Window Object, Creating a New Console/Device/Frame Type, Window Hierarchy, Consoles; Devices; Frames; Windows
+@node The Window Object, Modules for the Basic Displayable Lisp Objects, Window Hierarchy, Consoles; Devices; Frames; Windows
 @section The Window Object
 @cindex window object, the
 @cindex object, the window
@@ -17423,143 +17517,7 @@
 @end table
 
 
-@node Creating a New Console/Device/Frame Type, Modules for the Basic Displayable Lisp Objects, The Window Object, Consoles; Devices; Frames; Windows
-@section Creating a New Console, Device, or Frame Type
-@cindex creating a new console type
-@cindex console type, creating a new
-@cindex creating a new device type
-@cindex device type, creating a new
-@cindex creating a new frame type
-@cindex frame type, creating a new
-
-Unfortunately, at the present time, only the console abstraction is at
-all well-maintained.  Device and frame internals are referred to from
-many places in the redisplay and console code.  The best that can be
-done therefore is to create a whole new console type, even though much
-code will be shared.  (Ben Wing has complained about the code
-duplication in the GTK+ v1 console, and probably would not be happy with
-the unpublished Qt console or Andrew Choi's Carbon console, but it's
-hard to see how those consoles could have been done better without
-fixing the abstractions in the X (actually Xt), MS Windows, and tty
-consoles as well as doing a complete refactoring of the console, device,
-and frame code.)
-
-What is desireable is sharing console, device, and frame methods across
-platforms in a more general way, reducing the amount of duplicated code
-by pulling it back into the redisplay engine proper or the Lisp modules
-as appropriate.  For example, we should be able to use
-@samp{make-frame-on-device} to share a single X connection among GTK, X,
-and Xft frames.  Xft is partially implemented, but GTK would be much
-harder (impossible?) because it has its own event loop.  (Xft shares the
-Xt event loop with the X console.)
-
-The way all methods get added to the console type is uncool.  A console
-should be a composite, which indicates a collection of I/O resources
-``used together.''  It should indicate where operations that change
-``focus'' search for targets, @emph{i.e.}, by default new frames are
-created on the selected device of the console where the input that
-invoked the command was received, @samp{pop-to-buffer-other-window} only
-considers existing windows on the same device of the same console,
-@emph{etc.}  But it should be possible to assemble consoles out of
-component input channels, imaging devices, and multimedia (audio)
-channels.
-
-The following notes may provide some guidance to those who wish to
-create new console types (@emph{i.e.}, port the redisplay code to a new
-platform).  They are based on an unsuccessful attempt to refactor the
-Xft code into a new console type while sharing most routines with the X
-console.  (For clarification or suggestions, feel free to write
-@email{stephen@@xemacs.org,Stephen Turnbull}.)
-
-The first thing to realize is that the naming of many modules obscures
-their relationship to the console abstraction.  For example, the
-@file{objects-@var{console-type}}, @file{redisplay-@var{console-type}},
-and @file{glyphs-@var{console-type}} series of modules have nothing to
-do with Lisp objects and little to do with redisplay, respectively.
-Rather they implement abstractions used for rendering on each console
-type, such as fonts and colors (@file{objects}) and string and graphics
-drawing primitives (@file{redisplay}).  These modules are conceptually
-part of the console implementations, not part of redisplay or Lisp.
-
-Public methods of a console are implemented as C functions declared
-@code{static}, following a rigid naming convention:
-@samp{@var{console-type}_@var{method-name}}.  Methods are bound to the
-console type in the @samp{console_type_create_@var{file}} functions for
-each console component (console, device, and frame) using the
-@samp{CONSOLE_HAS_METHOD} family of macros.  Methods for displaying
-images are bound using the @samp{IIFORMAT_HAS_DEVMETHOD} family of
-macros.  Methods are invoked using the @samp{CONMETH}, @samp{DEVMETH},
-and @samp{FRAMEMETH} families of macros, which look up the relevant
-methods in the object's table of methods.
-
-@strong{N.B.} All of the object tables are actually references to
-console method tables.  To create a variant of an existing console,
-there is a @samp{CONSOLE_INHERITS_METHOD} constructor, but this actually
-constructs the name of the parent's method pointer and stores in the
-derived console type's method table.  Of course this is time-efficient,
-and since there are few console types it is a neglible waste of space.
-However in practice this may have contributed to breaking the various
-abstractions, and the variant console must be coded in the same file as
-the parent (because the methods are static).  Another minor symptom of
-the incompleteness of the abstraction is the fact that the API for
-inheritance of device methods for image formats is named
-@samp{IIFORMAT_HAS_SHARED_METHOD}, although the semantics are identical.
-
-One problem encountered in attempting to create an Xft console type as a
-derivative of the X console type was that there is no support for such
-union types in the consistency-checking code, whether for the
-fundamental Lisp consistency checks (the @samp{CHECK_SOMETHING} family
-of macros) or for the error-checking variants of many functions.  These
-APIs all simply check for the apparent console type, which is a single
-symbol (or enumerator).
-
-To create a new console with mostly new methods, it's probably best to
-copy all of the @file{@var{function}-@var{console-type}} files from a
-similar console (or several, if the new console type seems like a
-combination of several existing console types), renaming the files by
-substituting @var{new-console-type} for @var{console-type}.  Then
-proceed in the obvious way by renaming methods from
-@samp{@var{console-type}_@var{method-name}} to
-@samp{@var{new-console-type}_@var{method-name}}, and implementing them.
-
-Once you've done that, then the fun starts.  Insert the initialization
-functions (@samp{syms_of_@var{file}}, @samp{vars_of_@var{file}},
-@samp{console_type_create_@var{file}}, @emph{etc.}) in @samp{main_1} in
-@file{emacs.c}.
-
-Add a device creation function @samp{make-@var{console-type}-device} in
-@file{device.el}.  Add the device type to the calls to
-@samp{Face-frob-property} in @file{faces.el}, as well as calls to the
-device initializer functions for devices and frames, and ``additional
-frobbing'' in that file.
-
-You may wish to add an option to force the initial frame to that device
-type to @file{emacs.c}.  Don't forget to document it in the command help
-function in @file{startup.el}.
-
-You may need to add support for your console type in
-@samp{init_event_stream} in @file{event-stream.c}.
-
-If your console has a different UI for fonts or colors, or adds new
-capability, you may need to add a @file{@var{console-type}-faces.el}
-file, or add code to the @file{@var{parent-type}-faces.el} file, to
-support new font or color capability.  Probably initialization code in
-@file{faces.c} will be needed too.
-
-A check for the console type is probably needed in @samp{init_redisplay}
-in @file{redisplay.c}.
-
-Ditto for the @file{@var{console-type}-init.el} file.
-
-Don't forget that Emacs windows are console-dependent, too.  At least a
-@samp{WINDOW_@var{console-type}_P}-checking macro should be added in
-@file{window-impl.h}.
-
-Note that this project failed; there are probably many other details to
-be implemented that I didn't get to.  But don't let that stop you!
-
-
-@node Modules for the Basic Displayable Lisp Objects,  , Creating a New Console/Device/Frame Type, Consoles; Devices; Frames; Windows
+@node Modules for the Basic Displayable Lisp Objects,  , The Window Object, Consoles; Devices; Frames; Windows
 @section Modules for the Basic Displayable Lisp Objects
 @cindex modules for the basic displayable Lisp objects
 @cindex displayable Lisp objects, modules for the basic
@@ -17710,7 +17668,190 @@
 types such as scrollbars.
 
 
-@node The Redisplay Mechanism, Extents, Consoles; Devices; Frames; Windows, Top
+@node Window-System Support, The Redisplay Mechanism, Consoles; Devices; Frames; Windows, Top
+@chapter Window-System Support
+@cindex window-system support
+@cindex window systems
+@cindex X
+@cindex X Windows
+@cindex Windows
+@cindex Microsoft Windows
+@cindex MS-Windows
+@cindex GTK
+@cindex Gnome
+
+XEmacs defines the concept of a ``device type'', which approximately
+corresponds to a window-system type, and separates out display-related
+code into device-independent and device-dependent sections.
+Generally, the device-independent code will go into a generally-named
+file such as @file{redisplay.c}, while the device-dependent code goes
+into @file{redisplay-x.c}, @file{redisplay-gtk.c},
+@file{redisplay-msw.c}, etc.  Device-dependent methods are called
+using the @code{DEVMETH} macro.
+
+The following device types are defined:
+
+@table @asis
+@item X-Windows (@code{x})
+This supports rendering through @code{Xlib}, widget support through
+@code{Xt}, and event-handling through @code{Xt}.
+@item Microsoft Windows (@code{msw})
+@item GTK/Gnome (@code{gtk})
+@item TTY's (@code{tty})
+This is used for TTY connections (e.g. running inside of an @code{xterm} or
+Windows console window).
+@item Stream devices (@code{stream})
+This is used for ``stream'' devices, of which there is only one -- the
+initial stdio device used when XEmacs is running noninteractively.
+@end table
+
+In addition, there is a pseudo-device-type `xlike', which is used for
+abstracting X and GTK code that is very similar.
+
+@menu
+* Creating a Window-System Type::  
+@end menu
+
+@node Creating a Window-System Type,  , Window-System Support, Window-System Support
+@section Creating a Window-System Type
+@cindex creating a new window-system type
+@cindex window-system types, creating
+@cindex creating a new console type
+@cindex console types, creating
+@cindex creating a new device type
+@cindex device types, creating
+@cindex creating a new frame type
+@cindex frame types, creating
+
+Unfortunately, at the present time, only the console abstraction is
+really well-maintained.  Device and frame internals are referred to
+from many places in the redisplay and console code.  The best that can
+be done therefore is to create a whole new console type, even though
+much code will be shared.  (Ben Wing has complained about the code
+duplication in the GTK+ v1 console, and probably would not be happy
+with the unpublished Qt console or Andrew Choi's Carbon console, but
+it's hard to see how those consoles could have been done better
+without fixing the abstractions in the X (actually Xt), MS Windows,
+and tty consoles as well as doing a complete refactoring of the
+console, device, and frame code.)
+
+What is desireable is sharing console, device, and frame methods across
+platforms in a more general way, reducing the amount of duplicated code
+by pulling it back into the redisplay engine proper or the Lisp modules
+as appropriate.  For example, we should be able to use
+@samp{make-frame-on-device} to share a single X connection among GTK, X,
+and Xft frames.  Xft is partially implemented, but GTK would be much
+harder (impossible?) because it has its own event loop.  (Xft shares the
+Xt event loop with the X console.)
+
+The way all methods get added to the console type is uncool.  A console
+should be a composite, which indicates a collection of I/O resources
+``used together.''  It should indicate where operations that change
+``focus'' search for targets, @emph{i.e.}, by default new frames are
+created on the selected device of the console where the input that
+invoked the command was received, @samp{pop-to-buffer-other-window} only
+considers existing windows on the same device of the same console,
+@emph{etc.}  But it should be possible to assemble consoles out of
+component input channels, imaging devices, and multimedia (audio)
+channels.
+
+The following notes may provide some guidance to those who wish to
+create new console types (@emph{i.e.}, port the redisplay code to a new
+platform).  They are based on an unsuccessful attempt to refactor the
+Xft code into a new console type while sharing most routines with the X
+console.  (For clarification or suggestions, feel free to write
+@email{stephen@@xemacs.org,Stephen Turnbull}.)
+
+The first thing to realize is that the naming of many modules obscures
+their relationship to the console abstraction.  For example, the
+@file{objects-@var{console-type}}, @file{redisplay-@var{console-type}},
+and @file{glyphs-@var{console-type}} series of modules have nothing to
+do with Lisp objects and little to do with redisplay, respectively.
+Rather they implement abstractions used for rendering on each console
+type, such as fonts and colors (@file{objects}) and string and graphics
+drawing primitives (@file{redisplay}).  These modules are conceptually
+part of the console implementations, not part of redisplay or Lisp.
+
+Public methods of a console are implemented as C functions declared
+@code{static}, following a rigid naming convention:
+@samp{@var{console-type}_@var{method-name}}.  Methods are bound to the
+console type in the @samp{console_type_create_@var{file}} functions for
+each console component (console, device, and frame) using the
+@samp{CONSOLE_HAS_METHOD} family of macros.  Methods for displaying
+images are bound using the @samp{IIFORMAT_HAS_DEVMETHOD} family of
+macros.  Methods are invoked using the @samp{CONMETH}, @samp{DEVMETH},
+and @samp{FRAMEMETH} families of macros, which look up the relevant
+methods in the object's table of methods.
+
+@strong{N.B.} All of the object tables are actually references to
+console method tables.  To create a variant of an existing console,
+there is a @samp{CONSOLE_INHERITS_METHOD} constructor, but this actually
+constructs the name of the parent's method pointer and stores in the
+derived console type's method table.  Of course this is time-efficient,
+and since there are few console types it is a neglible waste of space.
+However in practice this may have contributed to breaking the various
+abstractions, and the variant console must be coded in the same file as
+the parent (because the methods are static).  Another minor symptom of
+the incompleteness of the abstraction is the fact that the API for
+inheritance of device methods for image formats is named
+@samp{IIFORMAT_HAS_SHARED_METHOD}, although the semantics are identical.
+
+One problem encountered in attempting to create an Xft console type as a
+derivative of the X console type was that there is no support for such
+union types in the consistency-checking code, whether for the
+fundamental Lisp consistency checks (the @samp{CHECK_SOMETHING} family
+of macros) or for the error-checking variants of many functions.  These
+APIs all simply check for the apparent console type, which is a single
+symbol (or enumerator).
+
+To create a new console with mostly new methods, it's probably best to
+copy all of the @file{@var{function}-@var{console-type}} files from a
+similar console (or several, if the new console type seems like a
+combination of several existing console types), renaming the files by
+substituting @var{new-console-type} for @var{console-type}.  Then
+proceed in the obvious way by renaming methods from
+@samp{@var{console-type}_@var{method-name}} to
+@samp{@var{new-console-type}_@var{method-name}}, and implementing them.
+
+Once you've done that, then the fun starts.  Insert the initialization
+functions (@samp{syms_of_@var{file}}, @samp{vars_of_@var{file}},
+@samp{console_type_create_@var{file}}, @emph{etc.}) in @samp{main_1} in
+@file{emacs.c}.
+
+Add a device creation function @samp{make-@var{console-type}-device} in
+@file{device.el}.  Add the device type to the calls to
+@samp{Face-frob-property} in @file{faces.el}, as well as calls to the
+device initializer functions for devices and frames, and ``additional
+frobbing'' in that file.
+
+You may wish to add an option to force the initial frame to that device
+type to @file{emacs.c}.  Don't forget to document it in the command help
+function in @file{startup.el}.
+
+You may need to add support for your console type in
+@samp{init_event_stream} in @file{event-stream.c}.
+
+If your console has a different UI for fonts or colors, or adds new
+capability, you may need to add a @file{@var{console-type}-faces.el}
+file, or add code to the @file{@var{parent-type}-faces.el} file, to
+support new font or color capability.  Probably initialization code in
+@file{faces.c} will be needed too.
+
+A check for the console type is probably needed in @samp{init_redisplay}
+in @file{redisplay.c}.
+
+Ditto for the @file{@var{console-type}-init.el} file.
+
+Don't forget that Emacs windows are console-dependent, too.  At least a
+@samp{WINDOW_@var{console-type}_P}-checking macro should be added in
+@file{window-impl.h}.
+
+Note that this project failed; there are probably many other details to
+be implemented that I didn't get to.  But don't let that stop you!
+
+
+
+@node The Redisplay Mechanism, Extents, Window-System Support, Top
 @chapter The Redisplay Mechanism
 @cindex redisplay mechanism, the
 
@@ -25682,7 +25823,7 @@
   signal_simple_error_2 ("string" ... )
   
   build_translated_string ("string")
-  #### add this and use it instead of @code{build_string()} in some places.
+  #### add this and use it instead of @code{build_cistring()} in some places.
   
   yes_or_no_p ("string" ... )
   #### add this instead of funcalling Qyes_or_no_p directly.
@@ -28394,8 +28535,8 @@
 @cindex garbage collection, discussion
 
 @menu
-* Discussion -- KKCC::
-* Discussion -- Incremental Collector::
+* Discussion -- KKCC::          
+* Discussion -- Incremental Collector::  
 * Discussion -- Pure Space::    
 * Discussion -- Hashtable-Based Marking and Cleanup::  
 * Discussion -- The Anti-Cons::  
--- a/man/lispref/buffers.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/buffers.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -524,7 +524,7 @@
 
 If @var{time} is not @code{nil}, it should have the form
 @code{(@var{high} . @var{low})} or @code{(@var{high} @var{low})}, in
-either case containing two integers, each of which holds 16 bits of the
+either case containing two fixnums, each of which holds 16 bits of the
 time.
 
 This function is useful if the buffer was not read from the file
--- a/man/lispref/commands.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/commands.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -102,8 +102,8 @@
 @cindex interactive function
 
   A Lisp function becomes a command when its body contains, at top
-level, a form that calls the special form @code{interactive}.  This
-form does nothing when actually executed, but its presence serves as a
+level, a form that calls the special operator @code{interactive}.  This
+operator does nothing when actually executed, but its presence serves as a
 flag to indicate that interactive calling is permitted.  Its argument
 controls the reading of arguments for an interactive call.
 
@@ -122,7 +122,7 @@
 
 @defspec interactive arg-descriptor
 @cindex argument descriptors
-This special form declares that the function in which it appears is a
+This special operator declares that the function in which it appears is a
 command, and that it may therefore be called interactively (via
 @kbd{M-x} or by entering a key sequence bound to it).  The argument
 @var{arg-descriptor} declares how to compute the arguments to the
@@ -762,7 +762,7 @@
 
 @defvar echo-keystrokes
 This variable determines how much time should elapse before command
-characters echo.  Its value must be an integer, which specifies the
+characters echo.  Its value must be a float or a fixnum, which specifies the
 number of seconds to wait before echoing.  If the user types a prefix
 key (say @kbd{C-x}) and then delays this many seconds before continuing,
 the key @kbd{C-x} is echoed in the echo area.  Any subsequent characters
@@ -1324,7 +1324,7 @@
 
 @item @code{button}
 The event button.  This an integer, either 1, 2 or 3.  It is allowed
-only for button-press and button-release events.
+for button-press, button-release and misc-user events.
 
 @item @code{modifiers}
 The event modifiers.  This is a list of modifier symbols.  It is allowed
--- a/man/lispref/control.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/control.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -5,14 +5,14 @@
 @setfilename ../../info/control.info
 @node Control Structures, Variables, Evaluation, Top
 @chapter Control Structures
-@cindex special forms for control structures
+@cindex special operators for control structures
 @cindex control structures
 
   A Lisp program consists of expressions or @dfn{forms} (@pxref{Forms}).
 We control the order of execution of the forms by enclosing them in
-@dfn{control structures}.  Control structures are special forms which
-control when, whether, or how many times to execute the forms they
-contain.
+@dfn{control structures}.  Control structures are special operators which
+control when, whether, or how many times to execute the subforms of
+their containing forms.
 
   The simplest order of execution is sequential execution: first form
 @var{a}, then form @var{b}, and so on.  This is what happens when you
@@ -29,9 +29,9 @@
   XEmacs Lisp provides several kinds of control structure, including
 other varieties of sequencing, conditionals, iteration, and (controlled)
 jumps---all discussed below.  The built-in control structures are
-special forms since their subforms are not necessarily evaluated or not
-evaluated sequentially.  You can use macros to define your own control
-structure constructs (@pxref{Macros}).
+special operators since their enclosing forms' subforms are not
+necessarily evaluated or not evaluated sequentially.  You can use macros
+to define your own control structure constructs (@pxref{Macros}).
 
 @menu
 * Sequencing::             Evaluation in textual order.
@@ -77,7 +77,7 @@
 @code{or}, or in the @var{then}-part of an @code{if}.
 
 @defspec progn forms@dots{}
-This special form evaluates all of the @var{forms}, in textual
+This special operator evaluates all of the @var{forms}, in textual
 order, returning the result of the final form.
 
 @example
@@ -97,7 +97,7 @@
 a different value:
 
 @defspec prog1 form1 forms@dots{}
-This special form evaluates @var{form1} and all of the @var{forms}, in
+This special operator evaluates @var{form1} and all of the @var{forms}, in
 textual order, returning the result of @var{form1}.
 
 @example
@@ -121,7 +121,7 @@
 @end defspec
 
 @defspec prog2 form1 form2 forms@dots{}
-This special form evaluates @var{form1}, @var{form2}, and all of the
+This special operator evaluates @var{form1}, @var{form2}, and all of the
 following @var{forms}, in textual order, returning the result of
 @var{form2}.
 
@@ -157,7 +157,7 @@
 If @var{condition} has the value @code{nil}, and no @var{else-forms} are
 given, @code{if} returns @code{nil}.
 
-@code{if} is a special form because the branch that is not selected is
+@code{if} is a special operator because the branch that is not selected is
 never evaluated---it is ignored.  Thus, in the example below,
 @code{true} is not printed because @code{print} is never called.
 
@@ -269,7 +269,7 @@
 @end defun
 
 @defspec and conditions@dots{}
-The @code{and} special form tests whether all the @var{conditions} are
+The @code{and} special operator tests whether all the @var{conditions} are
 true.  It works by evaluating the @var{conditions} one by one in the
 order written.
 
@@ -323,7 +323,7 @@
 @end defspec
 
 @defspec or conditions@dots{}
-The @code{or} special form tests whether at least one of the
+The @code{or} special operator tests whether at least one of the
 @var{conditions} is true.  It works by evaluating all the
 @var{conditions} one by one in the order written.
 
@@ -379,7 +379,7 @@
   Iteration means executing part of a program repetitively.  For
 example, you might want to repeat some computation once for each element
 of a list, or once for each integer from 0 to @var{n}.  You can do this
-in XEmacs Lisp with the special form @code{while}:
+in XEmacs Lisp with the special operator @code{while}:
 
 @defspec while condition forms@dots{}
 @code{while} first evaluates @var{condition}.  If the result is
@@ -488,7 +488,7 @@
 the narrowing status saved by @code{save-restriction} and the window
 selection saved by @code{save-window-excursion} (@pxref{Window
 Configurations}).  It also runs any cleanups established with the
-@code{unwind-protect} special form when it exits that form
+@code{unwind-protect} special operator when it exits that form
 (@pxref{Cleanups}).
 
   The @code{throw} need not appear lexically within the @code{catch}
@@ -957,7 +957,7 @@
   The usual effect of signaling an error is to terminate the command
 that is running and return immediately to the XEmacs editor command loop.
 You can arrange to trap errors occurring in a part of your program by
-establishing an error handler, with the special form
+establishing an error handler, with the special operator
 @code{condition-case}.  A simple example looks like this:
 
 @example
@@ -1029,7 +1029,7 @@
 @code{catch} signals an error that can be handled).
 
 @defspec condition-case var protected-form handlers@dots{}
-This special form establishes the error handlers @var{handlers} around
+This special operator establishes the error handlers @var{handlers} around
 the execution of @var{protected-form}.  If @var{protected-form} executes
 without error, the value it returns becomes the value of the
 @code{condition-case} form; in this case, the @code{condition-case} has
--- a/man/lispref/debugging.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/debugging.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -529,7 +529,7 @@
 @samp{backtrace-output}.  Each line of the backtrace represents one
 function call.  The line shows the values of the function's arguments if
 they are all known.  If they are still being computed, the line says so.
-The arguments of special forms are elided.
+The arguments of special operators are elided.
 
 @smallexample
 @group
--- a/man/lispref/edebug-inc.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/edebug-inc.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -203,13 +203,13 @@
 instrumenting it.  Also see the command @kbd{i} (@ref{Jumping}) which
 steps into the callee.
 
-@cindex special forms (Edebug)
+@cindex special operators (Edebug)
 @cindex interactive commands (Edebug)
 @cindex anonymous lambda expressions (Edebug)
 @cindex Common Lisp (Edebug)
 @pindex cl.el (Edebug)
 @pindex cl-specs.el
-  Edebug knows how to instrument all the standard special forms, an
+  Edebug knows how to instrument all the standard special operators, an
 interactive form with an expression argument, anonymous lambda
 expressions, and other defining forms.  (Specifications for macros
 defined by @file{cl.el} (version 2.03) are provided in
@@ -1497,7 +1497,7 @@
 Here we provide several examples of Edebug specifications to show
 many of its capabilities.
 
-A @code{let} special form has a sequence of bindings and a body.  Each
+A @code{let} special operator has a sequence of bindings and a body.  Each
 of the bindings is either a symbol or a sublist with a symbol and
 optional value.  In the specification below, notice the @code{gate}
 inside of the sublist to prevent backtracking.
--- a/man/lispref/eval.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/eval.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -252,8 +252,9 @@
 			      we find the real function via the symbol.
 * Function Forms::          Forms that call functions.
 * Macro Forms::             Forms that call macros.
-* Special Forms::           ``Special forms'' are idiosyncratic primitives,
+* Special Operators::       ``Special operators'' are idiosyncratic primitives,
                               most of them extremely important.
+                              Also known as special forms.
 * Autoloading::             Functions set up to load files
                               containing their real definitions.
 @end menu
@@ -354,7 +355,7 @@
 call, or a special form, according to its first element.  These three
 kinds of forms are evaluated in different ways, described below.  The
 remaining list elements constitute the @dfn{arguments} for the function,
-macro, or special form.
+macro, or special operator.
 
   The first step in evaluating a nonempty list is to examine its first
 element.  This element alone determines what kind of form the list is
@@ -387,7 +388,7 @@
 @cindex invalid function
   More precisely, we should now have a Lisp function (a lambda
 expression), a byte-code function, a primitive function, a Lisp macro, a
-special form, or an autoload object.  Each of these types is a case
+special operator, or an autoload object.  Each of these types is a case
 described in one of the following sections.  If the object is not one of
 these types, the error @code{invalid-function} is signaled.
 
@@ -531,20 +532,22 @@
 
 @xref{Macros}, for a complete description of XEmacs Lisp macros.
 
-@node Special Forms
-@subsection Special Forms
-@cindex special form evaluation
+@node Special Operators
+@subsection Special Operators
+@cindex special operator evaluation
+@cindex special form
 
-  A @dfn{special form} is a primitive function specially marked so that
-its arguments are not all evaluated.  Most special forms define control
+  A @dfn{special operator} (historically, and less logically, a
+@dfn{special form}) is a primitive function specially marked so that
+its arguments are not all evaluated.  Most special operators define control
 structures or perform variable bindings---things which functions cannot
 do.
 
-  Each special form has its own rules for which arguments are evaluated
+  Each special operator has its own rules for which arguments are evaluated
 and which are used without evaluation.  Whether a particular argument is
 evaluated may depend on the results of evaluating other arguments.
 
-  Here is a list, in alphabetical order, of all of the special forms in
+  Here is a list, in alphabetical order, of all of the special operators in
 XEmacs Lisp with a reference to where each is described.
 
 @table @code
@@ -627,17 +630,16 @@
 @pxref{Temporary Displays}
 @end table
 
-@cindex CL note---special forms compared
+@cindex CL note---special operators compared
 @quotation
-@b{Common Lisp note:} here are some comparisons of special forms in
+@b{Common Lisp note:} here are some comparisons of special operators in
 XEmacs Lisp and Common Lisp.  @code{setq}, @code{if}, and
-@code{catch} are special forms in both XEmacs Lisp and Common Lisp.
-@code{defun} is a special form in XEmacs Lisp, but a macro in Common
-Lisp.  @code{save-excursion} is a special form in XEmacs Lisp, but
-doesn't exist in Common Lisp.  @code{throw} is a special form in
-Common Lisp (because it must be able to throw multiple values), but it
-is a function in XEmacs Lisp (which doesn't have multiple
-values).@refill
+@code{catch} are special operators in both XEmacs Lisp and Common Lisp.
+@code{defun} is a special operator in XEmacs Lisp, but a macro in Common
+Lisp.  @code{save-excursion} is a special operator in XEmacs Lisp, but
+doesn't exist in Common Lisp.  @code{throw} is a special operator in
+both Common Lisp and XEmacs Lisp (because it must be able to throw
+multiple values).@refill
 @end quotation
 
 @node Autoloading
@@ -654,14 +656,14 @@
 @section Quoting
 @cindex quoting
 
-  The special form @code{quote} returns its single argument, as written,
+  The special operator @code{quote} returns its single argument, as written,
 without evaluating it.  This provides a way to include constant symbols
 and lists, which are not self-evaluating objects, in a program.  (It is
 not necessary to quote self-evaluating objects such as numbers, strings,
 and vectors.)
 
 @defspec quote object
-This special form returns @var{object}, without evaluating it.
+This special operator returns @var{object}, without evaluating it.
 @end defspec
 
 @cindex @samp{'} for quoting
--- a/man/lispref/frames.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/frames.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -786,13 +786,13 @@
 @end defun
 
 @defspec save-selected-frame forms@dots{}
-This special form records the selected frame, executes @var{forms} in
+This special operator records the selected frame, executes @var{forms} in
 sequence, then restores the earlier selected frame.  The value returned
 is the value of the last form.
 @end defspec
 
 @defspec with-selected-frame frame forms@dots{}
-This special form records the selected frame, then selects @var{frame}
+This special operator records the selected frame, then selects @var{frame}
 and executes @var{forms} in sequence.  After the last form is finished,
 the earlier selected frame is restored.  The value returned is the value
 of the last form.
--- a/man/lispref/functions.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/functions.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -42,7 +42,7 @@
 @cindex function
 In XEmacs Lisp, a @dfn{function} is anything that can be applied to
 arguments in a Lisp program.  In some cases, we use it more
-specifically to mean a function written in Lisp.  Special forms and
+specifically to mean a function written in Lisp.  Special operators and
 macros are not functions.
 
 @item command
@@ -84,7 +84,7 @@
 @cindex built-in function
 A @dfn{primitive} is a function callable from Lisp that is written in C,
 such as @code{car} or @code{append}.  These functions are also called
-@dfn{built-in} functions or @dfn{subrs}.  (Special forms are also
+@dfn{built-in} functions or @dfn{subrs}.  (Special operators are also
 considered primitives.)
 
 Usually the reason that a function is a primitives is because it is
@@ -101,11 +101,11 @@
 @xref{Lambda Expressions}.
 @end ifinfo
 
-@item special form
-A @dfn{special form} is a primitive that is like a function but does not
+@item special operator
+A @dfn{special operator} is a primitive that is like a function but does not
 evaluate all of its arguments in the usual way.  It may evaluate only
 some of the arguments, or may evaluate them in an unusual order, or
-several times.  Many special forms are described in @ref{Control
+several times.  Many special operators are described in @ref{Control
 Structures}.
 
 @item macro
@@ -114,7 +114,7 @@
 differs from a function in that it translates a Lisp expression that you
 write into an equivalent expression to be evaluated instead of the
 original expression.  Macros enable Lisp programmers to do the sorts of
-things that special forms can do.  @xref{Macros}, for how to define and
+things that special operators can do.  @xref{Macros}, for how to define and
 use macros.
 
 @item compiled function
@@ -267,14 +267,14 @@
 
   It is not often useful to write a lambda expression as the @sc{car} of
 a form in this way.  You can get the same result, of making local
-variables and giving them values, using the special form @code{let}
+variables and giving them values, using the special operator @code{let}
 (@pxref{Local Variables}).  And @code{let} is clearer and easier to use.
 In practice, lambda expressions are either stored as the function
 definitions of symbols, to produce named functions, or passed as
 arguments to other functions (@pxref{Anonymous Functions}).
 
   However, calls to explicit lambda expressions were very useful in the
-old days of Lisp, before the special form @code{let} was invented.  At
+old days of Lisp, before the special operator @code{let} was invented.  At
 that time, they were the only way to bind and initialize local
 variables.
 
@@ -472,7 +472,7 @@
 
   We usually give a name to a function when it is first created.  This
 is called @dfn{defining a function}, and it is done with the
-@code{defun} special form.
+@code{defun} special operator.
 
 @defspec defun name argument-list body-forms
 @code{defun} is the usual way to define new Lisp functions.  It
@@ -547,7 +547,7 @@
 
 @defun define-function name definition
 @defunx defalias name definition
-These equivalent special forms define the symbol @var{name} as a
+These equivalent primitives define the symbol @var{name} as a
 function, with definition @var{definition} (which can be any valid Lisp
 function).
 
@@ -601,7 +601,7 @@
 place where the arguments have already been evaluated.
 
 The argument @var{function} must be either a Lisp function or a
-primitive function.  Special forms and macros are not allowed, because
+primitive function.  Special operators and macros are not allowed, because
 they make sense only when given the ``unevaluated'' argument
 expressions.  @code{funcall} cannot provide these because, as we saw
 above, it never knows them in the first place.
@@ -637,7 +637,7 @@
 
 @code{apply} returns the result of calling @var{function}.  As with
 @code{funcall}, @var{function} must either be a Lisp function or a
-primitive function; special forms and macros do not make sense in
+primitive function; special operators and macros do not make sense in
 @code{apply}.
 
 @example
@@ -830,12 +830,12 @@
 @end example
 
 @noindent
-In such cases, we usually use the special form @code{function} instead
+In such cases, we usually use the special operator @code{function} instead
 of simple quotation to quote the anonymous function.
 
 @defspec function function-object
 @cindex function quoting
-This special form returns @var{function-object} without evaluating it.
+This special operator returns @var{function-object} without evaluating it.
 In this, it is equivalent to @code{quote}.  However, it serves as a
 note to the XEmacs Lisp compiler that @var{function-object} is intended
 to be used only as a function, and therefore can safely be compiled.
--- a/man/lispref/hash-tables.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/hash-tables.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -65,12 +65,15 @@
 Hash tables can also be created by the lisp reader using structure
 syntax, for example:
 @example
-#s(hash-table size 20 data (foo 1 bar 2))
+#s(hash-table :size 20 :data (foo 1 bar 2))
 @end example
 
-The structure syntax accepts the same keywords as @code{make-hash-table}
-(without the @code{:} character), as well as the additional keyword
-@code{data}, which specifies the initial hash table contents.
+The structure syntax accepts the same keywords as
+@code{make-hash-table}, as well as the additional keyword @code{data},
+which specifies the initial hash table contents.  Older versions of
+XEmacs required that the keywords not have the initial ``:'' in the
+structure syntax, and this version of XEmacs still supports that syntax,
+but you cannot mix the two styles within one structure.
 
 @defun make-hash-table &key @code{test} @code{size} @code{rehash-size} @code{rehash-threshold} @code{weakness}
 This function returns a new empty hash table object.
--- a/man/lispref/help.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/help.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -555,8 +555,8 @@
 Otherwise it calls @code{message} to display it in the echo area.
 
 This function expects to be called inside a
-@code{with-output-to-temp-buffer} special form, and expects
-@code{standard-output} to have the value bound by that special form.
+@code{with-output-to-temp-buffer} form, and expects
+@code{standard-output} to have the value bound by that special operator.
 For an example of its use, see the long example in @ref{Accessing
 Documentation}.
 @end defun
--- a/man/lispref/internationalization.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/internationalization.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -35,7 +35,6 @@
 * Level 3 Primitives::
 * Dynamic Messaging::
 * Domain Specification::
-* Documentation String Extraction::
 @end menu
 
 @node Level 3 Basics
@@ -168,25 +167,6 @@
 @end example
 @end defun
 
-
-@node Documentation String Extraction
-@subsection Documentation String Extraction
-
-The utility @file{etc/make-po} scans the file @code{DOC} to extract
-documentation strings and creates a message file @code{doc.po}.  This file
-may then be inserted within @code{emacs.po}.
-
-Currently, @code{make-po} is hard-coded to read from @code{DOC} and write
-to @code{doc.po}.  In order to extract documentation strings from an add-on
-package, first run @code{make-docfile} on the package to produce the
-@code{DOC} file.  Then run @code{make-po -p} with the @code{-p} argument to
-indicate that we are extracting documentation for an add-on package.
-
-(The @code{-p} argument is a kludge to make up for a subtle difference
-between pre-loaded documentation and add-on documentation:  For add-on
-packages, the final carriage returns in the strings produced by
-@code{make-docfile} must be ignored.)
-
 @node I18N Level 4
 @section I18N Level 4
 
--- a/man/lispref/intro.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/intro.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -720,7 +720,7 @@
 @cindex function descriptions
 @cindex command descriptions
 @cindex macro descriptions
-@cindex special form descriptions
+@cindex special operator descriptions
 
   In a function description, the name of the function being described
 appears first.  It is followed on the same line by a list of parameters.
@@ -773,13 +773,13 @@
   @xref{Lambda Expressions}, for a more complete description of optional
 and rest arguments.
 
-  Command, macro, and special form descriptions have the same format,
+  Command, macro, and special operator descriptions have the same format,
 but the word `Function' is replaced by `Command', `Macro', or `Special
 Form', respectively.  Commands are simply functions that may be called
 interactively; macros process their arguments differently from functions
 (the arguments are not evaluated), but are presented the same way.
 
-  Special form descriptions use a more complex notation to specify
+  Special operator descriptions use a more complex notation to specify
 optional and repeated parameters because they can break the argument
 list down into separate arguments in more complicated ways.
 @samp{@code{@r{[}@var{optional-arg}@r{]}}} means that @var{optional-arg} is
@@ -788,7 +788,7 @@
 additional levels of list structure.  Here is an example:
 
 @defspec count-loop (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{}
-This imaginary special form implements a loop that executes the
+This imaginary special operator implements a loop that executes the
 @var{body} forms and then increments the variable @var{var} on each
 iteration.  On the first iteration, the variable has the value
 @var{from}; on subsequent iterations, it is incremented by 1 (or by
@@ -812,7 +812,7 @@
     (setq done t)))
 @end example
 
-In this special form, the arguments @var{from} and @var{to} are
+With this special operator, the arguments @var{from} and @var{to} are
 optional, but must both be present or both absent.  If they are present,
 @var{inc} may optionally be specified as well.  These arguments are
 grouped with the argument @var{var} into a list, to distinguish them
--- a/man/lispref/lispref.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/lispref.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -408,7 +408,7 @@
 * Classifying Lists::       How to distinguish various sorts of list forms.
 * Function Forms::          Forms that call functions.
 * Macro Forms::             Forms that call macros.
-* Special Forms::           ``Special forms'' are idiosyncratic primitives,
+* Special Operators::       ``Special operators'' are idiosyncratic primitives,
                               most of them extremely important.
 * Autoloading::             Functions set up to load files
                               containing their real definitions.
--- a/man/lispref/macros.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/macros.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -178,10 +178,39 @@
 from the macro call.
 
   It is possible to use an anonymous Lisp macro just like an anonymous
-function, but this is never done, because it does not make sense to pass
-an anonymous macro to functionals such as @code{mapcar}.  In practice,
-all Lisp macros have names, and they are usually defined with the
-special form @code{defmacro}.
+function.  It doesn't make sense to pass an anonymous macro to
+functionals such as @code{mapcar}, and it is usually more readable to
+use @code{macrolet} to make a local macro definition, and call that.
+But if, for whatever reason, @code{macrolet} is not available, code
+like the following may be useful:
+
+@example
+((macro . (lambda (&rest arguments)
+	    (let (res)
+	      (while (consp arguments)
+		(setq res (cons (cons 'put
+				      (cons (list 'quote (car arguments))
+					    '((quote my-property) t)))
+				res)
+		      arguments (cdr arguments)))
+	      (cons 'progn res))))
+ + - = floor ceiling round)
+@end example
+
+This expands to: 
+
+@example
+(progn
+  (put 'round 'my-property t)
+  (put 'ceiling 'my-property t)
+  (put 'floor 'my-property t)
+  (put '= 'my-property t)
+  (put '- 'my-property t)
+  (put '+ 'my-property t))
+@end example
+
+In practice, almost all Lisp macros have names, and they are usually
+defined with the special operator @code{defmacro}.
 
 @defspec defmacro name argument-list body-forms@dots{}
 @code{defmacro} defines the symbol @var{name} as a macro that looks
@@ -214,7 +243,7 @@
 
   Backquote allows you to quote a list, but selectively evaluate
 elements of that list.  In the simplest case, it is identical to the
-special form @code{quote} (@pxref{Quoting}).  For example, these
+special operator @code{quote} (@pxref{Quoting}).  For example, these
 two forms yield identical results:
 
 @example
--- a/man/lispref/numbers.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/numbers.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -9,13 +9,13 @@
 @cindex integers
 @cindex numbers
 
-  XEmacs supports two to five numeric data types.  @dfn{Integers} and
+  XEmacs supports two to five numeric data types.  @dfn{Fixnums} and
 @dfn{floating point numbers} are always supported.  As a build-time
 option, @dfn{bignums}, @dfn{ratios}, and @dfn{bigfloats} may be
 enabled on some platforms.
 
-  Integers, which are what Common Lisp calls
-@dfn{fixnums}, are whole numbers such as @minus{}3, 0, #b0111, #xFEED,
+  Fixnums (called just @dfn{integers} in GNU Emacs and older versions
+of XEmacs) are whole numbers such as @minus{}3, 0, #b0111, #xFEED,
 #o744.  Their values are exact, and their range is limited.  The
 number prefixes `#b', `#o', and `#x' are supported to represent numbers
 in binary, octal, and hexadecimal notation (or radix).  Floating point
@@ -52,14 +52,15 @@
 The exact rules are more carefully explained elsewhere
 (@pxref{Canonicalization and Contagion}).
 
-  Note that the term ``integer'' is used throughout the XEmacs
-documentation and code to mean ``fixnum''.  This is inconsistent with
-Common Lisp, and likely to cause confusion.  Similarly, ``float'' is
-used to mean ``fixed precision floating point number'', and the Common
-Lisp distinctions among @dfn{short-floats}, @dfn{long-floats},
-@emph{etc.}, and bigfloats (which are not standardized in Common Lisp)
-are not reflected in XEmacs terminology.  (Volunteers to fix this in the
-XEmacs manuals would be heartily welcomed.)
+  Common Lisp terminology and historical Emacs terminology conflict
+here, to an extent.  We attempt to use ``fixnum'' and ``integer''
+consistently, but older XEmacs and GNU Emacs code and documentation use
+the latter to mean the former.  ``Float'' is used in Emacs documentation
+to mean ``fixed precision floating point number'', and the Common Lisp
+distinctions among @dfn{short-floats}, @dfn{long-floats}, @emph{etc.},
+and bigfloats (which are not standardized in Common Lisp) are not
+reflected in XEmacs terminology.  We're working on this, but volunteers
+to fix it in the XEmacs manuals would be heartily welcomed.
 
 @menu
 * Integer Basics::            Representation and range of integers.
@@ -541,12 +542,11 @@
 yet.)
 
 @item
-Terminology is not Common-Lisp-conforming.  For example, ``integer'' for
-Emacs Lisp means what Common Lisp calls ``fixnum''.  This issue is being
-investigated, but the use of ``integer'' for fixnum is pervasive and may
-cause backward-compatibility and GNU-Emacs-compatibility problems.
-There are similar issues for floating point numbers.  Since Emacs Lisp
-has not had a ratio type before, there should be no problems there.
+Our documentation's terminology, and our API terminology, is not always
+Common-Lisp-conforming.  Many places use ``integer'' where ``fixnum''
+better reflects what the code accepts or produces; there are similar
+issues for the varying types of floating point numbers.  Since Emacs
+Lisp has not had a ratio type before, there are no problems there.
 
 @item
 An atom with ratio read syntax now returns a number, not a symbol.
@@ -759,8 +759,8 @@
 @b{Common Lisp note:} Comparing numbers in Common Lisp always requires
 @code{=} because Common Lisp implements multi-word integers, and two
 distinct integer objects can have the same numeric value.  XEmacs Lisp
-can have just one integer object for any given value because it has a
-limited range of integer values.
+can have just one fixnum object for any given value because it has a
+limited range of fixnum values.
 @end quotation
 
 In addition to numbers, all of the following functions also accept
@@ -914,7 +914,8 @@
 
   It is important to note that in XEmacs Lisp, arithmetic functions
 do not check for overflow.  Thus @code{(1+ 134217727)} may evaluate to
-@minus{}134217728, depending on your hardware.
+@minus{}134217728, depending on your hardware and whether your XEmacs
+supports bignums.
 
 @defun 1+ number
 This function returns @var{number} plus one.  @var{number} may be a
--- a/man/lispref/objects.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/objects.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -290,31 +290,25 @@
 @node Integer Type
 @subsection Integer Type
 
-  The range of values for integers in XEmacs Lisp is @minus{}134217728 to
-134217727 (28 bits; i.e.,
-@ifinfo
--2**27
-@end ifinfo
-@tex
-$-2^{27}$
-@end tex
-to
-@ifinfo
-2**27 - 1)
-@end ifinfo
-@tex
-$2^{28}-1$)
-@end tex
-on most machines.  (Some machines, in particular 64-bit machines such as
-the DEC Alpha, may provide a wider range.)  It is important to note that
-the XEmacs Lisp arithmetic functions do not check for overflow.  Thus
-@code{(1+ 134217727)} is @minus{}134217728 on most machines. (However,
-you @emph{will} get an error if you attempt to read an out-of-range
-number using the Lisp reader.)
-
-  The read syntax for integers is a sequence of (base ten) digits with
-an optional sign at the beginning. (The printed representation produced
-by the Lisp interpreter never has a leading @samp{+}.)
+  In XEmacs Lisp, integers can be fixnums (that is, fixed-precision
+integers) or bignums (arbitrary-precision integers), if compile-time
+configuration supports this.  The read syntax for the two types is the
+same, the type chosen depending on the numeric values involved.
+
+  The range of values for fixnums in XEmacs Lisp is given by the
+constants @code{most-positive-fixnum} and @code{most-negative-fixnum}.
+On 32-bit machines, these constants reflect 31 value bits, ranging from
+@minus{}1073741824 to 1073741823.
+
+  In the absence of @xref{The Bignum Extension}, XEmacs Lisp
+arithmetic functions do not check for overflow; so the code snippet
+@code{(= most-negative-fixnum (1+ most-positive-fixnum))} will give
+@code{t}.  However, you @emph{will} get an error if you attempt to read
+an out-of-range number using the Lisp reader.
+
+  The main read syntax for integers is a sequence of base ten digits
+with an optional sign at the beginning. (The printed representation
+produced by the Lisp interpreter never has a leading @samp{+}.)
 
 @example
 @group
@@ -1022,7 +1016,7 @@
 read syntax; see @ref{String Type}, @ref{Vector Type}, and @ref{Bit
 Vector Type}.
 
-  An array may have any length up to the largest integer; but once
+  An array may have any length up to the largest fixnum; but once
 created, it has a fixed size.  The first element of an array has index
 zero, the second element has index 1, and so on.  This is called
 @dfn{zero-origin} indexing.  For example, an array of four elements has
@@ -1223,15 +1217,15 @@
 
 @node Primitive Function Type
 @subsection Primitive Function Type
-@cindex special forms
+@cindex special operators
 
   A @dfn{primitive function} is a function callable from Lisp but
 written in the C programming language.  Primitive functions are also
 called @dfn{subrs} or @dfn{built-in functions}.  (The word ``subr'' is
 derived from ``subroutine''.)  Most primitive functions evaluate all
 their arguments when they are called.  A primitive function that does
-not evaluate all its arguments is called a @dfn{special form}
-(@pxref{Special Forms}).@refill
+not evaluate all its arguments is called a @dfn{special operator}
+(@pxref{Special Operators}).@refill
 
   It does not matter to the caller of a function whether the function is
 primitive.  However, this does matter if you try to substitute a
@@ -1320,7 +1314,7 @@
 @example
 @group
 (make-hash-table :size 50)
-     @result{} #<hash-table 0/107 0x313a>
+     @result{} #<hash-table :size 0/107 0x3babb0e4>
 @end group
 @end example
 
@@ -1331,7 +1325,7 @@
 @subsection Range Table Type
 @cindex range table type
 
-  A @dfn{range table} is a table that maps from ranges of integers to
+  A @dfn{range table} is a table that maps from ranges of fixnums to
 arbitrary Lisp objects.  Range tables automatically combine overlapping
 ranges that map to the same Lisp object, and operations are provided
 for mapping over all of the ranges in a range table.
@@ -1714,7 +1708,7 @@
 @subsection Syntax Table Type
 
   Under XEmacs 20, a @dfn{syntax table} is a particular type of char
-table.  Under XEmacs 19, a syntax table a vector of 256 integers.  In
+table.  Under XEmacs 19, a syntax table is a vector of 256 integers.  In
 both cases, each element defines how one character is interpreted when it
 appears in a buffer.  For example, in C mode (@pxref{Major Modes}), the
 @samp{+} character is punctuation, but in Lisp mode it is a valid
@@ -2245,7 +2239,7 @@
 change in one will be reflected by the same change in the other.
 
 @code{eq} returns @code{t} if @var{object1} and @var{object2} are
-integers with the same value.  It is preferable to use @code{=} or
+fixnums with the same value.  It is preferable to use @code{=} or
 @code{eql} in many contexts for numeric comparison, especially since
 bignums (integers with values that would have otherwise overflowed, only
 available on some builds) with the same value are not @code{eq};
@@ -2424,3 +2418,56 @@
 
   The test for equality is implemented recursively, and circular lists may
 therefore cause infinite recursion (leading to an error).
+
+@defun equalp object1 object2
+This function is like @code{equal}, but compares characters and strings
+case-insensitively; numbers are compared using @code{=}; arrays (that
+is, strings, bit-vectors and vectors) are regarded as being
+@code{equalp} if their contents are @code{equalp}; and
+@code{hash-tables} are @code{equalp} if their values are @code{equalp}
+and they would otherwise be @code{equal}.
+
+@code{equalp} is recursive with vectors, lists and hash-tables, but not
+with other complex types.  For types without a defined @code{equalp}
+behavior, @code{equalp} behaves as @code{equal} does. 
+
+@example
+@group
+(equalp "asdf" "ASDF")
+     @result{} t
+@end group
+@group
+(equalp "asdf" [?a ?s ?D ?F])
+     @result{} t
+@end group
+@group
+(equalp "asdf" [?a ?s ?D ?F ?g])
+     @result{} nil
+@end group
+@group
+(equalp "" (bit-vector))
+     @result{} t
+@end group
+@group
+(equalp #s(hash-table) (make-hash-table))
+     @result{} t
+@end group
+@group
+(equalp #s(hash-table data (t "hi there"))
+	(let ((ht (make-hash-table)))
+	  (puthash t "HI THERE" ht)
+	  ht))
+     @result{} t
+@group
+@end group
+(equalp #s(hash-table test eq data (1.0 "hi there"))
+	(let ((ht (make-hash-table :test 'eql)))
+	  (puthash 1.0 "HI THERE" ht)
+	  ht))
+     @result{} nil
+@end group
+@end example
+@end defun
+
+@code{equalp} can also provoke an error if handed a circular structure,
+as with @code{equal}. 
--- a/man/lispref/os.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/os.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -419,7 +419,7 @@
 @deffn Command kill-emacs &optional exit-data
 This function exits the XEmacs process and kills it.
 
-If @var{exit-data} is an integer, then it is used as the exit status
+If @var{exit-data} is a fixnum, then it is used as the exit status
 of the XEmacs process.  (This is useful primarily in batch operation; see
 @ref{Batch Mode}.)
 
@@ -765,7 +765,7 @@
 on the effective @sc{uid}, not the real @sc{uid}.
 
 If you specify @var{uid}, the value is the user name that corresponds
-to @var{uid} (which should be an integer).
+to @var{uid} (which should be a fixnum).
 
 @example
 @group
@@ -884,7 +884,7 @@
 @c Emacs 19 feature
 The argument @var{time-value}, if given, specifies a time to format
 instead of the current time.  The argument should be a list whose first
-two elements are integers.  Thus, you can use times obtained from
+two elements are fixnums.  Thus, you can use times obtained from
 @code{current-time} (see below) and from @code{file-attributes}
 (@pxref{File Attributes}).
 
@@ -935,15 +935,15 @@
 
 The argument @var{time-value}, if given, specifies a time to analyze
 instead of the current time.  The argument should be a cons cell
-containing two integers, or a list whose first two elements are
-integers.  Thus, you can use times obtained from @code{current-time}
+containing two fixnums, or a list whose first two elements are
+fixnums.  Thus, you can use times obtained from @code{current-time}
 (see above) and from @code{file-attributes} (@pxref{File Attributes}).
 @end defun
 
 @node Time Conversion
 @section Time Conversion
 
-  These functions convert time values (lists of two or three integers)
+  These functions convert time values (lists of two or three fixnums)
 to strings or to calendrical information.  There is also a function to
 convert calendrical information to a time value.  You can get time
 values from the functions @code{current-time} (@pxref{Time of Day}) and
--- a/man/lispref/positions.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/positions.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -505,7 +505,7 @@
 @var{pixels} is negative.  The optional second argument @var{window} is
 the window to move in, and defaults to the selected window.  The
 optional third argument @var{how} specifies the stopping condition.  A
-negative integer indicates that the motion should be no more
+negative fixnum indicates that the motion should be no more
 than @var{pixels}.  A positive value indicates that the
 motion should be at least @var{pixels}.  Any other value indicates
 that the motion should be as close as possible to @var{pixels}.
@@ -758,7 +758,7 @@
   It is often useful to move point ``temporarily'' within a localized
 portion of the program, or to switch buffers temporarily.  This is
 called an @dfn{excursion}, and it is done with the @code{save-excursion}
-special form.  This construct saves the current buffer and its values of
+special operator.  This construct saves the current buffer and its values of
 point and the mark so they can be restored after the completion of the
 excursion.
 
@@ -770,13 +770,13 @@
 @cindex mark excursion
 @cindex point excursion
 @cindex current buffer excursion
-The @code{save-excursion} special form saves the identity of the current
+The @code{save-excursion} special operator saves the identity of the current
 buffer and the values of point and the mark in it, evaluates
 @var{forms}, and finally restores the buffer and its saved values of
 point and the mark.  All three saved values are restored even in case of
 an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
 
-The @code{save-excursion} special form is the standard way to switch
+The @code{save-excursion} special operator is the standard way to switch
 buffers or move point within one part of a program and avoid affecting
 the rest of the program.  It is used more than 500 times in the Lisp
 sources of XEmacs.
@@ -813,24 +813,24 @@
 @end defspec
 
 @defspec save-current-buffer forms@dots{}
-This special form is similar to @code{save-excursion} but it only
+This special operator is similar to @code{save-excursion} but it only
 saves and restores the current buffer.  Beginning with XEmacs 20.3,
 @code{save-current-buffer} is a primitive.
 @end defspec
 
 @defspec with-current-buffer buffer forms@dots{}
-This special form evaluates @var{forms} with @var{buffer} as the current
+This macro evaluates @var{forms} with @var{buffer} as the current
 buffer.  It returns the value of the last form.
 @end defspec
 
 @defspec with-temp-file filename forms@dots{}
-This special form creates a new buffer, evaluates @var{forms} there, and
+This macro creates a new buffer, evaluates @var{forms} there, and
 writes the buffer to @var{filename}.  It returns the value of the last form
 evaluated.
 @end defspec
 
 @defspec save-selected-window forms@dots{}
-This special form is similar to @code{save-excursion} but it saves and
+This macro is similar to @code{save-excursion} but it saves and
 restores the selected window and nothing else.
 @end defspec
 
@@ -894,7 +894,7 @@
 @end deffn
 
 @defspec save-restriction body@dots{}
-This special form saves the current bounds of the accessible portion,
+This special operator saves the current bounds of the accessible portion,
 evaluates the @var{body} forms, and finally restores the saved bounds,
 thus restoring the same state of narrowing (or absence thereof) formerly
 in effect.  The state of narrowing is restored even in the event of an
@@ -922,7 +922,7 @@
 value were outside the limits of the temporary narrowing, this would
 fail to restore it accurately.
 
-The @code{save-restriction} special form records the values of the
+The @code{save-restriction} special operator records the values of the
 beginning and end of the accessible portion as distances from the
 beginning and end of the buffer.  In other words, it records the amount
 of inaccessible text before and after the accessible portion.
--- a/man/lispref/processes.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/processes.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -757,7 +757,7 @@
 @code{process-connection-type} in @ref{Asynchronous Processes}.
 
   Some of the functions below take a @var{signal} argument, which
-identifies a signal to be sent.  It must be either an integer or a
+identifies a signal to be sent.  It must be either a fixnum or a
 symbol which names the signal, like @code{SIGSEGV}.
 
 @defun process-send-signal signal &optional process current-group
--- a/man/lispref/range-tables.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/range-tables.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -7,8 +7,8 @@
 @chapter Range Tables
 @cindex Range Tables
 
-A range table is a table that efficiently associated values with
-ranges of integers.
+A range table is a table that efficiently associates values with
+ranges of fixnums.
 
 Note that range tables have a read syntax, like this:
 
--- a/man/lispref/searching.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/searching.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -80,7 +80,7 @@
 to return the new position of point in that case, but some programs
 may depend on a value of @code{nil}.)
 
-If @var{count} is supplied (it must be an integer), then the search is
+If @var{count} is supplied (it must be a fixnum), then the search is
 repeated that many times (each time starting at the end of the previous
 time's match).  If @var{count} is negative, the search direction is
 backward.  If the successive searches succeed, the function succeeds,
@@ -1039,7 +1039,7 @@
 with.  If it is a string, that string is used.  It can also be a list of
 strings, to be used in cyclic order.
 
-If @var{repeat-count} is non-@code{nil}, it should be an integer.  Then
+If @var{repeat-count} is non-@code{nil}, it should be a fixnum.  Then
 it specifies how many times to use each of the strings in the
 @var{replacements} list before advancing cyclicly to the next one.
 
@@ -1459,23 +1459,10 @@
   You can save and restore the match data with @code{save-match-data}:
 
 @defspec save-match-data body@dots{}
-This special form executes @var{body}, saving and restoring the match
+This special operator executes @var{body}, saving and restoring the match
 data around it.
 @end defspec
 
-  You can use @code{set-match-data} together with @code{match-data} to
-imitate the effect of the special form @code{save-match-data}.  This is
-useful for writing code that can run in Emacs 18.  Here is how:
-
-@example
-@group
-(let ((data (match-data)))
-  (unwind-protect
-      @dots{}   ; @r{May change the original match data.}
-    (set-match-data data)))
-@end group
-@end example
-
   Emacs automatically saves and restores the match data when it runs
 process filter functions (@pxref{Filter Functions}) and process
 sentinels (@pxref{Sentinels}).
--- a/man/lispref/specifiers.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/specifiers.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -876,7 +876,7 @@
 @end defun
 
 @defspec let-specifier specifier-list &rest body
-This special form temporarily adds specifications to specifiers,
+This macro temporarily adds specifications to specifiers,
 evaluates forms in @var{body} and restores the specifiers to their
 previous states.  The specifiers and their temporary specifications are
 listed in @var{specifier-list}.
@@ -892,11 +892,10 @@
 @var{locale}.  @var{locale}, @var{tag-set} and @var{how-to-add} have the
 same meaning as in @code{add-spec-to-specifier}.
 
-This special form is implemented as a macro; the code resulting from
-macro expansion will add specifications to specifiers using
-@code{add-spec-to-specifier}.  After forms in @var{body} are evaluated,
-the temporary specifications are removed and old specifier spec-lists
-are restored.
+The code resulting from macro expansion will add specifications to
+specifiers using @code{add-spec-to-specifier}.  After forms in
+@var{body} are evaluated, the temporary specifications are removed and
+old specifier spec-lists are restored.
 
 @var{locale}, @var{tag-set} and @var{how-to-add} may be omitted, and
 default to @code{nil}.  The value of the last form in @var{body} is
--- a/man/lispref/strings.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/strings.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -145,7 +145,7 @@
 @defun make-string length character
 This function returns a new string consisting entirely of @var{length}
 successive copies of @var{character}.  @var{length} must be a
-non-negative integer.
+non-negative fixnum.
 
 @example
 (make-string 5 ?x)
@@ -224,7 +224,7 @@
 @xref{Duplicable Extents}.
 
 A @code{wrong-type-argument} error is signaled if either @var{start} or
-@var{end} is not an integer or @code{nil}.  An @code{args-out-of-range}
+@var{end} is not a fixnum or @code{nil}.  An @code{args-out-of-range}
 error is signaled if @var{start} indicates a character following
 @var{end}, or if either integer is out of range for @var{string}.
 
@@ -246,8 +246,8 @@
 @example
 (concat "abc" "-def")
      @result{} "abc-def"
-(concat "abc" (list 120 (+ 256 121)) [122])
-     @result{} "abcxyz"
+(equal (concat "abc" (list 120 (+ 256 121)) [122]) (format "abcx%cz" 377))
+     @result{} t
 ;; @r{@code{nil} is an empty sequence.}
 (concat "abc" nil "-def")
      @result{} "abc-def"
@@ -258,30 +258,9 @@
 @end example
 
 @noindent
-The second example above shows how characters stored in strings are
-taken modulo 256.  In other words, each character in the string is
-stored in one byte.
-
 The @code{concat} function always constructs a new string that is
 not @code{eq} to any existing string.
 
-When an argument is an integer (not a sequence of integers), it is
-converted to a string of digits making up the decimal printed
-representation of the integer.  @strong{Don't use this feature; we plan
-to eliminate it.  If you already use this feature, change your programs
-now!}  The proper way to convert an integer to a decimal number in this
-way is with @code{format} (@pxref{Formatting Strings}) or
-@code{number-to-string} (@pxref{String Conversion}).
-
-@example
-@group
-(concat 137)
-     @result{} "137"
-(concat 54 321)
-     @result{} "54321"
-@end group
-@end example
-
 For information about other concatenation functions, see the description
 of @code{mapconcat} in @ref{Mapping Functions}, @code{vconcat} in
 @ref{Vectors}, @code{bvconcat} in @ref{Bit Vectors}, and @code{append}
@@ -1189,7 +1168,7 @@
 @item syntax
 Used for syntax tables, which specify the syntax of a particular
 character.  Higher-level Lisp functions are provided for
-working with syntax tables.  The valid values are integers.
+working with syntax tables.  The valid values are fixnums.
 @end table
 
 @defun char-table-type char-table
--- a/man/lispref/symbols.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/symbols.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -132,7 +132,7 @@
 @section Defining Symbols
 @cindex definition of a symbol
 
-  A @dfn{definition} in Lisp is a special form that announces your
+  A @dfn{definition} in Lisp is a special operator that announces your
 intention to use a certain symbol in a particular way.  In XEmacs Lisp,
 you can define a symbol as a variable, or define it as a function (or
 macro), or both independently.
@@ -143,7 +143,7 @@
 supply an initial value for the variable, plus documentation for the
 variable.
 
-  @code{defvar} and @code{defconst} are special forms that define a
+  @code{defvar} and @code{defconst} are special operators that define a
 symbol as a global variable.  They are documented in detail in
 @ref{Defining Variables}.
 
--- a/man/lispref/text.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/text.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -1679,7 +1679,7 @@
 @var{force} is the special value @code{coerce}, it says to add
 whitespace at the end of the line to reach that column.
 
-If @var{column} is not a non-negative integer, an error is signaled.
+If @var{column} is not a non-negative fixnum, an error is signaled.
 
 The return value is the column number actually moved to.
 @end defun
@@ -2698,7 +2698,7 @@
 @var{contents})}.  Normally, there is one element for each XEmacs
 register that has been used.
 
-The object @var{name} is a character (an integer) identifying the
+The object @var{name} is a character identifying the
 register.  The object @var{contents} is a string, marker, or list
 representing the register contents.  A string represents text stored in
 the register.  A marker represents a position.  A list represents a
--- a/man/lispref/variables.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/variables.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -128,7 +128,7 @@
 
   For example, when a function is called, its argument variables receive
 new local values that last until the function exits.  The @code{let}
-special form explicitly establishes new local values for specified
+special operator explicitly establishes new local values for specified
 variables; these last until exit from the @code{let} form.
 
 @cindex shadowing of variables
@@ -144,7 +144,7 @@
 speak of a @dfn{local binding} of the variable as well as a local value.
 
   The local binding is a conceptual place that holds a local value.
-Entry to a function, or a special form such as @code{let}, creates the
+Entry to a function, or a special operator such as @code{let}, creates the
 local binding; exit from the function or from the @code{let} removes the
 local binding.  As long as the local binding lasts, the variable's value
 is stored within it.  Use of @code{setq} or @code{set} while there is a
@@ -165,11 +165,11 @@
 Ordinary evaluation of a symbol always returns the value of its current
 binding.
 
-  The special forms @code{let} and @code{let*} exist to create
+  The special operators @code{let} and @code{let*} exist to create
 local bindings.
 
 @defspec let (bindings@dots{}) forms@dots{}
-This special form binds variables according to @var{bindings} and then
+This special operator binds variables according to @var{bindings} and then
 evaluates all of the @var{forms} in textual order.  The @code{let}-form
 returns the value of the last form in @var{forms}.
 
@@ -199,7 +199,7 @@
 @end defspec
 
 @defspec let* (bindings@dots{}) forms@dots{}
-This special form is like @code{let}, but it binds each variable right
+This special operator is like @code{let}, but it binds each variable right
 after computing its local value, before computing the local value for
 the next variable.  Therefore, an expression in @var{bindings} can
 reasonably refer to the preceding symbols bound in this @code{let*}
@@ -376,7 +376,7 @@
 @cindex variable definition
 
   You may announce your intention to use a symbol as a global variable
-with a @dfn{variable definition}: a special form, either @code{defconst}
+with a @dfn{variable definition}: a special operator, either @code{defconst}
 or @code{defvar}.
 
   In XEmacs Lisp, definitions serve three purposes.  First, they inform
@@ -404,7 +404,7 @@
 this reason, user options must be defined with @code{defvar}.
 
 @defspec defvar symbol [value [doc-string]]
-This special form defines @var{symbol} as a value and initializes it.
+This special operator defines @var{symbol} as a value and initializes it.
 The definition informs a person reading your code that @var{symbol} is
 used as a variable that programs are likely to set or change.  It is
 also used for all user option variables except in the preloaded parts of
@@ -475,7 +475,7 @@
 @end group
 @end example
 
-Here is an equivalent expression for the @code{defvar} special form:
+Here is an equivalent expression for the @code{defvar} special operator:
 
 @example
 @group
@@ -494,7 +494,7 @@
 @end defspec
 
 @defspec defconst symbol [value [doc-string]]
-This special form defines @var{symbol} as a value and initializes it.
+This special operator defines @var{symbol} as a value and initializes it.
 It informs a person reading your code that @var{symbol} has a global
 value, established here, that will not normally be changed or locally
 bound by the execution of the program.  The user, however, may be
@@ -553,7 +553,7 @@
   @strong{Warning:} If the @code{defconst} and @code{defvar} special
 forms are used while the variable has a local binding, they set the
 local binding's value; the global binding is not changed.  This is not
-what we really want.  To prevent it, use these special forms at top
+what we really want.  To prevent it, use these special operators at top
 level in a file, where normally no local binding is in effect, and make
 sure to load the file before making a local binding for the variable.
 
@@ -616,7 +616,7 @@
 run time, use the function @code{set}.
 
 @defspec setq [symbol form]@dots{}
-This special form is the most common method of changing a variable's
+This special operator is the most common method of changing a variable's
 value.  Each @var{symbol} is given a new value, which is the result of
 evaluating the corresponding @var{form}.  The most-local existing
 binding of the symbol is changed.
@@ -1232,7 +1232,7 @@
 this variable.
 
 @c Emacs 19 feature
-  The special forms @code{defvar} and @code{defconst} also set the
+  The special operators @code{defvar} and @code{defconst} also set the
 default value (if they set the variable at all), rather than any local
 value.
 
--- a/man/lispref/windows.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/lispref/windows.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -443,7 +443,7 @@
 @end defun
 
 @defspec save-selected-window forms@dots{}
-This special form records the selected window, executes @var{forms} in
+This macro records the selected window, executes @var{forms} in
 sequence, then restores the earlier selected window.  It does not save
 or restore anything about the sizes, arrangement or contents of windows;
 therefore, if the @var{forms} change them, the changes are permanent.
@@ -1955,7 +1955,7 @@
 @end defun
 
 @defspec save-window-excursion forms@dots{}
-This special form records the window configuration, executes @var{forms}
+This macro records the window configuration, executes @var{forms}
 in sequence, then restores the earlier window configuration.  The window
 configuration includes the value of point and the portion of the buffer
 that is visible.  It also includes the choice of selected window.
--- a/man/term.texi	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +0,0 @@
-@\input texinfo @c -*-texinfo-*-
-@setfilename ../info/term.info
-@settitle XEmacs Terminal Emulator Mode
-
-@titlepage
-@sp 6
-@center @titlefont(XEmacs Terminal Emulator Mode)
-@end titlepage
-
-@ifinfo
-@dircategory XEmacs Editor
-@direntry
-* Term mode: (term).		XEmacs Terminal Emulator Mode.
-@end direntry
-
-@node Top, , (DIR)
-@top Terminal emulator mode
-@end ifinfo
-
-This is some notes about the term Emacs mode.
-
-@menu
-* term mode::
-@end menu
-
-@node term mode
-@chapter XEmacs Terminal Emulator Mode
-
-@menu
-* Overview::
-* Connecting to remote computers::
-* Paging::
-* Terminal escapes::
-@end menu
-
-The @code{term} package includes the major modes @code{term},
-@code{shell}, and @code{gud} (for running gdb or another debugger).
-It is a replacement for the comint mode of Emacs 19,
-as well as shell, gdb, terminal, and telnet modes.
-The package works best with recent releases of Emacs 19,
-but will also work reasonably well with Emacs 18 as well as Lucid Emacs 19.
-
-The file @code{nshell.el} is a wrapper to use unless term mode
-is built into Emacs.  If works around some of the missing
-in older Emacs versions.
-To use it, edit the paths in @code{nshell.el}, appropriately,
-and then @code{M-x load-file nshell.el RET}.
-This will also load in replacement shell and gud modes.
-
-@node Overview
-@section Overview
-
-The @code{term} mode is used to control a program (an "inferior process").
-It sends most keyboard input characters to the program,
-and displays output from the program in the buffer.
-This is similar to the traditional comint mode, and
-modes derived from it (such as shell and gdb modes).
-You can do with the new term-based shell the same sort
-of things you could do with the old shell mode,
-using more or less the same interface.  However, the
-new mode is more flexible, and works somewhat differently.
-
-@menu
-* Output from the inferior::
-* subbuffer:: The sub-buffer
-* altsubbuffer:: The alternate sub-buffer
-* Input to the inferior::
-@end menu
-
-@node Output from the inferior
-@subsection Output from the inferior
-
-In typical usage, output from the inferior is
-added to the end of the buffer.  If needed, the window
-will be scrolled, just like a regular terminal.
-(Only one line at a time will be scrolled, just like
-regular terminals, and in contrast to the old shell mode.)
-Thus the buffer becomes a log of your interaction with the
-inferior, just like the old shell mode.
-
-Like a real terminal, term maintains a "cursor position."
-This is the @code{process-mark} of the inferior process.
-If the process-mark is not at the end of the buffer, output from
-the inferior will overwrite existing text in the buffer.
-This is like a real terminal, but unlike the old shell mode
-(which inserts the output, instead of overwriting).
-
-Some programs (such as Emacs itself) need to control the
-appearance on the screen in detail.  They do this by
-sending special control codes.  The exact control
-codes needed from terminal to terminal, but nowadays
-most terminals and terminal emulators (including xterm)
-understand the so-called "ANSI escape sequences" (first
-popularized by the Digital's VT100 family of terminal).
-The term mode also understands these escape sequences,
-and for each control code does the appropriate thing
-to change the buffer so that the appearance of the window
-will match what it would be on a real terminal.
-(In contrast, the old shell mode doesn't handle
-terminal control codes at all.)
-
-See <...> for the specific control codes.
-
-@node subbuffer
-@subsection The sub-buffer
-
-A program that talks to terminal expects the terminal to have a fixed size. 
-If the program is talking a terminal emulator program such as @code{xterm},
-that size can be changed (if the xterm window is re-sized), but programs
-still assume a logical terminal that has a fixed size independent
-of the amount of output transmitted by the programs.
-
-To programs that use it, the Emacs terminal emulator acts as if it
-too has a fixed size.  The @dfn{sub-buffer} is the part of a @code{term}-mode
-buffer that corresponds to a "normal" terminal.  Most of the time
-(unless you explicitly scroll the window displaying the buffer),
-the sub-buffer is the part of the buffer that is displayed in a window.
-
-The sub-buffer is defined in terms of three buffer-local-variable:
-
-@defvar term-height
-The height of the sub-buffer, in screen lines.
-@end defvar
-
-@defvar term-width
-The width of the sub-buffer, in screen columns.
-@end defvar
-
-@defvar term-home-marker
-The "home" position, that is the top left corner of the sub-buffer.
-@end defvar
-
-The sub-buffer is assumed to be the end part of the buffer;
-the @code{term-home-marker} should never be more than
-@code{term-height} screen lines from the end of the buffer.
-
-@node altsubbuffer
-@subsection The alternate sub-buffer
-
-When a "graphical" program finishes, it is nice to
-restore the screen state to what it was before the program started.
-Many people are used to this behavior from @code{xterm}, and
-its also offered by the @code{term} emulator.
-
-@defun term-switch-to-alternate-sub-buffer set
-If @var{set} is true, and we're not already using the alternate sub-buffer,
-switch to it.  What this means is that the @code{term-home-marker}
-is saved (in the variable @code{term-saved-home-marker}), and the
-@code{term-home-marker} is set to the end of the buffer.
-
-If @var{set} is false and we're using the alternate sub-buffer,
-switch back to the saved sub-buffer.  What this means is that the
-(current, alternate) sub-buffer is deleted (using
-@code{(delete-region term-home-marker (point-max))}), and then the
-@code{term-home-marker} is restored (from @code{term-saved-home-marker}).
-@end defun
-
-@node Input to the inferior
-@subsection Input to the inferior
-
-Characters typed by the user are sent to the inferior.
-How this is done depends on whether the @code{term} buffer
-is in "character" mode or "line" mode.
-(A @code{term} buffer can also be in "pager" mode.
-This is discussed <later>.)
-Which of these is currently active is specified in the mode line.
-The difference between them is the key-bindings available.
-
-In character mode, one character (by default @key{C-c}) is special,
-and is a prefix for various commands.  All other characters are
-sent directly to the inferior process, with no interpretation by Emacs.
-Character mode looks and feels like a real terminal, or a conventional
-terminal emulator such as xterm.
-
-In line mode, key commands mostly have standard Emacs actions.
-Regulars characters insert themselves into the buffer.
-When return is typed, the entire current line of the buffer
-(except possibly the prompt) is sent to the inferior process.
-Line mode is basically the original shell mode from earlier Emacs versions.
-
-To switch from line mode to character mode type @kbd{C-c C-k}.
-To switch from character mode to line mode type @kbd{C-c C-j}.
-
-In either mode, "echoing" of user input is handled by the inferior.
-Therefor, in line mode after an input line at the end of the buffer
-is sent to the inferior, it is deleted from the buffer.
-This is so that the inferior can echo the input, if it wishes
-(which it normally does).
-
-@node Connecting to remote computers
-@section Connecting to remote computers
-
-If you want to login to a remove computer, you can do that just as
-you would expect, using whatever commands you would normally use.
-
-(This is worth emphasizing, because earlier versions of @code{shell}
-mode would not work properly if you tried to log in to some other
-computer, because of the way echoing was handled.  That is why
-there was a separate @code{telnet} mode to partially compensate for
-these problems.  The @code{telnet} mode is no longer needed, and
-is basically obsolete.)
-
-A program that asks you for a password will normally suppress
-echoing of the password, so the password will not show up in the buffer.
-This will happen just as if you were using a real terminal, if
-the buffer is in char mode.  If it is in line mode, the password
-will be temporarily visible, but will be erased when you hit return.
-(This happens automatically; there is no special password processing.)
-
-When you log in to a different machine, you need to specify the
-type of terminal your using.   If you are talking to a Bourne-compatible
-shell, and your system understands the @code{TERMCAP} variable,
-you can use the command @kbd{M-x shell-send-termcap}, which
-sends a string specifying the terminal type and size.
-(This command is also useful after the window has changed size.)
-
-If you need to specify the terminal type manually, you can try the
-terminal types "ansi" or "vt100".
-
-You can of course run gdb on that remote computer.  One useful
-trick:  If you invoke gdb with the @code{--fullname} option,
-it will send special commands to Emacs that will cause Emacs to
-pop up the source files you're debugging.  This will work
-whether or not gdb is running on a different computer than Emacs,
-assuming can access the source files specified by gdb.
-
-@node Paging
-@section Paging
-
-When the pager is enabled, Emacs will "pause" after each screenful
-of output (since the last input sent to the inferior).
-It will enter "pager" mode, which feels a lot like the "more"
-program:  Typing a space requests another screenful of output.
-Other commands request more or less output, or scroll backwards
-in the @code{term} buffer.  In pager mode, type @kbd{h} or @kbd{?}
-to display a help message listing all the available pager mode commands.
-
-In either character or line mode, type @kbd{C-c p} to enable paging,
-and @kbd{C-c D} to disable it.
-
-@node Terminal escapes
-@section Terminal Escape sequences
-
-A program that does "graphics" on a terminal controls the
-terminal by sending strings called @dfn{terminal escape sequences}
-that the terminal (or terminal emulator) interprets as special commands.
-The @code{term} mode includes a terminal emulator that understands
-standard ANSI escape sequences, originally popularized by VT100 terminals,
-and now used by the @code{xterm} program and most modern terminal
-emulator software.
-
-@menu
-* Cursor motion:: Escape sequences to move the cursor
-* Erasing:: Escape commands for erasing text
-* Inserting and deleting:: Escape sequences to insert and delete text
-* Scrolling:: Escape sequences to scroll part of the visible window
-* Command hook::
-* Miscellaneous escapes::
-@end menu
-
-printing chars
-
-tab
-
-LF
-
-@node Cursor motion
-@subsection Escape sequences to move the cursor
-
-@table @kbd
-@item RETURN
-Moves to the beginning of the current screen line.
-
-@item C-b
-Moves backwards one column.  (Tabs are broken up if needed.)
-@comment Line wrap FIXME
-
-@item Esc [ R ; C H
-Move to screen row R, screen column C, where (R=1) is the top row,
-and (C=1) is the leftmost column.  Defaults are R=1 and C=1.
-
-@item Esc [ N A
-Move N (default 1) screen lines up.
-@item Esc [ N B
-Move N (default 1) screen lines down.
-@item Esc [ N C
-Move N (default 1) columns right.
-@item Esc [ N D
-Move N (default 1) columns left.
-@end table
-
-@node Erasing
-@subsection Escape commands for erasing text
-
-These commands "erase" part of the sub-buffer.
-Erasing means replacing by white space; it is not the same as deleting.
-The relative screen positions of things that are not erased remain
-unchanged with each other, as does the relative cursor position.
-
-@table @kbd
-@item E [ J
-Erase from cursor to end of screen.
-@item E [ 0 J
-Same as E [ J.
-@item E [ 1 J
-Erase from home position to point.
-@item E [ 2 J
-Erase whole sub-buffer.
-@item E [ K
-Erase from point to end of screen line.
-@item E [ 0 K
-Same as E [ K.
-@item E [ 1 K
-Erase from beginning of screen line to point.
-@item E [ 2 K
-Erase whole screen line.
-@end table
-
-@node Inserting and deleting
-@subsection Escape sequences to insert and delete text
-
-@table @kbd
-@item Esc [ N L
-Insert N (default 1) blank lines.
-@item Esc [ N M
-Delete N (default 1) lines.
-@item Esc [ N P
-Delete N (default 1) characters.
-@item Esc [ N @@
-Insert N (default 1) spaces.
-@end table
-
-@node Scrolling
-@subsection Escape sequences to scroll part of the visible window
-
-@table @kbd
-@item Esc D
-Scroll forward one screen line.
-
-@item Esc M
-Scroll backwards one screen line.
-
-@item Esc [ T ; B r
-Set the scrolling region to be from lines T down to line B inclusive,
-where line 1 is the topmost line.
-@end table
-
-@node Command hook
-@subsection Command hook
-
-If @kbd{C-z} is seen, any text up to a following @key{LF} is scanned.
-The text in between (not counting the initial C-z or the final LF)
-is passed to the function that is the value of @code{term-command-hook}.
-
-The default value of the @code{term-command-hook} variable
-is the function @code{term-command-hook}, which handles the following:
-
-@table @kbd
-@item C-z C-z FILENAME:LINENUMBER:IGNORED LF
-Set term-pending-frame to @code{(cons "FILENAME" LINENUMBER)}.
-When the buffer is displayed in the current window, show
-the FILENAME in the other window, and show an arrow at LINENUMBER.
-Gdb emits these strings when invoked with the flag --fullname.
-This is used by gdb mode; you can also invoke gdb with this flag
-from shell mode.
-
-@item C-z / DIRNAME LF
-Set the directory of the term buffer to DIRNAME
-
-@item C-z ! LEXPR LF
-Read and evaluate LEXPR as a Lisp expression.
-The result is ignored.
-@end table
-
-@node Miscellaneous escapes
-@subsection Miscellaneous escapes
-
-@table @kbd
-@item C-g (Bell)
-Calls @code{(beep t)}.
-
-@item Esc 7
-Save cursor.
-
-@item Esc 8
-Restore cursor.
-
-@item Esc [ 47 h
-Switch to the alternate sub-buffer,
-@item Esc [ 47 l
-Switch back to the regular sub-buffer,
-@end table
-
-@bye
--- a/man/xemacs-faq.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/xemacs-faq.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -188,7 +188,8 @@
 * Advanced::              Advanced Customization Using XEmacs Lisp.
 * Other Packages::        Other External Packages.
 * Current Events::        What the Future Holds.
-* Legacy Versions::       New information about old XEmacsen.
+* Legacy Versions::       New Information about Old XEmacsen.
+* Bleeding Edge::         Working with XEmacs Source Code Repositories.
 
 @detailmenu
  --- The Detailed Node Listing ---
@@ -567,6 +568,27 @@
 * Q10.0.1::   Gnus 5.10 won't display smileys in XEmacs 21.1.
 * Q10.0.2::   XEmacs won't start on Windows in XEmacs 21.1.
 
+11 Working with XEmacs source code repositories
+
+11.0: The XEmacs repositories
+* Q11.0.1::   Where is the most recent XEmacs development code?
+* Q11.0.2::   Where is the most recent XEmacs stable code?
+* Q11.0.3::   Where is the most recent XEmacs package code?
+* Q11.0.4::   Why isn't @var{package} available? and what to do about it.
+* Q11.0.5::   How do I get commit access?
+
+11.1: Working with CVS
+* Q11.1.1::   How do I keep cool using CVS?
+
+11.2: Working with Mercurial
+* Q11.2.1::   What is Mercurial?
+* Q11.2.2::   Where do I get Mercurial?
+* Q11.2.3::   Do I really have to waste space on history?
+* Q11.2.4::   @code{hg diff} gives bizarre output.
+* Q11.2.5::   How do I recover from a bad commit?  (I already pushed.)
+* Q11.2.6::   How do I recover from a bad commit?  (I haven't pushed yet.)
+* Q11.2.7::   Testing patches with Mercurial Queues.
+
 @end detailmenu
 @end menu
 
@@ -7781,12 +7803,10 @@
 
 @emph{Interpreted} code, on the other hand, must expand these macros
 every time they are executed.  For this reason it is strongly
-recommended that code making heavy use of macros be compiled.  (The
-features labelled @dfn{Special Form} instead of @dfn{Function} in this
-manual are macros.)  A loop using @code{incf} a hundred times will
-execute considerably faster if compiled, and will also garbage-collect
-less because the macro expansion will not have to be generated, used,
-and thrown away a hundred times.
+recommended that code making heavy use of macros be compiled. A loop
+using @code{incf} a hundred times will execute considerably faster if
+compiled, and will also garbage-collect less because the macro expansion
+will not have to be generated, used, and thrown away a hundred times.
 
 You can find out how a macro expands by using the @code{cl-prettyexpand}
 function.
@@ -8585,7 +8605,7 @@
 @strong{Frame focus changes}: @code{focus-follows-mouse} works like FSF,
 prevents any attempt to permanently change the selected frame; new
 function @code{focus-frame} sets the window system focus a frame; new
-special forms @code{save-selected-frame} and @code{with-selected-frame}.
+macros @code{save-selected-frame} and @code{with-selected-frame}.
 
 @item
 @strong{Window function changes}: @code{select-window} now has optional
@@ -8671,7 +8691,7 @@
 For older news, see the file @file{ONEWS} in the @file{etc} directory of
 the XEmacs distribution.
 
-@node Legacy Versions,  , Current Events, Top
+@node Legacy Versions,  Bleeding Edge, Current Events, Top
 @unnumbered 10 New information about old XEmacsen
 
 This is part 10 of the XEmacs Frequently Asked Questions list.  It will
@@ -8747,4 +8767,550 @@
 binaries, but you can use the 21.1 binaries if you are very paranoid
 about stability.  @xref{Q1.1.2, Are binaries available?}.
 
+
+@node Bleeding Edge, , Legacy Versions, Top
+@unnumbered 10 Working with XEmacs Source Code Repositories.
+
+This is part 11 of the XEmacs Frequently Asked Questions list.  The
+primary purpose is advice on use of the version control systems used to
+keep the history of XEmacs development.
+
+@menu
+11.0: The XEmacs repositories
+* Q11.0.1::   Where is the most recent XEmacs development code?
+* Q11.0.2::   Where is the most recent XEmacs stable code?
+* Q11.0.3::   Where is the most recent XEmacs package code?
+* Q11.0.4::   Why isn't @var{package} available? and what to do about it.
+* Q11.0.5::   How do I get commit access?
+
+11.1: Working with CVS
+* Q11.1.1::   How do I keep cool using CVS?
+
+11.2: Working with Mercurial
+* Q11.2.1::   What is Mercurial?
+* Q11.2.2::   Where do I get Mercurial?
+* Q11.2.3::   Do I really have to waste space on history?
+* Q11.2.4::   @code{hg diff} gives bizarre output.
+* Q11.2.5::   How do I recover from a bad commit?  (I already pushed.)
+* Q11.2.6::   How do I recover from a bad commit?  (I haven't pushed yet.)
+* Q11.2.7::   Testing patches with Mercurial Queues.
+@end menu
+
+
+@node Q11.0.1, Q11.0.2, Bleeding Edge, Bleeding Edge
+@unnumberedsubsec Where is the most recent XEmacs development code?
+
+The most recent XEmacs @emph{development} code is kept in a Mercurial
+repository, hosted by the Debian project.  The read-only URL, for
+anybody who doesn't intend to push upstream directly, is
+
+@example
+http://hg.debian.org/hg/xemacs/xemacs
+@end example
+
+The read-write URL for committers is
+
+@example
+ssh://sperber-guest@@hg.debian.org//hg/xemacs/xemacs
+@end example
+
+Yes, Virginia, that doubled slash is correct.
+
+@xref{Q11.0.5, How do I get commit access?}.
+
+@xref{Q11.2.1, What is Mercurial?}.
+
+@node Q11.0.2, Q11.0.3, Q11.0.1, Bleeding Edge
+@unnumberedsubsec Where is the most recent XEmacs stable code?
+
+The most recent XEmacs @emph{stable} code is kept in a Mercurial
+repository, hosted by the Debian project.  The read-only URL is
+
+@example
+http://hg.debian.org/hg/xemacs/xemacs-21.4
+@end example
+
+If you're @emph{not} Vin, you don't need commit access.  If you
+@emph{are} Vin, you shouldn't need to refer to this FAQ.
+
+@xref{Q11.2.1, What is Mercurial?}.
+
+
+@node Q11.0.3, Q11.0.4, Q11.0.2, Bleeding Edge
+@unnumberedsubsec Where is the most recent XEmacs package code?
+
+The most recent XEmacs @emph{packages} code is kept in a CVS
+repository, hosted by the Debian project.  The read-only @code{CVSROOT},
+for anybody who doesn't intend to push upstream directly, is
+
+@example
+CVSROOT=:pserver:anonymous@@cvs.alioth.debian.org:/cvsroot/xemacs
+@end example
+
+The read-write @code{CVSROOT} for committers is
+
+@example
+CVSROOT=:ext:@var{aliothuser}@@cvs.alioth.debian.org:/cvsroot/xemacs
+@end example
+
+where @var{aliothuser} is your account on @code{alioth.debian.org}.  Then
+
+@example
+cvs checkout packages
+@end example
+
+as usual.  For more information, see
+@uref{http://www.xemacs.org/Develop/cvsaccess.html, XEmacs CVS Archive}
+on the website.
+
+@xref{Q11.1.1, How do I stay cool using CVS?}.
+
+@xref{Q11.0.5, How do I get commit access?}.
+
+
+@node Q11.0.4, Q11.0.5, Q11.0.3, Bleeding Edge
+@unnumberedsubsec Why isn't @var{package} available? and what to do about it.
+
+If a package isn't available from the Packages repository, probably
+nobody has shown enough interest to add it yet.  (Occasionally, there is
+a better package already in the XEmacs repository, of course.)
+
+The first step is to ask about it, and propose addition, on
+@email{xemacs-beta@@xemacs.org, the XEmacs Contributors list}.
+
+Most regular XEmacs contributors already shoulder primary responsibility
+for several packages, and contribute to maintenance of the rest, so you
+are unlikely to get a massively enthusiastic response unless you
+volunteer to become the maintainer of the version packaged for XEmacs
+yourself.  The duties are not terribly onerous if you're an active user
+of the package @ref{(xemacs-devguide)XEmacs Package Maintainer}.
+
+
+@node Q11.0.5, Q11.1.1, Q11.0.4, Bleeding Edge
+@unnumberedsubsec How do I get commit access?
+
+To get commit access to XEmacs code, write to
+@email{xemacs-review@@xemacs.org, the XEmacs Review Board} and request
+it.  Once approved, for the development code, you also need to send
+@email{mike@@xemacs.org, Michael Sperber} your SSH v2 RSA key (Alioth
+policy; v1 and DSA keys aren't acceptable).  A CC to
+@email{xemacs-services@@xemacs.org, the XEmacs Services team} is a good
+idea, although not absolutely necessary.  You should also get an Alioth
+account so that you can publish branches for review.
+
+For packages code, you must get an Alioth account.  Send your account
+name information to @email{xemacs-services@@xemacs.org, the XEmacs
+Services team}.
+
+The stable repository is gated; only the gatekeeper (currently Vin
+Shelton) has commit access.  Patches for the stable repository should be
+submitted to @email{xemacs-patches@@xemacs.org, XEmacs Patches}, as usual.
+
+@uref{http://www.xemacs.org/Develop/hgaccess.html, XEmacs Mercurial Archive}
+
+@uref{http://www.xemacs.org/Develop/cvsaccess.html, XEmacs CVS Archive}
+
+@xref{Q11.1.1, How do I stay cool using CVS?}.
+
+@xref{Q11.2.1, What is Mercurial?}.
+
+
+@node Q11.1.1, Q11.2.1, Q11.0.5, Bleeding Edge
+@unnumberedsubsec How do I keep cool using CVS?
+
+You don't.  CVS is just basically and in detail @emph{un}-cool.
+
+What would be really cool is if you would help us out in moving the
+packages repository to Mercurial.  Volunteer on
+@email{xemacs-beta@@xemacs.org, the XEmacs Contributors list}.  What's
+needed is to figure out how to provide a one step checkout for the whole
+package hierarchy, while restricting commits to one package at a time.
+
+For help using CVS, Google or ask on @email{xemacs-beta@@xemacs.org}.
+Please update this FAQ with one or two of the best references you find.
+
+
+@node Q11.2.1, Q11.2.2, Q11.1.1, Bleeding Edge
+@unnumberedsubsec What is Mercurial?
+
+Mercurial is a @dfn{distributed version control system}, or DVCS.  This
+means that versioning information can be easily exchanged between
+different lines of development, even if located on different hosts.  In
+the older @dfn{centralize version control system} model, when you
+@dfn{commit} a change, it is immediately reflected in the public
+repository.  In a DVCS, each user has a @dfn{local repository}, and
+the commit operation creates a version in that repository.  To
+communicate with the public repository, a separate @dfn{push} operation
+must be executed.  The DVCS model is more appropriate for open source
+development.
+
+@itemize
+@item
+The VCS model mirrors the development organization, where developers
+tend to work independently or in very small groups.
+
+@item
+Users without commit access can conveniently manage their local changes.
+
+@item
+Developers can work, and commit changes, while disconnected from the
+Internet.  Then they merge and push their changes later.
+@end itemize
+
+Use of a DVCS does require some changes in workflow, but the XEmacs
+developers consider that inconvenience to be far more than balanced by
+the advantages.
+
+
+@node Q11.2.2, Q11.2.3, Q11.2.1, Bleeding Edge
+@unnumberedsubsec Where do I get Mercurial?
+
+Most OS distributions (including add-on distributions like
+@uref{http://www.cygwin.com/, Cygwin} and
+@uref{http://www.macports.org/, MacPorts}) include Mercurial packages.
+Of course, you can get the source distribution, as well as pre-built
+packages for most major platforms, from
+@uref{http://mercurial.selenic.com/wiki/, the Mercurial developers}.
+
+
+@node Q11.2.3, Q11.2.4, Q11.2.2, Bleeding Edge
+@unnumberedsubsec Do I really have to waste space on history?
+
+Yes, you do.  It's really not that much, though.  In one of my current
+workspaces, I see
+
+@table @code
+@item XEmacs source files (and other cruft, such as editor backups)
+115464KB
+@item Build products
+49676
+@item Mercurial control files and history
+25644
+@end table
+
+That really does include all of the history available in the main XEmacs
+development branch, and the build products are near twice the size of
+all of the Mercurial-specific information.
+
+
+@node Q11.2.4, Q11.2.5, Q11.2.3, Bleeding Edge
+@unnumberedsubsec @code{hg diff} gives bizarre output.
+
+You may see an unreasonable diff (often large) that doesn't seem to
+reflect your work.
+
+This is usually due to using @code{hg diff} on a @dfn{merge commit}.
+That means the commit has multiple parents, and joins together two lines
+of development that occured concurrently.
+
+You're diffing against the "wrong" one; try the other one.  You get the
+relevent revision number or ID from @code{hg log}.  In more detail:
+
+When there is a merge in Mercurial, it will often be the case that
+one of the parents is the immediate predecessor of the merge
+commit.  @code{hg log} will report something like
+
+@example
+    changeset:   4789:56049bea9231    # revision D, below
+    parent:      4788:5cca06f930ea    # your commit
+    parent:      4787:6e6f7b79c1fc    # diff against this
+    user:        you (or somebody else)
+
+    changeset:   4788:5cca06f930ea    # revision B, below
+    parent:      4760:217abcf015c4    # revision A, below
+    user:        you
+
+    changeset:   4787:6e6f7b79c1fc    # revision C, below
+    parent:      4786:d6cfba1cc388
+    user:        somebody else
+@end example
+
+Note that the divergence took place a long time ago (r4760).
+It's natural to diff against (tip - 1), in the example above,
+@code{hg diff -r 4788}.  But this will give unexpected output!
+
+A picture of this history looks something like
+
+@example
+      B --- D
+     /     /
+    A ... C
+@end example
+
+where A is the common ancestor, B is the commit you did, C is the
+mainline at the time of the merge, and D is the merge commit.  The
+three dots between A and C can represent many commits, and a lot
+of work.  Given no conflicts in the merge, @code{hg diff -r C -r D} is
+the same as @code{hg diff -r A -r B}, @emph{i.e.}, it shows your work.
+Similarly, @code{hg diff -r B -r D} is the same as
+@code{hg diff -r A -r C}.  This latter diff is likely to be quite large,
+and it doesn't show your work.  Unfortunately, that is the typical
+result of diffing against the "previous" commit.
+
+@node Q11.2.5, Q11.2.6, Q11.2.4, Bleeding Edge
+@unnumberedsubsec How do I recover from a bad commit?  (I already pushed.)
+
+Once upon a time, an XEmacs developer wrote:
+
+ > GAAAAK!  What's the best way to restore ChangeLog and its history?
+
+He had just inadvertantly pushed a commit which deleted
+@file{src/ChangeLog}!  The history is still there, not to worry.  (In
+this case, another developer had restored src/ChangeLog already.)  The
+best way depends on a number of things.  First, let's look at the log
+and the state of the DAG (the graph of commits).  Here's the log,
+formatted somewhat differently from the usual output for compactness.
+
+@example
+5025    anne    Restore src/ChangeLog.
+5024    barb    merge
+        parents: 5023 5010
+5023    barb    Error-checking.
+5020    barb    merge
+        parents: 5019 5006 
+5019    barb    Fix non-Mule build.
+5011    barb    Some internals-manual updates.
+        parents: 5002
+5010    cary    Windows fixes for Visual Studio 6.
+        parents: 5008 5009
+5009    cary    Miscellaneous small fixes to Windows VS6 build.
+        parents: 5006
+5008    dana    Add license information.
+5007    dana    Relicense emodules.texi.
+5006    cary    Instantiate compile fix for nt.c.
+5005    edna    Cast correctly.
+5003    edna    #'union doesn't preserve relative order
+5002    barb    Fix some compile bugs.
+@end example
+
+(The gaps at 5003...5005, 5011...5019, and 5020...5023 are filled with
+sequences of commits by the same developers.)  Let's visualize this as a
+graph.  Time increases to the right, the leading "50" is omitted for
+brevity, and the dotted links indicate that several irrelevant commits
+were omitted, also for brevity.
+
+@example
+                        ,------ 09 -----.
+                       /                 \
+02 --- 03 ... 05 --- 06 --- 07 --- 08 --- 10 --- 24 --- 25
+  \                    \                        /
+   `-- 11 ... 19 -------`-- 20 ... 23 ---------'
+@end example
+
+The "problem commit" is 5010, which merges 5008 with 5009, and somehow
+managed to "lose" @file{src/ChangeLog}.  The unobvious consequence is
+that, although the @emph{other} changes made in 5007 and 5008 were
+successfully merged and are present in 5010, the log entry made by
+Dana for 5008 "just disappeared".  (The log entry for 5007 is in a
+different @file{ChangeLog}, so it's safe.)
+
+@subsubheading The safe and simple way for Cary
+
+To recover state file-by-file (also for whole directories), use @code{hg
+revert}.  This does not change the "current" version, @emph{i.e.}, the
+commit that will be the parent for your next commit.
+
+If it's not a merge commit, it's simple to restore the ChangeLog.  It's
+best to do it before making any other commits in your own workspace, and
+before pulling in new commits from others.  If there are a lot of such
+commits in your workspace already, ask for help.  But in this case,
+there was no such problem.  Just
+
+@example
+hg revert -r 5009 src/ChangeLog
+# Add Dana's log entry by hand.
+hg commit -m "Restore src/ChangeLog."
+@end example
+
+5009 is the revision id of the most recent commit that had the correct
+version of the file.  You get that from the "parent" field in @code{hg
+log}, or from the DAG browser (@code{hg view}, requires @code{hgk}
+extension enabled).
+
+Alternatively, Cary could revert from 5008.  This would leave her with
+@emph{her} log entry for 5009 missing, and that would have to be added
+by hand.
+
+Note that in the actual history, Cary didn't realize that Dana's log
+went missing, so Anne had to pick up the slack in 5025.
+
+@subsubheading Recovery by another developer
+
+Another way to recover earlier state is with @code{hg checkout} (or
+@code{hg update}, which is another way to spell the same command).  This
+changes the version that hg sees as "current", as well as reverting the
+workspace.
+
+A common scenario is that another developer, such as Barb in the log
+above, was already working on @file{src/ChangeLog}, saves her copy, then
+tries to merge.  She would then get a modify/delete conflict.  It's
+tempting to just resolve that in favor of keeping the file, and commit.
+This often works, but an alternative way uses the VCS:
+
+@example
+hg checkout 5010
+hg revert -r 5009 src/ChangeLog
+# Add Dana's log entry by hand.
+hg commit -m "Restore src/ChangeLog."
+@end example
+
+to get the same effect as described above, then
+
+@example
+hg merge
+@end example
+
+(making her changes "float to the top" of the log) or
+
+@example
+hg checkout 5023
+hg merge
+@end example
+
+(putting the Cary's branch at the top of the log).  This assumes she has
+no other heads in her workspace.  If she does have other heads she would
+have to use an explicit argument to @code{hg merge}.
+
+Note that in the actual history, Barb didn't realize that Dana's log
+went missing, so Anne (or somebody) had to pick up the slack in 5025.
+
+@subsubheading The hard but accurate way
+
+Suppose Barb did @code{hg pull -u}, but notices the problem before
+resolving conflicts and committing the merge.  Assume Barb was fully committed
+before doing @code{hg pull -u}.
+
+@example
+# Restore the ChangeLog, "covering up" the broken commit.
+# Check out Cary's head.  This nukes the merged files in the workspace,
+# but @emph{the history and versions in Barb's rev. 5023 are preserved
+# in the repository}.  The -C is necessary to overwrite files.
+hg checkout -C 5010
+hg revert -r 5009 src/ChangeLog
+# Merge Dana's branch (yes, again).
+# The repeated merge outside of src/ChangeLog should resolve to a
+# no-op, but the ChangeLog probably conflicts.
+# The -f is needed because revert leaves uncommitted changes.
+hg merge -f 5008
+hg commit -m "Re-merge Dana's branch to recover her logs."
+# Merge Barb's work.
+# If Barb has only two heads, which seems likely, the argument to
+# merge is optional.
+hg merge 5023
+hg commit -m merge
+@end example
+
+Visualizing this with a graph, we have:
+
+@example
+                        ,------ 09 -----.
+                       /                 \
+02 --- 03 ... 05 --- 06 --- 07 --- 08 --- 10 *** 24 --- 25
+  \                    \             \          /      /
+   \                    \             `--------'      /
+    \                    \                           /
+     `-- 11 ... 19 -------`-- 20 ... 23 ------------'
+@end example
+
+Note that the versions 5024 and 5025 in this graph denote
+@emph{different} versions from the actual history.  The starred link
+means that editing work (aside from resolving conflicts) was done, on
+top of the merge.  However, the editing work is actually done by
+Mercurial (the revert command)!
+
+
+@node Q11.2.6, Q11.2.7, Q11.2.5, Bleeding Edge
+@unnumberedsubsec How do I recover from a bad commit?  (I haven't pushed yet.)
+
+If you hadn't yet pushed the commit you now regret, and realize it
+before doing further commits, you can use @code{hg strip tip}.  Then
+just redo the commit, possibly with additional changes before
+committing.
+
+@code{hg strip} is dangerous; for practical purposes it destroys
+history, and it also reverts the files in your workspace.  It's
+probably possible to recover the history, but I don't know how.  And any
+uncommitted changes that might be lost are gone forever.  However, it
+is useful in cases like this.
+
+When in doubt, use the safer method @ref{Q11.2.5}.
+
+
+@node Q11.2.7, , Q11.2.6, Bleeding Edge
+@unnumberedsubsec Testing patches with Mercurial Queues.
+
+When testing a patch proposed on xemacs-beta or xemacs-patches,
+conflicts or new heads often appear later, when using @code{hg pull -u}.
+
+There are both theoretical and practical reasons why this happens,
+and it's unlikely to change.  The current workflow of XEmacs is also
+unlikely to change soon; testing patches is also probably going to
+remain necessary.  One way to avoid this issue is to use Mercurial
+Queues (mq), an extension distributed with Mercurial.
+
+Enable mq by adding
+
+@example
+    [extensions]
+
+    hgext.mq =
+@end example
+
+to your @file{~/.hgrc}.  (Yes, the right hand side is empty.)  If you
+already have an @code{[extensions]} section, don't repeat it.  Add
+@code{hgext.mq =} to the existing extensions section.
+
+When you want to test a patch, you need an hg workspace with no
+uncommitted changes.  If you already have some uncommitted changes,
+you can preserve them with mq as follows:
+
+@example
+    $ hg qnew -f -m "Preserve local changes." local-changes
+@end example
+
+The @code{-m} flag specifies the commit message for the new patch.  The
+@code{-f} flag "forces" qnew to put all of the uncommitted local changes
+into an mq patch, and commits it (you will see a commit with summary
+"Preserve local changes." if you do an @code{hg log} now).
+"local-changes" is the name of the patch.
+
+Now, create an mq patch for the test patch (which we assume was saved
+to @file{/tmp/xemacs.patch}):
+
+    $ hg qimport -P -n test-xemacs-patch /tmp/xemacs.patch
+
+The @code{-n} flag specifies the name of the patch.  Give it a name
+sufficiently explicit so you'll know what it is later.  Remember, it
+may take several weeks for the patch to be pushed to the public
+mainline.  The @code{-P} flag says "apply this patch to the workspace
+now".
+
+When you want to update the workspace, you need to remove the mq
+commits, update, and restore your local changes and the test patch.
+You do it this way:
+
+@example
+    $ hg qpop --all
+    $ hg pull -u                # use your usual method, hg fetch etc.
+    $ hg qpush --all
+@end example
+
+@code{hg qpop --all} undoes all the mq commits, but leaves the patches
+in @file{.hg/patches}.  @code{hg qpush --all} reapplies the patches and
+restores the mq commits.  Of course you hope that the patch will be
+committed upstream.  When it is, you do this:
+
+@example
+    $ hg qpop --all
+    $ hg pull -u
+    $ hg qdelete test-xemacs-patch
+    $ hg qpush --all
+@end example
+
+and you're back in business with the official version of the patch you
+tested, and all your local changes applied.
+
+It's also possible to split your local changes into smaller mq
+patches, but that's out of scope for this answer.
+
 @bye
--- a/man/xemacs/programs.texi	Wed Jan 20 07:05:57 2010 -0600
+++ b/man/xemacs/programs.texi	Wed Feb 24 01:58:04 2010 -0600
@@ -271,7 +271,7 @@
 
   In Emacs, a parenthetical grouping at the top level in the buffer is
 called a @dfn{defun}.  The name derives from the fact that most
-top-level lists in Lisp are instances of the special form
+top-level lists in Lisp are instances of the special operator
 @code{defun}, but Emacs calls any top-level parenthetical
 grouping counts a defun regardless of its contents or
 the programming language.  For example, in C, the body of a
--- a/modules/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/modules/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,115 @@
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* canna/canna_api.c:
+	* canna/canna_api.c (storeResults):
+	* canna/canna_api.c (Fcanna_set_bunsetsu):
+	* canna/canna_api.c (Fcanna_initialize):
+	* canna/canna_api.c (Fcanna_store_yomi):
+	* canna/canna_api.c (Fcanna_henkan_end):
+	Convert file to utf-8.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* postgresql/postgresql.c:
+	* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
+	* postgresql/postgresql.c (Fpq_connectdb):
+	* postgresql/postgresql.c (Fpq_connect_start):
+	* postgresql/postgresql.c (Fpq_lo_import):
+	* postgresql/postgresql.c (Fpq_lo_export):
+	* ldap/eldap.c (Fldap_open):
+	* ldap/eldap.c (Fldap_search_basic):
+	* ldap/eldap.c (Fldap_add):
+	* ldap/eldap.c (Fldap_modify):
+	* ldap/eldap.c (Fldap_delete):
+	* canna/canna_api.c (Fcanna_initialize):
+	* canna/canna_api.c (Fcanna_store_yomi):
+	* canna/canna_api.c (Fcanna_parse):
+	* canna/canna_api.c (Fcanna_henkan_begin):
+	EXTERNAL_TO_C_STRING returns its argument instead of storing it
+	in a parameter, and is renamed to EXTERNAL_TO_ITEXT.  Similar
+	things happen to related macros.  See entry in src/ChangeLog.
+
+	More Mule-izing of postgresql.c.  Extract out common code
+	between `pq-connectdb' and `pq-connect-start'.  Fix places
+	that signal an error string using a formatted string to instead
+	follow the standard and have a fixed reason followed by the
+	particular error message stored as one of the frobs.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* postgresql/postgresql.c (print_pgconn):
+	* postgresql/postgresql.c (print_pgresult):
+	* postgresql/postgresql.c (Fpq_conn_defaults):
+	* postgresql/postgresql.c (Fpq_pgconn):
+	* postgresql/postgresql.c (Fpq_res_status):
+	* postgresql/postgresql.c (Fpq_result_error_message):
+	* postgresql/postgresql.c (Fpq_fname):
+	* postgresql/postgresql.c (Fpq_get_value):
+	* postgresql/postgresql.c (Fpq_cmd_status):
+	* postgresql/postgresql.c (Fpq_cmd_tuples):
+	* postgresql/postgresql.c (Fpq_notifies):
+	* postgresql/postgresql.c (Fpq_get_line):
+	* postgresql/postgresql.c (Fpq_get_line_async):
+	* postgresql/postgresql.c (FROB):
+	* postgresql/postgresql.c (init_postgresql_from_environment):
+	* ldap/eldap.c:
+	* ldap/eldap.c (Fldap_open):
+	* ldap/eldap.c (Fldap_search_basic):
+	* canna/canna_api.c:
+	* canna/canna_api.c (make_euc_string):
+	Rename:
+
+	write_c_string -> write_cistring
+	build_intstring -> build_istring
+	build_string -> build_cistring
+	build_ext_string -> build_extstring
+	make_ext_string -> make_extstring
+	buffer_insert_c_string -> buffer_insert_ascstring
+	intern_int -> intern_istring
+
+	See comment in src/ChangeLog about this.
+	
+2010-01-26  Ben Wing  <ben@xemacs.org>
+
+	* postgresql/postgresql.c:
+	* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
+	* postgresql/postgresql.c (print_pgresult):
+	* postgresql/postgresql.c (Fpq_conn_defaults):
+	* postgresql/postgresql.c (Fpq_connectdb):
+	* postgresql/postgresql.c (Fpq_connect_start):
+	* postgresql/postgresql.c (Fpq_result_status):
+	* postgresql/postgresql.c (Fpq_res_status):
+	Mule-ize large parts of it.  
+
+2010-01-26  Ben Wing  <ben@xemacs.org>
+
+	* ldap/eldap.c (print_ldap):
+	* ldap/eldap.c (allocate_ldap):
+	Use write_ascstring().
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* postgresql/postgresql.c (CHECK_LIVE_CONNECTION):
+	* postgresql/postgresql.c (print_pgconn):
+	* postgresql/postgresql.c (Fpq_connectdb):
+	* postgresql/postgresql.c (Fpq_connect_start):
+	* postgresql/postgresql.c (Fpq_exec):
+	* postgresql/postgresql.c (Fpq_get_result):
+	Fix g++ 4.3 complaints about implicit conversions of string
+	literals (const char *) to char *.
+
+2010-01-16  Ben Wing  <ben@xemacs.org>
+
+	* common/Makefile.common:
+	* common/Makefile.common (.PHONY):
+	Use WIN32_ANY not HAVE_MS_WINDOWS so we still link with the
+	import library even when --with-msw=no.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* ldap/eldap.c (Fldap_search_basic):
+	Cast to Extbyte * to avoid C++ compile error.
+
 2009-11-10  Jerry James  <james@xemacs.org>
 
 	* canna/canna_api.c (Fcanna_initialize): Drop support for the NEC EWS.
--- a/modules/canna/canna_api.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/modules/canna/canna_api.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-/* CANNA interface -*- coding: euc-jp -*-
+/* CANNA interface -*- coding: utf-8 -*-
 
    Copyright (C) 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
@@ -199,8 +199,8 @@
 static Lisp_Object CANNA_mode_keys (void);
 static Lisp_Object Qeuc_jp;
 
-#define make_euc_string(p, len) make_ext_string ((Extbyte *) p, len, Qeuc_jp)
-#define build_euc_string(p) build_ext_string ((Extbyte *) p, Qeuc_jp)
+#define make_euc_string(p, len) make_extstring ((Extbyte *) p, len, Qeuc_jp)
+#define build_euc_string(p) build_extstring ((Extbyte *) p, Qeuc_jp)
 
 #ifdef CANNA_MULE
 static int euc_jp_num_chars (unsigned char *, int);
@@ -237,10 +237,10 @@
     }
   else
     {
-      /* ���ꤷ��ʸ���� (the confirmed string) */
+      /* 確定した文字列 (the confirmed string) */
       Vcanna_kakutei_string = make_euc_string (buf, len);
       val = make_int (len);
-      /* ���ꤷ��ʸ������ɤߤξ���...
+      /* 確定した文字列の読みの情報...
 	 (info about the reading of the confirmed string) */
       Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil;
       if (ks->info & KanjiYomiInfo)
@@ -253,20 +253,20 @@
 	      int yomilen2;
 
 	      Vcanna_kakutei_yomi =
-		make_euc_string (p, yomilen); /* �ɤ� (reading) */
+		make_euc_string (p, yomilen); /* 読み (reading) */
 	      p += yomilen + 1;
 	      yomilen2 = strlen (p);
 	      if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE)
 		{
 		  Vcanna_kakutei_romaji =
 		    make_euc_string (p, yomilen2);
-				/* �����޻� (romanization) */
+				/* ローマ字 (romanization) */
 		}
 	    }
 	}
 
 
-      /* ����ɽ����ʸ����Ǥ���
+      /* 候補表示の文字列です。
 	 (string for displaying candidate translations) */
       Vcanna_henkan_string = Qnil;
       if (ks->length >= 0)
@@ -293,7 +293,7 @@
 #endif /* CANNA_MULE */
 	}
 
-      /* ������� (information about the echo area menu) */
+      /* 一覧の情報 (information about the echo area menu) */
       Vcanna_ichiran_string = Qnil;
       if (ks->info & KanjiGLineInfo && ks->gline.length >= 0)
 	{
@@ -311,14 +311,14 @@
 #endif /* CANNA_MULE */
 	}
 
-      /* �⡼�ɤξ��� (mode information) */
+      /* モードの情報 (mode information) */
       Vcanna_mode_string = Qnil;
       if (ks->info & KanjiModeInfo)
 	{
 	  Vcanna_mode_string = build_euc_string ((Extbyte *) ks->mode);
 	}
 
-      /* ����¾�ξ��� (other information) */
+      /* その他の情報 (other information) */
       canna_empty_info = (ks->info & KanjiEmptyInfo) ? 1 : 0;
       canna_through_info = (ks->info & KanjiThroughInfo) ? 1 : 0;
     }
@@ -334,7 +334,7 @@
        (num))
 {
   /* This is actually a Boolean! */
-  char *kugiri; /* ʸ����ڤ�򤹤뤫�� (display clause separator?) */
+  char *kugiri; /* 文節区切りをするか? (display clause separator?) */
 
   kugiri = NILP (num) ? (char *) 0 : (char *) 1;
 
@@ -367,7 +367,7 @@
   char **p, **q;
 
   /* This is actually a Boolean! */
-  char *kugiri; /* ʸ����ڤ�򤹤뤫�� (display clause separator?) */
+  char *kugiri; /* 文節区切りをするか? (display clause separator?) */
 
   IRCP_context = -1;
 
@@ -390,7 +390,7 @@
       CHECK_STRING (server);
       jrKanjiControl (0, KC_SETSERVERNAME,
 		      /* !!#### Check encoding */
-		      NEW_LISP_STRING_TO_EXTERNAL (server, Qnative));
+		      LISP_STRING_TO_EXTERNAL (server, Qnative));
     }
 
   if (NILP (rcfile))
@@ -401,7 +401,7 @@
     {
       CHECK_STRING (rcfile);
       jrKanjiControl (0, KC_SETINITFILENAME,
-		      NEW_LISP_STRING_TO_EXTERNAL (rcfile, Qfile_name));
+		      LISP_STRING_TO_EXTERNAL (rcfile, Qfile_name));
     }
 
   {
@@ -424,7 +424,7 @@
   if (res == -1)
     {
       val = Fcons (build_euc_string (jrKanjiError), val);
-      /* ���˥���饤���Ǽ��Ԥ�����硣 (on initialization failure) */
+      /* イニシャライズで失敗した場合。 (on initialization failure) */
       return Fcons (Qnil, val);
     }
   else
@@ -444,12 +444,12 @@
 #ifndef CANNA_MULE
       jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
 #else
-      /* mule ���ä���Ⱦ�ѥ������ʤ�Ȥ���
+      /* mule だったら半角カタカナも使える
 	 (Mule can use half-width katakana) */
       if (canna_inhibit_hankakukana)
 	jrKanjiControl (0, KC_INHIBITHANKAKUKANA, (char *) 1);
 #endif
-      jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ����: �����޻��ޤ��֤�
+      jrKanjiControl (0, KC_YOMIINFO, (char *) 2); /* ※2: ローマ字まで返す
 						      (*2: return to
 						      romanized form) */
       val = Fcons (Qnil, val);
@@ -561,7 +561,7 @@
   Extbyte *ext;
 
   CHECK_STRING (yomi);
-  LISP_STRING_TO_EXTERNAL (yomi, ext, Qeuc_jp);
+  ext = LISP_STRING_TO_EXTERNAL (yomi, Qeuc_jp);
   strncpy (key_buffer, ext, sizeof (key_buffer));
   key_buffer[sizeof (key_buffer) - 1] = '\0';
   ks.length = strlen (key_buffer);
@@ -573,7 +573,7 @@
   else
     {
       CHECK_STRING (roma);
-      LISP_STRING_TO_EXTERNAL (roma, ext, Qeuc_jp);
+      ext = LISP_STRING_TO_EXTERNAL (roma, Qeuc_jp);
       ks.mode = (unsigned char *) (key_buffer + ks.length + 1);
       strncpy (key_buffer + ks.length + 1, ext,
 	       sizeof (key_buffer) - ks.length - 1);
@@ -581,7 +581,7 @@
     }
 
   ks.echoStr = (unsigned char *) key_buffer;
-  ksv.buffer = (unsigned char *) key_buffer; /* ������ (return value) */
+  ksv.buffer = (unsigned char *) key_buffer; /* 返値用 (return value) */
   ksv.bytes_buffer = KEYTOSTRSIZE;
   ksv.ks = &ks;
 
@@ -629,7 +629,7 @@
   Extbyte *ext;
 
   CHECK_STRING (str);
-  LISP_STRING_TO_EXTERNAL (str, ext, Qeuc_jp);
+  ext = LISP_STRING_TO_EXTERNAL (str, Qeuc_jp);
   strncpy (key_buffer, ext, sizeof (key_buffer));
   key_buffer[sizeof (key_buffer) - 1] = '\0';
   p = (Extbyte **) key_buffer;
@@ -716,7 +716,7 @@
       return Qnil;
     }
 
-  LISP_STRING_TO_EXTERNAL (yomi, ext, Qeuc_jp);
+  ext = LISP_STRING_TO_EXTERNAL (yomi, Qeuc_jp);
   strncpy ((char *) yomibuf, ext, sizeof (yomibuf));
   yomibuf[sizeof (yomibuf) - 1] = '\0';
 
@@ -836,7 +836,7 @@
     {
       return Qnil;
     }
-  RkEndBun (IRCP_context, 1); /* �ؽ��Ϥ��ĤǤ�Ԥä��ɤ���ΤʤΤ���
+  RkEndBun (IRCP_context, 1); /* 学習はいつでも行って良いものなのか?
 				 (is it OK to invoke learning function
 				 at arbitrary times?) */
   return Qt;
--- a/modules/common/Makefile.common	Wed Jan 20 07:05:57 2010 -0600
+++ b/modules/common/Makefile.common	Wed Feb 24 01:58:04 2010 -0600
@@ -59,7 +59,7 @@
 INSTALL_PROGRAM=@MOD_INSTALL_PROGRAM@
 OBJECT_TO_BUILD=@OBJECT_TO_BUILD@
 LIBSTDCPP=@LIBSTDCPP@
-#ifdef HAVE_MS_WINDOWS
+#ifdef WIN32_ANY
 IMPORT_LIB=../../src/xemacs-import.a
 #endif
 
--- a/modules/ldap/eldap.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/modules/ldap/eldap.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* LDAP client interface for XEmacs.
    Copyright (C) 1998 Free Software Foundation, Inc.
-   Copyright (C) 2004, 2005 Ben Wing.
+   Copyright (C) 2004, 2005, 2010 Ben Wing.
    
 
 This file is part of XEmacs.
@@ -99,7 +99,7 @@
 #endif
     }
   invalid_operation ("LDAP error",
-		     build_ext_string (ldap_err2string (ldap_err), Qnative));
+		     build_extstring (ldap_err2string (ldap_err), Qnative));
 }
 
 
@@ -134,7 +134,7 @@
 
   write_fmt_string_lisp (printcharfun, "#<ldap %S", 1, ldap->host);
   if (!ldap->ld)
-    write_c_string (printcharfun,"(dead) ");
+    write_ascstring (printcharfun,"(dead) ");
   write_fmt_string (printcharfun, " 0x%lx>", (long)ldap);
 }
 
@@ -149,14 +149,10 @@
 }
 
 static void
-finalize_ldap (void *header, int for_disksave)
+finalize_ldap (void *header)
 {
   Lisp_LDAP *ldap = (Lisp_LDAP *) header;
 
-  if (for_disksave)
-    invalid_operation ("Can't dump an emacs containing LDAP objects",
-			 make_ldap (ldap));
-
   if (ldap->ld)
     ldap_unbind (ldap->ld);
   ldap->ld = NULL;
@@ -263,13 +259,13 @@
 	else if (EQ (keyword, Qbinddn))
 	  {
 	    CHECK_STRING (value);
-	    LISP_STRING_TO_EXTERNAL (value, ldap_binddn, Qnative);
+	    ldap_binddn = LISP_STRING_TO_EXTERNAL (value, Qnative);
 	  }
 	/* Password */
 	else if (EQ (keyword, Qpasswd))
 	  {
 	    CHECK_STRING (value);
-	    LISP_STRING_TO_EXTERNAL (value, ldap_password, Qnative);
+	    ldap_password = LISP_STRING_TO_EXTERNAL (value, Qnative);
 	  }
 	/* Deref */
 	else if (EQ (keyword, Qderef))
@@ -307,7 +303,7 @@
 
   /* Connect to the server and bind */
   slow_down_interrupts ();
-  ld = ldap_open (NEW_LISP_STRING_TO_EXTERNAL (host, Qnative), ldap_port);
+  ld = ldap_open (LISP_STRING_TO_EXTERNAL (host, Qnative), ldap_port);
   speed_up_interrupts ();
 
   if (ld == NULL )
@@ -346,7 +342,7 @@
   if (err != LDAP_SUCCESS)
     {
       signal_error (Qprocess_error, "Failed binding to the server",
-		    build_ext_string (ldap_err2string (err), Qnative));
+		    build_extstring (ldap_err2string (err), Qnative));
     }
 
   ldap = allocate_ldap ();
@@ -486,7 +482,7 @@
 	EXTERNAL_LIST_LOOP_2 (current, attrs)
 	  {
 	    CHECK_STRING (current);
-	    LISP_STRING_TO_EXTERNAL (current, ldap_attributes[i], Qnative);
+	    ldap_attributes[i] = LISP_STRING_TO_EXTERNAL (current, Qnative);
 	    ++i;
 	  }
       }
@@ -498,9 +494,9 @@
 
   /* Perform the search */
   bs = NILP (base) ? (Extbyte *) "" :
-    NEW_LISP_STRING_TO_EXTERNAL (base, Qnative);
+    LISP_STRING_TO_EXTERNAL (base, Qnative);
   filt = NILP (filter) ? (Extbyte *) "" :
-    NEW_LISP_STRING_TO_EXTERNAL (filter, Qnative);
+    LISP_STRING_TO_EXTERNAL (filter, Qnative);
   if (ldap_search (ld, bs, ldap_scope, filt, ldap_attributes,
 		   NILP (attrsonly) ? 0 : 1)
       == -1)
@@ -535,19 +531,19 @@
           dn = ldap_get_dn (ld, e);
           if (dn == NULL)
             signal_ldap_error (ld, e, 0);
-          entry = Fcons (build_ext_string (dn, Qnative), Qnil);
+          entry = Fcons (build_extstring (dn, Qnative), Qnil);
         }
       for (a = ldap_first_attribute (ld, e, &ptr);
            a != NULL;
            a = ldap_next_attribute (ld, e, ptr))
         {
-          list = Fcons (build_ext_string (a, Qnative), Qnil);
+          list = Fcons (build_extstring (a, Qnative), Qnil);
           unwind.vals = ldap_get_values_len (ld, e, a);
           if (unwind.vals != NULL)
             {
               for (i = 0; unwind.vals[i] != NULL; i++)
                 {
-                  list = Fcons (make_ext_string ((Extbyte *) unwind.vals[i]->bv_val,
+                  list = Fcons (make_extstring ((Extbyte *) unwind.vals[i]->bv_val,
                                                  unwind.vals[i]->bv_len,
                                                  Qnative),
                                 list);
@@ -645,8 +641,8 @@
 	CHECK_CONS (current);
 	CHECK_STRING (XCAR (current));
 	ldap_mods_ptrs[i] = &(ldap_mods[i]);
-	LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type,
-				 Qnative);
+	ldap_mods[i].mod_type =
+	  LISP_STRING_TO_EXTERNAL (XCAR (current), Qnative);
 	ldap_mods[i].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES;
 	values = XCDR (current);
 	if (CONSP (values))
@@ -687,7 +683,7 @@
       }
   }
   ldap_mods_ptrs[i] = NULL;
-  rc = ldap_add_s (ld, NEW_LISP_STRING_TO_EXTERNAL (dn, Qnative),
+  rc = ldap_add_s (ld, LISP_STRING_TO_EXTERNAL (dn, Qnative),
 		   ldap_mods_ptrs);
   if (rc != LDAP_SUCCESS)
     signal_ldap_error (ld, NULL, rc);
@@ -754,8 +750,8 @@
 	  invalid_constant ("Invalid LDAP modification type", mod_op);
 	current = XCDR (current);
 	CHECK_STRING (XCAR (current));
-	LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type,
-				 Qnative);
+	ldap_mods[i].mod_type =
+	  LISP_STRING_TO_EXTERNAL (XCAR (current), Qnative);
 	values = XCDR (current);
 	len = (Elemcount) XINT (Flength (values));
 	bervals = alloca_array (struct berval, len);
@@ -779,7 +775,7 @@
       }
   }
   ldap_mods_ptrs[i] = NULL;
-  rc = ldap_modify_s (ld, NEW_LISP_STRING_TO_EXTERNAL (dn, Qnative),
+  rc = ldap_modify_s (ld, LISP_STRING_TO_EXTERNAL (dn, Qnative),
 		      ldap_mods_ptrs);
   if (rc != LDAP_SUCCESS)
     signal_ldap_error (ld, NULL, rc);
@@ -804,7 +800,7 @@
   ld = XLDAP (ldap)->ld;
   CHECK_STRING (dn);
 
-  rc = ldap_delete_s (ld, NEW_LISP_STRING_TO_EXTERNAL (dn, Qnative));
+  rc = ldap_delete_s (ld, LISP_STRING_TO_EXTERNAL (dn, Qnative));
   if (rc != LDAP_SUCCESS)
     signal_ldap_error (ld, NULL, rc);
 
--- a/modules/postgresql/postgresql.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/modules/postgresql/postgresql.c	Wed Feb 24 01:58:04 2010 -0600
@@ -99,7 +99,6 @@
 /* #define POSTGRES_LO_IMPORT_IS_VOID 1 */
 
 #include "lisp.h"
-#include "sysdep.h"
 
 #include "buffer.h"
 #include "postgresql.h"
@@ -107,6 +106,8 @@
 #ifdef HAVE_SHLIB
 # include "emodules.h"
 #endif
+#include "sysdep.h"
+#include "sysfile.h"
 
 #ifdef RUNNING_XEMACS_21_1 /* handle interface changes */
 #define PG_OS_CODING FORMAT_FILENAME
@@ -120,15 +121,36 @@
 Lisp_Object Vpg_coding_system;
 #endif
 
-#define CHECK_LIVE_CONNECTION(P) do {					\
-	if (!P || (PQstatus (P) != CONNECTION_OK)) {			\
-		char *e = "bad value";					\
-		if (P) e = PQerrorMessage (P);				\
-	 signal_ferror (Qprocess_error, "dead connection [%s]", e);	\
-	} } while (0)
-#define PUKE_IF_NULL(p) do {						 \
-	if (!p) signal_error (Qinvalid_argument, "bad value", Qunbound); \
-	} while (0)
+#define CHECK_LIVE_CONNECTION(P)					\
+do									\
+{									\
+  if (!P || (PQstatus (P) != CONNECTION_OK))				\
+    {									\
+      Lisp_Object err;							\
+									\
+      if (P)								\
+	err = build_extstring (PQerrorMessage (P), PG_OS_CODING);	\
+      else								\
+	err = build_msg_string ("Bad value");				\
+      signal_error (Qprocess_error, "Dead connection", err);		\
+    }									\
+}									\
+while (0)
+
+#define PUKE_IF_NULL(p)							\
+do									\
+{									\
+  if (!p) signal_error (Qinvalid_argument, "Bad value", Qunbound);	\
+}									\
+while (0)
+
+#define SIGNAL_ERROR(p, reason)						\
+do									\
+{									\
+  signal_error (Qprocess_error, reason,					\
+		build_extstring (PQerrorMessage (p), PG_OS_CODING));	\
+}									\
+while (0)  
 
 static Lisp_Object VXPGHOST;
 static Lisp_Object VXPGUSER;
@@ -205,7 +227,7 @@
   char buf[256];
   PGconn *P;
   ConnStatusType cst;
-  char *host="", *db="", *user="", *port="";
+  const char *host="", *db="", *user="", *port="";
 
   P = (XPGCONN (obj))->pgconn;
 
@@ -233,7 +255,7 @@
   if (print_readably)
     printing_unreadable_object ("%s", buf);
   else
-    write_c_string (printcharfun, buf);
+    write_cistring (printcharfun, buf);
 }
 
 static Lisp_PGconn *
@@ -252,6 +274,8 @@
   return pgconn;
 }
 
+#ifdef RUNNING_XEMACS_21_4
+
 static void
 finalize_pgconn (void *header, int for_disksave)
 {
@@ -268,6 +292,22 @@
     }
 }
 
+#else /* not RUNNING_XEMACS_21_4 */
+
+static void
+finalize_pgconn (void *header)
+{
+  Lisp_PGconn *pgconn = (Lisp_PGconn *)header;
+
+  if (pgconn->pgconn)
+    {
+      PQfinish (pgconn->pgconn);
+      pgconn->pgconn = (PGconn *)NULL;
+    }
+}
+
+#endif /* (not) RUNNING_XEMACS_21_4 */
+
 #ifdef RUNNING_XEMACS_21_1
 DEFINE_LRECORD_IMPLEMENTATION ("pgconn", pgconn,
 			       mark_pgconn, print_pgconn, finalize_pgconn,
@@ -349,7 +389,7 @@
 		   PQcmdStatus (res));
 	  break;
 	default:
-notuples:
+	notuples:
 	  /* No counts to print */
 	  sprintf (buf, RESULT_DEFAULT_FMT, /* evil! */
 		   PQresStatus (PQresultStatus (res)),
@@ -363,7 +403,7 @@
   if (print_readably)
     printing_unreadable_object ("%s", buf);
   else
-    write_c_string (printcharfun, buf);
+    write_cistring (printcharfun, buf);
 }
 
 #undef RESULT_TUPLES_FMT
@@ -386,6 +426,8 @@
   return pgresult;
 }
 
+#ifdef RUNNING_XEMACS_21_4
+
 static void
 finalize_pgresult (void *header, int for_disksave)
 {
@@ -402,6 +444,22 @@
     }
 }
 
+#else /* not RUNNING_XEMACS_21_4 */
+
+static void
+finalize_pgresult (void *header)
+{
+  Lisp_PGresult *pgresult = (Lisp_PGresult *)header;
+
+  if (pgresult->pgresult)
+    {
+      PQclear (pgresult->pgresult);
+      pgresult->pgresult = (PGresult *)NULL;
+    }
+}
+
+#endif /* (not) RUNNING_XEMACS_21_4 */
+
 #ifdef RUNNING_XEMACS_21_1
 DEFINE_LRECORD_IMPLEMENTATION ("pgresult", pgresult,
 			       mark_pgresult, print_pgresult, finalize_pgresult,
@@ -450,23 +508,25 @@
 
   pcio = PQconndefaults();
   if (!pcio) return Qnil; /* can never happen in libpq-7.0 */
-  temp = list1 (Fcons (build_ext_string (pcio[0].keyword, PG_OS_CODING),
-		       Fcons (build_ext_string (pcio[0].envvar, PG_OS_CODING),
-			      Fcons (build_ext_string (pcio[0].compiled, PG_OS_CODING),
-				     Fcons (build_ext_string (pcio[0].val, PG_OS_CODING),
-					    Fcons (build_ext_string (pcio[0].label, PG_OS_CODING),
-						   Fcons (build_ext_string (pcio[0].dispchar, PG_OS_CODING),
-							  Fcons (make_int (pcio[0].dispsize), Qnil))))))));
+  temp =
+    list1 (nconc2 (list4 (build_extstring (pcio[0].keyword, PG_OS_CODING),
+			  build_extstring (pcio[0].envvar, PG_OS_CODING),
+			  build_extstring (pcio[0].compiled, PG_OS_CODING),
+			  build_extstring (pcio[0].val, PG_OS_CODING)),
+		   list3 (build_extstring (pcio[0].label, PG_OS_CODING),
+			  build_extstring (pcio[0].dispchar, PG_OS_CODING),
+			  make_int (pcio[0].dispsize))));
 
   for (i = 1; pcio[i].keyword; i++)
     {
-      temp1 = list1 (Fcons (build_ext_string (pcio[i].keyword, PG_OS_CODING),
-			    Fcons (build_ext_string (pcio[i].envvar, PG_OS_CODING),
-				   Fcons (build_ext_string (pcio[i].compiled, PG_OS_CODING),
-					  Fcons (build_ext_string (pcio[i].val, PG_OS_CODING),
-						 Fcons (build_ext_string (pcio[i].label, PG_OS_CODING),
-							Fcons (build_ext_string (pcio[i].dispchar, PG_OS_CODING),
-							       Fcons (make_int (pcio[i].dispsize), Qnil))))))));
+      temp1 =
+	list1 (nconc2 (list4 (build_extstring (pcio[i].keyword, PG_OS_CODING),
+			      build_extstring (pcio[i].envvar, PG_OS_CODING),
+			      build_extstring (pcio[i].compiled, PG_OS_CODING),
+			      build_extstring (pcio[i].val, PG_OS_CODING)),
+		       list3 (build_extstring (pcio[i].label, PG_OS_CODING),
+			      build_extstring (pcio[i].dispchar, PG_OS_CODING),
+			      make_int (pcio[i].dispsize))));
       {
 	Lisp_Object args[2];
 	args[0] = temp;
@@ -483,44 +543,57 @@
 PGconn *PQconnectdb(const char *conninfo)
 */
 
+#ifdef HAVE_POSTGRESQLV7
+#define USED_IF_V7(x) x
+#else
+#define USED_IF_V7(x) UNUSED (x)
+#endif
+
+static Lisp_Object
+postgresql_connect (Lisp_Object conninfo, int USED_IF_V7 (async))
+{
+  PGconn *P;
+  Lisp_PGconn *lisp_pgconn;
+
+  CHECK_STRING (conninfo);
+
+  P = (
+#ifdef HAVE_POSTGRESQLV7
+       async ? PQconnectStart : 
+#endif
+       PQconnectdb)
+    (LISP_STRING_TO_EXTERNAL (conninfo, PG_OS_CODING));
+  if (P && (PQstatus (P) == CONNECTION_OK))
+    {
+      (void) PQsetNoticeProcessor (P, xemacs_notice_processor, NULL);
+      lisp_pgconn = allocate_pgconn ();
+      lisp_pgconn->pgconn = P;
+      return make_pgconn (lisp_pgconn);
+    }
+  else
+    {
+      /* Connection failed.  Destroy the connection and signal an error. */
+
+      Lisp_Object errmsg;
+      if (P)
+	{
+	  errmsg = build_extstring (PQerrorMessage (P), PG_OS_CODING);
+	  PQfinish (P);
+	}
+      else
+	errmsg = build_msg_string ("Out of Memory?");
+      signal_error (Qprocess_error, "Connecting to PostGreSQL backend",
+		    errmsg);
+    }
+}
+
 /* ###autoload */
 DEFUN ("pq-connectdb", Fpq_connectdb, 1, 1, 0, /*
 Make a new connection to a PostgreSQL backend.
 */
 	(conninfo))
 {
-  PGconn *P;
-  Lisp_PGconn *lisp_pgconn;
-  char *error_message = "Out of Memory?";
-  char *c_conninfo;
-
-  CHECK_STRING (conninfo);
-
-  TO_EXTERNAL_FORMAT(LISP_STRING, conninfo,
-		     C_STRING_ALLOCA, c_conninfo, Qnative);
-  P = PQconnectdb (c_conninfo);
-  if (P && (PQstatus (P) == CONNECTION_OK))
-    {
-      (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL);
-      lisp_pgconn = allocate_pgconn();
-      lisp_pgconn->pgconn = P;
-      return make_pgconn (lisp_pgconn);
-    }
-  else
-    {
-      /* Connection failed.  Destroy the connection and signal an error. */
-      char buf[BLCKSZ];
-      strcpy (buf, error_message);
-      if (P)
-	{
-	  /* storage for the error message gets erased when call PQfinish */
-	  /* so we must temporarily stash it somewhere */
-	  strncpy (buf, PQerrorMessage (P), sizeof (buf));
-	  buf[sizeof (buf) - 1] = '\0';
-	  PQfinish (P);
-	}
-      signal_ferror (Qprocess_error, "libpq: %s", buf);
-    }
+  return postgresql_connect (conninfo, 0);
 }
 
 /* PQconnectStart Makes a new asynchronous connection to a backend.
@@ -534,37 +607,7 @@
 */
 	(conninfo))
 {
-  PGconn *P;
-  Lisp_PGconn *lisp_pgconn;
-  char *error_message = "Out of Memory?";
-  char *c_conninfo;
-
-  CHECK_STRING (conninfo);
-  TO_EXTERNAL_FORMAT (LISP_STRING, conninfo,
-		      C_STRING_ALLOCA, c_conninfo, Qnative);
-  P = PQconnectStart (c_conninfo);
-
-  if (P && (PQstatus (P) != CONNECTION_BAD))
-    {
-      (void)PQsetNoticeProcessor (P, xemacs_notice_processor, NULL);
-      lisp_pgconn = allocate_pgconn();
-      lisp_pgconn->pgconn = P;
-
-      return make_pgconn (lisp_pgconn);
-    }
-  else
-    {
-      /* capture the error message before destroying the object */
-      char buf[BLCKSZ];
-      strcpy (buf, error_message);
-      if (P)
-	{
-	  strncpy (buf, PQerrorMessage (P), sizeof (buf));
-	  buf[sizeof (buf) - 1] = '\0';
-	  PQfinish (P);
-	}
-      signal_ferror (Qprocess_error, "libpq: %s", buf);
-    }
+  return postgresql_connect (conninfo, 1);
 }
 
 DEFUN ("pq-connect-poll", Fpq_connect_poll, 1, 1, 0, /*
@@ -585,10 +628,7 @@
     {
     case PGRES_POLLING_FAILED:
       /* Something Bad has happened */
-      {
-	char *e = PQerrorMessage (P);
-	signal_ferror (Qprocess_error, "libpq: %s", e);
-      }
+      SIGNAL_ERROR (P, "Polling asynchronous connection");
     case PGRES_POLLING_OK:
       return Qpgres_polling_ok;
     case PGRES_POLLING_READING:
@@ -751,10 +791,7 @@
   CHECK_LIVE_CONNECTION (P);
 
   if (PQresetStart (P)) return Qt;
-  {
-    char *e = PQerrorMessage (P);
-    signal_ferror (Qprocess_error, "libpq: %s", e);
-  }
+  SIGNAL_ERROR (P, "Resetting connection");
 }
 
 DEFUN ("pq-reset-poll", Fpq_reset_poll, 1, 1, 0, /*
@@ -774,11 +811,7 @@
   switch (polling_status)
     {
     case PGRES_POLLING_FAILED:
-      /* Something Bad has happened */
-      {
-	char *e = PQerrorMessage (P);
-	signal_ferror (Qprocess_error, "libpq: %s", e);
-      }
+      SIGNAL_ERROR (P, "Polling asynchronous reset");
     case PGRES_POLLING_OK:
       return Qpgres_polling_ok;
     case PGRES_POLLING_READING:
@@ -840,22 +873,22 @@
     /* PQdb Returns the database name of the connection.
        char *PQdb(PGconn *conn)
      */
-    return build_ext_string (PQdb(P), PG_OS_CODING);
+    return build_extstring (PQdb(P), PG_OS_CODING);
   else if (EQ (field, Qpquser))
     /* PQuser Returns the user name of the connection.
        char *PQuser(PGconn *conn)
      */
-    return build_ext_string (PQuser(P), PG_OS_CODING);
+    return build_extstring (PQuser(P), PG_OS_CODING);
   else if (EQ (field, Qpqpass))
     /* PQpass Returns the password of the connection.
        char *PQpass(PGconn *conn)
      */
-    return build_ext_string (PQpass(P), PG_OS_CODING);
+    return build_extstring (PQpass(P), PG_OS_CODING);
   else if (EQ (field, Qpqhost))
     /* PQhost Returns the server host name of the connection.
        char *PQhost(PGconn *conn)
      */
-    return build_ext_string (PQhost(P), PG_OS_CODING);
+    return build_extstring (PQhost(P), PG_OS_CODING);
   else if (EQ (field, Qpqport))
     {
       char *p;
@@ -871,12 +904,12 @@
     /* PQtty Returns the debug tty of the connection.
        char *PQtty(PGconn *conn)
      */
-    return build_ext_string (PQtty(P), PG_OS_CODING);
+    return build_extstring (PQtty(P), PG_OS_CODING);
   else if (EQ (field, Qpqoptions))
   /* PQoptions Returns the backend options used in the connection.
      char *PQoptions(PGconn *conn)
    */
-    return build_ext_string (PQoptions(P), PG_OS_CODING);
+    return build_extstring (PQoptions(P), PG_OS_CODING);
   else if (EQ (field, Qpqstatus))
     {
       ConnStatusType cst;
@@ -905,7 +938,7 @@
        by an operation on the connection.
        char *PQerrorMessage(PGconn* conn);
      */
-    return build_ext_string (PQerrorMessage(P), PG_OS_CODING);
+    return build_extstring (PQerrorMessage(P), PG_OS_CODING);
   else if (EQ (field, Qpqbackendpid))
     /* PQbackendPID Returns the process ID of the backend server handling
        this connection.
@@ -938,7 +971,8 @@
 
   R = PQexec (P, c_query);
   {
-    char *tag, buf[BLCKSZ];
+    const Ascbyte *tag;
+    char buf[BLCKSZ];
 
     if (!R) out_of_memory ("query: out of memory", Qunbound);
     else
@@ -989,7 +1023,7 @@
 		      C_STRING_ALLOCA, c_query, Qnative);
 
   if (PQsendQuery (P, c_query)) return Qt;
-  else signal_ferror (Qprocess_error, "async query: %s", PQerrorMessage (P));
+  else SIGNAL_ERROR (P, "Sending asynchronous query");
 }
 
 DEFUN ("pq-get-result", Fpq_get_result, 1, 1, 0, /*
@@ -1011,7 +1045,8 @@
   if (!R) return Qnil; /* not an error, there's no more data to get */
 
   {
-    char *tag, buf[BLCKSZ];
+    const Ascbyte *tag;
+    char buf[BLCKSZ];
 
     switch (PQresultStatus (R))
       {
@@ -1063,7 +1098,9 @@
   case PGRES_FATAL_ERROR: return Qpgres_fatal_error;
   default:
     /* they've added a new field we don't know about */
-    signal_ferror (Qprocess_error, "Help!  Unknown exec status code %08x from backend!", est);
+    signal_ferror (Qprocess_error,
+		   "Help!  Unknown exec status code %08x from backend!",
+		   est);
   }
 }
 
@@ -1078,7 +1115,7 @@
   R = (XPGRESULT (result))->pgresult;
   PUKE_IF_NULL (R);
 
-  return build_ext_string (PQresStatus (PQresultStatus (R)), PG_OS_CODING);
+  return build_extstring (PQresStatus (PQresultStatus (R)), PG_OS_CODING);
 }
 
 /* Sundry PGresult accessor functions */
@@ -1093,7 +1130,7 @@
   R = (XPGRESULT (result))->pgresult;
   PUKE_IF_NULL (R);
 
-  return build_ext_string (PQresultErrorMessage (R), PG_OS_CODING);
+  return build_extstring (PQresultErrorMessage (R), PG_OS_CODING);
 }
 
 DEFUN ("pq-ntuples", Fpq_ntuples, 1, 1, 0, /*
@@ -1151,7 +1188,7 @@
   R = (XPGRESULT (result))->pgresult;
   PUKE_IF_NULL (R);
 
-  return build_ext_string (PQfname (R, XINT (field_index)), PG_OS_CODING);
+  return build_extstring (PQfname (R, XINT (field_index)), PG_OS_CODING);
 }
 
 DEFUN ("pq-fnumber", Fpq_fnumber, 2, 2, 0, /*
@@ -1236,7 +1273,7 @@
   R = (XPGRESULT (result))->pgresult;
   PUKE_IF_NULL (R);
 
-  return build_ext_string (PQgetvalue (R, XINT (tup_num), XINT (field_num)),
+  return build_extstring (PQgetvalue (R, XINT (tup_num), XINT (field_num)),
 			   PG_OS_CODING);
 }
 
@@ -1286,7 +1323,7 @@
   R = (XPGRESULT (result))->pgresult;
   PUKE_IF_NULL (R);
 
-  return build_ext_string (PQcmdStatus (R), PG_OS_CODING);
+  return build_extstring (PQcmdStatus (R), PG_OS_CODING);
 }
 
 DEFUN ("pq-cmd-tuples", Fpq_cmd_tuples, 1, 1, 0, /*
@@ -1300,7 +1337,7 @@
   R = (XPGRESULT (result))->pgresult;
   PUKE_IF_NULL (R);
 
-  return build_ext_string (PQcmdTuples (R), PG_OS_CODING);
+  return build_extstring (PQcmdTuples (R), PG_OS_CODING);
 }
 
 DEFUN ("pq-oid-value", Fpq_oid_value, 1, 1, 0, /*
@@ -1394,7 +1431,7 @@
   {
     Lisp_Object temp;
 
-    temp = list2 (build_ext_string (PGN->relname, PG_OS_CODING), make_int (PGN->be_pid));
+    temp = list2 (build_extstring (PGN->relname, PG_OS_CODING), make_int (PGN->be_pid));
     free ((void *)PGN);
     return temp;
   }
@@ -1424,9 +1461,7 @@
   P = (XPGCONN (conn))->pgconn;
   CHECK_LIVE_CONNECTION (P);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, filename,
-		      C_STRING_ALLOCA, c_filename,
-		      Qfile_name);
+  LISP_PATHNAME_CONVERT_OUT (filename, c_filename);
 
   return make_int ((int)lo_import (P, c_filename));
 }
@@ -1445,8 +1480,7 @@
   P = (XPGCONN (conn))->pgconn;
   CHECK_LIVE_CONNECTION (P);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, filename,
-		      C_STRING_ALLOCA, c_filename, Qfile_name);
+  LISP_PATHNAME_CONVERT_OUT (filename, c_filename);
 
   return make_int ((int)lo_export (P, XINT (oid), c_filename));
 }
@@ -1508,7 +1542,7 @@
 
   ret = PQgetline (P, buffer, sizeof (buffer));
 
-  return Fcons (make_int (ret), build_ext_string (buffer, PG_OS_CODING));
+  return Fcons (make_int (ret), build_extstring (buffer, PG_OS_CODING));
 }
 
 DEFUN ("pq-put-line", Fpq_put_line, 2, 2, 0, /*
@@ -1577,7 +1611,7 @@
   if (ret == -1) return Qt; /* done! */
   else if (!ret) return Qnil; /* no data yet */
   else return Fcons (make_int (ret),
-		     make_ext_string ((Extbyte *) buffer, ret, PG_OS_CODING));
+		     make_extstring ((Extbyte *) buffer, ret, PG_OS_CODING));
 }
 
 DEFUN ("pq-put-nbytes", Fpq_put_nbytes, 2, 2, 0, /*
@@ -1847,7 +1881,7 @@
 
 #define FROB(envvar, var)			\
   if ((p = egetenv (envvar)))			\
-    var = build_intstring (p);	\
+    var = build_istring (p);	\
   else						\
     var = Qnil
 
--- a/nt/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/nt/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,24 @@
+2010-02-18  Vin Shelton  <acs@xemacs.org>
+
+	* xemacs.mak (INFO_FILES): Removed term.info.
+
+2010-02-11  Vin Shelton  <acs@xemacs.org>
+ 
+ 	* xemacs.mak (LIB_SRC_DEFINES): Added PROGRAM_DEFINES to lib_src
+ 	compilation options so winclient.c can see them.
+ 
+2010-02-03  Jerry James  <james@xemacs.org>
+
+	* xemacs.rc: Add license and copyright boilerplate text for Jonathan
+	Harris.
+	* xpm.mak: Ditto.
+
+2010-01-28  Jerry James  <james@xemacs.org>
+
+	* compface.mak: Add license and copyright boilerplate text based
+	on Ben's recollections.
+	* tiff.mak: Ditto.
+
 2009-12-21  Jerry James  <james@xemacs.org>
 
 	* xemacs.dsp: Remove references to OffiX files.
--- a/nt/ad2c.sed	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/^!/d
-/^$/d
-s/\\/\\\\/g
-s/\\$//g
-s/"/\\"/g
-s/^/(String) "/
-: test
-/\\$/b slash
-s/$/",/
-p
-d
-: slash
-n
-/^!/d
-/^$/d
-s/"/\\"/g
-s/\\\\/\\/g
-s/\\n/\\\\n/g
-s/\\t/\\\\t/g
-s/\\f/\\\\f/g
-s/\\b/\\\\b/g
-b test
--- a/nt/compface.mak	Wed Jan 20 07:05:57 2010 -0600
+++ b/nt/compface.mak	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,23 @@
-#
-# Compface Makefile for Microsoft NMAKE
-# Based on xpm.mak
-#
+##   Compface Makefile for Microsoft NMAKE
+##   Based on xpm.mak
+##   Copyright (C) 2001 Ben Wing.
+
+## This file is part of XEmacs.
+
+## XEmacs is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+
+## XEmacs is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with XEmacs; see the file COPYING.  If not, write to
+## the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+## Boston, MA 02110-1301, USA.
 
 !if !defined(DEBUG_XEMACS)
 DEBUG_XEMACS=0
--- a/nt/tiff.mak	Wed Jan 20 07:05:57 2010 -0600
+++ b/nt/tiff.mak	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,23 @@
-#
-# TIFF makefile for Microsoft nmake
-#
+##   TIFF makefile for Microsoft nmake
+##   Copyright (C) 2001 Ben Wing.
+
+## This file is part of XEmacs.
+
+## XEmacs is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+
+## XEmacs is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with XEmacs; see the file COPYING.  If not, write to
+## the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+## Boston, MA 02110-1301, USA.
+
 !if !defined(DEBUG_XEMACS)
 DEBUG_XEMACS=0
 !endif
--- a/nt/x11.patch	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-*** X11.def.old	Thu Apr 10 07:29:27 1997
---- X11.def	Wed Jul 02 22:20:16 1997
-***************
-*** 5,15 ****
-  VERSION 6.1
-  EXPORTS
-   _Xdebug_p=_Xdebug CONSTANT
--  _XCreateMutex_fn_p=_XCreateMutex_fn CONSTANT
--  _XFreeMutex_fn_p=_XFreeMutex_fn CONSTANT
--  _XLockMutex_fn_p=_XLockMutex_fn CONSTANT
--  _XUnlockMutex_fn_p=_XUnlockMutex_fn CONSTANT
--  _Xglobal_lock_p=_Xglobal_lock CONSTANT
-   XActivateScreenSaver
-   XAddConnectionWatch
-   XAddExtension
---- 5,10 ----
-***************
-*** 623,630 ****
-   _XUnregisterFilter
-   _XUnregisterInternalConnection
-   _XVIDtoVisual
--  _Xthread_init
--  _Xthread_waiter
-   XkbIgnoreExtension
-   XkbOpenDisplay
-   XkbQueryExtension
---- 618,623 ----
--- a/nt/xemacs.mak	Wed Jan 20 07:05:57 2010 -0600
+++ b/nt/xemacs.mak	Wed Feb 24 01:58:04 2010 -0600
@@ -1033,9 +1033,6 @@
 	set COPYCMD=$(COPYCMD)
 	@copy $(SRC)\config.h.in $(SRC)\config.h
 
-#$(SRC)\Emacs.ad.h: $(SRCROOT)\etc\Emacs.ad
-#	!"sed -f ad2c.sed < $(SRCROOT)\etc\Emacs.ad > $(SRC)\Emacs.ad.h"
-
 #$(SRC)\paths.h: $(SRC)\paths.h.in
 #	!"cd $(SRC); cp paths.h.in paths.h"
 
@@ -1068,7 +1065,7 @@
 
 ###################### lib-src programs
 
-LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE
+LIB_SRC_DEFINES = -DHAVE_CONFIG_H -DWIN32_NATIVE $(PROGRAM_DEFINES)
 
 #
 # Creating config.values to be used by config.el
@@ -1499,7 +1496,6 @@
 	$(INFODIR)\lispref.info \
 	$(INFODIR)\new-users-guide.info \
 	$(INFODIR)\standards.info \
-	$(INFODIR)\term.info \
 	$(INFODIR)\termcap.info \
 	$(INFODIR)\texinfo.info \
 	$(INFODIR)\widget.info \
--- a/nt/xemacs.rc	Wed Jan 20 07:05:57 2010 -0600
+++ b/nt/xemacs.rc	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,22 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 #ifdef INCLUDE_DUMP
 101    DUMP      "xemacs.dmp"
 #endif
--- a/nt/xpm.mak	Wed Jan 20 07:05:57 2010 -0600
+++ b/nt/xpm.mak	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,25 @@
 #
 # XPM Makefile for Microsoft NMAKE without X libraries
 #
+# Copyright (C) 1997 Free Software Foundation, Inc.
+#
+# This file is part of XEmacs.
+#
+# XEmacs is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+#
+# XEmacs is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+# Boston, MA 02110-1301, USA.
+#
 !if !defined(DEBUG)
 !if defined(DEBUG_XEMACS)
 DEBUG=$(DEBUG_XEMACS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/.gdbinit.in.in	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,572 @@
+## gdb init file for XEmacs              -*- ksh -*-
+## This is the source for src/.gdbinit.  Edit it, and rerun configure.
+## (Running config.status is not enough.)
+## The generated file depends on src/config.h (currently only in one place).
+
+## To insert comments that will remain in the generated file, we use the
+## imake XCOMM convention.  Lines beginning with "XCOMM " exactly (no
+## leading whitespace, one trailing ASCII space, case sensitive) will be
+## transformed to gdb command file comments in the generated file.
+
+XCOMM gdb init file for XEmacs
+XCOMM AUTOMATICALLY GENERATED FROM etc/gdbinit.in BY configure -- DO NOT EDIT.
+XCOMM See etc/gdbinit.in for licensing information and usage hints.
+XCOMM Copyright (C) 1998 Free Software Foundation, Inc.
+XCOMM Copyright (C) 2010 Ben Wing.
+
+## This file is part of XEmacs.
+
+## XEmacs is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by the
+## Free Software Foundation; either version 2, or (at your option) any
+## later version.
+
+## XEmacs is distributed in the hope that it will be useful, but WITHOUT
+## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+## for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with XEmacs; see the file COPYING.  If not, write to
+## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+## Boston, MA  02110-1301  USA
+
+## Author: Martin Buchholz
+
+## Other contributors you could ask for help: Ivan Golubev, Jerry James,
+## Stephen Turnbull.
+
+## Some useful commands for debugging emacs with gdb 4.16 or better.
+##
+## Since this file is called `.gdbinit', it will be read by gdb
+## automatically when gdb is run in the build directory, which is where
+## developers usually debug their xemacs.  You can also source this
+## file from your ~/.gdbinit, if you like.
+##
+## Configure xemacs with --debug, and compile with -g.
+##
+## See also the question of the XEmacs FAQ, titled
+## "How to Debug an XEmacs problem with a debugger".
+##
+## This can be used to debug XEmacs no matter how the following are
+## specified:
+
+## USE_UNION_TYPE
+
+## (the above all have configure equivalents)
+
+## Some functions defined here require a running process, but most
+## don't.  Considerable effort has been expended to this end.
+
+## See the dbg_ C support code in src/alloc.c that allows the functions
+## defined in this file to work correctly.
+
+#define NOT_C_CODE
+#include "config.h"
+
+set print union off
+set print pretty off
+
+#ifdef VDB_POSIX
+handle SIGSEGV SIGBUS nostop noprint
+#endif
+
+set $Lisp_Type_Int = -2
+set $Lisp_Type_Record = 0
+set $Lisp_Type_Char = 2
+
+define decode_object
+  set $obj = (unsigned long) $arg0
+  if $obj & 1
+  ## It's an int
+    set $val = $obj >> 1
+    set $type = $Lisp_Type_Int
+  else
+    set $type = $obj & dbg_typemask
+    if $type == $Lisp_Type_Char
+      set $val = ($obj & dbg_valmask) >> dbg_gctypebits
+    else
+      ## It's a record pointer
+      set $val = $obj
+    end
+  end
+
+  if $type == $Lisp_Type_Record
+    set $lheader = ((struct lrecord_header *) $val)
+    set $lrecord_type = ($lheader->type)
+    set $imp = ((struct lrecord_implementation *) lrecord_implementations_table[(int) $lrecord_type])
+  else
+    set $lrecord_type = -1
+    set $lheader = -1
+    set $imp = -1
+  end
+end
+
+document decode_object
+Usage: decode_object lisp_object
+Extract implementation information from a Lisp Object.
+Defines variables $val, $type and $imp.
+end
+
+define xint
+decode_object $arg0
+print ((long) $val)
+end
+
+define xtype
+  decode_object $arg0
+  if $type == $Lisp_Type_Int
+    echo int\n
+  else
+  if $type == $Lisp_Type_Char
+    echo char\n
+  else
+    printf "record type: %s\n", $imp->name
+  end
+  end
+end
+
+document xtype
+Usage: xtype lisp_object
+Print the Lisp type of a lisp object.
+end
+
+define lisp-shadows
+  run -batch -vanilla -f list-load-path-shadows
+end
+
+document lisp-shadows
+Usage: lisp-shadows
+Run xemacs to check for lisp shadows
+end
+
+define environment-to-run-temacs
+  unset env EMACSLOADPATH
+  set env EMACSBOOTSTRAPLOADPATH=@srcdir@/../lisp/:@srcdir@/..
+  set env EMACSBOOTSTRAPMODULEPATH=../modules/:..
+end
+
+define run-temacs
+  environment-to-run-temacs
+  run -nd -no-packages -batch -l @srcdir@/../lisp/loadup.el run-temacs -q
+end
+
+document run-temacs
+Usage: run-temacs
+Run temacs interactively, like xemacs.
+Use this with debugging tools (like purify) that cannot deal with dumping,
+or when temacs builds successfully, but xemacs does not.
+end
+
+define check-xemacs-arg
+  run -vanilla -batch -l @srcdir@/../tests/automated/test-harness.el -f batch-test-emacs @srcdir@/../tests/$arg0
+end
+
+define check-xemacs
+  if $argc == 0
+    check-xemacs-arg automated
+  else
+    check-xemacs-arg automated/$arg0
+  end
+end
+
+document check-xemacs
+Usage: check-xemacs [FILE]
+Run the test suite.  If no file given, run the whole suite, equivalent to
+'make check'.  If a file given, run the suite only on the specified file.
+end
+
+define check-temacs-arg
+  environment-to-run-temacs
+  run -nd -no-packages -batch -l @srcdir@/../lisp/loadup.el run-temacs -q -batch -l @srcdir@/../tests/automated/test-harness.el -f batch-test-emacs @srcdir@/../tests/$arg0
+
+define check-temacs
+  if $argc == 0
+    check-temacs-arg automated
+  else
+    check-temacs-arg automated/$arg0
+  end
+end
+
+document check-temacs
+Usage: check-temacs [FILE]
+Run the test suite on temacs.  If no file given, run the whole suite,
+equivalent to 'make check-temacs'.  If a file given, run the suite only on
+the specified file.
+
+Use this with debugging tools (like purify) that cannot deal with dumping,
+or when temacs builds successfully, but xemacs does not.
+end
+
+define update-elc
+  environment-to-run-temacs
+  run -nd -no-packages -batch -l @srcdir@/../lisp/update-elc.el
+end
+
+document update-elc
+Usage: update-elc
+Run the core lisp byte compilation part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+end
+
+define update-elc-2
+  environment-to-run-temacs
+  run -no-packages -batch -no-autoloads -l update-elc-2.el -f batch-update-elc-2 @srcdir@/../lisp
+end
+
+document update-elc-2
+Usage: update-elc-2
+Run the post-dump core lisp byte compilation part of the build procedure.
+end
+
+define dmp
+  environment-to-run-temacs
+  run -nd -no-packages -batch -l @srcdir@/../lisp/loadup.el dump
+end
+
+document dmp
+Usage: dmp
+Run the dumping part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+end
+
+define ldp
+  printf "%s", "Lisp => "
+  call debug_print($arg0)
+end
+
+document ldp
+Usage: ldp lisp_object
+Print a Lisp Object value using the Lisp printer.
+Requires a running xemacs process.
+end
+
+define lbt
+call debug_backtrace()
+end
+
+document lbt
+Usage: lbt
+Print the current Lisp stack trace.
+Requires a running xemacs process.
+end
+
+
+define leval
+ldp Feval(Fcar(Fread_from_string(build_cistring($arg0),Qnil,Qnil)))
+end
+
+document leval
+Usage: leval "SEXP"
+Eval a lisp expression.
+Requires a running xemacs process.
+
+Example:
+(gdb) leval "(+ 1 2)"
+Lisp ==> 3
+end
+
+
+define wtype
+print $arg0->core.widget_class->core_class.class_name
+end
+
+define xtname
+print XrmQuarkToString(((Object)($arg0))->object.xrm_name)
+end
+
+## GDB's command language makes you want to ...
+
+define pptype
+  set $type_ptr = ($arg0 *) $val
+  print $type_ptr
+  print *$type_ptr
+end
+
+define pstructtype
+  set $type_ptr = (struct $arg0 *) $val
+  print $type_ptr
+  print *$type_ptr
+end
+
+define pobj
+  decode_object $arg0
+  if $type == $Lisp_Type_Int
+    printf "Integer: %d\n", $val
+  else
+  if $type == $Lisp_Type_Char
+    if $val > 32 && $val < 128
+      printf "Char: %c\n", $val
+    else
+      printf "Char: %d\n", $val
+    end
+  else
+  if $lrecord_type == lrecord_type_string
+    pptype Lisp_String
+  else
+  if $lrecord_type == lrecord_type_cons
+    pptype Lisp_Cons
+  else
+  if $lrecord_type == lrecord_type_symbol
+    pptype Lisp_Symbol
+    printf "Symbol name: %s\n", ((Lisp_String *)$type_ptr->name)->data_
+  else
+  if $lrecord_type == lrecord_type_vector
+    pptype Lisp_Vector
+    printf "Vector of length %d\n", $type_ptr->size
+    ##print *($type_ptr->data) @ $type_ptr->size
+  else
+  if $lrecord_type == lrecord_type_bit_vector
+    pptype Lisp_Bit_Vector
+  else
+  if $lrecord_type == lrecord_type_buffer
+    pstructtype buffer
+  else
+  if $lrecord_type == lrecord_type_char_table
+    pptype Lisp_Char_Table
+  else
+  if $lrecord_type == lrecord_type_char_table_entry
+    pptype Lisp_Char_Table_Entry
+  else
+  if $lrecord_type == lrecord_type_charset
+    pptype Lisp_Charset
+  else
+  if $lrecord_type == lrecord_type_coding_system
+    pptype Lisp_Coding_System
+  else
+  if $lrecord_type == lrecord_type_color_instance
+    pptype Lisp_Color_Instance
+  else
+  if $lrecord_type == lrecord_type_command_builder
+    pptype command_builder
+  else
+  if $lrecord_type == lrecord_type_compiled_function
+    pptype Lisp_Compiled_Function
+  else
+  if $lrecord_type == lrecord_type_console
+    pstructtype console
+  else
+  if $lrecord_type == lrecord_type_database
+    pptype Lisp_Database
+  else
+  if $lrecord_type == lrecord_type_device
+    pstructtype device
+  else
+  if $lrecord_type == lrecord_type_event
+    pptype Lisp_Event
+  else
+  if $lrecord_type == lrecord_type_extent
+    pstructtype extent
+  else
+  if $lrecord_type == lrecord_type_extent_auxiliary
+    pstructtype extent_auxiliary
+  else
+  if $lrecord_type == lrecord_type_extent_info
+    pstructtype extent_info
+  else
+  if $lrecord_type == lrecord_type_face
+    pptype Lisp_Face
+  else
+  if $lrecord_type == lrecord_type_float
+    pptype Lisp_Float
+  else
+  if $lrecord_type == lrecord_type_font_instance
+    pptype Lisp_Font_Instance
+  else
+  if $lrecord_type == lrecord_type_frame
+    pstructtype frame
+  else
+  if $lrecord_type == lrecord_type_glyph
+    pptype Lisp_Glyph
+  else
+  if $lrecord_type == lrecord_type_gui_item
+    pptype Lisp_Gui_Item
+  else
+  if $lrecord_type == lrecord_type_hash_table
+    pptype Lisp_Hash_Table
+  else
+  if $lrecord_type == lrecord_type_image_instance
+    pptype Lisp_Image_Instance
+  else
+  if $lrecord_type == lrecord_type_keymap
+    pptype Lisp_Keymap
+  else
+  if $lrecord_type == lrecord_type_lcrecord_list
+    pstructtype lcrecord_list
+  else
+  if $lrecord_type == lrecord_type_ldap
+    pptype Lisp_LDAP
+  else
+  if $lrecord_type == lrecord_type_lstream
+    pstructtype lstream
+  else
+  if $lrecord_type == lrecord_type_marker
+    pptype Lisp_Marker
+  else
+  if $lrecord_type == lrecord_type_opaque
+    pptype Lisp_Opaque
+  else
+  if $lrecord_type == lrecord_type_opaque_ptr
+    pptype Lisp_Opaque_Ptr
+  else
+  if $lrecord_type == lrecord_type_popup_data
+    pptype popup_data
+  else
+  if $lrecord_type == lrecord_type_process
+    pptype Lisp_Process
+  else
+  if $lrecord_type == lrecord_type_range_table
+    pptype Lisp_Range_Table
+  else
+  if $lrecord_type == lrecord_type_specifier
+    pptype Lisp_Specifier
+  else
+  if $lrecord_type == lrecord_type_subr
+    pptype Lisp_Subr
+  else
+  if $lrecord_type == lrecord_type_symbol_value_buffer_local
+    pstructtype symbol_value_buffer_local
+  else
+  if $lrecord_type == lrecord_type_symbol_value_forward
+    pstructtype symbol_value_forward
+  else
+  if $lrecord_type == lrecord_type_symbol_value_lisp_magic
+    pstructtype symbol_value_lisp_magic
+  else
+  if $lrecord_type == lrecord_type_symbol_value_varalias
+    pstructtype symbol_value_varalias
+  else
+  if $lrecord_type == lrecord_type_timeout
+    pptype Lisp_Timeout
+  else
+  if $lrecord_type == lrecord_type_toolbar_button
+    pstructtype toolbar_button
+  else
+  if $lrecord_type == lrecord_type_tooltalk_message
+    pptype Lisp_Tooltalk_Message
+  else
+  if $lrecord_type == lrecord_type_tooltalk_pattern
+    pptype Lisp_Tooltalk_Pattern
+  else
+  if $lrecord_type == lrecord_type_weak_list
+    pstructtype weak_list
+  else
+  if $lrecord_type == lrecord_type_window
+    pstructtype window
+  else
+  if $lrecord_type == lrecord_type_window_configuration
+    pstructtype window_config
+  else
+  if $lrecord_type == lrecord_type_fc_pattern
+    pstructtype fc_pattern
+  else
+  if $lrecord_type == lrecord_type_fc_config
+    pstructtype fc_config
+  else
+    echo Unknown Lisp Object type\n
+    print $arg0
+  ## Barf, gag, retch
+  end
+  end 
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  ## Repeat after me... gdb sux, gdb sux, gdb sux...
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  ## Are we having fun yet??
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+  end
+end
+
+document pobj
+Usage: pobj lisp_object
+Print the internal C representation of a Lisp Object.
+end
+
+## -------------------------------------------------------------
+## functions to test the debugging support itself.
+## If you change this file, make sure the following still work...
+## -------------------------------------------------------------
+define test_xtype
+  printf "Vemacs_major_version: "
+  xtype Vemacs_major_version
+  printf "Vhelp_char: "
+  xtype Vhelp_char
+  printf "Qnil: "
+  xtype Qnil
+  printf "Qunbound: "
+  xtype Qunbound
+  printf "Vobarray: "
+  xtype Vobarray
+  printf "Vall_weak_lists: "
+  xtype Vall_weak_lists
+  printf "Vxemacs_codename: "
+  xtype Vxemacs_codename
+end
+
+define test_pobj
+  printf "Vemacs_major_version: "
+  pobj Vemacs_major_version
+  printf "Vhelp_char: "
+  pobj Vhelp_char
+  printf "Qnil: "
+  pobj Qnil
+  printf "Qunbound: "
+  pobj Qunbound
+  printf "Vobarray: "
+  pobj Vobarray
+  printf "Vall_weak_lists: "
+  pobj Vall_weak_lists
+  printf "Vxemacs_codename: "
+  pobj Vxemacs_codename
+end
+
--- a/src/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -232,6 +232,3564 @@
 	* window.c (make_dummy_parent):
 	Create a simpler interface (ALLOC_LCRECORD) for allocating 
 
+2010-02-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fns.c (split_string_by_ichar_1):
+	Use better types (e.g., not an Ichar for a buffer size) in this
+	function when dealing with ESCAPECHAR.
+
+2010-02-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fns.c (mapcarX):
+	Correct this function, discarding multiple values when one
+	SEQUENCE is supplied, choosing a better label name.  Correct the
+	comment describing the SOME_OR_EVERY argument.
+
+2010-02-12  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* syswindows.h:
+	Remove the PDWORD_PTR typedef; it's not used in
+	intl-auto-encap-win32.h , and it breaks the build with Visual C++
+	2005 Express Edition and a 2005 copy of the SDK.
+
+2010-02-10  Ben Wing  <ben@xemacs.org>
+
+	* text.h:
+	* text.h (VALIDATE_IBYTEPTR_BACKWARD):
+	* text.h (EI_ALLOC):
+	* text.h (eicpyout_alloca_fmt):
+	* text.h (eifree):
+	* text.h (eito_alloca):
+	* text.h (eito_external):
+	* text.h (DFC_LISP_STRING_USE_CONVERTED_DATA):
+	* text.h (EXTERNAL_TO_ITEXT):
+	(1) Fix up long comment about the internal-external conversion
+	macros to reflect the recent changes to the macros.
+
+	(2) Reformat the macros in text.h so they line up properly.
+
+2010-02-09  Jerry James  <james@xemacs.org>
+
+	* s/hpux11-shr.h: Add license information from Marcus Thiessel.
+
+2010-02-09  Ben Wing  <ben@xemacs.org>
+
+	* dynarr.c (Dynarr_insert_many):
+	* dynarr.c (Dynarr_delete_many):
+	* emacs.c:
+	* emacs.c (pause_so_user_can_read_messages):
+	* emacs.c (Fkill_emacs):
+	* emacs.c (guts_of_fatal_error_signal):
+	* lisp.h:
+	* lisp.h (INLINE_ERROR_CHECK_ARGS):
+	* lisp.h (Dynarr_set_length_1):
+	* lisp.h (Dynarr_set_length):
+	* lisp.h (Dynarr_pop):
+	Add ERROR_CHECK_DYNARR, dynarr_checking_assert().  Use it.
+	Sort existing error-check categories in lisp.h, remove most of the
+	(unused) assert variations from most categories.  Add a long
+	comment about reorganizing the system by categories and
+	subcategories.  Create ERROR_CHECK_ANY if any error-checking
+	categories defined, and use it in emacs.c to define
+	USER_IS_DEVELOPING_XEMACS.
+
+	In emacs.c and cmdloop.c, don't display a message at early
+	shutdown or fatal shutdown when on Cygwin, only Windows native --
+	Cygwin has a working stderr that shows error output.
+
+	Update comment in Dynarr_verify_pos_atp().
+	
+
+2010-02-09  Ben Wing  <ben@xemacs.org>
+
+	* syswindows.h:
+	Create a long comment about build flags such as WIN32_NATIVE,
+	HAVE_MS_WINDOWS.
+
+2010-02-09  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	Disabled inline assert should just use disabled_assert()
+	not disabled_assert_at_line() otherwise you get compile errors.
+	(Hasn't bitten us only because no one is currently using inline
+	asserts -- but this is different in the Unicode-internal repo.)
+
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* charset.h:
+	* charset.h (Fget_charset): Declare some fake charset defs so
+	we can compile when non-Mule.
+	* depend: Rebuild.
+
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* event-Xt.c:
+	Add comment about simultaneous window-system consoles/devices.
+
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c:
+	Add prototypes for debugging functions.
+	
+	* alloc.c (compact_string_chars): Make static.
+	
+	* console-x.c (x_initially_selected_for_input):
+	* console-x.h:
+	* console-x.h (X_ERROR_OCCURRED):
+	Delete x_has_keysym() prototype from console-x.c, move to console-x.h.
+
+	* eval.c (multiple_value_call):
+	Real bug: Fix shadowing local vars.
+	
+	* event-unixoid.c (read_event_from_tty_or_stream_desc):
+	* event-unixoid.c (signal_fake_event):
+	* lread.c (check_if_suppressed):
+	* strftime.c (strftime):
+	Fix stupid global shadowing warnings.
+	
+	* event-unixoid.c (signal_fake_event):
+	* event-unixoid.c (drain_signal_event_pipe):
+	Use Rawbyte, not char.
+	
+	* frame.h: Remove old prototype.
+	
+	* gc.c:
+	* gc.c (show_gc_cursor_and_message):
+	* gc.c (remove_gc_cursor_and_message):
+	* gc.c (gc_prepare):
+	* gc.c (gc_finish_mark):
+	* gc.c (gc_finalize):
+	* gc.c (gc_sweep):
+	* gc.c (gc_finish):
+	* gc.c (gc_suspend_mark_phase):
+	* gc.c (gc_resume_mark_phase):
+	* gc.c (gc_mark):
+	* gc.c (gc_resume_mark):
+	Make fns static.
+	
+	* glyphs-eimage.c (gif_decode_error_string):
+	Fix non-prototype.
+	
+	* lisp.h:
+	Hack around global shadowing warnings involving `index'.
+	
+	* intl-win32.c (wcsncpy):
+	* number-gmp.c (bigfloat_to_string):
+	* objects-msw.c (mswindows_font_spec_matches_charset_stage_2):
+	* specifier.c (call_charset_predicate):
+	* specifier.c (DEFINE_SPECIFIER_TAG_FROB):
+	Declarations cannot follow statements in standard C.
+
+	* search.c (search_buffer): Fix local shadowing warnings.
+	
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* faces.c:
+	* faces.c (face_property_matching_instance):
+	* faces.c (ensure_face_cachel_contains_charset):
+	* faces.h (FACE_FONT):
+	* lisp.h:
+	* lisp.h (enum font_specifier_matchspec_stages):
+	* objects-msw.c:
+	* objects-msw.c (mswindows_font_spec_matches_charset):
+	* objects-msw.c (mswindows_find_charset_font):
+	* objects-tty.c:
+	* objects-tty.c (tty_font_spec_matches_charset):
+	* objects-tty.c (tty_find_charset_font):
+	* objects-xlike-inc.c:
+	* objects-xlike-inc.c (XFUN):
+	* objects-xlike-inc.c (xft_find_charset_font):
+	* objects.c:
+	* objects.c (font_instantiate):
+	* objects.c (FROB):
+	* specifier.c:
+	* specifier.c (charset_matches_specifier_tag_set_p):
+	* specifier.c (call_charset_predicate):
+	* specifier.c (define_specifier_tag):
+	* specifier.c (Fdefine_specifier_tag):
+	* specifier.c (setup_charset_initial_specifier_tags):
+	* specifier.c (specifier_instance_from_inst_list):
+	* specifier.c (FROB):
+	* specifier.c (vars_of_specifier):
+	* specifier.h:
+	Rename the specifier-font-matching stages in preparation for
+	eliminating shadowed warnings, some other related fixes from
+	ben-unicode-internal.
+
+	1. Rename raw enums:
+	   initial	 -> STAGE_INITIAL
+	   final	 -> STAGE_FINAL
+	   impossible	 -> NUM_MATCHSPEC_STAGES
+	2. Move `enum font_specifier_matchspec_stages' from
+	   specifier.h to lisp.h.
+	3. Whitespace changes to match coding standards.
+	4. Eliminate unused second argument STAGE in charset predicates
+	   that don't use it -- the code that calls the charset predicates
+	   is now smart enough to supply the right number of arguments
+	   automatically.
+	5. Add some long(ish) comments and authorial notices, esp. in
+	   objects.c.
+	6. In specifier.c, change Vcharset_tag_lists from a vector over
+	   leading bytes to a hash table over charsets.  This change is
+	   unnecessary currently but doesn't hurt and will be required
+	   when we merge in Unicode-internal.
+	7. In specifier.c, extract out the code that calls charset predicates
+	   into a function call_charset_predicate().
+
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* emacs.c:
+	* emacs.c (assert_failed):
+	Fix comments about when inhibit_non_essential_printing_operations
+	is set and how used.  Increment/decrement in assert_failed rather
+	than just setting/resetting to avoid hosing things in case we're
+	called when the value is already non-zero.  Similarly increment/
+	decrement in_assert_failed.
+	
+	* gc.c (gc_prepare):
+	* gc.c (gc_finish):
+	Increment/decrement inhibit_non_essential_printing_operations
+	rather than setting/resetting.
+	
+	* print.c:
+	* print.c (debug_out):
+	* print.c (write_string_to_alternate_debugging_output):
+	* print.c (restore_inhibit_non_essential_conversion_operations):
+	* print.c (debug_print_exit):
+	* print.c (debug_print_enter):
+	* print.c (debug_prin1):
+	* print.c (debug_p4):
+	* print.c (ext_print_begin):
+	* print.c (ext_print_end):
+	* print.c (external_debug_print):
+	* print.c (debug_p3):
+	* print.c (debug_backtrace):
+	* print.c (debug_short_backtrace):
+	* print.c (vars_of_print):
+	Lots of cleanup.  Fix debug_out() so it binds
+	inhibit_non_essential_printing_operations around it to ensure no
+	conversion.  Remove many other places that set the same var since
+	the lower-level functions now all do it.  A few other places, add
+	inhibit_non_essential_printing_operations bindings.Extract the
+	code out that sets up and resets lots of bindings in debug_prin1()
+	so that debug_backtrace() can use it, and rewrite it to use the
+	new STORE_VOID_IN_LISP() rather than having to have a single
+	static opaque structure holding all the bindings (and not handling
+	reentrancy).  Fix raw `char' to be `CIbyte' in the declaration of
+	`alternate_do_string'.
+	
+	* signal.c (check_what_happened):
+	Fix bug: Don't try to check for QUIT when
+	inhibit_non_essential_printing_operations or we may screw things
+	up if QUIT happens during debug printing.
+
+2010-02-08  Ben Wing  <ben@xemacs.org>
+
+	* casetab.c (compute_canon_mapper):
+	* casetab.c (initialize_identity_mapper):
+	* casetab.c (compute_up_or_eqv_mapper):
+	* casetab.c (recompute_case_table):
+	* casetab.c (set_case_table):
+	* chartab.c (copy_mapper):
+	* chartab.c (copy_char_table_range):
+	* chartab.c (get_range_char_table_1):
+	* console.c (find_nonminibuffer_frame_not_on_console_predicate):
+	* console.c (find_nonminibuffer_frame_not_on_console):
+	* console.c (nuke_all_console_slots):
+	* device.c:
+	* device.c (find_nonminibuffer_frame_not_on_device_predicate):
+	* device.c (find_nonminibuffer_frame_not_on_device):
+	* dialog-msw.c (dialog_proc):
+	* dialog-msw.c (handle_question_dialog_box):
+	* dialog-x.c (maybe_run_dbox_text_callback):
+	* eval.c:
+	* eval.c (safe_run_hook_trapping_problems_1):
+	* eval.c (safe_run_hook_trapping_problems):
+	* event-msw.c:
+	* event-msw.c (mswindows_wnd_proc):
+	* event-msw.c (mswindows_find_frame):
+	* faces.c (update_face_inheritance_mapper):
+	* frame-msw.c (mswindows_init_frame_1):
+	* frame-msw.c (mswindows_get_mouse_position):
+	* frame-msw.c (mswindows_get_frame_parent):
+	* glade.c (connector):
+	* glade.c (Fglade_xml_signal_connect):
+	* glade.c (Fglade_xml_signal_autoconnect):
+	* glade.c (Fglade_xml_textdomain):
+	* glyphs-msw.c (mswindows_subwindow_instantiate):
+	* glyphs-msw.c (mswindows_widget_instantiate):
+	* glyphs.c (check_instance_cache_mapper):
+	* glyphs.c (check_window_subwindow_cache):
+	* glyphs.c (check_image_instance_structure):
+	* gui-x.c (snarf_widget_value_mapper):
+	* gui-x.c (popup_selection_callback):
+	* gui-x.c (button_item_to_widget_value):
+	* keymap.c (map_keymap_mapper):
+	* keymap.c (Fmap_keymap):
+	* menubar-gtk.c (__torn_off_sir):
+	* menubar-gtk.c (__activate_menu):
+	* menubar-gtk.c (menu_convert):
+	* menubar-gtk.c (__generic_button_callback):
+	* menubar-gtk.c (menu_descriptor_to_widget_1):
+	* menubar-msw.c:
+	* menubar-msw.c (EMPTY_ITEM_ID):
+	* menubar-x.c (menu_item_descriptor_to_widget_value_1):
+	* menubar-x.c (pre_activate_callback):
+	* menubar-x.c (command_builder_operate_menu_accelerator):
+	* menubar-x.c (command_builder_find_menu_accelerator):
+	* print.c (print_internal):
+	* process-unix.c (close_process_descs_mapfun):
+	* process.c (get_process_from_usid):
+	* process.c (init_process_io_handles):
+	* profile.c (sigprof_handler):
+	* profile.c (get_profiling_info_timing_maphash):
+	* profile.c (Fget_profiling_info):
+	* profile.c (set_profiling_info_timing_maphash):
+	* profile.c (mark_profiling_info_maphash):
+	* scrollbar-msw.c (mswindows_create_scrollbar_instance):
+	* scrollbar-msw.c (mswindows_free_scrollbar_instance):
+	* scrollbar-msw.c (mswindows_handle_scrollbar_event):
+	* specifier.c (recompute_cached_specifier_everywhere_mapfun):
+	* specifier.c (recompute_cached_specifier_everywhere):
+	* syntax.c (copy_to_mirrortab):
+	* syntax.c (copy_if_not_already_present):
+	* syntax.c (update_just_this_syntax_table):
+	* text.c (new_dfc_convert_now_damn_it):
+	* text.h (LISP_STRING_TO_EXTERNAL):
+	* tooltalk.c:
+	* tooltalk.c (tooltalk_message_callback):
+	* tooltalk.c (tooltalk_pattern_callback):
+	* tooltalk.c (Fcreate_tooltalk_message):
+	* tooltalk.c (Fcreate_tooltalk_pattern):
+	* ui-byhand.c (__generic_toolbar_callback):
+	* ui-byhand.c (generic_toolbar_insert_item):
+	* ui-byhand.c (__emacs_gtk_ctree_recurse_internal):
+	* ui-byhand.c (Fgtk_ctree_recurse):
+	* ui-gtk.c (__internal_callback_destroy):
+	* ui-gtk.c (__internal_callback_marshal):
+	* ui-gtk.c (Fgtk_signal_connect):
+	* ui-gtk.c (gtk_type_to_lisp):
+	* ui-gtk.c (lisp_to_gtk_type):
+	* ui-gtk.c (lisp_to_gtk_ret_type):
+	* lisp-disunion.h:
+	* lisp-disunion.h (NON_LVALUE):
+	* lisp-union.h:
+	* lisp.h (LISP_HASH):
+	Rename:
+
+	LISP_TO_VOID -> STORE_LISP_IN_VOID
+	VOID_TO_LISP -> GET_LISP_FROM_VOID
+
+	These new names are meant to clearly identify that the Lisp object
+	is the source and void the sink, and that they can't be used the
+	other way around -- they aren't exact opposites despite the old
+	names.  The names are also important given the new functions
+	created just below.  Also, clarify comments in lisp-union.h and
+	lisp-disunion.h about the use of the functions.
+
+	* lisp.h:
+	New functions STORE_VOID_IN_LISP and GET_VOID_FROM_LISP.  These
+	are different from the above in that the source is a void *
+	(previously, you had to use make_opaque_ptr()).
+
+	* eval.c (restore_lisp_object):
+	* eval.c (record_unwind_protect_restoring_lisp_object):
+	* eval.c (struct restore_int):
+	* eval.c (restore_int):
+	* eval.c (record_unwind_protect_restoring_int):
+	* eval.c (free_pointer):
+	* eval.c (record_unwind_protect_freeing):
+	* eval.c (free_dynarr):
+	* eval.c (record_unwind_protect_freeing_dynarr):
+	* eval.c (unbind_to_1):
+	Use STORE_VOID_IN_LISP and GET_VOID_FROM_LISP to eliminate the
+	use of make_opaque_ptr() and mostly eliminate Lisp consing
+	entirely in the use of these various record_unwind_protect_*
+	functions as well as internal_bind_* (e.g. internal_bind_int).
+
+	* tests.c:
+	* tests.c (Ftest_store_void_in_lisp):
+	* tests.c (syms_of_tests):
+	* tests.c (vars_of_tests):
+	Add an C-assert-style test to test STORE_VOID_IN_LISP and
+	GET_VOID_FROM_LISP to make sure the same value comes back that
+	was put in.
+
+2010-02-09  Vin Shelton  <acs@xemacs.org>
+
+	* objects-msw.c (mswindows_font_spec_matches_charset_stage_2):
+	Declare hfont at start of a code block.
+
+	* glyphs-eimage.c: Undefine and then redefine FAR around the jpeg
+	header.
+
+2010-02-08  Vin Shelton  <acs@xemacs.org>
+
+	* nt.c (open_unc_volume): lpRemoteName is an XELPTSTR.
+
+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* lisp.h (Dynarr_verify, Dynarr_verify_mod):
+	If ERROR_CHECK_STRUCTURES is not defined, cast the argument in
+	these two macros; fixes the g++ build.
+
+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fileio.c (Finsert_file_contents_internal):
+	Only call format-decode if it has a function binding.
+	(build_annotations): Only call format-annotate-function if it has
+	a function binding; incidentally only calling #'car-less-than-car
+	if *it* has a function binding.
+	(syms_of_fileio): #'car-less-than-car and #'cdr-less-than-cdr are
+	now in Lisp.
+
+2010-02-07  Ben Wing  <ben@xemacs.org>
+
+	* fns.c: Qlist, Qstring mistakenly declared twice.
+	* fns.c (mapcarX):
+	(void) cast needed to avoid compile problem.
+
+2010-02-07  Ben Wing  <ben@xemacs.org>
+
+	* emacs.c (make_argc_argv):
+	Cast to Wexttext * to fix compile error.
+	
+	* nt.c (init_user_info):
+	Cast to CIbyte * to fix compile error.
+	
+	* nt.c (open_unc_volume):
+	To fix compile error, store pathname into an Extbyte * variable
+	then write into the dest, casting to LPTSTR.
+
+	* emacs.c (debug_can_access_memory):
+	* fileio.c (Fmake_temp_name):
+	* fileio.c (a_write):
+	* fns.c:
+	* fns.c (check_losing_bytecode):
+	* fns.c (plists_differ):
+	* fns.c (internal_equal_trapping_problems):
+	* fns.c (base64_value_to_char):
+	* fns.c (base64_conversion_error):
+	* fns.c (STORE_BYTE):
+	* fns.c (vars_of_fns):
+	* lisp.h:
+	* nt.c (init_user_info):
+	* nt.c (mswindows_readdir):
+	* nt.c (mswindows_executable_type):
+	Replace raw `char *' or `unsigned char *' with characterized type --
+	Rawbyte, Binbyte, Boolbyte, Ibyte or Ascbyte.  This should fix at
+	least one real bug -- in a_write(), the "speedy insert" code that
+	checks for an unchanged region declared the file data read in as
+	char[] but then compared the value to an Ichar.  Hence, any chars
+	in the range 128-255 would always appear changed -- in particular,
+	this algorithm would fail completely with binary data.
+	
+
+2010-02-07  Ben Wing  <ben@xemacs.org>
+
+	* fns.c (mapcarX):
+	C++ requires explicit cast to enum lrecord_type.
+
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* mule-wnnfns.c:
+	Convert file to utf-8.
+	
+2010-02-03  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fns.c (mapcarX):
+	Accept a new argument, indicating whether the function is being
+	called from #'some or #'every. Implement it.
+	Discard any multiple values where that is appropriate.
+	(Fmapconcat, FmapcarX, Fmapvector, Fmapcan, Fmapc, Fmap)
+	(Fmap_into):
+	Pass the new flag to mapcarX.
+	(Fsome, Fevery): Move these functions here from cl-extra.el;
+	implement them in terms of mapcarX.
+	(maplist): Discard multiple values where appropriate.
+
+2010-02-06  Ben Wing  <ben@xemacs.org>
+
+	* config.h.in: Add undef for TRUST_NDBM_H_PROTOTYPES.
+	* database.c:
+	* database.c (struct):
+	Use TRUST_NDBM_H_PROTOTYPES to determine whether to include ndbm.h
+	or to specify our own prototypes, in place of CYGWIN_HEADERS (or
+	more generally, any random list of systems).
+	* depend: Regenerate.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	Cast pointer when storing value to avoid problems because some
+	store vars are Extbyte * and some are LPTSTR.
+
+2010-02-05  Jerry James  <james@xemacs.org>
+
+	* s/sco7.h: Add copyright and license header with the permission of
+	Ron Record, the author.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* depend:
+	Regenerate.
+	* make-src-depend (PrintPatternDeps):
+	Remove refs to xgccache, no longer existent.
+	
+	* select-gtk.c (THIS_IS_GTK):
+	* select-gtk.c (gtk_decline_selection_request):
+	* select-x.c (THIS_IS_X):
+	* select-xlike-inc.c:
+	* select-xlike-inc.c (selection_data_to_lisp_data):
+	Rename PROCESSING_X_CODE to THIS_IS_X and PROCESSING_GTK_CODE to
+	THIS_SI_GTK for consistency with other xlike code.
+	
+	Rename select-xlike-inc.c from select-common.h, in keeping with
+	xlike terminology.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* console-msw.c (write_string_to_mswindows_debugging_output):
+	* console-msw.c (Fmswindows_message_box):
+	* console-x.c (x_perhaps_init_unseen_key_defaults):
+	* console.c:
+	* database.c (dbm_get):
+	* database.c (dbm_put):
+	* database.c (dbm_remove):
+	* database.c (berkdb_get):
+	* database.c (berkdb_put):
+	* database.c (berkdb_remove):
+	* database.c (Fopen_database):
+	* device-gtk.c (gtk_init_device):
+	* device-msw.c (msprinter_init_device_internal):
+	* device-msw.c (msprinter_default_printer):
+	* device-msw.c (msprinter_init_device):
+	* device-msw.c (sync_printer_with_devmode):
+	* device-msw.c (Fmsprinter_select_settings):
+	* device-x.c (sanity_check_geometry_resource):
+	* device-x.c (Dynarr_add_validified_lisp_string):
+	* device-x.c (x_init_device):
+	* device-x.c (Fx_put_resource):
+	* device-x.c (Fx_valid_keysym_name_p):
+	* device-x.c (Fx_set_font_path):
+	* dialog-msw.c (push_lisp_string_as_unicode):
+	* dialog-msw.c (handle_directory_dialog_box):
+	* dialog-msw.c (handle_file_dialog_box):
+	* dialog-x.c (dbox_descriptor_to_widget_value):
+	* editfns.c (Fformat_time_string):
+	* editfns.c (Fencode_time):
+	* editfns.c (Fset_time_zone_rule):
+	* emacs.c (make_argc_argv):
+	* emacs.c (Fdump_emacs):
+	* emodules.c (emodules_load):
+	* eval.c:
+	* eval.c (maybe_signal_error_1):
+	* event-msw.c (Fdde_alloc_advise_item):
+	* event-msw.c (mswindows_dde_callback):
+	* event-msw.c (mswindows_wnd_proc):
+	* fileio.c (report_error_with_errno):
+	* fileio.c (Fsysnetunam):
+	* fileio.c (Fdo_auto_save):
+	* font-mgr.c (extract_fcapi_string):
+	* font-mgr.c (Ffc_config_app_font_add_file):
+	* font-mgr.c (Ffc_config_app_font_add_dir):
+	* font-mgr.c (Ffc_config_filename):
+	* frame-gtk.c (gtk_set_frame_text_value):
+	* frame-gtk.c (gtk_create_widgets):
+	* frame-msw.c (mswindows_init_frame_1):
+	* frame-msw.c (mswindows_set_title_from_ibyte):
+	* frame-msw.c (msprinter_init_frame_3):
+	* frame-x.c (x_set_frame_text_value):
+	* frame-x.c (x_set_frame_properties):
+	* frame-x.c (start_drag_internal_1):
+	* frame-x.c (x_cde_transfer_callback):
+	* frame-x.c (x_create_widgets):
+	* glyphs-eimage.c (my_jpeg_output_message):
+	* glyphs-eimage.c (jpeg_instantiate):
+	* glyphs-eimage.c (gif_instantiate):
+	* glyphs-eimage.c (png_instantiate):
+	* glyphs-eimage.c (tiff_instantiate):
+	* glyphs-gtk.c (xbm_instantiate_1):
+	* glyphs-gtk.c (gtk_xbm_instantiate):
+	* glyphs-gtk.c (gtk_xpm_instantiate):
+	* glyphs-gtk.c (gtk_xface_instantiate):
+	* glyphs-gtk.c (cursor_font_instantiate):
+	* glyphs-gtk.c (gtk_redisplay_widget):
+	* glyphs-gtk.c (gtk_widget_instantiate_1):
+	* glyphs-gtk.c (gtk_add_tab_item):
+	* glyphs-msw.c (mswindows_xpm_instantiate):
+	* glyphs-msw.c (bmp_instantiate):
+	* glyphs-msw.c (mswindows_resource_instantiate):
+	* glyphs-msw.c (xbm_instantiate_1):
+	* glyphs-msw.c (mswindows_xbm_instantiate):
+	* glyphs-msw.c (mswindows_xface_instantiate):
+	* glyphs-msw.c (mswindows_redisplay_widget):
+	* glyphs-msw.c (mswindows_widget_instantiate):
+	* glyphs-msw.c (add_tree_item):
+	* glyphs-msw.c (add_tab_item):
+	* glyphs-msw.c (mswindows_combo_box_instantiate):
+	* glyphs-msw.c (mswindows_widget_query_string_geometry):
+	* glyphs-x.c (x_locate_pixmap_file):
+	* glyphs-x.c (xbm_instantiate_1):
+	* glyphs-x.c (x_xbm_instantiate):
+	* glyphs-x.c (extract_xpm_color_names):
+	* glyphs-x.c (x_xpm_instantiate):
+	* glyphs-x.c (x_xface_instantiate):
+	* glyphs-x.c (autodetect_instantiate):
+	* glyphs-x.c (safe_XLoadFont):
+	* glyphs-x.c (cursor_font_instantiate):
+	* glyphs-x.c (x_redisplay_widget):
+	* glyphs-x.c (Fchange_subwindow_property):
+	* glyphs-x.c (x_widget_instantiate):
+	* glyphs-x.c (x_tab_control_redisplay):
+	* glyphs.c (pixmap_to_lisp_data):
+	* gui-x.c (menu_separator_style_and_to_external):
+	* gui-x.c (add_accel_and_to_external):
+	* gui-x.c (button_item_to_widget_value):
+	* hpplay.c (player_error_internal):
+	* hpplay.c (play_sound_file):
+	* hpplay.c (play_sound_data):
+	* intl.c (Fset_current_locale):
+	* lisp.h:
+	* menubar-gtk.c (gtk_xemacs_set_accel_keys):
+	* menubar-msw.c (populate_menu_add_item):
+	* menubar-msw.c (populate_or_checksum_helper):
+	* menubar-x.c (menu_item_descriptor_to_widget_value_1):
+	* nt.c (init_user_info):
+	* nt.c (get_long_basename):
+	* nt.c (nt_get_resource):
+	* nt.c (init_mswindows_environment):
+	* nt.c (get_cached_volume_information):
+	* nt.c (mswindows_readdir):
+	* nt.c (read_unc_volume):
+	* nt.c (mswindows_stat):
+	* nt.c (mswindows_getdcwd):
+	* nt.c (mswindows_executable_type):
+	* nt.c (Fmswindows_short_file_name):
+	* ntplay.c (nt_play_sound_file):
+	* objects-gtk.c:
+	* objects-gtk.c (gtk_valid_color_name_p):
+	* objects-gtk.c (gtk_initialize_font_instance):
+	* objects-gtk.c (gtk_font_list):
+	* objects-msw.c (font_enum_callback_2):
+	* objects-msw.c (parse_font_spec):
+	* objects-x.c (x_parse_nearest_color):
+	* objects-x.c (x_valid_color_name_p):
+	* objects-x.c (x_initialize_font_instance):
+	* objects-x.c (x_font_instance_truename):
+	* objects-x.c (x_font_list):
+	* objects-xlike-inc.c (XFUN):
+	* objects-xlike-inc.c (xft_find_charset_font):
+	* process-nt.c (mswindows_report_winsock_error):
+	* process-nt.c (nt_create_process):
+	* process-nt.c (get_internet_address):
+	* process-nt.c (nt_open_network_stream):
+	* process-unix.c:
+	* process-unix.c (allocate_pty):
+	* process-unix.c (get_internet_address):
+	* process-unix.c (unix_canonicalize_host_name):
+	* process-unix.c (unix_open_network_stream):
+	* realpath.c:
+	* select-common.h (lisp_data_to_selection_data):
+	* select-gtk.c (symbol_to_gtk_atom):
+	* select-gtk.c (atom_to_symbol):
+	* select-msw.c (symbol_to_ms_cf):
+	* select-msw.c (mswindows_register_selection_data_type):
+	* select-x.c (symbol_to_x_atom):
+	* select-x.c (x_atom_to_symbol):
+	* select-x.c (hack_motif_clipboard_selection):
+	* select-x.c (Fx_store_cutbuffer_internal):
+	* sound.c (Fplay_sound_file):
+	* sound.c (Fplay_sound):
+	* sound.h (sound_perror):
+	* sysdep.c:
+	* sysdep.c (qxe_allocating_getcwd):
+	* sysdep.c (qxe_execve):
+	* sysdep.c (copy_in_passwd):
+	* sysdep.c (qxe_getpwnam):
+	* sysdep.c (qxe_ctime):
+	* sysdll.c (dll_open):
+	* sysdll.c (dll_function):
+	* sysdll.c (dll_variable):
+	* sysdll.c (search_linked_libs):
+	* sysdll.c (dll_error):
+	* sysfile.h:
+	* sysfile.h (PATHNAME_CONVERT_OUT_TSTR):
+	* sysfile.h (PATHNAME_CONVERT_OUT_UTF_8):
+	* sysfile.h (PATHNAME_CONVERT_OUT):
+	* sysfile.h (LISP_PATHNAME_CONVERT_OUT):
+	* syswindows.h (ITEXT_TO_TSTR):
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	* syswindows.h (TSTR_TO_LOCAL_FILE_FORMAT):
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN):
+	* syswindows.h (LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR):
+	* text.h:
+	* text.h (eicpy_ext_len):
+	* text.h (enum new_dfc_src_type):
+	* text.h (EXTERNAL_TO_ITEXT):
+	* text.h (GET_STRERROR):
+	* tooltalk.c (check_status):
+	* tooltalk.c (Fadd_tooltalk_message_arg):
+	* tooltalk.c (Fadd_tooltalk_pattern_attribute):
+	* tooltalk.c (Fadd_tooltalk_pattern_arg):
+	* win32.c (tstr_to_local_file_format):
+	* win32.c (mswindows_lisp_error_1):
+	* win32.c (mswindows_report_process_error):
+	* win32.c (Fmswindows_shell_execute):
+	* win32.c (mswindows_read_link_1):
+
+	Changes involving external/internal format conversion,
+	mostly code cleanup and renaming.
+
+	1. Eliminate the previous macros like LISP_STRING_TO_EXTERNAL
+	   that stored its result in a parameter.  The new version of
+	   LISP_STRING_TO_EXTERNAL returns its result through the
+	   return value, same as the previous NEW_LISP_STRING_TO_EXTERNAL.
+	   Use the new-style macros throughout the code.
+        2. Rename C_STRING_TO_EXTERNAL and friends to ITEXT_TO_EXTERNAL,
+	   in keeping with overall naming rationalization involving
+	   Itext and related types.
+
+	Macros involved in previous two:
+
+	EXTERNAL_TO_C_STRING -> EXTERNAL_TO_ITEXT
+	EXTERNAL_TO_C_STRING_MALLOC -> EXTERNAL_TO_ITEXT_MALLOC
+	SIZED_EXTERNAL_TO_C_STRING -> SIZED_EXTERNAL_TO_ITEXT
+	SIZED_EXTERNAL_TO_C_STRING_MALLOC -> SIZED_EXTERNAL_TO_ITEXT_MALLOC
+	C_STRING_TO_EXTERNAL -> ITEXT_TO_EXTERNAL
+	C_STRING_TO_EXTERNAL_MALLOC -> ITEXT_TO_EXTERNAL_MALLOC
+	LISP_STRING_TO_EXTERNAL
+	LISP_STRING_TO_EXTERNAL_MALLOC
+	LISP_STRING_TO_TSTR
+	C_STRING_TO_TSTR -> ITEXT_TO_TSTR
+	TSTR_TO_C_STRING -> TSTR_TO_ITEXT
+
+	The following four still return their values through parameters,
+	since they have more than one value to return:
+	
+	C_STRING_TO_SIZED_EXTERNAL -> ITEXT_TO_SIZED_EXTERNAL
+	LISP_STRING_TO_SIZED_EXTERNAL
+	C_STRING_TO_SIZED_EXTERNAL_MALLOC -> ITEXT_TO_SIZED_EXTERNAL_MALLOC
+	LISP_STRING_TO_SIZED_EXTERNAL_MALLOC
+
+	Sometimes additional casts had to be inserted, since the old
+	macros played strange games and completely defeated the type system
+	of the store params.
+	3. Rewrite many places where direct calls to TO_EXTERNAL_FORMAT
+	   occurred with calls to one of the convenience macros listed above,
+	   or to make_extstring().
+	4. Eliminate SIZED_C_STRING macros (they were hardly used, anyway)
+	   and use a direct call to TO_EXTERNAL_FORMAT or TO_INTERNAL_FORMAT.
+	4. Use LISP_PATHNAME_CONVERT_OUT in many places instead of something
+	   like LISP_STRING_TO_EXTERNAL(..., Qfile_name).
+	5. Eliminate some temporary variables that are no longer necessary
+	   now that we return a value rather than storing it into a variable.
+	6. Some Mule-izing in database.c.
+	7. Error functions:
+	   -- A bit of code cleanup in maybe_signal_error_1.
+	   -- Eliminate report_file_type_error; it's just an alias for
+	      signal_error_2 with params in a different order.
+	   -- Fix some places in the hostname-handling code that directly
+	      inserted externally-retrieved error strings into the
+	      supposed ASCII "reason" param instead of doing the right thing
+	      and sticking text descriptive of what was going on in "reason"
+	      and putting the external message in a frob.
+	8. Use Ascbyte instead of CIbyte in process-unix.c and maybe one
+	   or two other places.
+	9. Some code cleanup in copy_in_passwd() in sysdep.c.
+	10. Fix a real bug due to accidental variable shadowing in
+	    tstr_to_local_file_format() in win32.c.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	* lisp.h (staticpro_nodump_1):
+	Define staticpro_1 and staticpro_nodump_1 when not XEMACS_DEBUG.
+	
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_massage_multiword_predicate):
+	Cosmetic fixes.
+
+2010-02-05  Ben Wing  <ben@xemacs.org>
+
+	* bytecode.c (bytecode_assert):
+	Use 0 instead of x in disabled_assert calls to avoid errors due
+	to using undefined vars/params (they are defined only when
+	ERROR_CHECK_BYTE_CODE, which also turns on/off the asserts).
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c (release_breathing_space):
+	* alloc.c (resize_string):
+	* alloc.c (sweep_lcrecords_1):
+	* alloc.c (SWEEP_FIXED_TYPE_BLOCK_1):
+	* alloc.c (ADDITIONAL_FREE_compiled_function):
+	* alloc.c (compact_string_chars):
+	* alloc.c (ADDITIONAL_FREE_string):
+	* alloc.c (sweep_strings):
+	* alloca.c (xemacs_c_alloca):
+	* alsaplay.c (alsa_play_sound_file):
+	* buffer.c (init_initial_directory):
+	* buffer.h:
+	* buffer.h (BUFFER_FREE):
+	* console-stream.c (stream_delete_console):
+	* console-tty.c (free_tty_console_struct):
+	* data.c (Fnumber_to_string):
+	* device-gtk.c (gtk_init_device):
+	* device-gtk.c (free_gtk_device_struct):
+	* device-gtk.c (gtk_delete_device):
+	* device-msw.c (mswindows_delete_device):
+	* device-msw.c (msprinter_delete_device):
+	* device-tty.c (free_tty_device_struct):
+	* device-tty.c (tty_delete_device):
+	* device-x.c (x_init_device):
+	* device-x.c (free_x_device_struct):
+	* device-x.c (x_delete_device):
+	* dialog-msw.c (handle_directory_dialog_box):
+	* dialog-x.c (dbox_descriptor_to_widget_value):
+	* dired-msw.c (Fmswindows_insert_directory):
+	* dired.c (free_user_cache):
+	* dired.c (user_name_completion_unwind):
+	* doc.c (unparesseuxify_doc_string):
+	* doc.c (Fsubstitute_command_keys):
+	* doprnt.c (emacs_doprnt_1):
+	* dumper.c (pdump_load_finish):
+	* dumper.c (pdump_file_free):
+	* dumper.c (pdump_file_unmap):
+	* dynarr.c:
+	* dynarr.c (Dynarr_free):
+	* editfns.c (uncache_home_directory):
+	* editfns.c (Fset_time_zone_rule):
+	* elhash.c:
+	* elhash.c (pdump_reorganize_hash_table):
+	* elhash.c (maphash_unwind):
+	* emacs.c (make_arg_list_1):
+	* emacs.c (free_argc_argv):
+	* emacs.c (sort_args):
+	* emacs.c (Frunning_temacs_p):
+	* emodules.c (attempt_module_delete):
+	* eval.c (free_pointer):
+	* event-Xt.c (unselect_filedesc):
+	* event-Xt.c (emacs_Xt_select_process):
+	* event-gtk.c (unselect_filedesc):
+	* event-gtk.c (dragndrop_data_received):
+	* event-msw.c (winsock_closer):
+	* event-msw.c (mswindows_dde_callback):
+	* event-msw.c (mswindows_wnd_proc):
+	* event-stream.c (finalize_command_builder):
+	* event-stream.c (free_command_builder):
+	* extents.c (free_gap_array):
+	* extents.c (free_extent_list):
+	* extents.c (free_soe):
+	* extents.c (extent_fragment_delete):
+	* extents.c (extent_priority_sort_function):
+	* file-coding.c (make_coding_system_1):
+	* file-coding.c (coding_finalizer):
+	* file-coding.c (set_coding_stream_coding_system):
+	* file-coding.c (chain_finalize_coding_stream_1):
+	* file-coding.c (chain_finalize):
+	* file-coding.c (free_detection_state):
+	* file-coding.c (coding_category_symbol_to_id):
+	* fileio.c:
+	* fileio.c (Ffile_name_directory):
+	* fileio.c (if):
+	* fileio.c (Ffile_symlink_p):
+	* filelock.c (FREE_LOCK_INFO):
+	* filelock.c (current_lock_owner):
+	* font-mgr.c (Ffc_name_unparse):
+	* font-mgr.c (Ffc_pattern_duplicate):
+	* frame-gtk.c (gtk_delete_frame):
+	* frame-msw.c (mswindows_delete_frame):
+	* frame-msw.c (msprinter_delete_frame):
+	* frame-x.c (x_cde_destroy_callback):
+	* frame-x.c (Fcde_start_drag_internal):
+	* frame-x.c (x_cde_transfer_callback):
+	* frame-x.c (x_delete_frame):
+	* frame.c (update_frame_title):
+	* frame.c (Fset_frame_pointer):
+	* gc.c (register_for_finalization):
+	* gccache-gtk.c (free_gc_cache):
+	* gccache-gtk.c (gc_cache_lookup):
+	* gccache-x.c (free_gc_cache):
+	* gccache-x.c (gc_cache_lookup):
+	* glyphs-eimage.c:
+	* glyphs-eimage.c (jpeg_instantiate_unwind):
+	* glyphs-eimage.c (gif_instantiate_unwind):
+	* glyphs-eimage.c (png_instantiate_unwind):
+	* glyphs-eimage.c (png_instantiate):
+	* glyphs-eimage.c (tiff_instantiate_unwind):
+	* glyphs-gtk.c (convert_EImage_to_GDKImage):
+	* glyphs-gtk.c (gtk_finalize_image_instance):
+	* glyphs-gtk.c (gtk_init_image_instance_from_eimage):
+	* glyphs-gtk.c (gtk_xpm_instantiate):
+	* glyphs-msw.c (convert_EImage_to_DIBitmap):
+	* glyphs-msw.c (mswindows_init_image_instance_from_eimage):
+	* glyphs-msw.c (mswindows_initialize_image_instance_mask):
+	* glyphs-msw.c (xpm_to_eimage):
+	* glyphs-msw.c (mswindows_xpm_instantiate):
+	* glyphs-msw.c (xbm_create_bitmap_from_data):
+	* glyphs-msw.c (mswindows_finalize_image_instance):
+	* glyphs-x.c (convert_EImage_to_XImage):
+	* glyphs-x.c (x_finalize_image_instance):
+	* glyphs-x.c (x_init_image_instance_from_eimage):
+	* glyphs-x.c (x_xpm_instantiate):
+	* gui-x.c (free_popup_widget_value_tree):
+	* hash.c (free_hash_table):
+	* hash.c (grow_hash_table):
+	* hash.c (pregrow_hash_table_if_necessary):
+	* imgproc.c (build_EImage_quantable):
+	* insdel.c (uninit_buffer_text):
+	* intl-win32.c (convert_multibyte_to_internal_malloc):
+	* intl.c:
+	* intl.c (Fset_current_locale):
+	* keymap.c:
+	* keymap.c (where_is_recursive_mapper):
+	* keymap.c (where_is_internal):
+	* lisp.h:
+	* lisp.h (xfree):
+	* lstream.c (Lstream_close):
+	* lstream.c (resizing_buffer_closer):
+	* mule-coding.c:
+	* mule-coding.c (iso2022_finalize_detection_state):
+	* nt.c:
+	* nt.c (mswindows_get_long_filename):
+	* nt.c (nt_get_resource):
+	* nt.c (init_mswindows_environment):
+	* nt.c (get_cached_volume_information):
+	* nt.c (mswindows_opendir):
+	* nt.c (mswindows_closedir):
+	* nt.c (mswindows_readdir):
+	* nt.c (mswindows_stat):
+	* nt.c (mswindows_getdcwd):
+	* nt.c (Fmswindows_long_file_name):
+	* ntplay.c (nt_play_sound_file):
+	* ntplay.c (play_sound_data_1):
+	* number-gmp.c (gmp_free):
+	* number-gmp.c (init_number_gmp):
+	* number-mp.c (bignum_to_string):
+	* number-mp.c (BIGNUM_TO_TYPE):
+	* number.c (bignum_print):
+	* number.c (bignum_convfree):
+	* number.c (ratio_print):
+	* number.c (bigfloat_print):
+	* number.c (bigfloat_finalize):
+	* objects-gtk.c (gtk_finalize_color_instance):
+	* objects-gtk.c (gtk_finalize_font_instance):
+	* objects-msw.c (mswindows_finalize_color_instance):
+	* objects-msw.c (mswindows_finalize_font_instance):
+	* objects-tty.c (tty_finalize_color_instance):
+	* objects-tty.c (tty_finalize_font_instance):
+	* objects-tty.c (tty_font_list):
+	* objects-x.c (x_finalize_color_instance):
+	* objects-x.c (x_finalize_font_instance):
+	* process.c:
+	* process.c (finalize_process):
+	* realpath.c:
+	* redisplay.c (add_propagation_runes):
+	* regex.c:
+	* regex.c (xfree):
+	* regex.c (REGEX_FREE_STACK):
+	* regex.c (FREE_STACK_RETURN):
+	* regex.c (regex_compile):
+	* regex.c (regexec):
+	* regex.c (regfree):
+	* scrollbar-gtk.c (gtk_free_scrollbar_instance):
+	* scrollbar-gtk.c (gtk_release_scrollbar_instance):
+	* scrollbar-msw.c (mswindows_free_scrollbar_instance):
+	* scrollbar-msw.c (unshow_that_mofo):
+	* scrollbar-x.c (x_free_scrollbar_instance):
+	* scrollbar-x.c (x_release_scrollbar_instance):
+	* select-gtk.c (emacs_gtk_selection_handle):
+	* select-msw.c (mswindows_own_selection):
+	* select-x.c:
+	* select-x.c (x_handle_selection_request):
+	* select-x.c (unexpect_property_change):
+	* select-x.c (x_handle_property_notify):
+	* select-x.c (receive_incremental_selection):
+	* select-x.c (x_get_window_property_as_lisp_data):
+	* select-x.c (Fx_get_cutbuffer_internal):
+	* specifier.c (finalize_specifier):
+	* syntax.c (uninit_buffer_syntax_cache):
+	* sysdep.c (qxe_allocating_getcwd):
+	* sysdep.c (qxe_lstat):
+	* sysdep.c (copy_in_passwd):
+	* sysdep.c (qxe_ctime):
+	* sysdep.c (closedir):
+	* sysdep.c (DIRSIZ):
+	* termcap.c (tgetent):
+	* termcap.c (tprint):
+	* tests.c (Ftest_data_format_conversion):
+	* text.c (new_dfc_convert_copy_data):
+	* text.h (eifree):
+	* text.h (eito_alloca):
+	* text.h (eito_external):
+	* toolbar-msw.c (mswindows_output_toolbar):
+	* ui-gtk.c (CONVERT_RETVAL):
+	* ui-gtk.c (__allocate_object_storage):
+	* unicode.c (free_from_unicode_table):
+	* unicode.c (free_to_unicode_table):
+	* unicode.c (free_charset_unicode_tables):
+	* win32.c (mswindows_read_link_1):
+	Rename: xfree(VAL, TYPE)->xfree(VAL)
+
+	Command used:
+
+	gr 'xfree *\((.*),.*\);' 'xfree (\1);' *.[ch]
+
+	Followed by grepping for 'xfree.*,' and fixing anything left.
+
+	Rationale: Having to specify the TYPE argument is annoying and
+	error-prone.  It was originally put in to work around warnings
+	due to strict aliasing but years and years ago I rewrote it
+	in a way that doesn't use the TYPE argument at all and no one
+	has complained since then. (And anyway, XEmacs is far from
+	ever being in compliance with strict aliasing and would require
+	far-reaching changes to get that way.)
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* emacs.c (SHEBANG_EXE_PROGNAME_LENGTH):
+	* emacs.c (main_1):
+	Restore old definition of SHEBANG_EXE_PROGNAME_LENGTH; not possible
+	to ANSI-concatenate wide and narrow strings.
+	* print.c (write_msg_istring):
+	* print.c (write_msg_cistring):
+	* print.c (write_msg_ascstring):
+	Can't return a value in a void-declared function.
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* filelock.c:
+	* filelock.c (fill_in_lock_file_name):
+	Name the lock symlink file .#FN# instead of .#FN for file FN, so
+	that the link file doesn't have a .c or .el or whatever extension,
+	which confuses programs/functions that search by extension (e.g.
+	etags, byte-recompile-directory, etc.).
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
+	Put this back again:
+	
+	Make the various calls to staticpro() instead call staticpro_1(),
+	passing in the name of the C var being staticpro'ed, so that it
+	shows up in staticpro_names.  Otherwise staticpro_names just has
+	1000+ copies of the word `location'.
+
+2010-02-04  Ben Wing  <ben@xemacs.org>
+
+	* bytecode.c (assert_failed_with_remembered_ops):
+	* bytecode.c (init_opcode_table_multi_op):
+	Declare some things const to shut up G++ v4 warnings.
+	
+	* redisplay.c (add_ibyte_string_runes):
+	* redisplay.c (add_string_to_fstring_db_runes):
+	* redisplay.c (generate_fstring_runes):
+	* redisplay.c (window_line_number):
+	* redisplay.c (decode_mode_spec):
+	Use Ascbyte instead of char in various places.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* frame.c (Fmake_frame):
+	* glyphs.c:
+	* glyphs.c (NUM_PRECACHED_GLYPHS):
+	* glyphs.c (get_glyph_cachel_index):
+	* glyphs.c (FROB):
+	* glyphs.c (mark_glyph_cachels_as_not_updated):
+	* redisplay.c (regenerate_window):
+	* redisplay.c (redisplay_window):
+	When creating a frame, call reset_glyph_cachels on the minibuffer
+	window as well as the root window.  Fixes a crash due to other
+	glyphs (e.g. the gutter glyph) getting in the glyph cachel before
+	the pre-cached glyphs that are supposed to have fixed indices
+	(continuation-glyph, truncation-glyph, etc.).
+
+	Add a bunch of asserts to make sure that the glyph cachels always
+	properly contain the pre-cached glyphs.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* device-x.c (x_get_resource_prefix):
+	* device-x.c (Fx_get_resource):
+	* device-x.c (Fx_get_resource_prefix):
+	* device-x.c (Fx_put_resource):
+	* dialog-msw.c:
+	* dialog-msw.c (handle_question_dialog_box):
+	* dired-msw.c (mswindows_sort_files):
+	* dired-msw.c (mswindows_get_files):
+	* extents.c (extent_fragment_sort_by_priority):
+	* extents.c (Fset_extent_parent):
+	* file-coding.c (coding_reader):
+	* file-coding.c (coding_writer):
+	* file-coding.c (gzip_convert):
+	* frame.c (generate_title_string):
+	* gutter.c (calculate_gutter_size_from_display_lines):
+	* indent.c (vmotion_1):
+	* lread.c (read_bit_vector):
+	* mule-coding.c (iso2022_decode):
+	* rangetab.c:
+	* rangetab.c (Fcopy_range_table):
+	* rangetab.c (Fget_range_table):
+	* rangetab.c (unified_range_table_copy_data):
+	* redisplay-msw.c (mswindows_output_string):
+	* redisplay-output.c (output_display_line):
+	* redisplay-output.c (redisplay_move_cursor):
+	* redisplay-output.c (redisplay_clear_bottom_of_window):
+	* redisplay-tty.c (tty_output_ichar_dynarr):
+	* redisplay-tty.c (set_foreground_to):
+	* redisplay-tty.c (set_background_to):
+	* redisplay-xlike-inc.c (XLIKE_output_string):
+	* redisplay.c (redisplay_window_text_width_string):
+	* redisplay.c (redisplay_text_width_string):
+	* redisplay.c (create_text_block):
+	* redisplay.c (SET_CURRENT_MODE_CHARS_PIXSIZE):
+	* redisplay.c (generate_fstring_runes):
+	* redisplay.c (regenerate_modeline):
+	* redisplay.c (ensure_modeline_generated):
+	* redisplay.c (real_current_modeline_height):
+	* redisplay.c (create_string_text_block):
+	* redisplay.c (regenerate_window):
+	* redisplay.c (REGEN_INC_FIND_START_END):
+	* redisplay.c (point_visible):
+	* redisplay.c (redisplay_window):
+	* redisplay.c (mark_glyph_block_dynarr):
+	* redisplay.c (line_start_cache_start):
+	* redisplay.c (start_with_line_at_pixpos):
+	* redisplay.c (update_line_start_cache):
+	* redisplay.c (glyph_to_pixel_translation):
+	* redisplay.c (pixel_to_glyph_translation):
+	* sysdep.c (qxe_readdir):
+	* text.c (dfc_convert_to_external_format):
+	* text.c (dfc_convert_to_internal_format):
+	* toolbar-common.c (common_output_toolbar_button):
+	* window.c (window_modeline_height):
+	* window.c (Fwindow_last_line_visible_height):
+	* window.c (window_displayed_height):
+	* window.c (window_scroll):
+	* window.c (get_current_pixel_pos):
+	Use Dynarr_begin() in place of Dynarr_atp (foo, 0).
+
+	* dynarr.c (Dynarr_realloc):
+	* dynarr.c (Dynarr_lisp_realloc):
+	* dynarr.c (Dynarr_resize):
+	* dynarr.c (Dynarr_insert_many):
+	* dynarr.c (Dynarr_delete_many):
+	* dynarr.c (Dynarr_memory_usage):
+	* dynarr.c (stack_like_malloc):
+	* dynarr.c (stack_like_free):
+	* lisp.h:
+	* lisp.h (DECLARE_DYNARR_LISP_IMP):
+	* lisp.h (XD_DYNARR_DESC):
+	* lisp.h (Dynarr_pop):
+	* gutter.c (output_gutter):
+	* redisplay-output.c (sync_rune_structs):
+	* redisplay-output.c (redisplay_output_window):
+	Redo the dynarr code, add greater checks.
+
+	Rename the `len', `largest' and `max' members to `len_',
+	`largest_' and `max_' to try and catch existing places that might
+	directly modify these values.  Make new accessors Dynarr_largest()
+	and Dynarr_max() and make them and existing Dynarr_length() be
+	non-lvalues by adding '+ 0' to them; fix a couple of places in the
+	redisplay code that tried to modify the length directly by setting
+	Dynarr_length().  Use the accessors whenever possible even in the
+	dynarr code itself.  The accessors also verify that 0 <= len <=
+	largest <= max.  Rename settor function Dynarr_set_size() to
+	Dynarr_set_length() and use it more consistently; also create
+	lower-level Dynarr_set_length_1().  This latter function should be
+	the only function that directly modifies the `len_' member of a
+	Dynarr, and in the process makes sure that the `largest' value is
+	kept correct.
+
+	Consistently use ERROR_CHECK_STRUCTURES instead of
+	ERROR_CHECK_TYPES for error-checking code.  Reintroduce the
+	temporarily disabled verification code on the positions of
+	Dynarr_at(), Dynarr_atp() and Dynarr_atp_past_end().
+	Also create Dynarr_resize_if() in place of a repeated
+	code fragment.  Clean up all the functions that modify Dynarrs to
+	use the new macros and functions and verify the correctness of the
+	Dynarr both before and after the change.
+
+	Note that there are two kinds of verification -- one for accessing
+	and one for modifying.  The difference is that the modify
+	verification additionally checks to make sure that the Dynarr
+	isn't locked. (This is used in redisplay to check for problems
+	with reentrancy.)
+	
+	* lrecord.h: Move XD_DYNARR_DESC to lisp.h, grouping with the dynarr code.
+
+2010-02-03  Jerry James  <james@xemacs.org>
+
+	* s/mach-bsd4-3.h: Add historical copyright and license information,
+	unearthed by Ben Wing.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* bytecode.c:
+	Fix minor compile problem.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
+	Temporarily back out staticpro-related changes in symbols.c and
+	symeval.h to fix compile problems, will put back when `latest-fix'
+	workspace gets merged in.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c (Fmake_byte_code):
+	* lread.c:
+	* lread.c (readevalloop):
+	* lread.c (Fread):
+	* lread.c (Fread_from_string):
+	* lread.c (read_list_conser):
+	* lread.c (read_list):
+	* lread.c (vars_of_lread):
+	Remove the old kludgy stuff bracketed by `#ifdef
+	COMPILED_FUNCTION_ANNOTATION_HACK_OLD_WAY'.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c (Fmake_byte_code):
+	* bytecode.h:
+	* lisp.h:
+	* lread.c:
+	* lread.c (readevalloop):
+	* lread.c (Fread):
+	* lread.c (Fread_from_string):
+	* lread.c (read_list_conser):
+	* lread.c (read_list):
+	* lread.c (vars_of_lread):
+	* symbols.c:
+	* symbols.c (Fdefine_function):
+	Turn on the "compiled-function annotation hack".  Implement it
+	properly by hooking into Fdefalias().  Note in the docstring to
+	`defalias' that we do this.  Remove some old broken code and
+	change code that implemented the old kludgy way of hooking into
+	the Lisp reader into bracketed by `#ifdef
+	COMPILED_FUNCTION_ANNOTATION_HACK_OLD_WAY', which is not enabled.
+
+	Also enable byte-code metering when DEBUG_XEMACS -- this is a form
+	of profiling for computing histograms of which sequences of two
+	bytecodes are used most often.
+	
+	* bytecode-ops.h:
+	* bytecode-ops.h (OPCODE):
+	New file.  Extract out all the opcodes and declare them using
+	OPCODE(), a bit like frame slots and such.  This way the file can
+	be included multiple times if necessary to iterate multiple times
+	over the byte opcodes.
+	
+	* bytecode.c:
+	* bytecode.c (NUM_REMEMBERED_BYTE_OPS):
+	* bytecode.c (OPCODE):
+	* bytecode.c (assert_failed_with_remembered_ops):
+	* bytecode.c (READ_UINT_2):
+	* bytecode.c (READ_INT_1):
+	* bytecode.c (READ_INT_2):
+	* bytecode.c (PEEK_INT_1):
+	* bytecode.c (PEEK_INT_2):
+	* bytecode.c (JUMP_RELATIVE):
+	* bytecode.c (JUMP_NEXT):
+	* bytecode.c (PUSH):
+	* bytecode.c (POP_WITH_MULTIPLE_VALUES):
+	* bytecode.c (DISCARD):
+	* bytecode.c (UNUSED):
+	* bytecode.c (optimize_byte_code):
+	* bytecode.c (optimize_compiled_function):
+	* bytecode.c (Fbyte_code):
+	* bytecode.c (vars_of_bytecode):
+	* bytecode.c (init_opcode_table_multi_op):
+	* bytecode.c (reinit_vars_of_bytecode):
+	* emacs.c (main_1):
+	* eval.c (funcall_compiled_function):
+	* symsinit.h:
+	Any time we change either the instruction pointer or the stack
+	pointer, assert that we're going to move it to a valid location.
+	This should catch failures right when they occur rather than
+	sometime later.  This requires that we pass in another couple of
+	parameters into some functions (only with error-checking enabled,
+	see below).
+
+	Also keep track, using a circular queue, of the last 100 byte
+	opcodes seen, and when we hit an assert failure during byte-code
+	execution, output the contents of the queue in a nice readable
+	fashion.  This requires that bytecode-ops.h be included a second
+	time so that a table mapping opcodes to the name of their operation
+	can be constructed.  This table is constructed in new function
+	reinit_vars_of_bytecode().
+
+	Everything in the last two paras happens only when
+	ERROR_CHECK_BYTE_CODE.
+
+	Add some longish comments describing how the arrays that hold the
+	stack and instructions, and the pointers used to access them, work.
+	
+	* gc.c:
+	Import some code from my `latest-fix' workspace to mark the
+	staticpro's in order from lowest to highest, rather than highest to
+	lowest, so it's easier to debug when something goes wrong.
+	
+	* lisp.h (abort_with_message): Renamed from abort_with_msg().
+	
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symeval.h (DEFVAR_SYMVAL_FWD_OBJECT):
+	Make the various calls to staticpro() instead call staticpro_1(),
+	passing in the name of the C var being staticpro'ed, so that it
+	shows up in staticpro_names.  Otherwise staticpro_names just has
+	1000+ copies of the word `location'.
+
+2010-02-02  Ben Wing  <ben@xemacs.org>
+
+	* bytecode.c (execute_rare_opcode):
+	* lisp.h (abort_with_msg): New.
+	When aborting due to unknown opcode, output more descriptive msg.
+
+2010-02-01  Vin Shelton  <acs@xemacs.org>
+
+	* intl-encap-win32.c: Added description of override keyword.
+	Fix 2nd arg to CreateMDIWindowW.
+
+	* intl-auto-encap-win32.c:
+	* intl-auto-encap-win32.h: Fix 2nd arg to qxeCreateMDIWindow.
+
+2010-02-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fns.c (internal_equalp):
+	Use bytecode_arithcompare, which takes two args, instead of
+	passing a stack pointer to Feqlsign.
+	Use CANONCASE(), not DOWNCASE(), for case-insensitive character
+	comparison.
+	Correct a comment here.
+	* casefiddle.c (casify_object): New operation in this function,
+	CASE_CANONICALIZE.
+	(Fcanoncase): New function, used for case-insensitive comparison.
+	* lisp.h:
+	Make Fcanoncase, bytecode_arithcompare visible here.
+	* bytecode.c (bytecode_arithcompare):
+	Make this visible to other files.
+
+2010-02-03  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	* Makefile.in.in (x_objs):
+	* Makefile.in.in (gtk_gui_objs):
+	* console-xlike-inc.h:
+	* depend:
+	* device-x.c:
+	* emacs.c:
+	* gccache-gtk.h:
+	* gccache-gtk.h (gc_cache_lookup):
+	* gccache-x.c:
+	* gccache-x.c (GCCACHE_HASH):
+	* gccache-x.h:
+	* toolbar-gtk.c:
+	* toolbar-gtk.c (gtk_initialize_frame_toolbars):
+	* toolbar-x.c:
+	* toolbar-x.c (x_initialize_frame_toolbars):
+	* toolbar-xlike.c:
+	* toolbar-xlike.c (xlike_draw_blank_toolbar_button):
+	* toolbar-xlike.c (xlike_output_toolbar_button):
+	* toolbar-xlike.c (xlike_get_button_size):
+	* toolbar-xlike.c (XLIKE_OUTPUT_BUTTONS_LOOP):
+	* toolbar-xlike.c (xlike_output_toolbar):
+	* toolbar-xlike.c (xlike_clear_toolbar):
+	* toolbar-xlike.c (xlike_output_frame_toolbars):
+	* toolbar-xlike.c (xlike_clear_frame_toolbars):
+	* toolbar-xlike.c (xlike_redraw_exposed_toolbar):
+	* toolbar-xlike.c (xlike_redraw_exposed_toolbars):
+	* toolbar-xlike.c (xlike_redraw_frame_toolbars):
+	* toolbar-xlike.h:
+	* toolbar-xlike.h (xlike_clear_frame_toolbars):
+	Rename some files to make them consistent with general naming rules:
+	
+	xgccache.c -> gccache-x.c
+	xgccache.h -> gccache-x.h
+	toolbar-common.c -> toolbar-xlike.c
+	toolbar-common.h -> toolbar-xlike.h
+
+	Fix include-file references.  Also change the names of functions
+	in now-named toolbar-xlike.c to be xlike_foo() instead of common_foo().
+
+	Add a longish comment in console-xlike-inc.h describing the "xlike"
+	system, how it works and what the various files are used for.
+	
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	* compiler.h:
+	* config.h.in:
+	* console-x-impl.h:
+	* console-x-impl.h (struct x_frame):
+	* console-x-impl.h (FRAME_X_TOTALLY_VISIBLE_P):
+	* console-x.h:
+	* console-xlike-inc.h:
+	* emacs.c (main_1):
+	* faces.c (complex_vars_of_faces):
+	* font-mgr.h:
+	* frame-x.c (x_delete_frame):
+	* frame-x.c (x_update_frame_external_traits):
+	* glyphs-x.c (update_widget_face):
+	* inline.c:
+	* objects-x-impl.h:
+	* objects-x-impl.h (struct x_color_instance_data):
+	* objects-x-impl.h (struct x_font_instance_data):
+	* objects-x.c:
+	* objects-x.c (x_initialize_color_instance):
+	* objects-x.c (x_initialize_font_instance):
+	* objects-x.c (x_print_font_instance):
+	* objects-x.c (x_finalize_font_instance):
+	* objects-x.c (x_font_instance_truename):
+	* objects-x.c (vars_of_objects_x):
+	* objects-x.h:
+	USE_XFT* -> HAVE_XFT*.  But in objects-xlike-inc.c and
+	redisplay-xlike-inc.c, continue to use USE_XFT, and define
+	it appropriately in console-xlike-inc.h when both HAVE_XFT
+	and THIS_IS_X -- even if HAVE_XFT, we don't want to enable
+	XFT code when included in a *-gtk.c file.
+
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c (common_init_alloc_early):
+	Fix compiler breakage.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* objects-gtk-impl.h:
+	* objects-gtk-impl.h (XCOLOR_INSTANCE_GTK_COLOR):
+	* objects-gtk-impl.h (XFONT_INSTANCE_GTK_FONT):
+	* objects-x-impl.h (XCOLOR_INSTANCE_X_COLOR):
+	* objects-x-impl.h (XFONT_INSTANCE_X_FONT):
+	Define XCOLOR_INSTANCE_X_COLOR, XCOLOR_INSTANCE_GTK_COLOR,
+	XFONT_INSTANCE_X_FONT, XFONT_INSTANCE_GTK_FONT for convenience
+	purposes.  Fixes compile bug in redisplay-xlike-inc.c.
+
+2010-01-29  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	* objects.h (set_face_boolean_attached_to):
+	Use lisp.h for EXFUN of Fregexp_quote, that's what it's for.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* compiler.h:
+	Create a USED() macro to force unused-var warnings to go away,
+	in certain cases where it's inconvenient to do otherwise (e.g.
+	when THIS_IS_GTK in redisplay-xlike-inc.c).
+	
+	* console-x.h:
+	Remove unneeded decls, make some static.
+
+	* redisplay-xlike-inc.c:
+	* console-xlike-inc.h: New file.  Include defns from
+	redisplay-xlike-inc.c that may be useful in other XLIKE files.
+	Correct the handling of colors and font-style setting functions
+	in the xlike defns.  Lots of fixes in the GTK-specific defns.
+	
+	* depend: Regenerate.
+	
+	* event-xlike-inc.c:
+	* event-xlike-inc.c (USE_UNICODE_MAP):
+	* event-xlike-inc.c (endif):
+	* gccache-gtk.c:
+	* gtk-glue.c (xemacs_list_to_gtklist):
+	* gtk-glue.c (xemacs_gtklist_to_list):
+	* gtk-glue.c (FROB):
+	* gtk-glue.c (face_to_gc):
+	* gtk-glue.c (face_to_style):
+	* gtk-glue.c (gdk_event_to_emacs_event):
+	* gtk-xemacs.h (struct _GtkXEmacs):
+	* gtk-xemacs.h (struct _GtkXEmacsClass):
+	* objects-xlike-inc.c:
+	Cosmetic, comment fixes.
+	
+	* glyphs.c (pixmap_to_lisp_data):
+	Unused var fixes.
+	
+
+	* gtk-glue.c:
+	* gccache-gtk.c:
+	* gtk-xemacs.c:
+	* gtk-xemacs.h:
+	* objects-xlike-inc.c:
+	* ui-gtk.c:
+	* ui-gtk.h:
+	* xgccache.c:
+	* xgccache.c (GC_CACHE_SIZE):
+	* xgccache.h:
+	Misc include-file fixes.
+	
+	* objects-xlike-inc.c (XFUN):
+	* objects-xlike-inc.c (xlistfonts_checking_charset):
+	Combine some ifdeffed stuff using defs in console-xlike-inc.h.
+	
+	* redisplay-gtk.c:
+	* redisplay-gtk.c (THIS_IS_GTK):
+	* redisplay-gtk.c (XLIKE_bevel_area):
+	* redisplay-gtk.c (XLIKE_ring_bell):
+	* redisplay-gtk.c (gdk_draw_text_image):
+	Fix numerous compile problems.  Delete gtk_output_shadows(),
+	which mostly duplicates generic bevel_modeline().  Fix up
+	gtk_bevel_modeline() into XLIKE_bevel_area() and make use of
+	the style var properly to set the appropriate GTK constant.
+	
+	* redisplay-x.c:
+	* redisplay-x.c (XLIKE_window_output_begin):
+	* redisplay-x.c (XLIKE_window_output_end):
+	* redisplay-x.c (XLIKE_bevel_area):
+	* redisplay-x.c (x_output_shadows):
+	* redisplay-x.c (XLIKE_ring_bell):
+	Make x_output_shadows be static.  Change the defn of various
+	functions to look like XLIKE_foo() so it matches the calling
+	convention elsewhere.
+	
+	* redisplay-xlike-inc.c:
+	* redisplay-xlike-inc.c (NEED_GCCACHE_H):
+	* redisplay-xlike-inc.c (XLIKE_text_width):
+	* redisplay-xlike-inc.c (XLIKE_get_gc):
+	* redisplay-xlike-inc.c (XLIKE_text_width_single_run):
+	* redisplay-xlike-inc.c (XFT_FROB_LISP_COLOR):
+	* redisplay-xlike-inc.c (XLIKE_output_xlike_pixmap):
+	* redisplay-xlike-inc.c (XLIKE_output_pixmap):
+	* redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
+	* redisplay-xlike-inc.c (XLIKE_flash):
+	Lots of header fixes.  Lots of stuff moved to console-xlike-inc.h.
+	Use XFUN() to generate function names instead of directly
+	calling XLIKE_PASTE().  Remove unnecessary prototypes.
+	Unify calls to text_width funs.  Make XLIKE_get_gc non-static
+	since it's called from gtk.  Change the color-function calls
+	and fill-style-setting calls to match the changes in
+	console-xlike-inc.h.  Use USED() to avoid some warnings.
+	
+	* symsinit.h:
+	Sort the prototypes, and add a fun `sort-symsinit' in a comment
+	that does the sorting (using sort-regexp-fields).
+	
+	* symsinit.h (init_number):
+	
+	
+	* sysgtk.h: New file, wraps the various GTK headers.
+	* sysgdkx.h: New file, wraps <gtk/gdkx.h>.  Keep this separate to
+	* event-gtk.h: Delete.  Combine stuff into console-gtk.h.
+	help isolate X-specific code from GTK.
+
+	* device-gtk.c:
+	* event-gtk.c:
+	* console-gtk.h:
+	* frame-gtk.c:
+	* gccache-gtk.c:
+	* gccache-gtk.h:
+	* glyphs-gtk.c (gtk_colorize_image_instance):
+	* glyphs-gtk.h:
+	* gtk-xemacs.h:
+	* objects-gtk.c:
+	* objects-gtk.c (MAX_FONT_COUNT):
+	* ui-gtk.h:
+	Use sysgtk.h or sysgdkx.h instead of directly including GTK
+	headers.  Don't include event-gtk.h.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* abbrev.c (abbrev_match_mapper):
+	* buffer.h (CANON_TABLE_OF):
+	* buffer.h:
+	* editfns.c (Fchar_equal):
+	* minibuf.c (scmp_1):
+	* text.c (qxestrcasecmp_i18n):
+	* text.c (qxestrncasecmp_i18n):
+	* text.c (qxetextcasecmp):
+	* text.c (qxetextcasecmp_matching):
+	Create new macro CANONCASE that converts to a canonical mapping
+	and use it to do caseless comparisons instead of DOWNCASE.
+	
+	* alloc.c:
+	* alloc.c (cons_equal):
+	* alloc.c (vector_equal):
+	* alloc.c (string_equal):
+	* bytecode.c (compiled_function_equal):
+	* chartab.c (char_table_entry_equal):
+	* chartab.c (char_table_equal):
+	* data.c (weak_list_equal):
+	* data.c (weak_box_equal):
+	* data.c (ephemeron_equal):
+	* device-msw.c (equal_devmode):
+	* elhash.c (hash_table_equal):
+	* events.c (event_equal):
+	* extents.c (properties_equal):
+	* extents.c (extent_equal):
+	* faces.c:
+	* faces.c (face_equal):
+	* faces.c (face_hash):
+	* floatfns.c (float_equal):
+	* fns.c:
+	* fns.c (bit_vector_equal):
+	* fns.c (plists_differ):
+	* fns.c (Fplists_eq):
+	* fns.c (Fplists_equal):
+	* fns.c (Flax_plists_eq):
+	* fns.c (Flax_plists_equal):
+	* fns.c (internal_equal):
+	* fns.c (internal_equalp):
+	* fns.c (internal_equal_0):
+	* fns.c (syms_of_fns):
+	* glyphs.c (image_instance_equal):
+	* glyphs.c (glyph_equal):
+	* glyphs.c (glyph_hash):
+	* gui.c (gui_item_equal):
+	* lisp.h:
+	* lrecord.h (struct lrecord_implementation):
+	* marker.c (marker_equal):
+	* number.c (bignum_equal):
+	* number.c (ratio_equal):
+	* number.c (bigfloat_equal):
+	* objects.c (color_instance_equal):
+	* objects.c (font_instance_equal):
+	* opaque.c (equal_opaque):
+	* opaque.c (equal_opaque_ptr):
+	* rangetab.c (range_table_equal):
+	* specifier.c (specifier_equal):
+	Add a `foldcase' param to the equal() method and use it to implement
+	`equalp' comparisons.  Also add to plists_differ(), although we
+	don't currently use it here.
+
+	Rewrite internal_equalp().  Implement cross-type vector comparisons.
+	Don't implement our own handling of numeric promotion -- just use
+	the `=' primitive.
+
+	Add internal_equal_0(), which takes a `foldcase' param and calls
+	either internal_equal() or internal_equalp().
+	
+	* buffer.h:
+	When given a 0 for buffer (which is the norm when functions don't
+	have a specific buffer available), use the current buffer's table,
+	not `standard-case-table'; otherwise the current settings are
+	ignored.
+	
+	* casetab.c:
+	* casetab.c (set_case_table):
+	When handling old-style vectors of 256 in `set-case-table' don't
+	overwrite the existing table!  Instead create a new table and
+	populate.
+	
+	* device-msw.c (sync_printer_with_devmode):
+	* lisp.h:
+	* text.c (lisp_strcasecmp_ascii):
+	Rename lisp_strcasecmp to lisp_strcasecmp_ascii and use
+	lisp_strcasecmp_i18n for caseless comparisons in some places.
+	
+	* elhash.c:
+	Delete unused lisp_string_hash and lisp_string_equal().
+	
+	* events.h:
+	* keymap-buttons.h:
+	* keymap.h:
+	* keymap.c (keymap_lookup_directly):
+	* keymap.c (keymap_store):
+	* keymap.c (FROB):
+	* keymap.c (key_desc_list_to_event):
+	* keymap.c (describe_map_mapper):
+	* keymap.c (INCLUDE_BUTTON_ZERO):
+	New file keymap-buttons.h; use to handle buttons 1-26 in place of
+	duplicating code 26 times.
+	
+	* frame-gtk.c (allocate_gtk_frame_struct):
+	* frame-msw.c (mswindows_init_frame_1):
+	Fix some comments about internal_equal() in redisplay that don't
+	apply any more.
+	
+	* keymap-slots.h:
+	* keymap.c:
+	New file keymap-slots.h.  Use it to notate the slots in a keymap
+	structure, similar to frameslots.h or coding-system-slots.h.
+	
+	* keymap.c (MARKED_SLOT):
+	* keymap.c (keymap_equal):
+	* keymap.c (keymap_hash):
+	Implement.
+	
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* syntax.c:
+	* syntax.c (scan_lists):
+	* syntax.c (syms_of_syntax):
+	Declare `scan-error' as a type of `syntax-error'.  In `scan-lists'
+	et al., don't signal a syntax error but instead a `scan-error', and
+	pass a couple of integer arguments, for GNU compatibility.  Fixes
+	problems with typing double-quote in texinfo.el.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* symbols.c (Fspecial_operator_p, syms_of_symbols):
+	* eval.c (print_subr, Finteractive_p, Ffuncall)
+	(Ffunction_min_args, Ffunction_max_args, vars_of_eval):
+	* editfns.c:
+	* data.c (Fsubr_max_args):
+	* doc.c (Fbuilt_in_symbol_file):
+	Change "special form" to "special operator" in our sources.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* search.c (search_buffer): 
+	When checking the octets of c for identity, don't compare the
+	same octet with itself. Thank you Ben Wing!
+
+2010-01-30  Ben Wing  <ben@xemacs.org>
+
+	* intl-auto-encap-win32.c:
+	* intl-auto-encap-win32.c (qxeExtractAssociatedIcon):
+	* intl-auto-encap-win32.c (qxeExtractIconEx):
+	* intl-auto-encap-win32.c (qxeCreateMDIWindow):
+	* intl-auto-encap-win32.c (qxeCreateWindowStation):
+	* intl-auto-encap-win32.c (qxeDdeCreateStringHandle):
+	* intl-auto-encap-win32.c (qxeAbortSystemShutdown):
+	* intl-auto-encap-win32.c (qxeRegConnectRegistry):
+	* intl-auto-encap-win32.c (qxeGetICMProfile):
+	* intl-auto-encap-win32.h:
+	Rebuild.
+	
+	* intl-encap-win32.c:
+	* intl-encap-win32.c (qxeUpdateICMRegKey):
+	Delete manual definitions of functions with former errors in
+	Cygwin headers but no longer.  Use "override" with some functions
+	where Cygwin or VS6 accidentally omits a const declaration or
+	includes an extra one.  Use "no" on SendMessageTimeout, which
+	has an error in the VS6 prototype (you could manually fix this
+	with an ifdef to split the Cygwin vs. VS6 calls, if we ever
+	actually used this function).
+
+2010-01-30  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* search.c (search_buffer):
+	Don't use Boyer-Moore for case-insensitive search if the search
+	pattern contains repeated Ibytes and the corresponding character
+	has case information (or, equivalently, if one of its case
+	equivalents would contain repeated Ibytes).
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Move #'mapcar*, #'mapcan, #'mapc, #'map, #'mapl, #'mapcon to C;
+	extend #'mapvector, #'mapconcat, #'mapcar to support more
+	SEQUENCES; have them all error with circular lists.
+
+	* fns.c (Fsubseq): Call CHECK_SEQUENCE here; Flength can return
+	from the debugger if it errors with a non-sequence, leading to a
+	crash in Fsubseq if sequence really is *not* a sequence.
+	(mapcarX): Rename mapcar1 to mapcarX; rework it comprehensively to
+	take an optional lisp output argument, and a varying number of
+	sequences.
+	Special-case a single list argument, as we used to, saving its
+	elements in the stack space for the results before calling
+	FUNCTION, so FUNCTION can corrupt the list all it
+	wants. dead_wrong_type_argument() in the other cases if we
+	encounter a non-cons where we expected a cons.
+	(Fmapconcat):
+	Accept further SEQUENCES after separator here. Special-case
+	the idiom (mapconcat 'identity SEQUENCE), don't even funcall.
+	(FmapcarX): Rename this from Fmapcar. Accept optional SEQUENCES.
+	(Fmapvector): Accept optional SEQUENCES.
+	(Fmapcan, Fmapc, Fmap): Move these here from cl-extra.el.
+	(Fmap_into): New function, as specified by Common Lisp.
+	(maplist): New function, the guts of the implementation of
+	Fmaplist and Fmapl. 
+	(Fmaplist, Fmapl, Fmapcon): Move these from cl-extra.el.
+	(syms_of_fns):
+	Add a few needed symbols here, for the type tests
+	used by #'map. Add the new subrs, with aliases for #'mapc-internal
+	and #'mapcar.
+
+	* general-slots.h: Declare Qcoerce here, now it's used in both
+	indent.c and fns.c
+	* indent.c (syms_of_indent): Qcoerce is gone from here.
+
+	* lisp.h: Add ARRAYP(), SEQUENCEP(), and the corresponding CHECK_*
+	macros. Declare Fbit_vector, Fstring, FmapcarX, now other files
+	need to use them.
+	* data.c (Farrayp, Fsequencep): Use ARRAYP and SEQUENCEP, just
+	added to lisp.h
+
+	* buffer.c (Fbuffer_list): Now Fmapcar has been renamed FmapcarX
+	and takes MANY arguments, update this function to reflect that.
+
+2010-01-28  Jerry James  <james@xemacs.org>
+
+	* Makefile.in.in: Remove internationalization rules, since the
+	lib-src programs they invoke are now gone.
+
+2010-01-29  Ben Wing  <ben@xemacs.org>
+
+	* search.c (boyer_moore): Fix longstanding bug involving
+	searching for Control-1 chars; code was trying to directly
+	extract the last byte in the textual representation of a char
+	from an Ichar (and doing it in a buggy fashion) rather than 
+	just converting the Ichar to text and looking at the last byte.
+
+2010-01-28  Ben Wing  <ben@xemacs.org>
+
+	* syswindows.h:
+	Add typedefs for PCVOID and PDWORD_PTR for non-Cygwin-headers folks
+	(i.e. Visual Studio et al.).
+
+2010-01-27  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* number.c (Fdenominator): 
+	Oops, change #else to #endif here; thank you Vin Shelton, thank
+	you Robert Delius Royar.
+
+2010-01-28  Ben Wing  <ben@xemacs.org>
+
+	* device-x.c (x_init_device):
+	* emodules.c (emodules_load):
+	* emodules.c (emodules_doc_subr):
+	* emodules.c (emodules_doc_sym):
+	* emodules.h:
+	Make the externally-called functions emodules_doc_sym() and
+	emodules_doc_subr() take Ascbyte * pointers since they're usually
+	passed string constants and we can't guarantee the encoding if
+	it's not ASCII.  Fix pointer type in calls to dll_variable(), etc.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* lread.c (vars_of_lread):
+	Turn on load-ignore-out-of-date-elc-files by default.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* event-unixoid.c (read_event_from_tty_or_stream_desc):
+	Don't try to write one byte into a four-byte variable, leaving
+	the rest undefined.  This is a recipe for crashing.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* .gdbinit.in.in:
+	* README:
+	* abbrev.c (write_abbrev):
+	* abbrev.c (describe_abbrev):
+	* alloc.c (make_extstring):
+	* alloc.c (build_istring):
+	* alloc.c (build_cistring):
+	* alloc.c (build_ascstring):
+	* alloc.c (build_extstring):
+	* alloc.c (build_msg_istring):
+	* alloc.c (build_defer_istring):
+	* buffer.c (Fgenerate_new_buffer_name):
+	* buffer.c (init_buffer_2):
+	* console-tty.c (tty_init_console):
+	* console-x.c (get_display_arg_connection):
+	* console-x.c (x_perhaps_init_unseen_key_defaults):
+	* database.c (dbm_map):
+	* database.c (dbm_get):
+	* database.c (berkdb_get):
+	* database.c (berkdb_map):
+	* device-gtk.c (FROB_PIXMAP):
+	* device-gtk.c (Fgtk_style_info):
+	* device-msw.c (msprinter_default_printer):
+	* device-msw.c (sync_printer_with_devmode):
+	* device-x.c (coding_system_of_xrm_database):
+	* device-x.c (x_init_device):
+	* device-x.c (signal_if_x_error):
+	* device-x.c (Fx_get_resource):
+	* device-x.c (Fx_server_vendor):
+	* device-x.c (Fx_get_font_path):
+	* dialog-x.c (maybe_run_dbox_text_callback):
+	* doc.c (extract_object_file_name):
+	* doc.c (unparesseuxify_doc_string):
+	* doc.c (get_doc_string):
+	* doc.c (get_object_file_name):
+	* doc.c (Fdocumentation):
+	* doc.c (Fsnarf_documentation):
+	* doc.c (Fsubstitute_command_keys):
+	* editfns.c (init_editfns):
+	* editfns.c (Ftemp_directory):
+	* editfns.c (Fuser_login_name):
+	* editfns.c (Fuser_real_login_name):
+	* editfns.c (Fuser_home_directory):
+	* editfns.c (Fformat_time_string):
+	* editfns.c (Fcurrent_time_string):
+	* editfns.c (Fcurrent_time_zone):
+	* emacs.c:
+	* emacs.c (main_1):
+	* emodules.c (Flist_modules):
+	* emodules.c (emodules_load):
+	* emodules.c (emodules_doc_sym):
+	* emodules.c (vars_of_module):
+	* event-Xt.c (x_has_keysym):
+	* event-gtk.c (emacs_gtk_format_magic_event):
+	* event-gtk.c (dragndrop_data_received):
+	* event-gtk.c (gtk_reset_key_mapping):
+	* event-msw.c (mswindows_dde_callback):
+	* event-msw.c (mswindows_wnd_proc):
+	* faces.c (complex_vars_of_faces):
+	* file-coding.c (find_coding_system):
+	* file-coding.c (setup_eol_coding_systems):
+	* file-coding.c (make_coding_system_1):
+	* file-coding.c (snarf_coding_system):
+	* fileio.c:
+	* fileio.c (lisp_strerror):
+	* fileio.c (Ffile_name_directory):
+	* fileio.c (Ffile_name_as_directory):
+	* fileio.c (Fdirectory_file_name):
+	* fileio.c (if):
+	* fileio.c (Ffile_symlink_p):
+	* fileio.c (Fencrypt_string):
+	* fileio.c (Fdecrypt_string):
+	* filelock.c (lock_file):
+	* filelock.c (Ffile_locked_p):
+	* floatfns.c (matherr):
+	* font-mgr.c (build_fcapi_string):
+	* font-mgr.c (make_xlfd_font_regexp):
+	* frame-msw.c (mswindows_window_id):
+	* frame-msw.c (mswindows_frame_property):
+	* frame-x.c:
+	* frame-x.c (color_to_string):
+	* frame-x.c (maybe_set_frame_title_format):
+	* frame-x.c (x_cde_transfer_callback):
+	* frame-x.c (Fx_window_id):
+	* glade.c (connector):
+	* glade.c (Fglade_xml_textdomain):
+	* glade.c (syms_of_glade):
+	* glyphs-eimage.c (jpeg_instantiate):
+	* glyphs-eimage.c (png_instantiate):
+	* glyphs-eimage.c (tiff_instantiate):
+	* glyphs-gtk.c (font_instantiate):
+	* glyphs-gtk.c (BUILD_GLYPH_INST):
+	* glyphs-x.c (x_locate_pixmap_file):
+	* glyphs-x.c (font_instantiate):
+	* glyphs-x.c (x_widget_property):
+	* glyphs-x.c (BUILD_GLYPH_INST):
+	* glyphs.c (print_image_instance):
+	* glyphs.c (bitmap_to_lisp_data):
+	* glyphs.c (pixmap_to_lisp_data):
+	* gpmevent.c (turn_off_gpm):
+	* gpmevent.c (Fgpm_enabled_p):
+	* gpmevent.c (Fgpm_enable):
+	* gtk-glue.c (__make_string_mapper):
+	* gtk-glue.c (xemacs_gtklist_to_list):
+	* gtk-xemacs.c (FROB_FACE):
+	* gtk-xemacs.c (xemacs_gtk_convert_color):
+	* hpplay.c (player_error_internal):
+	* hpplay.c (myHandler):
+	* insdel.c (buffer_insert_ascstring_1):
+	* insdel.h:
+	* insdel.h (buffer_insert_ascstring):
+	* intl.c (Fcurrent_locale):
+	* intl.c (Fset_current_locale):
+	* keymap.c (make_key_description):
+	* keymap.c (Ftext_char_description):
+	* keymap.c (describe_command):
+	* keymap.c (describe_map):
+	* lisp.h:
+	* lread.c:
+	* lread.c (locate_file_in_directory_mapper):
+	* lread.c (locate_file_construct_suffixed_files_mapper):
+	* mule-charset.c (Fmake_charset):
+	* nt.c (Fmswindows_short_file_name):
+	* nt.c (Fmswindows_long_file_name):
+	* objects-gtk.c (__get_gtk_font_truename):
+	* objects-gtk.c (__gtk_font_list_internal):
+	* objects-msw.c (font_enum_callback_2):
+	* objects-msw.c (create_hfont_from_font_spec):
+	* objects-msw.c (mswindows_font_list):
+	* objects-msw.c (mswindows_font_spec_matches_charset_stage_2):
+	* objects-tty.c (tty_initialize_font_instance):
+	* objects-x.c (x_font_truename):
+	* objects-x.c (x_font_instance_truename):
+	* objects-x.c (x_font_instance_properties):
+	* objects-x.c (x_font_list):
+	* print.c (write_cistring):
+	* print.c (print_vector_internal):
+	* print.c (print_cons):
+	* process-nt.c (nt_canonicalize_host_name):
+	* process-unix.c (unix_create_process):
+	* process-unix.c (unix_canonicalize_host_name):
+	* process.c (status_message):
+	* process.c (status_notify):
+	* process.c (init_xemacs_process):
+	* process.c (syms_of_process):
+	* redisplay-tty.c (term_get_fkeys_1):
+	* redisplay-tty.c (CONDITIONAL_REASSIGN):
+	* search.c (compile_pattern_1):
+	* select-common.h (selection_data_to_lisp_data):
+	* select-gtk.c (atom_to_symbol):
+	* select-gtk.c (PROCESSING_GTK_CODE):
+	* select-msw.c (mswindows_get_foreign_selection):
+	* select-x.c (x_atom_to_symbol):
+	* select-x.c (Fx_get_cutbuffer_internal):
+	* symbols.c (intern_istring):
+	* symbols.c (intern):
+	* symbols.c (intern_converting_underscores_to_dashes):
+	* symbols.c (Fintern):
+	* sysdep.c (init_system_name):
+	* sysdll.c (dll_error):
+	* sysdll.c (dll_open):
+	* syswindows.h:
+	* syswindows.h (build_tstr_string):
+	* tests.c (DFC_CHECK_LENGTH):
+	* tests.c (DFC_CHECK_CONTENT):
+	* tests.c (DFC_RESULT_PASS):
+	* tests.c (Ftest_data_format_conversion):
+	* text.c:
+	* text.c (new_dfc_convert_now_damn_it):
+	* text.h:
+	* text.h (build_wext_string):
+	* tooltalk.c (tt_build_c_string):
+	* tooltalk.c (Ftooltalk_default_procid):
+	* tooltalk.c (Ftooltalk_default_session):
+	* tooltalk.c (init_tooltalk):
+	* ui-byhand.c (Fgtk_clist_get_text):
+	* ui-byhand.c (Fgtk_clist_get_pixtext):
+	* ui-byhand.c (Fgtk_label_get):
+	* ui-byhand.c (Fgtk_notebook_query_tab_label_packing):
+	* ui-gtk.c (emacs_gtk_object_printer):
+	* ui-gtk.c (emacs_gtk_boxed_printer):
+	* ui-gtk.c (gtk_type_to_lisp):
+	* ui-gtk.c (symbol_to_enum):
+	* ui-gtk.c (enum_to_symbol):
+	* unexaix.c (report_error):
+	* unexaix.c (ERROR0):
+	* unexec.c (report_error):
+	* unexec.c (ERROR0):
+	* unicode.c (unicode_to_ichar):
+	* win32.c (tstr_to_local_file_format):
+	* win32.c (Fmswindows_cygwin_to_win32_path):
+	* win32.c (struct read_link_hash):
+	* xemacs.def.in.in:
+
+	Rename:
+
+	write_c_string -> write_cistring
+	build_intstring -> build_istring
+	build_string -> build_cistring
+	build_ext_string -> build_extstring
+	make_ext_string -> make_extstring
+	buffer_insert_c_string -> buffer_insert_ascstring
+	intern_int -> intern_istring
+
+	These functions have been renamed so that the naming harmonizes
+	with the typedefs for strings: `cistring' along with CIbyte *,
+	`istring' along with Ibyte *, `extstring' along with Extbyte *,
+	`ascstring' along with Ascbyte *.
+
+	Also make buffer_insert_ascstring take Ascbyte * and assert
+	that its argument is ASCII.
+
+2010-01-26  Ben Wing  <ben@xemacs.org>
+
+	* alloc.c:
+	* alloc.c (build_ascstring):
+	* alloc.c (build_msg_cistring):
+	* alloc.c (staticpro_1):
+	* alloc.c (staticpro_name):
+	* alloc.c (staticpro_nodump_1):
+	* alloc.c (staticpro_nodump_name):
+	* alloc.c (unstaticpro_nodump_1):
+	* alloc.c (mcpro_1):
+	* alloc.c (mcpro_name):
+	* alloc.c (object_memory_usage_stats):
+	* alloc.c (common_init_alloc_early):
+	* alloc.c (init_alloc_once_early):
+	* buffer.c (print_buffer):
+	* buffer.c (vars_of_buffer):
+	* buffer.c (common_init_complex_vars_of_buffer):
+	* buffer.c (init_initial_directory):
+	* bytecode.c (invalid_byte_code):
+	* bytecode.c (print_compiled_function):
+	* bytecode.c (mark_compiled_function):
+	* chartab.c (print_table_entry):
+	* chartab.c (print_char_table):
+	* config.h.in:
+	* console-gtk.c:
+	* console-gtk.c (gtk_device_to_console_connection):
+	* console-gtk.c (gtk_semi_canonicalize_console_connection):
+	* console-gtk.c (gtk_canonicalize_console_connection):
+	* console-gtk.c (gtk_semi_canonicalize_device_connection):
+	* console-gtk.c (gtk_canonicalize_device_connection):
+	* console-stream.c (stream_init_frame_1):
+	* console-stream.c (vars_of_console_stream):
+	* console-stream.c (init_console_stream):
+	* console-x.c (x_semi_canonicalize_console_connection):
+	* console-x.c (x_semi_canonicalize_device_connection):
+	* console-x.c (x_canonicalize_device_connection):
+	* console-x.h:
+	* data.c (eq_with_ebola_notice):
+	* data.c (Fsubr_interactive):
+	* data.c (Fnumber_to_string):
+	* data.c (digit_to_number):
+	* device-gtk.c (gtk_init_device):
+	* device-msw.c (print_devmode):
+	* device-x.c (x_event_name):
+	* dialog-msw.c (handle_directory_dialog_box):
+	* dialog-msw.c (handle_file_dialog_box):
+	* dialog-msw.c (vars_of_dialog_mswindows):
+	* doc.c (weird_doc):
+	* doc.c (Fsnarf_documentation):
+	* doc.c (vars_of_doc):
+	* dumper.c (pdump):
+	* dynarr.c:
+	* dynarr.c (Dynarr_realloc):
+	* editfns.c (Fuser_real_login_name):
+	* editfns.c (get_home_directory):
+	* elhash.c (print_hash_table_data):
+	* elhash.c (print_hash_table):
+	* emacs.c (main_1):
+	* emacs.c (vars_of_emacs):
+	* emodules.c:
+	* emodules.c (_emodules_list):
+	* emodules.c (Fload_module):
+	* emodules.c (Funload_module):
+	* emodules.c (Flist_modules):
+	* emodules.c (find_make_module):
+	* emodules.c (attempt_module_delete):
+	* emodules.c (emodules_load):
+	* emodules.c (emodules_doc_subr):
+	* emodules.c (emodules_doc_sym):
+	* emodules.c (syms_of_module):
+	* emodules.c (vars_of_module):
+	* emodules.h:
+	* eval.c (print_subr):
+	* eval.c (signal_call_debugger):
+	* eval.c (build_error_data):
+	* eval.c (signal_error):
+	* eval.c (maybe_signal_error):
+	* eval.c (signal_continuable_error):
+	* eval.c (maybe_signal_continuable_error):
+	* eval.c (signal_error_2):
+	* eval.c (maybe_signal_error_2):
+	* eval.c (signal_continuable_error_2):
+	* eval.c (maybe_signal_continuable_error_2):
+	* eval.c (signal_ferror):
+	* eval.c (maybe_signal_ferror):
+	* eval.c (signal_continuable_ferror):
+	* eval.c (maybe_signal_continuable_ferror):
+	* eval.c (signal_ferror_with_frob):
+	* eval.c (maybe_signal_ferror_with_frob):
+	* eval.c (signal_continuable_ferror_with_frob):
+	* eval.c (maybe_signal_continuable_ferror_with_frob):
+	* eval.c (syntax_error):
+	* eval.c (syntax_error_2):
+	* eval.c (maybe_syntax_error):
+	* eval.c (sferror):
+	* eval.c (sferror_2):
+	* eval.c (maybe_sferror):
+	* eval.c (invalid_argument):
+	* eval.c (invalid_argument_2):
+	* eval.c (maybe_invalid_argument):
+	* eval.c (invalid_constant):
+	* eval.c (invalid_constant_2):
+	* eval.c (maybe_invalid_constant):
+	* eval.c (invalid_operation):
+	* eval.c (invalid_operation_2):
+	* eval.c (maybe_invalid_operation):
+	* eval.c (invalid_change):
+	* eval.c (invalid_change_2):
+	* eval.c (maybe_invalid_change):
+	* eval.c (invalid_state):
+	* eval.c (invalid_state_2):
+	* eval.c (maybe_invalid_state):
+	* eval.c (wtaerror):
+	* eval.c (stack_overflow):
+	* eval.c (out_of_memory):
+	* eval.c (print_multiple_value):
+	* eval.c (issue_call_trapping_problems_warning):
+	* eval.c (backtrace_specials):
+	* eval.c (backtrace_unevalled_args):
+	* eval.c (Fbacktrace):
+	* eval.c (warn_when_safe):
+	* event-Xt.c (modwarn):
+	* event-Xt.c (modbarf):
+	* event-Xt.c (check_modifier):
+	* event-Xt.c (store_modifier):
+	* event-Xt.c (emacs_Xt_format_magic_event):
+	* event-Xt.c (describe_event):
+	* event-gtk.c (dragndrop_data_received):
+	* event-gtk.c (store_modifier):
+	* event-gtk.c (gtk_reset_modifier_mapping):
+	* event-msw.c (dde_eval_string):
+	* event-msw.c (Fdde_alloc_advise_item):
+	* event-msw.c (mswindows_dde_callback):
+	* event-msw.c (FROB):
+	* event-msw.c (emacs_mswindows_format_magic_event):
+	* event-stream.c (external_debugging_print_event):
+	* event-stream.c (execute_help_form):
+	* event-stream.c (vars_of_event_stream):
+	* events.c (print_event_1):
+	* events.c (print_event):
+	* events.c (event_equal):
+	* extents.c (print_extent_1):
+	* extents.c (print_extent):
+	* extents.c (vars_of_extents):
+	* faces.c (print_face):
+	* faces.c (complex_vars_of_faces):
+	* file-coding.c:
+	* file-coding.c (print_coding_system):
+	* file-coding.c (print_coding_system_in_print_method):
+	* file-coding.c (default_query_method):
+	* file-coding.c (find_coding_system):
+	* file-coding.c (make_coding_system_1):
+	* file-coding.c (chain_print):
+	* file-coding.c (undecided_print):
+	* file-coding.c (gzip_print):
+	* file-coding.c (vars_of_file_coding):
+	* file-coding.c (complex_vars_of_file_coding):
+	* fileio.c:
+	* fileio.c (report_file_type_error):
+	* fileio.c (report_error_with_errno):
+	* fileio.c (report_file_error):
+	* fileio.c (barf_or_query_if_file_exists):
+	* fileio.c (vars_of_fileio):
+	* floatfns.c (matherr):
+	* fns.c (print_bit_vector):
+	* fns.c (Fmapconcat):
+	* fns.c (add_suffix_to_symbol):
+	* fns.c (add_prefix_to_symbol):
+	* frame-gtk.c:
+	* frame-gtk.c (Fgtk_window_id):
+	* frame-x.c (def):
+	* frame-x.c (x_cde_transfer_callback):
+	* frame.c:
+	* frame.c (Fmake_frame):
+	* gc.c (show_gc_cursor_and_message):
+	* gc.c (vars_of_gc):
+	* glyphs-eimage.c (png_instantiate):
+	* glyphs-eimage.c (tiff_instantiate):
+	* glyphs-gtk.c (gtk_print_image_instance):
+	* glyphs-msw.c (mswindows_print_image_instance):
+	* glyphs-x.c (x_print_image_instance):
+	* glyphs-x.c (update_widget_face):
+	* glyphs.c (make_string_from_file):
+	* glyphs.c (print_image_instance):
+	* glyphs.c (signal_image_error):
+	* glyphs.c (signal_image_error_2):
+	* glyphs.c (signal_double_image_error):
+	* glyphs.c (signal_double_image_error_2):
+	* glyphs.c (xbm_mask_file_munging):
+	* glyphs.c (pixmap_to_lisp_data):
+	* glyphs.h:
+	* gui.c (gui_item_display_flush_left):
+	* hpplay.c (player_error_internal):
+	* hpplay.c (myHandler):
+	* intl-win32.c:
+	* intl-win32.c (langcode_to_lang):
+	* intl-win32.c (sublangcode_to_lang):
+	* intl-win32.c (Fmswindows_get_locale_info):
+	* intl-win32.c (lcid_to_locale_mule_or_no):
+	* intl-win32.c (mswindows_multibyte_to_unicode_print):
+	* intl-win32.c (complex_vars_of_intl_win32):
+	* keymap.c:
+	* keymap.c (print_keymap):
+	* keymap.c (ensure_meta_prefix_char_keymapp):
+	* keymap.c (Fkey_description):
+	* keymap.c (Ftext_char_description):
+	* lisp.h:
+	* lisp.h (struct):
+	* lisp.h (DECLARE_INLINE_HEADER):
+	* lread.c (Fload_internal):
+	* lread.c (locate_file):
+	* lread.c (read_escape):
+	* lread.c (read_raw_string):
+	* lread.c (read1):
+	* lread.c (read_list):
+	* lread.c (read_compiled_function):
+	* lread.c (init_lread):
+	* lrecord.h:
+	* marker.c (print_marker):
+	* marker.c (marker_equal):
+	* menubar-msw.c (displayable_menu_item):
+	* menubar-x.c (command_builder_operate_menu_accelerator):
+	* menubar.c (vars_of_menubar):
+	* minibuf.c (reinit_complex_vars_of_minibuf):
+	* minibuf.c (complex_vars_of_minibuf):
+	* mule-charset.c (Fmake_charset):
+	* mule-charset.c (complex_vars_of_mule_charset):
+	* mule-coding.c (iso2022_print):
+	* mule-coding.c (fixed_width_query):
+	* number.c (bignum_print):
+	* number.c (ratio_print):
+	* number.c (bigfloat_print):
+	* number.c (bigfloat_finalize):
+	* objects-msw.c:
+	* objects-msw.c (mswindows_color_to_string):
+	* objects-msw.c (mswindows_color_list):
+	* objects-tty.c:
+	* objects-tty.c (tty_font_list):
+	* objects-tty.c (tty_find_charset_font):
+	* objects-xlike-inc.c (xft_find_charset_font):
+	* objects-xlike-inc.c (endif):
+	* print.c:
+	* print.c (write_istring):
+	* print.c (write_ascstring):
+	* print.c (Fterpri):
+	* print.c (Fprint):
+	* print.c (print_error_message):
+	* print.c (print_vector_internal):
+	* print.c (print_cons):
+	* print.c (print_string):
+	* print.c (printing_unreadable_object):
+	* print.c (print_internal):
+	* print.c (print_float):
+	* print.c (print_symbol):
+	* process-nt.c (mswindows_report_winsock_error):
+	* process-nt.c (nt_canonicalize_host_name):
+	* process-unix.c (unix_canonicalize_host_name):
+	* process.c (print_process):
+	* process.c (report_process_error):
+	* process.c (report_network_error):
+	* process.c (make_process_internal):
+	* process.c (Fstart_process_internal):
+	* process.c (status_message):
+	* process.c (putenv_internal):
+	* process.c (vars_of_process):
+	* process.h:
+	* profile.c (vars_of_profile):
+	* rangetab.c (print_range_table):
+	* realpath.c (vars_of_realpath):
+	* redisplay.c (vars_of_redisplay):
+	* search.c (wordify):
+	* search.c (Freplace_match):
+	* sheap.c (sheap_adjust_h):
+	* sound.c (report_sound_error):
+	* sound.c (Fplay_sound_file):
+	* specifier.c (print_specifier):
+	* symbols.c (Fsubr_name):
+	* symbols.c (do_symval_forwarding):
+	* symbols.c (set_default_buffer_slot_variable):
+	* symbols.c (set_default_console_slot_variable):
+	* symbols.c (store_symval_forwarding):
+	* symbols.c (default_value):
+	* symbols.c (defsymbol_massage_name_1):
+	* symbols.c (defsymbol_massage_name_nodump):
+	* symbols.c (defsymbol_massage_name):
+	* symbols.c (defsymbol_massage_multiword_predicate_nodump):
+	* symbols.c (defsymbol_massage_multiword_predicate):
+	* symbols.c (defsymbol_nodump):
+	* symbols.c (defsymbol):
+	* symbols.c (defkeyword):
+	* symbols.c (defkeyword_massage_name):
+	* symbols.c (check_module_subr):
+	* symbols.c (deferror_1):
+	* symbols.c (deferror):
+	* symbols.c (deferror_massage_name):
+	* symbols.c (deferror_massage_name_and_message):
+	* symbols.c (defvar_magic):
+	* symeval.h:
+	* symeval.h (DEFVAR_SYMVAL_FWD):
+	* sysdep.c:
+	* sysdep.c (init_system_name):
+	* sysdll.c:
+	* sysdll.c (MAYBE_PREPEND_UNDERSCORE):
+	* sysdll.c (dll_function):
+	* sysdll.c (dll_variable):
+	* sysdll.c (dll_error):
+	* sysdll.c (dll_open):
+	* sysdll.c (dll_close):
+	* sysdll.c (image_for_address):
+	* sysdll.c (my_find_image):
+	* sysdll.c (search_linked_libs):
+	* sysdll.h:
+	* sysfile.h:
+	* sysfile.h (DEFAULT_DIRECTORY_FALLBACK):
+	* syswindows.h:
+	* tests.c (DFC_CHECK_LENGTH):
+	* tests.c (DFC_CHECK_CONTENT):
+	* tests.c (Ftest_hash_tables):
+	* text.c (vars_of_text):
+	* text.h:
+	* tooltalk.c (tt_opnum_string):
+	* tooltalk.c (tt_message_arg_ival_string):
+	* tooltalk.c (Ftooltalk_default_procid):
+	* tooltalk.c (Ftooltalk_default_session):
+	* tooltalk.c (init_tooltalk):
+	* tooltalk.c (vars_of_tooltalk):
+	* ui-gtk.c (Fdll_load):
+	* ui-gtk.c (type_to_marshaller_type):
+	* ui-gtk.c (Fgtk_import_function_internal):
+	* ui-gtk.c (emacs_gtk_object_printer):
+	* ui-gtk.c (emacs_gtk_boxed_printer):
+	* unicode.c (unicode_to_ichar):
+	* unicode.c (unicode_print):
+	* unicode.c (unicode_query):
+	* unicode.c (vars_of_unicode):
+	* unicode.c (complex_vars_of_unicode):
+	* win32.c:
+	* win32.c (mswindows_report_process_error):
+	* window.c (print_window):
+	* xemacs.def.in.in:
+
+	BASIC IDEA: Further fixing up uses of char * and CIbyte *
+	to reflect their actual semantics; Mule-izing some code;
+	redoing of the not-yet-working code to handle message translation.
+	
+	Clean up code to handle message-translation (not yet working).
+	Create separate versions of build_msg_string() for working with
+	Ibyte *, CIbyte *, and Ascbyte * arguments.  Assert that Ascbyte *
+	arguments are pure-ASCII.  Make build_msg_string() be the same
+	as build_msg_ascstring().  Create same three versions of GETTEXT()
+	and DEFER_GETTEXT().  Also create build_defer_string() and
+	variants for the equivalent of DEFER_GETTEXT() when building a
+	string.  Remove old CGETTEXT().  Clean up code where GETTEXT(),
+	DEFER_GETTEXT(), build_msg_string(), etc. was being called and
+	introduce some new calls to build_msg_string(), etc.  Remove
+	GETTEXT() from calls to weird_doc() -- we assume that the
+	message snarfer knows about weird_doc().  Remove uses of
+	DEFER_GETTEXT() from error messages in sysdep.c and instead use
+	special comments /* @@@begin-snarf@@@ */ and /* @@@end-snarf@@@ */
+	that the message snarfer presumably knows about.
+	
+	Create build_ascstring() and use it in many instances in place
+	of build_string().  The purpose of having Ascbyte * variants is
+	to make the code more self-documenting in terms of what sort of
+	semantics is expected for char * strings.  In fact in the process
+	of looking for uses of build_string(), much improperly Mule-ized
+	was discovered.
+
+	Mule-ize a lot of code as described in previous paragraph,
+	e.g. in sysdep.c.
+
+	Make the error functions take Ascbyte * strings and fix up a
+	couple of places where non-pure-ASCII strings were being passed in
+	(file-coding.c, mule-coding.c, unicode.c). (It's debatable whether
+	we really need to make the error functions work this way.  It
+	helps catch places where code is written in a way that message
+	translation won't work, but we may well never implement message
+	translation.)
+
+	Make staticpro() and friends take Ascbyte * strings instead of
+	raw char * strings.  Create a const_Ascbyte_ptr dynarr type
+	to describe what's held by staticpro_names[] and friends,
+	create pdump descriptions for const_Ascbyte_ptr dynarrs, and
+	use them in place of specially-crafted staticpro descriptions.
+
+	Mule-ize certain other functions (e.g. x_event_name) by correcting
+	raw use of char * to Ascbyte *, Rawbyte * or another such type,
+	and raw use of char[] buffers to another type (usually Ascbyte[]).
+
+	Change many uses of write_c_string() to write_msg_string(),
+	write_ascstring(), etc.
+
+	Mule-ize emodules.c, emodules.h, sysdll.h.
+
+	Fix some un-Mule-ized code in intl-win32.c.
+	
+	A comment in event-Xt.c and the limitations of the message
+	snarfer (make-msgfile or whatever) is presumably incorrect --
+	it should be smart enough to handle function calls spread over
+	more than one line.  Clean up code in event-Xt.c that was
+	written awkwardly for this reason.
+
+	In config.h.in, instead of NEED_ERROR_CHECK_TYPES_INLINES,
+	create a more general XEMACS_DEFS_NEEDS_INLINE_DECLS to
+	indicate when inlined functions need to be declared in
+	xemacs.defs.in.in, and make use of it in xemacs.defs.in.in.
+	We need to do this because postgresql.c now calls qxestrdup(),
+	which is an inline function.
+
+	Make nconc2() and other such functions MODULE_API and put
+	them in xemacs.defs.in.in since postgresql.c now uses them.
+
+	Clean up indentation in lread.c and a few other places.
+	
+	In text.h, document ASSERT_ASCTEXT_ASCII() and
+	ASSERT_ASCTEXT_ASCII_LEN(), group together the stand-in
+	encodings and add some more for DLL symbols, function and
+	variable names, etc.
+	
+2010-01-26  Ben Wing  <ben@xemacs.org>
+
+	* .gdbinit.in.in: Allow an argument to check-xemacs and check-temacs
+	to check a specific file.
+
+2010-01-24  Ben Wing  <ben@xemacs.org>
+
+	* chartab.c (decode_char_table_range):
+	* extents.c (extent_fragment_update):
+	* objects-msw.c (initialize_font_instance):
+	* process.c (Fgetenv):
+	* redisplay-output.c (get_next_display_block):
+	Fix warnings about possible use of uninitialized vars.
+	
+	* compiler.h:
+	* compiler.h (REGISTER):
+	* event-stream.c (is_scrollbar_event):
+	* window.c (window_scrollbar_width):
+	* window.c (window_scrollbar_height):
+	* window.c (window_left_window_gutter_width):
+	* window.c (window_right_window_gutter_width):
+	Add USED_IF_SCROLLBARS.  Use it to fix warnings about unused
+	vars when --with-scrollbars=no.
+
+	* config.h.in:
+	Change comment to explain better why DECLARE_INLINE_HEADER
+	is needed.
+
+	* dialog-msw.c:
+	* emacs.c (SHEBANG_EXE_PROGNAME_LENGTH):
+	* emacs.c (main_1):
+	* event-msw.c (struct mswin_message_debug):
+	* event-msw.c (debug_output_mswin_message):
+	* font-mgr.c:
+	* font-mgr.c (Ffc_config_filename):
+	* glyphs-msw.c (struct):
+	* glyphs-msw.c (bitmap_table):
+	* glyphs-x.c (update_widget_face):
+	* intl-win32.c (struct lang_to_string):
+	* intl-win32.c (lang_to_string_table):
+	* nas.c:
+	* objects-xlike-inc.c:
+	* objects-xlike-inc.c (xft_find_charset_font):
+	* syswindows.h:
+	* win32.c (mswindows_output_last_error):
+	Fix g++ 4.3 complaints about implicit conversions of string
+	literals (const char *) to char *.
+
+	* lisp.h:
+	G++ 4.3 needs #include <limits> to avoid errors about min/max.
+	
+	* lisp.h (disabled_assert_with_message):
+	Use disabled_assert* whenever asserts are disabled.  Rewrite
+	disabled_assert* to avoid complaints about unused vars by
+	pretending to use the vars but casting them to (void).
+	Remove code that defined assert() weirdly if DEBUG_XEMACS but
+	not USE_ASSERTIONS -- configure sets USE_ASSERTIONS automatically
+	when DEBUG_XEMACS, and if the user has forced it off, then
+	so be it.
+	
+	* lisp.h (SYMBOL_KEYWORD):
+	Put some of the combined `extern Lisp_Object's back under
+	the file they are declared in.  Cosmetic fix.
+	
+	* number.h:
+	Remove `extern Lisp_Object' decls that duplicate lisp.h,
+	since they have different C vs. C++ linkage.
+	
+2010-01-21  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	Oops.  Use two hashes for comments in Makefile.in.in.
+
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* symbols.c:
+	Add long comment about the types of magic symbols, and the various
+	declarations that go along with them.
+
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* .gdbinit.in.in:
+	Moved here from etc/.gdbinit.in.
+	Put @srcdir@ in various places rather than just `..' whenever
+	Makefile.in.in does so.  Fixes various strange crashes and errors
+	than occur when using `..'.
+	* Makefile.in.in (config-changed):
+	Add target, useful when building both Unicode-internal and
+	old-Mule workspaces using --srcdir and don't run configure before
+	switching from one to the other.
+
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* lrecord.h:
+	* lrecord.h (enum lrecord_type):
+	* lrecord.h (struct lrecord_implementation):
+	Clean up description of finalizer methods.  Clean up and expand
+	the long comment at the top of lrecord.h.  Add a section about why
+	New-GC requires a bunch of new internal objects to be created (not
+	completely understood).
+
+2010-01-20  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	Disable error-checking code in Dynarr_at and related lookup
+	functions.  It leads to a crash in the glyph-cachels code under
+	Cygwin 1.7 and GCC 3.4.4.  I assume this is a compiler bug since
+	the code in question doesn't (or shouldn't) modify anything.
+	Changing the code from inline to non-inline didn't help.
+
+2010-01-19  Ben Wing  <ben@xemacs.org>
+
+	* console-impl.h (struct console_methods):
+	* console-stream.c (stream_text_width):
+	* redisplay-msw.c (mswindows_output_string):
+	* redisplay-msw.c (mswindows_text_width):
+	* redisplay-tty.c (tty_text_width):
+	* redisplay-xlike-inc.c (XLIKE_text_width):
+	* redisplay-xlike-inc.c (XLIKE_output_string):
+	* redisplay.c:
+	* redisplay.c (redisplay_window_text_width_ichar_string):
+	* redisplay.c (redisplay_text_width_string):
+	Change the text_width method to take a window instead of a frame.
+	Needed for Unicode-internal.
+
+2010-01-18  Ben Wing  <ben@xemacs.org>
+
+	* redisplay-gtk.c:
+	* redisplay-gtk.c (gtk_bevel_area):
+	* redisplay-x.c:
+	* redisplay-x.c (THIS_IS_X):
+	* redisplay-xlike-inc.c:
+	* redisplay-xlike-inc.c (XLIKE_text_width_single_run):
+	* redisplay-xlike-inc.c (XLIKE_text_width):
+	* redisplay-xlike-inc.c (XLIKE_output_display_block):
+	* redisplay-xlike-inc.c (XLIKE_get_gc):
+	* redisplay-xlike-inc.c (XLIKE_output_string):
+	* redisplay-xlike-inc.c (XLIKE_OUTPUT_XLIKE_PIXMAP):
+	* redisplay-xlike-inc.c (XLIKE_output_pixmap):
+	* redisplay-xlike-inc.c (XLIKE_output_vertical_divider):
+	* redisplay-xlike-inc.c (XLIKE_output_blank):
+	* redisplay-xlike-inc.c (XLIKE_output_horizontal_line):
+	* redisplay-xlike-inc.c (XLIKE_clear_region):
+	* redisplay-xlike-inc.c (XLIKE_output_eol_cursor):
+	* redisplay-xlike-inc.c (XLIKE_clear_frame_window):
+	* redisplay-xlike-inc.c (XLIKE_clear_frame):
+	* redisplay-xlike-inc.c (XLIKE_flash):
+	* redisplay-xlike-inc.c (console_type_create_redisplay_XLIKE):
+	Move lots more code into redisplay-xlike-inc.c.  Use macros to
+	isolate the code that differs among X vs. GTK, to reduce the need
+	for ifdefs in the middle of the code.  Now, redisplay-x.c and
+	redisplay-gtk.c only contain a few functions whose implementation
+	is completely different from one to the other, or which are not
+	present at all in one of them.
+
+	GTK code not currently tested, but it has bitrotted somewhat
+	any.  Doing this will help keep it less bitrotty.
+
+	* depend: Regenerate.
+
+2010-01-18  Ben Wing  <ben@xemacs.org>
+
+	* redisplay-xlike-inc.c:
+	* redisplay-xlike-inc.c (separate_textual_runs_nomule):
+	* redisplay-xlike-inc.c (separate_textual_runs_xft_nomule):
+	* redisplay-xlike-inc.c (separate_textual_runs_xft_mule):
+	* redisplay-xlike-inc.c (separate_textual_runs_mule):
+	Break separate_textual_runs_* functions from redisplay-x.c.
+	(Code in redisplay-gtk.c should have been identical but was
+	bit-rotted.)
+	
+	* redisplay-gtk.c:
+	* redisplay-x.c:
+	Delete code, replace with include statement.
+
+	* depend: Regenerate.
+
+2010-01-18  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	* print.c:
+	New variable `in_debug_print'.
+	
+	* alloc.c:
+	* alloc.c (free_managed_lcrecord):
+	If gc_in_progress and in_debug_print, just return instead of
+	crashing. This only happens when the programmer calls debug_print()
+	or a variation inside of a debugger, and is probably already
+	diagnosing a crash.
+	
+	* print.c (struct debug_bindings):
+	* print.c (debug_prin1_exit):
+	* print.c (debug_prin1):
+	At entrance, record the old value of in_debug_print in the
+	debug_bindings, set up an unwind-protect to restore the old value,
+	and set in_debug_print to 1.  In the unwind-protect, restore the
+	old value.
+	
+
+2010-01-16  Ben Wing  <ben@xemacs.org>
+
+	* win32.c (mswindows_read_link_1):
+	Conditionalize COM support on HAVE_MS_WINDOWS because otherwise we
+	haven't linked with the appropriate libraries.
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* doprnt.c (emacs_doprnt_1):
+	Cosmetic: Use Qunbound, not Qnil as second arg to call to
+	syntax_error() to get cleaner error message.
+	
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* intl-encap-win32.c:
+	Add `review' lines for all functions seen in the headers that we
+	process but not yet associated with an encapsulation command.
+	These will cause an error to be signaled if these functions are
+	used.
+	* intl-auto-encap-win32.c:
+	* intl-auto-encap-win32.h:
+	Regenerate.
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* intl-auto-encap-win32.c:
+	* intl-auto-encap-win32.c (qxeExtractAssociatedIcon):
+	* intl-auto-encap-win32.c (qxeShellExecuteEx):
+	* intl-auto-encap-win32.c (qxeSHFileOperation):
+	* intl-auto-encap-win32.c (qxeSHQueryRecycleBin):
+	* intl-auto-encap-win32.c (qxeSHEmptyRecycleBin):
+	* intl-auto-encap-win32.c (qxeWNetAddConnection):
+	* intl-auto-encap-win32.c (qxeWNetAddConnection2):
+	* intl-auto-encap-win32.c (qxeWNetAddConnection3):
+	* intl-auto-encap-win32.c (qxeWNetCancelConnection):
+	* intl-auto-encap-win32.c (qxeWNetCancelConnection2):
+	* intl-auto-encap-win32.c (qxeWNetGetConnection):
+	* intl-auto-encap-win32.c (qxeWNetUseConnection):
+	* intl-auto-encap-win32.c (qxeWNetConnectionDialog1):
+	* intl-auto-encap-win32.c (qxeWNetDisconnectDialog1):
+	* intl-auto-encap-win32.c (qxeWNetOpenEnum):
+	* intl-auto-encap-win32.c (qxeWNetEnumResource):
+	* intl-auto-encap-win32.c (qxeWNetGetUniversalName):
+	* intl-auto-encap-win32.c (qxeWNetGetUser):
+	* intl-auto-encap-win32.c (qxeWNetGetProviderName):
+	* intl-auto-encap-win32.c (qxeWNetGetNetworkInformation):
+	* intl-auto-encap-win32.c (qxeWNetGetLastError):
+	* intl-auto-encap-win32.c (qxeMultinetGetConnectionPerformance):
+	* intl-auto-encap-win32.c (qxeAppendMenu):
+	* intl-auto-encap-win32.c (qxeCopyAcceleratorTable):
+	* intl-auto-encap-win32.c (qxeDlgDirSelectComboBoxEx):
+	* intl-auto-encap-win32.c (qxeEnumDesktops):
+	* intl-auto-encap-win32.c (qxeEnumWindowStations):
+	* intl-auto-encap-win32.c (qxeGetClassInfo):
+	* intl-auto-encap-win32.c (qxeGetClassLong):
+	* intl-auto-encap-win32.c (qxeGetClassName):
+	* intl-auto-encap-win32.c (qxeGetKeyboardLayoutName):
+	* intl-auto-encap-win32.c (qxeGetWindowLong):
+	* intl-auto-encap-win32.c (qxeGetUserObjectInformation):
+	* intl-auto-encap-win32.c (qxeGetWindowTextLength):
+	* intl-auto-encap-win32.c (qxeGrayString):
+	* intl-auto-encap-win32.c (qxeInsertMenu):
+	* intl-auto-encap-win32.c (qxeSetProp):
+	* intl-auto-encap-win32.c (qxeEnumICMProfiles):
+	* intl-auto-encap-win32.c (qxeExtTextOut):
+	* intl-auto-encap-win32.c (qxeSetICMProfile):
+	* intl-auto-encap-win32.c (qxeTextOut):
+	* intl-auto-encap-win32.c (qxeSHGetPathFromIDList):
+	* intl-auto-encap-win32.c (qxeFindText):
+	* intl-auto-encap-win32.c (qxeReplaceText):
+	* intl-auto-encap-win32.c (qxeImmInstallIME):
+	* intl-auto-encap-win32.c (qxeImmGetDescription):
+	* intl-auto-encap-win32.c (qxeImmGetIMEFileName):
+	* intl-auto-encap-win32.c (qxeImmGetCompositionString):
+	* intl-auto-encap-win32.c (qxeImmGetCandidateListCount):
+	* intl-auto-encap-win32.c (qxeImmGetCandidateList):
+	* intl-auto-encap-win32.c (qxeImmGetGuideLine):
+	* intl-auto-encap-win32.c (qxeImmConfigureIME):
+	* intl-auto-encap-win32.c (qxeImmEscape):
+	* intl-auto-encap-win32.c (qxeImmGetConversionList):
+	* intl-auto-encap-win32.c (qxeImmRegisterWord):
+	* intl-auto-encap-win32.c (qxeImmUnregisterWord):
+	* intl-auto-encap-win32.c (qxeImmEnumRegisterWord):
+	* intl-auto-encap-win32.c (qxesndPlaySound):
+	* intl-auto-encap-win32.c (qxePlaySound):
+	* intl-auto-encap-win32.c (qxewaveOutGetErrorText):
+	* intl-auto-encap-win32.c (qxewaveInGetErrorText):
+	* intl-auto-encap-win32.c (qxemidiOutGetErrorText):
+	* intl-auto-encap-win32.c (qxemidiInGetErrorText):
+	* intl-auto-encap-win32.c (qxemmioStringToFOURCC):
+	* intl-auto-encap-win32.c (qxemmioInstallIOProc):
+	* intl-auto-encap-win32.c (qxemmioOpen):
+	* intl-auto-encap-win32.c (qxemmioRename):
+	* intl-auto-encap-win32.c (qxemciSendCommand):
+	* intl-auto-encap-win32.c (qxemciSendString):
+	* intl-auto-encap-win32.c (qxemciGetDeviceID):
+	* intl-auto-encap-win32.c (qxemciGetErrorString):
+	* intl-auto-encap-win32.h:
+	* intl-auto-encap-win32.h (qxemciGetErrorString):
+	Regenerate these files from Cygwin headers.
+	
+	* intl-encap-win32.c:
+	Bracket more functions in HAVE_MS_WINDOWS, to fix build problems
+	when building --with-msw=no on Cygwin.
+
+	Fixes for Cygwin headers:
+	-- Comment out IME.H, non-existent in Cygwin.
+	-- Make MessageBoxIndirect a `no' (don't encapsulate but generate
+	   error if used) because it has a structure parameter that needs
+	   to be A/W split but is declared as FOO*, and our parser can't
+	   split this.
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* Makefile.in.in:
+	Build xemacs-export.o whenever we're on any Windows OS (WIN32_ANY)
+	instead of only when we build support for the GUI portion of
+	MS-Windows (HAVE_MS_WINDOWS).
+
+	Cosmetic: Use WIN32_ANY in place of equivalent
+	(WIN32_NATIVE or CYGWIN).
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* emacs.c:
+	* emacs.c (debug_can_access_memory):
+	When checking for bad memory, we need to read all bytes from memory;
+	try even harder to avoid the possibility that a super-optimizing
+	compiler will optimize away the memory reads.
+
+2010-01-15  Ben Wing  <ben@xemacs.org>
+
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN):
+	* syswindows.h (INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT):
+	Declare some temporary pointer variables const to avoid compile
+	errors under C++ and/or Visual Studio 6.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* casetab.c: Typo in comment.
+
+2010-01-24  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* number.c (Fnumerator, Fdenominator, Fcanonicalize_number):
+	Be more careful to return integers in their canonical forms here,
+	and to give the same answer all the time when treating a rational
+	that is itself is an integer as a ratio.
+
+2010-01-24  Aidan Kehoe  <kehoea@parhasard.net>
+
+	Fix problems with #'eql, extended number types, and the hash table
+	implementation; change the Bintegerp bytecode to fixnump semantics
+	even on bignum builds, since #'integerp can have a fast
+	implementation in terms of #'fixnump for most of its extant uses,
+	but not vice-versa.
+
+	* lisp.h: Always #include number.h; we want the macros provided in
+	it, even if the various number types are not available.
+	* number.h (NON_FIXNUM_NUMBER_P): New macro, giving 1 when its
+	argument is of non-immediate number type.  Equivalent to FLOATP if
+	WITH_NUMBER_TYPES is not defined.
+
+	* elhash.c (lisp_object_eql_equal, lisp_object_eql_hash):
+	Use NON_FIXNUM_NUMBER_P in these functions, instead of FLOATP,
+	giving more correct behaviour in the presence of the extended
+	number types.
+	* bytecode.c (Bfixnump, execute_optimized_program):
+	Rename Bintegerp to Bfixnump; change its semantics to reflect the
+	new name on builds with bignum support.
+
+	* data.c (Ffixnump, Fintegerp, syms_of_data, vars_of_data): 
+	Always make #'fixnump available, even on non-BIGNUM builds;
+	always implement #'integerp in this file, even on BIGNUM builds.
+	Move most-positive-fixnum, most-negative-fixnum here from
+	number.c, so they are Lisp constants even on builds without number
+	types, and attempts to change or bind them error.
+	Use the NUMBERP and INTEGERP macros even on builds without
+	extended number types.
+	* data.c (fixnum_char_or_marker_to_int):
+	Rename this function from integer_char_or_marker_to_int, to better
+	reflect the arguments it accepts.
+
+	* number.c (Fevenp, Foddp, syms_of_number):
+	Never provide #'integerp in this file. Remove #'oddp,
+	#'evenp; their implementations are overridden by those in cl.el.
+	* number.c (vars_of_number):
+	most-positive-fixnum, most-negative-fixnum are no longer here.
+
+2010-01-17  Vin Shelton  <acs@xemacs.org>
+
+	* fileio.c (check_writable): Remove cast from 2010-01-14
+
+	* syswindows.h: Use consts in macros where appropriate in lieu of
+	cast in check_writable().  Patch from Ben Wing.
+
+2010-01-16  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* config.h.in:
+	* floatfns.c (emacs_rint):
+	Don't look for rint in configure, always use our own
+	implementation that rounds to the even number in the case of
+	ambiguity, for consistency with the bignum code.
+
+2010-01-14  Vin Shelton  <acs@xemacs.org>
+
+	* fileio.c (check_writable): Fix compilation error under Visual
+	Studio 6.
+
+	* sysfile.h: 
+	Add conditional definition for EOVERFLOW, which isn't defined
+	under Visual Studio 6.
+
+2010-01-14  Didier Verna  <didier@xemacs.org>
+
+	* faces.c (complex_vars_of_faces): change X11 bgcolor fallback of
+	default face to match that of gui element face.
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* buffer.h:
+	* compiler.h:
+	Don't use USED_IF_MULE_OR_CHECK_TEXT in buffer.h.  Eliminate since
+	not used anywhere any more.
+	
+	* font-mgr.c (fontset_to_list):
+	* font-mgr.c (Ffc_config_substitute):
+	Don't use Fsignal() as it may return.  Use signal_error() instead
+	or a more specific function such as invalid_state() or wtaerror().
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* syswindows.h: Don't define CYGWIN_HEADERS here.
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* s/cygwin32.h:
+	* s/mingw32.h:
+	Define here instead so it's available in all files.  Fixes
+	compile problems in database.c in some cases.
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* glyphs-eimage.c:
+	Turn on fixes for conflicts between jmorecfg.h and windows.h on
+	Cygwin, too.
+	
+	* emacs.c (debug_can_access_memory):
+	* lisp.h:
+	Declare function const void * to avoid warnings.
+	
+	* sysfile.h:
+	Include syswindows.h on Windows to avoid problems using things like
+	PATHNAME_CONVERT_OUT.
+	
+	* sysfile.h (X_OK):
+	* dialog-msw.c (handle_directory_proc):
+	* dialog-msw.c (handle_directory_dialog_box):
+	* nt.c (Fmswindows_short_file_name):
+	* sysdep.c (qxe_allocating_getcwd):
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	* unexcw.c (unexec):
+	* unexnt.c (_start):
+	* win32.c (mswindows_read_link_1):
+	Rename PATH_MAX_EXTERNAL to PATH_MAX_TSTR to reflect its actual
+	semantics.
+
+	* unexcw.c:
+	Remove include of syswindows.h that had been added because
+	sysfile.h didn't include it.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* specifier.c (specifier_instance_from_inst_list):
+	Don't declare an unused variable, (void) 0 is enough.
+	
+	* text.h:
+	Don't use USED_IF_MULE_OR_CHECK_TEXT().
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* debug.c (vars_of_debug):
+	Provide `debug-xemacs' to signal we have a debug build;
+	must do this to get previoug `debug-on-error' change to work.
+
+2010-01-13  Jerry James  <james@xemacs.org>
+
+	* font-mgr.c (Ffc_config_app_font_add_file): Fix parentheses.
+	(Ffc_config_app_font_add_dir): Ditto.
+
+2010-01-13  Jerry James  <james@xemacs.org>
+
+	* Makefile.in.in: Remove CYGWIN && !PDUMP section.
+	* depend: Regenerated.
+	* s/cygwin.sc: Removed.
+	* s/cygwin32.h (UNEXEC): Do not define.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* print.c:
+	* print.c (internal_object_printer):
+	* print.c (enum printing_badness):
+	* print.c (printing_major_badness):
+	* print.c (print_internal):
+	Clean up the part of the code that looks for things that might
+	lead to crashing in the print code:
+	-- Make the "badness" messages more consistent.
+	-- Move the checks for circularities after the checks for bad
+	   memory, since the checks for circularities involve accessing
+	   memory (which could be bad).
+	-- Add an extra check to see if the object's implementation structure
+	   is bad memory.
+	-- Add extra check for object itself being a null pointer or
+	   implementation pointer being null.
+	-- Add some extra comments to help in maintaining the code.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* casetab.c (print_case_table):
+	* console.c (print_console):
+	* data.c (print_weak_list):
+	* data.c (print_weak_box):
+	* data.c (print_ephemeron):
+	* data.c (ephemeron_equal):
+	* database.c (print_database):
+	* device-msw.c (print_devmode):
+	* device.c (print_device):
+	* eval.c:
+	* file-coding.c (print_coding_system):
+	* frame.c (print_frame):
+	* glyphs.c (print_image_instance):
+	* glyphs.c (print_glyph):
+	* gui.c:
+	* gui.c (print_gui_item):
+	* keymap.c (print_keymap):
+	* lisp.h:
+	* mule-charset.c (print_charset):
+	* objects.c (print_color_instance):
+	* objects.c (print_font_instance):
+	* print.c:
+	* print.c (printing_unreadable_object):
+	* print.c (printing_unreadable_lcrecord):
+	* print.c (default_object_printer):
+	* process.c (print_process):
+	* tooltalk.c:
+	* tooltalk.c (print_tooltalk_message):
+	* tooltalk.c (print_tooltalk_pattern):
+	* ui-gtk.c (ffi_object_printer):
+	* ui-gtk.c (emacs_gtk_object_printer):
+	* ui-gtk.c (emacs_gtk_boxed_printer):
+	* window.c (print_window):
+	New function printing_unreadable_lcrecord().  Automatically
+	prints the type name and pointer value of the object.  Use it
+	instead of printing_unreadable_object(); make that latter
+	function local to print.c.
+
+	* window.c (print_window):
+	During creation, window may have Qt as its buffer. Don't
+	crash if trying to print such a window.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* dynarr.c:
+	Add comment explaining Dynarr_largest() use.
+
+	* dynarr.c (Dynarr_insert_many):
+	In Dynarr_insert_many(), don't call Dynarr_resize() unless we
+	actually need to resize, and note that an assert() that we are
+	inserting at or below the current end could be wrong if code
+	wants to access stuff between `len' and `largest'.
+
+	* dynarr.c (stack_like_malloc):
+	Don't just Dynarr_resize() to the right size; instead use
+	Dynarr_reset() then Dynarr_add_many(), so that the 'len' and
+	'largest' and such get set properly.
+
+	* dynarr.c (Dynarr_insert_many):
+	* dynarr.c (Dynarr_delete_many):
+	* dynarr.c (Dynarr_memory_usage):
+	* dynarr.c (stack_like_free):
+	* faces.c (add_face_cachel):
+	* gutter.c (output_gutter):
+	* lisp.h:
+	* lisp.h (Dynarr_declare):
+	* lisp.h (Dynarr_length):
+	* lisp.h (Dynarr_add):
+	* lisp.h (Dynarr_increment):
+	* lisp.h (Dynarr_pop):
+	* lread.c (define_structure_type):
+	* lread.c (define_structure_type_keyword):
+	* lrecord.h:
+	* lrecord.h (XD_DYNARR_DESC):
+	* lrecord.h (XD_LISP_DYNARR_DESC):
+	* redisplay-output.c (compare_display_blocks):
+	* redisplay-output.c (output_display_line):
+	* redisplay.c (add_ichar_rune_1):
+	* redisplay.c (create_text_block):
+	* redisplay.c (generate_formatted_string_db):
+	* redisplay.c (create_string_text_block):
+	* redisplay.c (point_visible):
+	* redisplay.c (mark_glyph_block_dynarr):
+	* redisplay.c (mark_redisplay_structs):
+	* redisplay.c (line_start_cache_end):
+	* redisplay.c (update_line_start_cache):
+	* redisplay.c (glyph_to_pixel_translation):
+	* redisplay.c (pixel_to_glyph_translation):
+	Rename Dynarr member 'cur' to 'len' since it's the length of
+	the dynarr, not really a pointer to a "current insertion point".
+
+	Use type_checking_assert() instead of just assert() in some places.
+
+
+	Add additional assertions (Dynarr_verify*()) to check that we're
+	being given positions within range.  Use them in Dynarr_at,
+	Dynarr_atp, etc.  New Dynarr_atp_allow_end() for retrieving a
+	pointer to a position that might be the element past the last one.
+	New Dynarr_past_lastp() to retrieve a pointer to the position
+	past the last one, using Dynarr_atp_allow_end().  Change code
+	appropriately to use it.
+
+	Rename Dynarr_end() to Dynarr_lastp() (pointer to the last
+	element) for clarity, and change code appropriately to use it.
+
+	Change code appropriately to use Dynarr_begin().
+	
+	Rewrite Dynarr_add_many().  New version can accept a NULL pointer
+	to mean "reserve space but don't put anything in it".  Used by
+	stack_like_malloc().
+
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* lisp.h:
+	* lisp.h (inline_type_checking_assert):
+	Add structure_checking_assert(), gc_checking_assert(), etc. for
+	all types of error-checking.  Also FOO_checking_assert_with_message()
+	and inline_FOO_checking_assert() -- the latter for use in an inline
+	function where you want the calling function's line/file to be reported
+	(requires some conspiracy with the function itself).
+
+	Add disabled_assert(), disabled_assert_at_line(),
+	disabled_assert_with_message(), for what to do when an assert is
+	disabled.  Formerly, we used to do ((void) 0), but now we do
+	((void) x), so the variable appears used and any side effects of the
+	expression do get done.  In Unicode-internal, the standard assert()
+	uses this, but not yet in this workspace.
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* cmdloop.c:
+	During really-early-error-handler, exit to the debugger and abort
+	if an error occurs and 
+	* lisp.h: extern Vdebug_on_error.
+
+2010-01-12  Ben Wing  <ben@xemacs.org>
+
+	* sheap.c:
+	* sheap.c (more_static_core): 
+	Increase STATIC_HEAP_SLOP.
+	Change heap-exhausted error message to mention the computed
+	static heap size.
+	
+	* unexcw.c: Include syswindows.h to avoid compile error.
+
+	* file-coding.c (default_query_method): Single = is intended.
+	Rewrite using comma operator to make this clearer and avoid
+	dependency on the value of an enum.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* database.c:
+	* intl-encap-win32.c (qxeUpdateICMRegKey):
+	Cosmetic fixes.
+	
+	* device-x.c (signal_if_x_error):
+	* editfns.c (Fformat_time_string):
+	* editfns.c (Fencode_time):
+	* editfns.c (Fcurrent_time_zone):
+	* editfns.c (Fset_time_zone_rule):
+	* event-gtk.c (gtk_reset_key_mapping):
+	* fileio.c (Fsysnetunam):
+	* font-mgr.c:
+	* font-mgr.c (Ffc_config_app_font_add_dir):
+	* font-mgr.c (Ffc_config_filename):
+	* glyphs-eimage.c (my_jpeg_output_message):
+	* glyphs-eimage.c (jpeg_instantiate):
+	* glyphs-shared.c (read_bitmap_data_from_file):
+	* glyphs-x.c (x_redisplay_widget):
+	* glyphs-x.c (x_widget_instantiate):
+	* glyphs-x.c (x_widget_property):
+	* glyphs-x.c (x_tab_control_redisplay):
+	* hpplay.c (player_error_internal):
+	* hpplay.c (play_sound_file):
+	* hpplay.c (play_sound_data):
+	* process-unix.c:
+	* process-unix.c (unix_canonicalize_host_name):
+	* process.c (init_xemacs_process):
+	* sound.h (sound_perror):
+	* sysdep.c:
+	* sysdep.c (qxe_execve):
+	* sysdep.c (copy_in_passwd):
+	* sysdep.c (qxe_getpwnam):
+	* sysdep.c (qxe_ctime):
+	* sysdll.c (dll_error):
+	* sysdll.c (dll_open):
+	* tooltalk.c (check_status):
+	* tooltalk.c (Fadd_tooltalk_message_arg):
+	* tooltalk.c (Fadd_tooltalk_pattern_attribute):
+	* tooltalk.c (Fadd_tooltalk_pattern_arg):
+	Change all occurrences of Qnative to some more specific encoding.
+	Create Qtime_function_encoding, Qtime_zone_encoding,
+	Quser_name_encoding, Qerror_message_encoding,
+	Qjpeg_error_message_encoding, Qtooltalk_encoding, Qgtk_encoding,
+	Qx_error_message_encoding.
+
+	* intl-win32.c (init_intl_win32):
+	Provide cygwin-use-utf-8 if this is the case.
+
+	* fileio.c (Ffile_truename):
+	* realpath.c:
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_TSTR):
+	* syswindows.h (TSTR_TO_LOCAL_FILE_FORMAT):
+	* syswindows.h (LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN):
+	* syswindows.h (INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT):
+	* syswindows.h (LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR):
+	* win32.c (urlify_filename):
+	* win32.c (tstr_to_local_file_format):
+	* win32.c (Fmswindows_cygwin_to_win32_path):
+	Rename LOCAL_FILE_FORMAT_TO_INTERNAL_WIN32 and
+	INTERNAL_WIN32_TO_LOCAL_FILE_FORMAT to
+	LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN and
+	INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT, since "win32" is a misnomer.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* config.h.in:
+	Add def for HAVE_CYGWIN_CONV_PATH.
+	
+	* dialog-msw.c (handle_directory_dialog_box):
+	* dialog-msw.c (handle_file_dialog_box):
+	* fileio.c:
+	* fileio.c (Ffile_truename):
+	* syswindows.h:
+	* syswindows.h (CCP_POSIX_TO_WIN_T):
+	* syswindows.h (LISP_LOCAL_FILE_FORMAT_TO_TSTR):
+	* syswindows.h (INTERNAL_WIN32_TO_LOCAL_FILE_FORMAT):
+	* syswindows.h (LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR):
+	* win32.c (urlify_filename):
+	* win32.c (tstr_to_local_file_format):
+	* win32.c (Fmswindows_shell_execute):
+	* win32.c (Fmswindows_cygwin_to_win32_path):
+	Rename LOCAL_FILE_FORMAT_TO_TSTR to LISP_LOCAL_FILE_FORMAT_TO_TSTR.
+	Rename LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR to
+	LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR.  Both of these renames
+	reflect the fact that their 'in' argument is a Lisp object.
+
+	Create new LOCAL_FILE_FORMAT_TO_TSTR that accepts an Ibyte *.
+
+	Rename LOCAL_TO_WIN32_FILE_FORMAT to
+	LOCAL_FILE_FORMAT_TO_INTERNAL_WIN32; rename WIN32_TO_LOCAL_FILE_FORMAT
+	to INTERNAL_WIN32_TO_LOCAL_FILE_FORMAT similarly.
+	This clarifies the fact that the result is a file in MS-Windows format
+	rather than POSIX format, but still in internal-format instead of
+	UTF-16.
+
+	Fix up the *LOCAL_FILE_FORMAT* functions to use cygwin_conv_path()
+	if available.  This converts between a UTF-8 POSIX path and a
+	UTF-16 Windows path (or ANSI Windows path, in the increasingly
+	unlikely situation that we're using Windows 9x).  Previously, we
+	used an old API and operated on internal-format data, because the
+	external format was unpredictable.  This doesn't work any more,
+	even with the old API (it tries to convert to UTF-8).  So instead,
+	when the new API is available we use the new API and operate on
+	external-format data.  This necessitates that if we want to convert
+	to/from internal-format Windows-style paths, we need to first convert
+	to external format, do the conversion, and convert back to
+	internal format.  To avoid this, we change some callers of the
+	macros to use the right version (internal or external format
+	destination) and avoid doing the internal/external conversions
+	themselves.
+
+	* realpath.c:
+	* fileio.c (check_writable):
+	Cosmetic fixes to check_writable.
+
+	Avoid directly calling cygwin_conv_to_full_win32_path
+	(fileio.c:check_writable did this) or cygwin_posix_to_win32_path_list
+	(realpath.c:readlink_or_correct_case did this); use the
+	*LOCAL_FILE_FORMAT* macros instead.
+
+	* fileio.c (Ffile_exists_p):
+	* glyphs-msw.c (mswindows_resource_instantiate):
+	* sysdll.c (dll_open):
+	* sysfile.h:
+	* sysfile.h (PATHNAME_CONVERT_OUT_TSTR):
+	Add PATHNAME_CONVERT_OUT_TSTR and PATHNAME_CONVERT_OUT_UTF_8 for
+	conversion involving specified coding systems rather than `file-name'.
+	Use them in *LOCAL_FILE_FORMAT* macros.
+
+	* emacs.c (main_1):
+	* symsinit.h:
+	* unicode.c:
+	New function complex_vars_of_unicode().  In it, create the utf-8
+	coding system.  Call it appropriately in emacs.c.  Sort the
+	prototypes of complex_vars_of_*() in symsinit.h, for cosmetic
+	reasons.
+	
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* regex.c (re_compile_fastmap):
+	The code to compute the fastmap in charset_mule_not was totally
+	messed up.  I'm surprised it hasn't led to more visible bugs.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* rangetab.c:
+	* rangetab.c (external_to_internal_adjust_ends):
+	* rangetab.c (put_range_table):
+	* rangetab.c (Fmap_range_table):
+	* rangetab.c (struct unified_range_table):
+	* rangetab.c (unified_range_table_copy_data):
+	* rangetab.c (unified_range_table_get_range):
+	Add an entry to unified range tables to keep track of their type.
+	Factor out code to adjust the endpoints of ranges between the
+	external format (either end can be open or closed) and internal
+	format (always closed/open).  Use code also when returning
+	ranges out of unified range tables.  Fixes an off-by-one error
+	in regex.c where it was getting ranges with an end one greater
+	than expected, since it creates closed-closed range tables and
+	was getting passed the internal-format ranges.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* config.h.in:
+	* config.h.in (ERROR_CHECK_GLYPHS):
+	Trying to avoid link errors referring to the ERROR_CHECK_TYPES
+	functions, either in eldap.o (if we don't include references to
+	ERROR_CHECK_TYPES in xemacs.def.in.in) or xemacs-export.o (if
+	we do include such references):
+	
+	Add line for USE_GPLUSPLUS, set by configure.
+	Define INLINE_HEADERS_ARE_STATIC when we add static to inline headers.
+	(Possibly used when setting NEED_ERROR_CHECK_TYPES_INLINES.)
+	Currently, set NEED_ERROR_CHECK_TYPES_INLINES when ERROR_CHECK_TYPES
+	and USE_GPLUSPLUS.
+	
+	* xemacs.def.in.in:
+	Use NEED_ERROR_CHECK_TYPES_INLINES here to bracket things like
+	`error_check_cons' instead of just ERROR_CHECK_TYPES.
+
+	* faces.c (complex_vars_of_faces):
+	Bracket various font variables with defined(USE_XFT or MULE) to
+	avoid warnings.
+	
+	* fileio.c:
+	Make sure the `expand-file-name' handler returns a string, to
+	avoid a potential crash.
+	
+	* floatfns.c (round_one_bigfloat_1):
+	#if-0 out an assert that can never be triggered and which
+	generates warnings "dereferencing type-punned pointer will break
+	strict-aliasing rules".
+	
+	* redisplay-x.c (separate_textual_runs_nomule):
+	Remove unused variable in non-Mule case.
+	
+	* specifier.c (charset_matches_specifier_tag_set_p):
+	Variable CHARSET is unused when not Mule.
+	
+	* specifier.c (specifier_instance_from_inst_list):
+	Add a comment questioning why font-specific stuff is littering
+	specifier.c.
+	
+	* syswindows.h:
+	Expand on the comments on a #if 0 I added in a previous patch.
+	
+	* vdb-win32.c:
+	* vdb-win32.c (win32_fault_handler):
+	* vdb-win32.c (vdb_install_signal_handler):
+	Change return type to LONG instead of DWORD to avoid warning or
+	error.
+	
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* database.c: Cygwin prototypes in ndbm.h are incomplete and
+	cause C++ compile errors; fix them.
+	
+	* fileio.c (check_writable):
+	Fix compile errors.  Also move the call to C_STRING_TO_TSTR
+	earlier, which is probably wrong, but fixed in a later patch.
+	
+	* intl-encap-win32.c (qxeGetICMProfile):
+	Ifdef out a fix to work around a previous bogosity in Cygwin
+	header files which has now been fixed.  Keeping in the fix
+	led to compile errors. #### Proper way to do it is to figure
+	out when it got fixed, perhaps put in a configure test, but it
+	seems not worth it.
+	
+	* intl-encap-win32.c (qxeUpdateICMRegKey):
+	Cosmetic change, undone in a later patch.
+	* mule-charset.c (Fset_charset_ccl_program):
+	Remove unused variable.
+	* nas.c:
+	#if-0 out some unused static code to avoid a warning.
+	* syswindows.h:
+	Don't declare prototypes for GetCurrentFiber and GetFiberData,
+	it causes a compile error.
+	* unicode.c (unicode_query):
+	invalid_lower_limit might have been used uninitted, so initialize it.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* config.h.in:
+	Add def for HAVE_CYGWIN_CONV_PATH.
+	
+	* dialog-msw.c (handle_directory_dialog_box):
+	* dialog-msw.c (handle_file_dialog_box):
+	* fileio.c:
+	* fileio.c (Ffile_truename):
+	* syswindows.h:
+	* syswindows.h (CCP_POSIX_TO_WIN_T):
+	* syswindows.h (LISP_LOCAL_FILE_FORMAT_TO_TSTR):
+	* syswindows.h (INTERNAL_WIN32_TO_LOCAL_FILE_FORMAT):
+	* syswindows.h (LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR):
+	* win32.c (urlify_filename):
+	* win32.c (tstr_to_local_file_format):
+	* win32.c (Fmswindows_shell_execute):
+	* win32.c (Fmswindows_cygwin_to_win32_path):
+	Rename LOCAL_FILE_FORMAT_TO_TSTR to LISP_LOCAL_FILE_FORMAT_TO_TSTR.
+	Rename LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR to
+	LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR.  Both of these renames
+	reflect the fact that their 'in' argument is a Lisp object.
+
+	Create new LOCAL_FILE_FORMAT_TO_TSTR that accepts an Ibyte *.
+
+	Rename LOCAL_TO_WIN32_FILE_FORMAT to
+	LOCAL_FILE_FORMAT_TO_INTERNAL_WIN32; rename WIN32_TO_LOCAL_FILE_FORMAT
+	to INTERNAL_WIN32_TO_LOCAL_FILE_FORMAT similarly.
+	This clarifies the fact that the result is a file in MS-Windows format
+	rather than POSIX format, but still in internal-format instead of
+	UTF-16.
+
+	Fix up the *LOCAL_FILE_FORMAT* functions to use cygwin_conv_path()
+	if available.  This converts between a UTF-8 POSIX path and a
+	UTF-16 Windows path (or ANSI Windows path, in the increasingly
+	unlikely situation that we're using Windows 9x).  Previously, we
+	used an old API and operated on internal-format data, because the
+	external format was unpredictable.  This doesn't work any more,
+	even with the old API (it tries to convert to UTF-8).  So instead,
+	when the new API is available we use the new API and operate on
+	external-format data.  This necessitates that if we want to convert
+	to/from internal-format Windows-style paths, we need to first convert
+	to external format, do the conversion, and convert back to
+	internal format.  To avoid this, we change some callers of the
+	macros to use the right version (internal or external format
+	destination) and avoid doing the internal/external conversions
+	themselves.
+
+	* realpath.c:
+	* fileio.c (check_writable):
+	Cosmetic fixes to check_writable.
+
+	Avoid directly calling cygwin_conv_to_full_win32_path
+	(fileio.c:check_writable did this) or cygwin_posix_to_win32_path_list
+	(realpath.c:readlink_or_correct_case did this); use the
+	*LOCAL_FILE_FORMAT* macros instead.
+
+	* fileio.c (Ffile_exists_p):
+	* glyphs-msw.c (mswindows_resource_instantiate):
+	* sysdll.c (dll_open):
+	* sysfile.h:
+	* sysfile.h (PATHNAME_CONVERT_OUT_TSTR):
+	Add PATHNAME_CONVERT_OUT_TSTR and PATHNAME_CONVERT_OUT_UTF_8 for
+	conversion involving specified coding systems rather than `file-name'.
+	Use them in *LOCAL_FILE_FORMAT* macros.
+
+	* emacs.c (main_1):
+	* symsinit.h:
+	* unicode.c:
+	New function complex_vars_of_unicode().  In it, create the utf-8
+	coding system.  Call it appropriately in emacs.c.  Sort the
+	prototypes of complex_vars_of_*() in symsinit.h, for cosmetic
+	reasons.
+	
+
+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* fns.c (split_string_by_ichar_1): Extend this to take UNESCAPE
+	and ESCAPECHAR arguments.
+	(split_external_path, split_env_path, Fsplit_string_by_char)
+	(Fsplit_path):
+	Pass the new arguments to split_string_by_ichar_1(); take a new
+	optional argument, ESCAPE-CHAR, in #'split-string-by-char,
+	allowing SEPCHAR to be escaped.
+
+2010-01-09  Didier Verna  <didier@xemacs.org>
+
+	* glyphs.c (query_string_font): Use proper domain for cachel
+	updating.
+
+2010-01-09  Didier Verna  <didier@xemacs.org>
+
+	Fix query_string_geometry lookup domain.
+	* redisplay.c (redisplay_window_text_width_ichar_string): Formerly
+	named redisplay_text_width_ichar_string.
+	* redisplay.c (redisplay_window_text_width_string): Formerly named
+	redisplay_text_width_string. Make static.
+	* redisplay.c (redisplay_text_width_string): Formerly named
+	redisplay_frame_text_width_string. Generalize to accept any
+	Lisp_Object domain argument (instead of only frames).
+	* redisplay.c (add_ichar_rune_1): Update funcalls for the above
+	renaming.
+	* redisplay.c (generate_fstring_runes): Ditto.
+	* redisplay.h: Ditto.
+	* glyphs.c (query_string_geometry): Use proper domain for cachel
+	updating and in generalized version of redisplay_text_width_string.
+
+2010-01-08  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule-charset.c (Fmake_charset): 
+	Change build_string with an Ibyte argument to build_intstring,
+	fixing the build on Visual C++. Thank you for the report, Vin.
+
+2010-01-07  Jerry James  <james@xemacs.org>
+
+	* font-mgr.c (Ffc_font_match): Initialize result to FcResultMatch
+	before calling FcFontMatch.
+	* objects-xlike-inc.c (xft_find_charset_font): Ditto.
+
+2010-01-07  Henrique Martins  <xemacs@martins.cc>
+
+	* dired.c (file_name_completion): If a file is too big to stat(),
+	ignore the error, since we don't use the size.
+
+2010-01-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule-charset.c:
+	(syms_of_mule_charset, complex_vars_of_mule_charset):
+	* lisp.h:
+	Restore the creation of arabic-iso8859-6 in C, having it in Lisp
+	isn't sufficient for X11 input to work.
+
+2010-01-06  Jerry James  <james@xemacs.org>
+
+	* emacs.c (main_1): Only call reinit_vars_of_number if
+	WITH_NUMBER_TYPES.
+
+2010-01-06  Jerry James  <james@xemacs.org>
+
+	* alloc.c: Include valgrind header if USE_VALGRIND.
+	(Fvalgrind_leak_check): New function.
+	(Fvalgrind_quick_leak_check): New function.
+	(syms_of_alloc): Declare the new functions.
+	* config.h.in (USE_VALGRIND): New define.
+
+2010-01-06  Jerry James  <james@xemacs.org>
+
+	* emacs.c: Fix FSF address.
+	(main_1): Call reinit_vars_of_number.
+	* number-gmp.c: Fix FSF address.
+	* number-gmp.h: Ditto.
+	* number-mp.c: Ditto.
+	* number-mp.h: Ditto.
+	* number.h: Ditto.
+	* number.c: Ditto.
+	(bignum_finalize): New function.
+	(ratio_finalize): New function.
+	(bigfloat_finalize): New function.
+	(vars_of_number): Don't create a bignum here.
+	(reinit_vars_of_number): New function; create a bignum here.
+	(init_number): Call reinit_vars_of_number if !PDUMP.
+	* symsinit.h: Fix FSF address.  Declare reinit_vars_of_number.
+
+2010-01-05  Jerry James  <james@xemacs.org>
+
+	* font-mgr.c (Ffc_name_unparse): Return value of FcNameUnparse
+	must be freed.
+
+2009-12-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* eval.c (Ffunctionp): 
+	Special forms no longer give t in this function, in accordance
+	with recent GNU Emacs and with Common Lisp.
+
 2009-12-21  Jerry James  <james@xemacs.org>
 
 	* config.h.in: Remove OffiX support.
@@ -260,6 +3818,16 @@
 	against msvcrt8.  This fix was taken from the Mozilla project
 	which experienced the same problem.
 
+2009-12-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* symbols.c (reject_constant_symbols): 
+	Indicate that accepting attempted modification of keywords is a
+	temporary thing.
+
+2009-12-23  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* fns.c (Fcompare_strings): Coerce bounds to be within strings.
+
 2009-12-18  Jerry James  <james@xemacs.org>
 
 	* ppc.ldscript: Remove, obsolete.
@@ -325,11 +3893,28 @@
 	* xmu.h: Ditto.
 	* depend: Regenerate.
 
+2010-01-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* mule-charset.c (Fmake_charset):
+	Don't intern the symbols used to refer to temporary character
+	sets, that doesn't bring us anything.
+
 2009-12-05  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	* faces.c (complex_vars_of_faces): Explain why "*" isn't rewritten
 	as a full XLFD.
 
+2010-01-09  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* elhash.c:
+	(print_hash_table, print_hash_table_data)
+	(hash_table_instantiate)
+	(structure_type_create_hash_table_structure_name): 
+	(syms_of_elhash): 
+	Use keywords, not ordinary symbols, in the hash table read syntax,
+	for compatibility with Common Lisp and recent GNU Emacs. Accept
+	the non-keyword syntax, but don't allow mixing of the two styles.
+
 2009-11-19  Vin Shelton  <acs@xemacs.org>
 
 	* sysdep.c (sys_subshell): Restore sys_subshell(); it's necessary
--- a/src/Makefile.in.in	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/Makefile.in.in	Wed Feb 24 01:58:04 2010 -0600
@@ -3,7 +3,7 @@
 ##   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois
 ##   Copyright (C) 1996, 1997 Sun Microsystems, Inc.
 ##   Copyright (C) 1998, 1999 J. Kean Johnston.
-##   Copyright (C) 2001, 2002, 2003, 2005 Ben Wing.
+##   Copyright (C) 2001, 2002, 2003, 2005, 2010 Ben Wing.
 
 ## This file is part of XEmacs.
 
@@ -132,13 +132,13 @@
 
 #ifdef HAVE_X_WINDOWS
 x_objs=console-x.o device-x.o event-Xt.o frame-x.o \
- glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o intl-x.o
-#ifdef USE_XFT
+ glyphs-x.o objects-x.o redisplay-x.o select-x.o gccache-x.o intl-x.o
+#ifdef HAVE_XFT
 x_objs += font-mgr.o
 #endif
 x_gui_objs=$(gui_objs:.o=-x.o)
 #ifdef HAVE_TOOLBARS
-x_gui_objs += toolbar-common.o
+x_gui_objs += toolbar-xlike.o
 #endif
 #endif
 
@@ -159,7 +159,7 @@
  gtk-xemacs.o ui-gtk.o
 gtk_gui_objs=$(gui_objs:.o=-gtk.o)
 #ifdef HAVE_TOOLBARS
-gtk_gui_objs += toolbar-common.o
+gtk_gui_objs += toolbar-xlike.o
 #endif
 #endif
 
@@ -230,7 +230,7 @@
 
 #ifdef HAVE_SHLIB
 shlib_objs=sysdll.o
-# ifdef HAVE_MS_WINDOWS
+# ifdef WIN32_ANY
 export_lib=xemacs-export.o
 xemacs-export.o: xemacs.def
 	dlltool -D xemacs-${version}.exe -d $< -l xemacs-import.a -e $@
@@ -245,7 +245,7 @@
 tooltalk_objs=tooltalk.o
 #endif
 
-#if defined (WIN32_NATIVE) || defined (CYGWIN)
+#ifdef WIN32_ANY
 win32_objs=win32.o intl-win32.o intl-auto-encap-win32.o intl-encap-win32.o \
  xemacs_res.o
 #endif
@@ -368,10 +368,6 @@
 
 LIBES = $(lwlib_lib) $(malloclib) $(ld_libs_all) $(lib_gcc)
 
-#ifdef I18N3
-mo_file = $(LIB_SRC)/emacs.mo
-#endif
-
 #########################################################################
 ##                           Implicit rules                            ##
 #########################################################################
@@ -391,10 +387,6 @@
 ldflags  = $(LDFLAGS) $(ld_switch_all) $(ld_dynamic_link_flags)
 #endif
 
-#if defined (CYGWIN) && !defined (PDUMP)
-ldflags += -Wl,--script=s/cygwin.sc
-#endif
-
 #ifdef SOLARIS2
 %.o : %.c
 #else
@@ -668,35 +660,6 @@
 ##                     Subsidiary dependency rules                     ##
 #########################################################################
 
-#ifdef I18N3
-
-# if defined(SPARC) && !defined(USG)
-   xgettext=		 /usr/openwin/bin/xgettext
-   xgettext_args=	 -o emacs -m_X messages
-   msgfmt=		 /usr/openwin/bin/msgfmt
-# else
-   xgettext=		 xgettext
-   xgettext_args=	 -s -d emacs -M_X messages
-   msgfmt=		 msgfmt
-#endif
-
-$(LIB_SRC)/emacs.po: $(LIB_SRC)/make-msgfile $(LIB_SRC)/make-po $(objs)
-	$(LIB_SRC)/make-msgfile -o $(LIB_SRC)/messages $(objs)
-	cd $(LIB_SRC) && $(xgettext) $(xgettext_args)
-	$(RM) $(LIB_SRC)/emacs.po
-	cd $(LIB_SRC) && $(LIB_SRC)/make-po -a $(LIB_SRC)/emacs.po DOC
-
-$(LIB_SRC)/emacs.mo: $(LIB_SRC)/emacs.po
-	cd $(LIB_SRC)/ && $(msgfmt) -o emacs.mo emacs.po
-
-$(LIB_SRC)/make-msgfile:
-	cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-msgfile
-
-$(LIB_SRC)/make-po:
-	cd $(LIB_SRC) && $(MAKE) $(RECURSIVE_MAKE_ARGS) make-po
-
-#endif /* I18N3 */
-
 TopLevelEmacsShell.o : $(SRC)/EmacsShell-sub.c config.h xintrinsicp.h EmacsShellP.h
 	$(CC) -c $(cflags) -DDEFINE_TOP_LEVEL_EMACS_SHELL $(SRC)/EmacsShell-sub.c
 	mv EmacsShell-sub.o TopLevelEmacsShell.o
@@ -921,6 +884,19 @@
 testdir = $(SRC)/../tests/automated
 batch_test_emacs = $(BATCH_PACKAGES) -l $(testdir)/test-harness.el -f batch-test-emacs $(testdir)
 
+## `config-changed' is useful if you are building both Unicode-internal
+## and old-Mule workspaces using --srcdir and don't run configure before
+## switching from one to the other.  If you rerun configure, update-elc.el
+## notices this and automatically removes the two files below, but not
+## if you just switch directories and `make'.  In that case, do
+## `make config-changed' to avoid an error.
+
+.PHONY: remove-config-dependent-elcs config-changed
+remove-config-dependent-elcs:
+	rm $(LISP)/mule/chinese.elc $(LISP)/mule/general-late.elc
+config-changed: remove-config-dependent-elcs all
+
+
 .PHONY: check check-temacs check-features
 check:
 	$(DO_XEMACS) $(batch_test_emacs)
--- a/src/README	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/README	Wed Feb 24 01:58:04 2010 -0600
@@ -61,7 +61,7 @@
       eval.c for a classification of various error functions.
 
    -- Constant strings occurring in source files need to get wrapped
-      in a call to GETTEXT (or if inside of a call to `build_string',
+      in a call to GETTEXT (or if inside of a call to `build_ascstring',
       change that function to `build_translated_string') if they don't
       occur in certain places where the I18N3 message snarfer will see
       them.  For a complete discussion of this, see the file
--- a/src/abbrev.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/abbrev.c	Wed Feb 24 01:58:04 2010 -0600
@@ -131,10 +131,10 @@
 
     for (idx = 0; idx < abbrev_length; idx++)
       {
-	if (DOWNCASE (closure->buf,
+	if (CANONCASE (closure->buf,
 		      BUF_FETCH_CHAR (closure->buf,
 				      closure->point - abbrev_length + idx))
-	    != DOWNCASE (closure->buf, itext_ichar (ptr)))
+	    != CANONCASE (closure->buf, itext_ichar (ptr)))
 	  {
 	    break;
 	  }
@@ -424,16 +424,16 @@
   if (NILP (XSYMBOL_VALUE (sym)) || ! NILP (system_flag))
     return;
 
-  buffer_insert_c_string (buf, "    (");
+  buffer_insert_ascstring (buf, "    (");
   name = Fsymbol_name (sym);
   Fprin1 (name, stream);
-  buffer_insert_c_string (buf, " ");
+  buffer_insert_ascstring (buf, " ");
   Fprin1 (XSYMBOL_VALUE (sym), stream);
-  buffer_insert_c_string (buf, " ");
+  buffer_insert_ascstring (buf, " ");
   Fprin1 (XSYMBOL (sym)->function, stream);
-  buffer_insert_c_string (buf, " ");
+  buffer_insert_ascstring (buf, " ");
   Fprin1 (count, stream);
-  buffer_insert_c_string (buf, ")\n");
+  buffer_insert_ascstring (buf, ")\n");
 }
 
 static void
@@ -462,7 +462,7 @@
 
   if (!NILP (system_flag))
     {
-      buffer_insert_c_string (buf, " (sys)");
+      buffer_insert_ascstring (buf, " (sys)");
       Findent_to (make_int (20), one, Qnil);
     }
   else
@@ -476,7 +476,7 @@
       Findent_to (make_int (45), one, Qnil);
       Fprin1 (XSYMBOL (sym)->function, stream);
     }
-  buffer_insert_c_string (buf, "\n");
+  buffer_insert_ascstring (buf, "\n");
 }
 
 static int
@@ -528,28 +528,28 @@
 
   if (!NILP (readable))
     {
-      buffer_insert_c_string (buf, "(");
+      buffer_insert_ascstring (buf, "(");
       Fprin1 (name, stream);
-      buffer_insert_c_string (buf, ")\n\n");
+      buffer_insert_ascstring (buf, ")\n\n");
       while (! NILP (symbols))
 	{
 	  describe_abbrev (XCAR (symbols), stream);
 	  symbols = XCDR (symbols);
 	}
 
-      buffer_insert_c_string (buf, "\n\n");
+      buffer_insert_ascstring (buf, "\n\n");
     }
   else
     {
-      buffer_insert_c_string (buf, "(define-abbrev-table '");
+      buffer_insert_ascstring (buf, "(define-abbrev-table '");
       Fprin1 (name, stream);
-      buffer_insert_c_string (buf, " '(\n");
+      buffer_insert_ascstring (buf, " '(\n");
       while (! NILP (symbols))
 	{
 	  write_abbrev (XCAR (symbols), stream);
 	  symbols = XCDR (symbols);
 	}
-      buffer_insert_c_string (buf, "    ))\n\n");
+      buffer_insert_ascstring (buf, "    ))\n\n");
     }
 
   return Qnil;
--- a/src/alloc.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/alloc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -71,6 +71,9 @@
 #ifdef DOUG_LEA_MALLOC
 #include <malloc.h>
 #endif
+#ifdef USE_VALGRIND
+#include <valgrind/memcheck.h>
+#endif
 
 EXFUN (Fgarbage_collect, 0);
 
@@ -226,7 +229,7 @@
     {
       void *tmp = breathing_space;
       breathing_space = 0;
-      xfree (tmp, void *);
+      xfree (tmp);
     }
 }
 #endif /* not NEW_GC */
@@ -269,7 +272,7 @@
   /* Unbelievably, calling free() on 0xDEADBEEF doesn't cause an	\
      error until much later on for many system mallocs, such as		\
      the one that comes with Solaris 2.3.  FMH!! */			\
-  assert (block != (void *) 0xDEADBEEF);				\
+  assert (block != (void *) DEADBEEF_CONSTANT);				\
   MALLOC_BEGIN ();							\
 }									\
 while (0)
@@ -280,7 +283,7 @@
   /* Unbelievably, calling free() on 0xDEADBEEF doesn't cause an	\
      error until much later on for many system mallocs, such as		\
      the one that comes with Solaris 2.3.  FMH!! */			\
-  assert (block != (void *) 0xDEADBEEF);				\
+  assert (block != (void *) DEADBEEF_CONSTANT);				\
   /* You cannot free something within dumped space, because there is	\
      no longer any sort of malloc structure associated with the block.	\
      If you are tripping this, you may need to conditionalize on	\
@@ -1255,15 +1258,15 @@
 }
 
 static int
-cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth)
+cons_equal (Lisp_Object ob1, Lisp_Object ob2, int depth, int foldcase)
 {
   depth++;
-  while (internal_equal (XCAR (ob1), XCAR (ob2), depth))
+  while (internal_equal_0 (XCAR (ob1), XCAR (ob2), depth, foldcase))
     {
       ob1 = XCDR (ob1);
       ob2 = XCDR (ob2);
       if (! CONSP (ob1) || ! CONSP (ob2))
-	return internal_equal (ob1, ob2, depth);
+	return internal_equal_0 (ob1, ob2, depth, foldcase);
     }
   return 0;
 }
@@ -1575,7 +1578,7 @@
 }
 
 static int
-vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+vector_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   int len = XVECTOR_LENGTH (obj1);
   if (len != XVECTOR_LENGTH (obj2))
@@ -1585,7 +1588,7 @@
     Lisp_Object *ptr1 = XVECTOR_DATA (obj1);
     Lisp_Object *ptr2 = XVECTOR_DATA (obj2);
     while (len--)
-      if (!internal_equal (*ptr1++, *ptr2++, depth + 1))
+      if (!internal_equal_0 (*ptr1++, *ptr2++, depth + 1, foldcase))
 	return 0;
   }
   return 1;
@@ -1957,19 +1960,7 @@
   f->stack_depth = (unsigned short) XINT (stack_depth);
 
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  if (!NILP (Vcurrent_compiled_function_annotation))
-    f->annotated = Fcopy (Vcurrent_compiled_function_annotation);
-  else if (!NILP (Vload_file_name_internal_the_purecopy))
-    f->annotated = Vload_file_name_internal_the_purecopy;
-  else if (!NILP (Vload_file_name_internal))
-    {
-      struct gcpro gcpro1;
-      GCPRO1 (fun);		/* don't let fun get reaped */
-      Vload_file_name_internal_the_purecopy =
-	Ffile_name_nondirectory (Vload_file_name_internal);
-      f->annotated = Vload_file_name_internal_the_purecopy;
-      UNGCPRO;
-    }
+  f->annotated = Vload_file_name_internal;
 #endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
 
   /* doc_string may be nil, string, int, or a cons (string . int).
@@ -2278,11 +2269,15 @@
 }
 
 static int
-string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+string_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int foldcase)
 {
   Bytecount len;
-  return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) &&
-	  !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len));
+  if (foldcase)
+    return !lisp_strcasecmp_i18n (obj1, obj2);
+  else
+    return (((len = XSTRING_LENGTH (obj1)) == XSTRING_LENGTH (obj2)) &&
+	    !memcmp (XSTRING_DATA (obj1), XSTRING_DATA (obj2), len));
 }
 
 static const struct memory_description string_description[] = {
@@ -2680,7 +2675,7 @@
 		      XSTRING_LENGTH (s) + 1 - pos);
 	    }
 	  XSET_STRING_DATA (s, new_data);
-	  xfree (old_data, Ibyte *);
+	  xfree (old_data);
 	}
     }
   else /* old string is small */
@@ -2898,7 +2893,7 @@
 /* Take some raw memory, encoded in some external data format,
    and convert it into a Lisp string. */
 Lisp_Object
-make_ext_string (const Extbyte *contents, EMACS_INT length,
+make_extstring (const Extbyte *contents, EMACS_INT length,
 		 Lisp_Object coding_system)
 {
   Lisp_Object string;
@@ -2909,39 +2904,93 @@
 }
 
 Lisp_Object
-build_intstring (const Ibyte *str)
+build_istring (const Ibyte *str)
 {
   /* Some strlen's crash and burn if passed null. */
   return make_string (str, (str ? qxestrlen (str) : (Bytecount) 0));
 }
 
 Lisp_Object
-build_string (const CIbyte *str)
-{
-  /* Some strlen's crash and burn if passed null. */
-  return make_string ((const Ibyte *) str, (str ? strlen (str) : 0));
+build_cistring (const CIbyte *str)
+{
+  return build_istring ((const Ibyte *) str);
+}
+
+Lisp_Object
+build_ascstring (const Ascbyte *str)
+{
+  ASSERT_ASCTEXT_ASCII (str);
+  return build_istring ((const Ibyte *) str);
 }
 
 Lisp_Object
-build_ext_string (const Extbyte *str, Lisp_Object coding_system)
+build_extstring (const Extbyte *str, Lisp_Object coding_system)
 {
   /* Some strlen's crash and burn if passed null. */
-  return make_ext_string ((const Extbyte *) str,
+  return make_extstring ((const Extbyte *) str,
 			  (str ? dfc_external_data_len (str, coding_system) :
 			   0),
 			  coding_system);
 }
 
+/* Build a string whose content is a translatable message, and translate
+   the message according to the current language environment. */
+
+Lisp_Object
+build_msg_istring (const Ibyte *str)
+{
+  return build_istring (IGETTEXT (str));
+}
+
+/* Build a string whose content is a translatable message, and translate
+   the message according to the current language environment. */
+
+Lisp_Object
+build_msg_cistring (const CIbyte *str)
+{
+  return build_msg_istring ((const Ibyte *) str);
+}
+
+/* Build a string whose content is a translatable message, and translate
+   the message according to the current language environment.
+   String must be pure-ASCII, and when compiled with error-checking,
+   an abort will have if not pure-ASCII. */
+
+Lisp_Object
+build_msg_ascstring (const Ascbyte *str)
+{
+  ASSERT_ASCTEXT_ASCII (str);
+  return build_msg_istring ((const Ibyte *) str);
+}
+
+/* Build a string whose content is a translatable message, but don't
+   translate the message immediately.  Perhaps do something else instead,
+   such as put a property on the string indicating that it needs to be
+   translated.
+
+   This is useful for strings that are built at dump time or init time,
+   rather than on-the-fly when the current language environment is set
+   properly. */
+
+Lisp_Object
+build_defer_istring (const Ibyte *str)
+{
+  Lisp_Object retval = build_istring ((Ibyte *) str);
+  /* Possibly do something to the return value */
+  return retval;
+}
+
 Lisp_Object
-build_msg_intstring (const Ibyte *str)
-{
-  return build_intstring (GETTEXT (str));
+build_defer_cistring (const CIbyte *str)
+{
+  return build_defer_istring ((Ibyte *) str);
 }
 
 Lisp_Object
-build_msg_string (const CIbyte *str)
-{
-  return build_string (CGETTEXT (str));
+build_defer_ascstring (const Ascbyte *str)
+{
+  ASSERT_ASCTEXT_ASCII (str);
+  return build_defer_istring ((Ibyte *) str);
 }
 
 Lisp_Object
@@ -3133,6 +3182,14 @@
   const struct lrecord_implementation *implementation
     = LHEADER_IMPLEMENTATION (lheader);
 
+  /* If we try to debug-print during GC, we'll likely get a crash on the
+     following assert (called from Lstream_delete(), from prin1_to_string()).
+     Instead, just don't do anything.  Worst comes to worst, we have a
+     small memory leak -- and programs being debugged usually won't be
+     super long-lived afterwards, anyway. */
+  if (gc_in_progress && in_debug_print)
+    return;
+
   /* Finalizer methods may try to free objects within them, which typically
      won't be marked and thus are scheduled for demolition.  Putting them
      on the free list would be very bad, as we'd have xfree()d memory in
@@ -3257,62 +3314,58 @@
 
 #ifdef DEBUG_XEMACS
 
-static const struct memory_description staticpro_one_name_description_1[] = {
-  { XD_ASCII_STRING, 0 },
-  { XD_END }
-};
-
-static const struct sized_memory_description staticpro_one_name_description = {
-  sizeof (char *),
-  staticpro_one_name_description_1
-};
-
-static const struct memory_description staticpro_names_description_1[] = {
-  XD_DYNARR_DESC (char_ptr_dynarr, &staticpro_one_name_description),
-  { XD_END }
-};
-
-
-extern const struct sized_memory_description staticpro_names_description;
-
-const struct sized_memory_description staticpro_names_description = {
-  sizeof (char_ptr_dynarr),
-  staticpro_names_description_1
-};
-
 /* Help debug crashes gc-marking a staticpro'ed object. */
 
 Lisp_Object_ptr_dynarr *staticpros;
-char_ptr_dynarr *staticpro_names;
+const_Ascbyte_ptr_dynarr *staticpro_names;
 
 /* Mark the Lisp_Object at non-heap VARADDRESS as a root object for
    garbage collection, and for dumping. */
 void
-staticpro_1 (Lisp_Object *varaddress, char *varname)
+staticpro_1 (Lisp_Object *varaddress, const Ascbyte *varname)
 {
   Dynarr_add (staticpros, varaddress);
   Dynarr_add (staticpro_names, varname);
   dump_add_root_lisp_object (varaddress);
 }
 
+const Ascbyte *staticpro_name (int count);
+
+/* External debugging function: Return the name of the variable at offset
+   COUNT. */
+const Ascbyte *
+staticpro_name (int count)
+{
+  return Dynarr_at (staticpro_names, count);
+}
 
 Lisp_Object_ptr_dynarr *staticpros_nodump;
-char_ptr_dynarr *staticpro_nodump_names;
+const_Ascbyte_ptr_dynarr *staticpro_nodump_names;
 
 /* Mark the Lisp_Object at heap VARADDRESS as a root object for
    garbage collection, but not for dumping. (See below.) */
 void
-staticpro_nodump_1 (Lisp_Object *varaddress, char *varname)
+staticpro_nodump_1 (Lisp_Object *varaddress, const Ascbyte *varname)
 {
   Dynarr_add (staticpros_nodump, varaddress);
   Dynarr_add (staticpro_nodump_names, varname);
 }
 
+const Ascbyte *staticpro_nodump_name (int count);
+
+/* External debugging function: Return the name of the variable at offset
+   COUNT. */
+const Ascbyte *
+staticpro_nodump_name (int count)
+{
+  return Dynarr_at (staticpro_nodump_names, count);
+}
+
 #ifdef HAVE_SHLIB
 /* Stop treating the Lisp_Object at non-heap VARADDRESS as a root object
    for garbage collection, but not for dumping. */
 void
-unstaticpro_nodump_1 (Lisp_Object *varaddress, char *varname)
+unstaticpro_nodump_1 (Lisp_Object *varaddress, const Ascbyte *varname)
 {
   Dynarr_delete_object (staticpros, varaddress);
   Dynarr_delete_object (staticpro_names, varname);
@@ -3396,42 +3449,28 @@
 
 #ifdef DEBUG_XEMACS
 
-static const struct memory_description mcpro_one_name_description_1[] = {
-  { XD_ASCII_STRING, 0 },
-  { XD_END }
-};
-
-static const struct sized_memory_description mcpro_one_name_description = {
-  sizeof (char *),
-  mcpro_one_name_description_1
-};
-
-static const struct memory_description mcpro_names_description_1[] = {
-  XD_DYNARR_DESC (char_ptr_dynarr, &mcpro_one_name_description),
-  { XD_END }
-};
-
-extern const struct sized_memory_description mcpro_names_description;
-
-const struct sized_memory_description mcpro_names_description = {
-  sizeof (char_ptr_dynarr),
-  mcpro_names_description_1
-};
-
 /* Help debug crashes gc-marking a mcpro'ed object. */
 
 Lisp_Object_dynarr *mcpros;
-char_ptr_dynarr *mcpro_names;
+const_Ascbyte_ptr_dynarr *mcpro_names;
 
 /* Mark the Lisp_Object at non-heap VARADDRESS as a root object for
    garbage collection, and for dumping. */
 void
-mcpro_1 (Lisp_Object varaddress, char *varname)
+mcpro_1 (Lisp_Object varaddress, const Ascbyte *varname)
 {
   Dynarr_add (mcpros, varaddress);
   Dynarr_add (mcpro_names, varname);
 }
 
+/* External debugging function: Return the name of the variable at offset
+   COUNT. */
+const Ascbyte *
+mcpro_name (int count)
+{
+  return Dynarr_at (mcpro_names, count);
+}
+
 #else /* not DEBUG_XEMACS */
 
 Lisp_Object_dynarr *mcpros;
@@ -3550,7 +3589,7 @@
           *prev = next;
 	  tick_lcrecord_stats (h, 1);
 	  /* used to call finalizer right here. */
-	  xfree (header, struct old_lcrecord_header *);
+	  xfree (header);
 	  header = next;
 	}
     }
@@ -3674,7 +3713,7 @@
 	  SFTB_current = SFTB_current->prev;				     \
 	  {								     \
 	    *SFTB_prev = SFTB_current;					     \
-	    xfree (SFTB_victim_block, struct typename##_block *);	     \
+	    xfree (SFTB_victim_block);	     \
 	    /* Restore free list to what it was before victim was swept */   \
 	    typename##_free_list = SFTB_old_free_list;			     \
 	    num_free -= SFTB_limit;					     \
@@ -3780,7 +3819,7 @@
 {
 #define UNMARK_compiled_function(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader))
 #define ADDITIONAL_FREE_compiled_function(ptr) \
-  if (ptr->args_in_array) xfree (ptr->args, Lisp_Object *)
+  if (ptr->args_in_array) xfree (ptr->args)
 
   SWEEP_FIXED_TYPE_BLOCK (compiled_function, Lisp_Compiled_Function);
 }
@@ -4126,7 +4165,7 @@
 #ifndef NEW_GC
 /* Compactify string chars, relocating the reference to each --
    free any empty string_chars_block we see. */
-void
+static void
 compact_string_chars (void)
 {
   struct string_chars_block *to_sb = first_string_chars_block;
@@ -4213,7 +4252,7 @@
     for (victim = to_sb->next; victim; )
       {
 	struct string_chars_block *next = victim->next;
-	xfree (victim, struct string_chars_block *);
+	xfree (victim);
 	victim = next;
       }
 
@@ -4273,7 +4312,7 @@
 #define ADDITIONAL_FREE_string(ptr) do {	\
     Bytecount size = ptr->size_;		\
     if (BIG_STRING_SIZE_P (size))		\
-      xfree (ptr->data_, Ibyte *);		\
+      xfree (ptr->data_);		\
   } while (0)
 
   SWEEP_FIXED_TYPE_BLOCK_1 (string, Lisp_String, u.lheader);
@@ -4463,8 +4502,8 @@
     {
       if (lrecord_stats[i].instances_in_use != 0)
         {
-          char buf [255];
-          const char *name = lrecord_implementations_table[i]->name;
+          Ascbyte buf[255];
+          const Ascbyte *name = lrecord_implementations_table[i]->name;
 	  int len = strlen (name);
 
 	  if (lrecord_stats[i].bytes_in_use_including_overhead != 
@@ -4507,8 +4546,8 @@
           || lcrecord_stats[i].bytes_freed != 0
 	  || lcrecord_stats[i].instances_on_free_list != 0)
         {
-          char buf [255];
-          const char *name = lrecord_implementations_table[i]->name;
+          Ascbyte buf[255];
+          const Ascbyte *name = lrecord_implementations_table[i]->name;
 	  int len = strlen (name);
 
           sprintf (buf, "%s-storage", name);
@@ -4724,6 +4763,29 @@
 }
 #endif /* ALLOC_TYPE_STATS */
 
+#ifdef USE_VALGRIND
+DEFUN ("valgrind-leak-check", Fvalgrind_leak_check, 0, 0, "", /*
+Ask valgrind to perform a memory leak check.
+The results of the leak check are sent to stderr.
+*/
+       ())
+{
+  VALGRIND_DO_LEAK_CHECK;
+  return Qnil;
+}
+
+DEFUN ("valgrind-quick-leak-check", Fvalgrind_quick_leak_check, 0, 0, "", /*
+Ask valgrind to perform a quick memory leak check.
+This just prints a summary of leaked memory, rather than all the details.
+The results of the leak check are sent to stderr.
+*/
+       ())
+{
+  VALGRIND_DO_QUICK_LEAK_CHECK;
+  return Qnil;
+}
+#endif /* USE_VALGRIND */
+
 void
 recompute_funcall_allocation_flag (void)
 {
@@ -4927,7 +4989,8 @@
 #ifdef DEBUG_XEMACS
   if (staticpro_nodump_names)
     Dynarr_free (staticpro_nodump_names);
-  staticpro_nodump_names = Dynarr_new2 (char_ptr_dynarr, char *);
+  staticpro_nodump_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr,
+					const Ascbyte *);
   Dynarr_resize (staticpro_nodump_names, 100); /* ditto */
 #endif
 
@@ -4936,9 +4999,10 @@
   Dynarr_resize (mcpros, 1410); /* merely a small optimization */
   dump_add_root_block_ptr (&mcpros, &mcpros_description);
 #ifdef DEBUG_XEMACS
-  mcpro_names = Dynarr_new2 (char_ptr_dynarr, char *);
+  mcpro_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, const Ascbyte *);
   Dynarr_resize (mcpro_names, 1410); /* merely a small optimization */
-  dump_add_root_block_ptr (&mcpro_names, &mcpro_names_description);
+  dump_add_root_block_ptr (&mcpro_names,
+			   &const_Ascbyte_ptr_dynarr_description);
 #endif
 #endif /* NEW_GC */
 
@@ -5031,9 +5095,10 @@
   Dynarr_resize (staticpros, 1410); /* merely a small optimization */
   dump_add_root_block_ptr (&staticpros, &staticpros_description);
 #ifdef DEBUG_XEMACS
-  staticpro_names = Dynarr_new2 (char_ptr_dynarr, char *);
+  staticpro_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, const Ascbyte *);
   Dynarr_resize (staticpro_names, 1410); /* merely a small optimization */
-  dump_add_root_block_ptr (&staticpro_names, &staticpro_names_description);
+  dump_add_root_block_ptr (&staticpro_names,
+			   &const_Ascbyte_ptr_dynarr_description);
 #endif
 
 #ifdef NEW_GC
@@ -5041,9 +5106,10 @@
   Dynarr_resize (mcpros, 1410); /* merely a small optimization */
   dump_add_root_block_ptr (&mcpros, &mcpros_description);
 #ifdef DEBUG_XEMACS
-  mcpro_names = Dynarr_new2 (char_ptr_dynarr, char *);
+  mcpro_names = Dynarr_new2 (const_Ascbyte_ptr_dynarr, const Ascbyte *);
   Dynarr_resize (mcpro_names, 1410); /* merely a small optimization */
-  dump_add_root_block_ptr (&mcpro_names, &mcpro_names_description);
+  dump_add_root_block_ptr (&mcpro_names,
+			   &const_Ascbyte_ptr_dynarr_description);
 #endif
 #else /* not NEW_GC */
   init_lcrecord_lists ();
@@ -5078,6 +5144,10 @@
 #endif
   DEFSUBR (Ftotal_memory_usage);
   DEFSUBR (Fconsing_since_gc);
+#ifdef USE_VALGRIND
+  DEFSUBR (Fvalgrind_leak_check);
+  DEFSUBR (Fvalgrind_quick_leak_check);
+#endif
 }
 
 void
--- a/src/alloca.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/alloca.c	Wed Feb 24 01:58:04 2010 -0600
@@ -152,7 +152,7 @@
 	  register header *np = hp->h.next;
 
 #ifdef emacs
-	  xfree (hp, header *);	/* Collect garbage.  */
+	  xfree (hp);	/* Collect garbage.  */
 #else
 	  free (hp);		/* Collect garbage.  */
 #endif
--- a/src/alsaplay.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/alsaplay.c	Wed Feb 24 01:58:04 2010 -0600
@@ -414,6 +414,6 @@
   retry_read (fd, data, st.st_size);
   retry_close (fd);
   retval = alsa_play_sound_data (data, st.st_size, volume);
-  xfree (data, Binbyte);
+  xfree (data);
   return retval;
 }
--- a/src/buffer.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/buffer.c	Wed Feb 24 01:58:04 2010 -0600
@@ -307,7 +307,7 @@
 	printing_unreadable_object ("#<buffer %s>", XSTRING_DATA (b->name));
     }
   else if (!BUFFER_LIVE_P (b))
-    write_c_string (printcharfun, "#<killed buffer>");
+    write_ascstring (printcharfun, "#<killed buffer>");
   else if (escapeflag)
     write_fmt_string_lisp (printcharfun, "#<buffer %S>", 1, b->name);
   else
@@ -371,9 +371,11 @@
 */
        (frame))
 {
-  return Fmapcar (Qcdr,
-		  EQ (frame, Qt) ? Vbuffer_alist :
-		  decode_frame (frame)->buffer_alist);
+  Lisp_Object args[2];
+  args[0] = Qcdr;
+  args[1] = EQ (frame, Qt) ?
+    Vbuffer_alist : decode_frame (frame)->buffer_alist;
+  return FmapcarX (countof (args), args);
 }
 
 Lisp_Object
@@ -786,7 +788,7 @@
   while (1)
     {
       qxesprintf (number, "<%d>", ++count);
-      gentemp = concat2 (name, build_intstring (number));
+      gentemp = concat2 (name, build_istring (number));
       if (!NILP (ignore))
         {
           tem = Fstring_equal (gentemp, ignore);
@@ -1996,8 +1998,8 @@
   staticpro (&QSFundamental);
   staticpro (&QSscratch);
 
-  QSFundamental = build_string ("Fundamental");
-  QSscratch = build_string (DEFER_GETTEXT ("*scratch*"));
+  QSFundamental = build_ascstring ("Fundamental");
+  QSscratch = build_ascstring ("*scratch*");
 
   DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook /*
 List of hooks to be run before killing local variables in a buffer.
@@ -2257,7 +2259,7 @@
   defs->syntax_table = Vstandard_syntax_table;
   defs->mirror_syntax_table =
     XCHAR_TABLE (Vstandard_syntax_table)->mirror_table;
-  defs->modeline_format = build_string ("%-");  /* reset in loaddefs.el */
+  defs->modeline_format = build_ascstring ("%-");  /* reset in loaddefs.el */
   defs->case_fold_search = Qt;
   defs->selective_display_ellipses = Qt;
   defs->tab_width = make_int (8);
@@ -2934,7 +2936,7 @@
 	stderr_out ("`getcwd' failed: %s: changing default directory to %s\n",
                     errmess, DEFAULT_DIRECTORY_FALLBACK);
 
-        if (qxe_chdir ((Ibyte *)DEFAULT_DIRECTORY_FALLBACK) < 0)
+        if (qxe_chdir ((Ibyte *) DEFAULT_DIRECTORY_FALLBACK) < 0)
           {
             GET_STRERROR (errmess, errno);
 
@@ -2963,7 +2965,7 @@
 #ifdef WIN32_NATIVE
   {
     Ibyte *newinit = mswindows_canonicalize_filename (initial_directory);
-    xfree (initial_directory, Ibyte *);
+    xfree (initial_directory);
     initial_directory = newinit;
   }
 
@@ -2981,7 +2983,7 @@
     XECOPY_TCHAR (p, '\0');
   
     qxeSetCurrentDirectory (modname);
-    xfree (modname, Extbyte *);
+    xfree (modname);
   }
 #endif
 }
@@ -2998,7 +3000,7 @@
   /* This function can GC */
   Fset_buffer (Fget_buffer (QSscratch));
 
-  current_buffer->directory = build_intstring (initial_directory);
+  current_buffer->directory = build_istring (initial_directory);
 
 #if 0 /* FSFmacs */
   /* #### is this correct? */
--- a/src/buffer.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/buffer.h	Wed Feb 24 01:58:04 2010 -0600
@@ -543,7 +543,7 @@
 
 DECLARE_INLINE_HEADER (
 Bytebpos
-prev_bytebpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf), Bytebpos x)
+prev_bytebpos (struct buffer *buf, Bytebpos x)
 )
 {
   DEC_BYTEBPOS (buf, x);
@@ -552,7 +552,7 @@
 
 DECLARE_INLINE_HEADER (
 Bytebpos
-next_bytebpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf), Bytebpos x)
+next_bytebpos (struct buffer *buf, Bytebpos x)
 )
 {
   INC_BYTEBPOS (buf, x);
@@ -587,8 +587,7 @@
 
 DECLARE_INLINE_HEADER (
 Bytebpos
-charbpos_to_bytebpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf),
-		      Charbpos x)
+charbpos_to_bytebpos (struct buffer *buf, Charbpos x)
 )
 {
   Bytebpos retval;
@@ -620,8 +619,7 @@
 
 DECLARE_INLINE_HEADER (
 Charbpos
-bytebpos_to_charbpos (struct buffer *USED_IF_MULE_OR_CHECK_TEXT (buf),
-		      Bytebpos x)
+bytebpos_to_charbpos (struct buffer *buf, Bytebpos x)
 )
 {
   Charbpos retval;
@@ -1151,7 +1149,7 @@
 #define BUFFER_REALLOC(data,size)\
 	((Ibyte *) xrealloc (data, (size) * sizeof(Ibyte)))
 /* Avoid excess parentheses, or syntax errors may rear their heads. */
-#define BUFFER_FREE(data) xfree (data, Ibyte *)
+#define BUFFER_FREE(data) xfree (data)
 #define R_ALLOC_DECLARE(var,data)
 
 #endif /* !REL_ALLOC */
@@ -1190,7 +1188,10 @@
 BUFFER_CASE_TABLE (struct buffer *buf)
 )
 {
-  return buf ? buf->case_table : Vstandard_case_table;
+  return buf ? buf->case_table : current_buffer->case_table;
+  /* When buf=0, was Vstandard_case_table, but this sucks.  If I set a
+     different case table in this buffer, operations that use a case table
+     by default should use the current one. */
 }
 
 /* Macros used below. */
@@ -1198,6 +1199,8 @@
   TRT_TABLE_OF (XCASE_TABLE_DOWNCASE (BUFFER_CASE_TABLE (buf)), c)
 #define UPCASE_TABLE_OF(buf, c)		\
   TRT_TABLE_OF (XCASE_TABLE_UPCASE (BUFFER_CASE_TABLE (buf)), c)
+#define CANON_TABLE_OF(buf, c)	\
+  TRT_TABLE_OF (XCASE_TABLE_CANON (BUFFER_CASE_TABLE (buf)), c)
 
 /* 1 if CH is upper case.  */
 
@@ -1248,4 +1251,9 @@
 
 #define DOWNCASE(buf, ch) DOWNCASE_TABLE_OF (buf, ch)
 
+/* Convert a character to a canonical representation, so that case-independent
+   comparisons will work. */
+
+#define CANONCASE(buf, ch) CANON_TABLE_OF (buf, ch)
+
 #endif /* INCLUDED_buffer_h_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/bytecode-ops.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,185 @@
+/* Execution of byte code produced by bytecomp.el.
+   Implementation of compiled-function objects.
+   Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2002, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Mule 2.0, FSF 19.30. */
+
+/* There is more than one place in bytecode.c that may want to do something
+   with the list of all the opcodes.  To handle this, we extract them into
+   a separate file that can get included after defining OPCODE(sym, val)
+   appropriately.  No need to undefine OPCODE; that happens automatically.
+*/
+
+  OPCODE (varref,  			010)
+  OPCODE (varset,  			020)
+  OPCODE (varbind, 			030)
+  OPCODE (call,    			040)
+  OPCODE (unbind,  			050)
+
+  OPCODE (nth,     			070)
+  OPCODE (symbolp, 			071)
+  OPCODE (consp,   			072)
+  OPCODE (stringp, 			073)
+  OPCODE (listp,   			074)
+  OPCODE (old_eq,  			075)
+  OPCODE (old_memq, 			076)
+  OPCODE (not,    			077)
+  OPCODE (car,    			0100)
+  OPCODE (cdr, 	  			0101)
+  OPCODE (cons,   			0102)
+  OPCODE (list1,  			0103)
+  OPCODE (list2,  			0104)
+  OPCODE (list3,  			0105)
+  OPCODE (list4,  			0106)
+  OPCODE (length, 			0107)
+  OPCODE (aref,   			0110)
+  OPCODE (aset,   			0111)
+  OPCODE (symbol_value, 		0112)
+  OPCODE (symbol_function, 		0113)
+  OPCODE (set,    			0114)
+  OPCODE (fset,   			0115)
+  OPCODE (get,    			0116)
+  OPCODE (substring, 			0117)
+  OPCODE (concat2, 			0120)
+  OPCODE (concat3, 			0121)
+  OPCODE (concat4, 			0122)
+  OPCODE (sub1, 			0123)
+  OPCODE (add1, 			0124)
+  OPCODE (eqlsign, 			0125)
+  OPCODE (gtr, 				0126)
+  OPCODE (lss, 				0127)
+  OPCODE (leq, 				0130)
+  OPCODE (geq, 				0131)
+  OPCODE (diff, 			0132)
+  OPCODE (negate, 			0133)
+  OPCODE (plus, 			0134)
+  OPCODE (max, 				0135)
+  OPCODE (min, 				0136)
+  OPCODE (mult, 			0137)
+
+  OPCODE (point, 			0140)
+  OPCODE (eq, 				0141) /* was Bmark, but no longer
+						 generated as of v18 */
+  OPCODE (goto_char, 			0142)
+  OPCODE (insert, 			0143)
+  OPCODE (point_max, 			0144)
+  OPCODE (point_min, 			0145)
+  OPCODE (char_after, 			0146)
+  OPCODE (following_char, 		0147)
+  OPCODE (preceding_char, 		0150)
+  OPCODE (current_column, 		0151)
+  OPCODE (indent_to, 			0152)
+  OPCODE (equal, 			0153) /* was Bscan_buffer, but no
+						 longer generated as of
+						 v18 */
+  OPCODE (eolp, 			0154)
+  OPCODE (eobp, 			0155)
+  OPCODE (bolp, 			0156)
+  OPCODE (bobp, 			0157)
+  OPCODE (current_buffer, 		0160)
+  OPCODE (set_buffer, 			0161)
+  OPCODE (save_current_buffer, 		0162) /* was Bread_char, but no
+						 longer generated as of
+						 v19 */
+  OPCODE (memq, 			0163) /* was Bset_mark, but no
+						 longer generated as of
+						 v18 */
+  OPCODE (interactive_p, 		0164) /* Needed since interactive-p
+						 takes unevalled args */
+  OPCODE (forward_char, 		0165)
+  OPCODE (forward_word, 		0166)
+  OPCODE (skip_chars_forward, 		0167)
+  OPCODE (skip_chars_backward, 		0170)
+  OPCODE (forward_line, 		0171)
+  OPCODE (char_syntax, 			0172)
+  OPCODE (buffer_substring, 		0173)
+  OPCODE (delete_region, 		0174)
+  OPCODE (narrow_to_region, 		0175)
+  OPCODE (widen, 			0176)
+  OPCODE (end_of_line, 			0177)
+
+  OPCODE (constant2, 			0201)
+  OPCODE (goto, 			0202)
+  OPCODE (gotoifnil, 			0203)
+  OPCODE (gotoifnonnil, 		0204)
+  OPCODE (gotoifnilelsepop, 		0205)
+  OPCODE (gotoifnonnilelsepop, 		0206)
+  OPCODE (return, 			0207)
+  OPCODE (discard, 			0210)
+  OPCODE (dup, 				0211)
+
+  OPCODE (save_excursion, 		0212)
+  OPCODE (save_window_excursion,	0213)
+  OPCODE (save_restriction, 		0214)
+  OPCODE (catch, 			0215)
+
+  OPCODE (unwind_protect, 		0216)
+  OPCODE (condition_case, 		0217)
+  OPCODE (temp_output_buffer_setup, 	0220)
+  OPCODE (temp_output_buffer_show,  	0221)
+
+  OPCODE (unbind_all,			0222)
+
+  OPCODE (set_marker,			0223)
+  OPCODE (match_beginning,		0224)
+  OPCODE (match_end,			0225)
+  OPCODE (upcase,			0226)
+  OPCODE (downcase,			0227)
+
+  OPCODE (string_equal, 		0230)
+  OPCODE (string_lessp,     		0231)
+  OPCODE (old_equal, 	 		0232)
+  OPCODE (nthcdr, 	 		0233)
+  OPCODE (elt, 		 		0234)
+  OPCODE (old_member, 	 		0235)
+  OPCODE (old_assq, 	 		0236)
+  OPCODE (nreverse, 	 		0237)
+  OPCODE (setcar, 	 		0240)
+  OPCODE (setcdr, 	 		0241)
+  OPCODE (car_safe, 	 		0242)
+  OPCODE (cdr_safe, 	 		0243)
+  OPCODE (nconc, 	 		0244)
+  OPCODE (quo, 		 		0245)
+  OPCODE (rem, 		 		0246)
+  OPCODE (numberp, 	 		0247)
+  OPCODE (fixnump, 	 		0250) /* Was Bintegerp. */
+
+  OPCODE (Rgoto, 			0252)
+  OPCODE (Rgotoifnil, 			0253)
+  OPCODE (Rgotoifnonnil, 		0254)
+  OPCODE (Rgotoifnilelsepop, 		0255)
+  OPCODE (Rgotoifnonnilelsepop, 	0256)
+
+  OPCODE (listN, 			0257)
+  OPCODE (concatN, 			0260)
+  OPCODE (insertN, 			0261)
+
+  OPCODE (bind_multiple_value_limits,   0262) /* New in 21.5. */
+  OPCODE (multiple_value_list_internal, 0263) /* New in 21.5. */
+  OPCODE (multiple_value_call,          0264) /* New in 21.5. */
+  OPCODE (throw,                        0265) /* New in 21.5. */
+
+  OPCODE (member, 			0266) /* new in v20 */
+  OPCODE (assq, 			0267) /* new in v20 */
+
+  OPCODE (constant,			0300)
+
+#undef OPCODE
--- a/src/bytecode.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/bytecode.c	Wed Feb 24 01:58:04 2010 -0600
@@ -58,6 +58,8 @@
 #include "syntax.h"
 #include "window.h"
 
+#define NUM_REMEMBERED_BYTE_OPS 100
+
 #ifdef NEW_GC
 static Lisp_Object
 make_compiled_function_args (int totalargs)
@@ -100,169 +102,110 @@
 
 Lisp_Object Qbyte_code, Qcompiled_functionp, Qinvalid_byte_code;
 
+
 enum Opcode /* Byte codes */
 {
-  Bvarref  		= 010,
-  Bvarset  		= 020,
-  Bvarbind 		= 030,
-  Bcall    		= 040,
-  Bunbind  		= 050,
-
-  Bnth     		= 070,
-  Bsymbolp 		= 071,
-  Bconsp   		= 072,
-  Bstringp 		= 073,
-  Blistp   		= 074,
-  Bold_eq  		= 075,
-  Bold_memq 		= 076,
-  Bnot    		= 077,
-  Bcar    		= 0100,
-  Bcdr 	  		= 0101,
-  Bcons   		= 0102,
-  Blist1  		= 0103,
-  Blist2  		= 0104,
-  Blist3  		= 0105,
-  Blist4  		= 0106,
-  Blength 		= 0107,
-  Baref   		= 0110,
-  Baset   		= 0111,
-  Bsymbol_value 	= 0112,
-  Bsymbol_function 	= 0113,
-  Bset    		= 0114,
-  Bfset   		= 0115,
-  Bget    		= 0116,
-  Bsubstring 		= 0117,
-  Bconcat2 		= 0120,
-  Bconcat3 		= 0121,
-  Bconcat4 		= 0122,
-  Bsub1 		= 0123,
-  Badd1 		= 0124,
-  Beqlsign 		= 0125,
-  Bgtr 			= 0126,
-  Blss 			= 0127,
-  Bleq 			= 0130,
-  Bgeq 			= 0131,
-  Bdiff 		= 0132,
-  Bnegate 		= 0133,
-  Bplus 		= 0134,
-  Bmax 			= 0135,
-  Bmin 			= 0136,
-  Bmult 		= 0137,
-
-  Bpoint 		= 0140,
-  Beq 			= 0141, /* was Bmark,
-				   but no longer generated as of v18 */
-  Bgoto_char 		= 0142,
-  Binsert 		= 0143,
-  Bpoint_max 		= 0144,
-  Bpoint_min 		= 0145,
-  Bchar_after 		= 0146,
-  Bfollowing_char 	= 0147,
-  Bpreceding_char 	= 0150,
-  Bcurrent_column 	= 0151,
-  Bindent_to 		= 0152,
-  Bequal 		= 0153, /* was Bscan_buffer,
-				   but no longer generated as of v18 */
-  Beolp 		= 0154,
-  Beobp 		= 0155,
-  Bbolp 		= 0156,
-  Bbobp 		= 0157,
-  Bcurrent_buffer 	= 0160,
-  Bset_buffer 		= 0161,
-  Bsave_current_buffer 	= 0162, /* was Bread_char,
-				   but no longer generated as of v19 */
-  Bmemq 		= 0163, /* was Bset_mark,
-				   but no longer generated as of v18 */
-  Binteractive_p 	= 0164, /* Needed since interactive-p takes
-				   unevalled args */
-  Bforward_char 	= 0165,
-  Bforward_word 	= 0166,
-  Bskip_chars_forward 	= 0167,
-  Bskip_chars_backward 	= 0170,
-  Bforward_line 	= 0171,
-  Bchar_syntax 		= 0172,
-  Bbuffer_substring 	= 0173,
-  Bdelete_region 	= 0174,
-  Bnarrow_to_region 	= 0175,
-  Bwiden 		= 0176,
-  Bend_of_line 		= 0177,
-
-  Bconstant2 		= 0201,
-  Bgoto 		= 0202,
-  Bgotoifnil 		= 0203,
-  Bgotoifnonnil 	= 0204,
-  Bgotoifnilelsepop 	= 0205,
-  Bgotoifnonnilelsepop 	= 0206,
-  Breturn 		= 0207,
-  Bdiscard 		= 0210,
-  Bdup 			= 0211,
-
-  Bsave_excursion 	= 0212,
-  Bsave_window_excursion= 0213,
-  Bsave_restriction 	= 0214,
-  Bcatch 		= 0215,
-
-  Bunwind_protect 	= 0216,
-  Bcondition_case 	= 0217,
-  Btemp_output_buffer_setup = 0220,
-  Btemp_output_buffer_show  = 0221,
-
-  Bunbind_all 		= 0222,
-
-  Bset_marker 		= 0223,
-  Bmatch_beginning 	= 0224,
-  Bmatch_end 		= 0225,
-  Bupcase 		= 0226,
-  Bdowncase 		= 0227,
-
-  Bstring_equal 	= 0230,
-  Bstring_lessp     	= 0231,
-  Bold_equal 	 	= 0232,
-  Bnthcdr 	 	= 0233,
-  Belt 		 	= 0234,
-  Bold_member 	 	= 0235,
-  Bold_assq 	 	= 0236,
-  Bnreverse 	 	= 0237,
-  Bsetcar 	 	= 0240,
-  Bsetcdr 	 	= 0241,
-  Bcar_safe 	 	= 0242,
-  Bcdr_safe 	 	= 0243,
-  Bnconc 	 	= 0244,
-  Bquo 		 	= 0245,
-  Brem 		 	= 0246,
-  Bnumberp 	 	= 0247,
-  Bintegerp 	 	= 0250,
-
-  BRgoto 		= 0252,
-  BRgotoifnil 		= 0253,
-  BRgotoifnonnil 	= 0254,
-  BRgotoifnilelsepop 	= 0255,
-  BRgotoifnonnilelsepop = 0256,
-
-  BlistN 		= 0257,
-  BconcatN 		= 0260,
-  BinsertN 		= 0261,
-
-  Bbind_multiple_value_limits   = 0262,         /* New in 21.5. */
-  Bmultiple_value_list_internal = 0263,         /* New in 21.5. */
-  Bmultiple_value_call          = 0264,         /* New in 21.5. */
-  Bthrow                        = 0265,         /* New in 21.5. */
-
-  Bmember 		= 0266, /* new in v20 */
-  Bassq 		= 0267, /* new in v20 */
-
-  Bconstant 		= 0300
+#define OPCODE(sym, val) B##sym = val,
+#include "bytecode-ops.h"
 };
 typedef enum Opcode Opcode;
-
 
 Lisp_Object * execute_rare_opcode (Lisp_Object *stack_ptr,
+#ifdef ERROR_CHECK_BYTE_CODE
+				   Lisp_Object *stack_beg,
+				   Lisp_Object *stack_end,
+#endif /* ERROR_CHECK_BYTE_CODE */
 				   const Opbyte *program_ptr,
 				   Opcode opcode);
 
-/* Define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
-   This isn't defined in FSF Emacs and isn't defined in XEmacs v19. */
-/* #define BYTE_CODE_METER */
+#ifndef ERROR_CHECK_BYTE_CODE
+
+/* Normally we would use `x' instead of `0' in the argument list, to avoid
+   problems if `x' (an expression) has side effects, and warnings if `x'
+   contains variables or parameters that are otherwise unused.  But in
+   this case `x' contains references to vars and params that exist only
+   when ERROR_CHECK_BYTE_CODE, and leaving in `x' would result in compile
+   errors. */
+# define bytecode_assert(x) disabled_assert (0)
+# define bytecode_assert_with_message(x, msg) disabled_assert(0)
+# define bytecode_abort_with_message(msg) abort_with_message (msg)
+
+#else /* ERROR_CHECK_BYTE_CODE */
+
+# define bytecode_assert(x) \
+  ((x) ? (void) 0 : assert_failed_with_remembered_ops (__FILE__, __LINE__, #x))
+# define bytecode_assert_with_message(x, msg) \
+  ((x) ? (void) 0 : assert_failed_with_remembered_ops (__FILE__, __LINE__, msg))
+# define bytecode_abort_with_message(msg) \
+  assert_failed_with_remembered_ops (__FILE__, __LINE__, msg)
+
+/* Table mapping opcodes to their names.  This handles opcodes like
+   Bvarref+7, but it doesn't list any of the Bconstant+N opcodes; those
+   are handled specially. */
+Ascbyte *opcode_name_table[256];
+
+/* Circular queue remembering the most recent operations. */
+Opcode remembered_ops[NUM_REMEMBERED_BYTE_OPS];
+int remembered_op_next_pos, num_remembered;
+
+static void
+remember_operation (Opcode op)
+{
+  remembered_ops[remembered_op_next_pos] = op;
+  remembered_op_next_pos =
+    (remembered_op_next_pos + 1) % NUM_REMEMBERED_BYTE_OPS;
+  if (num_remembered < NUM_REMEMBERED_BYTE_OPS)
+    num_remembered++;
+}
+
+static void
+assert_failed_with_remembered_ops (const Ascbyte *file, int line,
+				   const Ascbyte *msg_to_abort_with)
+{
+  Ascbyte *msg =
+    alloca_array (Ascbyte,
+		  NUM_REMEMBERED_BYTE_OPS*50 + strlen (msg_to_abort_with));
+  int i;
+
+  if (msg_to_abort_with)
+    strcpy (msg, msg_to_abort_with);
+  strcat (msg, "\n\nRecent bytecodes, oldest first:\n\n");
+
+  for (i = 0; i < num_remembered; i++)
+    {
+      Ascbyte msg2[50];
+      int pos;
+      Opcode op;
+
+      sprintf (msg2, "%5d:  ", i - num_remembered + 1);
+      strcat (msg, msg2);
+      pos = (remembered_op_next_pos + NUM_REMEMBERED_BYTE_OPS +
+	     i - num_remembered) % NUM_REMEMBERED_BYTE_OPS;
+      op = remembered_ops[pos];
+      if (op >= Bconstant)
+	{
+	  sprintf (msg2, "constant+%d", op - Bconstant);
+	  strcat (msg, msg2);
+	}
+      else
+	{
+	  const Ascbyte *opname = opcode_name_table[op];
+	  if (!opname)
+	    {
+	      stderr_out ("Internal error! NULL pointer in opcode_name_table, opcode %d\n", op);
+	      strcat (msg, "NULL");
+	    }
+	  else
+	    strcat (msg, opname);
+	}
+      sprintf (msg2, " (%d)\n", op);
+      strcat (msg, msg2);
+    }
+
+  assert_failed (file, line, msg);
+}
+
+#endif /* ERROR_CHECK_BYTE_CODE */
 
 
 #ifdef BYTE_CODE_METER
@@ -329,7 +272,7 @@
 
 /* We have our own two-argument versions of various arithmetic ops.
    Only two-argument arithmetic operations have their own byte codes. */
-static int
+int
 bytecode_arithcompare (Lisp_Object obj1, Lisp_Object obj2)
 {
 #ifdef WITH_NUMBER_TYPES
@@ -618,72 +561,127 @@
 }
 
 
+
+/*********************** The instruction array *********************/
+
+/* Check that there are at least LEN elements left in the end of the
+   instruction array before fetching them.  Note that we allow for
+   PROGRAM_PTR == PROGRAM_END after the fetch -- that means there are
+   no more elements to fetch next time around, but we might exit before
+   next time comes.
+
+   When checking the destination if jumps, however, we don't allow
+   PROGRAM_PTR to equal PROGRAM_END, since we will always be fetching
+   another instruction after the jump. */
+
+#define CHECK_OPCODE_SPACE(len) \
+  bytecode_assert (program_ptr + len <= program_end)
+
 /* Read next uint8 from the instruction stream. */
-#define READ_UINT_1 ((unsigned int) (unsigned char) *program_ptr++)
+#define READ_UINT_1 \
+  (CHECK_OPCODE_SPACE (1), (unsigned int) (unsigned char) *program_ptr++)
 
 /* Read next uint16 from the instruction stream. */
 #define READ_UINT_2						\
-  (program_ptr += 2,						\
+  (CHECK_OPCODE_SPACE (2),					\
+   program_ptr += 2,						\
    (((unsigned int) (unsigned char) program_ptr[-1]) * 256 +	\
     ((unsigned int) (unsigned char) program_ptr[-2])))
 
 /* Read next int8 from the instruction stream. */
-#define READ_INT_1 ((int) (signed char) *program_ptr++)
+#define READ_INT_1 \
+  (CHECK_OPCODE_SPACE (1), (int) (signed char) *program_ptr++)
 
 /* Read next int16 from the instruction stream. */
 #define READ_INT_2					\
-  (program_ptr += 2,					\
+  (CHECK_OPCODE_SPACE (2),				\
+   program_ptr += 2,					\
    (((int) (  signed char) program_ptr[-1]) * 256 +	\
     ((int) (unsigned char) program_ptr[-2])))
 
 /* Read next int8 from instruction stream; don't advance program_pointer */
-#define PEEK_INT_1 ((int) (signed char) program_ptr[0])
+#define PEEK_INT_1 \
+  (CHECK_OPCODE_SPACE (1), (int) (signed char) program_ptr[0])
 
 /* Read next int16 from instruction stream; don't advance program_pointer */
 #define PEEK_INT_2					\
-  ((((int) (  signed char) program_ptr[1]) * 256) |	\
+  (CHECK_OPCODE_SPACE (2),				\
+   (((int) (  signed char) program_ptr[1]) * 256) |	\
     ((int) (unsigned char) program_ptr[0]))
 
 /* Do relative jumps from the current location.
    We only do a QUIT if we jump backwards, for efficiency.
    No infloops without backward jumps! */
-#define JUMP_RELATIVE(jump) do {	\
-  int JR_jump = (jump);			\
-  if (JR_jump < 0) QUIT;		\
-  program_ptr += JR_jump;		\
+#define JUMP_RELATIVE(jump) do {					\
+  int _JR_jump = (jump);						\
+  if (_JR_jump < 0) QUIT;						\
+  /* Check that where we're going to is in range.  Note that we don't use \
+     CHECK_OPCODE_SPACE() -- that only checks the end, and it allows	\
+     program_ptr == program_end, which we don't allow. */		\
+  bytecode_assert (program_ptr + _JR_jump >= program &&			\
+		   program_ptr + _JR_jump < program_end);		\
+  program_ptr += _JR_jump;						\
 } while (0)
 
 #define JUMP  JUMP_RELATIVE (PEEK_INT_2)
 #define JUMPR JUMP_RELATIVE (PEEK_INT_1)
 
-#define JUMP_NEXT  ((void) (program_ptr += 2))
-#define JUMPR_NEXT ((void) (program_ptr += 1))
+#define JUMP_NEXT  (CHECK_OPCODE_SPACE (2), (void) (program_ptr += 2))
+#define JUMPR_NEXT (CHECK_OPCODE_SPACE (1), (void) (program_ptr += 1))
+
+/*********************** The stack array *********************/
+
+/* NOTE: The stack array doesn't work quite like you'd expect.
+
+   STACK_PTR points to the value on the top of the stack.  Popping a value
+   fetches the value from the STACK_PTR and then decrements it.  Pushing a
+   value first increments it, then writes the new value.  STACK_PTR -
+   STACK_BEG is the number of elements on the stack.
+
+   This means that when STACK_PTR == STACK_BEG, the stack is empty, and
+   the space at STACK_BEG is never written to -- the first push will write
+   into the space directly after STACK_BEG.  This is why the call to
+   alloca_array() below has a count of `stack_depth + 1', and why
+   we GCPRO1 (stack_ptr[1]) -- the value at stack_ptr[0] is unused and
+   uninitialized.
+
+   Also, STACK_END actually points to the last usable storage location,
+   and does not point past the end, like you'd expect. */
+
+#define CHECK_STACKPTR_OFFSET(len) \
+  bytecode_assert (stack_ptr + (len) >= stack_beg && \
+                   stack_ptr + (len) <= stack_end)
 
 /* Push x onto the execution stack. */
-#define PUSH(x) (*++stack_ptr = (x))
+#define PUSH(x) (CHECK_STACKPTR_OFFSET (1), *++stack_ptr = (x))
 
 /* Pop a value, which may be multiple, off the execution stack. */
-#define POP_WITH_MULTIPLE_VALUES (*stack_ptr--)
+#define POP_WITH_MULTIPLE_VALUES (CHECK_STACKPTR_OFFSET (-1), *stack_ptr--)
 
 /* Pop a value off the execution stack, treating multiple values as single. */
 #define POP (IGNORE_MULTIPLE_VALUES (POP_WITH_MULTIPLE_VALUES))
 
-#define DISCARD_PRESERVING_MULTIPLE_VALUES(n) (stack_ptr -= (n))
+/* ..._UNSAFE() means it evaluates its argument more than once. */
+#define DISCARD_PRESERVING_MULTIPLE_VALUES_UNSAFE(n) \
+  (CHECK_STACKPTR_OFFSET (-(n)), stack_ptr -= (n))
 
 /* Discard n values from the execution stack.  */
 #define DISCARD(n) do {                                         \
+    int _discard_n = (n);					\
     if (1 != multiple_value_current_limit)                      \
       {                                                         \
-        int i, en = n;                                          \
-        for (i = 0; i < en; i++)                                \
+        int i;							\
+        for (i = 0; i < _discard_n; i++)			\
           {                                                     \
+	    CHECK_STACKPTR_OFFSET (-1);				\
             *stack_ptr = ignore_multiple_values (*stack_ptr);   \
             stack_ptr--;                                        \
           }                                                     \
       }                                                         \
     else                                                        \
       {                                                         \
-        stack_ptr -= (n);                                       \
+	CHECK_STACKPTR_OFFSET (-_discard_n);			\
+        stack_ptr -= _discard_n;				\
       }                                                         \
   } while (0)
 
@@ -704,6 +702,7 @@
 /* See comment before the big switch in execute_optimized_program(). */
 #define GCPRO_STACK  (gcpro1.nvars = stack_ptr - stack_beg)
 
+
 /* The actual interpreter for byte code.
    This function has been seriously optimized for performance.
    Don't change the constructs unless you are willing to do
@@ -712,18 +711,25 @@
 
 Lisp_Object
 execute_optimized_program (const Opbyte *program,
+#ifdef ERROR_CHECK_BYTE_CODE
+			   Elemcount program_length,
+#endif
 			   int stack_depth,
 			   Lisp_Object *constants_data)
 {
   /* This function can GC */
   REGISTER const Opbyte *program_ptr = (Opbyte *) program;
+#ifdef ERROR_CHECK_BYTE_CODE
+  const Opbyte *program_end = program_ptr + program_length;
+#endif
+  /* See comment above explaining the `+ 1' */
   Lisp_Object *stack_beg = alloca_array (Lisp_Object, stack_depth + 1);
   REGISTER Lisp_Object *stack_ptr = stack_beg;
   int speccount = specpdl_depth ();
   struct gcpro gcpro1;
 
 #ifdef BYTE_CODE_METER
-  Opcode this_opcode = 0;
+  Opcode this_opcode = (Opcode) 0;
   Opcode prev_opcode;
 #endif
 
@@ -758,13 +764,22 @@
      return from the interpreter do we need to finalize the struct gcpro
      itself, and that's done at case Breturn.
   */
+
+  /* See comment above explaining the `[1]' */
   GCPRO1 (stack_ptr[1]);
 
   while (1)
     {
       REGISTER Opcode opcode = (Opcode) READ_UINT_1;
 
+#ifdef ERROR_CHECK_BYTE_CODE
+      remember_operation (opcode);
+#endif
+
       GCPRO_STACK;		/* Get nvars right before maybe signaling. */
+      /* #### NOTE: This code should probably never get triggered, since we
+	 now catch the problems earlier, farther down, before we ever set
+	 a bad value for STACK_PTR. */
 #ifdef ERROR_CHECK_BYTE_CODE
       if (stack_ptr > stack_end)
 	stack_overflow ("byte code stack overflow", Qunbound);
@@ -789,7 +804,13 @@
 	    {
 	      /* We're not sure what these do, so better safe than sorry. */
 	      /* GCPRO_STACK; */
-	      stack_ptr = execute_rare_opcode (stack_ptr, program_ptr, opcode);
+	      stack_ptr = execute_rare_opcode (stack_ptr,
+#ifdef ERROR_CHECK_BYTE_CODE
+					       stack_beg,
+					       stack_end,
+#endif /* ERROR_CHECK_BYTE_CODE */
+					       program_ptr, opcode);
+	      CHECK_STACKPTR_OFFSET (0);
 	    }
 	  break;
 
@@ -1075,12 +1096,8 @@
 #endif
 	  break;
 
-	case Bintegerp:
-#ifdef HAVE_BIGNUM
-	  TOP_LVALUE = INTEGERP (TOP) ? Qt : Qnil;
-#else
+	case Bfixnump:
 	  TOP_LVALUE = INTP (TOP) ? Qt : Qnil;
-#endif
 	  break;
 
 	case Beq:
@@ -1441,6 +1458,10 @@
    Don't make this function static, since then the compiler might inline it. */
 Lisp_Object *
 execute_rare_opcode (Lisp_Object *stack_ptr,
+#ifdef ERROR_CHECK_BYTE_CODE
+		     Lisp_Object *stack_beg,
+		     Lisp_Object *stack_end,
+#endif /* ERROR_CHECK_BYTE_CODE */
 		     const Opbyte *UNUSED (program_ptr),
 		     Opcode opcode)
 {
@@ -1448,7 +1469,7 @@
 
   switch (opcode)
     {
-
+      
     case Bsave_excursion:
       record_unwind_protect (save_excursion_restore,
 			     save_excursion_save ());
@@ -1717,7 +1738,7 @@
     case Bmultiple_value_call:
       {
         n = XINT (POP);
-        DISCARD_PRESERVING_MULTIPLE_VALUES (n - 1);
+        DISCARD_PRESERVING_MULTIPLE_VALUES_UNSAFE (n - 1);
         /* Discard multiple values for the first (function) argument: */
         TOP_LVALUE = TOP;
         TOP_LVALUE = multiple_value_call (n, TOP_ADDRESS);
@@ -1726,7 +1747,7 @@
 
     case Bmultiple_value_list_internal:
       {
-        DISCARD_PRESERVING_MULTIPLE_VALUES (3);
+        DISCARD_PRESERVING_MULTIPLE_VALUES_UNSAFE (3);
         TOP_LVALUE = multiple_value_list_internal (4, TOP_ADDRESS);
         break;
       }
@@ -1741,7 +1762,11 @@
       }
 
     default:
-      ABORT();
+      {
+	Ascbyte msg[100];
+	sprintf (msg, "Unknown opcode %d", opcode);
+	bytecode_abort_with_message (msg);
+      }
       break;
     }
   return stack_ptr;
@@ -1749,7 +1774,7 @@
 
 
 DOESNT_RETURN
-invalid_byte_code (const CIbyte *reason, Lisp_Object frob)
+invalid_byte_code (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qinvalid_byte_code, reason, frob);
 }
@@ -1865,8 +1890,8 @@
 		    Lisp_Object constants,
 		    /* out */
 		    Opbyte * const program,
-		    int * const program_length,
-		    int * const varbind_count)
+		    Elemcount * const program_length,
+		    Elemcount * const varbind_count)
 {
   Bytecount instructions_length = XSTRING_LENGTH (instructions);
   Elemcount comfy_size = (Elemcount) (2 * instructions_length);
@@ -2130,8 +2155,8 @@
 optimize_compiled_function (Lisp_Object compiled_function)
 {
   Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (compiled_function);
-  int program_length;
-  int varbind_count;
+  Elemcount program_length;
+  Elemcount varbind_count;
   Opbyte *program;
 
   {
@@ -2221,7 +2246,7 @@
   struct gcpro gcpro1, gcpro2;
   GCPRO2 (obj, printcharfun);
 
-  write_c_string (printcharfun, print_readably ? "#[" : "#<compiled-function ");
+  write_ascstring (printcharfun, print_readably ? "#[" : "#<compiled-function ");
 #ifdef COMPILED_FUNCTION_ANNOTATION_HACK
   if (!print_readably)
     {
@@ -2234,7 +2259,7 @@
   print_internal (compiled_function_arglist (f), printcharfun, escapeflag);
 
   /* COMPILED_INSTRUCTIONS = 1 */
-  write_c_string (printcharfun, " ");
+  write_ascstring (printcharfun, " ");
   {
     struct gcpro ngcpro1;
     Lisp_Object instructions = compiled_function_instructions (f);
@@ -2251,7 +2276,7 @@
   }
 
   /* COMPILED_CONSTANTS = 2 */
-  write_c_string (printcharfun, " ");
+  write_ascstring (printcharfun, " ");
   print_internal (compiled_function_constants (f), printcharfun, escapeflag);
 
   /* COMPILED_STACK_DEPTH = 3 */
@@ -2260,7 +2285,7 @@
   /* COMPILED_DOC_STRING = 4 */
   if (docp || intp)
     {
-      write_c_string (printcharfun, " ");
+      write_ascstring (printcharfun, " ");
       print_internal (compiled_function_documentation (f), printcharfun,
 		      escapeflag);
     }
@@ -2268,13 +2293,13 @@
   /* COMPILED_INTERACTIVE = 5 */
   if (intp)
     {
-      write_c_string (printcharfun, " ");
+      write_ascstring (printcharfun, " ");
       print_internal (compiled_function_interactive (f), printcharfun,
 		      escapeflag);
     }
 
   UNGCPRO;
-  write_c_string (printcharfun, print_readably ? "]" : ">");
+  write_ascstring (printcharfun, print_readably ? "]" : ">");
 }
 
 
@@ -2302,7 +2327,8 @@
 }
 
 static int
-compiled_function_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+compiled_function_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+			 int UNUSED (foldcase))
 {
   Lisp_Compiled_Function *f1 = XCOMPILED_FUNCTION (obj1);
   Lisp_Compiled_Function *f2 = XCOMPILED_FUNCTION (obj2);
@@ -2701,8 +2727,8 @@
        (instructions, constants, stack_depth))
 {
   /* This function can GC */
-  int varbind_count;
-  int program_length;
+  Elemcount varbind_count;
+  Elemcount program_length;
   Opbyte *program;
 
   CHECK_STRING (instructions);
@@ -2717,6 +2743,9 @@
 		      &program_length, &varbind_count);
   SPECPDL_RESERVE (varbind_count);
   return execute_optimized_program (program,
+#ifdef ERROR_CHECK_BYTE_CODE
+				    program_length,
+#endif
 				    XINT (stack_depth),
 				    XVECTOR_DATA (constants));
 }
@@ -2759,7 +2788,6 @@
 vars_of_bytecode (void)
 {
 #ifdef BYTE_CODE_METER
-
   DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter /*
 A vector of vectors which holds a histogram of byte code usage.
 \(aref (aref byte-code-meter 0) CODE) indicates how many times the byte
@@ -2784,3 +2812,57 @@
   }
 #endif /* BYTE_CODE_METER */
 }
+
+#ifdef ERROR_CHECK_BYTE_CODE
+
+/* Initialize the opcodes in the table that correspond to a base opcode
+   plus an offset (except for Bconstant). */
+
+static void
+init_opcode_table_multi_op (Opcode op)
+{
+  const Ascbyte *basename = opcode_name_table[op];
+  Ascbyte temp[300];
+  int i;
+
+  for (i = 1; i < 7; i++)
+    {
+      assert (!opcode_name_table[op + i]);
+      sprintf (temp, "%s+%d", basename, i);
+      opcode_name_table[op + i] = xstrdup (temp);
+    }
+}
+
+#endif /* ERROR_CHECK_BYTE_CODE */
+
+void
+reinit_vars_of_bytecode (void)
+{
+#ifdef ERROR_CHECK_BYTE_CODE
+  int i;
+
+#define OPCODE(sym, val) opcode_name_table[val] = xstrdup (#sym);
+#include "bytecode-ops.h"
+
+  for (i = 0; i < countof (opcode_name_table); i++)
+    {
+      int j;
+      Ascbyte *name = opcode_name_table[i];
+      if (name)
+	{
+	  Bytecount len = strlen (name);
+	  /* Prettify the name by converting underscores to hyphens, similar
+	     to what happens with DEFSYMBOL. */
+	  for (j = 0; j < len; j++)
+	    if (name[j] == '_')
+	      name[j] = '-';
+	}
+    }
+
+  init_opcode_table_multi_op (Bvarref);
+  init_opcode_table_multi_op (Bvarset);
+  init_opcode_table_multi_op (Bvarbind);
+  init_opcode_table_multi_op (Bcall);
+  init_opcode_table_multi_op (Bunbind);
+#endif /* ERROR_CHECK_BYTE_CODE */
+}
--- a/src/bytecode.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/bytecode.h	Wed Feb 24 01:58:04 2010 -0600
@@ -67,8 +67,19 @@
 #define COMPILED_INTERACTIVE	5
 #define COMPILED_DOMAIN		6
 
-/* It doesn't make sense to have this and also have load-history */
-/* #define COMPILED_FUNCTION_ANNOTATION_HACK */
+/* Someone claims: [[ It doesn't make sense to have this and also have
+   load-history ]] But in fact they are quite different things.  Perhaps
+   we should turn this on only when DEBUG_XEMACS but there's no speed
+   harm at all, so no reason not to do it always. */
+#define COMPILED_FUNCTION_ANNOTATION_HACK
+
+#ifdef DEBUG_XEMACS
+/* Define BYTE_CODE_METER to enable generation of a byte-op usage
+   histogram.  This isn't defined in FSF Emacs and isn't defined in XEmacs
+   v19.  But this is precisely the thing to turn on when DEBUG_XEMACS.  It
+   may lead to a slight speed penalty but nothing major. */
+#define BYTE_CODE_METER
+#endif
 
 struct Lisp_Compiled_Function
 {
@@ -131,6 +142,9 @@
 
 typedef unsigned char Opbyte;
 Lisp_Object execute_optimized_program (const Opbyte *program,
+#ifdef ERROR_CHECK_BYTE_CODE
+				       Elemcount program_length,
+#endif
 				       int stack_depth,
 				       Lisp_Object *constants_data);
 
--- a/src/casefiddle.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/casefiddle.c	Wed Feb 24 01:58:04 2010 -0600
@@ -28,7 +28,8 @@
 #include "insdel.h"
 #include "syntax.h"
 
-enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP};
+enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP,
+                  CASE_CANONICALIZE};
 
 static Lisp_Object
 casify_object (enum case_action flag, Lisp_Object string_or_char,
@@ -43,7 +44,19 @@
       Ichar c;
       CHECK_CHAR_COERCE_INT (string_or_char);
       c = XCHAR (string_or_char);
-      c = (flag == CASE_DOWN) ? DOWNCASE (buf, c) : UPCASE (buf, c);
+      if (flag == CASE_DOWN)
+	{
+	  c = DOWNCASE (buf, c);
+	}
+      else if (flag == CASE_UP)
+	{
+	  c = UPCASE (buf, c);
+	}
+      else
+	{
+	  c = CANONCASE (buf, c);
+	}
+
       return make_char (c);
     }
 
@@ -68,6 +81,9 @@
 	    case CASE_DOWN:
 	      c = DOWNCASE (buf, c);
 	      break;
+	    case CASE_CANONICALIZE:
+	      c = CANONCASE (buf, c);
+	      break;
 	    case CASE_CAPITALIZE:
 	    case CASE_CAPITALIZE_UP:
 	      wordp_prev = wordp;
@@ -119,6 +135,23 @@
   return casify_object (CASE_DOWN, string_or_char, buffer);
 }
 
+DEFUN ("canoncase", Fcanoncase, 1, 2, 0, /*
+Convert STRING-OR-CHAR to its canonical lowercase form and return that.
+
+STRING-OR-CHAR may be a character or string.  The result has the same type.
+STRING-OR-CHAR is not altered--the value is a copy.
+
+Optional second arg BUFFER specifies which buffer's case tables to use,
+and defaults to the current buffer.
+
+For any N characters that are equivalent in case-insensitive searching,
+their canonical lowercase character will be the same.
+*/
+       (string_or_char, buffer))
+{
+  return casify_object (CASE_CANONICALIZE, string_or_char, buffer);
+}
+
 DEFUN ("capitalize", Fcapitalize, 1, 2, 0, /*
 Convert STRING-OR-CHAR to capitalized form and return that.
 This means that each word's first character is upper case
@@ -331,6 +364,7 @@
 {
   DEFSUBR (Fupcase);
   DEFSUBR (Fdowncase);
+  DEFSUBR (Fcanoncase);
   DEFSUBR (Fcapitalize);
   DEFSUBR (Fupcase_initials);
   DEFSUBR (Fupcase_region);
--- a/src/casetab.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/casetab.c	Wed Feb 24 01:58:04 2010 -0600
@@ -53,7 +53,7 @@
    entry; these groups are called "equivalence classes" and `eqv' lists them
    by linking the characters in each equivalence class together in a
    circular list. That is, to find out all all the members of a given char's
-   equivalence classe, you need something like the following code:
+   equivalence class, you need something like the following code:
 
     (let* ((char ?i)
            (original-char char)
@@ -105,7 +105,7 @@
 {
   Lisp_Case_Table *ct = XCASE_TABLE (obj);
   if (print_readably)
-    printing_unreadable_object ("#<case-table 0x%x>", ct->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
   write_fmt_string_lisp
     (printcharfun, "#<case-table downcase=%s upcase=%s canon=%s eqv=%s ", 4,
      CASE_TABLE_DOWNCASE (ct), CASE_TABLE_UPCASE (ct),
@@ -303,7 +303,7 @@
 compute_canon_mapper (struct chartab_range *range,
 		      Lisp_Object UNUSED (table), Lisp_Object val, void *arg)
 {
-  Lisp_Object casetab = VOID_TO_LISP (arg);
+  Lisp_Object casetab = GET_LISP_FROM_VOID (arg);
   if (range->type == CHARTAB_RANGE_CHAR)
     SET_TRT_TABLE_OF (XCASE_TABLE_CANON (casetab), range->ch,
 		      TRT_TABLE_OF (XCASE_TABLE_DOWNCASE (casetab),
@@ -318,7 +318,7 @@
 			    Lisp_Object UNUSED (table),
 			    Lisp_Object UNUSED (val), void *arg)
 {
-  Lisp_Object trt = VOID_TO_LISP (arg);
+  Lisp_Object trt = GET_LISP_FROM_VOID (arg);
   if (range->type == CHARTAB_RANGE_CHAR)
     SET_TRT_TABLE_OF (trt, range->ch, range->ch);
   
@@ -330,7 +330,7 @@
 			  Lisp_Object UNUSED (table),
 			  Lisp_Object val, void *arg)
 {
-  Lisp_Object inverse = VOID_TO_LISP (arg);
+  Lisp_Object inverse = GET_LISP_FROM_VOID (arg);
   Ichar toch = XCHAR (val);
 
   if (range->type == CHARTAB_RANGE_CHAR && range->ch != toch)
@@ -360,13 +360,13 @@
      retrieving the values below! */
   XCASE_TABLE (casetab)->dirty = 0;
   map_char_table (XCASE_TABLE_DOWNCASE (casetab), &range,
-		  compute_canon_mapper, LISP_TO_VOID (casetab));
+		  compute_canon_mapper, STORE_LISP_IN_VOID (casetab));
   map_char_table (XCASE_TABLE_CANON (casetab), &range,
 		  initialize_identity_mapper,
-		  LISP_TO_VOID (XCASE_TABLE_EQV (casetab)));
+		  STORE_LISP_IN_VOID (XCASE_TABLE_EQV (casetab)));
   map_char_table (XCASE_TABLE_CANON (casetab), &range,
 		  compute_up_or_eqv_mapper,
-		  LISP_TO_VOID (XCASE_TABLE_EQV (casetab)));
+		  STORE_LISP_IN_VOID (XCASE_TABLE_EQV (casetab)));
 }  
 
 DEFUN ("current-case-table", Fcurrent_case_table, 0, 1, 0, /*
@@ -403,24 +403,20 @@
   /* This function can GC */
   struct buffer *buf =
     standard ? XBUFFER (Vbuffer_defaults) : current_buffer;
+  Lisp_Object casetab;
 
   check_case_table (table);
 
   if (CASE_TABLEP (table))
-    {
-      if (standard)
-	Vstandard_case_table = table;
-
-      buf->case_table = table;
-    }
+    casetab = table;
   else
     {
       /* For backward compatibility. */
       Lisp_Object down, up, canon, eqv, tail = table;
-      Lisp_Object casetab =
-	standard ? Vstandard_case_table :  buf->case_table;
       struct chartab_range range;
 
+      casetab = Fmake_case_table ();
+
       range.type = CHARTAB_RANGE_ALL;
 
       Freset_char_table (XCASE_TABLE_DOWNCASE (casetab));
@@ -439,17 +435,17 @@
 	{
 	  map_char_table (XCASE_TABLE_DOWNCASE (casetab), &range,
 			  initialize_identity_mapper,
-			  LISP_TO_VOID (XCASE_TABLE_UPCASE (casetab)));
+			  STORE_LISP_IN_VOID (XCASE_TABLE_UPCASE (casetab)));
 	  map_char_table (XCASE_TABLE_DOWNCASE (casetab), &range,
 			  compute_up_or_eqv_mapper,
-			  LISP_TO_VOID (XCASE_TABLE_UPCASE (casetab)));
+			  STORE_LISP_IN_VOID (XCASE_TABLE_UPCASE (casetab)));
 	}
       else
 	convert_old_style_syntax_string (XCASE_TABLE_UPCASE (casetab), up);
 
       if (NILP (canon))
 	map_char_table (XCASE_TABLE_DOWNCASE (casetab), &range,
-			compute_canon_mapper, LISP_TO_VOID (casetab));
+			compute_canon_mapper, STORE_LISP_IN_VOID (casetab));
       else
 	convert_old_style_syntax_string (XCASE_TABLE_CANON (casetab), canon);
 
@@ -457,15 +453,21 @@
 	{
 	  map_char_table (XCASE_TABLE_CANON (casetab), &range,
 			  initialize_identity_mapper,
-			  LISP_TO_VOID (XCASE_TABLE_EQV (casetab)));
+			  STORE_LISP_IN_VOID (XCASE_TABLE_EQV (casetab)));
 	  map_char_table (XCASE_TABLE_CANON (casetab), &range,
 			  compute_up_or_eqv_mapper,
-			  LISP_TO_VOID (XCASE_TABLE_EQV (casetab)));
+			  STORE_LISP_IN_VOID (XCASE_TABLE_EQV (casetab)));
 	}
       else
 	convert_old_style_syntax_string (XCASE_TABLE_CANON (casetab), eqv);
     }
 
+
+  if (standard)
+    Vstandard_case_table = casetab;
+
+  buf->case_table = casetab;
+
   return buf->case_table;
 }
 
--- a/src/charset.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/charset.h	Wed Feb 24 01:58:04 2010 -0600
@@ -60,6 +60,8 @@
 } while (0)
 #define XCHARSET_CCL_PROGRAM(cs) Qnil
 #define XCHARSET_NAME(cs) Qascii
+#define Fget_charset(cs) (cs)
+#define Fcharset_list() list1 (Vcharset_ascii)
 
 #else /* MULE */
 
--- a/src/chartab.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/chartab.c	Wed Feb 24 01:58:04 2010 -0600
@@ -112,14 +112,16 @@
 }
 
 static int
-char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+			int foldcase)
 {
   Lisp_Char_Table_Entry *cte1 = XCHAR_TABLE_ENTRY (obj1);
   Lisp_Char_Table_Entry *cte2 = XCHAR_TABLE_ENTRY (obj2);
   int i;
 
   for (i = 0; i < 96; i++)
-    if (!internal_equal (cte1->level2[i], cte2->level2[i], depth + 1))
+    if (!internal_equal_0 (cte1->level2[i], cte2->level2[i], depth + 1,
+			   foldcase))
       return 0;
 
   return 1;
@@ -225,6 +227,7 @@
 static void
 decode_char_table_range (Lisp_Object range, struct chartab_range *outrange)
 {
+  xzero (*outrange);
   if (EQ (range, Qt))
     outrange->type = CHARTAB_RANGE_ALL;
   else if (CHAR_OR_CHAR_INTP (range))
@@ -312,7 +315,7 @@
   struct gcpro gcpro1;
   Lisp_Object lisprange;
   if (!a->first)
-    write_c_string (a->printcharfun, " ");
+    write_ascstring (a->printcharfun, " ");
   a->first = 0;
   lisprange = encode_char_table_range (range);
   GCPRO1 (lisprange);
@@ -336,14 +339,14 @@
   write_fmt_string_lisp (printcharfun, "#s(char-table type %s data (",
 			 1, char_table_type_to_symbol (ct->type));
   map_char_table (obj, &range, print_table_entry, &arg);
-  write_c_string (printcharfun, "))");
+  write_ascstring (printcharfun, "))");
 
   /* #### need to print and read the default; but that will allow the
      default to be modified, which we don't (yet) support -- but FSF does */
 }
 
 static int
-char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   Lisp_Char_Table *ct1 = XCHAR_TABLE (obj1);
   Lisp_Char_Table *ct2 = XCHAR_TABLE (obj2);
@@ -353,16 +356,16 @@
     return 0;
 
   for (i = 0; i < NUM_ASCII_CHARS; i++)
-    if (!internal_equal (ct1->ascii[i], ct2->ascii[i], depth + 1))
+    if (!internal_equal_0 (ct1->ascii[i], ct2->ascii[i], depth + 1, foldcase))
       return 0;
 
 #ifdef MULE
   for (i = 0; i < NUM_LEADING_BYTES; i++)
-    if (!internal_equal (ct1->level1[i], ct2->level1[i], depth + 1))
+    if (!internal_equal_0 (ct1->level1[i], ct2->level1[i], depth + 1, foldcase))
       return 0;
 #endif /* MULE */
 
-  return internal_equal (ct1->default_, ct2->default_, depth + 1);
+  return internal_equal_0 (ct1->default_, ct2->default_, depth + 1, foldcase);
 }
 
 static Hashcode
@@ -793,7 +796,7 @@
 copy_mapper (struct chartab_range *range, Lisp_Object UNUSED (table),
 	     Lisp_Object val, void *arg)
 {
-  put_char_table (VOID_TO_LISP (arg), range, val);
+  put_char_table (GET_LISP_FROM_VOID (arg), range, val);
   return 0;
 }
 
@@ -801,7 +804,7 @@
 copy_char_table_range (Lisp_Object from, Lisp_Object to,
 		       struct chartab_range *range)
 {
-  map_char_table (from, range, copy_mapper, LISP_TO_VOID (to));
+  map_char_table (from, range, copy_mapper, STORE_LISP_IN_VOID (to));
 }
 
 static Lisp_Object
--- a/src/cmdloop.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/cmdloop.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Editor command loop.
    Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2005 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -137,7 +137,32 @@
   stderr_out ("*** Backtrace\n");
   Fbacktrace (Qexternal_debugging_output, Qt);
   stderr_out ("*** Killing XEmacs\n");
-#ifdef HAVE_MS_WINDOWS
+#ifdef DEBUG_XEMACS
+  /* When configured --with-debug, and debug-on-error is set, exit to the
+     debugger and abort.  This will happen during loadup/dumping.  There is
+     also code in signal_call_debugger() to do the same whenever running
+     noninteractively.  That's intended for use debugging e.g. batch byte
+     compilation, AFTER dumping has already happened, where the XEMACSDEBUG
+     variable can be set to '(setq debug-on-error t)' to trigger the
+     behavior.
+
+     Why do we need to duplicate the bomb-out check here?  Well,
+     signal_call_debugger() doesn't want to bomb out unless it has an
+     uncaught error, and in this case, we've installed a
+     call-with-condition-case handler, and so signal_call_debugger() can't
+     bomb out before calling us.  If we returned and let the error be
+     processed further, it *would* trigger the bomb-out-to-debugger
+     behavior, but in fact it never gets there because we do `kill-emacs'.
+     Therefore, we have to provide the bomb-to-debugger feature
+     ourselves. */
+  if (!NILP (Vdebug_on_error))
+    {
+      stderr_out ("XEmacs exiting to debugger.\n");
+      Fforce_debugging_signal (Qt);
+    }
+#endif
+#if defined (HAVE_MS_WINDOWS) && defined (WIN32_NATIVE)
+  /* Don't do this under Cygwin, since we have output on stderr. */
   Fmswindows_message_box (build_msg_string ("Initialization error"),
 			  Qnil, Qnil);
 #endif
--- a/src/compiler.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/compiler.h	Wed Feb 24 01:58:04 2010 -0600
@@ -238,18 +238,25 @@
 # else
 #  define USED_IF_MULE(decl) UNUSED (decl)
 # endif
-# if defined (MULE) || defined (ERROR_CHECK_TEXT)
-#  define USED_IF_MULE_OR_CHECK_TEXT(decl) decl
-# else
-#  define USED_IF_MULE_OR_CHECK_TEXT(decl) UNUSED (decl)
-# endif
-# ifdef USE_XFT
+# ifdef HAVE_XFT
 #  define USED_IF_XFT(decl) decl
 # else
 #  define USED_IF_XFT(decl) UNUSED (decl)
 # endif
+# ifdef HAVE_SCROLLBARS
+#  define USED_IF_SCROLLBARS(decl) decl
+# else
+#  define USED_IF_SCROLLBARS(decl) UNUSED (decl)
+# endif
 #endif /* UNUSED */
 
+/* Declaration that variable or expression X is "used" to defeat
+   "unused variable" warnings.  DON'T DO THIS FOR PARAMETERS IF IT ALL
+   POSSIBLE.  Use an UNUSED() or USED_IF_*() declaration on the parameter
+   instead.  Don't do this for unused local variables that should really
+   just be deleted. */
+#define USED(x) ((void) (x))
+
 #ifdef DEBUG_XEMACS
 # define REGISTER
 # define register
--- a/src/config.h.in	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/config.h.in	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* XEmacs site configuration template file.  -*- C -*-
    Copyright (C) 1986, 1991-1994, 1998, 1999 Free Software Foundation, Inc.
-   Copyright (C) 2000, 2001, 2002, 2004, 2005 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -217,11 +217,11 @@
 #undef HAVE_FCCONFIGSETRESCANINTERVAL
 
 /* Compile with support for Xft? */
-#undef USE_XFT
+#undef HAVE_XFT
 /* Per-widget stuff will go away? */
-#undef USE_XFT_MENUBARS
-#undef USE_XFT_TABS
-#undef USE_XFT_GAUGES
+#undef HAVE_XFT_MENUBARS
+#undef HAVE_XFT_TABS
+#undef HAVE_XFT_GAUGES
 
 /* Defines for building X applications */
 #ifdef HAVE_X_WINDOWS
@@ -375,6 +375,9 @@
 /* Is scanf() broken? (Under certain versions of Cygwin) */
 #undef CYGWIN_SCANF_BUG
 
+/* UTF-8-aware path-conversion function in Cygwin 1.7 and on */
+#undef HAVE_CYGWIN_CONV_PATH
+
 #undef HAVE_MMAP
 #undef HAVE_STRCOLL
 #undef HAVE_GETPGRP
@@ -412,7 +415,6 @@
 #undef HAVE_READLINK
 #undef HAVE_RENAME
 #undef HAVE_RES_INIT
-#undef HAVE_RINT
 #undef HAVE_RMDIR
 #undef HAVE_SELECT
 #undef HAVE_SETITIMER
@@ -532,6 +534,8 @@
 #undef HAVE_DBM
 /* Full #include file path for GDBM's or platforms ndbm.h */
 #undef NDBM_H_FILE
+/* Can we trust the prototypes in ndbm.h?  If not, we need to declare our own */
+#undef TRUST_NDBM_H_PROTOTYPES
 
 /* Define to 1 if the system has the type `u_int8_t'. */
 #undef HAVE_U_INT8_T
@@ -647,13 +651,18 @@
    It is only intended for use by the developers. */
 #undef PURIFY
 
+/* Define USE_VALGRIND to compile valgrind hints into the code.
+   It is only intended for use by the developers. */
+#undef USE_VALGRIND
+
 /* Define EXTERNAL_WIDGET to compile support for using the editor as a
    widget within another program. */
 #undef EXTERNAL_WIDGET
 
-/* There are some special-case defines for gcc and lcc. */
+/* There are some special-case defines for gcc, g++ and lcc. */
 #undef USE_GCC
-#undef USE_LCC
+#undef USE_GPLUSPLUS
+#undef USE_LCC /* #### Not currently set in configure */
 
 /* Compile in support for CDE (Common Desktop Environment) drag and drop?
    Requires libDtSvc, which typically must be present at runtime.  */
@@ -1075,6 +1084,7 @@
 
 #if (defined ( __STDC_VERSION__) &&  __STDC_VERSION__ >= 199901L) \
   || defined (__cplusplus) || ! defined (__GNUC__) || ! defined(emacs)
+# define INLINE_HEADERS_ARE_STATIC
 # define INLINE_HEADER inline static
 #elif defined (DONT_EXTERN_INLINE_HEADER_FUNCTIONS)
 # define INLINE_HEADER inline
@@ -1084,7 +1094,8 @@
 
 /* Use DECLARE_INLINE_HEADER() to declare an inline function in a header
    file, like this: (This avoids the need to write a prototype directly
-   followed by the function header itself.)
+   followed by the function header itself, in order to avoid a
+   "no prototype" warning from GCC.)
 
   DECLARE_INLINE_HEADER (int foo (int x))
   {
@@ -1146,4 +1157,30 @@
 #define ERROR_CHECK_TYPES
 #endif /* ERROR_CHECK_ALL */
 
+/* It's very tricky.  In some circumstances, if we don't include the
+   ERROR_CHECK_TYPES functions in xemacs.def.in.in, we get lots of
+   undefined references from eldap.o and postgresql.o; but in other
+   circumstances, if we DO include them, we get undefined references
+   in xemacs-export.o to the same functions.  We try here to grok when
+   we need to include them in xemacs.def.in.in.  I originally thought
+   it was enough to condition on !defined (INLINE_HEADERS_ARE_STATIC) --
+   if they're static, they shouldn't lead to any external references
+   in the modules, right?  Wrong, under non-optimized builds.  So now
+   let's try conditioning on !C++ -- by examining inline.o with nm,
+   it seems it's the C++ builds where inline.o doesn't get any inline
+   functions compiled into it at all, which would lead to problems if
+   we reference them in xemacs.def.in.in.
+
+   #### FIXME Should we condition on GCC and defined(emacs), like we
+   do (inverted) for INLINE_HEADERS_ARE_STATIC? --ben */
+
+/* Checking for !defined (__cplusplus) doesn't work, because we typically
+   aren't using the C++ preprocessor when processing xemacs.def.in.in
+   even if we're using a C++ compiler.  I suspect we only need this at
+   all GCC is being used. */
+#if !defined (USE_GPLUSPLUS)
+/* #if !defined (INLINE_HEADERS_ARE_STATIC) */
+#define XEMACS_DEFS_NEEDS_INLINE_DECLS
+#endif
+
 #endif /* _SRC_CONFIG_H_ */
--- a/src/console-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -60,7 +60,7 @@
     return Qnil;
   else
     {
-	connection = build_string ("gtk");
+	connection = build_ascstring ("gtk");
     }
   return connection;
 }
@@ -73,7 +73,7 @@
 
   GCPRO1 (connection);
 
-  connection = build_string ("gtk");
+  connection = build_ascstring ("gtk");
 
   RETURN_UNGCPRO (connection);
 }
@@ -87,7 +87,7 @@
 
   GCPRO2 (connection, hostname);
 
-  connection = build_string ("gtk");
+  connection = build_ascstring ("gtk");
 
   RETURN_UNGCPRO (connection);
 }
@@ -100,7 +100,7 @@
 
   GCPRO1 (connection);
 
-  connection = build_string("gtk");
+  connection = build_ascstring("gtk");
 
   RETURN_UNGCPRO (connection);
 }
@@ -112,7 +112,7 @@
   struct gcpro gcpro1;
 
   GCPRO1 (connection);
-  connection = build_string("gtk");
+  connection = build_ascstring("gtk");
 
   RETURN_UNGCPRO (connection);
 }
--- a/src/console-gtk.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-gtk.h	Wed Feb 24 01:58:04 2010 -0600
@@ -36,7 +36,7 @@
 #ifdef HAVE_GTK
 
 #include "console.h"
-#include <gtk/gtk.h>
+#include "sysgtk.h"
 
 /* Variables associated with the X display frame this emacs is using. */
 
@@ -64,8 +64,6 @@
 		      int start_pixpos, int width, face_index findex,
 		      int cursor, int cursor_start, int cursor_width,
 		      int cursor_height);
-void gtk_output_shadows (struct frame *f, int x, int y, int width,
-		       int height, int shadow_thickness);
 GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
 		   Lisp_Object bg_pmap, Lisp_Object lwidth);
 
@@ -99,5 +97,17 @@
 extern void ungcpro_popup_callbacks (GUI_ID id);
 extern Lisp_Object get_gcpro_popup_callbacks (GUI_ID id);
 
+int gtk_event_to_emacs_event (struct frame *frame,
+			      GdkEvent *gdk_event,
+			      struct Lisp_Event *emacs_event);
+
+gint emacs_gtk_key_event_handler(GtkWidget *widget, GdkEventKey *event);
+gint emacs_gtk_button_event_handler(GtkWidget *widget, GdkEventButton *event);
+gint emacs_gtk_motion_event_handler (GtkWidget *widget, GdkEventMotion *event);
+
+gboolean emacs_shell_event_handler (GtkWidget *wid /* unused */,
+				    GdkEvent *event,
+				    gpointer closure);
+
 #endif /* HAVE_GTK */
 #endif /* _XEMACS_DEVICE_X_H_ */
--- a/src/console-impl.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-impl.h	Wed Feb 24 01:58:04 2010 -0600
@@ -145,7 +145,7 @@
   /* redisplay methods */
   int (*left_margin_width_method) (struct window *);
   int (*right_margin_width_method) (struct window *);
-  int (*text_width_method) (struct frame *f, struct face_cachel *cachel,
+  int (*text_width_method) (struct window *w, struct face_cachel *cachel,
 			    const Ichar *str, Charcount len);
   void (*output_display_block_method) (struct window *, struct display_line *,
 				       int, int, int, int, int, int, int);
--- a/src/console-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -347,8 +347,7 @@
   if (initialized && !inhibit_non_essential_conversion_operations)
     {
       TO_EXTERNAL_FORMAT (DATA, (str, len),
-			  C_STRING_ALLOCA, extptr,
-			  Qmswindows_tstr);
+			  C_STRING_ALLOCA, extptr, Qmswindows_tstr);
       qxeOutputDebugString (extptr);
     }
   else
@@ -578,12 +577,12 @@
     }
 
   CHECK_STRING (message_);
-  LISP_STRING_TO_TSTR (message_, msgout);
+  msgout = LISP_STRING_TO_TSTR (message_);
   
   if (!NILP (title))
     {
       CHECK_STRING (title);
-      LISP_STRING_TO_TSTR (title, titleout);
+      titleout = LISP_STRING_TO_TSTR (title);
     }
 
   {
--- a/src/console-stream.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-stream.c	Wed Feb 24 01:58:04 2010 -0600
@@ -136,7 +136,7 @@
 	retry_fclose (stream_con->in);
 
 #ifndef NEW_GC
-      xfree (stream_con, struct stream_console *);
+      xfree (stream_con);
 #endif /* not NEW_GC */
       CONSOLE_STREAM_DATA (con) = NULL;
     }
@@ -192,7 +192,7 @@
     invalid_operation ("Only one frame allowed on stream devices", Qunbound);
 #endif
   if (frame_name_is_defaulted)
-    f->name = build_string ("stream");
+    f->name = build_ascstring ("stream");
   f->height = 80;
   f->width = 24;
   f->visible = 0; /* so redisplay doesn't try to do anything */
@@ -200,7 +200,7 @@
 
 
 static int
-stream_text_width (struct frame *UNUSED (f),
+stream_text_width (struct window *UNUSED (w),
 		   struct face_cachel *UNUSED (cachel),
 		   const Ichar *UNUSED (str), Charcount len)
 {
@@ -372,7 +372,7 @@
   Vterminal_frame = Qnil;
 
   /* Moved from console-tty.c */
-  Vstdio_str = build_string ("stdio");
+  Vstdio_str = build_ascstring ("stdio");
   staticpro (&Vstdio_str);
 }
 
--- a/src/console-tty.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-tty.c	Wed Feb 24 01:58:04 2010 -0600
@@ -111,7 +111,7 @@
 	  invalid_state ("Cannot determine terminal type", Qunbound);
 	}
       else
-	terminal_type = build_intstring (temp_type);
+	terminal_type = build_istring (temp_type);
     }
 
   /* Determine the controlling process */
@@ -213,11 +213,11 @@
     {
       if (tty_con->term_entry_buffer) /* allocated in term_init () */
 	{
-	  xfree (tty_con->term_entry_buffer, char *);
+	  xfree (tty_con->term_entry_buffer);
 	  tty_con->term_entry_buffer = NULL;
 	}
 #ifndef NEW_GC
-      xfree (tty_con, struct tty_console *);
+      xfree (tty_con);
 #endif /* not NEW_GC */
       CONSOLE_TTY_DATA (con) = NULL;
     }
--- a/src/console-x-impl.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-x-impl.h	Wed Feb 24 01:58:04 2010 -0600
@@ -316,7 +316,7 @@
 #endif /* XIM_XLIB */
 #endif /* HAVE_XIM */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* The Xft Drawable wrapper for this device.
      #### Should this be per-device, or per-frame? */
   /* This is persistent to take advantage of the ability of Xft's glyph
@@ -386,7 +386,7 @@
 
 #define FRAME_X_GEOM_FREE_ME_PLEASE(f) (FRAME_X_DATA (f)->geom_free_me_please)
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #define FRAME_X_XFTDRAW(f)   (FRAME_X_DATA (f)->xftDraw)
 #endif
 
--- a/src/console-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -43,8 +43,6 @@
 
 int wedge_metacity;	/* nonzero means update WM_HINTS always */
 
-extern void x_has_keysym (KeySym, Lisp_Object, int);
-
 static int
 x_initially_selected_for_input (struct console *UNUSED (con))
 {
@@ -162,12 +160,12 @@
       /* assert: display_arg is only set if we found the display
 	 arg earlier so we can't fail to find it now. */
       assert (disp_name != NULL);
-      conn = build_ext_string (disp_name, Qcommand_argument_encoding);
+      conn = build_extstring (disp_name, Qcommand_argument_encoding);
       free_argc_argv (argv);
       return conn;
     }
   else
-    return build_ext_string (XDisplayName (0), Qx_display_name_encoding);
+    return build_extstring (XDisplayName (0), Qx_display_name_encoding);
 }
 
 /* "semi-canonicalize" means convert to a nicer form for printing, but
@@ -202,7 +200,7 @@
 
   /* Check for a couple of standard special cases */
   if (string_ichar (connection, 0) == ':')
-    connection = concat2 (build_string ("localhost"), connection);
+    connection = concat2 (build_ascstring ("localhost"), connection);
   else
     {
       /* connection =~ s/^unix:/localhost:/; */
@@ -217,7 +215,7 @@
 	  INC_IBYTEPTR (p);
 	}
 
-      connection = concat2 (build_string ("localhost:"),
+      connection = concat2 (build_ascstring ("localhost:"),
 			    make_string (p, end - p));
     }
  ok:
@@ -277,7 +275,7 @@
 			 &screen_length);
 
   if (!screen_length)
-    connection = concat2 (connection, build_string (".0"));
+    connection = concat2 (connection, build_ascstring (".0"));
   RETURN_UNGCPRO (connection);
 }
 
@@ -335,7 +333,7 @@
       CHECK_CHAR(key);
 
       buf[set_itext_ichar(buf, XCHAR(key))] = '\0';
-      key_name = build_intstring (buf);
+      key_name = build_istring (buf);
 
       /* We need to do the lookup and compare later, because we can't check
 	 the Qcharacter_of_keysym property belonging to an actual character. */
@@ -347,7 +345,7 @@
       return Qnil;
     }
 
-  LISP_STRING_TO_EXTERNAL (key_name, keysym_ext, Qctext);
+  keysym_ext = LISP_STRING_TO_EXTERNAL (key_name, Qctext);
   xkeysym = XStringToKeysym(keysym_ext);
   if (NoSymbol == xkeysym) 
     {
--- a/src/console-x.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console-x.h	Wed Feb 24 01:58:04 2010 -0600
@@ -51,7 +51,7 @@
 #include <X11/xpm.h>
 #endif
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 /* shut up GCC */
 #define face_index face_index_arg
 #define glyph_index glyph_index_arg
@@ -104,7 +104,7 @@
 void x_wm_set_cell_size (Widget wmshell, int cw, int ch);
 void x_wm_set_variable_size (Widget wmshell, int width, int height);
 
-const char *x_event_name (int event_type);
+const Ascbyte *x_event_name (int event_type);
 int check_if_pending_expose_event (struct device *d);
 int x_error_handler (Display *disp, XErrorEvent *event);
 void expect_x_error (Display *dpy);
@@ -137,15 +137,6 @@
 		      int start_pixpos, int width, face_index findex,
 		      int cursor, int cursor_start, int cursor_width,
 		      int cursor_height);
-void x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p,
-			int x, int y, int xoffset, int yoffset,
-			int width, int height,
-			unsigned long fg, unsigned long bg,
-			GC override_gc);
-void x_output_shadows (struct frame *f, int x, int y, int width,
-		       int height, GC top_shadow_gc,
-		       GC bottom_shadow_gc, GC background_gc,
-		       int shadow_thickness, int edges);
 void x_generate_shadow_pixels (struct frame *f,
 			       unsigned long *top_shadow,
 			       unsigned long *bottom_shadow,
@@ -154,6 +145,7 @@
 
 int x_initialize_frame_menubar (struct frame *f);
 void x_init_modifier_mapping (struct device *d);
+void x_has_keysym (KeySym, Lisp_Object, int);
 
 int x_frame_window_state (struct frame *f);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/console-xlike-inc.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,333 @@
+/* Definitions for use in *-xlike-inc.c files.
+   Copyright (C) 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+#ifndef INCLUDED_console_xlike_inc_h_
+#define INCLUDED_console_xlike_inc_h_
+
+/* X and GTK are quite similar, since GTK based its structure on Xlib.
+   However, there are many small differences.  Creating two separate
+   versions of the code, as Bill Perry did originally, is easier to code
+   but hard to maintain and leads to bit rot.  On the other hand, trying to
+   abstract out into device methods, as is done generally for different
+   window systems, gets very hairy very quickly because the differences are
+   on the level of individual library functions, constants and types, of
+   which there are large number.  Abstracting them into device methods
+   would lead to a large number of very small functions and very
+   hard-to-read code.
+
+   Instead, we handle the situation by the following:
+
+   (1) In cases where there are lots of individual differences, we have
+   only one copy, placed in a file called *-xlike-inc.c
+   (e.g. redisplay-xlike-inc.c), and conditionalize using ifdefs.  Because
+   we can compile with both X and GTK at once, we include this file inside
+   of the appropriate device-specific file (e.g. redisplay-gtk.c or
+   redisplay-x.c).  The `inc' in *-xlike-inc.c indicates that this is a
+   file meant to be included in another file, despite the fact that it is a
+   .c file.
+
+   To signal which variety of "xlike" we are compiling for, either
+   THIS_IS_X or THIS_IS_GTK needs to be defined, prior to including the
+   *-xlike-inc.c file.
+
+   (2) For code that is identical in both versions, or where it's possible
+   to have only one copy at runtime through some other means, we name
+   the file *-xlike.c.  This is a normal file, not included in some other
+   file.  An example of "other means" is toolbar-xlike.c, where all
+   functions are passed a frame or device, and it's possible to do run-time
+   conditionalization based on the device type. (This isn't currently the
+   case but will be soon once the related changes from my `hg-fixup'
+   workspace are checked in. --ben) */
+
+
+/* About the representation of color below:
+
+   X has two ways of representing a color: (a) as an unsigned long
+   representing a color pixel value, i.e. the actual value stored in memory
+   or a file at a particular pixel location to indicate that the pixel
+   takes on a specific color; and (b) an XColor structure, which
+   encapsulates both the RGB components of a color and the associated color
+   pixel value.
+
+   We call the former type XLIKE_PIXEL and the latter XLIKE_COLOR, along
+   with routines to convert from one to the other.  Differences between the
+   two in specific functions and structures should be abstracted using the
+   XLIKE_FOO() routines, e.g. XLIKE_SET_GC_COLOR(). */
+
+#if defined (THIS_IS_X) && defined (THIS_IS_GTK)
+#error "Exactly one of THIS_IS_X and THIS_IS_GTK may be defined."
+#endif
+
+#if !defined (THIS_IS_X) && !defined (THIS_IS_GTK)
+#error "Either THIS_IS_X or THIS_IS_GTK must be defined."
+#endif
+
+#ifdef THIS_IS_X
+#  include "console-x-impl.h"
+#  ifdef NEED_GCCACHE_H
+#    include "gccache-x.h"
+#  endif
+#  ifdef NEED_GLYPHS_H
+#    include "glyphs-x.h"
+#  endif
+#  ifdef NEED_OBJECTS_IMPL_H
+#    include "objects-x-impl.h"
+#  endif
+#else /* THIS_IS_GTK */
+#  include "console-gtk-impl.h"
+#  ifdef NEED_GCCACHE_H
+#    include "gccache-gtk.h"
+#  endif
+#  ifdef NEED_GLYPHS_H
+#    include "glyphs-gtk.h"
+#  endif
+#  ifdef NEED_OBJECTS_IMPL_H
+#    include "objects-gtk-impl.h"
+#  endif
+#endif /* THIS_IS_GTK */
+
+/* Just because we have XFT support doesn't mean we should use it.
+   In particular, the xlike routines are used by both X and GTK code,
+   but XFT stuff is X-specific.  HAVE_XFT will still be defined when
+   the GTK flavor is active, but we don't want to trigger the XFT code
+   in this case.  We could just undefine HAVE_XFT but I'd rather make
+   it clearer that something else is going on. --ben */
+
+#if defined (THIS_IS_X) && defined (HAVE_XFT)
+#define USE_XFT
+#define USE_XFT_MENUBARS
+#define USE_XFT_TABS
+#define USE_XFT_GAUGES
+#endif
+
+/***************************************************************************/
+/*                           Common definitions                            */
+/***************************************************************************/
+
+#define XLIKE_PASTE_1(a,b) a##_##b
+#define XLIKE_PASTE(a,b) XLIKE_PASTE_1(a,b)
+#define XFUN(name) XLIKE_PASTE (XLIKE_NAME, name)
+
+#define XLIKE_CONSOLE_HAS_METHOD_1(xlike, name) CONSOLE_HAS_METHOD (xlike, name)
+#define XLIKE_CONSOLE_HAS_METHOD(name) \
+  XLIKE_CONSOLE_HAS_METHOD_1 (XLIKE_NAME, name)
+
+#define XCOLOR_INSTANCE_XLIKE_COLOR(x) \
+  COLOR_INSTANCE_XLIKE_COLOR (XCOLOR_INSTANCE (x))
+
+#ifdef THIS_IS_X
+
+/***************************************************************************/
+/*               Definitions implementing X flavor of XLIKE                */
+/***************************************************************************/
+
+#define XLIKE_NAME x
+#define USED_IF_X(var) var
+#define USED_IF_GTK(var) UNUSED (var)
+
+/* types */
+typedef Display * XLIKE_DISPLAY;
+typedef Window XLIKE_WINDOW;
+typedef GC XLIKE_GC;
+typedef XRectangle XLIKE_RECTANGLE;
+typedef XGCValues XLIKE_GCVALUES;
+typedef XColor XLIKE_COLOR;
+typedef unsigned long XLIKE_PIXEL;
+
+/* constants */
+#define XLIKE_NONE None
+#define XLIKE_FALSE False
+
+#define XLIKE_GC_BACKGROUND GCBackground
+#define XLIKE_GC_CLIP_MASK GCClipMask
+#define XLIKE_GC_CLIP_X_ORIGIN GCClipXOrigin
+#define XLIKE_GC_CLIP_Y_ORIGIN GCClipYOrigin
+#define XLIKE_GC_EXPOSURES GCGraphicsExposures
+#define XLIKE_GC_FILL GCFillStyle
+#define XLIKE_GC_FONT GCFont
+#define XLIKE_GC_FOREGROUND GCForeground
+#define XLIKE_GC_FUNCTION GCFunction
+#define XLIKE_GC_LINE_WIDTH GCLineWidth
+#define XLIKE_GC_STIPPLE GCStipple
+#define XLIKE_GC_TILE GCTile
+
+#define XLIKE_GX_COPY GXcopy
+#define XLIKE_GX_XOR GXxor
+
+#define XLIKE_FILL_STIPPLED FillStippled
+#define XLIKE_FILL_OPAQUE_STIPPLED FillOpaqueStippled
+#define XLIKE_FILL_TILED FillTiled
+#define XLIKE_FILL_SOLID FillSolid
+
+/* functions */
+#define GET_XLIKE_DISPLAY(d) DEVICE_X_DISPLAY (d)
+#define GET_XLIKE_X_DISPLAY(d) DEVICE_X_DISPLAY (d)
+#define GET_XLIKE_WINDOW(w) XtWindow (FRAME_X_TEXT_WIDGET (f))
+#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
+  XFillRectangle (dpy, x_win, gc, x, y, width, height)
+#define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height) \
+  XDrawRectangle (dpy, x_win, gc, x, y, width, height)
+#define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2) \
+  XDrawLine (dpy, x_win, gc, x1, y1, x2, y2)
+#define XLIKE_TEXT_WIDTH(fi, ptr, len) XTextWidth (fi, (char *) ptr, len)
+#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) XTextWidth16 (fi, (XChar2b *) ptr, len)
+
+#define XLIKE_DISPLAY_LINE_HEIGHT(dl) DISPLAY_LINE_HEIGHT (dl)
+#define XLIKE_DISPLAY_LINE_YPOS(dl) DISPLAY_LINE_YPOS (dl)
+#define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) ((dl)->top_clip)
+#define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect)		\
+  /* #### why not Unsorted? */						\
+  XSetClipRectangles (dpy, gc, xorig, yorig, prect, 1, YXBanded)
+#define XLIKE_CLEAR_CLIP_MASK(dpy, gc)		\
+do						\
+  {						\
+    XSetClipMask (dpy, gc, None);		\
+    XSetClipOrigin (dpy, gc, 0, 0);		\
+  }						\
+while (0)
+#define XLIKE_FLUSH(dpy) XSync (dpy, False)
+#define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
+  XClearArea (dpy, win, x, y, width, height, False)
+ 
+#define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_X_MASK
+#define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_X_PIXMAP
+#define COLOR_INSTANCE_XLIKE_COLOR COLOR_INSTANCE_X_COLOR
+#define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_X_FONT
+#define DEVICE_XLIKE_GC_CACHE DEVICE_X_GC_CACHE
+#define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_X_GRAY_PIXMAP
+#define XLIKE_SET_GC_FILL(gc, style) ((gc).fill_style = (style))
+#define XLIKE_COLOR_TO_PIXEL(c) ((c).pixel)
+#define XLIKE_SET_GC_COLOR(lval, rval) ((lval) = (rval).pixel)
+#define XLIKE_SET_GC_PIXEL(lval, rval) ((lval) = (rval))
+#define XLIKE_FONT_NUM(val) ((val)->fid)
+
+/************ End X flavor of XLIKE **********/
+
+
+#else /* THIS_IS_GTK */
+
+/***************************************************************************/
+/*              Definitions implementing GTK flavor of XLIKE               */
+/***************************************************************************/
+
+#define XLIKE_NAME gtk
+#define USED_IF_X(var) UNUSED (var)
+#define USED_IF_GTK(var) var
+
+/*types */
+typedef void * XLIKE_DISPLAY;
+typedef GdkWindow * XLIKE_WINDOW;
+typedef GdkGC * XLIKE_GC;
+typedef GdkRectangle XLIKE_RECTANGLE;
+typedef GdkGCValues XLIKE_GCVALUES;
+typedef GdkColor XLIKE_COLOR;
+typedef gulong   XLIKE_PIXEL;
+
+/* constants */
+#define XLIKE_NONE 0
+#define XLIKE_FALSE FALSE
+
+#define XLIKE_GC_BACKGROUND GDK_GC_BACKGROUND
+#define XLIKE_GC_CLIP_MASK GDK_GC_CLIP_MASK
+#define XLIKE_GC_CLIP_X_ORIGIN GDK_GC_CLIP_X_ORIGIN
+#define XLIKE_GC_CLIP_Y_ORIGIN GDK_GC_CLIP_Y_ORIGIN
+#define XLIKE_GC_EXPOSURES GDK_GC_EXPOSURES
+#define XLIKE_GC_FILL GDK_GC_FILL
+#define XLIKE_GC_FONT GDK_GC_FONT
+#define XLIKE_GC_FOREGROUND GDK_GC_FOREGROUND
+#define XLIKE_GC_FUNCTION GDK_GC_FUNCTION
+#define XLIKE_GC_LINE_WIDTH GDK_GC_LINE_WIDTH
+#define XLIKE_GC_STIPPLE GDK_GC_STIPPLE
+#define XLIKE_GC_TILE GDK_GC_TILE
+
+#define XLIKE_GX_COPY GDK_COPY
+#define XLIKE_GX_XOR GDK_XOR
+
+#define XLIKE_FILL_STIPPLED GDK_STIPPLED
+#define XLIKE_FILL_OPAQUE_STIPPLED GDK_OPAQUE_STIPPLED
+#define XLIKE_FILL_TILED GDK_TILED
+#define XLIKE_FILL_SOLID GDK_SOLID
+
+/* functions */
+
+/* Avoid unused-variable warning involving D */
+#define GET_XLIKE_DISPLAY(d) (USED (d), NULL)
+#define GET_XLIKE_X_DISPLAY(d) (USED (d), GDK_DISPLAY ())
+#define GET_XLIKE_WINDOW(w) GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (w))
+#define XLIKE_FILL_RECTANGLE(dpy, x_win, gc, x, y, width, height)	\
+  (USED (dpy), gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE,	\
+                                   x, y, width, height))
+#define XLIKE_DRAW_RECTANGLE(dpy, x_win, gc, x, y, width, height)	\
+  (USED (dpy), gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE,	\
+                                   x, y, width, height))
+#define XLIKE_DRAW_LINE(dpy, x_win, gc, x1, y1, x2, y2)			\
+  (USED (dpy), gdk_draw_line (GDK_DRAWABLE (x_win), gc, x1, y1, x2, y2))
+#define XLIKE_TEXT_WIDTH(fi, ptr, len) \
+  gdk_text_width (fi, (char *) ptr, len)
+#define XLIKE_TEXT_WIDTH_WIDE(fi, ptr, len) \
+  gdk_text_width_wc (fi, (GdkWChar *) ptr, len)
+
+/* FIXME: This is totally bogus.  It removes dl->top_clip from the
+   equations.  If there is a bug involving this, fix it properly!
+   Or just ensure that top_clip is 0. */
+#define XLIKE_DISPLAY_LINE_HEIGHT(dl) \
+  ((dl)->ascent + (dl)->descent - (dl)->clip)
+#define XLIKE_DISPLAY_LINE_YPOS(dl) ((dl)->ypos - (dl)->ascent)
+#define XLIKE_DISPLAY_LINE_TOP_CLIP(dl) (0)
+#define XLIKE_SET_CLIP_RECTANGLE(dpy, gc, xorig, yorig, prect)	\
+do								\
+  {								\
+    USED (dpy);							\
+    gdk_gc_set_clip_rectangle (gc, prect);			\
+    gdk_gc_set_clip_origin (gc, xorig, yorig);			\
+  }								\
+while (0)
+#define XLIKE_CLEAR_CLIP_MASK(dpy, gc)		\
+do						\
+  {						\
+    USED (dpy);					\
+    gdk_gc_set_clip_rectangle (gc, NULL);	\
+    gdk_gc_set_clip_origin (gc, 0, 0);		\
+  }						\
+while (0)
+#define XLIKE_FLUSH(dpy) gdk_flush ()
+#define XLIKE_CLEAR_AREA(dpy, win, x, y, width, height) \
+  (USED (dpy), gdk_window_clear_area (win, x, y, width, height))
+
+#define IMAGE_INSTANCE_XLIKE_MASK IMAGE_INSTANCE_GTK_MASK
+#define XIMAGE_INSTANCE_XLIKE_PIXMAP XIMAGE_INSTANCE_GTK_PIXMAP
+#define COLOR_INSTANCE_XLIKE_COLOR(ci) (*COLOR_INSTANCE_GTK_COLOR (ci))
+#define FONT_INSTANCE_XLIKE_FONT FONT_INSTANCE_GTK_FONT
+#define DEVICE_XLIKE_GRAY_PIXMAP DEVICE_GTK_GRAY_PIXMAP
+#define DEVICE_XLIKE_GC_CACHE DEVICE_GTK_GC_CACHE
+#define XLIKE_SET_GC_FILL(gc, style) ((gc).fill = (style))
+#define XLIKE_COLOR_TO_PIXEL(c) ((c).pixel)
+#define XLIKE_SET_GC_COLOR(lval, rval) ((lval) = (rval))
+#define XLIKE_SET_GC_PIXEL(lval, rval) ((lval).pixel = (rval))
+#define XLIKE_FONT_NUM(val) (val)
+
+/************ End GTK flavor of XLIKE **********/
+
+#endif /* (not) THIS_IS_X */
+
+
+#endif /* INCLUDED_console_xlike_inc_h_ */
--- a/src/console.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/console.c	Wed Feb 24 01:58:04 2010 -0600
@@ -169,8 +169,7 @@
   struct console *con = XCONSOLE (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<console %s 0x%x>",
-				XSTRING_DATA (con->name), con->header.uid);
+    printing_unreadable_lcrecord (obj, XSTRING_DATA (con->name));
 
   write_fmt_string (printcharfun, "#<%s-console",
 		    !CONSOLE_LIVE_P (con) ? "dead" : CONSOLE_TYPE_NAME (con));
@@ -650,7 +649,7 @@
 {
   Lisp_Object console;
 
-  console = VOID_TO_LISP (closure);
+  console = GET_LISP_FROM_VOID (closure);
   if (FRAME_MINIBUF_ONLY_P (XFRAME (frame)))
     return 0;
   if (EQ (console, FRAME_CONSOLE (XFRAME (frame))))
@@ -662,7 +661,7 @@
 find_nonminibuffer_frame_not_on_console (Lisp_Object console)
 {
   return find_some_frame (find_nonminibuffer_frame_not_on_console_predicate,
-			  LISP_TO_VOID (console));
+			  STORE_LISP_IN_VOID (console));
 }
 
 static void
@@ -1006,9 +1005,7 @@
       Bytecount count;
       Extbyte *p;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, stuffstring,
-			  ALLOCA, (p, count),
-			  Qkeyboard);
+      LISP_STRING_TO_SIZED_EXTERNAL (stuffstring, p, count, Qkeyboard);
       while (count-- > 0)
 	stuff_char (XCONSOLE (Vcontrolling_terminal), *p++);
       stuff_char (XCONSOLE (Vcontrolling_terminal), '\n');
--- a/src/data.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/data.c	Wed Feb 24 01:58:04 2010 -0600
@@ -65,6 +65,8 @@
 Lisp_Object Qerror_lacks_explanatory_string;
 Lisp_Object Qfloatp;
 
+Fixnum Vmost_negative_fixnum, Vmost_positive_fixnum;
+
 #ifdef DEBUG_XEMACS
 
 int debug_issue_ebola_notices;
@@ -79,13 +81,13 @@
     {
       /* #### It would be really nice if this were a proper warning
          instead of brain-dead print to Qexternal_debugging_output.  */
-      write_c_string
+      write_msg_string
 	(Qexternal_debugging_output,
 	 "Comparison between integer and character is constant nil (");
       Fprinc (obj1, Qexternal_debugging_output);
-      write_c_string (Qexternal_debugging_output, " and ");
+      write_msg_string (Qexternal_debugging_output, " and ");
       Fprinc (obj2, Qexternal_debugging_output);
-      write_c_string (Qexternal_debugging_output, ")\n");
+      write_msg_string (Qexternal_debugging_output, ")\n");
       debug_short_backtrace (debug_ebola_backtrace_length);
     }
   return EQ (obj1, obj2);
@@ -295,10 +297,7 @@
 */
        (object))
 {
-  return (VECTORP	(object) ||
-	  STRINGP	(object) ||
-	  BIT_VECTORP	(object))
-    ? Qt : Qnil;
+  return ARRAYP (object) ? Qt : Qnil;
 }
 
 DEFUN ("sequencep", Fsequencep, 1, 1, 0, /*
@@ -306,11 +305,7 @@
 */
        (object))
 {
-  return (LISTP		(object) ||
-	  VECTORP	(object) ||
-	  STRINGP	(object) ||
-	  BIT_VECTORP	(object))
-    ? Qt : Qnil;
+  return SEQUENCEP (object) ? Qt : Qnil;
 }
 
 DEFUN ("markerp", Fmarkerp, 1, 1, 0, /*
@@ -340,7 +335,7 @@
 
 DEFUN ("subr-max-args", Fsubr_max_args, 1, 1, 0, /*
 Return maximum number of args built-in function SUBR may be called with,
-or nil if it takes an arbitrary number of arguments or is a special form.
+or nil if it takes an arbitrary number of arguments or is a special operator.
 */
        (subr))
 {
@@ -363,7 +358,7 @@
   const CIbyte *prompt;
   CHECK_SUBR (subr);
   prompt = XSUBR (subr)->prompt;
-  return prompt ? list2 (Qinteractive, build_msg_string (prompt)) : Qnil;
+  return prompt ? list2 (Qinteractive, build_msg_cistring (prompt)) : Qnil;
 }
 
 
@@ -420,7 +415,7 @@
 */
        (integer))
 {
-  CHECK_INT (integer);
+  CHECK_INTEGER (integer);
   if (CHAR_INTP (integer))
     return make_char (XINT (integer));
   else
@@ -456,31 +451,34 @@
   return CHAR_OR_CHAR_INTP (object) || STRINGP (object) ? Qt : Qnil;
 }
 
-#ifdef HAVE_BIGNUM
-/* In this case, integerp is defined in number.c. */
 DEFUN ("fixnump", Ffixnump, 1, 1, 0, /*
 Return t if OBJECT is a fixnum.
+
+In this implementation, a fixnum is an immediate integer, and has a
+maximum value described by the constant `most-positive-fixnum'.  This
+contrasts with bignums, integers where the values are limited by your
+available memory.
 */
        (object))
 {
   return INTP (object) ? Qt : Qnil;
 }
-#else
 DEFUN ("integerp", Fintegerp, 1, 1, 0, /*
-Return t if OBJECT is an integer.
+Return t if OBJECT is an integer, nil otherwise.
+
+On builds without bignum support, this function is identical to `fixnump'.
 */
        (object))
 {
-  return INTP (object) ? Qt : Qnil;
+  return INTEGERP (object) ? Qt : Qnil;
 }
-#endif
 
 DEFUN ("integer-or-marker-p", Finteger_or_marker_p, 1, 1, 0, /*
 Return t if OBJECT is an integer or a marker (editor pointer).
 */
        (object))
 {
-  return INTP (object) || MARKERP (object) ? Qt : Qnil;
+  return INTEGERP (object) || MARKERP (object) ? Qt : Qnil;
 }
 
 DEFUN ("integer-or-char-p", Finteger_or_char_p, 1, 1, 0, /*
@@ -488,7 +486,7 @@
 */
        (object))
 {
-  return INTP (object) || CHARP (object) ? Qt : Qnil;
+  return INTEGERP (object) || CHARP (object) ? Qt : Qnil;
 }
 
 DEFUN ("integer-char-or-marker-p", Finteger_char_or_marker_p, 1, 1, 0, /*
@@ -496,7 +494,7 @@
 */
        (object))
 {
-  return INTP (object) || CHARP (object) || MARKERP (object) ? Qt : Qnil;
+  return INTEGERP (object) || CHARP (object) || MARKERP (object) ? Qt : Qnil;
 }
 
 DEFUN ("natnump", Fnatnump, 1, 1, 0, /*
@@ -542,11 +540,7 @@
 */
        (object))
 {
-#ifdef WITH_NUMBER_TYPES
   return NUMBERP (object) ? Qt : Qnil;
-#else
-  return INT_OR_FLOATP (object) ? Qt : Qnil;
-#endif
 }
 
 DEFUN ("number-or-marker-p", Fnumber_or_marker_p, 1, 1, 0, /*
@@ -554,7 +548,7 @@
 */
        (object))
 {
-  return INT_OR_FLOATP (object) || MARKERP (object) ? Qt : Qnil;
+  return NUMBERP (object) || MARKERP (object) ? Qt : Qnil;
 }
 
 DEFUN ("number-char-or-marker-p", Fnumber_char_or_marker_p, 1, 1, 0, /*
@@ -562,9 +556,7 @@
 */
        (object))
 {
-  return (INT_OR_FLOATP (object) ||
-	  CHARP         (object) ||
-	  MARKERP       (object))
+  return (NUMBERP (object) || CHARP (object) || MARKERP (object))
     ? Qt : Qnil;
 }
 
@@ -740,6 +732,19 @@
 
   if      (INTP  (index_)) idx = XINT  (index_);
   else if (CHARP (index_)) idx = XCHAR (index_); /* yuck! */
+#ifdef HAVE_BIGNUM
+  else if (BIGNUMP (index_))
+    {
+      Lisp_Object canon = Fcanonicalize_number (index_);
+      if (EQ (canon, index_))
+	{
+	  /* We don't support non-fixnum indices. */
+	  goto range_error;
+	}
+      index_ = canon;
+      goto retry;
+    }
+#endif
   else
     {
       index_ = wrong_type_argument (Qinteger_or_char_p, index_);
@@ -795,6 +800,19 @@
 
   if      (INTP  (index_)) idx = XINT (index_);
   else if (CHARP (index_)) idx = XCHAR (index_); /* yuck! */
+#ifdef HAVE_BIGNUM
+  else if (BIGNUMP (index_))
+    {
+      Lisp_Object canon = Fcanonicalize_number (index_);
+      if (EQ (canon, index_))
+	{
+	  /* We don't support non-fixnum indices. */
+	  goto range_error;
+	}
+      index_ = canon;
+      goto retry;
+    }
+#endif
   else
     {
       index_ = wrong_type_argument (Qinteger_or_char_p, index_);
@@ -884,7 +902,7 @@
 #endif /* WITH_NUMBER_TYPES */
 
 static EMACS_INT
-integer_char_or_marker_to_int (Lisp_Object obj)
+fixnum_char_or_marker_to_int (Lisp_Object obj)
 {
  retry:
   if      (INTP    (obj)) return XINT  (obj);
@@ -892,6 +910,9 @@
   else if (MARKERP (obj)) return marker_position (obj);
   else
     {
+      /* On bignum builds, we can only be called from #'lognot, which
+	 protects against this happening: */
+      assert (!BIGNUMP (obj));
       obj = wrong_type_argument (Qinteger_char_or_marker_p, obj);
       goto retry;
     }
@@ -1192,52 +1213,48 @@
 */
        (number))
 {
-#ifdef WITH_NUMBER_TYPES
   CHECK_NUMBER (number);
-#else
-  CHECK_INT_OR_FLOAT (number);
-#endif
 
   if (FLOATP (number))
     {
-      char pigbuf[350];	/* see comments in float_to_string */
+      Ascbyte pigbuf[350];	/* see comments in float_to_string */
 
       float_to_string (pigbuf, XFLOAT_DATA (number));
-      return build_string (pigbuf);
+      return build_ascstring (pigbuf);
     }
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (number))
     {
-      char *str = bignum_to_string (XBIGNUM_DATA (number), 10);
-      Lisp_Object retval = build_string (str);
-      xfree (str, char *);
+      Ascbyte *str = bignum_to_string (XBIGNUM_DATA (number), 10);
+      Lisp_Object retval = build_ascstring (str);
+      xfree (str);
       return retval;
     }
 #endif
 #ifdef HAVE_RATIO
   if (RATIOP (number))
     {
-      char *str = ratio_to_string (XRATIO_DATA (number), 10);
-      Lisp_Object retval = build_string (str);
-      xfree (str, char *);
+      Ascbyte *str = ratio_to_string (XRATIO_DATA (number), 10);
+      Lisp_Object retval = build_ascstring (str);
+      xfree (str);
       return retval;
     }
 #endif
 #ifdef HAVE_BIGFLOAT
   if (BIGFLOATP (number))
     {
-      char *str = bigfloat_to_string (XBIGFLOAT_DATA (number), 10);
-      Lisp_Object retval = build_string (str);
-      xfree (str, char *);
+      Ascbyte *str = bigfloat_to_string (XBIGFLOAT_DATA (number), 10);
+      Lisp_Object retval = build_ascstring (str);
+      xfree (str);
       return retval;
     }
 #endif
 
   {
-    char buffer[DECIMAL_PRINT_SIZE (long)];
+    Ascbyte buffer[DECIMAL_PRINT_SIZE (long)];
 
     long_to_string (buffer, XINT (number));
-    return build_string (buffer);
+    return build_ascstring (buffer);
   }
 }
 
@@ -2132,7 +2149,7 @@
   Lisp_Object *args_end = args + nargs;
 
   while (args < args_end)
-    bits &= integer_char_or_marker_to_int (*args++);
+    bits &= fixnum_char_or_marker_to_int (*args++);
 
   return make_int (bits);
 #endif /* HAVE_BIGNUM */
@@ -2184,7 +2201,7 @@
   Lisp_Object *args_end = args + nargs;
 
   while (args < args_end)
-    bits |= integer_char_or_marker_to_int (*args++);
+    bits |= fixnum_char_or_marker_to_int (*args++);
 
   return make_int (bits);
 #endif /* HAVE_BIGNUM */
@@ -2206,7 +2223,7 @@
     return make_int (0);
 
   while (!(CHARP (args[0]) || MARKERP (args[0]) || INTEGERP (args[0])))
-    args[0] = wrong_type_argument (Qnumber_char_or_marker_p, args[0]);
+    args[0] = wrong_type_argument (Qinteger_char_or_marker_p, args[0]);
 
   result = args[0];
   if (CHARP (result))
@@ -2216,7 +2233,7 @@
   for (i = 1; i < nargs; i++)
     {
       while (!(CHARP (args[i]) || MARKERP (args[i]) || INTEGERP (args[i])))
-	args[i] = wrong_type_argument (Qnumber_char_or_marker_p, args[i]);
+	args[i] = wrong_type_argument (Qinteger_char_or_marker_p, args[i]);
       other = args[i];
       if (promote_args (&result, &other) == FIXNUM_T)
 	{
@@ -2235,7 +2252,7 @@
   Lisp_Object *args_end = args + nargs;
 
   while (args < args_end)
-    bits ^= integer_char_or_marker_to_int (*args++);
+    bits ^= fixnum_char_or_marker_to_int (*args++);
 
   return make_int (bits);
 #endif /* !HAVE_BIGNUM */
@@ -2247,6 +2264,9 @@
 */
        (number))
 {
+  while (!(CHARP (number) || MARKERP (number) || INTEGERP (number)))
+    number = wrong_type_argument (Qinteger_char_or_marker_p, number);
+
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (number))
     {
@@ -2254,7 +2274,8 @@
       return make_bignum_bg (scratch_bignum);
     }
 #endif /* HAVE_BIGNUM */
-  return make_int (~ integer_char_or_marker_to_int (number));
+
+  return make_int (~ fixnum_char_or_marker_to_int (number));
 }
 
 DEFUN ("%", Frem, 2, 2, 0, /*
@@ -2284,8 +2305,8 @@
       return Fcanonicalize_number (make_bignum_bg (scratch_bignum));
     }
 #else /* !HAVE_BIGNUM */
-  EMACS_INT ival1 = integer_char_or_marker_to_int (number1);
-  EMACS_INT ival2 = integer_char_or_marker_to_int (number2);
+  EMACS_INT ival1 = fixnum_char_or_marker_to_int (number1);
+  EMACS_INT ival2 = fixnum_char_or_marker_to_int (number2);
 
   if (ival2 == 0)
     Fsignal (Qarith_error, Qnil);
@@ -2592,7 +2613,7 @@
 		 int UNUSED (escapeflag))
 {
   if (print_readably)
-    printing_unreadable_object ("#<weak-list>");
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string_lisp (printcharfun, "#<weak-list %s %S>", 2,
 			 encode_weak_list_type (XWEAK_LIST (obj)->type),
@@ -2600,13 +2621,13 @@
 }
 
 static int
-weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+weak_list_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   struct weak_list *w1 = XWEAK_LIST (obj1);
   struct weak_list *w2 = XWEAK_LIST (obj2);
 
   return ((w1->type == w2->type) &&
-	  internal_equal (w1->list, w2->list, depth + 1));
+	  internal_equal_0 (w1->list, w2->list, depth + 1, foldcase));
 }
 
 static Hashcode
@@ -3064,21 +3085,21 @@
 }
 
 static void
-print_weak_box (Lisp_Object UNUSED (obj), Lisp_Object printcharfun,
+print_weak_box (Lisp_Object obj, Lisp_Object printcharfun,
 		int UNUSED (escapeflag))
 {
   if (print_readably)
-    printing_unreadable_object ("#<weak_box>");
-  write_fmt_string (printcharfun, "#<weak_box>");
+    printing_unreadable_lcrecord (obj, 0);
+  write_fmt_string (printcharfun, "#<weak-box>"); /* #### fix */
 }
 
 static int
-weak_box_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+weak_box_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   struct weak_box *wb1 = XWEAK_BOX (obj1);
   struct weak_box *wb2 = XWEAK_BOX (obj2);
 
-  return (internal_equal (wb1->value, wb2->value, depth + 1));
+  return (internal_equal_0 (wb1->value, wb2->value, depth + 1, foldcase));
 }
 
 static Hashcode
@@ -3286,19 +3307,20 @@
 }
 
 static void
-print_ephemeron (Lisp_Object UNUSED (obj), Lisp_Object printcharfun,
+print_ephemeron (Lisp_Object obj, Lisp_Object printcharfun,
 		 int UNUSED (escapeflag))
 {
   if (print_readably)
-    printing_unreadable_object ("#<ephemeron>");
-  write_fmt_string (printcharfun, "#<ephemeron>");
+    printing_unreadable_lcrecord (obj, 0);
+  write_fmt_string (printcharfun, "#<ephemeron>"); /* #### fix */
 }
 
 static int
-ephemeron_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+ephemeron_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   return
-    internal_equal (XEPHEMERON_REF (obj1), XEPHEMERON_REF(obj2), depth + 1);
+    internal_equal_0 (XEPHEMERON_REF (obj1), XEPHEMERON_REF(obj2), depth + 1,
+		      foldcase);
 }
 
 static Hashcode
@@ -3541,11 +3563,8 @@
   DEFSUBR (Fchar_to_int);
   DEFSUBR (Fint_to_char);
   DEFSUBR (Fchar_or_char_int_p);
-#ifdef HAVE_BIGNUM
   DEFSUBR (Ffixnump);
-#else
   DEFSUBR (Fintegerp);
-#endif
   DEFSUBR (Finteger_or_marker_p);
   DEFSUBR (Finteger_or_char_p);
   DEFSUBR (Finteger_char_or_marker_p);
@@ -3635,6 +3654,16 @@
   Vall_weak_boxes = Qnil;
   dump_add_weak_object_chain (&Vall_weak_boxes);
 
+  DEFVAR_CONST_INT ("most-negative-fixnum", &Vmost_negative_fixnum /*
+The fixnum closest in value to negative infinity.
+*/);
+  Vmost_negative_fixnum = EMACS_INT_MIN;
+
+  DEFVAR_CONST_INT ("most-positive-fixnum", &Vmost_positive_fixnum /*
+The fixnum closest in value to positive infinity.
+*/);
+  Vmost_positive_fixnum = EMACS_INT_MAX;
+
 #ifdef DEBUG_XEMACS
   DEFVAR_BOOL ("debug-issue-ebola-notices", &debug_issue_ebola_notices /*
 If non-zero, note when your code may be suffering from char-int confoundance.
--- a/src/database.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/database.c	Wed Feb 24 01:58:04 2010 -0600
@@ -85,26 +85,28 @@
 #endif /* HAVE_BERKELEY_DB */
 
 #ifdef HAVE_DBM
-#if defined (CYGWIN) || defined (MINGW)
+# ifdef TRUST_NDBM_H_PROTOTYPES
+#  include NDBM_H_FILE
+# else /* not TRUST_NDBM_H_PROTOTYPES */
+
+/* The prototypes in gdbm/ndbm.h currently are broken when compiling
+using C++, since they are of the form `datum dbm_firstkey()', without any
+args given. */
 
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
 #endif
 
-/* As of Cygwin 1.7.0, the prototypes in ndbm.h are broken when compiling
-using C++, since they are of the form `datum dbm_firstkey()', without any
-args given. */
 /* Parameters to dbm_store for simple insertion or replacement. */
 #define  DBM_INSERT  0
 #define  DBM_REPLACE 1
 
-
 /* The data and key structure.  This structure is defined for compatibility. */
-typedef struct {
-        char *dptr;
-        int   dsize;
-      } datum;
-
+typedef struct
+{
+  char *dptr;
+  int   dsize;
+} datum;
 
 /* The file information header. This is good enough for most applications. */
 typedef struct {int dummy[10];} DBM;
@@ -123,9 +125,7 @@
 }
 #endif
 
-#else
-#include NDBM_H_FILE
-#endif
+# endif /* (not) TRUST_NDBM_H_PROTOTYPES */
 Lisp_Object Qdbm;
 #endif /* HAVE_DBM */
 
@@ -217,7 +217,7 @@
   Lisp_Database *db = XDATABASE (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<database 0x%x>", db->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string_lisp (printcharfun, "#<database \"%s\" (%s/%s/",
 			 3, db->fname, db->funcs->get_type (db),
@@ -321,9 +321,9 @@
        keydatum = dbm_nextkey (db->dbm_handle))
     {
       valdatum = dbm_fetch (db->dbm_handle, keydatum);
-      key = make_ext_string ((Extbyte *) keydatum.dptr, keydatum.dsize,
+      key = make_extstring ((Extbyte *) keydatum.dptr, keydatum.dsize,
 			     db->coding_system);
-      val = make_ext_string ((Extbyte *) valdatum.dptr, valdatum.dsize,
+      val = make_extstring ((Extbyte *) valdatum.dptr, valdatum.dsize,
 			     db->coding_system);
       call2 (func, key, val);
     }
@@ -334,13 +334,12 @@
 {
   datum keydatum, valdatum;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, key,
-		      ALLOCA, (keydatum.dptr, keydatum.dsize),
-		      db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (key, keydatum.dptr, keydatum.dsize,
+				 db->coding_system);
   valdatum = dbm_fetch (db->dbm_handle, keydatum);
 
   return (valdatum.dptr
-	  ? make_ext_string ((Extbyte *) valdatum.dptr, valdatum.dsize,
+	  ? make_extstring ((Extbyte *) valdatum.dptr, valdatum.dsize,
 			     db->coding_system)
 	  : Qnil);
 }
@@ -351,12 +350,10 @@
 {
   datum keydatum, valdatum;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, val,
-		      ALLOCA, (valdatum.dptr, valdatum.dsize),
-		      db->coding_system);
-  TO_EXTERNAL_FORMAT (LISP_STRING, key,
-		      ALLOCA, (keydatum.dptr, keydatum.dsize),
-		      db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (val, valdatum.dptr, valdatum.dsize,
+				 db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (key, keydatum.dptr, keydatum.dsize,
+				 db->coding_system);
 
   return !dbm_store (db->dbm_handle, keydatum, valdatum,
 		     NILP (replace) ? DBM_INSERT : DBM_REPLACE);
@@ -367,9 +364,8 @@
 {
   datum keydatum;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, key,
-		      ALLOCA, (keydatum.dptr, keydatum.dsize),
-		      db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (key, keydatum.dptr, keydatum.dsize,
+				 db->coding_system);
 
   return dbm_delete (db->dbm_handle, keydatum);
 }
@@ -456,9 +452,8 @@
   xzero (keydatum);
   xzero (valdatum);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, key,
-		      ALLOCA, (keydatum.data, keydatum.size),
-		      db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (key, keydatum.data, keydatum.size,
+				 db->coding_system);
 
 #if DB_VERSION_MAJOR == 1
   status = db->db_handle->get (db->db_handle, &keydatum, &valdatum, 0);
@@ -467,7 +462,7 @@
 #endif /* DB_VERSION_MAJOR */
 
   if (!status)
-    return make_ext_string ((const Extbyte *) valdatum.data, valdatum.size,
+    return make_extstring ((const Extbyte *) valdatum.data, valdatum.size,
 			    db->coding_system);
 
 #if DB_VERSION_MAJOR == 1
@@ -492,12 +487,10 @@
   xzero (keydatum);
   xzero (valdatum);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, key,
-		      ALLOCA, (keydatum.data, keydatum.size),
-		      db->coding_system);
-  TO_EXTERNAL_FORMAT (LISP_STRING, val,
-		      ALLOCA, (valdatum.data, valdatum.size),
-		      db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (key, keydatum.data, keydatum.size,
+				 db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (val, valdatum.data, valdatum.size,
+				 db->coding_system);
 #if DB_VERSION_MAJOR == 1
   status = db->db_handle->put (db->db_handle, &keydatum, &valdatum,
  			       NILP (replace) ? R_NOOVERWRITE : 0);
@@ -520,9 +513,8 @@
   /* DB Version 2 requires DBT's to be zeroed before use. */
   xzero (keydatum);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, key,
-		      ALLOCA, (keydatum.data, keydatum.size),
-		      db->coding_system);
+  LISP_STRING_TO_SIZED_EXTERNAL (key, keydatum.data, keydatum.size,
+				 db->coding_system);
 
 #if DB_VERSION_MAJOR == 1
   status = db->db_handle->del (db->db_handle, &keydatum, 0);
@@ -558,9 +550,9 @@
        status == 0;
        status = dbp->seq (dbp, &keydatum, &valdatum, R_NEXT))
     {
-      key = make_ext_string ((const Extbyte *) keydatum.data, keydatum.size,
+      key = make_extstring ((const Extbyte *) keydatum.data, keydatum.size,
 			     db->coding_system);
-      val = make_ext_string ((const Extbyte *) valdatum.data, valdatum.size,
+      val = make_extstring ((const Extbyte *) valdatum.data, valdatum.size,
 			     db->coding_system);
       call2 (func, key, val);
     }
@@ -577,9 +569,9 @@
 	 status == 0;
 	 status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_NEXT))
       {
-	key = make_ext_string ((const Extbyte *) keydatum.data, keydatum.size,
+	key = make_extstring ((const Extbyte *) keydatum.data, keydatum.size,
 			       db->coding_system);
-	val = make_ext_string ((const Extbyte *) valdatum.data, valdatum.size,
+	val = make_extstring ((const Extbyte *) valdatum.data, valdatum.size,
 			       db->coding_system);
 	call2 (func, key, val);
       }
@@ -647,7 +639,7 @@
   int modemask;
   int accessmask = 0;
   Lisp_Database *db = NULL;
-  char *filename;
+  Extbyte *filename;
   struct gcpro gcpro1, gcpro2;
 
   CHECK_STRING (file);
@@ -655,9 +647,7 @@
   file = Fexpand_file_name (file, Qnil);
   UNGCPRO;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, file,
-		      C_STRING_ALLOCA, filename,
-		      Qfile_name);
+  LISP_PATHNAME_CONVERT_OUT (file, filename);
 
   if (NILP (access_))
     {
@@ -665,16 +655,16 @@
     }
   else
     {
-      char *acc;
+      Ibyte *acc;
       CHECK_STRING (access_);
-      acc = (char *) XSTRING_DATA (access_);
+      acc = XSTRING_DATA (access_);
 
-      if (strchr (acc, '+'))
+      if (qxestrchr (acc, '+'))
 	accessmask |= O_CREAT;
 
       {
-	char *rp = strchr (acc, 'r');
-	char *wp = strchr (acc, 'w');
+	int rp = !!qxestrchr (acc, 'r');
+	int wp = !!qxestrchr (acc, 'w');
 	if (rp && wp) accessmask |= O_RDWR;
 	else if (wp)  accessmask |= O_WRONLY;
 	else          accessmask |= O_RDONLY;
--- a/src/debug.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/debug.c	Wed Feb 24 01:58:04 2010 -0600
@@ -207,4 +207,5 @@
 void
 vars_of_debug (void)
 {
+  Fprovide (intern ("debug-xemacs"));
 }
--- a/src/depend	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/depend	Wed Feb 24 01:58:04 2010 -0600
@@ -15,24 +15,27 @@
 #endif
 
 #if defined(HAVE_MS_WINDOWS)
-console-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h
-device-msw.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-msw.h objects.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h
+console-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h
+device-msw.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-msw.h objects.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h
 dialog-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 dired-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console-msw.h console.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h regex.h symeval.h symsinit.h syntax.h sysdir.h sysfile.h sysfloat.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h
-event-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-frame-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+event-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console-stream-impl.h console-stream.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+frame-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs-msw.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-gui-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-menubar-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+gui-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+menubar-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 objects-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device-impl.h device.h devslots.h dumper.h elhash.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h opaque.h specifier.h symeval.h symsinit.h syswindows.h text.h vdb.h
-redisplay-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-scrollbar-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+redisplay-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h debug.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gutter.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+scrollbar-msw.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h dumper.h elhash.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 select-msw.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select.h specifier.h symeval.h symsinit.h syswindows.h text.h vdb.h
 toolbar-msw.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h device.h dumper.h elhash.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-msw.h glyphs.h gui.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syswindows.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 #endif
 #if defined(HAVE_XLIKE)
 event-xlike-inc.o: 
-objects-xlike-inc.o: 
+objects-xlike-inc.o: $(LWLIB_SRCDIR)/lwlib.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h gccache-gtk.h gccache-x.h glyphs-gtk.h glyphs-x.h glyphs.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysgtk.h window-impl.h window.h winslots.h xintrinsic.h
+redisplay-xlike-inc.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+select-xlike-inc.o: 
+toolbar-xlike.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar-xlike.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 #endif
 #if defined(HAVE_X_WINDOWS)
 EmacsFrame.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
@@ -42,54 +45,54 @@
 balloon-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h balloon_help.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
 balloon_help.o: $(CONFIG_H) balloon_help.h compiler.h xintrinsic.h
 console-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-device-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h systime.h text.h vdb.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h
-dialog-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h xintrinsic.h
-frame-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
-glyphs-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
-gui-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
+device-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-x.h general-slots.h glyphs-x.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h
+dialog-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h xintrinsic.h
+frame-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gutter.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+gccache-x.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h gccache-x.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
+glyphs-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
+gui-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h glyphs.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xmotif.h
 intl-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h compiler.h console-x.h console.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-menubar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
-objects-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h elhash.h font-mgr.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-redisplay-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+menubar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+objects-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h device-impl.h device.h devslots.h dumper.h elhash.h font-mgr.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+redisplay-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 scrollbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
-select-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h xintrinsic.h xmotif.h
-toolbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-common.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
-xgccache.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h xgccache.h
+select-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h opaque.h redisplay.h select-xlike-inc.c select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h xintrinsic.h xmotif.h
+toolbar-x.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h charset.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-xlike.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
 #endif
 #if defined(HAVE_TTY)
-console-tty.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h dumper.h elhash.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systty.h text.h vdb.h window-impl.h window.h winslots.h
-device-tty.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h text.h vdb.h
-event-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h text.h vdb.h
-frame-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h systime.h systty.h text.h vdb.h
+console-tty.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h dumper.h elhash.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systty.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+device-tty.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
+event-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h text.h vdb.h
+frame-tty.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h systime.h systty.h text.h vdb.h
 objects-tty.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h specifier.h symeval.h symsinit.h systty.h text.h vdb.h
-redisplay-tty.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h
+redisplay-tty.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-tty-impl.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h
 #endif
 #if defined(HAVE_GTK)
-console-gtk.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
-device-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h text.h vdb.h window-impl.h window.h winslots.h
-dialog-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h events.h frame.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
+console-gtk.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h
+device-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysgdkx.h sysgtk.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+dialog-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h events.h frame.h gc.h general-slots.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h systime.h text.h vdb.h window.h
 emacs-marshals.o: hash.h
 emacs-widget-accessors.o: 
-event-gtk.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-gtk.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gtk-xemacs.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window.h
-frame-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
-gccache-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h gccache-gtk.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
+event-gtk.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gtk-xemacs.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgdkx.h sysgtk.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window.h
+frame-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gtk-xemacs.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgdkx.h sysgtk.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
+gccache-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h gccache-gtk.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysgtk.h text.h vdb.h
 glade.o: bytecode.h
-glyphs-gtk.o: $(CONFIG_H) $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysfile.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
-gtk-glue.o: objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h
-gtk-xemacs.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h event-gtk.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-gui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
-menubar-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
-native-gtk-toolbar.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h console-gtk.h console.h dumper.h faces.h frame.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
-objects-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-xlike-inc.c objects.h specifier.h symeval.h symsinit.h text.h vdb.h
-redisplay-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h general-slots.h glyphs-gtk.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h
-scrollbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-select-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select-common.h select.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h
-toolbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h toolbar-common.h vdb.h
+glyphs-gtk.o: $(CONFIG_H) $(LISP_H) bitmaps.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h gui.h imgproc.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysfile.h sysgdkx.h sysgtk.h systime.h syswindows.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
+gtk-glue.o: console-gtk.h console.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h specifier.h sysgtk.h
+gtk-xemacs.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gtk-xemacs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h
+gui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h
+menubar-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgtk.h systime.h text.h ui-gtk.h vdb.h window-impl.h window.h winslots.h
+native-gtk-toolbar.o: $(CONFIG_H) $(LISP_H) charset.h compiler.h console-gtk.h console.h dumper.h faces.h frame.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+objects-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h device-impl.h device.h devslots.h dumper.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects-xlike-inc.c objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysgdkx.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+redisplay-gtk.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console-xlike-inc.h console.h debug.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h gccache-gtk.h gccache-x.h general-slots.h glyphs-gtk.h glyphs-x.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects-x-impl.h objects-x.h objects.h redisplay-xlike-inc.c redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysgdkx.h sysgtk.h sysproc.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h xmprimitivep.h
+scrollbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-gtk.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar-gtk.h scrollbar.h specifier.h symeval.h symsinit.h sysgtk.h text.h vdb.h window-impl.h window.h winslots.h
+select-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h select-xlike-inc.c select.h specifier.h symeval.h symsinit.h sysgtk.h systime.h text.h vdb.h
+toolbar-gtk.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h sysgtk.h text.h toolbar-xlike.h vdb.h
 ui-byhand.o: gui.h
-ui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h dumper.h elhash.h emacs-marshals.c emacs-widget-accessors.c event-gtk.h events.h faces.h gc.h general-slots.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h systime.h text.h ui-byhand.c ui-gtk.h vdb.h window-impl.h window.h winslots.h
+ui-gtk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console.h device.h dumper.h elhash.h emacs-marshals.c emacs-widget-accessors.c events.h faces.h gc.h general-slots.h glade.c glyphs-gtk.h glyphs.h gtk-glue.c gui.h hash.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-gtk-impl.h objects-gtk.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdll.h sysgtk.h systime.h text.h ui-byhand.c ui-gtk.h vdb.h window-impl.h window.h winslots.h
 #endif
 #if defined(HAVE_DATABASE)
-database.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h database.h dumper.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
+database.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h database.h dumper.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 #endif
 #if defined(MULE)
 mule-ccl.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h mule-ccl.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
@@ -105,93 +108,93 @@
 extw-Xt.o: $(CONFIG_H) compiler.h extw-Xlib.h extw-Xt.h
 #endif
 abbrev.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h text.h vdb.h window.h
-alloc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h text.h vdb.h window-impl.h window.h winslots.h
+alloc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 alloca.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-alsaplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h text.h vdb.h
+alsaplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 blocktype.o: $(CONFIG_H) $(LISP_H) blocktype.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 buffer.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h syntax.h sysdir.h sysfile.h syswindows.h text.h vdb.h window.h
-bytecode.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h text.h vdb.h window.h
-callint.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h events.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
+bytecode.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode-ops.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h text.h vdb.h window.h
+callint.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h events.h gc.h general-slots.h insdel.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
 casefiddle.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
 casetab.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 chartab.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
 cm.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h systty.h text.h vdb.h
-cmdloop.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window.h
+cmdloop.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-msw.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h syswindows.h text.h vdb.h window.h
 cmds.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h extents.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
-console-stream.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h systty.h text.h vdb.h window.h
-console.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h systty.h text.h vdb.h window.h
+console-stream.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h systty.h syswindows.h text.h vdb.h window.h
+console.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h systty.h text.h vdb.h window.h
 data.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfloat.h syssignal.h text.h vdb.h
 debug.o: $(CONFIG_H) $(LISP_H) bytecode.h compiler.h debug.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-device.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h text.h toolbar.h vdb.h window.h
+device.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h text.h toolbar.h vdb.h window.h
 dialog.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h
 dired.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h dumper.h elhash.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h regex.h symeval.h symsinit.h syntax.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h syswindows.h text.h vdb.h
-doc.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
+doc.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 doprnt.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 dragdrop.o: $(CONFIG_H) $(LISP_H) compiler.h dragdrop.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 dump-data.o: $(CONFIG_H) $(LISP_H) compiler.h dump-data.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 dumper.o: $(CONFIG_H) $(LISP_H) coding-system-slots.h compiler.h console-stream.h console.h dump-data.h dumper.h elhash.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 dynarr.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 ecrt0.o: $(CONFIG_H)
-editfns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h text.h vdb.h window.h
+editfns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window.h
 elhash.o: $(CONFIG_H) $(LISP_H) bytecode.h compiler.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 emacs.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h console-msw.h console.h dump-data.h dumper.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h paths.h process.h redisplay.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
 emodules.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h dumper.h emodules.h file-coding.h frame.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdll.h text.h vdb.h window.h
-esd.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h text.h vdb.h
+esd.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 eval.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device.h dumper.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window.h
-event-Xt.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h
-event-stream.o: $(CONFIG_H) $(LISP_H) backtrace.h blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h macros.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h text.h vdb.h window-impl.h window.h winslots.h
-event-unixoid.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h
-events.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h extents.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h systty.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
-extents.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h debug.h device.h dumper.h elhash.h extents-impl.h extents.h faces.h frame.h gc.h general-slots.h glyphs.h gutter.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
+event-Xt.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-tty.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dragdrop.h dumper.h elhash.h event-xlike-inc.c events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-x.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h xintrinsicp.h xmotif.h
+event-stream.o: $(CONFIG_H) $(LISP_H) backtrace.h blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h events.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h insdel.h intl-auto-encap-win32.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h macros.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+event-unixoid.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h text.h vdb.h
+events.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device.h dumper.h events.h extents.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h systty.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+extents.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h debug.h device.h dumper.h elhash.h extents-impl.h extents.h faces.h frame.h gc.h general-slots.h glyphs.h gutter.h insdel.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 faces.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h extents-impl.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 file-coding.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h extents.h file-coding.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h symeval.h symsinit.h text.h vdb.h
-fileio.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
-filelock.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h paths.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h text.h vdb.h
-filemode.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
+fileio.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h profile.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+filelock.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h paths.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h
+filemode.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 floatfns.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfloat.h syssignal.h text.h vdb.h
-fns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h events.h extents.h frame.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h redisplay.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h text.h vdb.h
+fns.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h events.h extents.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h redisplay.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
 font-lock.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
-font-mgr.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h font-mgr.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h
-frame.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+font-mgr.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h font-mgr.h gc.h general-slots.h hash.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-x-impl.h objects-x.h objects.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h xintrinsic.h
+frame.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h extents.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 free-hook.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-gc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h text.h vdb.h window-impl.h window.h winslots.h
+gc.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console-stream.h console.h device.h dumper.h elhash.h events.h extents-impl.h extents.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 general.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-getloadavg.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
-glyphs-eimage.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
-glyphs-shared.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h dumper.h elhash.h faces.h frame.h gc.h general-slots.h glyphs.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
+getloadavg.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
+glyphs-eimage.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h file-coding.h frame.h gc.h general-slots.h glyphs.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
+glyphs-shared.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h dumper.h elhash.h faces.h frame.h gc.h general-slots.h glyphs.h imgproc.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 glyphs-widget.o: $(CONFIG_H) $(LISP_H) bytecode.h charset.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame.h gc.h general-slots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-glyphs.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h text.h vdb.h window-impl.h window.h winslots.h
+glyphs.o: $(CONFIG_H) $(LISP_H) blocktype.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 gmalloc.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysdep.h text.h vdb.h
-gpmevent.o: $(CONFIG_H) $(LISP_H) commands.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h gpmevent.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h
+gpmevent.o: $(CONFIG_H) $(LISP_H) commands.h compiler.h conslots.h console-impl.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h gpmevent.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h systty.h text.h vdb.h
 gui.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h dumper.h elhash.h gc.h general-slots.h gui.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h redisplay.h symeval.h symsinit.h text.h vdb.h
 gutter.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 hash.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 hpplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h text.h vdb.h
 imgproc.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h imgproc.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 indent.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h extents.h faces.h frame.h gc.h general-slots.h glyphs.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-inline.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h font-mgr.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h intl-auto-encap-win32.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdll.h sysfile.h systime.h syswindows.h text.h toolbar.h tooltalk.h ui-gtk.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+inline.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h conslots.h console-gtk.h console-impl.h console-msw.h console.h database.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h font-mgr.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs-x.h glyphs.h gui.h intl-auto-encap-win32.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdll.h sysfile.h sysgtk.h systime.h syswindows.h text.h toolbar.h tooltalk.h ui-gtk.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 input-method-motif.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h specifier.h symeval.h symsinit.h text.h vdb.h xintrinsic.h xmotif.h
-input-method-xlib.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
+input-method-xlib.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 insdel.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h console.h device.h dumper.h extents.h frame.h gc.h general-slots.h insdel.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h symeval.h symsinit.h text.h vdb.h
 intl-auto-encap-win32.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syswindows.h text.h vdb.h
 intl-encap-win32.o: $(CONFIG_H) $(LISP_H) compiler.h console-msw.h console.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syswindows.h text.h vdb.h
 intl-win32.o: $(CONFIG_H) $(LISP_H) charset.h coding-system-slots.h compiler.h conslots.h console-impl.h console-msw-impl.h console-msw.h console.h dumper.h elhash.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects-msw-impl.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syswindows.h text.h vdb.h window-impl.h window.h winslots.h
 intl.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-keymap.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h events.h extents.h frame.h gc.h general-slots.h insdel.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
+keymap.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h events.h extents.h frame.h gc.h general-slots.h insdel.h keymap-buttons.h keymap-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
 lastfile.o: $(CONFIG_H)
 libinterface.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h libinterface.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-libsst.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h libsst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h text.h vdb.h
+libsst.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h libsst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 line-number.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-linuxplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h systty.h text.h vdb.h
+linuxplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h systty.h syswindows.h text.h vdb.h
 lread.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h profile.h symeval.h symsinit.h sysfile.h sysfloat.h syswindows.h text.h vdb.h
-lstream.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
-macros.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h macros.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
+lstream.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
+macros.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device.h dumper.h events.h frame.h gc.h general-slots.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h macros.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window.h
 marker.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 mc-alloc.o: $(CONFIG_H) $(LISP_H) blocktype.h compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 md5.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-menubar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-minibuf.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-stream.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
-miscplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h text.h vdb.h
+menubar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h gui.h keymap-buttons.h keymap.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
+minibuf.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console-stream.h console.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h insdel.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h text.h vdb.h window-impl.h window.h winslots.h
+miscplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h miscplay.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h syssignal.h syswindows.h text.h vdb.h
 nas.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysdep.h syssignal.h text.h vdb.h
 nt.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h text.h vdb.h
 ntheap.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysdep.h syswindows.h text.h vdb.h
@@ -202,50 +205,49 @@
 objects.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h elhash.h faces.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects-impl.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systty.h text.h vdb.h window-impl.h window.h winslots.h
 opaque.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 print.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-msw.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h extents.h frame.h gc.h general-slots.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h redisplay.h specifier.h symeval.h symsinit.h sysfile.h systty.h syswindows.h text.h vdb.h
-process-nt.o: $(CONFIG_H) $(LISP_H) compiler.h console-msw.h console.h dumper.h events.h gc.h general-slots.h hash.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process-slots.h process.h procimpl.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
-process-unix.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h text.h vdb.h window.h
-process.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h insdel.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
+process-nt.o: $(CONFIG_H) $(LISP_H) compiler.h console-msw.h console.h dumper.h events.h gc.h general-slots.h hash.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h process-slots.h process.h procimpl.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
+process-unix.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h console.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
+process.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h console.h device.h dumper.h events.h file-coding.h frame.h gc.h general-slots.h hash.h insdel.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h process-slots.h process.h procimpl.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
 profile.o: $(CONFIG_H) $(LISP_H) backtrace.h bytecode.h compiler.h dumper.h elhash.h gc.h general-slots.h hash.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h profile.h symeval.h symsinit.h syssignal.h systime.h text.h vdb.h
 ralloc.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 rangetab.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h rangetab.h symeval.h symsinit.h text.h vdb.h
 realpath.o: $(CONFIG_H) $(LISP_H) backtrace.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h profile.h symeval.h symsinit.h sysdir.h sysfile.h syswindows.h text.h vdb.h
 redisplay-output.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
-redisplay.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h insdel.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h systty.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
+redisplay.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h commands.h compiler.h conslots.h console-impl.h console-tty.h console.h debug.h device-impl.h device.h devslots.h dumper.h elhash.h events.h extents-impl.h extents.h faces.h file-coding.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gui.h gutter.h insdel.h intl-auto-encap-win32.h keymap-buttons.h line-number.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h menubar.h number-gmp.h number-mp.h number.h objects-impl.h objects.h opaque.h process.h profile.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h systime.h systty.h syswindows.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 regex.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h regex.h symeval.h symsinit.h syntax.h text.h vdb.h
 scrollbar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h commands.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h gutter.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 search.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h insdel.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h regex.h symeval.h symsinit.h syntax.h text.h vdb.h
 select.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h extents.h frame.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h objects.h opaque.h redisplay.h select.h specifier.h symeval.h symsinit.h text.h vdb.h
-sgiplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h libst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h text.h vdb.h
-sheap.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sheap-adjust.h symeval.h symsinit.h sysfile.h text.h vdb.h
-signal.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h text.h vdb.h
+sgiplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h libst.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h
+sheap.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sheap-adjust.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
+signal.o: $(CONFIG_H) $(LISP_H) compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h events.h frame-impl.h frame.h frameslots.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h redisplay.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h syswindows.h text.h vdb.h
 sound.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h sound.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h syswindows.h text.h vdb.h xintrinsic.h
-specifier.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
+specifier.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h elhash.h frame.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h vdb.h window-impl.h window.h winslots.h
 strcat.o: $(CONFIG_H)
 strftime.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-sunplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h text.h vdb.h
+sunplay.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h sound.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h syswindows.h text.h vdb.h
 sunpro.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
-symbols.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h text.h vdb.h
+symbols.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h bytecode.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h specifier.h symeval.h symsinit.h text.h vdb.h
 syntax.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h extents.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h syntax.h text.h vdb.h
-sysdep.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
+sysdep.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console-stream-impl.h console-stream.h console-tty-impl.h console-tty.h console.h device-impl.h device.h devslots.h dumper.h events.h frame.h gc.h general-slots.h intl-auto-encap-win32.h keymap-buttons.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h ndir.h number-gmp.h number-mp.h number.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h systty.h syswait.h syswindows.h text.h vdb.h window.h
 sysdll.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysdll.h sysfile.h syswindows.h text.h vdb.h
 termcap.o: $(CONFIG_H) $(LISP_H) compiler.h console.h device.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 terminfo.o: $(CONFIG_H)
 tests.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h elhash.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h symeval.h symsinit.h text.h vdb.h
 text.o: $(CONFIG_H) $(LISP_H) backtrace.h buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h lstream.h mc-alloc.h number-gmp.h number-mp.h number.h profile.h symeval.h symsinit.h text.h vdb.h
-toolbar-common.o: $(CONFIG_H) $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h charset.h compiler.h conslots.h console-gtk-impl.h console-gtk.h console-impl.h console-x-impl.h console-x.h console.h device-impl.h device.h devslots.h dumper.h faces.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar-common.h toolbar.h vdb.h window-impl.h window.h winslots.h xintrinsic.h
 toolbar.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h conslots.h console-impl.h console.h device-impl.h device.h devslots.h dumper.h frame-impl.h frame.h frameslots.h gc.h general-slots.h glyphs.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h text.h toolbar.h vdb.h window-impl.h window.h winslots.h
 tooltalk.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h elhash.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h process.h symeval.h symsinit.h syssignal.h text.h tooltalk.h vdb.h
 tparam.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 undo.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h compiler.h dumper.h extents.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 unexaix.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 unexalpha.o: $(CONFIG_H) compiler.h
-unexcw.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h text.h vdb.h
+unexcw.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 unexec.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h getpagesize.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 unexelf.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 unexhp9k800.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 unexnt.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 unexsol2-6.o: compiler.h
-unicode.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h extents.h file-coding.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h symeval.h symsinit.h sysfile.h text.h vdb.h
+unicode.o: $(CONFIG_H) $(LISP_H) buffer.h bufslots.h casetab.h charset.h chartab.h coding-system-slots.h compiler.h dumper.h extents.h file-coding.h gc.h general-slots.h intl-auto-encap-win32.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h opaque.h rangetab.h symeval.h symsinit.h sysfile.h syswindows.h text.h vdb.h
 vdb-fake.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 vdb-mach.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
 vdb-posix.o: $(CONFIG_H) $(LISP_H) compiler.h dumper.h gc.h general-slots.h lisp-disunion.h lisp-union.h lisp.h lrecord.h mc-alloc.h number-gmp.h number-mp.h number.h symeval.h symsinit.h text.h vdb.h
--- a/src/device-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/device-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -234,7 +234,7 @@
 
   /* Attempt to load a site-specific gtkrc */
   {
-    Lisp_Object gtkrc = Fexpand_file_name (build_string ("gtkrc"), Vdata_directory);
+    Lisp_Object gtkrc = Fexpand_file_name (build_ascstring ("gtkrc"), Vdata_directory);
     gchar **default_files = gtk_rc_get_default_files ();
     gint num_files;
 
@@ -248,7 +248,7 @@
 
 	new_rc_files = xnew_array_and_zero (gchar *, num_files + 3);
 
-	LISP_STRING_TO_EXTERNAL (gtkrc, new_rc_files[0], Qfile_name);
+	LISP_PATHNAME_CONVERT_OUT (gtkrc, new_rc_files[0]);
 
 	for (ctr = 1; default_files[ctr-1]; ctr++)
 	  new_rc_files[ctr] = g_strdup (default_files[ctr-1]);
@@ -258,7 +258,7 @@
 	for (ctr = 1; new_rc_files[ctr]; ctr++)
 	  free(new_rc_files[ctr]);
 
-	xfree (new_rc_files, gchar **);
+	xfree (new_rc_files);
       }
   }
 
@@ -354,7 +354,7 @@
 static void
 free_gtk_device_struct (struct device *d)
 {
-  xfree (d->device_data, void *);
+  xfree (d->device_data);
 }
 #endif /* not NEW_GC */
 
@@ -664,7 +664,7 @@
 
   result = nconc2 (result, list2 (Qfont, convert_font (style->font)));
 
-#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_string (style->rc_style->bg_pixmap_name[state]) : Qnil)
+#define FROB_PIXMAP(state) (style->rc_style->bg_pixmap_name[state] ? build_cistring (style->rc_style->bg_pixmap_name[state]) : Qnil)
 
   if (style->rc_style)
     result = nconc2 (result, list2 (Qbackground,
@@ -744,7 +744,8 @@
   Qgtk_seen_characters = Qnil;
 }
 
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
+
 static void
 gtk_device_init_x_specific_cruft (struct device *d)
 {
--- a/src/device-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/device-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -300,7 +300,7 @@
 
   DeleteDC (DEVICE_MSWINDOWS_HCDC (d));
 #ifndef NEW_GC
-  xfree (d->device_data, void *);
+  xfree (d->device_data);
 #endif /* not NEW_GC */
 }
 
@@ -441,7 +441,7 @@
 
   DEVICE_MSPRINTER_NAME (d) = printer_name;
 
-  LISP_STRING_TO_TSTR (printer_name, printer_ext);
+  printer_ext = LISP_STRING_TO_TSTR (printer_name);
 
   if (!qxeOpenPrinter (printer_ext, &DEVICE_MSPRINTER_HPRINTER (d), NULL))
     {
@@ -493,7 +493,7 @@
   if (qxeGetProfileString (XETEXT ("windows"), XETEXT ("device"), NULL, name,
 			   sizeof (name) / XETCHAR_SIZE) <= 0)
     return Qnil;
-  TSTR_TO_C_STRING (name, nameint);
+  nameint = TSTR_TO_ITEXT (name);
 
   if (nameint[0] == '\0')
     return Qnil;
@@ -502,7 +502,7 @@
      name[] or ALLOCA ()ed */
   qxestrtok (nameint, ",");
 
-  return build_intstring (nameint);
+  return build_istring (nameint);
 }
 
 
@@ -539,7 +539,7 @@
   if (!msprinter_init_device_internal (d, DEVICE_CONNECTION (d)))
     signal_open_printer_error (d);
 
-  LISP_STRING_TO_TSTR (DEVICE_CONNECTION (d), printer_name);
+  printer_name = LISP_STRING_TO_TSTR (DEVICE_CONNECTION (d));
   /* Determine DEVMODE size and store the default DEVMODE */
   dm_size = qxeDocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER (d),
 				   printer_name, NULL, NULL, 0);
@@ -573,7 +573,7 @@
 	}
 
 #ifndef NEW_GC
-      xfree (d->device_data, void *);
+      xfree (d->device_data);
 #endif /* not NEW_GC */
     }
 }
@@ -652,7 +652,7 @@
 {
   /* Change connection if the device changed */
   if (!NILP (devname)
-      && lisp_strcasecmp (devname, DEVICE_MSPRINTER_NAME (d)) != 0)
+      && lisp_strcasecmp_i18n (devname, DEVICE_MSPRINTER_NAME (d)) != 0)
     {
       Lisp_Object new_connection = devname;
 
@@ -666,7 +666,7 @@
 	  Ibyte new_connext[20];
 
 	  qxesprintf (new_connext, ":%X", d->header.uid);
-	  new_connection = concat2 (devname, build_intstring (new_connext));
+	  new_connection = concat2 (devname, build_istring (new_connext));
 	}
       DEVICE_CONNECTION (d) = new_connection;
 
@@ -681,7 +681,7 @@
   {
     Extbyte *nameext;
 
-    LISP_STRING_TO_TSTR (DEVICE_MSPRINTER_NAME (d), nameext);
+    nameext = LISP_STRING_TO_TSTR (DEVICE_MSPRINTER_NAME (d));
 
     /* Apply the new devmode to the printer */
     qxeDocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER (d),
@@ -1037,7 +1037,7 @@
       Extbyte *nameext;
       LONG dm_size;
 
-      LISP_STRING_TO_TSTR (DEVICE_MSPRINTER_NAME (d), nameext);
+      nameext = LISP_STRING_TO_TSTR (DEVICE_MSPRINTER_NAME (d));
       dm_size = qxeDocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER (d),
 				       nameext, NULL, NULL, 0);
       if (dm_size <= 0)
@@ -1148,9 +1148,8 @@
 {
   Lisp_Devmode *dm = XDEVMODE (obj);
   if (print_readably)
-    printing_unreadable_object ("#<msprinter-settings 0x%x>",
-				dm->header.uid);
-  write_c_string (printcharfun, "#<msprinter-settings");
+    printing_unreadable_lcrecord (obj, 0);
+  write_ascstring (printcharfun, "#<msprinter-settings");
   if (!NILP (dm->printer_name))
     write_fmt_string_lisp (printcharfun, " for %S", 1, dm->printer_name);
   if (!NILP (dm->device))
@@ -1167,7 +1166,8 @@
 }
 
 static int
-equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+equal_devmode (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	       int UNUSED (foldcase))
 {
   Lisp_Devmode *dm1 = XDEVMODE (obj1);
   Lisp_Devmode *dm2 = XDEVMODE (obj2);
@@ -1180,7 +1180,7 @@
     return 0;
   if (NILP (dm1->printer_name) || NILP (dm2->printer_name))
     return 1;
-  return lisp_strcasecmp (dm1->printer_name, dm2->printer_name) == 0;
+  return lisp_strcasecmp_i18n (dm1->printer_name, dm2->printer_name) == 0;
 }
 
 static Hashcode
--- a/src/device-tty.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/device-tty.c	Wed Feb 24 01:58:04 2010 -0600
@@ -116,7 +116,7 @@
 free_tty_device_struct (struct device *d)
 {
   if (d->device_data)
-    xfree (d->device_data, void *);
+    xfree (d->device_data);
 }
 
 static void
--- a/src/device-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/device-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -53,7 +53,7 @@
 #include <X11/CoreP.h>		/* Numerous places access the fields of
 				   a core widget directly.  We could
 				   use XtGetValues(), but ... */
-#include "xgccache.h"
+#include "gccache-x.h"
 #include <X11/Shell.h>
 #include <X11/Xmu/Error.h>
 
@@ -208,7 +208,7 @@
   last_xrm_db = db;
 
   locale = XrmLocaleOfDatabase (db);
-  localestr = build_ext_string (locale, Qbinary);
+  localestr = build_extstring (locale, Qbinary);
   last_coding_system = call1 (Qget_coding_system_from_locale, localestr);
 
   return last_coding_system;
@@ -263,9 +263,9 @@
     {
       Ibyte *app_name_int, *app_class_int, *value_addr_int;
       Lisp_Object codesys = coding_system_of_xrm_database (XtDatabase (dpy));
-      EXTERNAL_TO_C_STRING (app_name, app_name_int, codesys);
-      EXTERNAL_TO_C_STRING (app_class, app_class_int, codesys);
-      EXTERNAL_TO_C_STRING (value.addr, value_addr_int, codesys);
+      app_name_int = EXTERNAL_TO_ITEXT (app_name, codesys);
+      app_class_int = EXTERNAL_TO_ITEXT (app_class, codesys);
+      value_addr_int = EXTERNAL_TO_ITEXT (value.addr, codesys);
 
       warn_when_safe (Qgeometry, Qerror,
 		      "\n"
@@ -387,7 +387,7 @@
   Bytecount len;
   Extbyte *data;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, str, ALLOCA, (data, len), Qbinary);
+  LISP_STRING_TO_SIZED_EXTERNAL (str, data, len, Qbinary); 
   Dynarr_add_many (cda, data, len);
   validify_resource_component (Dynarr_atp (cda, Dynarr_length (cda) - len),
 			       len);
@@ -583,7 +583,8 @@
       {
 	/* Look for the Xaw3d function */
 	dll_func xaw_function_handle =
-	  dll_function (xaw_dll_handle, "Xaw3dComputeTopShadowRGB");
+	  dll_function (xaw_dll_handle,
+			(const Ibyte *) "Xaw3dComputeTopShadowRGB");
 
 	/* If we found it, warn the user in big, nasty, unfriendly letters */
 	if (xaw_function_handle != NULL)
@@ -621,7 +622,7 @@
 
   make_argc_argv (Vx_initial_argv_list, &argc, &argv);
 
-  LISP_STRING_TO_EXTERNAL (display, disp_name, Qctext);
+  disp_name = LISP_STRING_TO_EXTERNAL (display, Qctext);
 
   /*
    * Break apart the old XtOpenDisplay call into XOpenDisplay and
@@ -645,7 +646,7 @@
 
   if (STRINGP (Vx_emacs_application_class) &&
       XSTRING_LENGTH (Vx_emacs_application_class) > 0)
-    LISP_STRING_TO_EXTERNAL (Vx_emacs_application_class, app_class, Qctext);
+    app_class = LISP_STRING_TO_EXTERNAL (Vx_emacs_application_class, Qctext);
   else
     {
       if (egetenv ("USE_EMACS_AS_DEFAULT_APPLICATION_CLASS"))
@@ -665,7 +666,7 @@
 	}
 
       /* need to update Vx_emacs_application_class: */
-      Vx_emacs_application_class = build_string (app_class);
+      Vx_emacs_application_class = build_cistring (app_class);
     }
 
   slow_down_interrupts ();
@@ -694,14 +695,13 @@
     if (STRINGP (Vx_app_defaults_directory) &&
 	XSTRING_LENGTH (Vx_app_defaults_directory) > 0)
       {
-	LISP_STRING_TO_EXTERNAL (Vx_app_defaults_directory, data_dir,
-				 Qfile_name);
+	LISP_PATHNAME_CONVERT_OUT (Vx_app_defaults_directory, data_dir);
 	path = alloca_extbytes (strlen (data_dir) + strlen (locale) + 7);
 	format = "%s%s/Emacs";
       }
     else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0)
       {
-	LISP_STRING_TO_EXTERNAL (Vdata_directory, data_dir, Qfile_name);
+	LISP_PATHNAME_CONVERT_OUT (Vdata_directory, data_dir);
 	path = alloca_extbytes (strlen (data_dir) + 13 + strlen (locale) + 7);
 	format = "%sapp-defaults/%s/Emacs";
       }
@@ -740,7 +740,7 @@
     {
       /* Cast off const for G++ 4.3. */
       Extbyte *temp = (Extbyte *) locale;
-      xfree (temp, Extbyte*);
+      xfree (temp);
     }
  }
 #endif /* MULE */
@@ -948,7 +948,7 @@
 static void
 free_x_device_struct (struct device *d)
 {
-  xfree (d->device_data, void *);
+  xfree (d->device_data);
 }
 #endif /* not NEW_GC */
 
@@ -1003,10 +1003,10 @@
 /*				handle X errors				*/
 /************************************************************************/
 
-const char *
+const Ascbyte *
 x_event_name (int event_type)
 {
-  static const char *events[] =
+  static const Ascbyte *events[] =
   {
     "0: ERROR!",
     "1: REPLY",
@@ -1196,19 +1196,19 @@
     return 0;
   data = Qnil;
   qxesprintf (num, "0x%X", (unsigned int) last_error.resourceid);
-  data = Fcons (build_intstring (num), data);
+  data = Fcons (build_istring (num), data);
   qxesprintf (num, "%d", last_error.request_code);
   XGetErrorDatabaseText (last_error.display, "XRequest", (char *) num, "",
 			 buf, sizeof (buf));
   if (*buf)
-    data = Fcons (build_ext_string (buf, Qnative), data);
+    data = Fcons (build_extstring (buf, Qx_error_message_encoding), data);
   else
     {
       qxesprintf (num, "Request-%d", last_error.request_code);
-      data = Fcons (build_intstring (num), data);
+      data = Fcons (build_istring (num), data);
     }
   XGetErrorText (last_error.display, last_error.error_code, buf, sizeof (buf));
-  data = Fcons (build_ext_string (buf, Qnative), data);
+  data = Fcons (build_extstring (buf, Qx_error_message_encoding), data);
  again:
   Fsignal (Qx_error, data);
   if (! resumable_p) goto again;
@@ -1425,8 +1425,8 @@
     class_len = strlen (appclass);
     Dynarr_add_many (name,  appname,  name_len);
     Dynarr_add_many (class_, appclass, class_len);
-    validify_resource_component (Dynarr_atp (name,  0), name_len);
-    validify_resource_component (Dynarr_atp (class_, 0), class_len);
+    validify_resource_component (Dynarr_begin (name), name_len);
+    validify_resource_component (Dynarr_begin (class_), class_len);
   }
 
   if (EQ (locale, Qglobal))
@@ -1568,8 +1568,8 @@
   Dynarr_add (name_Extbyte_dynarr,  '\0');
   Dynarr_add (class_Extbyte_dynarr, '\0');
 
-  name_string  = Dynarr_atp (name_Extbyte_dynarr,  0);
-  class_string = Dynarr_atp (class_Extbyte_dynarr, 0);
+  name_string  = Dynarr_begin (name_Extbyte_dynarr);
+  class_string = Dynarr_begin (class_Extbyte_dynarr);
 
   {
     XrmValue xrm_value;
@@ -1603,7 +1603,7 @@
   }
 
   if (EQ (type, Qstring))
-    return build_ext_string (raw_result, codesys);
+    return build_extstring (raw_result, codesys);
   else if (EQ (type, Qboolean))
     {
       if (!strcasecmp (raw_result, "off")   ||
@@ -1616,8 +1616,8 @@
 	return Fcons (Qt, Qnil);
       return maybe_signal_continuable_error_2
 	(Qinvalid_operation, "Can't convert to a Boolean",
-	 build_ext_string (name_string, Qbinary),
-	 build_ext_string (raw_result, codesys), Qresource,
+	 build_extstring (name_string, Qbinary),
+	 build_extstring (raw_result, codesys), Qresource,
 	 errb);
     }
   else if (EQ (type, Qinteger) || EQ (type, Qnatnum))
@@ -1627,13 +1627,13 @@
       if (1 != sscanf (raw_result, "%d%c", &i, &c))
       return maybe_signal_continuable_error_2
 	(Qinvalid_operation, "Can't convert to an integer",
-	 build_ext_string (name_string, Qbinary),
-	 build_ext_string (raw_result, codesys), Qresource,
+	 build_extstring (name_string, Qbinary),
+	 build_extstring (raw_result, codesys), Qresource,
 	 errb);
       else if (EQ (type, Qnatnum) && i < 0)
 	return maybe_signal_continuable_error_2
 	  (Qinvalid_argument, "Invalid numerical value for resource",
-	   make_int (i), build_ext_string (name_string, Qbinary),
+	   make_int (i), build_extstring (name_string, Qbinary),
 	   Qresource, errb);
       else
 	return make_int (i);
@@ -1668,9 +1668,9 @@
   if (!display)
     return Qnil;
 
-  return Fcons (make_string ((Ibyte *) Dynarr_atp (name_Extbyte_dynarr, 0),
+  return Fcons (make_string ((Ibyte *) Dynarr_begin (name_Extbyte_dynarr),
 			     Dynarr_length (name_Extbyte_dynarr)),
-		make_string ((Ibyte *) Dynarr_atp (class_Extbyte_dynarr, 0),
+		make_string ((Ibyte *) Dynarr_begin (class_Extbyte_dynarr),
 			     Dynarr_length (class_Extbyte_dynarr)));
 }
 
@@ -1689,8 +1689,8 @@
       Extbyte *str, *colon_pos;
 
       CHECK_STRING (resource_line);
-      LISP_STRING_TO_EXTERNAL (resource_line, str,
-			       coding_system_of_xrm_database (db));
+      str = LISP_STRING_TO_EXTERNAL (resource_line,
+				     coding_system_of_xrm_database (db));
       if (!(colon_pos = strchr (str, ':')) || strchr (str, '\n'))
       invalid:
 	syntax_error ("Invalid resource line", resource_line);
@@ -1801,7 +1801,7 @@
   Display *dpy = get_x_display (device);
   Extbyte *vendor = ServerVendor (dpy);
 
-  return build_ext_string (vendor ? vendor : "", Qx_hpc_encoding);
+  return build_extstring (vendor ? vendor : "", Qx_hpc_encoding);
 }
 
 DEFUN ("x-server-version", Fx_server_version, 0, 1, 0, /*
@@ -1829,7 +1829,7 @@
   const Extbyte *keysym_ext;
 
   CHECK_STRING (keysym);
-  LISP_STRING_TO_EXTERNAL (keysym, keysym_ext, Qctext);
+  keysym_ext = LISP_STRING_TO_EXTERNAL (keysym, Qctext);
 
   return XStringToKeysym (keysym_ext) ? Qt : Qnil;
 }
@@ -2046,7 +2046,7 @@
     gui_error ("Can't get X font path", device);
 
   while (ndirs_return--)
-      font_path = Fcons (build_ext_string (directories[ndirs_return],
+      font_path = Fcons (build_extstring (directories[ndirs_return],
                                            Qfile_name),
 			 font_path);
 
@@ -2087,10 +2087,7 @@
 
   {
     EXTERNAL_LIST_LOOP_2 (path_entry, font_path)
-      {
-	LISP_STRING_TO_EXTERNAL (path_entry, directories[i++],
-				 Qfile_name);
-      }
+      LISP_PATHNAME_CONVERT_OUT (path_entry, directories[i++]);
   }
 
   expect_x_error (dpy);
--- a/src/device.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/device.c	Wed Feb 24 01:58:04 2010 -0600
@@ -160,8 +160,7 @@
   struct device *d = XDEVICE (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<device %s 0x%x>",
-				XSTRING_DATA (d->name), d->header.uid);
+    printing_unreadable_lcrecord (obj, XSTRING_DATA (d->name));
 
   write_fmt_string (printcharfun, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" :
 		    DEVICE_TYPE_NAME (d));
@@ -751,7 +750,7 @@
 {
   Lisp_Object device;
 
-  device = VOID_TO_LISP (closure);
+  device = GET_LISP_FROM_VOID (closure);
   if (FRAME_MINIBUF_ONLY_P (XFRAME (frame)))
     return 0;
   if (EQ (device, FRAME_DEVICE (XFRAME (frame))))
@@ -763,7 +762,7 @@
 find_nonminibuffer_frame_not_on_device (Lisp_Object device)
 {
   return find_some_frame (find_nonminibuffer_frame_not_on_device_predicate,
-			  LISP_TO_VOID (device));
+			  STORE_LISP_IN_VOID (device));
 }
 
 
--- a/src/dialog-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/dialog-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Implements elisp-programmable dialog boxes -- MS Windows interface.
    Copyright (C) 1998 Kirill M. Katsnelson <kkm@kis.ru>
-   Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -202,7 +202,7 @@
     case WM_DESTROY:
       {
 	Lisp_Object data;
-	data = VOID_TO_LISP ((void *) qxeGetWindowLong (hwnd, DWL_USER));
+	data = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, DWL_USER));
 	Vdialog_data_list = delq_no_quit (data, Vdialog_data_list);
       }
       break;
@@ -212,7 +212,7 @@
 	Lisp_Object fn, arg, data;
 	struct mswindows_dialog_id *did;
 
-	data = VOID_TO_LISP ((void *) qxeGetWindowLong (hwnd, DWL_USER));
+	data = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, DWL_USER));
 	did = XMSWINDOWS_DIALOG_ID (data);
 	if (w_param != IDCANCEL) /* user pressed escape */
 	  {
@@ -249,9 +249,8 @@
   int length;
   Extbyte *uni_string;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, string,
-		      ALLOCA, (uni_string, length),
-		      Qmswindows_unicode);
+  LISP_STRING_TO_SIZED_EXTERNAL (string, uni_string, length,
+				 Qmswindows_unicode);
   Dynarr_add_many (dynarr, uni_string, length);
   Dynarr_add (dynarr, '\0');
   Dynarr_add (dynarr, '\0');
@@ -296,7 +295,7 @@
 static struct
 {
   DWORD errmess;
-  Ascbyte *errname;
+  const Ascbyte *errname;
 } common_dialog_errors[] =
 {
   { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" },
@@ -343,7 +342,7 @@
 CALLBACK handle_directory_proc (HWND hwnd, UINT msg,
 				LPARAM lParam, LPARAM lpData)
 {
-  Extbyte szDir[PATH_MAX_EXTERNAL];
+  Extbyte szDir[PATH_MAX_TCHAR];
   struct param_data *pd = (struct param_data *) lpData;
   
   switch (msg)
@@ -393,7 +392,7 @@
     BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_EDITBOX | BIF_NEWDIALOGSTYLE;
   bi.lpfn = handle_directory_proc;
   
-  LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil),
+  LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_ascstring (""), Qnil),
 			     pd.fname);
   
   {
@@ -402,10 +401,10 @@
 	if (EQ (key, Q_title))
 	  {
 	    CHECK_STRING (value);
-	    LISP_STRING_TO_EXTERNAL (value, bi.lpszTitle, Qmswindows_tstr);
+	    bi.lpszTitle = (XELPTSTR) LISP_STRING_TO_TSTR (value);
 	  }
 	else if (EQ (key, Q_initial_directory))
-	  LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil),
+	  LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil),
 				     pd.fname);
 	else if (EQ (key, Q_initial_filename))
 	  ;			/* do nothing */
@@ -429,7 +428,7 @@
       pidl = qxeSHBrowseForFolder (&bi);
       if (pidl)
 	{
-	  Extbyte *szDir = alloca_extbytes (PATH_MAX_EXTERNAL);
+	  Extbyte *szDir = alloca_extbytes (PATH_MAX_TCHAR);
 	  
 	  if (qxeSHGetPathFromIDList (pidl, szDir))
 	    ret = tstr_to_local_file_format (szDir);
@@ -441,7 +440,7 @@
       else if (pd.unknown_fname != 0)
 	{
 	  ret = tstr_to_local_file_format (pd.unknown_fname);
-	  xfree (pd.unknown_fname, Extbyte *);
+	  xfree (pd.unknown_fname);
 	}
       else while (1)
 	signal_quit ();
@@ -467,8 +466,9 @@
   ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE;
   qxetcscpy (fnbuf, XETEXT (""));
   
-  LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil),
-			     ofn.lpstrInitialDir);
+  LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_ascstring (""),
+						     Qnil),
+				  ofn.lpstrInitialDir);
   
   {
     EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
@@ -478,17 +478,17 @@
 	    Extbyte *fnout;
 	    
 	    CHECK_STRING (value);
-	    LOCAL_FILE_FORMAT_TO_TSTR (value, fnout);
+	    LISP_LOCAL_FILE_FORMAT_TO_TSTR (value, fnout);
 	    qxetcscpy (fnbuf, fnout);
 	  }
 	else if (EQ (key, Q_title))
 	  {
 	    CHECK_STRING (value);
-	    LISP_STRING_TO_TSTR (value, ofn.lpstrTitle);
+	    ofn.lpstrTitle = (XELPTSTR) LISP_STRING_TO_TSTR (value);
 	  }
 	else if (EQ (key, Q_initial_directory))
-	  LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil),
-				     ofn.lpstrInitialDir);
+	  LISP_LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil),
+					  ofn.lpstrInitialDir);
 	else if (EQ (key, Q_file_must_exist))
 	  {
 	    if (!NILP (value))
@@ -760,9 +760,9 @@
     /* Woof! Everything is ready. Pop pop pop in now! */
     did->hwnd =
       qxeCreateDialogIndirectParam (NULL,
-				    (LPDLGTEMPLATE) Dynarr_atp (template_, 0),
+				    (LPDLGTEMPLATE) Dynarr_begin (template_),
 				    FRAME_MSWINDOWS_HANDLE (f), dialog_proc,
-				    (LPARAM) LISP_TO_VOID (obj));
+				    (LPARAM) STORE_LISP_IN_VOID (obj));
     if (!did->hwnd)
       /* Something went wrong creating the dialog */
       signal_error (Qdialog_box_error, "Creating dialog", keys);
@@ -839,9 +839,9 @@
 	       &Vdefault_file_dialog_filter_alist /*
 						   */ );
   Vdefault_file_dialog_filter_alist =
-    list5 (Fcons (build_msg_string ("Text Files"), build_string ("*.txt")),
-	   Fcons (build_msg_string ("C Files"), build_string ("*.c;*.h")),
-	   Fcons (build_msg_string ("Elisp Files"), build_string ("*.el")),
-	   Fcons (build_msg_string ("HTML Files"), build_string ("*.html;*.html")),
-	   Fcons (build_msg_string ("All Files"), build_string ("*.*")));
+    list5 (Fcons (build_defer_string ("Text Files"), build_ascstring ("*.txt")),
+	   Fcons (build_defer_string ("C Files"), build_ascstring ("*.c;*.h")),
+	   Fcons (build_defer_string ("Elisp Files"), build_ascstring ("*.el")),
+	   Fcons (build_defer_string ("HTML Files"), build_ascstring ("*.html;*.html")),
+	   Fcons (build_defer_string ("All Files"), build_ascstring ("*.*")));
 }
--- a/src/dialog-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/dialog-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -51,14 +51,14 @@
     {
       Lisp_Object text_field_callback;
       Extbyte *text_field_value = wv->value;
-      text_field_callback = VOID_TO_LISP (wv->call_data);
+      text_field_callback = GET_LISP_FROM_VOID (wv->call_data);
       text_field_callback = XCAR (XCDR (text_field_callback));
       if (text_field_value)
 	{
 	  void *tmp =
-	    LISP_TO_VOID (cons3 (Qnil,
+	    STORE_LISP_IN_VOID (cons3 (Qnil,
 				 list2 (text_field_callback,
-					build_ext_string (text_field_value,
+					build_extstring (text_field_value,
 							  Qlwlib_encoding)),
 				 Qnil));
 	  popup_selection_callback (0, id, (XtPointer) tmp);
@@ -171,7 +171,7 @@
   wv_closure = make_opaque_ptr (kids);
   record_unwind_protect (widget_value_unwind, wv_closure);
   prev->name = xstrdup ("message");
-  LISP_STRING_TO_EXTERNAL_MALLOC (question, prev->value, Qlwlib_encoding);
+  prev->value = LISP_STRING_TO_EXTERNAL_MALLOC (question, Qlwlib_encoding);
   prev->enabled = 1;
 
   {
@@ -207,7 +207,7 @@
 	  {
 	    allow_text_p = 0;	 /* only allow text field at the front */
 	    if (wv->value)
-	      xfree (wv->value, char *);
+	      xfree (wv->value);
 	    wv->value = wv->name;	/* what a mess... */
 	    wv->name = xstrdup (button_names [n]);
 
--- a/src/dired-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/dired-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -179,7 +179,7 @@
 {
   mswindows_sort_method = sort_by;
   mswindows_reverse_sort = reverse;
-  qsort (Dynarr_atp (files, 0), Dynarr_length (files),
+  qsort (Dynarr_begin (files), Dynarr_length (files),
 	 sizeof (Win32_file), mswindows_ls_sort_fcn);
 }
 
@@ -587,7 +587,7 @@
   for (i = 0; i < Dynarr_length (files); ++i)
     {
       Win32_file *file = Dynarr_atp (files, i);
-      xfree (file->cFileName, Ibyte *);
+      xfree (file->cFileName);
     }
   Dynarr_free (files);
 
--- a/src/dired.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/dired.c	Wed Feb 24 01:58:04 2010 -0600
@@ -371,8 +371,10 @@
 	      || 0 <= scmp (d_name, XSTRING_DATA (file), file_name_length))
 	    continue;
 
-          if (file_name_completion_stat (directory, dp, &st) < 0)
-            continue;
+	  /* Ignore file-too-large conditions; the mode is still filled in. */
+	  if (file_name_completion_stat (directory, dp, &st) < 0 &&
+	      errno != EOVERFLOW)
+	    continue;
 
           directoryp = ((st.st_mode & S_IFMT) == S_IFDIR);
           if (directoryp)
@@ -576,8 +578,8 @@
 {
   int i;
   for (i = 0; i < cache->length; i++)
-    xfree (cache->user_names[i].ptr, Ibyte *);
-  xfree (cache->user_names, struct user_name *);
+    xfree (cache->user_names[i].ptr);
+  xfree (cache->user_names);
   xzero (*cache);
 }
 
--- a/src/doc.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/doc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -65,7 +65,7 @@
   if (0 > lseek (fd, position, 0))
     {
       if (name_nonreloc)
-	name_reloc = build_intstring (name_nonreloc);
+	name_reloc = build_istring (name_nonreloc);
       return_me = list3 (build_msg_string
 			 ("Position out of range in doc string file"),
 			  name_reloc, make_int (position));
@@ -180,7 +180,7 @@
   if (0 > lseek (fd, position, 0))
     {
       if (name_nonreloc)
-	name_reloc = build_intstring (name_nonreloc);
+	name_reloc = build_istring (name_nonreloc);
       return_me = list3 (build_msg_string
 			 ("Position out of range in doc string file"),
 			  name_reloc, make_int (position));
@@ -289,7 +289,7 @@
     }
   UNGCPRO;
   if (buffer != buf) /* We must have allocated buffer above */
-    xfree (buffer, Ibyte *);
+    xfree (buffer);
   return return_me;
 }
 
@@ -378,7 +378,7 @@
 
       if (fd < 0)
 	report_file_error ("Cannot open doc string file",
-			   name_nonreloc ? build_intstring (name_nonreloc) :
+			   name_nonreloc ? build_istring (name_nonreloc) :
 			   name_reloc);
     }
 
@@ -475,7 +475,7 @@
 
       if (fd < 0)
 	report_file_error ("Cannot open doc string file",
-			   name_nonreloc ? build_intstring (name_nonreloc) :
+			   name_nonreloc ? build_istring (name_nonreloc) :
 			   name_reloc);
     }
 
@@ -491,12 +491,13 @@
 
 
 static void
-weird_doc (Lisp_Object sym, const CIbyte *weirdness, const CIbyte *type,
+weird_doc (Lisp_Object sym, const Ascbyte *weirdness, const Ascbyte *type,
 	   int pos)
 {
-  if (!strcmp (weirdness, GETTEXT ("duplicate"))) return;
+  if (!strcmp (weirdness, "duplicate")) return;
   message ("Note: Strange doc (%s) for %s %s @ %d",
-           weirdness, type, XSTRING_DATA (XSYMBOL (sym)->name), pos);
+           GETTEXT (weirdness), GETTEXT (type),
+	   XSTRING_DATA (XSYMBOL (sym)->name), pos);
 }
 
 DEFUN ("built-in-symbol-file", Fbuilt_in_symbol_file, 1, 2, 0, /*
@@ -504,7 +505,7 @@
 Don't use this.  Use the more general `symbol-file' (q.v.) instead. 
 
 If TYPE is nil or omitted, any kind of definition is acceptable. 
-If TYPE is `defun', then function, subr, special form or macro definitions
+If TYPE is `defun', then function, subr, special operator or macro definitions
 are acceptable.
 If TYPE is `defvar', then variable definitions are acceptable.
 */
@@ -598,7 +599,7 @@
       if (XSUBR (fun)->doc == 0)
 	return Qnil;
       if ((EMACS_INT) XSUBR (fun)->doc >= 0)
-	doc = build_string (XSUBR (fun)->doc);
+	doc = build_cistring (XSUBR (fun)->doc);
       else
         doc = get_doc_string (make_int (- (EMACS_INT) XSUBR (fun)->doc));
     }
@@ -753,7 +754,7 @@
 
   fd = qxe_open (name, O_RDONLY | OPEN_BINARY, 0);
   if (fd < 0)
-    report_file_error ("Opening doc string file", build_intstring (name));
+    report_file_error ("Opening doc string file", build_istring (name));
   Vinternal_doc_file_name = filename;
   filled = 0;
   pos = 0;
@@ -789,8 +790,8 @@
 		  Lisp_Object old = Fget (sym, Qvariable_documentation, Qzero);
                   if (!ZEROP (old))
 		    {
-		      weird_doc (sym, GETTEXT ("duplicate"),
-				 GETTEXT ("variable"), pos);
+		      weird_doc (sym, "duplicate",
+				 "variable", pos);
 		      /* In the case of duplicate doc file entries, always
 			 take the later one.  But if the doc is not an int
 			 (a string, say) leave it alone. */
@@ -830,8 +831,8 @@
 	 So I'm disabling this. --ben */
 
 		      /* May have been #if'ed out or something */
-		      weird_doc (sym, GETTEXT ("not fboundp"),
-				 GETTEXT ("function"), pos);
+		      weird_doc (sym, "not fboundp",
+				 "function", pos);
 #endif
 		      goto weird;
 		    }
@@ -840,8 +841,8 @@
 		      /* Lisp_Subrs have a slot for it.  */
 		      if (XSUBR (fun)->doc)
 			{
-			  weird_doc (sym, GETTEXT ("duplicate"),
-				     GETTEXT ("subr"), pos);
+			  weird_doc (sym, "duplicate",
+				     "subr", pos);
 			  goto weird;
 			}
 		      XSUBR (fun)->doc = (char *) (- XINT (offset));
@@ -859,11 +860,12 @@
 			      Lisp_Object old = XCAR (tem);
 			      if (!ZEROP (old))
 				{
-				  weird_doc (sym, GETTEXT ("duplicate"),
-					     (EQ (tem, Qlambda)
-					      ? GETTEXT ("lambda")
-					      : GETTEXT ("autoload")),
-					     pos);
+				  if (EQ (tem, Qlambda))
+				    weird_doc (sym, "duplicate", "lambda",
+					       pos);
+				  else
+				    weird_doc (sym, "duplicate", "autoload",
+					       pos);
 				  /* In the case of duplicate doc file entries,
 				     always take the later one.  But if the doc
 				     is not an int (a string, say) leave it
@@ -875,24 +877,23 @@
 			    }
                           else if (!CONSP (tem))
 			    {
-			      weird_doc (sym, GETTEXT ("!CONSP(tem)"),
-					 GETTEXT ("function"), pos);
+			      weird_doc (sym, "!CONSP(tem)", "function", pos);
 			      goto cont;
 			    }
                           else
 			    {
 			      /* DOC string is a string not integer 0 */
 #if 0
-			      weird_doc (sym, GETTEXT ("!INTP(XCAR(tem))"),
-					 GETTEXT ("function"), pos);
+			      weird_doc (sym, "!INTP(XCAR(tem))",
+					 "function", pos);
 #endif
 			      goto cont;
 			    }
                         }
                       else
 			{
-			  weird_doc (sym, GETTEXT ("not lambda or autoload"),
-				     GETTEXT ("function"), pos);
+			  weird_doc (sym, "not lambda or autoload",
+				     "function", pos);
 			  goto cont;
 			}
 		    }
@@ -911,8 +912,7 @@
 
                       if (! (f->flags.documentationp))
 			{
-			  weird_doc (sym, GETTEXT ("no doc slot"),
-				     GETTEXT ("bytecode"), pos);
+			  weird_doc (sym, "no doc slot", "bytecode", pos);
 			  goto weird;
 			}
 		      else
@@ -921,8 +921,7 @@
 			    compiled_function_documentation (f);
 			  if (!ZEROP (old))
 			    {
-			      weird_doc (sym, GETTEXT ("duplicate"),
-					 GETTEXT ("bytecode"), pos);
+			      weird_doc (sym, "duplicate", "bytecode", pos);
 			      /* In the case of duplicate doc file entries,
 				 always take the later one.  But if the doc is
 				 not an int (a string, say) leave it alone. */
@@ -936,8 +935,7 @@
                     {
                       /* Otherwise the function is undefined or
                          otherwise weird.   Ignore it. */
-                      weird_doc (sym, GETTEXT ("weird function"),
-				 GETTEXT ("function"), pos);
+                      weird_doc (sym, "weird function", "function", pos);
                       goto weird;
                     }
                 }
@@ -1245,9 +1243,9 @@
 
 	    if (NILP (tem))
 	      {
-		buffer_insert_c_string (buf_, "(uses keymap \"");
+		buffer_insert_ascstring (buf_, "(uses keymap \"");
 		buffer_insert_lisp_string (buf_, Fsymbol_name (name));
-		buffer_insert_c_string (buf_, "\", which is not currently defined) ");
+		buffer_insert_ascstring (buf_, "\", which is not currently defined) ");
 
 		if (start[-1] == '<') keymap = Qnil;
 	      }
@@ -1284,7 +1282,7 @@
     tem = make_string (buf, bufp - buf);
   else
     tem = string;
-  xfree (buf, Ibyte *);
+  xfree (buf);
   UNGCPRO;
   return tem;
 }
@@ -1315,6 +1313,6 @@
 */ );
   Vinternal_doc_file_name = Qnil;
 
-  QSsubstitute = build_string (" *substitute*");
+  QSsubstitute = build_ascstring (" *substitute*");
   staticpro (&QSsubstitute);
 }
--- a/src/doprnt.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/doprnt.c	Wed Feb 24 01:58:04 2010 -0600
@@ -602,7 +602,7 @@
 		  sprintf (msg,
 			   "format specifier %%%c doesn't match argument type",
 			   ch);
-		  syntax_error (msg, Qnil);
+		  syntax_error (msg, Qunbound);
 		}
 	      else if (strchr (double_converters, ch))
 		{
@@ -725,7 +725,7 @@
 		  CIbyte msg[60];
 		  sprintf (msg, "invalid character value %d to %%c spec",
 			   a);
-		  syntax_error (msg, Qnil);
+		  syntax_error (msg, Qunbound);
 		}
 
 	      charlen = set_itext_ichar (charbuf, a);
@@ -754,7 +754,7 @@
 			    strlen ((const char *) text_to_print),
 			    spec->minwidth, -1, spec->minus_flag,
 			    spec->zero_flag);
-		  xfree (text_to_print, Ibyte *);
+		  xfree (text_to_print);
 		}
 #endif
 #ifdef HAVE_RATIO
@@ -766,7 +766,7 @@
 			    strlen ((const char *) text_to_print),
 			    spec->minwidth, -1, spec->minus_flag,
 			    spec->zero_flag);
-		  xfree (text_to_print, Ibyte *);
+		  xfree (text_to_print);
 		}
 #endif
 	    }
@@ -779,7 +779,7 @@
 	      doprnt_2 (stream, text_to_print,
 			strlen ((const char *) text_to_print),
 			spec->minwidth, -1, spec->minus_flag, spec->zero_flag);
-	      xfree (text_to_print, Ibyte *);
+	      xfree (text_to_print);
 	    }
 #endif /* HAVE_BIGFLOAT */
           else if (ch == 'b')
--- a/src/dumper.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/dumper.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2123,11 +2123,11 @@
 		   O_WRONLY | O_CREAT | O_TRUNC | OPEN_BINARY, 0666);
   if (pdump_fd < 0)
     report_file_error ("Unable to open dump file",
-		       build_string (EMACS_PROGNAME ".dmp"));
+		       build_ascstring (EMACS_PROGNAME ".dmp"));
   pdump_out = fdopen (pdump_fd, "w");
   if (pdump_out < 0)
     report_file_error ("Unable to open dump file for writing",
-		       build_string (EMACS_PROGNAME ".dmp"));
+		       build_ascstring (EMACS_PROGNAME ".dmp"));
 
   retry_fwrite (&header, sizeof (header), 1, pdump_out);
   PDUMP_ALIGN_OUTPUT (max_align_t);
@@ -2402,7 +2402,7 @@
     }
 
 #ifdef NEW_GC
-  xfree (pdump_mc_hash, mc_addr_elt *);
+  xfree (pdump_mc_hash);
 #endif /* NEW_GC */
 
 #ifdef NEW_GC
@@ -2518,7 +2518,7 @@
 static void
 pdump_file_free (void)
 {
-  xfree (pdump_start, Rawbyte *);
+  xfree (pdump_start);
 }
 
 #ifdef HAVE_MMAP
--- a/src/dynarr.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/dynarr.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Support for dynamic arrays.
    Copyright (C) 1993 Sun Microsystems, Inc.
-   Copyright (C) 2002, 2003, 2004 Ben Wing.
+   Copyright (C) 2002, 2003, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -98,7 +98,8 @@
 
    int Dynarr_largest(d)
       [MACRO] Return the maximum value that Dynarr_length(d) would
-      ever have returned.
+      ever have returned.  This is used esp. in the redisplay code,
+      which reuses dynarrs for performance reasons.
 
    type Dynarr_at(d, i)
       [MACRO] Return the element at the specified index (no bounds checking
@@ -126,6 +127,27 @@
 #include <config.h>
 #include "lisp.h"
 
+static const struct memory_description const_Ascbyte_ptr_description_1[] = {
+  { XD_ASCII_STRING, 0 },
+  { XD_END }
+};
+
+const struct sized_memory_description const_Ascbyte_ptr_description = {
+  sizeof (const Ascbyte *),
+  const_Ascbyte_ptr_description_1
+};
+
+static const struct memory_description const_Ascbyte_ptr_dynarr_description_1[] = {
+  XD_DYNARR_DESC (const_Ascbyte_ptr_dynarr, &const_Ascbyte_ptr_description),
+  { XD_END }
+};
+
+const struct sized_memory_description const_Ascbyte_ptr_dynarr_description = {
+  sizeof (const_Ascbyte_ptr_dynarr),
+  const_Ascbyte_ptr_dynarr_description_1
+};
+
+
 static int Dynarr_min_size = 8;
 
 static void
@@ -135,7 +157,8 @@
     {
       void *new_base = malloc (new_size * dy->elsize);
       memcpy (new_base, dy->base, 
-	      (dy->max < new_size ? dy->max : new_size) * dy->elsize);
+	      (Dynarr_max (dy) < new_size ? Dynarr_max (dy) : new_size) *
+	      dy->elsize);
       dy->base = new_base;
     }
   else
@@ -163,7 +186,8 @@
     XPNTR (alloc_sized_lrecord_array (dy->elsize, new_size, dy->lisp_imp));
   if (dy->base)
     memcpy (new_base, dy->base, 
-	    (dy->max < new_size ? dy->max : new_size) * dy->elsize);
+	    (Dynarr_max (dy) < new_size ? Dynarr_max (dy) : new_size) *
+	    dy->elsize);
   dy->base = new_base;
 }
 
@@ -188,16 +212,16 @@
   double multiplier;
   Dynarr *dy = (Dynarr *) Dynarr_verify (d);
 
-  if (dy->max <= 8)
+  if (Dynarr_max (dy) <= 8)
     multiplier = 2;
   else
     multiplier = 1.5;
 
-  for (newsize = dy->max; newsize < size;)
+  for (newsize = Dynarr_max (dy); newsize < size;)
     newsize = max (Dynarr_min_size, (int) (multiplier * newsize));
 
   /* Don't do anything if the array is already big enough. */
-  if (newsize > dy->max)
+  if (newsize > Dynarr_max (dy))
     {
 #ifdef NEW_GC
       if (dy->lisp_imp)
@@ -207,7 +231,7 @@
 #else /* not NEW_GC */
       Dynarr_realloc (dy, newsize);
 #endif /* not NEW_GC */
-      dy->max = newsize;
+      dy->max_ = newsize;
     }
 }
 
@@ -215,44 +239,43 @@
 void
 Dynarr_insert_many (void *d, const void *el, int len, int start)
 {
-  Dynarr *dy = (Dynarr *) Dynarr_verify (d);
-  
-  Dynarr_resize (dy, dy->cur+len);
-#if 0
-  /* WTF? We should be catching these problems. */
-  /* Silently adjust start to be valid. */
-  if (start > dy->cur)
-    start = dy->cur;
-  else if (start < 0)
-    start = 0;
-#else
-  assert (start >= 0 && start <= dy->cur);
-#endif
+  Dynarr *dy = Dynarr_verify_mod (d);
+
+  Dynarr_resize_if (dy, len);
 
-  if (start != dy->cur)
+  /* #### This could conceivably be wrong, if code wants to access stuff
+     between len and largest. */
+  dynarr_checking_assert (start >= 0 && start <= Dynarr_length (dy));
+
+  if (start != Dynarr_length (dy))
     {
       memmove ((char *) dy->base + (start + len)*dy->elsize,
 	       (char *) dy->base + start*dy->elsize,
-	       (dy->cur - start)*dy->elsize);
+	       (Dynarr_length (dy) - start)*dy->elsize);
     }
+  /* Some functions call us with a value of 0 to mean "reserve space but
+     don't write into it" */
   if (el)
     memcpy ((char *) dy->base + start*dy->elsize, el, len*dy->elsize);
-  dy->cur += len;
 
-  if (dy->cur > dy->largest)
-    dy->largest = dy->cur;
+  Dynarr_set_length_1 (dy, Dynarr_length (dy) + len);
+  (void) Dynarr_verify_mod (dy);
 }
 
 void
 Dynarr_delete_many (void *d, int start, int len)
 {
-  Dynarr *dy = (Dynarr *) Dynarr_verify (d);
+  Dynarr *dy = Dynarr_verify_mod (d);
 
-  assert (start >= 0 && len >= 0 && start + len <= dy->cur);
+  dynarr_checking_assert (start >= 0 && len >= 0 &&
+			  start + len <= Dynarr_length (dy));
+
   memmove ((char *) dy->base + start*dy->elsize,
 	   (char *) dy->base + (start + len)*dy->elsize,
-	   (dy->cur - start - len)*dy->elsize);
-  dy->cur -= len;
+	   (Dynarr_length (dy) - start - len)*dy->elsize);
+
+  Dynarr_set_length_1 (dy, Dynarr_length (dy) - len);
+  (void) Dynarr_verify_mod (dy);
 }
 
 void
@@ -264,18 +287,18 @@
   if (dy->base && !DUMPEDP (dy->base))
     {
       if (!dy->lisp_imp)
-	xfree (dy->base, void *);
+	xfree (dy->base);
     }
   if(!DUMPEDP (dy))
     {
       if (!dy->lisp_imp)
-	xfree (dy, Dynarr *);
+	xfree (dy);
     }
 #else /* not NEW_GC */
   if (dy->base && !DUMPEDP (dy->base))
-    xfree (dy->base, void *);
+    xfree (dy->base);
   if(!DUMPEDP (dy))
-    xfree (dy, Dynarr *);
+    xfree (dy);
 #endif /* not NEW_GC */
 }
 
@@ -301,12 +324,13 @@
 
   if (dy->base)
     {
-      Bytecount malloc_used = malloced_storage_size (dy->base,
-						     dy->elsize * dy->max, 0);
+      Bytecount malloc_used =
+	malloced_storage_size (dy->base, dy->elsize * Dynarr_max (dy), 0);
       /* #### This may or may not be correct.  Some Dynarrs would
-	 prefer that we use dy->cur instead of dy->largest here. */
-      Bytecount was_requested = dy->elsize * dy->largest;
-      Bytecount dynarr_overhead = dy->elsize * (dy->max - dy->largest);
+	 prefer that we use dy->len instead of dy->largest here. */
+      Bytecount was_requested = dy->elsize * Dynarr_largest (dy);
+      Bytecount dynarr_overhead =
+	dy->elsize * (Dynarr_max (dy) - Dynarr_largest (dy));
 
       total += malloc_used;
       stats->was_requested += was_requested;
@@ -353,8 +377,9 @@
   else
     this_one = Dynarr_new (char);
   Dynarr_add (stack_like_in_use_list, this_one);
-  Dynarr_resize (this_one, size);
-  return Dynarr_atp (this_one, 0);
+  Dynarr_reset (this_one);
+  Dynarr_add_many (this_one, 0, size);
+  return Dynarr_begin (this_one);
 }
 
 void
@@ -366,7 +391,7 @@
      order, and the item at the end of the list will be the one we're
      looking for, so just check for this first and avoid any function
      calls. */
-  if (Dynarr_atp (Dynarr_at (stack_like_in_use_list, len - 1), 0) == val)
+  if (Dynarr_begin (Dynarr_at (stack_like_in_use_list, len - 1)) == val)
     {
       char_dynarr *this_one = Dynarr_pop (stack_like_in_use_list);
       Dynarr_add (stack_like_free_list, this_one);
@@ -377,7 +402,7 @@
       int i;
       assert (len >= 2);
       for (i = len - 2; i >= 0; i--)
-	if (Dynarr_atp (Dynarr_at (stack_like_in_use_list, i), 0) ==
+	if (Dynarr_begin (Dynarr_at (stack_like_in_use_list, i)) ==
 	    val)
 	  {
 	    char_dynarr *this_one = Dynarr_at (stack_like_in_use_list, i);
--- a/src/editfns.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/editfns.c	Wed Feb 24 01:58:04 2010 -0600
@@ -95,7 +95,7 @@
   if ((p = egetenv ("NAME")))
     /* I don't think it's the right thing to do the ampersand
        modification on NAME.  Not that it matters anymore...  -hniksic */
-    Vuser_full_name = build_intstring (p);
+    Vuser_full_name = build_istring (p);
   else
     Vuser_full_name = Fuser_full_name (Qnil);
 }
@@ -649,7 +649,7 @@
     }
 #endif
 
-  return build_intstring (tmpdir);
+  return build_istring (tmpdir);
 }
 
 DEFUN ("user-login-name", Fuser_login_name, 0, 1, 0, /*
@@ -678,7 +678,7 @@
   /* #### - I believe this should return nil instead of "unknown" when pw==0
      pw=0 is indicated by a null return from user_login_name
   */
-  return returned_name ? build_intstring (returned_name) : Qnil;
+  return returned_name ? build_istring (returned_name) : Qnil;
 }
 
 /* This function may be called from other C routines when a
@@ -744,7 +744,7 @@
   struct passwd *pw = qxe_getpwuid (getuid ());
   /* #### - I believe this should return nil instead of "unknown" when pw==0 */
 
-  return build_string (pw ? pw->pw_name : "unknown");
+  return build_extstring (pw ? pw->pw_name : "unknown", Quser_name_encoding);
 }
 
 DEFUN ("user-uid", Fuser_uid, 0, 0, 0, /*
@@ -831,7 +831,7 @@
 uncache_home_directory (void)
 {
   if (cached_home_directory)
-    xfree (cached_home_directory, Ibyte *);
+    xfree (cached_home_directory);
   cached_home_directory = NULL;
 }
 
@@ -869,7 +869,7 @@
                  We probably should try to extract pw_dir from /etc/passwd,
                  before falling back to this. */
 	      cached_home_directory
-                = qxestrdup ((const Ibyte *)DEFAULT_DIRECTORY_FALLBACK);
+                = qxestrdup ((const Ibyte *) DEFAULT_DIRECTORY_FALLBACK);
 	      output_home_warning = 1;
 	    }
 	}
@@ -895,7 +895,7 @@
   Ibyte *path = get_home_directory ();
 
   return !path ? Qnil :
-    Fexpand_file_name (Fsubstitute_in_file_name (build_intstring (path)),
+    Fexpand_file_name (Fsubstitute_in_file_name (build_istring (path)),
 		       Qnil);
 }
 
@@ -1068,16 +1068,17 @@
       Extbyte *buf = alloca_extbytes (size);
       Extbyte *formext;
       /* make a copy of the static buffer returned by localtime() */
-      struct tm tm = * localtime(&value); 
+      struct tm tm = *localtime (&value); 
       
       *buf = 1;
 
       /* !!#### this use of external here is not totally safe, and
 	 potentially data lossy. */
-      LISP_STRING_TO_EXTERNAL (format_string, formext, Qnative);
+      formext = LISP_STRING_TO_EXTERNAL (format_string,
+					 Qtime_function_encoding);
       if (emacs_strftime (buf, size, formext, &tm)
 	  || !*buf)
-	return build_ext_string (buf, Qnative);
+	return build_extstring (buf, Qtime_function_encoding);
       /* If buffer was too small, make it bigger.  */
       size *= 2;
     }
@@ -1187,7 +1188,7 @@
       Extbyte **oldenv = environ, **newenv;
 
       if (STRINGP (zone))
-	LISP_STRING_TO_EXTERNAL (zone, tzstring, Qnative);
+	tzstring = LISP_STRING_TO_EXTERNAL (zone, Qtime_zone_encoding);
       else if (INTP (zone))
 	{
 	  int abszone = abs (XINT (zone));
@@ -1236,7 +1237,7 @@
 {
   time_t value;
   Ibyte *the_ctime;
-  EMACS_INT len; /* this is what make_ext_string() accepts; ####
+  EMACS_INT len; /* this is what make_extstring() accepts; ####
 		    should it be an Bytecount? */
 
   if (! lisp_to_time (specified_time, &value))
@@ -1319,7 +1320,7 @@
 #endif
 #endif /* not HAVE_TM_ZONE */
       if (s)
-	tem = build_ext_string (s, Qnative);
+	tem = build_extstring (s, Qtime_zone_encoding);
       else
 	{
 	  Ibyte buf[6];
@@ -1328,7 +1329,7 @@
 	  int am = (offset < 0 ? -offset : offset) / 60;
 	  qxesprintf (buf, "%c%02d%02d", (offset < 0 ? '-' : '+'), am/60,
 		      am%60);
-	  tem = build_intstring (buf);
+	  tem = build_istring (buf);
 	}
       return list2 (make_int (offset), tem);
     }
@@ -1433,12 +1434,12 @@
   else
     {
       CHECK_STRING (tz);
-      LISP_STRING_TO_EXTERNAL (tz, tzstring, Qnative);
+      tzstring = LISP_STRING_TO_EXTERNAL (tz, Qtime_zone_encoding);
     }
 
   set_time_zone_rule (tzstring);
   if (environbuf)
-    xfree (environbuf, Extbyte **);
+    xfree (environbuf);
   environbuf = environ;
 
   return Qnil;
@@ -2130,8 +2131,8 @@
 Execute BODY, saving and restoring current buffer's restrictions.
 The buffer's restrictions make parts of the beginning and end invisible.
 \(They are set up with `narrow-to-region' and eliminated with `widen'.)
-This special form, `save-restriction', saves the current buffer's restrictions
-when it is entered, and restores them when it is exited.
+This special operator, `save-restriction', saves the current buffer's
+restrictions when it is entered, and restores them when it is exited.
 So any `narrow-to-region' within BODY lasts only until the end of the form.
 The old restrictions settings are restored
 even in case of abnormal exit (throw or error).
@@ -2257,7 +2258,7 @@
   x2 = XCHAR (character2);
 
   return (!NILP (b->case_fold_search)
-	  ? DOWNCASE (b, x1) == DOWNCASE (b, x2)
+	  ? CANONCASE (b, x1) == CANONCASE (b, x2)
 	  : x1 == x2)
     ? Qt : Qnil;
 }
--- a/src/elhash.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/elhash.c	Wed Feb 24 01:58:04 2010 -0600
@@ -92,7 +92,7 @@
 
 /* obsolete as of 19990901 in xemacs-21.2 */
 static Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qkey_or_value_weak;
-static Lisp_Object Qnon_weak, Q_type;
+static Lisp_Object Qnon_weak, Q_type, Q_data;
 
 struct Lisp_Hash_Table
 {
@@ -184,36 +184,18 @@
 }
 
 
-#if 0 /* I don't think these are needed any more.
-	 If using the general lisp_object_equal_*() functions
-	 causes efficiency problems, these can be resurrected. --ben */
-/* equality and hash functions for Lisp strings */
-int
-lisp_string_equal (Lisp_Object str1, Lisp_Object str2)
-{
-  /* This is wrong anyway.  You can't use strcmp() on Lisp strings,
-     because they can contain zero characters.  */
-  return !strcmp ((char *) XSTRING_DATA (str1), (char *) XSTRING_DATA (str2));
-}
-
-static Hashcode
-lisp_string_hash (Lisp_Object obj)
-{
-  return hash_string (XSTRING_DATA (str), XSTRING_LENGTH (str));
-}
-
-#endif /* 0 */
 
 static int
 lisp_object_eql_equal (Lisp_Object obj1, Lisp_Object obj2)
 {
-  return EQ (obj1, obj2) || (FLOATP (obj1) && internal_equal (obj1, obj2, 0));
+  return EQ (obj1, obj2) ||
+    (NON_FIXNUM_NUMBER_P (obj1) && internal_equal (obj1, obj2, 0));
 }
 
 static Hashcode
 lisp_object_eql_hash (Lisp_Object obj)
 {
-  return FLOATP (obj) ? internal_hash (obj, 0) : LISP_HASH (obj);
+  return NON_FIXNUM_NUMBER_P (obj) ? internal_hash (obj, 0) : LISP_HASH (obj);
 }
 
 static int
@@ -262,7 +244,8 @@
    the same result -- if the keys are not equal according to the test
    function, then Fgethash() in hash_table_equal_mapper() will fail.  */
 static int
-hash_table_equal (Lisp_Object hash_table1, Lisp_Object hash_table2, int depth)
+hash_table_equal (Lisp_Object hash_table1, Lisp_Object hash_table2, int depth,
+		  int foldcase)
 {
   Lisp_Hash_Table *ht1 = XHASH_TABLE (hash_table1);
   Lisp_Hash_Table *ht2 = XHASH_TABLE (hash_table2);
@@ -281,7 +264,7 @@
       {
 	Lisp_Object value_in_other = Fgethash (e->key, hash_table2, Qunbound);
 	if (UNBOUNDP (value_in_other) ||
-	    !internal_equal (e->value, value_in_other, depth))
+	    !internal_equal_0 (e->value, value_in_other, depth, foldcase))
 	  return 0;		/* Give up */
       }
 
@@ -304,15 +287,15 @@
    syntax for hash tables.  This means that a typical hash table will be
    readably printed in the form of:
 
-   #s(hash-table size 2 data (key1 value1 key2 value2))
+   #s(hash-table :size 2 :data (key1 value1 key2 value2))
 
    The supported hash table structure keywords and their values are:
-   `test'             (eql (or nil), eq or equal)
-   `size'             (a natnum or nil)
-   `rehash-size'      (a float)
-   `rehash-threshold' (a float)
-   `weakness'         (nil, key, value, key-and-value, or key-or-value)
-   `data'             (a list)
+   `:test'             (eql (or nil), eq or equal)
+   `:size'             (a natnum or nil)
+   `:rehash-size'      (a float)
+   `:rehash-threshold' (a float)
+   `:weakness'         (nil, key, value, key-and-value, or key-or-value)
+   `:data'             (a list)
 
    If `print-readably' is nil, then a simpler syntax is used, for example
 
@@ -330,16 +313,16 @@
   int count = 0;
   htentry *e, *sentinel;
 
-  write_c_string (printcharfun, " data (");
+  write_ascstring (printcharfun, " :data (");
 
   for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++)
     if (!HTENTRY_CLEAR_P (e))
       {
 	if (count > 0)
-	  write_c_string (printcharfun, " ");
+	  write_ascstring (printcharfun, " ");
 	if (!print_readably && count > 3)
 	  {
-	    write_c_string (printcharfun, "...");
+	    write_ascstring (printcharfun, "...");
 	    break;
 	  }
 	print_internal (e->key, printcharfun, 1);
@@ -347,7 +330,7 @@
 	count++;
       }
 
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static void
@@ -357,16 +340,16 @@
   Lisp_Hash_Table *ht = XHASH_TABLE (obj);
   Ascbyte pigbuf[350];
 
-  write_c_string (printcharfun,
+  write_ascstring (printcharfun,
 		  print_readably ? "#s(hash-table" : "#<hash-table");
 
   /* These checks have a kludgy look to them, but they are safe.
      Due to nature of hashing, you cannot use arbitrary
      test functions anyway.  */
   if (!ht->test_function)
-    write_c_string (printcharfun, " test eq");
+    write_ascstring (printcharfun, " :test eq");
   else if (ht->test_function == lisp_object_equal_equal)
-    write_c_string (printcharfun, " test equal");
+    write_ascstring (printcharfun, " :test equal");
   else if (ht->test_function == lisp_object_eql_equal)
     DO_NOTHING;
   else
@@ -375,16 +358,16 @@
   if (ht->count || !print_readably)
     {
       if (print_readably)
-	write_fmt_string (printcharfun, " size %ld", (long) ht->count);
+	write_fmt_string (printcharfun, " :size %ld", (long) ht->count);
       else
-	write_fmt_string (printcharfun, " size %ld/%ld", (long) ht->count,
+	write_fmt_string (printcharfun, " :size %ld/%ld", (long) ht->count,
 			  (long) ht->size);
     }
 
   if (ht->weakness != HASH_TABLE_NON_WEAK)
     {
       write_fmt_string
-	(printcharfun, " weakness %s",
+	(printcharfun, " :weakness %s",
 	 (ht->weakness == HASH_TABLE_WEAK	    ? "key-and-value" :
 	  ht->weakness == HASH_TABLE_KEY_WEAK	    ? "key" :
 	  ht->weakness == HASH_TABLE_VALUE_WEAK	    ? "value" :
@@ -395,7 +378,7 @@
   if (ht->rehash_size != HASH_TABLE_DEFAULT_REHASH_SIZE)
     {
       float_to_string (pigbuf, ht->rehash_size);
-      write_fmt_string (printcharfun, " rehash-size %s", pigbuf);
+      write_fmt_string (printcharfun, " :rehash-size %s", pigbuf);
     }
 
   if (ht->rehash_threshold
@@ -403,14 +386,14 @@
 					      ht->test_function))
     {
       float_to_string (pigbuf, ht->rehash_threshold);
-      write_fmt_string (printcharfun, " rehash-threshold %s", pigbuf);
+      write_fmt_string (printcharfun, " :rehash-threshold %s", pigbuf);
     }
 
   if (ht->count)
     print_hash_table_data (ht, printcharfun);
 
   if (print_readably)
-    write_c_string (printcharfun, ")");
+    write_ascstring (printcharfun, ")");
   else
     write_fmt_string (printcharfun, " 0x%x>", ht->header.uid);
 }
@@ -434,7 +417,7 @@
 #endif
 
   if (!DUMPEDP (hentries))
-    xfree (hentries, htentry *);
+    xfree (hentries);
 }
 
 static void
@@ -841,17 +824,40 @@
   Lisp_Object weakness	       = Qnil;
   Lisp_Object data	       = Qnil;
 
-  PROPERTY_LIST_LOOP_3 (key, value, plist)
+  if (KEYWORDP (Fcar (plist)))
     {
-      if      (EQ (key, Qtest))		    test	     = value;
-      else if (EQ (key, Qsize))		    size	     = value;
-      else if (EQ (key, Qrehash_size))	    rehash_size	     = value;
-      else if (EQ (key, Qrehash_threshold)) rehash_threshold = value;
-      else if (EQ (key, Qweakness))	    weakness	     = value;
-      else if (EQ (key, Qdata))		    data	     = value;
-      else if (EQ (key, Qtype))/*obsolete*/ weakness	     = value;
-      else
-	ABORT ();
+      PROPERTY_LIST_LOOP_3 (key, value, plist)
+        {
+          if      (EQ (key, Q_test))		    test	     = value;
+          else if (EQ (key, Q_size))		    size	     = value;
+          else if (EQ (key, Q_rehash_size))	    rehash_size	     = value;
+          else if (EQ (key, Q_rehash_threshold)) rehash_threshold = value;
+          else if (EQ (key, Q_weakness))	    weakness	     = value;
+          else if (EQ (key, Q_data))		    data	     = value;
+          else if (!KEYWORDP (key))
+            signal_error (Qinvalid_read_syntax, 
+                          "can't mix keyword and non-keyword hash table syntax",
+                          key);
+          else ABORT();
+        }
+    }
+  else
+    {
+      PROPERTY_LIST_LOOP_3 (key, value, plist)
+        {
+          if      (EQ (key, Qtest))		    test	     = value;
+          else if (EQ (key, Qsize))		    size	     = value;
+          else if (EQ (key, Qrehash_size))	    rehash_size	     = value;
+          else if (EQ (key, Qrehash_threshold)) rehash_threshold = value;
+          else if (EQ (key, Qweakness))	    weakness	     = value;
+          else if (EQ (key, Qdata))		    data	     = value;
+          else if (EQ (key, Qtype))/*obsolete*/ weakness	     = value;
+          else if (KEYWORDP (key))
+            signal_error (Qinvalid_read_syntax, 
+                          "can't mix keyword and non-keyword hash table syntax",
+                          key);
+          else ABORT();                   
+        }
     }
 
   /* Create the hash table.  */
@@ -887,6 +893,16 @@
   struct structure_type *st;
 
   st = define_structure_type (structure_name, 0, hash_table_instantiate);
+
+  /* First the keyword syntax: */
+  define_structure_type_keyword (st, Q_test, hash_table_test_validate);
+  define_structure_type_keyword (st, Q_size, hash_table_size_validate);
+  define_structure_type_keyword (st, Q_rehash_size, hash_table_rehash_size_validate);
+  define_structure_type_keyword (st, Q_rehash_threshold, hash_table_rehash_threshold_validate);
+  define_structure_type_keyword (st, Q_weakness, hash_table_weakness_validate);
+  define_structure_type_keyword (st, Q_data, hash_table_data_validate);
+
+  /* Next the mutually exclusive, older, non-keyword syntax: */
   define_structure_type_keyword (st, Qtest, hash_table_test_validate);
   define_structure_type_keyword (st, Qsize, hash_table_size_validate);
   define_structure_type_keyword (st, Qrehash_size, hash_table_rehash_size_validate);
@@ -1092,7 +1108,7 @@
   memcpy (ht->hentries, new_entries, ht->size * sizeof (htentry));
 
 #ifndef NEW_GC
-  xfree (new_entries, htentry *);
+  xfree (new_entries);
 #endif /* not NEW_GC */
 }
 
@@ -1387,7 +1403,7 @@
 maphash_unwind (Lisp_Object unwind_obj)
 {
   void *ptr = (void *) get_opaque_ptr (unwind_obj);
-  xfree (ptr, void *);
+  xfree (ptr);
   free_opaque_ptr (unwind_obj);
   return Qnil;
 }
@@ -1831,6 +1847,7 @@
   DEFSYMBOL (Qvalue_weak); /* obsolete */
   DEFSYMBOL (Qnon_weak);     /* obsolete */
 
+  DEFKEYWORD (Q_data);
   DEFKEYWORD (Q_test);
   DEFKEYWORD (Q_size);
   DEFKEYWORD (Q_rehash_size);
--- a/src/emacs.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/emacs.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994
    Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -18,8 +18,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Mule 2.0, FSF 19.28. */
 
@@ -391,7 +391,7 @@
      sysdep.c (maybe; wait_for_termination)
      unexec.c
      unicode.c
-     xgccache.c (a bit)
+     gccache-x.c (a bit)
 
      #### review .h files; write a perl program to look for long comments
      throughout the files, ignoring stuff inside of DEFUN's.
@@ -670,8 +670,11 @@
 int preparing_for_armageddon;
 
 /* Nonzero means we're in an unstable situation and need to skip
-   i18n conversions and such.  During printing we check for this,
-   and during conversion we abort if we see this. */
+   internal->external conversions, QUIT checking and such.  This gets set
+   during early startup, during shutdown, and when debug printing
+   (i.e. called from a debugger such as gdb to print Lisp objects or
+   backtraces).  During printing we check for this, and during conversion
+   we abort if we see this. */
 int inhibit_non_essential_conversion_operations;
 
 static JMP_BUF run_temacs_catch;
@@ -714,7 +717,7 @@
 	      full_exe_path = mswindows_get_module_file_name ();
 	      assert (full_exe_path);
 	      fullpath = build_tstr_string (full_exe_path);
-	      xfree (full_exe_path, Extbyte *);
+	      xfree (full_exe_path);
 	      result = Fcons (fullpath, result);
 	    }
 	  else
@@ -747,8 +750,9 @@
     {
       CHECK_STRING (XCAR (next));
 
-      LISP_STRING_TO_EXTERNAL_MALLOC (XCAR (next), (*argv) [i],
-				      Qcommand_argument_encoding);
+      (*argv)[i] =
+	(Wexttext *) LISP_STRING_TO_EXTERNAL_MALLOC
+	(XCAR (next), Qcommand_argument_encoding);
     }
   (*argv) [n] = 0;
   *argc = i;
@@ -761,10 +765,10 @@
 
   while (argv[elt])
     {
-      xfree (argv[elt], Wexttext *);
+      xfree (argv[elt]);
       elt++;
     }
-  xfree (argv, Wexttext **);
+  xfree (argv);
 }
 
 static void
@@ -936,8 +940,8 @@
 
 #define SHEBANG_PROGNAME_LENGTH                                         \
   (int)((sizeof (WEXTSTRING (SHEBANG_PROGNAME)) - sizeof (WEXTSTRING (""))))
-#define SHEBANG_EXE_PROGNAME_LENGTH                                     \
-  (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME) WEXTSTRING(".exe"))       \
+#define SHEBANG_EXE_PROGNAME_LENGTH			\
+  (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME) WEXTSTRING (".exe"))	\
         - sizeof (WEXTSTRING ("")))
 
   {
@@ -959,7 +963,7 @@
 	    int j;
 
 	    newarr[0] = argv[0];
-	    newarr[1] = WEXTSTRING ("--script");
+	    newarr[1] = (Wexttext *) WEXTSTRING ("--script");
 	    for (j = 1; j < argc; ++j)
 	      {
 		newarr[j + 1] = argv[j];
@@ -1252,7 +1256,7 @@
 
 	  for (j = 0; j < count_before + 1; j++)
 	    new_[j] = argv[j];
-	  new_[count_before + 1] = WEXTSTRING ("-d");
+	  new_[count_before + 1] = (Wexttext *) WEXTSTRING ("-d");
 	  new_[count_before + 2] = dpy;
 	  for (j = count_before + 2; j <argc; j++)
 	    new_[j + 1] = argv[j];
@@ -1262,7 +1266,7 @@
       /* Change --display to -d, when its arg is separate.  */
       else if (dpy != 0 && skip_args > count_before
 	       && argv[count_before + 1][1] == '-')
-	argv[count_before + 1] = WEXTSTRING ("-d");
+	argv[count_before + 1] = (Wexttext *) WEXTSTRING ("-d");
 
       /* Don't actually discard this arg.  */
       skip_args = count_before;
@@ -1641,7 +1645,7 @@
 #endif
 #endif /* HAVE_XIM */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       syms_of_font_mgr();
 #endif
 
@@ -1895,6 +1899,9 @@
       reinit_opaque_early ();
 #endif /* not NEW_GC */
       reinit_eistring_early ();
+#ifdef WITH_NUMBER_TYPES
+      reinit_vars_of_number ();
+#endif
 
       reinit_console_type_create_stream ();
 #ifdef HAVE_TTY
@@ -2007,8 +2014,9 @@
 	 -- Fset() on a symbol that is unbound
 	 -- Any of the object-creating functions in alloc.c: e.g.
 	    - make_string()
-	    - build_intstring()
-	    - build_string()
+	    - build_istring()
+	    - build_cistring()
+	    - build_ascstring()
 	    - make_vector()
 	    - make_int()
 	    - make_char()
@@ -2221,7 +2229,7 @@
       vars_of_gui_x ();
 #endif
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       vars_of_font_mgr ();
 #endif
 
@@ -2292,6 +2300,7 @@
       /* Now do additional vars_of_*() initialization that happens both
 	 at dump time and after pdump load. */
       reinit_vars_of_buffer ();
+      reinit_vars_of_bytecode ();
       reinit_vars_of_console ();
 #ifdef DEBUG_XEMACS
       reinit_vars_of_debug ();
@@ -2351,7 +2360,7 @@
 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
       reinit_vars_of_gui_x ();
 #endif
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       reinit_vars_of_font_mgr ();
 #endif
 #endif /* HAVE_X_WINDOWS */
@@ -2411,8 +2420,11 @@
 	 then we suddenly have dependence on the previous call. */
       complex_vars_of_file_coding ();
 #ifdef WIN32_ANY
+      /* Define MS-Windows Unicode coding systems */
       complex_vars_of_intl_win32 ();
 #endif
+      /* Define UTF-8 coding system */
+      complex_vars_of_unicode ();
 
       /* At this point we should be able to do conversion operations.
          We have initialized things to the point that we can create Lisp
@@ -2421,7 +2433,7 @@
 	 quite soon, e.g. in complex_vars_of_glyphs_x(). */
       inhibit_non_essential_conversion_operations = 0;
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       /* This uses coding systems.  Must be done before faces are init'ed. */
       /* not in xft reloaded #3 */
       complex_vars_of_font_mgr ();
@@ -2626,7 +2638,7 @@
       if (XSTRING_DATA (Vinvocation_name)[0] == '-')
 	{
 	  /* XEmacs as a login shell, oh goody! */
-	  Vinvocation_name = build_intstring (egetenv ("SHELL"));
+	  Vinvocation_name = build_istring (egetenv ("SHELL"));
 	}
       Vinvocation_directory = Vinvocation_name;
 
@@ -2912,9 +2924,9 @@
     }
 
   memcpy (argv, new_argv, sizeof (Wexttext *) * argc);
-  xfree (new_argv, Wexttext **);
-  xfree (options, int *);
-  xfree (priority, int *);
+  xfree (new_argv);
+  xfree (options);
+  xfree (priority);
 }
 
 DEFUN ("running-temacs-p", Frunning_temacs_p, 0, 0, 0, /*
@@ -3002,15 +3014,16 @@
   run_temacs_argc = nargs + 1;
   run_temacs_argv = xnew_array (Wexttext *, nargs + 2);
 
-  LISP_STRING_TO_EXTERNAL_MALLOC (Fcar (Vcommand_line_args),
-				  run_temacs_argv[0],
-				  Qcommand_argument_encoding);
+  run_temacs_argv[0] =
+    (Wexttext *) LISP_STRING_TO_EXTERNAL_MALLOC (Fcar (Vcommand_line_args),
+						 Qcommand_argument_encoding);
   for (i = 0; i < nargs; i++)
     {
       CHECK_STRING (args[i]);
 
-      LISP_STRING_TO_EXTERNAL_MALLOC (args[i], run_temacs_argv[i + 1],
-				      Qcommand_argument_encoding);
+      run_temacs_argv[i + 1] =
+	(Wexttext *)
+	LISP_STRING_TO_EXTERNAL_MALLOC (args[i], Qcommand_argument_encoding);
     }
   run_temacs_argv[nargs + 1] = 0;
 
@@ -3287,10 +3300,10 @@
     Extbyte *filename_ext;
     Extbyte *symfile_ext;
 
-    LISP_STRING_TO_EXTERNAL (filename, filename_ext, Qfile_name);
+    LISP_PATHNAME_CONVERT_OUT (filename, filename_ext);
 
     if (STRINGP (symfile))
-      LISP_STRING_TO_EXTERNAL (symfile, symfile_ext, Qfile_name);
+      LISP_PATHNAME_CONVERT_OUT (symfile, symfile_ext);
     else
       symfile_ext = 0;
 
@@ -3321,6 +3334,21 @@
 /*                  exiting XEmacs (intended or not)                    */
 /************************************************************************/
 
+/* Do we need to pause with a message box so that messages can be read
+   at shutdown?  We do this is we have support for native Windows frames
+   and if we are native Windows.  The first part is because only when compiled
+   for native Windows frames do we have Fmswindows_message_box(), and
+   the second part is because we don't want to do this under Cygwin, where
+   we have a Unix-like environment and a working stderr where the messages
+   go.  The two conditions sound somewhat redundant (maybe we could just
+   use the second?) but they aren't completely: Theoretically (maybe with
+   MinGW?) we could imagine compiling under native Windows as the OS
+   but e.g. targetting only X Windows as the window system. --ben */
+
+#if defined (HAVE_MS_WINDOWS) && defined (WIN32_NATIVE)
+# define NEED_WINDOWS_MESSAGE_PAUSE
+#endif
+
 /*
 
 Info on intended/unintended exits:
@@ -3348,7 +3376,7 @@
 
 /* Return whether all bytes in the specified memory block can be read. */
 int
-debug_can_access_memory (void *ptr, Bytecount len)
+debug_can_access_memory (const void *ptr, Bytecount len)
 {
   return !IsBadReadPtr (ptr, len);
 }
@@ -3367,9 +3395,16 @@
   LONGJMP (memory_error_jump, 1);
 }
 
+/* Used in debug_can_access_memory().  Made into a global, externally
+   accessible variable to make absolutely sure that no compiler will
+   optimize away the memory-read function in debug_can_access_memory();
+   see comments there. */
+
+volatile int dcam_saveval;
+
 /* Return whether all bytes in the specified memory block can be read. */
 int
-debug_can_access_memory (void *ptr, Bytecount len)
+debug_can_access_memory (const void *ptr, Bytecount len)
 {
   /* Use volatile to protect variables from being clobbered by longjmp. */
   SIGTYPE (*volatile old_sigbus) (int);
@@ -3377,6 +3412,7 @@
   volatile int old_errno = errno;
   volatile int retval = 1;
 
+  assert (len > 0);
   if (!SETJMP (memory_error_jump))
     {
       old_sigbus =
@@ -3384,13 +3420,24 @@
       old_sigsegv =
 	(SIGTYPE (*) (int)) EMACS_SIGNAL (SIGSEGV, debug_memory_error);
 
+      /* We could just do memcmp (ptr, ptr, len), but we want to avoid any
+	 possibility that a super-optimizing compiler might optimize away such
+	 a call by concluding that its result is always 1. */
       if (len > 1)
-	/* If we can, try to avoid problems with super-optimizing compilers
-	   that might decide that memcmp (ptr, ptr, len) can be optimized
-	   away since its result is always 1. */
-	memcmp (ptr, (Rawbyte *) ptr + 1, len - 1);
+	/* Instead, if length is > 1, do off-by-one comparison.
+           We save the value somewhere that is externally accessible to
+           make absolutely sure that a compiler won't optimize away the
+           call by concluding that the return value isn't really used.
+           */
+	dcam_saveval = memcmp (ptr, (Rawbyte *) ptr + 1, len - 1);
       else
-	memcmp (ptr, ptr, len);
+	{
+	  /* We can't do the off-by-one trick with only one byte, so instead,
+             we compare to a fixed-sized buffer. */
+	  Rawbyte randval[1];
+	  randval[0] = 0;
+	  dcam_saveval = memcmp (randval, ptr, len);
+	}
     }
   else
     retval = 0;
@@ -3436,7 +3483,7 @@
   Vquit_flag = Qnil;
 }
 
-#ifdef HAVE_MS_WINDOWS
+#ifdef NEED_WINDOWS_MESSAGE_PAUSE
 static void
 pause_so_user_can_read_messages (int allow_further)
 {
@@ -3687,7 +3734,7 @@
 
   UNGCPRO;
 
-#ifdef HAVE_MS_WINDOWS
+#ifdef NEED_WINDOWS_MESSAGE_PAUSE
   pause_so_user_can_read_messages (1);
 #endif
 
@@ -3723,7 +3770,7 @@
    loops will fight each other and the return key will never be passed to
    the "pause" handler so that XEmacs's GPF handler can return, resignal
    the GPF, and properly go into the debugger.) */
-#if defined (ERROR_CHECK_TYPES) || defined (ERROR_CHECK_TEXT) || defined (ERROR_CHECK_GC) || defined (ERROR_CHECK_STRUCTURES)
+#ifdef ERROR_CHECK_ANY
 #define USER_IS_DEVELOPING_XEMACS
 #endif
 
@@ -3779,7 +3826,7 @@
           }
       }
 # endif
-#if defined (HAVE_MS_WINDOWS) && !defined (USER_IS_DEVELOPING_XEMACS)
+#if defined (NEED_WINDOWS_MESSAGE_PAUSE) && !defined (USER_IS_DEVELOPING_XEMACS)
       pause_so_user_can_read_messages (0);
 #endif
     }
@@ -3938,7 +3985,7 @@
   /* We are extremely paranoid so we sensibly deal with recursive
      assertion failures. */
   in_assert_failed++;
-  inhibit_non_essential_conversion_operations = 1;
+  inhibit_non_essential_conversion_operations++;
 
   if (in_assert_failed >= 4)
     _exit (-1);
@@ -4006,8 +4053,8 @@
   really_abort ();
 #endif /* defined (_MSC_VER) || defined (CYGWIN) */
 #endif /* !defined (ASSERTIONS_DONT_ABORT) */
-  inhibit_non_essential_conversion_operations = 0;
-  in_assert_failed = 0;
+  inhibit_non_essential_conversion_operations--;
+  in_assert_failed--;
 }
 
 /* -------------------------------------- */
@@ -4183,7 +4230,7 @@
   DEFVAR_LISP ("system-configuration", &Vsystem_configuration /*
 String naming the configuration XEmacs was built for.
 */ );
-  Vsystem_configuration = build_string (EMACS_CONFIGURATION);
+  Vsystem_configuration = build_ascstring (EMACS_CONFIGURATION);
 
 #ifndef EMACS_CONFIG_OPTIONS
 # define EMACS_CONFIG_OPTIONS "UNKNOWN"
@@ -4191,7 +4238,7 @@
   DEFVAR_LISP ("system-configuration-options", &Vsystem_configuration_options /*
 String containing the configuration options XEmacs was built with.
 */ );
-  Vsystem_configuration_options = build_string (EMACS_CONFIG_OPTIONS);
+  Vsystem_configuration_options = build_ascstring (EMACS_CONFIG_OPTIONS);
 
   DEFVAR_LISP ("emacs-major-version", &Vemacs_major_version /*
 Major version number of this version of Emacs, as an integer.
@@ -4257,7 +4304,7 @@
 #ifndef XEMACS_CODENAME
 #define XEMACS_CODENAME "Noname"
 #endif
-  Vxemacs_codename = build_string (XEMACS_CODENAME);
+  Vxemacs_codename = build_ascstring (XEMACS_CODENAME);
 
   DEFVAR_LISP ("xemacs-extra-name", &Vxemacs_extra_name /*
 Arbitrary string to place in the version string after the codename.
@@ -4270,7 +4317,7 @@
 to indicate particular branches, etc.
 */ );
 #ifdef XEMACS_EXTRA_NAME
-  Vxemacs_extra_name = build_string (XEMACS_EXTRA_NAME);
+  Vxemacs_extra_name = build_ascstring (XEMACS_EXTRA_NAME);
 #endif
   
   DEFVAR_LISP ("xemacs-release-date", &Vxemacs_release_date /*
@@ -4282,7 +4329,7 @@
 #ifndef XEMACS_RELEASE_DATE
 #define XEMACS_RELEASE_DATE "2005-02-18 (defaulted in emacs.c)"
 #endif
-  Vxemacs_release_date = build_string (XEMACS_RELEASE_DATE);
+  Vxemacs_release_date = build_ascstring (XEMACS_RELEASE_DATE);
   
   /* Lisp variables which contain command line flags.
 
@@ -4451,14 +4498,14 @@
 For example, this may be \"xemacs\" or \"infodock\".
 This is mainly meant for use in path searching.
 */ );
-  Vemacs_program_name = build_ext_string (PATH_PROGNAME, Qfile_name);
+  Vemacs_program_name = build_extstring (PATH_PROGNAME, Qfile_name);
 
   DEFVAR_LISP ("emacs-program-version", &Vemacs_program_version /*
 *Version of the Emacs variant.
 This typically has the form NN.NN-bNN.
 This is mainly meant for use in path searching.
 */ );
-  Vemacs_program_version = build_ext_string (PATH_VERSION, Qfile_name);
+  Vemacs_program_version = build_extstring (PATH_VERSION, Qfile_name);
 
   DEFVAR_LISP ("exec-path", &Vexec_path /*
 *List of directories to search programs to run in subprocesses.
@@ -4478,7 +4525,7 @@
 */ );
 #ifdef PATH_EXEC
   Vconfigure_exec_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_EXEC, Qfile_name));
+    (build_extstring (PATH_EXEC, Qfile_name));
 #else
   Vconfigure_exec_directory = Qnil;
 #endif
@@ -4494,7 +4541,7 @@
 */ );
 #ifdef PATH_LOADSEARCH
   Vconfigure_lisp_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_LOADSEARCH, Qfile_name));
+    (build_extstring (PATH_LOADSEARCH, Qfile_name));
 #else
   Vconfigure_lisp_directory = Qnil;
 #endif
@@ -4510,7 +4557,7 @@
 */ );
 #ifdef PATH_MULELOADSEARCH
   Vconfigure_mule_lisp_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_MULELOADSEARCH, Qfile_name);
+    (build_extstring (PATH_MULELOADSEARCH, Qfile_name);
 #else
   Vconfigure_mule_lisp_directory = Qnil;
 #endif
@@ -4526,7 +4573,7 @@
 */ );
 #ifdef PATH_MODULESEARCH
   Vconfigure_module_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_MODULESEARCH, Qfile_name));
+    (build_extstring (PATH_MODULESEARCH, Qfile_name));
 #else
   Vconfigure_module_directory = Qnil;
 #endif
@@ -4586,7 +4633,7 @@
 */ );
 #ifdef PATH_DATA
   Vconfigure_data_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_DATA, Qfile_name));
+    (build_extstring (PATH_DATA, Qfile_name));
 #else
   Vconfigure_data_directory = Qnil;
 #endif
@@ -4608,7 +4655,7 @@
 */ );
 #ifdef PATH_SITE
   Vconfigure_site_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_SITE, Qfile_name));
+    (build_extstring (PATH_SITE, Qfile_name));
 #else
   Vconfigure_site_directory = Qnil;
 #endif
@@ -4624,7 +4671,7 @@
 */ );
 #ifdef PATH_SITE_MODULES
   Vconfigure_site_module_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_SITE_MODULES, Qfile_name));
+    (build_extstring (PATH_SITE_MODULES, Qfile_name));
 #else
   Vconfigure_site_module_directory = Qnil;
 #endif
@@ -4641,7 +4688,7 @@
 */ );
 #ifdef PATH_DOC
   Vconfigure_doc_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_DOC, Qfile_name));
+    (build_extstring (PATH_DOC, Qfile_name));
 #else
   Vconfigure_doc_directory = Qnil;
 #endif
@@ -4652,7 +4699,7 @@
 */ );
 #ifdef PATH_EXEC_PREFIX
   Vconfigure_exec_prefix_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_EXEC_PREFIX, Qfile_name));
+    (build_extstring (PATH_EXEC_PREFIX, Qfile_name));
 #else
   Vconfigure_exec_prefix_directory = Qnil;
 #endif
@@ -4663,7 +4710,7 @@
 */ );
 #ifdef PATH_PREFIX
   Vconfigure_prefix_directory = Ffile_name_as_directory
-    (build_ext_string (PATH_PREFIX, Qfile_name));
+    (build_extstring (PATH_PREFIX, Qfile_name));
 #else
   Vconfigure_prefix_directory = Qnil;
 #endif
@@ -4676,7 +4723,7 @@
 */ );
 #ifdef PATH_INFO
   Vconfigure_info_directory =
-    Ffile_name_as_directory (build_ext_string (PATH_INFO, Qfile_name));
+    Ffile_name_as_directory (build_extstring (PATH_INFO, Qfile_name));
 #else
   Vconfigure_info_directory = Qnil;
 #endif
--- a/src/emodules.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/emodules.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,6 @@
 /* emodules.c - Support routines for dynamic module loading
 (C) Copyright 1998, 1999 J. Kean Johnston. All rights reserved.
+(C) Copyright 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -18,6 +19,8 @@
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* This file has been Mule-ized, Ben Wing, 1-26-10. */
+
 #include "emodules.h"
 #include "sysdll.h"
 #ifdef HAVE_LTDL
@@ -48,11 +51,11 @@
 typedef struct _emodules_list
 {
   int used;             /* Is this slot used?                              */
-  CIbyte *soname;       /* Name of the shared object loaded (full path)    */
-  CIbyte *modname;      /* The name of the module                          */
-  CIbyte *modver;       /* The module version string                       */
-  CIbyte *modtitle;     /* How the module announces itself                 */
-  void (*unload)(void); /* Module cleanup function to run before unloading */
+  Ibyte *soname;        /* Name of the shared object loaded (full path)    */
+  Ibyte *modname;       /* The name of the module                          */
+  Ibyte *modver;        /* The module version string                       */
+  Ibyte *modtitle;      /* How the module announces itself                 */
+  void (*unload) (void);/* Module cleanup function to run before unloading */
   dll_handle dlhandle;  /* Dynamic lib handle                              */
 } emodules_list;
 
@@ -61,8 +64,8 @@
 static emodules_list *modules;
 static int modnum;
 
-static int find_make_module (const CIbyte *mod, const CIbyte *name,
-			     const CIbyte *ver, int make_or_find);
+static int find_make_module (Lisp_Object mod, const Ibyte *name,
+			     const Ibyte *ver, int make_or_find);
 static Lisp_Object module_load_unwind (Lisp_Object);
 static void attempt_module_delete (int mod);
 
@@ -96,22 +99,22 @@
 */
        (file, name, version))
 {
-  const CIbyte *mod, *mname, *mver;
+  const Ibyte *mod, *mname, *mver;
   int speccount = specpdl_depth();
 
-  CHECK_STRING(file);
+  CHECK_STRING (file);
 
-  mod = (CIbyte *) XSTRING_DATA (file);
+  mod = XSTRING_DATA (file);
 
   if (NILP (name))
-    mname = "";
+    mname = (const Ibyte *) "";
   else
-    mname = (CIbyte *) XSTRING_DATA (name);
+    mname = XSTRING_DATA (name);
 
   if (NILP (version))
-    mver = "";
+    mver = (const Ibyte *) "";
   else
-    mver = (CIbyte *) XSTRING_DATA (version);
+    mver = XSTRING_DATA (version);
 
   dlhandle = 0;
   record_unwind_protect (module_load_unwind, make_int(modnum));
@@ -136,7 +139,7 @@
        (file, name, version))
 {
   int x;
-  const CIbyte *mod, *mname, *mver;
+  const Ibyte *mname, *mver;
   Lisp_Object foundname = Qnil;
   struct gcpro gcpro1;
 
@@ -146,20 +149,19 @@
   if (locate_file (Vmodule_load_path, file, Vmodule_extensions, &foundname, 0)
       < 0)
     return Qt;
-  mod = (CIbyte *) XSTRING_DATA (foundname);
   UNGCPRO;
 
   if (NILP (name))
-    mname = "";
+    mname = (const Ibyte *) "";
   else
-    mname = (CIbyte *) XSTRING_DATA (name);
+    mname = XSTRING_DATA (name);
 
   if (NILP (version))
-    mver = "";
+    mver = (const Ibyte *) "";
   else
-    mver = (CIbyte *) XSTRING_DATA (version);
+    mver = XSTRING_DATA (version);
 
-  x = find_make_module (mod, mname, mver, 1);
+  x = find_make_module (foundname, mname, mver, 1);
   if (x != -1)
     {
       if (modules[x].unload != NULL)
@@ -199,30 +201,31 @@
   for (i = 0; i < modnum; i++)
     {
       if (modules[i].used == 1)
-        mlist = Fcons (list4 (build_string (modules[i].soname),
-                              build_string (modules[i].modname),
-                              build_string (modules[i].modver),
-                              build_string (modules[i].modtitle)), mlist);
+        mlist = Fcons (list4 (build_istring (modules[i].soname),
+                              build_istring (modules[i].modname),
+                              build_istring (modules[i].modver),
+                              build_istring (modules[i].modtitle)), mlist);
     }
 
   return mlist;
 }
 
 static int
-find_make_module (const CIbyte *mod, const CIbyte *name, const CIbyte *ver,
+find_make_module (Lisp_Object mod, const Ibyte *name, const Ibyte *ver,
 		  int mof)
 {
   int i, fs = -1;
+  Ibyte *modstr = XSTRING_DATA (mod);
 
   for (i = 0; i < modnum; i++)
     {
       if (fs == -1 && modules[i].used == 0)
         fs = i;
-      if (strcmp (modules[i].soname, mod) == 0)
+      if (qxestrcmp (modules[i].soname, modstr) == 0)
         {
-          if (name && name[0] && strcmp (modules[i].modname, name))
+          if (name && name[0] && qxestrcmp (modules[i].modname, name))
             continue;
-          if (ver && ver[0] && strcmp (modules[i].modver, ver))
+          if (ver && ver[0] && qxestrcmp (modules[i].modver, ver))
             continue;
           return i; /* Found a match */
         }
@@ -253,10 +256,10 @@
 {
   if (dll_close (modules[mod].dlhandle) == 0)
     {
-      xfree (modules[mod].soname, CIbyte *);
-      xfree (modules[mod].modname, CIbyte *);
-      xfree (modules[mod].modver, CIbyte *);
-      xfree (modules[mod].modtitle, CIbyte *);
+      xfree (modules[mod].soname);
+      xfree (modules[mod].modname);
+      xfree (modules[mod].modver);
+      xfree (modules[mod].modtitle);
       modules[mod].dlhandle = 0;
       modules[mod].used = 0;
     }
@@ -330,18 +333,16 @@
  * the cleaning up.
  */
 void
-emodules_load (const CIbyte *module, const CIbyte *modname,
-	       const CIbyte *modver)
+emodules_load (const Ibyte *module, const Ibyte *modname,
+	       const Ibyte *modver)
 {
-  /* !!#### Needs serious work */
   Lisp_Object old_load_list;
   Lisp_Object filename;
   Lisp_Object foundname, lisp_modname;
   int x, mpx;
-  CIbyte *soname;
-  const CIbyte **f;
+  const Extbyte **f;
   const long *ellcc_rev;
-  CIbyte *mver, *mname, *mtitle, *symname;
+  Ibyte *mver, *mname, *mtitle, *symname;
   void (*modload)(void) = 0;
   void (*modsyms)(void) = 0;
   void (*modvars)(void) = 0;
@@ -359,13 +360,12 @@
   if (module == NULL || module[0] == '\0')
     invalid_argument ("Empty module name", Qunbound);
 
-  GCPRO4(filename, foundname, old_load_list, lisp_modname);
-  filename = build_string (module);
+  GCPRO4 (filename, foundname, old_load_list, lisp_modname);
+  filename = build_istring (module);
   if (locate_file (Vmodule_load_path, filename, Vmodule_extensions,
 		   &foundname, 0) < 0)
     signal_error (Qdll_error, "Cannot open dynamic module", filename);
 
-  LISP_STRING_TO_EXTERNAL (foundname, soname, Qfile_name);
   lisp_modname = call1 (Qfile_name_sans_extension,
 			Ffile_name_nondirectory (foundname));
 
@@ -375,76 +375,87 @@
       signal_error (Qdll_error, "Opening dynamic module", dll_error ());
     }
 
-  ellcc_rev = (const long *)dll_variable (dlhandle, "emodule_compiler");
+  ellcc_rev = (const long *) dll_variable (dlhandle,
+					   (const Ibyte *) "emodule_compiler");
   if (ellcc_rev == NULL || *ellcc_rev <= 0L)
     signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_compiler'", Qunbound);
   if (*ellcc_rev > EMODULES_REVISION)
     signal_ferror (Qdll_error, "Invalid dynamic module: Unsupported version `%ld(%ld)'", *ellcc_rev, EMODULES_REVISION);
 
-  f = (const CIbyte **) dll_variable (dlhandle, "emodule_name");
+  f = (const Extbyte **) dll_variable (dlhandle,
+				       (const Ibyte *) "emodule_name");
   if (f == NULL || *f == NULL)
     signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_name'", Qunbound);
 
-  mname = (CIbyte *) ALLOCA (strlen (*f) + 1);
-  strcpy (mname, *f);
+  mname = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding);
+  /* #### Not obvious we have to force an alloca copy here, but the old
+     code did so */
+  IBYTE_STRING_TO_ALLOCA (mname, mname);
+
   if (mname[0] == '\0')
     signal_error (Qdll_error, "Invalid dynamic module: Empty value for `emodule_name'", Qunbound);
 
-  f = (const CIbyte **) dll_variable (dlhandle, "emodule_version");
+  f = (const Extbyte **) dll_variable (dlhandle,
+				       (const Ibyte *) "emodule_version");
   if (f == NULL || *f == NULL)
     signal_error (Qdll_error, "Missing symbol `emodule_version': Invalid dynamic module", Qunbound);
 
-  mver = (CIbyte *) ALLOCA (strlen (*f) + 1);
-  strcpy (mver, *f);
+  mver = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding);
+  /* #### Not obvious we have to force an alloca copy here, but the old
+     code did so */
+  IBYTE_STRING_TO_ALLOCA (mver, mver);
 
-  f = (const CIbyte **) dll_variable (dlhandle, "emodule_title");
+  f = (const Extbyte **) dll_variable (dlhandle,
+				       (const Ibyte *) "emodule_title");
   if (f == NULL || *f == NULL)
     signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_title'", Qunbound);
 
-  mtitle = (CIbyte *) ALLOCA (strlen (*f) + 1);
-  strcpy (mtitle, *f);
+  mtitle = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding);
+  /* #### Not obvious we have to force an alloca copy here, but the old
+     code did so */
+  IBYTE_STRING_TO_ALLOCA (mtitle, mtitle);
 
-  symname = (CIbyte *) ALLOCA (strlen (mname) + 15);
+  symname = alloca_ibytes (qxestrlen (mname) + 15);
 
-  strcpy (symname, "modules_of_");
-  strcat (symname, mname);
-  modload = (void (*)(void))dll_function (dlhandle, symname);
+  qxestrcpy_ascii (symname, "modules_of_");
+  qxestrcat (symname, mname);
+  modload = (void (*)(void)) dll_function (dlhandle, symname);
   /*
    * modload is optional. If the module doesn't require other modules it can
    * be left out.
    */
 
-  strcpy (symname, "syms_of_");
-  strcat (symname, mname);
-  modsyms = (void (*)(void))dll_function (dlhandle, symname);
+  qxestrcpy_ascii (symname, "syms_of_");
+  qxestrcat (symname, mname);
+  modsyms = (void (*)(void)) dll_function (dlhandle, symname);
   if (modsyms == NULL)
     {
     missing_symbol:
       signal_error (Qdll_error, "Invalid dynamic module: Missing symbol",
-		    build_string (symname));
+		    build_istring (symname));
     }
 
-  strcpy (symname, "vars_of_");
-  strcat (symname, mname);
-  modvars = (void (*)(void))dll_function (dlhandle, symname);
+  qxestrcpy_ascii (symname, "vars_of_");
+  qxestrcat (symname, mname);
+  modvars = (void (*)(void)) dll_function (dlhandle, symname);
   if (modvars == NULL)
     goto missing_symbol;
 
-  strcpy (symname, "docs_of_");
-  strcat (symname, mname);
-  moddocs = (void (*)(void))dll_function (dlhandle, symname);
+  qxestrcpy_ascii (symname, "docs_of_");
+  qxestrcat (symname, mname);
+  moddocs = (void (*)(void)) dll_function (dlhandle, symname);
   if (moddocs == NULL)
     goto missing_symbol;
 
   /* Now look for the optional unload function. */
-  strcpy (symname, "unload_");
-  strcat (symname, mname);
-  modunld = (void (*)(void))dll_function (dlhandle, symname);
+  qxestrcpy_ascii (symname, "unload_");
+  qxestrcat (symname, mname);
+  modunld = (void (*)(void)) dll_function (dlhandle, symname);
 
-  if (modname && modname[0] && strcmp (modname, mname))
+  if (modname && modname[0] && qxestrcmp (modname, mname))
     signal_error (Qdll_error, "Module name mismatch", Qunbound);
 
-  if (modver && modver[0] && strcmp (modver, mver))
+  if (modver && modver[0] && qxestrcmp (modver, mver))
     signal_error (Qdll_error, "Module version mismatch", Qunbound);
 
   /*
@@ -453,7 +464,7 @@
    * If that is non-zero, we know that we have a previously loaded module
    * of the same name and version, and we don't need to go any further.
    */
-  mpx = find_make_module (soname, mname, mver, 0);
+  mpx = find_make_module (foundname, mname, mver, 0);
   mp = &modules[mpx];
   if (mp->used > 0)
     {
@@ -471,10 +482,10 @@
    * module to the list of modules.
    */
   mp->used = emodules_depth + 1;
-  mp->soname = xstrdup (soname);
-  mp->modname = xstrdup (mname);
-  mp->modver = xstrdup (mver);
-  mp->modtitle = xstrdup (mtitle);
+  mp->soname = qxestrdup (XSTRING_DATA (foundname));
+  mp->modname = qxestrdup (mname);
+  mp->modver = qxestrdup (mver);
+  mp->modtitle = qxestrdup (mtitle);
   mp->dlhandle = dlhandle;
   mp->unload = modunld;
   dlhandle = 0;
@@ -489,15 +500,15 @@
    * startup tasks.
    */
   if (modload != 0)
-    (*modload)();
+    (*modload) ();
 
   /*
    * Now we can get the module to initialize its symbols, and then its
    * variables, and lastly the documentation strings.
    */
-  (*modsyms)();
-  (*modvars)();
-  (*moddocs)();
+  (*modsyms) ();
+  (*modvars) ();
+  (*moddocs) ();
 
   if (!load_modules_quietly)
     message ("Loaded module %s v%s (%s)", mname, mver, mtitle);
@@ -521,12 +532,23 @@
 }
 
 void
-emodules_doc_subr(const char *symname, const char *doc)
+emodules_doc_subr (const Ascbyte *symname, const Ascbyte *doc)
 {
-  Bytecount len = strlen (symname);
-  Lisp_Object sym = oblookup (Vobarray, (const Ibyte *)symname, len);
+  Bytecount len;
+  Lisp_Object sym;
   Lisp_Subr *subr;
 
+  ASSERT_ASCTEXT_ASCII (symname);
+  len = strlen (symname);
+  sym = oblookup (Vobarray, (const Ibyte *) symname, len);
+
+  /* We do this assert to avoid the possibility of externally formatted
+     text ending up in the doc string, where it could cause crashes.
+     It you need to have a non-ASCII doc string, create another version
+     emodules_doc_subr_istring() that accepts an Ibyte * and doesn't
+     assert, or create an emodules_doc_subr_extstring() that takes
+     an externally_formatted string and a coding system name. */
+  ASSERT_ASCTEXT_ASCII (doc);
   /* Skip autoload cookies */
   if (SYMBOLP (sym) && SUBRP (XSYMBOL (sym)->function))
     {
@@ -534,7 +556,7 @@
       subr->doc = xstrdup (doc);
     }
   /*
-   * FIXME: I wish there was some way to avoid the xstrdup(). Is it
+   * #### FIXME: I wish there was some way to avoid the xstrdup(). Is it
    * possible to just set a pointer to the string, or somehow create a
    * symbol whose value we can point to the constant string? Can someone
    * look into this?
@@ -542,17 +564,24 @@
 }
 
 void
-emodules_doc_sym (const char *symname, const char *doc)
+emodules_doc_sym (const Ascbyte *symname, const Ascbyte *doc)
 {
-  Bytecount len = strlen (symname);
-  Lisp_Object sym = oblookup (Vobarray, (const Ibyte *)symname, len);
+  Bytecount len;
+  Lisp_Object sym;
   Lisp_Object docstr;
   struct gcpro gcpro1;
 
-  if (SYMBOLP(sym))
+  ASSERT_ASCTEXT_ASCII (symname);
+  len = strlen (symname);
+  sym = oblookup (Vobarray, (const Ibyte *) symname, len);
+
+  /* See comments above in emodules_doc_subr() about why we assert like
+     this. */
+  ASSERT_ASCTEXT_ASCII (doc);
+  if (SYMBOLP (sym))
     {
-      docstr = build_string (doc);
-      GCPRO1(docstr);
+      docstr = build_ascstring (doc);
+      GCPRO1 (docstr);
       Fput (sym, Qvariable_documentation, docstr);
       UNGCPRO;
     }
@@ -565,9 +594,9 @@
   DEFERROR_STANDARD (Qdll_error, Qerror);
   DEFSYMBOL (Qmodule);
   DEFSYMBOL (Qunload_module);
-  DEFSUBR(Fload_module);
-  DEFSUBR(Flist_modules);
-  DEFSUBR(Funload_module);
+  DEFSUBR (Fload_module);
+  DEFSUBR (Flist_modules);
+  DEFSUBR (Funload_module);
   module_tag = Fcons (Qmodule, Qnil);
   staticpro (&module_tag);
   Fput (Qunload_module, Qdisabled, Qt);
@@ -605,7 +634,7 @@
 the dynamic loading technology used in Emacs, if required.  It is not
 a given that this value will be the same as the Emacs version number.
 */ );
-  Vmodule_version = build_string (EMODULES_VERSION);
+  Vmodule_version = build_cistring (EMODULES_VERSION);
 
   DEFVAR_BOOL ("load-modules-quietly", &load_modules_quietly /*
 *Set to t if module loading is to be silent.
@@ -651,9 +680,9 @@
   DEFVAR_LISP ("module-extensions", &Vmodule_extensions /*
 *List of filename extensions to use when searching for dynamic modules.
 */);
-  Vmodule_extensions = list5 (build_string (".ell"),
-			      build_string (".so"),
-			      build_string (".dll"),
-			      build_string (".dylib"),
-			      build_string (""));
+  Vmodule_extensions = list5 (build_ascstring (".ell"),
+			      build_ascstring (".so"),
+			      build_ascstring (".dll"),
+			      build_ascstring (".dylib"),
+			      build_ascstring (""));
 }
--- a/src/emodules.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/emodules.h	Wed Feb 24 01:58:04 2010 -0600
@@ -59,7 +59,8 @@
  * specified version before. We also use these as checks when we open the
  * module to make sure we have the right module.
  */
-extern void emodules_load (const char *module, const char *name, const char *version);
+extern void emodules_load (const Ibyte *module, const Ibyte *modname,
+			   const Ibyte *modver);
 
 /*
  * Because subrs and symbols added by a dynamic module are not part of
@@ -70,10 +71,10 @@
  * into the right place. These functions will be called by the module
  * init code, generated by ellcc during initialization mode.
  */
-EXTERN_C MODULE_API void emodules_doc_subr (const char *objname,
-					    const char *docstr);
-EXTERN_C MODULE_API void emodules_doc_sym (const char *objname,
-					   const char *docstr);
+EXTERN_C MODULE_API void emodules_doc_subr (const Ascbyte *objname,
+					    const Ascbyte *docstr);
+EXTERN_C MODULE_API void emodules_doc_sym (const Ascbyte *objname,
+					   const Ascbyte *docstr);
 
 #define CDOCSUBR(Fname, DOC) emodules_doc_subr (Fname, DOC)
 #define CDOCSYM(Sname, DOC)  emodules_doc_sym  (Sname, DOC)
--- a/src/eval.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/eval.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Evaluator for XEmacs Lisp interpreter.
    Copyright (C) 1985-1987, 1992-1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -426,17 +426,17 @@
 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag))
 {
   Lisp_Subr *subr = XSUBR (obj);
-  const CIbyte *header =
-    (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr ";
-  const CIbyte *name = subr_name (subr);
-  const CIbyte *trailer = subr->prompt ? " (interactive)>" : ">";
+  const Ascbyte *header =
+    (subr->max_args == UNEVALLED) ? "#<special-operator " : "#<subr ";
+  const Ascbyte *name = subr_name (subr);
+  const Ascbyte *trailer = subr->prompt ? " (interactive)>" : ">";
 
   if (print_readably)
     printing_unreadable_object ("%s%s%s", header, name, trailer);
 
-  write_c_string (printcharfun, header);
-  write_c_string (printcharfun, name);
-  write_c_string (printcharfun, trailer);
+  write_ascstring (printcharfun, header);
+  write_ascstring (printcharfun, name);
+  write_ascstring (printcharfun, trailer);
 }
 
 static const struct memory_description subr_description[] = {
@@ -737,7 +737,7 @@
       specbind (Qstack_trace_on_signal, Qnil);
 
       if (!noninteractive)
-	internal_with_output_to_temp_buffer (build_string ("*Backtrace*"),
+	internal_with_output_to_temp_buffer (build_ascstring ("*Backtrace*"),
 					     backtrace_259,
 					     Qnil,
 					     Qnil);
@@ -779,7 +779,7 @@
       specbind (Qstack_trace_on_signal, Qnil);
 
       if (!noninteractive)
-	internal_with_output_to_temp_buffer (build_string ("*Backtrace*"),
+	internal_with_output_to_temp_buffer (build_ascstring ("*Backtrace*"),
 					     backtrace_259,
 					     Qnil,
 					     Qnil);
@@ -822,7 +822,7 @@
 /*		       The basic special forms				*/
 /************************************************************************/
 
-/* Except for Fprogn(), the basic special forms below are only called
+/* Except for Fprogn(), the basic special operators below are only called
    from interpreted code.  The byte compiler turns them into bytecodes. */
 
 DEFUN ("or", For, 0, UNEVALLED, 0, /*
@@ -2609,8 +2609,7 @@
   else if (ERRB_EQ (errb, ERROR_ME_WARN))
     warn_when_safe_lispobj (class_, Qwarning, Fcons (sig, data));
   else
-    for (;;)
-      Fsignal (sig, data);
+    signal_error_1 (sig, data);
 }
 
 /* Signal a continuable error or display a warning or do nothing,
@@ -2653,7 +2652,7 @@
    to signal_error_1(). */
 
 Lisp_Object
-build_error_data (const CIbyte *reason, Lisp_Object frob)
+build_error_data (const Ascbyte *reason, Lisp_Object frob)
 {
   if (EQ (frob, Qunbound))
     frob = Qnil;
@@ -2668,13 +2667,20 @@
 }
 
 DOESNT_RETURN
-signal_error (Lisp_Object type, const CIbyte *reason, Lisp_Object frob)
+signal_error (Lisp_Object type, const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error_1 (type, build_error_data (reason, frob));
 }
 
+/* NOTE NOTE NOTE: If you feel you need signal_ierror() or something
+   similar when reason is a non-ASCII message, you're probably doing
+   something wrong.  When you have an error message from an external
+   source, you should put the error message as the first item in FROB and
+   put a string in REASON indicating what you were doing when the error
+   message occurred.  Use signal_error_2() for such a case. */
+
 void
-maybe_signal_error (Lisp_Object type, const CIbyte *reason,
+maybe_signal_error (Lisp_Object type, const Ascbyte *reason,
 		    Lisp_Object frob, Lisp_Object class_,
 		    Error_Behavior errb)
 {
@@ -2685,14 +2691,14 @@
 }
 
 Lisp_Object
-signal_continuable_error (Lisp_Object type, const CIbyte *reason,
+signal_continuable_error (Lisp_Object type, const Ascbyte *reason,
 			  Lisp_Object frob)
 {
   return Fsignal (type, build_error_data (reason, frob));
 }
 
 Lisp_Object
-maybe_signal_continuable_error (Lisp_Object type, const CIbyte *reason,
+maybe_signal_continuable_error (Lisp_Object type, const Ascbyte *reason,
 				Lisp_Object frob, Lisp_Object class_,
 				Error_Behavior errb)
 {
@@ -2714,7 +2720,7 @@
    but these are more convenient in this particular case.) */
 
 DOESNT_RETURN
-signal_error_2 (Lisp_Object type, const CIbyte *reason,
+signal_error_2 (Lisp_Object type, const Ascbyte *reason,
 		Lisp_Object frob0, Lisp_Object frob1)
 {
   signal_error_1 (type, list3 (build_msg_string (reason), frob0,
@@ -2722,7 +2728,7 @@
 }
 
 void
-maybe_signal_error_2 (Lisp_Object type, const CIbyte *reason,
+maybe_signal_error_2 (Lisp_Object type, const Ascbyte *reason,
 		      Lisp_Object frob0, Lisp_Object frob1,
 		      Lisp_Object class_, Error_Behavior errb)
 {
@@ -2734,7 +2740,7 @@
 }
 
 Lisp_Object
-signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason,
+signal_continuable_error_2 (Lisp_Object type, const Ascbyte *reason,
 			    Lisp_Object frob0, Lisp_Object frob1)
 {
   return Fsignal (type, list3 (build_msg_string (reason), frob0,
@@ -2742,7 +2748,7 @@
 }
 
 Lisp_Object
-maybe_signal_continuable_error_2 (Lisp_Object type, const CIbyte *reason,
+maybe_signal_continuable_error_2 (Lisp_Object type, const Ascbyte *reason,
 				  Lisp_Object frob0, Lisp_Object frob1,
 				  Lisp_Object class_, Error_Behavior errb)
 {
@@ -2762,13 +2768,13 @@
    is a single string, created using the arguments. */
 
 DOESNT_RETURN
-signal_ferror (Lisp_Object type, const CIbyte *fmt, ...)
+signal_ferror (Lisp_Object type, const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2777,7 +2783,7 @@
 
 void
 maybe_signal_ferror (Lisp_Object type, Lisp_Object class_, Error_Behavior errb,
-		     const CIbyte *fmt, ...)
+		     const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
@@ -2787,7 +2793,7 @@
     return;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2795,13 +2801,13 @@
 }
 
 Lisp_Object
-signal_continuable_ferror (Lisp_Object type, const CIbyte *fmt, ...)
+signal_continuable_ferror (Lisp_Object type, const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2810,7 +2816,7 @@
 
 Lisp_Object
 maybe_signal_continuable_ferror (Lisp_Object type, Lisp_Object class_,
-				 Error_Behavior errb, const CIbyte *fmt, ...)
+				 Error_Behavior errb, const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
@@ -2820,7 +2826,7 @@
     return Qnil;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2843,14 +2849,14 @@
 */
 
 DOESNT_RETURN
-signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const CIbyte *fmt,
+signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob, const Ascbyte *fmt,
 			 ...)
 {
   Lisp_Object obj;
   va_list args;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2860,7 +2866,7 @@
 void
 maybe_signal_ferror_with_frob (Lisp_Object type, Lisp_Object frob,
 			       Lisp_Object class_, Error_Behavior errb,
-			       const CIbyte *fmt, ...)
+			       const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
@@ -2870,7 +2876,7 @@
     return;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2880,13 +2886,13 @@
 
 Lisp_Object
 signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob,
-				     const CIbyte *fmt, ...)
+				     const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2897,7 +2903,7 @@
 maybe_signal_continuable_ferror_with_frob (Lisp_Object type, Lisp_Object frob,
 					   Lisp_Object class_,
 					   Error_Behavior errb,
-					   const CIbyte *fmt, ...)
+					   const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
@@ -2907,7 +2913,7 @@
     return Qnil;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   /* Fsignal GC-protects its args */
@@ -2986,173 +2992,159 @@
 
 /* Called from within emacs_doprnt_1, so REASON is not formatted. */
 DOESNT_RETURN
-syntax_error (const CIbyte *reason, Lisp_Object frob)
+syntax_error (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qsyntax_error, reason, frob);
 }
 
 DOESNT_RETURN
-syntax_error_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
+syntax_error_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
 {
   signal_error_2 (Qsyntax_error, reason, frob1, frob2);
 }
 
 void
-maybe_syntax_error (const CIbyte *reason, Lisp_Object frob,
+maybe_syntax_error (const Ascbyte *reason, Lisp_Object frob,
 		    Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qsyntax_error, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-sferror (const CIbyte *reason, Lisp_Object frob)
+sferror (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qstructure_formation_error, reason, frob);
 }
 
 DOESNT_RETURN
-sferror_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
+sferror_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
 {
   signal_error_2 (Qstructure_formation_error, reason, frob1, frob2);
 }
 
 void
-maybe_sferror (const CIbyte *reason, Lisp_Object frob,
+maybe_sferror (const Ascbyte *reason, Lisp_Object frob,
 	       Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qstructure_formation_error, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-invalid_argument (const CIbyte *reason, Lisp_Object frob)
+invalid_argument (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qinvalid_argument, reason, frob);
 }
 
 DOESNT_RETURN
-invalid_argument_2 (const CIbyte *reason, Lisp_Object frob1,
+invalid_argument_2 (const Ascbyte *reason, Lisp_Object frob1,
 		    Lisp_Object frob2)
 {
   signal_error_2 (Qinvalid_argument, reason, frob1, frob2);
 }
 
 void
-maybe_invalid_argument (const CIbyte *reason, Lisp_Object frob,
+maybe_invalid_argument (const Ascbyte *reason, Lisp_Object frob,
 			Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qinvalid_argument, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-invalid_constant (const CIbyte *reason, Lisp_Object frob)
+invalid_constant (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qinvalid_constant, reason, frob);
 }
 
 DOESNT_RETURN
-invalid_constant_2 (const CIbyte *reason, Lisp_Object frob1,
+invalid_constant_2 (const Ascbyte *reason, Lisp_Object frob1,
 		    Lisp_Object frob2)
 {
   signal_error_2 (Qinvalid_constant, reason, frob1, frob2);
 }
 
 void
-maybe_invalid_constant (const CIbyte *reason, Lisp_Object frob,
+maybe_invalid_constant (const Ascbyte *reason, Lisp_Object frob,
 			Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qinvalid_constant, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-invalid_operation (const CIbyte *reason, Lisp_Object frob)
+invalid_operation (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qinvalid_operation, reason, frob);
 }
 
 DOESNT_RETURN
-invalid_operation_2 (const CIbyte *reason, Lisp_Object frob1,
+invalid_operation_2 (const Ascbyte *reason, Lisp_Object frob1,
 		     Lisp_Object frob2)
 {
   signal_error_2 (Qinvalid_operation, reason, frob1, frob2);
 }
 
 void
-maybe_invalid_operation (const CIbyte *reason, Lisp_Object frob,
+maybe_invalid_operation (const Ascbyte *reason, Lisp_Object frob,
 			 Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qinvalid_operation, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-invalid_change (const CIbyte *reason, Lisp_Object frob)
+invalid_change (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qinvalid_change, reason, frob);
 }
 
 DOESNT_RETURN
-invalid_change_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
+invalid_change_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
 {
   signal_error_2 (Qinvalid_change, reason, frob1, frob2);
 }
 
 void
-maybe_invalid_change (const CIbyte *reason, Lisp_Object frob,
+maybe_invalid_change (const Ascbyte *reason, Lisp_Object frob,
 		      Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qinvalid_change, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-invalid_state (const CIbyte *reason, Lisp_Object frob)
+invalid_state (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qinvalid_state, reason, frob);
 }
 
 DOESNT_RETURN
-invalid_state_2 (const CIbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
+invalid_state_2 (const Ascbyte *reason, Lisp_Object frob1, Lisp_Object frob2)
 {
   signal_error_2 (Qinvalid_state, reason, frob1, frob2);
 }
 
 void
-maybe_invalid_state (const CIbyte *reason, Lisp_Object frob,
+maybe_invalid_state (const Ascbyte *reason, Lisp_Object frob,
 		     Lisp_Object class_, Error_Behavior errb)
 {
   maybe_signal_error (Qinvalid_state, reason, frob, class_, errb);
 }
 
 DOESNT_RETURN
-wtaerror (const CIbyte *reason, Lisp_Object frob)
+wtaerror (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qwrong_type_argument, reason, frob);
 }
 
 DOESNT_RETURN
-stack_overflow (const CIbyte *reason, Lisp_Object frob)
+stack_overflow (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qstack_overflow, reason, frob);
 }
 
 DOESNT_RETURN
-out_of_memory (const CIbyte *reason, Lisp_Object frob)
+out_of_memory (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qout_of_memory, reason, frob);
 }
 
-DOESNT_RETURN
-printing_unreadable_object (const CIbyte *fmt, ...)
-{
-  Lisp_Object obj;
-  va_list args;
-
-  va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
-  va_end (args);
-
-  /* Fsignal GC-protects its args */
-  signal_error (Qprinting_unreadable_object, 0, obj);
-}
-
 
 /************************************************************************/
 /*			      User commands				*/
@@ -3315,7 +3307,7 @@
     btp = btp->next;
 
   /* If this isn't a byte-compiled function, then we may now be
-     looking at several frames for special forms.  Skip past them.  */
+     looking at several frames for special operators.  Skip past them.  */
   while (btp &&
 	 btp->nargs == UNEVALLED)
     btp = btp->next;
@@ -3633,6 +3625,10 @@
   {
     Lisp_Object value =
       execute_optimized_program ((Opbyte *) XOPAQUE_DATA (f->instructions),
+#ifdef ERROR_CHECK_BYTE_CODE
+				 XOPAQUE_SIZE (f->instructions) /
+				 sizeof (Opbyte),
+#endif
 				 f->stack_depth,
 				 XVECTOR_DATA (f->constants));
 
@@ -4073,7 +4069,7 @@
 	  val = SUBR_FUNCTION (subr, MANY) (fun_nargs, fun_args);
 	  PROFILE_EXIT_FUNCTION ();
 	}
-      else if (max_args == UNEVALLED) /* Can't funcall a special form */
+      else if (max_args == UNEVALLED) /* Can't funcall a special operator */
 	{
           /* Ugh, ugh, ugh. */
           if (EQ (fun, XSYMBOL_FUNCTION (Qthrow)))
@@ -4143,7 +4139,9 @@
   if (SYMBOLP (object))
     object = indirect_function (object, 0);
 
-  if (COMPILED_FUNCTIONP (object) || SUBRP (object))
+  if (COMPILED_FUNCTIONP (object)
+      || (SUBRP (object)
+	  && (XSUBR (object)->max_args != UNEVALLED)))
     return Qt;
   if (CONSP (object))
     {
@@ -4151,7 +4149,8 @@
       if (EQ (car, Qlambda))
 	return Qt;
       if (EQ (car, Qautoload)
-	  && NILP (Fcar_safe (Fcdr_safe (Fcdr_safe (Fcdr_safe (XCDR (object)))))))
+	  && NILP (Fcar_safe (Fcdr_safe(Fcdr_safe
+					(Fcdr_safe (XCDR (object)))))))
 	return Qt;
     }
   return Qnil;
@@ -4253,7 +4252,7 @@
 DEFUN ("function-min-args", Ffunction_min_args, 1, 1, 0, /*
 Return the minimum number of arguments a function may be called with.
 The function may be any form that can be passed to `funcall',
-any special form, or any macro.
+any special operator, or any macro.
 
 To check if a function can be called with a specified number of
 arguments, use `function-allows-args'.
@@ -4266,9 +4265,9 @@
 DEFUN ("function-max-args", Ffunction_max_args, 1, 1, 0, /*
 Return the maximum number of arguments a function may be called with.
 The function may be any form that can be passed to `funcall',
-any special form, or any macro.
+any special operator, or any macro.
 If the function takes an arbitrary number of arguments or is
-a built-in special form, nil is returned.
+a built-in special operator, nil is returned.
 
 To check if a function can be called with a specified number of
 arguments, use `function-allows-args'.
@@ -4425,7 +4424,7 @@
    A multiple value object is returned by #'values if:
 
    -- The number of arguments to #'values is not one, and: 
-   -- Some special form in the call stack is prepared to handle more than
+   -- Some special operator in the call stack is prepared to handle more than
    one multiple value.
    
    The return value of #'values-list is analogous to that of #'values.
@@ -4440,7 +4439,7 @@
    objects should be converted to heap allocation at that point.
 
    The specific multiple values saved and returned depend on how many
-   multiple-values special forms in the stack are interested in; for
+   multiple-values special operators in the stack are interested in; for
    example, if #'multiple-value-call is somewhere in the call stack, all
    values passed to #'values will be saved and returned.  If an expansion of
    #'multiple-value-setq with 10 SYMS is the only part of the call stack
@@ -4583,7 +4582,7 @@
 
   if (0 == count)
     {
-      write_c_string (printcharfun, "#<zero-length multiple value>");
+      write_msg_string (printcharfun, "#<zero-length multiple value>");
     }
 
   for (index = 0; index < count;)
@@ -4605,7 +4604,7 @@
 
       if (count > 1 && index < count)
         {
-          write_c_string (printcharfun, " ;\n");
+          write_ascstring (printcharfun, " ;\n");
         }
     }
 }
@@ -4723,11 +4722,11 @@
       if (MULTIPLE_VALUEP (result))
         {
           Lisp_Object val;
-          Elemcount i, count = XMULTIPLE_VALUE_COUNT (result);
-
-          for (i = 0; i < count; i++)
+          Elemcount j, count = XMULTIPLE_VALUE_COUNT (result);
+
+          for (j = 0; j < count; j++)
             {
-              val = multiple_value_aref (result, i);
+              val = multiple_value_aref (result, j);
               assert (!UNBOUNDP (val));
 
               XSETCDR (list_offset, Fcons (val, Qnil));
@@ -5723,7 +5722,7 @@
 	    ("%s: Attempt to throw outside of function:"
 	     "To catch `%s' with value `%s'\n\nBacktrace follows:\n\n%s",
 	     Qnil, 4,
-	     build_msg_string (warning_string ? warning_string : "error"),
+	     build_msg_cistring (warning_string ? warning_string : "error"),
 	     p->thrown_tag, p->thrown_value, p->backtrace);
 	  warn_when_safe_lispobj (Qerror, current_warning_level (), errstr);
 	}
@@ -5738,7 +5737,7 @@
 	    emacs_sprintf_string_lisp
 	    ("%s: (%s %s)\n\nBacktrace follows:\n\n%s",
 	     Qnil, 4,
-	     build_msg_string (warning_string ? warning_string : "error"),
+	     build_msg_cistring (warning_string ? warning_string : "error"),
 	     p->error_conditions, p->data, p->backtrace);
 
 	  warn_when_safe_lispobj (warning_class, current_warning_level (),
@@ -6341,7 +6340,7 @@
 static Lisp_Object
 safe_run_hook_trapping_problems_1 (void *puta)
 {
-  Lisp_Object hook = VOID_TO_LISP (puta);
+  Lisp_Object hook = GET_LISP_FROM_VOID (puta);
 
   run_hook (hook);
   return Qnil;
@@ -6369,7 +6368,7 @@
 				flags | POSTPONE_WARNING_ISSUE,
 				&prob,
 				safe_run_hook_trapping_problems_1,
-				LISP_TO_VOID (hook_symbol));
+				STORE_LISP_IN_VOID (hook_symbol));
   {
     Lisp_Object hook_name = XSYMBOL_NAME (hook_symbol);
     Ibyte *hook_str = XSTRING_DATA (hook_name);
@@ -6701,10 +6700,9 @@
 static Lisp_Object
 restore_lisp_object (Lisp_Object cons)
 {
-  Lisp_Object opaque = XCAR (cons);
-  Lisp_Object *addr = (Lisp_Object *) get_opaque_ptr (opaque);
+  Lisp_Object laddr = XCAR (cons);
+  Lisp_Object *addr = (Lisp_Object *) GET_VOID_FROM_LISP (laddr);
   *addr = XCDR (cons);
-  free_opaque_ptr (opaque);
   free_cons (cons);
   return Qnil;
 }
@@ -6715,9 +6713,11 @@
 record_unwind_protect_restoring_lisp_object (Lisp_Object *addr,
 					     Lisp_Object val)
 {
-  Lisp_Object opaque = make_opaque_ptr (addr);
+  /* We use a cons rather than a malloc()ed structure because we want the
+     Lisp object to have garbage-collection protection */
+  Lisp_Object laddr = STORE_VOID_IN_LISP (addr);
   return record_unwind_protect (restore_lisp_object,
-				noseeum_cons (opaque, val));
+				noseeum_cons (laddr, val));
 }
 
 /* Similar to specbind() but for any C variable whose value is a
@@ -6734,35 +6734,18 @@
   return count;
 }
 
-static Lisp_Object
-restore_int (Lisp_Object cons)
-{
-  Lisp_Object opaque = XCAR (cons);
-  Lisp_Object lval = XCDR (cons);
-  int *addr = (int *) get_opaque_ptr (opaque);
+struct restore_int
+{
+  int *addr;
   int val;
-
-  /* In the event that a C integer will always fit in an Emacs int, we
-     haven't ever stored a C integer as an opaque pointer. This #ifdef
-     eliminates a warning on AMD 64, where EMACS_INT has 63 value bits and C
-     integers have 32 value bits.  */
-#if INT_VALBITS < INTBITS
-  if (INTP (lval))
-    {
-      val = XINT (lval);
-    }
-  else
-    {
-      val = (int) get_opaque_ptr (lval);
-      free_opaque_ptr (lval);
-    }
-#else /* !(INT_VALBITS < INTBITS) */
-  val = XINT(lval);
-#endif /* INT_VALBITS < INTBITS */
-
-  *addr = val;
-  free_opaque_ptr (opaque);
-  free_cons (cons);
+};
+
+static Lisp_Object
+restore_int (Lisp_Object obj)
+{
+  struct restore_int *ri = (struct restore_int *) GET_VOID_FROM_LISP (obj);
+  *(ri->addr) = ri->val;
+  xfree (ri);
   return Qnil;
 }
 
@@ -6772,23 +6755,10 @@
 int
 record_unwind_protect_restoring_int (int *addr, int val)
 {
-  Lisp_Object opaque = make_opaque_ptr (addr);
-  Lisp_Object lval;
-
-  /* In the event that a C integer will always fit in an Emacs int, we don't
-     ever want to store a C integer as an opaque pointer. This #ifdef
-     eliminates a warning on AMD 64, where EMACS_INT has 63 value bits and C
-     integers have 32 value bits.  */
-#if INT_VALBITS <= INTBITS
-  if (NUMBER_FITS_IN_AN_EMACS_INT (val))
-    lval = make_int (val);
-  else
-    lval = make_opaque_ptr ((void *) val);
-#else /* !(INT_VALBITS < INTBITS) */
-  lval = make_int (val);
-#endif /* INT_VALBITS <= INTBITS */
-
-  return record_unwind_protect (restore_int, noseeum_cons (opaque, lval));
+  struct restore_int *ri = xnew (struct restore_int);
+  ri->addr = addr;
+  ri->val = val;
+  return record_unwind_protect (restore_int, STORE_VOID_IN_LISP (ri));
 }
 
 /* Similar to specbind() but for any C variable whose value is an int.
@@ -6809,8 +6779,8 @@
 static Lisp_Object
 free_pointer (Lisp_Object opaque)
 {
-  xfree (get_opaque_ptr (opaque), void *);
-  free_opaque_ptr (opaque);
+  void *ptr = GET_VOID_FROM_LISP (opaque);
+  xfree (ptr);
   return Qnil;
 }
 
@@ -6819,23 +6789,20 @@
 int
 record_unwind_protect_freeing (void *ptr)
 {
-  Lisp_Object opaque = make_opaque_ptr (ptr);
-  return record_unwind_protect (free_pointer, opaque);
+  return record_unwind_protect (free_pointer, STORE_VOID_IN_LISP (ptr));
 }
 
 static Lisp_Object
 free_dynarr (Lisp_Object opaque)
 {
-  Dynarr_free (get_opaque_ptr (opaque));
-  free_opaque_ptr (opaque);
+  Dynarr_free (GET_VOID_FROM_LISP (opaque));
   return Qnil;
 }
 
 int
 record_unwind_protect_freeing_dynarr (void *ptr)
 {
-  Lisp_Object opaque = make_opaque_ptr (ptr);
-  return record_unwind_protect (free_dynarr, opaque);
+  return record_unwind_protect (free_dynarr, STORE_VOID_IN_LISP (ptr));
 }
 
 /* Unwind the stack till specpdl_depth() == COUNT.
@@ -7010,18 +6977,18 @@
           || specpdl[speccount - 1].func == specbind_unwind_local
           || specpdl[speccount - 1].func == specbind_unwind_wasnt_local)
 	{
-	  write_c_string (stream, !printing_bindings ? "  # bind (" : " ");
+	  write_ascstring (stream, !printing_bindings ? "  # bind (" : " ");
 	  Fprin1 (specpdl[speccount - 1].symbol, stream);
 	  printing_bindings = 1;
 	}
       else
 	{
-	  if (printing_bindings) write_c_string (stream, ")\n");
-	  write_c_string (stream, "  # (unwind-protect ...)\n");
+	  if (printing_bindings) write_ascstring (stream, ")\n");
+	  write_ascstring (stream, "  # (unwind-protect ...)\n");
 	  printing_bindings = 0;
 	}
     }
-  if (printing_bindings) write_c_string (stream, ")\n");
+  if (printing_bindings) write_ascstring (stream, ")\n");
 }
 
 static Lisp_Object
@@ -7030,7 +6997,7 @@
   if (args)
     return *args;
   else
-    return list1 (build_string ("[internal]"));
+    return list1 (build_ascstring ("[internal]"));
 }
 
 DEFUN ("backtrace", Fbacktrace, 0, 2, "", /*
@@ -7088,15 +7055,15 @@
           speccount = catches->pdlcount;
           if (catchpdl == speccount)
 	    {
-	      write_c_string (stream, "  # (catch ");
+	      write_ascstring (stream, "  # (catch ");
 	      Fprin1 (catches->tag, stream);
-	      write_c_string (stream, " ...)\n");
+	      write_ascstring (stream, " ...)\n");
 	    }
           else
             {
-              write_c_string (stream, "  # (condition-case ... . ");
+              write_ascstring (stream, "  # (condition-case ... . ");
               Fprin1 (Fcdr (Fcar (catches->tag)), stream);
-              write_c_string (stream, ")\n");
+              write_ascstring (stream, ")\n");
             }
           catches = catches->next;
 	}
@@ -7109,19 +7076,19 @@
 	      backtrace_specials (speccount, backlist->pdlcount, stream);
 	      speccount = backlist->pdlcount;
 	    }
-	  write_c_string (stream, backlist->debug_on_exit ? "* " : "  ");
+	  write_ascstring (stream, backlist->debug_on_exit ? "* " : "  ");
 	  if (backlist->nargs == UNEVALLED)
 	    {
 	      Fprin1 (Fcons (*backlist->function,
 			     backtrace_unevalled_args (backlist->args)),
 		      stream);
-	      write_c_string (stream, "\n"); /* from FSFmacs 19.30 */
+	      write_ascstring (stream, "\n"); /* from FSFmacs 19.30 */
 	    }
 	  else
 	    {
 	      Lisp_Object tem = *backlist->function;
 	      Fprin1 (tem, stream); /* This can QUIT */
-	      write_c_string (stream, "(");
+	      write_ascstring (stream, "(");
 	      if (backlist->nargs == MANY)
 		{
 		  int i;
@@ -7133,7 +7100,7 @@
 		       !NILP (tail);
 		       tail = Fcdr (tail), i++)
 		    {
-		      if (i != 0) write_c_string (stream, " ");
+		      if (i != 0) write_ascstring (stream, " ");
 		      Fprin1 (Fcar (tail), stream);
 		    }
 		  NUNGCPRO;
@@ -7145,14 +7112,14 @@
 		    {
 		      if (!i && EQ (tem, Qbyte_code))
 			{
-			  write_c_string (stream, "\"...\"");
+			  write_ascstring (stream, "\"...\"");
 			  continue;
 			}
-		      if (i != 0) write_c_string (stream, " ");
+		      if (i != 0) write_ascstring (stream, " ");
 		      Fprin1 (backlist->args[i], stream);
 		    }
 		}
-	      write_c_string (stream, ")\n");
+	      write_ascstring (stream, ")\n");
 	    }
 	  backlist = backlist->next;
 	}
@@ -7168,8 +7135,8 @@
 
 DEFUN ("backtrace-frame", Fbacktrace_frame, 1, 1, 0, /*
 Return the function and arguments NFRAMES up from current execution point.
-If that frame has not evaluated the arguments yet (or is a special form),
-the value is (nil FUNCTION ARG-FORMS...).
+If that frame has not evaluated the arguments yet (or involves a special
+operator), the value is (nil FUNCTION ARG-FORMS...).
 If that frame has evaluated its arguments and called its function already,
 the value is (t FUNCTION ARG-VALUES...).
 A &rest arg is represented as the tail of the list ARG-VALUES.
@@ -7244,7 +7211,7 @@
    automatically be called when it is safe to do so. */
 
 void
-warn_when_safe (Lisp_Object class_, Lisp_Object level, const CIbyte *fmt, ...)
+warn_when_safe (Lisp_Object class_, Lisp_Object level, const Ascbyte *fmt, ...)
 {
   Lisp_Object obj;
   va_list args;
@@ -7253,7 +7220,7 @@
     return;
 
   va_start (args, fmt);
-  obj = emacs_vsprintf_string (CGETTEXT (fmt), args);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
   va_end (args);
 
   warn_when_safe_lispobj (class_, level, obj);
@@ -7537,7 +7504,7 @@
 The exclusive upper bound on the number of multiple values. 
 
 This applies to `values', `values-list', `multiple-value-bind' and related
-macros and special forms.
+macros and special operators.
 */);
   Vmultiple_values_limit = EMACS_INT_MAX > INT_MAX ? INT_MAX : EMACS_INT_MAX;
 
--- a/src/event-Xt.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/event-Xt.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* The event_stream interface for X11 with Xt, and/or tty frames.
    Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -22,6 +22,14 @@
 
 /* Synched up with: Not in FSF. */
 
+/* NOTE: It would be possible to fix things so that all of GTK, Windows, X,
+   TTY and stream can have consoles at the same time.  We already do lots
+   of combinations.  Basically, either call select() directly or some
+   interface onto it, and select() over all the filedescs, including the
+   X and GTK socket, and under Cygwin, the Windows device.  Then for whichever
+   filedesc there's an event, call the appropriate window-system-specific
+   method to pull the event(s) and store onto the dispatch queue. --ben */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -192,7 +200,7 @@
 		    EQ (new_value, Qt)))
 	    {
 	      maybe_define_x_key_as_self_inserting_character (keysym, sym);
-	      Fputhash (build_ext_string (name, Qbinary), new_value,
+	      Fputhash (build_extstring (name, Qbinary), new_value,
 			hash_table);
 	      Fputhash (sym, new_value, hash_table);
 	    }
@@ -337,46 +345,46 @@
   /* Boy, I really wish C had local functions...
    */
 
-  /* The call to warn_when_safe must be on the same line as the string or
-     make-msgfile won't pick it up properly (the newline doesn't confuse
-     it, but the backslash does). */
-
-#define modwarn(name,old,other)						\
-  warn_when_safe (Qkey_mapping, Qwarning, "XEmacs:  %s (0x%x) generates %s, which is generated by %s.",	\
-		  name, code, index_to_name (old), other),		\
+#define modwarn(name,old,other)					\
+  warn_when_safe (Qkey_mapping, Qwarning,			\
+ "XEmacs:  %s (0x%x) generates %s, which is generated by %s.",	\
+		  name, code, index_to_name (old), other),	\
   warned_about_overlapping_modifiers = 1
 
-#define modbarf(name,other)						    \
-  warn_when_safe (Qkey_mapping, Qwarning, "XEmacs:  %s (0x%x) generates %s, which is nonsensical.", \
-		  name, code, other),					    \
+#define modbarf(name,other)					\
+  warn_when_safe (Qkey_mapping, Qwarning,			\
+ "XEmacs:  %s (0x%x) generates %s, which is nonsensical.",	\
+		  name, code, other),				\
   warned_about_predefined_modifiers = 1
 
-#define check_modifier(name,mask)					      \
-  if ((1<<modifier_index) != mask)					      \
-    warn_when_safe (Qkey_mapping, Qwarning, "XEmacs:  %s (0x%x) generates %s, which is nonsensical.", \
-		    name, code, index_to_name (modifier_index)),	      \
+#define check_modifier(name,mask)					\
+  if ((1<<modifier_index) != mask)					\
+    warn_when_safe (Qkey_mapping, Qwarning,				\
+ "XEmacs:  %s (0x%x) generates %s, which is nonsensical.",		\
+		    name, code, index_to_name (modifier_index)),	\
     warned_about_predefined_modifiers = 1
 
-#define store_modifier(name,old)					   \
-  if (old && old != modifier_index)					   \
-    warn_when_safe (Qkey_mapping, Qwarning, "XEmacs:  %s (0x%x) generates both %s and %s, which is nonsensical.",\
-		    name, code, index_to_name (old),			   \
-		    index_to_name (modifier_index)),			   \
-    warned_about_duplicate_modifiers = 1;				   \
-  if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift");	   \
-  else if (modifier_index == LockMapIndex) modbarf (name,"ModLock");	   \
+#define store_modifier(name,old)					\
+  if (old && old != modifier_index)					\
+    warn_when_safe (Qkey_mapping, Qwarning,				\
+ "XEmacs:  %s (0x%x) generates both %s and %s, which is nonsensical.",	\
+		    name, code, index_to_name (old),			\
+		    index_to_name (modifier_index)),			\
+    warned_about_duplicate_modifiers = 1;				\
+  if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift");	\
+  else if (modifier_index == LockMapIndex) modbarf (name,"ModLock");	\
   else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl"); \
-  else if (sym == XK_Mode_switch)					   \
-    mode_bit = modifier_index; /* Mode_switch is special, see below... */  \
-  else if (modifier_index == meta_bit && old != meta_bit)		   \
-    modwarn (name, meta_bit, "Meta");					   \
-  else if (modifier_index == super_bit && old != super_bit)		   \
-    modwarn (name, super_bit, "Super");					   \
-  else if (modifier_index == hyper_bit && old != hyper_bit)		   \
-    modwarn (name, hyper_bit, "Hyper");					   \
-  else if (modifier_index == alt_bit && old != alt_bit)			   \
-    modwarn (name, alt_bit, "Alt");					   \
-  else									   \
+  else if (sym == XK_Mode_switch)					\
+    mode_bit = modifier_index; /* Mode_switch is special, see below... */ \
+  else if (modifier_index == meta_bit && old != meta_bit)		\
+    modwarn (name, meta_bit, "Meta");					\
+  else if (modifier_index == super_bit && old != super_bit)		\
+    modwarn (name, super_bit, "Super");					\
+  else if (modifier_index == hyper_bit && old != hyper_bit)		\
+    modwarn (name, hyper_bit, "Hyper");					\
+  else if (modifier_index == alt_bit && old != alt_bit)			\
+    modwarn (name, alt_bit, "Alt");					\
+  else									\
     old = modifier_index;
 
   mkpm = xd->x_modifier_keymap->max_keypermod;
@@ -1750,7 +1758,7 @@
 {
   Lisp_Object console = CDFW_CONSOLE (EVENT_CHANNEL (event));
   if (CONSOLE_X_P (XCONSOLE (console)))
-    write_c_string
+    write_ascstring
       (pstream, x_event_name ((EVENT_MAGIC_X_EVENT (event)).type));
 }
 
@@ -2189,7 +2197,7 @@
 	}
     }
   XtRemoveInput (closure->id);
-  xfree (closure, struct what_is_ready_closure *);
+  xfree (closure);
   filedesc_to_what_closure[fd] = 0;
 }
 
@@ -2426,7 +2434,7 @@
 static void
 describe_event (XEvent *event, Lisp_Object pstream)
 {
-  char buf[100];
+  Ascbyte buf[100];
   struct device *d = get_device_from_display (event->xany.display);
 
   sprintf (buf, "%s%s", x_event_name (event->type),
--- a/src/event-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/event-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -49,11 +49,11 @@
 
 #include "gtk-xemacs.h"
 
+#include "sysgdkx.h"
+
 #include "systime.h"
 #include "sysproc.h" /* for MAXDESC */
 
-#include <gdk/gdkkeysyms.h>
-
 #ifdef HAVE_DRAGNDROP
 #include "dragdrop.h"
 #endif
@@ -62,10 +62,6 @@
 # include "menubar.h"
 #endif
 
-#include <gdk/gdkx.h>
-
-#include "event-gtk.h"
-
 static struct event_stream *gtk_event_stream;
 
 #ifdef WIN32_ANY
@@ -228,7 +224,7 @@
 {
   Lisp_Object console = CDFW_CONSOLE (EVENT_CHANNEL (emacs_event));
   if (CONSOLE_GTK_P (XCONSOLE (console)))
-    write_c_string
+    write_cistring
       (pstream,
        gtk_event_name (EVENT_MAGIC_GDK_EVENT (emacs_event).type));
 }
@@ -792,7 +788,7 @@
 	}
     }
   gdk_input_remove (closure->id);
-  xfree (closure, struct what_is_ready_closure *);
+  xfree (closure);
   filedesc_to_what_closure[fd] = 0;
 }
 
@@ -1019,9 +1015,9 @@
     {
       /* Arbitrary string */
       l_type = Qdragdrop_MIME;
-      l_dndlist = list1 (list3 (list1 (build_string ("text/plain")),
-				build_string ("8_bit"),
-				make_ext_string (data->data,
+      l_dndlist = list1 (list3 (list1 (build_ascstring ("text/plain")),
+				build_ascstring ("8_bit"),
+				make_extstring (data->data,
 						 strlen ((char *)data->data),
 						 Qctext)));
     }
@@ -1033,7 +1029,7 @@
       l_dndlist = list1 (make_string ((Ibyte *)hurl, strlen (hurl)));
       l_type = Qdragdrop_URL;
 
-      xfree (hurl, char *);
+      xfree (hurl);
     }
   else if (data->type == preferred_targets[TARGET_NETSCAPE])
     {
@@ -1048,9 +1044,9 @@
 	 We just pass it up to lisp - we already have a mime type.
       */
       l_type = Qdragdrop_MIME;
-      l_dndlist = list1 (list3 (list1 (build_string (gdk_atom_name (data->type))),
-				build_string ("8bit"),
-				make_ext_string ((Extbyte *) data->data,
+      l_dndlist = list1 (list3 (list1 (build_cistring (gdk_atom_name (data->type))),
+				build_ascstring ("8bit"),
+				make_extstring ((Extbyte *) data->data,
 						 data->length, Qbinary)));
     }
 
@@ -1582,8 +1578,6 @@
 /*                      input pending / C-g checking                    */
 /************************************************************************/
 
-#include <gdk/gdkx.h>
-
 static void
 emacs_gtk_drain_queue (void)
 
@@ -1692,7 +1686,7 @@
 /* This is down at the bottom of the file so I can avoid polluting the
    generic code with this X specific CRAP! */
 
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 #include <X11/keysym.h>
 /* #### BILL!!! Fix this please! */
 
@@ -1787,8 +1781,8 @@
 	Lisp_Object sym = gtk_keysym_to_emacs_keysym (keysym[0], 0);
 	if (name)
 	  {
-	    Fputhash (build_ext_string (name, Qnative), Qsans_modifiers,
-		      hashtable);
+	    Fputhash (build_extstring (name, Qx_keysym_encoding),
+		      Qsans_modifiers, hashtable);
 	    Fputhash (sym, Qsans_modifiers, hashtable);
 	  }
       }
@@ -1802,7 +1796,8 @@
 	      Lisp_Object sym = gtk_keysym_to_emacs_keysym (keysym[j], 0);
 	      if (name && NILP (Fgethash (sym, hashtable, Qnil)))
 		{
-		  Fputhash (build_ext_string (name, Qnative), Qt, hashtable);
+		  Fputhash (build_extstring (name, Qx_keysym_encoding),
+			    Qt, hashtable);
 		  Fputhash (sym, Qt, hashtable);
 		}
 	    }
@@ -1875,10 +1870,6 @@
   /* Boy, I really wish C had local functions...
    */
 
-  /* The call to warn_when_safe must be on the same line as the string or
-     make-msgfile won't pick it up properly (the newline doesn't confuse
-     it, but the backslash does). */
-
 #define store_modifier(name,old)					   \
     old = modifier_index;
 
--- a/src/event-gtk.h	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/* Header file for miscellaneous event functions for GTK.
-   Copyright (C) 2002 William Perry.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-#ifndef __EVENT_GTK_H__
-#define __EVENT_GTK_H__
-
-int gtk_event_to_emacs_event (struct frame *frame,
-			      GdkEvent *gdk_event,
-			      struct Lisp_Event *emacs_event);
-
-gint emacs_gtk_key_event_handler(GtkWidget *widget, GdkEventKey *event);
-gint emacs_gtk_button_event_handler(GtkWidget *widget, GdkEventButton *event);
-gint emacs_gtk_motion_event_handler (GtkWidget *widget, GdkEventMotion *event);
-
-gboolean emacs_shell_event_handler (GtkWidget *wid /* unused */,
-				    GdkEvent *event,
-				    gpointer closure);
-
-#endif /* __EVENT-GTK_H__ */
--- a/src/event-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/event-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -832,7 +832,7 @@
 
   if (str->buffer)
     {
-      xfree (str->buffer, void *);
+      xfree (str->buffer);
       str->buffer = 0;
     }
 
@@ -1752,9 +1752,9 @@
    * get an error, or finish before the end of the string,
    * we know the original string had syntax errors.
    */
-  args[0] = build_string ("(progn ");
+  args[0] = build_ascstring ("(progn ");
   args[1] = str;
-  args[2] = build_string (")");
+  args[2] = build_ascstring (")");
   str = Fconcat (3, args);
 
   obj = Fread_from_string (str, Qnil, Qnil);
@@ -1811,7 +1811,6 @@
       (name))
 {
   Lisp_Object token;
-  Extbyte *str;
   HSZ hsz;
   struct gcpro gcpro1, gcpro2;
 
@@ -1820,18 +1819,17 @@
   else
     {
       static int num = 0;
-      char buf[20];
+      Ascbyte buf[20];
       sprintf (buf, "Tok%d", num);
       ++num;
-      name = build_string (buf);
+      name = build_ascstring (buf);
     }
 
   token = Qnil;
   GCPRO2 (name, token);
   token = Fmake_symbol (name);
-  TO_EXTERNAL_FORMAT (LISP_STRING, name, C_STRING_ALLOCA, str,
-		      Qmswindows_tstr);
-  hsz = qxeDdeCreateStringHandle (mswindows_dde_mlid, str,
+  hsz = qxeDdeCreateStringHandle (mswindows_dde_mlid,
+				  LISP_STRING_TO_TSTR (name),
 				  XEUNICODE_P ? CP_WINUNICODE : CP_WINANSI);
 
   Fput(token, QHSZ, make_float ((int)hsz));
@@ -1989,12 +1987,12 @@
 	  {
 	    if (NILP (dde_eval_error))
 	      {
-		args[0] = build_string ("OK: %s");
+		args[0] = build_ascstring ("OK: %s");
 		args[1] = dde_eval_result;
 	      }
 	    else
 	      {
-		args[0] = build_string ("ERR: %s");
+		args[0] = build_ascstring ("ERR: %s");
 		args[1] = dde_eval_error;
 	      }
 	  }
@@ -2013,17 +2011,17 @@
 		if (!DdeCmpStringHandles (hszItem, hsz))
 		  args[1] = Fsymbol_value (elt);
 	      }
-	    args[0] = build_string ("%s");
+	    args[0] = build_ascstring ("%s");
 	  }
 
 	res = Fformat (2, args);
 	UNGCPRO;
 
 	bytes = (uFmt == CF_TEXT ? 1 : 2) * (XSTRING_LENGTH (res) + 1);
-	TO_EXTERNAL_FORMAT (LISP_STRING, res,
-			    C_STRING_ALLOCA, result,
-			    uFmt == CF_TEXT ? Qmswindows_multibyte
-			    : Qmswindows_unicode);
+	result =
+	  LISP_STRING_TO_EXTERNAL (res,
+				   uFmt == CF_TEXT ? Qmswindows_multibyte
+				   : Qmswindows_unicode);
 
 	/* If we cannot create the data handle, this passes the null
 	 * return back to the client, which signals an error as we wish.
@@ -2045,9 +2043,7 @@
 	  /* Grab a pointer to the raw data supplied */
 	  extcmd = DdeAccessData (hdata, &len);
 
-	  TO_INTERNAL_FORMAT (DATA, (extcmd, len),
-			      LISP_STRING, tmp,
-			      Qmswindows_tstr);
+	  tmp = make_extstring ((Extbyte *) extcmd, len, Qmswindows_tstr);
 
 	  /* Release and free the data handle */
 	  DdeUnaccessData (hdata);
@@ -2078,9 +2074,7 @@
 	  DdeGetData (hdata, (LPBYTE) extcmd, len, 0);
 	  DdeFreeDataHandle (hdata);
 
-	  TO_INTERNAL_FORMAT (DATA, (extcmd, len),
-			      C_STRING_ALLOCA, cmd,
-			      Qmswindows_tstr);
+	  cmd = SIZED_EXTERNAL_TO_ITEXT (extcmd, len, Qmswindows_tstr);
 
 	  /* Check syntax & that it's an [Open("foo")] command, which we
 	   * treat like a file drop */
@@ -2118,8 +2112,8 @@
 
 	       they don't allow relative paths at all!  this is way bogus. */
 	    cmd = urlify_filename (cmd);
-	    l_dndlist = build_intstring (cmd);
-	    xfree (cmd, Ibyte *);
+	    l_dndlist = build_istring (cmd);
+	    xfree (cmd);
 	  }
 	  GCPRO2 (emacs_event, l_dndlist);
 
@@ -2734,9 +2728,8 @@
 		if (XEUNICODE_P)
 		  {
 		    length = unicode_char_to_text (tranmsg.wParam, extchar);
-		    TO_INTERNAL_FORMAT (DATA, (extchar, length),
-					C_STRING_ALLOCA, (intchar),
-					Qmswindows_unicode);
+		    intchar = SIZED_EXTERNAL_TO_ITEXT (extchar, length,
+						       Qmswindows_unicode);
 		    ch = itext_ichar (intchar);
 		  }
 		else
@@ -2750,7 +2743,7 @@
 				((LCID) GetKeyboardLayout (0) & 0xFFFF),
 				NULL));
 		    ch = itext_ichar (intchar);
-		    xfree (intchar, Ibyte *);
+		    xfree (intchar);
 		  }
 
 #ifdef DEBUG_XEMACS
@@ -2850,10 +2843,9 @@
 			      {
 				Ibyte *intchar;
 
-				TO_INTERNAL_FORMAT
-				  (DATA,
-				   (received_keys + (tounret - 1) * 2, 2),
-				   C_STRING_ALLOCA, intchar,
+				intchar =
+				  SIZED_EXTERNAL_TO_ITEXT
+				  (received_keys + (tounret - 1) * 2, 2,
 				   Qmswindows_unicode);
 				XSET_EVENT_KEY_ALT_KEYCHARS
 				  (lastev, i, itext_ichar (intchar));
@@ -2895,7 +2887,7 @@
 
 				XSET_EVENT_KEY_ALT_KEYCHARS
 				  (lastev, i, itext_ichar (intchar));
-				xfree (intchar, Ibyte *);
+				xfree (intchar);
 			      }
 			  }
 		      }
@@ -3199,7 +3191,7 @@
 	    tttextw->hinst = NULL;
 
 	    if (!NILP (btext))
-	      LISP_STRING_TO_TSTR (btext, btextext);
+	      btextext = LISP_STRING_TO_TSTR (btext);
 
 	    if (btextext)
 	      {
@@ -3415,8 +3407,7 @@
 		   * recursion here. */
 		  if (FRAME_MSWINDOWS_TARGET_RECT (frame))
 		    {
-		      xfree (FRAME_MSWINDOWS_TARGET_RECT (frame),
-			     XEMACS_RECT_WH *);
+		      xfree (FRAME_MSWINDOWS_TARGET_RECT (frame));
 		      FRAME_MSWINDOWS_TARGET_RECT (frame) = 0;
 		    }
 		}
@@ -3638,7 +3629,7 @@
 	if (ii)
 	  {
 	    Lisp_Object image_instance;
-	    image_instance = VOID_TO_LISP ((void *) ii);
+	    image_instance = GET_LISP_FROM_VOID ((void *) ii);
 	    if (IMAGE_INSTANCEP (image_instance)
 		&&
 		IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET))
@@ -3735,10 +3726,10 @@
 
 	    {
 	      Ibyte *fname2 = urlify_filename (fname);
-	      l_item = build_intstring (fname2);
-	      xfree (fname2, Ibyte *);
+	      l_item = build_istring (fname2);
+	      xfree (fname2);
 	      if (freeme)
-		xfree (fname, Ibyte *);
+		xfree (fname);
 	      l_dndlist = Fcons (l_item, l_dndlist);
 	    }
 	  }
@@ -4164,7 +4155,7 @@
       assert (!NILP (Vmswindows_frame_being_created));
       return Vmswindows_frame_being_created;
     }
-  f = VOID_TO_LISP ((void *) l);
+  f = GET_LISP_FROM_VOID ((void *) l);
   return f;
 }
 
@@ -4274,7 +4265,7 @@
 emacs_mswindows_format_magic_event (Lisp_Event *emacs_event,
 				    Lisp_Object pstream)
 {
-#define FROB(msg) case msg: write_c_string (pstream, "type=" #msg); break
+#define FROB(msg) case msg: write_ascstring (pstream, "type=" #msg); break
 
   switch (EVENT_MAGIC_MSWINDOWS_EVENT (emacs_event))
     {
@@ -4291,7 +4282,7 @@
   
   if (!NILP (EVENT_CHANNEL (emacs_event)))
     {
-      write_c_string (pstream, " ");
+      write_ascstring (pstream, " ");
       print_internal (EVENT_CHANNEL (emacs_event), pstream, 1);
     }
 }
@@ -4670,7 +4661,7 @@
 struct mswin_message_debug
 {
   int mess;
-  char *string;
+  const Ascbyte *string;
 };
 
 #define FROB(val) { val, #val, },
@@ -4961,7 +4952,7 @@
 {
   Lisp_Object frame = mswindows_find_frame (hwnd);
   int i;
-  char *str = 0;
+  const Ascbyte *str = 0;
   /* struct mswin_message_debug *i_hate_cranking_out_code_like_this; */
 
   for (i = 0; i < countof (debug_mswin_messages); i++)
--- a/src/event-stream.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/event-stream.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
    Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2003, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -255,13 +255,14 @@
 Fixnum debug_emacs_events;
 
 static void
-external_debugging_print_event (const char *event_description, Lisp_Object event)
+external_debugging_print_event (const Ascbyte *event_description,
+				Lisp_Object event)
 {
-  write_c_string (Qexternal_debugging_output, "(");
-  write_c_string (Qexternal_debugging_output, event_description);
-  write_c_string (Qexternal_debugging_output, ") ");
+  write_ascstring (Qexternal_debugging_output, "(");
+  write_ascstring (Qexternal_debugging_output, event_description);
+  write_ascstring (Qexternal_debugging_output, ") ");
   print_internal (event,	     Qexternal_debugging_output, 1);
-  write_c_string (Qexternal_debugging_output, "\n");
+  write_ascstring (Qexternal_debugging_output, "\n");
 }
 #define DEBUG_PRINT_EMACS_EVENT(event_description, event) do {	\
   if (debug_emacs_events)					\
@@ -356,7 +357,7 @@
   struct command_builder *b = (struct command_builder *) header;
   if (b->echo_buf)
     {
-      xfree (b->echo_buf, Ibyte *);
+      xfree (b->echo_buf);
       b->echo_buf = 0;
     }
 }
@@ -449,7 +450,7 @@
 {
   if (builder->echo_buf)
     {
-      xfree (builder->echo_buf, Ibyte *);
+      xfree (builder->echo_buf);
       builder->echo_buf = NULL;
     }
   FREE_LISP_OBJECT (wrap_command_builder (builder));
@@ -828,7 +829,7 @@
 
   help = IGNORE_MULTIPLE_VALUES (Feval (Vhelp_form));
   if (STRINGP (help))
-    internal_with_output_to_temp_buffer (build_string ("*Help*"),
+    internal_with_output_to_temp_buffer (build_ascstring ("*Help*"),
 					 print_help, help, Qnil);
   Fnext_command_event (event, Qnil);
   /* Remove the help from the frame */
@@ -4101,7 +4102,7 @@
 }
 
 static int
-is_scrollbar_event (Lisp_Object event)
+is_scrollbar_event (Lisp_Object USED_IF_SCROLLBARS (event))
 {
 #ifdef HAVE_SCROLLBARS
   Lisp_Object fun;
@@ -4934,9 +4935,9 @@
   last_point_position_buffer = Qnil;
   staticpro (&last_point_position_buffer);
 
-  QSnext_event_internal = build_string ("next_event_internal()");
+  QSnext_event_internal = build_ascstring ("next_event_internal()");
   staticpro (&QSnext_event_internal);
-  QSexecute_internal_event = build_string ("execute_internal_event()");
+  QSexecute_internal_event = build_ascstring ("execute_internal_event()");
   staticpro (&QSexecute_internal_event);
 
   DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /*
--- a/src/event-unixoid.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/event-unixoid.c	Wed Feb 24 01:58:04 2010 -0600
@@ -100,12 +100,16 @@
     ch = Lstream_get_ichar (XLSTREAM (CONSOLE_TTY_DATA (con)->instream));
   else
     {
+      Ibyte ibyte;
       /* #### Definitely something strange here.  We should be setting
 	 the stdio handle unbuffered and reading from it instead of mixing
 	 stdio and raw io calls. */
-      int nread = retry_read (fileno (CONSOLE_STREAM_DATA (con)->in), &ch, 1);
+      int nread = retry_read (fileno (CONSOLE_STREAM_DATA (con)->in),
+			      &ibyte, 1);
       if (nread <= 0)
 	ch = -1;
+      else
+        ch = ibyte;
     }
 
   if (ch < 0)
@@ -128,7 +132,7 @@
 void
 signal_fake_event (void)
 {
-  char byte = 0;
+  Rawbyte rbyte = 0;
   /* We do the write always.  Formerly I tried to "optimize" this
      by setting a flag indicating whether we're blocking and only
      doing the write in that case, but there is a race condition
@@ -144,7 +148,7 @@
     /* In case a signal comes through while we're dumping */
     {
       int old_errno = errno;
-      retry_write (signal_event_pipe[1], &byte, 1);
+      retry_write (signal_event_pipe[1], &rbyte, 1);
       errno = old_errno;
     }
 }
@@ -152,7 +156,7 @@
 void
 drain_signal_event_pipe (void)
 {
-  char chars[128];
+  Rawbyte chars[128];
   /* The input end of the pipe has been set to non-blocking. */
   while (retry_read (signal_event_pipe[0], chars, sizeof (chars)) > 0)
     ;
--- a/src/event-xlike-inc.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/event-xlike-inc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-/* Shared event code between X and GTK -- include file.
+/* Common code between X and GTK -- event-related.
    Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
@@ -22,10 +22,11 @@
 
 /* Synched up with: Not in FSF. */
 
-/* For some code it's reasonable to have only one copy and conditionalize
-   at run-time.  For other code it isn't. #### Perhaps all code should be
-   included here, not in event-xlike.c.  However, event-xlike.c is always
-   X-specific, whereas the following code isn't, in the GTK case. */
+/* Before including this file, you need to define either THIS_IS_X or
+   THIS_IS_GTK.  */
+
+/* See comment at top of redisplay-xlike-inc.c for an explanation of
+   how this file works. */
 
 static int
 #ifdef THIS_IS_GTK
@@ -160,7 +161,7 @@
   return 0;
 }
 
-#if defined(THIS_IS_X) || !defined(__GDK_KEYS_H__)
+#if defined (THIS_IS_X) || !defined (__GDK_KEYS_H__)
 
 /* Use an appropriate map to Unicode within x_keysym_to_character. Arguments
    are evaluated multiple times.
@@ -169,11 +170,11 @@
 
 #define USE_UNICODE_MAP(keysym, map)					\
   if (keysym >= FIRST_KNOWN_##map					\
-      && (keysym < (FIRST_KNOWN_##map + countof(map)))			\
+      && (keysym < (FIRST_KNOWN_##map + countof (map)))			\
       && map[keysym - FIRST_KNOWN_##map ]) do				\
     {									\
       keysym -= FIRST_KNOWN_##map ;					\
-      return Funicode_to_char(make_int(map[keysym]), Qnil);		\
+      return Funicode_to_char (make_int (map[keysym]), Qnil);		\
     } while (0)
 
 /* Maps to Unicode for X11 KeySyms, where we don't have a direct internal
@@ -588,10 +589,10 @@
 
 #ifndef THIS_IS_GTK
 static Lisp_Object
-x_keysym_to_character(KeySym keysym)
+x_keysym_to_character (KeySym keysym)
 #else
 Lisp_Object
-gtk_keysym_to_character(guint keysym)
+gtk_keysym_to_character (guint keysym)
 #endif
 {
   Lisp_Object charset = Qzero;
@@ -604,7 +605,7 @@
      #x01000000-#x01000100. */
 
   if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
-    return Funicode_to_char (make_int(keysym & 0xffffff), Qnil);
+    return Funicode_to_char (make_int (keysym & 0xffffff), Qnil);
 
   if ((keysym & 0xff) < 0xa0)
     return Qnil;
@@ -642,7 +643,7 @@
       break;
     case 6: /* Cyrillic */
       {
-	USE_UNICODE_MAP(keysym, CYRILLIC);
+	USE_UNICODE_MAP (keysym, CYRILLIC);
 	break;
       }
     case 7: /* Greek */
@@ -665,16 +666,16 @@
 	break;
       }
     case 8: 
-      USE_UNICODE_MAP(keysym, TECHNICAL);
+      USE_UNICODE_MAP (keysym, TECHNICAL);
       break;
     case 9: 
-      USE_UNICODE_MAP(keysym, SPECIAL);
+      USE_UNICODE_MAP (keysym, SPECIAL);
       break;
     case 10:
-      USE_UNICODE_MAP(keysym, PUBLISHING);
+      USE_UNICODE_MAP (keysym, PUBLISHING);
       break;
     case 11:
-      USE_UNICODE_MAP(keysym, APL);
+      USE_UNICODE_MAP (keysym, APL);
       break;
     case 12: /* Hebrew */
       USE_CHARSET (charset, HEBREW_ISO8859_8);
@@ -698,7 +699,7 @@
     case 32: /* Currency. The lower sixteen bits of these keysyms happily
 		correspond exactly to the Unicode code points of the
 		associated characters */
-      return Funicode_to_char(make_int(keysym & 0xffff), Qnil);
+      return Funicode_to_char (make_int (keysym & 0xffff), Qnil);
       break;
     default:
       break;
@@ -722,4 +723,4 @@
 #endif
 }
 
-#endif /* defined(THIS_IS_X) || !defined(__GDK_KEYS_H__) */
+#endif /* defined (THIS_IS_X) || !defined (__GDK_KEYS_H__) */
--- a/src/events.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/events.c	Wed Feb 24 01:58:04 2010 -0600
@@ -311,10 +311,10 @@
 }
 
 static void
-print_event_1 (const char *str, Lisp_Object obj, Lisp_Object printcharfun)
+print_event_1 (const Ascbyte *str, Lisp_Object obj, Lisp_Object printcharfun)
 {
   DECLARE_EISTRING_MALLOC (ei);
-  write_c_string (printcharfun, str);
+  write_ascstring (printcharfun, str);
   format_event_object (ei, obj, 0);
   write_eistring (printcharfun, ei);
   eifree (ei);
@@ -362,7 +362,7 @@
 			       XEVENT_TIMEOUT_OBJECT (obj));
 	break;
     case empty_event:
-	write_c_string (printcharfun, "#<empty-event");
+	write_ascstring (printcharfun, "#<empty-event");
 	break;
     case misc_user_event:
 	write_fmt_string_lisp (printcharfun, "#<misc-user-event (%S", 1,
@@ -377,17 +377,18 @@
 			       XEVENT_EVAL_OBJECT (obj));
 	break;
     case dead_event:
-	write_c_string (printcharfun, "#<DEALLOCATED-EVENT");
+	write_ascstring (printcharfun, "#<DEALLOCATED-EVENT");
 	break;
     default:
-	write_c_string (printcharfun, "#<UNKNOWN-EVENT-TYPE");
+	write_ascstring (printcharfun, "#<UNKNOWN-EVENT-TYPE");
 	break;
       }
-  write_c_string (printcharfun, ">");
+  write_ascstring (printcharfun, ">");
 }
 
 static int
-event_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+event_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	     int UNUSED (foldcase))
 {
   Lisp_Event *e1 = XEVENT (obj1);
   Lisp_Event *e2 = XEVENT (obj2);
--- a/src/events.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/events.h	Wed Feb 24 01:58:04 2010 -0600
@@ -910,38 +910,18 @@
 
 /* The modifiers XEmacs knows about; these appear in key and button events. */
 
-#define XEMACS_MOD_CONTROL      (1<<0)
-#define XEMACS_MOD_META         (1<<1)
-#define XEMACS_MOD_SUPER        (1<<2)
-#define XEMACS_MOD_HYPER        (1<<3)
-#define XEMACS_MOD_ALT          (1<<4)
-#define XEMACS_MOD_SHIFT        (1<<5)  /* not used for dual-case characters */
-#define XEMACS_MOD_BUTTON1      (1<<6)
-#define XEMACS_MOD_BUTTON2      (1<<7)
-#define XEMACS_MOD_BUTTON3      (1<<8)
-#define XEMACS_MOD_BUTTON4      (1<<9)
-#define XEMACS_MOD_BUTTON5      (1<<10)
-#define XEMACS_MOD_BUTTON6      (1<<11)
-#define XEMACS_MOD_BUTTON7      (1<<12)
-#define XEMACS_MOD_BUTTON8      (1<<13)
-#define XEMACS_MOD_BUTTON9      (1<<14)
-#define XEMACS_MOD_BUTTON10     (1<<15)
-#define XEMACS_MOD_BUTTON11     (1<<16)
-#define XEMACS_MOD_BUTTON12     (1<<17)
-#define XEMACS_MOD_BUTTON13     (1<<18)
-#define XEMACS_MOD_BUTTON14     (1<<19)
-#define XEMACS_MOD_BUTTON15     (1<<20)
-#define XEMACS_MOD_BUTTON16     (1<<21)
-#define XEMACS_MOD_BUTTON17     (1<<22)
-#define XEMACS_MOD_BUTTON18     (1<<23)
-#define XEMACS_MOD_BUTTON19     (1<<24)
-#define XEMACS_MOD_BUTTON20     (1<<25)
-#define XEMACS_MOD_BUTTON21     (1<<26)
-#define XEMACS_MOD_BUTTON22     (1<<27)
-#define XEMACS_MOD_BUTTON23     (1<<28)
-#define XEMACS_MOD_BUTTON24     (1<<29)
-#define XEMACS_MOD_BUTTON25     (1<<30)
-#define XEMACS_MOD_BUTTON26     (1<<31)
+enum event_modifiers
+  {
+    XEMACS_MOD_CONTROL  = (1<<0),
+    XEMACS_MOD_META     = (1<<1),
+    XEMACS_MOD_SUPER    = (1<<2),
+    XEMACS_MOD_HYPER    = (1<<3),
+    XEMACS_MOD_ALT      = (1<<4),
+    XEMACS_MOD_SHIFT    = (1<<5)  /* not used for dual-case characters */,
+#define FROB(num)				\
+    XEMACS_MOD_BUTTON##num  = (1<<(num+5)),
+#include "keymap-buttons.h"
+  };
    
 /* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key
    if there are both Alt and Meta keys.  If there are no Meta keys,
--- a/src/extents.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/extents.c	Wed Feb 24 01:58:04 2010 -0600
@@ -771,7 +771,7 @@
 free_gap_array (Gap_Array *ga)
 {
   gap_array_delete_all_markers (ga);
-  xfree (ga, Gap_Array *);
+  xfree (ga);
 }
 #endif /* not NEW_GC */
 
@@ -994,7 +994,7 @@
 {
   free_gap_array (el->start);
   free_gap_array (el->end);
-  xfree (el, Extent_List *);
+  xfree (el);
 }
 #endif /* not NEW_GC */
 
@@ -1799,7 +1799,7 @@
 free_soe (struct stack_of_extents *soe)
 {
   free_extent_list (soe->extents);
-  xfree (soe, struct stack_of_extents *);
+  xfree (soe);
 }
 #endif /* not NEW_GC */
 
@@ -2913,7 +2913,7 @@
   Dynarr_free (ef->extents);
   Dynarr_free (ef->begin_glyphs);
   Dynarr_free (ef->end_glyphs);
-  xfree (ef, struct extent_fragment *);
+  xfree (ef);
 }
 
 static int
@@ -2955,7 +2955,7 @@
     /* But some loser programs mess up and may create a large number
        of extents overlapping the same spot.  This will result in
        catastrophic behavior if we use the bubble sort above. */
-    qsort (Dynarr_atp (extarr, 0), Dynarr_length (extarr),
+    qsort (Dynarr_begin (extarr), Dynarr_length (extarr),
 	   sizeof (EXTENT), extent_priority_sort_function);
 }
 
@@ -3098,13 +3098,15 @@
       if (extent_start (e) == mempos && !NILP (extent_begin_glyph (e)))
 	{
 	  Lisp_Object glyph = extent_begin_glyph (e);
-	  if (seen_glyph) {
-	    struct glyph_block gb;
-	    
-	    gb.glyph = glyph;
-	    gb.extent = wrap_extent (e);
-	    Dynarr_add (ef->begin_glyphs, gb);
-	  }
+	  if (seen_glyph)
+	    {
+	      struct glyph_block gb;
+
+	      xzero (gb);
+	      gb.glyph = glyph;
+	      gb.extent = wrap_extent (e);
+	      Dynarr_add (ef->begin_glyphs, gb);
+	    }
 	  else if (EQ (glyph, last_glyph))
 	    seen_glyph = 1;
 	}
@@ -3117,13 +3119,15 @@
       if (extent_end (e) == mempos && !NILP (extent_end_glyph (e)))
 	{
 	  Lisp_Object glyph = extent_end_glyph (e);
-	  if (seen_glyph) {
-	    struct glyph_block gb;
-
-	    gb.glyph = glyph;
-	    gb.extent = wrap_extent (e);
-	    Dynarr_add (ef->end_glyphs, gb);
-	  }
+	  if (seen_glyph)
+	    {
+	      struct glyph_block gb;
+	      
+	      xzero (gb);
+	      gb.glyph = glyph;
+	      gb.extent = wrap_extent (e);
+	      Dynarr_add (ef->end_glyphs, gb);
+	    }
 	  else if (EQ (glyph, last_glyph))
 	    seen_glyph = 1;
 	}
@@ -3252,7 +3256,7 @@
   EXTENT ext = XEXTENT (obj);
   EXTENT anc = extent_ancestor (ext);
   Lisp_Object tail;
-  char buf[64], *bp = buf;
+  Ascbyte buf[64], *bp = buf;
 
   /* Retrieve the ancestor and use it, for faster retrieval of properties */
 
@@ -3280,7 +3284,7 @@
       extent_duplicable_p (anc) || !NILP (extent_invisible (anc)))
     *bp++ = ' ';
   *bp = '\0';
-  write_c_string (printcharfun, buf);
+  write_ascstring (printcharfun, buf);
 
   tail = extent_plist_slot (anc);
 
@@ -3342,12 +3346,12 @@
 	}
 
       if (!EXTENT_LIVE_P (XEXTENT (obj)))
-	write_c_string (printcharfun, "#<destroyed extent");
+	write_ascstring (printcharfun, "#<destroyed extent");
       else
 	{
-	  write_c_string (printcharfun, "#<extent ");
+	  write_ascstring (printcharfun, "#<extent ");
 	  print_extent_1 (obj, printcharfun, escapeflag);
-	  write_c_string (printcharfun, extent_detached_p (XEXTENT (obj))
+	  write_ascstring (printcharfun, extent_detached_p (XEXTENT (obj))
 			  ? " from " : " in ");
 	  write_fmt_string (printcharfun, "%s%s%s", title, name, posttitle);
 	}
@@ -3356,9 +3360,9 @@
     {
       if (print_readably)
 	printing_unreadable_object ("#<extent>");
-      write_c_string (printcharfun, "#<extent");
+      write_ascstring (printcharfun, "#<extent");
     }
-  write_c_string (printcharfun, ">");
+  write_ascstring (printcharfun, ">");
 }
 
 static int
@@ -3394,11 +3398,12 @@
   /* compare the random elements of the plists. */
   return !plists_differ (extent_no_chase_plist (e1),
 			 extent_no_chase_plist (e2),
-			 0, 0, depth + 1);
+			 0, 0, depth + 1, 0);
 }
 
 static int
-extent_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+extent_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	      int UNUSED (foldcase))
 {
   struct extent *e1 = XEXTENT (obj1);
   struct extent *e2 = XEXTENT (obj2);
@@ -3863,14 +3868,14 @@
     if (!NILP (parent))
       extent_properties (XEXTENT (parent), newprops);
 
-    qsort (Dynarr_atp (oldprops, 0), Dynarr_length (oldprops),
+    qsort (Dynarr_begin (oldprops), Dynarr_length (oldprops),
 	   sizeof (Lisp_Object_pair), compare_key_value_pairs);
-    qsort (Dynarr_atp (newprops, 0), Dynarr_length (newprops),
+    qsort (Dynarr_begin (newprops), Dynarr_length (newprops),
 	   sizeof (Lisp_Object_pair), compare_key_value_pairs);
     orignewlength = Dynarr_length (newprops);
     for (i = 0; i < Dynarr_length (oldprops); i++)
       {
-	if (!bsearch (Dynarr_atp (oldprops, i), Dynarr_atp (newprops, 0),
+	if (!bsearch (Dynarr_atp (oldprops, i), Dynarr_begin (newprops),
 		      Dynarr_length (newprops), sizeof (Lisp_Object_pair),
 		      compare_key_value_pairs))
 	  {
@@ -3883,7 +3888,7 @@
     for (i = 0; i < orignewlength; i++)
       {
 	if (!Dynarr_length (oldprops) || !bsearch (Dynarr_atp (newprops, i), 
-						   Dynarr_atp (oldprops, 0),
+						   Dynarr_begin (oldprops),
 						   Dynarr_length (oldprops), 
 						   sizeof (Lisp_Object_pair),
 						   compare_key_value_pairs))
@@ -3894,9 +3899,9 @@
 	    Dynarr_add (oldprops, new_);
 	  }
       }
-    qsort (Dynarr_atp (oldprops, 0), Dynarr_length (oldprops),
+    qsort (Dynarr_begin (oldprops), Dynarr_length (oldprops),
 	   sizeof (Lisp_Object_pair), compare_key_value_pairs);
-    qsort (Dynarr_atp (newprops, 0), Dynarr_length (newprops),
+    qsort (Dynarr_begin (newprops), Dynarr_length (newprops),
 	   sizeof (Lisp_Object_pair), compare_key_value_pairs);
     for (i = 0; i < Dynarr_length (oldprops); i++)
       {
@@ -7621,6 +7626,6 @@
   Vextent_face_reverse_memoize_hash_table =
     make_lisp_hash_table (100, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQ);
 
-  QSin_map_extents_internal = build_msg_string ("(in map-extents-internal)");
+  QSin_map_extents_internal = build_defer_string ("(in map-extents-internal)");
   staticpro (&QSin_map_extents_internal);
 }
--- a/src/faces.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/faces.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* "Face" primitives
    Copyright (C) 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2005, 2010 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -137,7 +137,7 @@
       write_fmt_string_lisp (printcharfun, "#<face %S", 1, face->name);
       if (!NILP (face->doc_string))
 	write_fmt_string_lisp (printcharfun, " %S", 1, face->doc_string);
-      write_c_string (printcharfun, ">");
+      write_ascstring (printcharfun, ">");
     }
 }
 
@@ -148,7 +148,8 @@
    This isn't concerned with "unspecified" attributes, that's what
    #'face-differs-from-default-p is for. */
 static int
-face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+face_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	    int UNUSED (foldcase))
 {
   Lisp_Face *f1 = XFACE (obj1);
   Lisp_Face *f2 = XFACE (obj2);
@@ -168,7 +169,7 @@
      internal_equal (f1->blinking,	     f2->blinking,	    depth) &&
      internal_equal (f1->reverse,	     f2->reverse,	    depth) &&
 
-     ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1));
+     ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1, 0));
 }
 
 static Hashcode
@@ -527,8 +528,8 @@
   struct face_inheritance_closure *fcl =
     (struct face_inheritance_closure *) face_inheritance_closure;
 
-  key = VOID_TO_LISP (hash_key);
-  contents = VOID_TO_LISP (hash_contents);
+  key = GET_LISP_FROM_VOID (hash_key);
+  contents = GET_LISP_FROM_VOID (hash_contents);
 
   if (EQ (fcl->property, Qfont))
     {
@@ -589,16 +590,20 @@
 
   if (!NILP (charset))
     matchspec = noseeum_cons (charset,
-			      stage == initial ? Qinitial : Qfinal);
+			      stage == STAGE_INITIAL ? Qinitial : Qfinal);
 
   GCPRO1 (matchspec);
+  /* This call to specifier_instance_no_quit(), will end up calling
+     font_instantiate() if the property in a question is a font (currently,
+     this means EQ (property, Qfont), because only the face property named
+     `font' contains a font object).  See the comments there. */
   retval = specifier_instance_no_quit (Fget (face, property, Qnil), matchspec,
 				       domain, errb, no_fallback, depth);
   UNGCPRO;
   if (CONSP (matchspec))
     free_cons (matchspec);
 
-  if (UNBOUNDP (retval) && !no_fallback && final == stage)
+  if (UNBOUNDP (retval) && !no_fallback && STAGE_FINAL == stage)
     {
       if (EQ (property, Qfont))
 	{
@@ -1159,7 +1164,7 @@
 					       /* ERROR_ME_DEBUG_WARN is
 						  fine here.  */
 					       ERROR_ME_DEBUG_WARN, 1, Qzero,
-					       initial);
+					       STAGE_INITIAL);
     DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, "
 		"result was something %s\n",
 		XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)),
@@ -1181,15 +1186,15 @@
 					       charset, domain,
 					       ERROR_ME_DEBUG_WARN, 0,
 					       Qzero,
-					       initial);
+					       STAGE_INITIAL);
 
-    DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, "
-		"allow fallback, result was something %s\n",
-		XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)),
-		XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))),
-		UNBOUNDP(new_val) ? "not bound" : "bound");
+    DEBUG_FACES ("just called f_p_m_i on face %s, charset %s, initial, "
+		 "allow fallback, result was something %s\n",
+		 XSTRING_DATA (XSYMBOL_NAME (XFACE (cachel->face)->name)),
+		 XSTRING_DATA (XSYMBOL_NAME (XCHARSET_NAME (charset))),
+		 UNBOUNDP (new_val) ? "not bound" : "bound");
 
-    if (!UNBOUNDP(new_val))
+    if (!UNBOUNDP (new_val))
       {
 	break;
       }
@@ -1200,7 +1205,7 @@
 					       charset, domain,
 					       ERROR_ME_DEBUG_WARN, 1,
 					       Qzero,
-					       final);
+					       STAGE_FINAL);
 
     DEBUG_FACES("just called f_p_m_i on face %s, charset %s, final, "
 		"result was something %s\n",
@@ -1208,7 +1213,7 @@
 		XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))),
 		UNBOUNDP(new_val) ? "not bound" : "bound");
     /* Tell X11 redisplay that it should translate to iso10646-1. */
-    if (!UNBOUNDP(new_val))
+    if (!UNBOUNDP (new_val))
       {
 	final_stage = 1;
 	break;
@@ -1222,13 +1227,13 @@
 					       charset, domain,
 					       ERROR_ME_DEBUG_WARN, 0,
 					       Qzero,
-					       final);
+					       STAGE_FINAL);
 
-    DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, "
-		"allow fallback, result was something %s\n",
-		XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)),
-		XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))),
-		UNBOUNDP(new_val) ? "not bound" : "bound");
+    DEBUG_FACES ("just called f_p_m_i on face %s, charset %s, initial, "
+		 "allow fallback, result was something %s\n",
+		 XSTRING_DATA (XSYMBOL_NAME (XFACE (cachel->face)->name)),
+		 XSTRING_DATA (XSYMBOL_NAME (XCHARSET_NAME (charset))),
+		 UNBOUNDP (new_val) ? "not bound" : "bound");
     if (!UNBOUNDP(new_val))
       {
 	/* Tell X11 redisplay that it should translate to iso10646-1. */
@@ -1362,8 +1367,7 @@
   if (must_finish_frobbing)
     {
       int default_face = EQ (face, Vdefault_face);
-      struct face_cachel *cachel
-	= Dynarr_atp (w->face_cachels, Dynarr_length (w->face_cachels) - 1);
+      struct face_cachel *cachel = Dynarr_lastp (w->face_cachels);
 
       FROB (background_pixmap);
       MAYBE_UNFROB_BACKGROUND_PIXMAP;
@@ -2030,30 +2034,30 @@
 
 DEFUN ("specifier-tag-one-dimensional-p",
        Fspecifier_tag_one_dimensional_p,
-       2, 2, 0, /*
+       1, 1, 0, /*
 Return non-nil if (charset-dimension CHARSET) is 1.
 
 Used by the X11 platform font code; see `define-specifier-tag'.  You
 shouldn't ever need to call this yourself.
 */
-       (charset, UNUSED(stage)))
+       (charset))
 {
-  CHECK_CHARSET(charset);
-  return (1 == XCHARSET_DIMENSION(charset)) ? Qt : Qnil;
+  CHECK_CHARSET (charset);
+  return (1 == XCHARSET_DIMENSION (charset)) ? Qt : Qnil;
 }
 
 DEFUN ("specifier-tag-two-dimensional-p",
        Fspecifier_tag_two_dimensional_p,
-       2, 2, 0, /*
+       1, 1, 0, /*
 Return non-nil if (charset-dimension CHARSET) is 2.
 
 Used by the X11 platform font code; see `define-specifier-tag'.  You
 shouldn't ever need to call this yourself.
 */
-       (charset, UNUSED(stage)))
+       (charset))
 {
-  CHECK_CHARSET(charset);
-  return (2 == XCHARSET_DIMENSION(charset)) ? Qt : Qnil;
+  CHECK_CHARSET (charset);
+  return (2 == XCHARSET_DIMENSION (charset)) ? Qt : Qnil;
 }
 
 DEFUN ("specifier-tag-final-stage-p",
@@ -2064,9 +2068,9 @@
 Used by the X11 platform font code for giving fallbacks; see
 `define-specifier-tag'.  You shouldn't ever need to call this.
 */
-       (UNUSED(charset), stage))
+       (UNUSED (charset), stage))
 {
-  return EQ(stage, Qfinal) ? Qt : Qnil;
+  return EQ (stage, Qfinal) ? Qt : Qnil;
 }
 
 DEFUN ("specifier-tag-initial-stage-p",
@@ -2231,7 +2235,7 @@
 
   Vdefault_face = Qnil; /* so that Fmake_face() doesn't set up a bogus
 			   default value */
-  Vdefault_face = Fmake_face (Qdefault, build_msg_string ("default face"),
+  Vdefault_face = Fmake_face (Qdefault, build_defer_string ("default face"),
 			      Qnil);
 
   /* Provide some last-resort fallbacks to avoid utter fuckage if
@@ -2241,22 +2245,22 @@
     Lisp_Object fg_fb = Qnil, bg_fb = Qnil;
 
 #ifdef HAVE_GTK
-    fg_fb = acons (list1 (Qgtk), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qgtk), build_string ("white"), bg_fb);
+    fg_fb = acons (list1 (Qgtk), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qgtk), build_ascstring ("white"), bg_fb);
 #endif
 #ifdef HAVE_X_WINDOWS
-    fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qx), build_string ("white"), bg_fb);
+    fg_fb = acons (list1 (Qx), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qx), build_ascstring ("gray80"), bg_fb);
 #endif
 #ifdef HAVE_TTY
     fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb);
     bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb);
 #endif
 #ifdef HAVE_MS_WINDOWS
-    fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb);
-    fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qmswindows), build_string ("white"), bg_fb);
+    fg_fb = acons (list1 (Qmsprinter), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qmsprinter), build_ascstring ("white"), bg_fb);
+    fg_fb = acons (list1 (Qmswindows), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qmswindows), build_ascstring ("white"), bg_fb);
 #endif
     set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), fg_fb);
     set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), bg_fb);
@@ -2273,12 +2277,12 @@
     Lisp_Object device_symbol = Qx;
 #endif
 
-#if defined (USE_XFT) || defined (MULE)
+#if defined (HAVE_XFT) || defined (MULE)
     const Ascbyte **fontptr;
 
     const Ascbyte *fonts[] =
     {
-#ifdef USE_XFT
+#ifdef HAVE_XFT
       /************** Xft fonts *************/
 
       /* Note that fontconfig can search for several font families in one
@@ -2303,7 +2307,7 @@
       "-*-*-medium-r-*-*-*-170-*-*-c-*-*-*",
 #endif
     };
-#endif /* defined (USE_XFT) || defined (MULE) */
+#endif /* defined (HAVE_XFT) || defined (MULE) */
 
 #ifdef MULE
 
@@ -2334,20 +2338,20 @@
 
 #endif /* MULE */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
     for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--)
       inst_list = Fcons (Fcons (list1 (device_symbol),
-				build_string (*fontptr)),
+				build_cistring (*fontptr)),
 			 inst_list);
 
-#else /* !USE_XFT */
+#else /* !HAVE_XFT */
     inst_list =
       Fcons
       (Fcons
        (list1 (device_symbol),
 	/* grrr.  This really does need to be "*", not an XLFD.
 	   An unspecified XLFD won't pick up stuff like 10x20. */
-	build_string ("*")),
+	build_ascstring ("*")),
        inst_list);
 #ifdef MULE
 
@@ -2361,7 +2365,7 @@
       Fcons
       (Fcons
        (list4(device_symbol, Qtwo_dimensional, Qfinal, Qx_coverage_instantiator),
-	build_string
+	build_ascstring
 	("-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")),
        inst_list);
 
@@ -2373,14 +2377,14 @@
       Fcons
       (Fcons
        (list4(device_symbol, Qone_dimensional, Qfinal, Qx_coverage_instantiator),
-	build_string
+	build_ascstring
 	("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")),
        inst_list);
 
     for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--)
       inst_list = Fcons (Fcons (list3 (device_symbol,
 				       Qtwo_dimensional, Qinitial),
-				build_string (*fontptr)),
+				build_cistring (*fontptr)),
 			 inst_list);
 
     /* We need to set the font for the JIT-ucs-charsets separately from the
@@ -2393,7 +2397,7 @@
       Fcons
       (Fcons
        (list4(device_symbol, Qencode_as_utf_8, Qinitial, Qx_coverage_instantiator),
-	build_string
+	build_ascstring
 	("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")),
        inst_list);
 
@@ -2405,7 +2409,7 @@
       Fcons
       (Fcons
        (list1 (device_symbol),
-	build_string ("-*-*-medium-r-*-*-*-120-*-*-c-*-*-*")),
+	build_ascstring ("-*-*-medium-r-*-*-*-120-*-*-c-*-*-*")),
        inst_list);
 
     /* With a Cygwin XFree86 install, this returns the best (clearest,
@@ -2418,15 +2422,15 @@
       Fcons
       (Fcons
        (list1 (device_symbol),
-	build_string ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")),
+	build_ascstring ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")),
        inst_list);
 
-#endif /* !USE_XFT */
+#endif /* !HAVE_XFT */
 
 #endif /* HAVE_X_WINDOWS || HAVE_GTK */
 
 #ifdef HAVE_TTY
-    inst_list = Fcons (Fcons (list1 (Qtty), build_string ("normal")),
+    inst_list = Fcons (Fcons (list1 (Qtty), build_ascstring ("normal")),
 		       inst_list);
 #endif /* HAVE_TTY */
 
@@ -2445,18 +2449,18 @@
 	{
 	  /* display device */
 	  inst_list = Fcons (Fcons (list1 (Qmswindows),
-				    build_string (*mswfontptr)),
+				    build_ascstring (*mswfontptr)),
 			     inst_list);
 	  /* printer device */
 	  inst_list = Fcons (Fcons (list1 (Qmsprinter),
-				    build_string (*mswfontptr)),
+				    build_ascstring (*mswfontptr)),
 			     inst_list);
 	}
        /* Use Lucida Console rather than Courier New if it exists -- the
 	  line spacing is much less, so many more lines fit with the same
 	  size font. (And it's specifically designed for screens.) */
        inst_list = Fcons (Fcons (list1 (Qmswindows),
-				 build_string ("Lucida Console:Regular:10::")),
+				 build_ascstring ("Lucida Console:Regular:10::")),
 			  inst_list);
     }
 #endif /* HAVE_MS_WINDOWS */
@@ -2480,7 +2484,7 @@
   /* gui-element is the parent face of all gui elements such as
      modeline, vertical divider and toolbar. */
   Vgui_element_face = Fmake_face (Qgui_element,
-				  build_msg_string ("gui element face"),
+				  build_defer_string ("gui element face"),
 				  Qnil);
 
   /* Provide some last-resort fallbacks for gui-element face which
@@ -2494,22 +2498,22 @@
     /* We need to put something in there, or error checking gets
        #%!@#ed up before the styles are set, which override the
        fallbacks. */
-    fg_fb = acons (list1 (Qgtk), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qgtk), build_string ("Gray80"), bg_fb);
+    fg_fb = acons (list1 (Qgtk), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qgtk), build_ascstring ("Gray80"), bg_fb);
 #endif
 #ifdef HAVE_X_WINDOWS
-    fg_fb = acons (list1 (Qx), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qx), build_string ("Gray80"), bg_fb);
+    fg_fb = acons (list1 (Qx), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qx), build_ascstring ("Gray80"), bg_fb);
 #endif
 #ifdef HAVE_TTY
     fg_fb = acons (list1 (Qtty), Fvector (0, 0), fg_fb);
     bg_fb = acons (list1 (Qtty), Fvector (0, 0), bg_fb);
 #endif
 #ifdef HAVE_MS_WINDOWS
-    fg_fb = acons (list1 (Qmsprinter), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qmsprinter), build_string ("white"), bg_fb);
-    fg_fb = acons (list1 (Qmswindows), build_string ("black"), fg_fb);
-    bg_fb = acons (list1 (Qmswindows), build_string ("Gray75"), bg_fb);
+    fg_fb = acons (list1 (Qmsprinter), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qmsprinter), build_ascstring ("white"), bg_fb);
+    fg_fb = acons (list1 (Qmswindows), build_ascstring ("black"), fg_fb);
+    bg_fb = acons (list1 (Qmswindows), build_ascstring ("Gray75"), bg_fb);
 #endif
     set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil), fg_fb);
     set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil), bg_fb);
@@ -2520,7 +2524,7 @@
      way since we need to get them anyway. */
 
   /* modeline is gui element. */
-  Vmodeline_face = Fmake_face (Qmodeline, build_msg_string ("modeline face"),
+  Vmodeline_face = Fmake_face (Qmodeline, build_defer_string ("modeline face"),
 			       Qnil);
 
   set_specifier_fallback (Fget (Vmodeline_face, Qforeground, Qunbound),
@@ -2533,7 +2537,7 @@
 
   /* toolbar is another gui element */
   Vtoolbar_face = Fmake_face (Qtoolbar,
-			      build_msg_string ("toolbar face"),
+			      build_defer_string ("toolbar face"),
 			      Qnil);
   set_specifier_fallback (Fget (Vtoolbar_face, Qforeground, Qunbound),
 			  Fget (Vgui_element_face, Qforeground, Qunbound));
@@ -2545,7 +2549,7 @@
 
   /* vertical divider is another gui element */
   Vvertical_divider_face = Fmake_face (Qvertical_divider,
-				       build_msg_string ("vertical divider face"),
+				       build_defer_string ("vertical divider face"),
 				       Qnil);
 
   set_specifier_fallback (Fget (Vvertical_divider_face, Qforeground, Qunbound),
@@ -2559,7 +2563,7 @@
 
   /* widget is another gui element */
   Vwidget_face = Fmake_face (Qwidget,
-			     build_msg_string ("widget face"),
+			     build_defer_string ("widget face"),
 			     Qnil);
   /* #### weird ... the gui-element face doesn't have its own font yet */
   set_specifier_fallback (Fget (Vwidget_face, Qfont, Qunbound),
@@ -2571,17 +2575,17 @@
   /* We don't want widgets to have a default background pixmap. */
 
   Vleft_margin_face = Fmake_face (Qleft_margin,
-				  build_msg_string ("left margin face"),
+				  build_defer_string ("left margin face"),
 				  Qnil);
   Vright_margin_face = Fmake_face (Qright_margin,
-				   build_msg_string ("right margin face"),
+				   build_defer_string ("right margin face"),
 				   Qnil);
   Vtext_cursor_face = Fmake_face (Qtext_cursor,
-				  build_msg_string ("face for text cursor"),
+				  build_defer_string ("face for text cursor"),
 				  Qnil);
   Vpointer_face =
     Fmake_face (Qpointer,
-		build_msg_string
+		build_defer_string
 		("face for foreground/background colors of mouse pointer"),
 		Qnil);
 }
--- a/src/faces.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/faces.h	Wed Feb 24 01:58:04 2010 -0600
@@ -393,7 +393,7 @@
 #define FACE_FONT(face, domain, charset)				\
   face_property_matching_instance (face, Qfont, charset, domain,	\
 				   ERROR_ME_DEBUG_WARN, 0, Qzero,	\
-				   initial)
+				   STAGE_INITIAL)
 #define FACE_DISPLAY_TABLE(face, domain)				\
   FACE_PROPERTY_INSTANCE (face, Qdisplay_table, domain, 0, Qzero)
 #define FACE_BACKGROUND_PIXMAP(face, domain)				\
--- a/src/file-coding.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/file-coding.c	Wed Feb 24 01:58:04 2010 -0600
@@ -297,12 +297,11 @@
 {
   Lisp_Coding_System *c = XCODING_SYSTEM (obj);
   if (print_readably)
-    printing_unreadable_object
-      ("printing unreadable object #<coding-system 0x%x>", c->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string_lisp (printcharfun, "#<coding-system %s ", 1, c->name);
   print_coding_system_properties (obj, printcharfun);
-  write_c_string (printcharfun, ">");
+  write_ascstring (printcharfun, ">");
 }
 
 /* Print an abbreviated version of a coding system (but still containing
@@ -314,7 +313,7 @@
 {
   write_fmt_string_lisp (printcharfun, "%s[", 1, XCODING_SYSTEM_NAME (cs));
   print_coding_system_properties (cs, printcharfun);
-  write_c_string (printcharfun, "]");
+  write_ascstring (printcharfun, "]");
 }
 
 #ifndef NEW_GC
@@ -497,9 +496,9 @@
           fail_range_start = pos;
           while ((pos < end) &&  
                  (EQ (Qnil, get_char_table (ch, safe_chars))
-                  && (failed_reason = query_coding_unencodable))
-                 && (previous_failed_reason == query_coding_succeeded
-                     || previous_failed_reason == failed_reason))
+                  && (failed_reason = query_coding_unencodable,
+		      (previous_failed_reason == query_coding_succeeded
+		       || previous_failed_reason == failed_reason))))
             {
               pos++;
               INC_BYTEBPOS (buf, pos_byte);
@@ -519,18 +518,12 @@
 
               if (flags & QUERY_METHOD_ERRORP)
                 {
-                  DECLARE_EISTRING (error_details);
-
-                  eicpy_ascii (error_details, "Cannot encode ");
-                  eicat_lstr (error_details,
-                              make_string_from_buffer (buf, fail_range_start,
-                                                       pos -
-                                                       fail_range_start));
-                  eicat_ascii (error_details, " using coding system");
-
-                  signal_error (Qtext_conversion_error, 
-                                (const CIbyte *)(eidata (error_details)),
-                                XCODING_SYSTEM_NAME (codesys));
+                  signal_error_2
+		    (Qtext_conversion_error,
+		     "Cannot encode using coding system",
+		     make_string_from_buffer (buf, fail_range_start,
+					      pos - fail_range_start),
+		     XCODING_SYSTEM_NAME (codesys));
                 }
 
               if (NILP (result))
@@ -677,7 +670,7 @@
                 }
             }
 
-          coding_system_or_name = intern_int (eidata (desired_base));
+          coding_system_or_name = intern_istring (eidata (desired_base));
 
           /* Remove this coding system and its subsidiary coding
              systems from the hash, to avoid calling this code recursively. */
@@ -695,7 +688,7 @@
           /* Keep around the form so it doesn't disappear from under
              #'eval's feet. */
           GCPRO1 (lookup);
-          call1_trapping_problems ((const CIbyte *)eidata (warning_info),
+          call1_trapping_problems ((const CIbyte *) eidata (warning_info),
                                    Qeval, lookup, 0);
           UNGCPRO;
 
@@ -1104,14 +1097,14 @@
       enum eol_type eol = coding_subsidiary_list[i].eol;
 
       qxestrcpy_ascii (codesys_name + len, extension);
-      codesys_name_sym = intern_int (codesys_name);
+      codesys_name_sym = intern_istring (codesys_name);
       if (mlen != -1)
 	qxestrcpy_ascii (codesys_mnemonic + mlen, mnemonic_ext);
 
       sub_codesys = Fcopy_coding_system (codesys, codesys_name_sym);
       if (mlen != -1)
 	XCODING_SYSTEM_MNEMONIC (sub_codesys) =
-	  build_intstring (codesys_mnemonic);
+	  build_istring (codesys_mnemonic);
 
       if (eol != EOL_LF)
 	{
@@ -1124,7 +1117,7 @@
 	      (sub_codesys, "internal-subsidiary-eol-wrapper",
 	       Qchain, Qunbound,
 	       mlen != -1 ?
-	       list6 (Qmnemonic, build_intstring (codesys_mnemonic),
+	       list6 (Qmnemonic, build_istring (codesys_mnemonic),
 		      Qchain, chain,
 		      Qcanonicalize_after_coding, sub_codesys) :
 	       list4 (Qchain, chain,
@@ -1210,8 +1203,8 @@
 			      XSTRING_DATA (Fsymbol_name (XCODING_SYSTEM_NAME
 							  (name_or_existing))),
 			      ++coding_system_tick);
-      name_or_existing = intern_int (newname);
-      xfree (newname, Ibyte *);
+      name_or_existing = intern_istring (newname);
+      xfree (newname);
       
       if (UNBOUNDP (description))
 	{
@@ -1219,13 +1212,13 @@
 	    emacs_sprintf_malloc
 	      (NULL, "For Internal Use (%s)",
 	       XSTRING_DATA (Fsymbol_name (name_or_existing)));
-	  description = build_intstring (newname);
-	  xfree (newname, Ibyte *);
+	  description = build_istring (newname);
+	  xfree (newname);
 	}
 
       newname = emacs_sprintf_malloc (NULL, "Int%d", coding_system_tick);
-      defmnem = build_intstring (newname);
-      xfree (newname, Ibyte *);
+      defmnem = build_istring (newname);
+      xfree (newname);
     }
   else
     CHECK_SYMBOL (name_or_existing);
@@ -1245,7 +1238,7 @@
   cs->internal_p = !!prefix;
 
   if (NILP (description))
-    description = build_string ("");
+    description = build_ascstring ("");
   else
     CHECK_STRING (description);
   CODING_SYSTEM_DESCRIPTION (cs) = description;
@@ -1373,9 +1366,9 @@
 	    (NULL, "internal-eol-copy-%s-%d",
 	     XSTRING_DATA (Fsymbol_name (name_or_existing)),
 	     ++coding_system_tick);
-	Lisp_Object newnamesym = intern_int (newname);
+	Lisp_Object newnamesym = intern_istring (newname);
 	Lisp_Object copied = Fcopy_coding_system (csobj, newnamesym);
-	xfree (newname, Ibyte *);
+	xfree (newname);
 	
 	XCODING_SYSTEM_CANONICAL (csobj) =
 	  make_internal_coding_system
@@ -1838,7 +1831,7 @@
 	{
 	  Bytecount chunk =
 	    min (size, (Bytecount) Dynarr_length (str->convert_to));
-	  memcpy (data, Dynarr_atp (str->convert_to, 0), chunk);
+	  memcpy (data, Dynarr_begin (str->convert_to), chunk);
 	  Dynarr_delete_many (str->convert_to, 0, chunk);
 	  data += chunk;
 	  size -= chunk;
@@ -1867,7 +1860,7 @@
 				  Dynarr_atp (str->convert_from, rejected),
 				  readmore);
 	/* Trim size down to how much we actually got */
-	Dynarr_set_size (str->convert_from, rejected + max (0, read_size));
+	Dynarr_set_length (str->convert_from, rejected + max (0, read_size));
       }
 
       if (read_size < 0) /* LSTREAM_ERROR */
@@ -1889,7 +1882,7 @@
 	/* Convert the data, and save any rejected data in convert_from */
 	processed =
 	  XCODESYSMETH (str->codesys, convert,
-			(str, Dynarr_atp (str->convert_from, 0),
+			(str, Dynarr_begin (str->convert_from),
 			 str->convert_to, to_process));
 	if (processed < 0)
 	  {
@@ -1898,10 +1891,10 @@
 	  }
 	assert (processed <= to_process);
 	if (processed < to_process)
-	  memmove (Dynarr_atp (str->convert_from, 0),
+	  memmove (Dynarr_begin (str->convert_from),
 		   Dynarr_atp (str->convert_from, processed),
 		   to_process - processed);
-	Dynarr_set_size (str->convert_from, to_process - processed);
+	Dynarr_set_length (str->convert_from, to_process - processed);
       }
     }
 
@@ -1921,7 +1914,7 @@
   Dynarr_reset (str->convert_to);
   size = XCODESYSMETH (str->codesys, convert,
 		       (str, data, str->convert_to, size));
-  if (Lstream_write (str->other_end, Dynarr_atp (str->convert_to, 0),
+  if (Lstream_write (str->other_end, Dynarr_begin (str->convert_to),
 		     Dynarr_length (str->convert_to)) < 0)
     return -1;
   else
@@ -2056,7 +2049,7 @@
   MAYBE_XCODESYSMETH (str->codesys, finalize_coding_stream, (str));
   if (str->data)
     {
-      xfree (str->data, void *);
+      xfree (str->data);
       str->data = 0;
     }
   str->finalized = 1;
@@ -2115,7 +2108,7 @@
   
   if (str->data)
     {
-      xfree (str->data, void *);
+      xfree (str->data);
       str->data = 0;
     }
   if (XCODING_SYSTEM_METHODS (str->codesys)->coding_data_size)
@@ -2609,10 +2602,10 @@
 {
   int i;
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   for (i = 0; i < XCODING_SYSTEM_CHAIN_COUNT (cs); i++)
     {
-      write_c_string (printcharfun, i == 0 ? "" : "->");
+      write_ascstring (printcharfun, i == 0 ? "" : "->");
       print_coding_system_in_print_method (XCODING_SYSTEM_CHAIN_CHAIN (cs)[i],
 					   printcharfun, escapeflag);
     }
@@ -2621,13 +2614,13 @@
     if (!NILP (cac))
       {
 	if (i > 0)
-	  write_c_string (printcharfun, " ");
-	write_c_string (printcharfun, "canonicalize-after-coding=");
+	  write_ascstring (printcharfun, " ");
+	write_ascstring (printcharfun, "canonicalize-after-coding=");
 	print_coding_system_in_print_method (cac, printcharfun, escapeflag);
       }
   }
 
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static void
@@ -2722,7 +2715,7 @@
 	  for (i = 0; i < data->lstream_count; i++)
 	    Lstream_delete (XLSTREAM ((data->lstreams)[i]));
 	}
-      xfree (data->lstreams, Lisp_Object *);
+      xfree (data->lstreams);
     }
 }
 
@@ -2736,7 +2729,7 @@
 chain_finalize (Lisp_Object c)
 {
   if (XCODING_SYSTEM_CHAIN_CHAIN (c))
-    xfree (XCODING_SYSTEM_CHAIN_CHAIN (c), Lisp_Object *);
+    xfree (XCODING_SYSTEM_CHAIN_CHAIN (c));
 }
 
 static int
@@ -3267,27 +3260,27 @@
     XCODING_SYSTEM_TYPE_DATA (cs, undecided);
   int need_space = 0;
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   if (data->do_eol)
     {
-      write_c_string (printcharfun, "do-eol");
+      write_ascstring (printcharfun, "do-eol");
       need_space = 1;
     }
   if (data->do_coding)
     {
       if (need_space)
-	write_c_string (printcharfun, " ");
-      write_c_string (printcharfun, "do-coding");
+	write_ascstring (printcharfun, " ");
+      write_ascstring (printcharfun, "do-coding");
       need_space = 1;
     }
   if (!NILP (data->cs))
     {
       if (need_space)
-	write_c_string (printcharfun, " ");
-      write_c_string (printcharfun, "coding-system=");
+	write_ascstring (printcharfun, " ");
+      write_ascstring (printcharfun, "coding-system=");
       print_coding_system_in_print_method (data->cs, printcharfun, escapeflag);
     }      
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static void
@@ -3363,7 +3356,7 @@
 	  (st);
     }
 
-  xfree (st, struct detection_state *);
+  xfree (st);
 }
 
 static int
@@ -3716,9 +3709,9 @@
   if (n > 0)
     {
       name[n] = '\0';
-      /* This call to intern_int() is OK because we already verified that
+      /* This call to intern_istring() is OK because we already verified that
 	 there are only ASCII characters in the string */
-      return find_coding_system_for_text_file (intern_int ((Ibyte *) name), 0);
+      return find_coding_system_for_text_file (intern_istring ((Ibyte *) name), 0);
     }
 
   return Qnil;
@@ -4309,12 +4302,12 @@
 {
   struct gzip_coding_system *data = XCODING_SYSTEM_TYPE_DATA (cs, gzip);
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   if (data->level == -1)
-    write_c_string (printcharfun, "default");
+    write_ascstring (printcharfun, "default");
   else
     print_internal (make_int (data->level), printcharfun, 0);
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 static int
@@ -4426,7 +4419,7 @@
 	  data->stream.avail_out = reserved;
 	  zerr = inflate (&data->stream, Z_NO_FLUSH);
 	  /* Lop off the unused portion */
-	  Dynarr_set_size (dst, Dynarr_length (dst) - data->stream.avail_out);
+	  Dynarr_set_length (dst, Dynarr_length (dst) - data->stream.avail_out);
 	  if (zerr != Z_OK)
 	    break;
 	}
@@ -4486,7 +4479,7 @@
 	    deflate (&data->stream,
 		     str->eof ? Z_FINISH : Z_NO_FLUSH);
 	  /* Lop off the unused portion */
-	  Dynarr_set_size (dst, Dynarr_length (dst) - data->stream.avail_out);
+	  Dynarr_set_length (dst, Dynarr_length (dst) - data->stream.avail_out);
 	  if (zerr != Z_OK)
 	    break;
 	}
@@ -4747,7 +4740,7 @@
   /* We always have file-coding support */
   Fprovide (intern ("file-coding"));
 
-  QScoding_system_cookie = build_string (";;;###coding system: ");
+  QScoding_system_cookie = build_ascstring (";;;###coding system: ");
   staticpro (&QScoding_system_cookie);
 
 #ifdef HAVE_DEFAULT_EOL_DETECTION
@@ -4835,12 +4828,12 @@
 {
   Fmake_coding_system_internal
     (Qconvert_eol_cr, Qconvert_eol,
-     build_msg_string ("Convert CR to LF"),
+     build_defer_string ("Convert CR to LF"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Converts CR (used to mark the end of a line on Macintosh systems) to LF\n"
 "(used internally and under Unix to mark the end of a line)."),
-		    Qmnemonic, build_string ("CR->LF"),
+		    Qmnemonic, build_ascstring ("CR->LF"),
 		    Qsubtype, Qcr),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
@@ -4850,11 +4843,11 @@
 
   Fmake_coding_system_internal
     (Qconvert_eol_lf, Qconvert_eol,
-     build_msg_string ("Convert LF to LF (do nothing)"),
+     build_defer_string ("Convert LF to LF (do nothing)"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Do nothing."),
-		    Qmnemonic, build_string ("LF->LF"),
+		    Qmnemonic, build_ascstring ("LF->LF"),
 		    Qsubtype, Qlf),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
@@ -4864,12 +4857,12 @@
 
   Fmake_coding_system_internal
     (Qconvert_eol_crlf, Qconvert_eol,
-     build_msg_string ("Convert CRLF to LF"),
+     build_defer_string ("Convert CRLF to LF"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Converts CR+LF (used to mark the end of a line on Macintosh systems) to LF\n"
 "(used internally and under Unix to mark the end of a line)."),
-		    Qmnemonic, build_string ("CRLF->LF"),
+		    Qmnemonic, build_ascstring ("CRLF->LF"),
 		    Qsubtype, Qcrlf),
 
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
@@ -4880,11 +4873,11 @@
 
   Fmake_coding_system_internal
     (Qconvert_eol_autodetect, Qconvert_eol,
-     build_msg_string ("Autodetect EOL type"),
+     build_defer_string ("Autodetect EOL type"),
      nconc2 (list6 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Autodetect the end-of-line type."),
-		    Qmnemonic, build_string ("Auto-EOL"),
+		    Qmnemonic, build_ascstring ("Auto-EOL"),
 		    Qsubtype, Qnil),
 	     /* VERY IMPORTANT!  Tell make-coding-system not to generate
 		subsidiaries -- it needs the coding systems we're creating
@@ -4894,11 +4887,11 @@
 
   Fmake_coding_system_internal
     (Qundecided, Qundecided,
-     build_msg_string ("Undecided (auto-detect)"),
+     build_defer_string ("Undecided (auto-detect)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list6 (Qdo_eol, Qt, Qdo_coding, Qt,
 		    /* We do EOL detection ourselves so we don't need to be
 		       wrapped in an EOL detector. (It doesn't actually hurt,
@@ -4907,43 +4900,43 @@
 
   Fmake_coding_system_internal
     (intern ("undecided-dos"), Qundecided,
-     build_msg_string ("Undecided (auto-detect) (CRLF)"),
+     build_defer_string ("Undecided (auto-detect) (CRLF)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding; EOL type of CRLF forced."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list4 (Qdo_coding, Qt,
 		    Qeol_type, Qcrlf)));
 
   Fmake_coding_system_internal
     (intern ("undecided-unix"), Qundecided,
-     build_msg_string ("Undecided (auto-detect) (LF)"),
+     build_defer_string ("Undecided (auto-detect) (LF)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding; EOL type of LF forced."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list4 (Qdo_coding, Qt,
 		    Qeol_type, Qlf)));
 
   Fmake_coding_system_internal
     (intern ("undecided-mac"), Qundecided,
-     build_msg_string ("Undecided (auto-detect) (CR)"),
+     build_defer_string ("Undecided (auto-detect) (CR)"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string
+		    build_defer_string
 		    ("Automatically detects the correct encoding; EOL type of CR forced."),
-		    Qmnemonic, build_string ("Auto")),
+		    Qmnemonic, build_ascstring ("Auto")),
 	     list4 (Qdo_coding, Qt,
 		    Qeol_type, Qcr)));
 
   /* Need to create this here or we're really screwed. */
   Fmake_coding_system_internal
     (Qraw_text, Qno_conversion,
-     build_msg_string ("Raw Text"),
+     build_defer_string ("Raw Text"),
      nconc2 (list4 (Qdocumentation,
-                    build_msg_string ("Raw text converts only line-break "
+                    build_defer_string ("Raw text converts only line-break "
                                       "codes, and acts otherwise like "
                                       "`binary'."),
-                    Qmnemonic, build_string ("Raw")),
+                    Qmnemonic, build_ascstring ("Raw")),
 #ifdef MULE
              list2 (Qsafe_charsets, list3 (Vcharset_ascii, Vcharset_control_1,
                                            Vcharset_latin_iso8859_1))));
@@ -4954,9 +4947,9 @@
 
   Fmake_coding_system_internal
     (Qbinary, Qno_conversion,
-     build_msg_string ("Binary"),
+     build_defer_string ("Binary"),
      nconc2 (list6 (Qdocumentation,
-                    build_msg_string (
+                    build_defer_string (
 "This coding system is as close as it comes to doing no conversion.\n"
 "On input, each byte is converted directly into the character\n"
 "with the corresponding code -- i.e. from the `ascii', `control-1',\n"
@@ -4964,7 +4957,7 @@
 "converted back to the corresponding bytes, and other characters\n"
 "are converted to the default character, i.e. `~'."),
                     Qeol_type, Qlf,
-                    Qmnemonic, build_string ("Binary")),
+                    Qmnemonic, build_ascstring ("Binary")),
 #ifdef MULE
              list2 (Qsafe_charsets, list3 (Vcharset_ascii, Vcharset_control_1,
                                            Vcharset_latin_iso8859_1))));
--- a/src/fileio.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/fileio.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* File IO for XEmacs.
    Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc.
-   Copyright (C) 1996, 2001, 2002, 2003, 2004 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2003, 2004, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -138,36 +138,19 @@
 
 EXFUN (Frunning_temacs_p, 0);
 
-/* DATA can be anything acceptable to signal_error ().
- */
-
-DOESNT_RETURN
-report_file_type_error (Lisp_Object errtype, Lisp_Object oserrmess,
-			const CIbyte *string, Lisp_Object data)
-{
-  struct gcpro gcpro1;
-  Lisp_Object errdata = build_error_data (NULL, data);
-
-  GCPRO1 (errdata);
-  errdata = Fcons (build_msg_string (string),
-		   Fcons (oserrmess, errdata));
-  signal_error_1 (errtype, errdata);
-  /* UNGCPRO; not reached */
-}
-
 DOESNT_RETURN
 report_error_with_errno (Lisp_Object errtype,
-			 const CIbyte *string, Lisp_Object data)
+			 const Ascbyte *reason, Lisp_Object data)
 {
-  report_file_type_error (errtype, lisp_strerror (errno), string, data);
+  signal_error_2 (errtype, reason, lisp_strerror (errno), data);
 }
 
 /* signal a file error when errno contains a meaningful value. */
 
 DOESNT_RETURN
-report_file_error (const CIbyte *string, Lisp_Object data)
+report_file_error (const Ascbyte *reason, Lisp_Object data)
 {
-  report_error_with_errno (Qfile_error, string, data);
+  report_error_with_errno (Qfile_error, reason, data);
 }
 
 
@@ -182,9 +165,9 @@
     {
       Ibyte ffff[99];
       qxesprintf (ffff, "Unknown error %d", errnum);
-      return build_intstring (ffff);
+      return build_istring (ffff);
     }
-  return build_ext_string (ret, Qstrerror_encoding);
+  return build_extstring (ret, Qstrerror_encoding);
 }
 
 static Lisp_Object
@@ -416,7 +399,7 @@
 	  return Qnil;
 	}
       if (wd)
-	xfree (wd, Ibyte *);
+	xfree (wd);
     }
 
 #if 0 /* No! This screws up efs, which calls file-name-directory on URL's
@@ -429,7 +412,7 @@
     qxestrncpy (newbeg, beg, len);
     newbeg[len] = '\0';
     newbeg = mswindows_canonicalize_filename (newbeg);
-    return build_intstring (newbeg);
+    return build_istring (newbeg);
   }
 #endif
 #endif /* not WIN32_NATIVE */
@@ -549,7 +532,7 @@
   buf = alloca_ibytes (XSTRING_LENGTH (filename) + 10);
   file_name_as_directory (buf, XSTRING_DATA (filename));
   if (qxestrcmp (buf, XSTRING_DATA (filename)))
-    return build_intstring (buf);
+    return build_istring (buf);
   else
     return filename;
 }
@@ -606,7 +589,7 @@
     return call2_check_string (handler, Qdirectory_file_name, directory);
   buf = alloca_ibytes (XSTRING_LENGTH (directory) + 20);
   directory_file_name (XSTRING_DATA (directory), buf);
-  return build_intstring (buf);
+  return build_istring (buf);
 }
 
 /* Fmake_temp_name used to be a simple wrapper around mktemp(), but it
@@ -635,7 +618,7 @@
 */
        (prefix))
 {
-  static const char tbl[64] =
+  static const Ascbyte tbl[64] =
   {
     'A','B','C','D','E','F','G','H',
     'I','J','K','L','M','N','O','P',
@@ -787,7 +770,7 @@
   if (NILP (default_directory))
     default_directory = current_buffer->directory;
   if (! STRINGP (default_directory))
-    default_directory = build_string (DEFAULT_DIRECTORY_FALLBACK);
+    default_directory = build_ascstring (DEFAULT_DIRECTORY_FALLBACK);
 
   if (!NILP (default_directory))
     {
@@ -946,7 +929,7 @@
 		{
 		  newnm = mswindows_canonicalize_filename (nm);
 		  if (qxestrcmp (newnm, XSTRING_DATA (name)) != 0)
-		    name = build_intstring (newnm);
+		    name = build_istring (newnm);
 		}
 	      else
 		{
@@ -954,12 +937,12 @@
 		  newnm = mswindows_canonicalize_filename (nm - 2);
 		  if (qxestrcmp (newnm, XSTRING_DATA (name)) != 0)
 		    {
-		      name = build_intstring (newnm);
+		      name = build_istring (newnm);
 		      XSTRING_DATA (name)[0] = DRIVE_LETTER (drive);
 		      XSTRING_DATA (name)[1] = ':';
 		    }
 		}
-	      xfree (newnm, Ibyte *);
+	      xfree (newnm);
 	      RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, name);
 	    }
 #endif /* WIN32_FILENAMES */
@@ -967,7 +950,7 @@
 	  if (nm == XSTRING_DATA (name))
 	    RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, name);
 	  RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name,
-					 build_intstring (nm));
+					 build_istring (nm));
 #endif /* not WIN32_NATIVE */
 	}
     }
@@ -1072,7 +1055,7 @@
 	  if (newcwd)
 	    {
 	      IBYTE_STRING_TO_ALLOCA (newcwd, newdir);
-	      xfree (newcwd, Ibyte *);
+	      xfree (newcwd);
 	    }
 	  else
 	    newdir = NULL;
@@ -1158,7 +1141,7 @@
 	      if (newcwd)
 		{
 		  IBYTE_STRING_TO_ALLOCA (newcwd, newdir);
-		  xfree (newcwd, Ibyte *);
+		  xfree (newcwd);
 		}
 	      else
 #endif
@@ -1332,8 +1315,8 @@
 
   {
     Ibyte *newtarget = mswindows_canonicalize_filename (target);
-    Lisp_Object result = build_intstring (newtarget);
-    xfree (newtarget, Ibyte *);
+    Lisp_Object result = build_istring (newtarget);
+    xfree (newtarget);
 
     RETURN_UNGCPRO_EXIT_PROFILING (QSin_expand_file_name, result);
   }
@@ -1388,7 +1371,7 @@
        detect that c:/windows == /windows for example. */
     if (! (IS_DIRECTORY_SEP (path[0]) && IS_DIRECTORY_SEP (path[1])))
       {
-	LOCAL_TO_WIN32_FILE_FORMAT (path, p);
+	LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, p);
 	path = p;
       }
 #endif
@@ -1761,7 +1744,7 @@
    If the file does not exist, STATPTR->st_mode is set to 0.  */
 
 static void
-barf_or_query_if_file_exists (Lisp_Object absname, const CIbyte *querystring,
+barf_or_query_if_file_exists (Lisp_Object absname, const Ascbyte *querystring,
 			      int interactive, struct stat *statptr)
 {
   /* This function can call Lisp.  GC checked 2000-07-28 ben */
@@ -1780,8 +1763,8 @@
 
 	  prompt =
 	    emacs_sprintf_string
-	      (CGETTEXT ("File %s already exists; %s anyway? "),
-	       XSTRING_DATA (absname), CGETTEXT (querystring));
+	      (GETTEXT ("File %s already exists; %s anyway? "),
+	       XSTRING_DATA (absname), GETTEXT (querystring));
 
 	  GCPRO1 (prompt);
 	  tem = call1 (Qyes_or_no_p, prompt);
@@ -1820,7 +1803,7 @@
 {
   /* This function can call Lisp.  GC checked 2000-07-28 ben */
   int ifd, ofd, n;
-  char buf[16 * 1024];
+  Rawbyte buf[16 * 1024];
   struct stat st, out_st;
   Lisp_Object handler;
   int speccount = specpdl_depth ();
@@ -2103,7 +2086,7 @@
       NGCPRO1 (*args);
       ngcpro1.nvars = 3;
       if (string_byte (newname, XSTRING_LENGTH (newname) - 1) != '/')
-	args[i++] = build_string ("/");
+	args[i++] = build_ascstring ("/");
       args[i++] = Ffile_name_nondirectory (filename);
       newname = Fconcat (i, args);
       NUNGCPRO;
@@ -2270,8 +2253,8 @@
   /* netunam, being a strange-o system call only used once, is not
      encapsulated. */
 
-  LISP_STRING_TO_EXTERNAL (path, path_ext, Qfile_name);
-  LISP_STRING_TO_EXTERNAL (login, login_ext, Qnative);
+  LISP_PATHNAME_CONVERT_OUT (path, path_ext);
+  login_ext = LISP_STRING_TO_EXTERNAL (login, Quser_name_encoding);
 
   netresult = netunam (path_ext, login_ext);
 
@@ -2324,82 +2307,73 @@
 static int
 check_writable (const Ibyte *filename)
 {
-#if defined(WIN32_NATIVE) || defined(CYGWIN)
-#ifdef CYGWIN
-    Extbyte filename_buffer[PATH_MAX];
-#endif
-	// Since this has to work for a directory, we can't just call 'CreateFile'
-	PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
-	/* these need not be freed, they point into pDesc */
-	PSID psidOwner;
-	PSID psidGroup;
-	PACL pDacl;
-	PACL pSacl;
-	/* end of insides of descriptor */
-	DWORD error;
-	DWORD attributes;
-	HANDLE tokenHandle;
-	GENERIC_MAPPING genericMapping;
-	DWORD accessMask;
-	PRIVILEGE_SET PrivilegeSet;
-    DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
-    BOOL fAccessGranted = FALSE;
-    DWORD dwAccessAllowed;
-    Extbyte *fnameext;
-
-    C_STRING_TO_TSTR(filename, fnameext);
-
-#ifdef CYGWIN
-    cygwin_conv_to_full_win32_path(fnameext, filename_buffer);
-    fnameext = filename_buffer;
-#endif
-
-    // First check for a normal file with the old-style readonly bit
+#ifdef WIN32_ANY
+  // Since this has to work for a directory, we can't just call 'CreateFile'
+  PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
+  /* these need not be freed, they point into pDesc */
+  PSID psidOwner;
+  PSID psidGroup;
+  PACL pDacl;
+  PACL pSacl;
+  /* end of insides of descriptor */
+  DWORD error;
+  DWORD attributes;
+  HANDLE tokenHandle;
+  GENERIC_MAPPING genericMapping;
+  DWORD accessMask;
+  PRIVILEGE_SET PrivilegeSet;
+  DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
+  BOOL fAccessGranted = FALSE;
+  DWORD dwAccessAllowed;
+  Extbyte *fnameext;
+
+  LOCAL_FILE_FORMAT_TO_TSTR (filename, fnameext);
+
+  // First check for a normal file with the old-style readonly bit
+  attributes = qxeGetFileAttributes(fnameext);
+  if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
+    return 0;
+
+  /* Win32 prototype lacks const. */
+  error = qxeGetNamedSecurityInfo(fnameext, SE_FILE_OBJECT, 
+				  DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
+				  &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
+  if(error != ERROR_SUCCESS) { // FAT?
     attributes = qxeGetFileAttributes(fnameext);
-    if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY)))
+    return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
+  }
+
+  genericMapping.GenericRead = FILE_GENERIC_READ;
+  genericMapping.GenericWrite = FILE_GENERIC_WRITE;
+  genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
+  genericMapping.GenericAll = FILE_ALL_ACCESS;
+
+  if(!ImpersonateSelf(SecurityDelegation)) {
+    return 0;
+  }
+  if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) {
+    return 0;
+  }
+
+  accessMask = GENERIC_WRITE;
+  MapGenericMask(&accessMask, &genericMapping);
+
+  if(!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
+		  &PrivilegeSet,       // receives privileges used in check
+		  &dwPrivSetSize,      // size of PrivilegeSet buffer
+		  &dwAccessAllowed,    // receives mask of allowed access rights
+		  &fAccessGranted)) 
+    {
+      CloseHandle(tokenHandle);
+      RevertToSelf();
+      LocalFree(pDesc);
       return 0;
-
-	/* Win32 prototype lacks const. */
-	error = qxeGetNamedSecurityInfo(fnameext, SE_FILE_OBJECT, 
-                                    DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
-                                    &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
-	if(error != ERROR_SUCCESS) { // FAT?
-		attributes = qxeGetFileAttributes(fnameext);
-		return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
-	}
-
-	genericMapping.GenericRead = FILE_GENERIC_READ;
-    genericMapping.GenericWrite = FILE_GENERIC_WRITE;
-    genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
-    genericMapping.GenericAll = FILE_ALL_ACCESS;
-
-	if(!ImpersonateSelf(SecurityDelegation)) {
-		return 0;
-	}
-	if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) {
-		return 0;
-	}
-
-	accessMask = GENERIC_WRITE;
-	MapGenericMask(&accessMask, &genericMapping);
-
-	if(!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
-					&PrivilegeSet,       // receives privileges used in check
-					&dwPrivSetSize,      // size of PrivilegeSet buffer
-					&dwAccessAllowed,    // receives mask of allowed access rights
-					&fAccessGranted)) 
-	{
-		CloseHandle(tokenHandle);
-		RevertToSelf();
-		LocalFree(pDesc);
-		return 0;
-	}
-	CloseHandle(tokenHandle);
-	RevertToSelf();
-	LocalFree(pDesc);
-	return fAccessGranted == TRUE;
-#else
-#ifdef HAVE_EACCESS
+    }
+  CloseHandle(tokenHandle);
+  RevertToSelf();
+  LocalFree(pDesc);
+  return fAccessGranted == TRUE;
+#elif defined (HAVE_EACCESS)
   return (qxe_eaccess (filename, W_OK) >= 0);
 #else
   /* Access isn't quite right because it uses the real uid
@@ -2408,8 +2382,7 @@
      Opening with O_WRONLY could work for an ordinary file,
      but would lose for directories.  */
   return (qxe_access (filename, W_OK) >= 0);
-#endif
-#endif
+#endif /* (not) defined (HAVE_EACCESS) */
 }
 
 DEFUN ("file-exists-p", Ffile_exists_p, 1, 1, 0, /*
@@ -2579,16 +2552,16 @@
 			      buf, bufsize);
       if (valsize < bufsize) break;
       /* Buffer was not long enough */
-      xfree (buf, Ibyte *);
+      xfree (buf);
       bufsize *= 2;
     }
   if (valsize == -1)
     {
-      xfree (buf, Ibyte *);
+      xfree (buf);
       return Qnil;
     }
   val = make_string (buf, valsize);
-  xfree (buf, Ibyte *);
+  xfree (buf);
   return val;
 #elif defined (WIN32_NATIVE)
   if (mswindows_shortcuts_are_symlinks)
@@ -2617,8 +2590,8 @@
       if (!fname)
 	return Qnil;
       {
-	Lisp_Object val = build_intstring (fname);
-	xfree (fname, Ibyte *);
+	Lisp_Object val = build_istring (fname);
+	xfree (fname);
 	return val;
       }
     }
@@ -3072,7 +3045,7 @@
 			     !NILP (visit) ? INSDEL_NO_LOCKING : 0);
       else
 	{
-	  char buffer[1 << 14];
+	  Rawbyte buffer[1 << 14];
 	  Charbpos same_at_start = BUF_BEGV (buf);
 	  Charbpos same_at_end = BUF_ZV (buf);
 	  int overlap;
@@ -3295,10 +3268,10 @@
     }
 
   /* Decode file format */
-  if (inserted > 0)
+  if (inserted > 0 && !UNBOUNDP (XSYMBOL_FUNCTION (Qformat_decode)))
     {
-      Lisp_Object insval = call3 (Qformat_decode,
-                                  Qnil, make_int (inserted), visit);
+      Lisp_Object insval = call3 (Qformat_decode, Qnil, make_int (inserted),
+				  visit);
       CHECK_INT (insval);
       inserted = XINT (insval);
     }
@@ -3655,33 +3628,6 @@
   return Qnil;
 }
 
-/* #### This is such a load of shit!!!!  There is no way we should define
-   something so stupid as a subr, just sort the fucking list more
-   intelligently. */
-DEFUN ("car-less-than-car", Fcar_less_than_car, 2, 2, 0, /*
-Return t if (car A) is numerically less than (car B).
-*/
-       (a, b))
-{
-  Lisp_Object objs[2];
-  objs[0] = Fcar (a);
-  objs[1] = Fcar (b);
-  return Flss (2, objs);
-}
-
-/* Heh heh heh, let's define this too, just to aggravate the person who
-   wrote the above comment. */
-DEFUN ("cdr-less-than-cdr", Fcdr_less_than_cdr, 2, 2, 0, /*
-Return t if (cdr A) is numerically less than (cdr B).
-*/
-       (a, b))
-{
-  Lisp_Object objs[2];
-  objs[0] = Fcdr (a);
-  objs[1] = Fcdr (b);
-  return Flss (2, objs);
-}
-
 /* Build the complete list of annotations appropriate for writing out
    the text between START and END, by calling all the functions in
    write-region-annotate-functions and merging the lists they return.
@@ -3725,10 +3671,19 @@
     }
 
   /* Now do the same for annotation functions implied by the file-format */
-  if (auto_saving && (!EQ (Vauto_save_file_format, Qt)))
-    p = Vauto_save_file_format;
+  if (UNBOUNDP (XSYMBOL_FUNCTION (Qformat_annotate_function)))
+    {
+      p = Qnil;
+    }
+  else if (auto_saving && (!EQ (Vauto_save_file_format, Qt)))
+    {
+      p = Vauto_save_file_format;
+    }
   else
-    p = current_buffer->file_format;
+    {
+      p = current_buffer->file_format;
+    }
+
   while (!NILP (p))
     {
       struct buffer *given_buffer = current_buffer;
@@ -3745,6 +3700,7 @@
       annotations = merge (annotations, res, Qcar_less_than_car);
       p = Fcdr (p);
     }
+
   UNGCPRO;
   return annotations;
 }
@@ -3770,7 +3726,7 @@
 {
   Lisp_Object tem;
   int nextpos;
-  unsigned char largebuf[A_WRITE_BATCH_SIZE];
+  Ibyte largebuf[A_WRITE_BATCH_SIZE];
   Lstream *instr = XLSTREAM (instream);
   Lstream *outstr = XLSTREAM (outstream);
 
@@ -3868,7 +3824,7 @@
 
   ecb_crypt (raw_key, encrypted_string, rounded_size,
 	     DES_ENCRYPT | DES_SW);
-  return make_ext_string (encrypted_string, rounded_size, Qbinary);
+  return make_extstring (encrypted_string, rounded_size, Qbinary);
 }
 
 DEFUN ("decrypt-string", Fdecrypt_string, 2, 2, 0, /*
@@ -3899,7 +3855,7 @@
 
 
   ecb_crypt (raw_key, decrypted_string, string_size, D | DES_SW);
-  return make_ext_string (decrypted_string, string_size - 1, Qbinary);
+  return make_extstring (decrypted_string, string_size - 1, Qbinary);
 }
 #endif /* 0 */
 
@@ -4259,19 +4215,19 @@
 		  const Extbyte *auto_save_file_name_ext;
 		  Bytecount auto_save_file_name_ext_len;
 
-		  TO_EXTERNAL_FORMAT (LISP_STRING, b->auto_save_file_name,
-				      ALLOCA, (auto_save_file_name_ext,
-					       auto_save_file_name_ext_len),
-				      Qescape_quoted);
+		  LISP_STRING_TO_SIZED_EXTERNAL (b->auto_save_file_name,
+						 auto_save_file_name_ext,
+						 auto_save_file_name_ext_len,
+						 Qescape_quoted);
 		  if (!NILP (b->filename))
 		    {
 		      const Extbyte *filename_ext;
 		      Bytecount filename_ext_len;
 
-		      TO_EXTERNAL_FORMAT (LISP_STRING, b->filename,
-					  ALLOCA, (filename_ext,
-						   filename_ext_len),
-					  Qescape_quoted);
+		      LISP_STRING_TO_SIZED_EXTERNAL (b->filename,
+						     filename_ext,
+						     filename_ext_len,
+						     Qescape_quoted);
 		      retry_write (listdesc, filename_ext, filename_ext_len);
 		    }
 		  retry_write (listdesc, "\n", 1);
@@ -4466,8 +4422,6 @@
   DEFSUBR (Ffile_newer_than_file_p);
   DEFSUBR (Finsert_file_contents_internal);
   DEFSUBR (Fwrite_region_internal);
-  DEFSUBR (Fcar_less_than_car); /* Vomitous! */
-  DEFSUBR (Fcdr_less_than_cdr); /* Yeah oh yeah bucko .... */
 #if 0
   DEFSUBR (Fencrypt_string);
   DEFSUBR (Fdecrypt_string);
@@ -4487,7 +4441,7 @@
 vars_of_fileio (void)
 {
   QSin_expand_file_name =
-    build_msg_string ("(in expand-file-name)");
+    build_defer_string ("(in expand-file-name)");
   staticpro (&QSin_expand_file_name);
 
   DEFVAR_LISP ("auto-save-file-format", &Vauto_save_file_format /*
@@ -4573,7 +4527,7 @@
 Emacs's pid and the system name will be appended to
 this prefix to create a unique file name.
 */ );
-  Vauto_save_list_file_prefix = build_string ("~/.saves-");
+  Vauto_save_list_file_prefix = build_ascstring ("~/.saves-");
 
   DEFVAR_BOOL ("inhibit-auto-save-session", &inhibit_auto_save_session /*
 When non-nil, inhibit auto save list file creation.
--- a/src/filelock.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/filelock.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,5 @@
 /* Copyright (C) 1985, 86, 87, 93, 94, 96 Free Software Foundation, Inc.
-   Copyright (C) 2001 Ben Wing.
+   Copyright (C) 2001, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -38,7 +38,7 @@
 
 #ifdef CLASH_DETECTION
 
-/* The strategy: to lock a file FN, create a symlink .#FN in FN's
+/* The strategy: to lock a file FN, create a symlink .#FN# in FN's
    directory, with link data `user@host.pid'.  This avoids a single
    mount (== failure) point for lock files.
 
@@ -67,12 +67,18 @@
    file names, because those are all the same systems that don't have
    symlinks.
 
-   This is compatible with the locking scheme used by Interleaf (which
-   has contributed this implementation for Emacs), and was designed by
-   Ethan Jacobson, Kimbo Mundy, and others.
+   Originally we used a name .#FN without the final #; this may have been
+   compatible with the locking scheme used by Interleaf (which has
+   contributed this implementation for Emacs), and was designed by Ethan
+   Jacobson, Kimbo Mundy, and others.
 
    --karl@cs.umb.edu/karl@hq.ileaf.com.  */
 
+/* NOTE:  We added the final # in the name .#FN# so that programs
+   that e.g. search for all .c files, such as etags, or try to
+   byte-compile all .el files in a directory (byte-recompile-directory),
+   won't get tripped up by the bogus symlink file. --ben */
+
 
 /* Here is the structure that stores information about a lock.  */
 
@@ -89,14 +95,15 @@
 
 /* Free the two dynamically-allocated pieces in PTR.  */
 #define FREE_LOCK_INFO(i) do {			\
-    xfree ((i).user, Ibyte *);			\
-    xfree ((i).host, Ibyte *);			\
+    xfree ((i).user);			\
+    xfree ((i).host);			\
   } while (0)
 
-/* Write the name of the lock file for FN into LFNAME.  Length will be
-   that of FN plus two more for the leading `.#' plus one for the null.  */
+/* Write the name of the lock file for FN into LFNAME.  Length will be that
+   of FN plus two more for the leading `.#' plus one for the trailing #
+   plus one for the null.  */
 #define MAKE_LOCK_NAME(lock, file) \
-  (lock = alloca_ibytes (XSTRING_LENGTH (file) + 2 + 1), \
+  (lock = alloca_ibytes (XSTRING_LENGTH (file) + 2 + 1 + 1), \
    fill_in_lock_file_name (lock, file))
 
 static void
@@ -116,7 +123,10 @@
   p = lockfile + dirlen;
   *(p++) = '.';
   *(p++) = '#';
-  memcpy (p, file_name + dirlen, XSTRING_LENGTH (fn) - dirlen + 1);
+  memcpy (p, file_name + dirlen, XSTRING_LENGTH (fn) - dirlen);
+  p += XSTRING_LENGTH (fn) - dirlen;
+  *(p++) = '#';
+  *p = '\0';
 }
 
 /* Lock the lock file named LFNAME.
@@ -183,7 +193,7 @@
   /* If nonexistent lock file, all is well; otherwise, got strange error. */
   if (len == -1)
     {
-      xfree (lfinfo, Ibyte *);
+      xfree (lfinfo);
       return errno == ENOENT ? 0 : -1;
     }
 
@@ -203,7 +213,7 @@
   at = qxestrchr (lfinfo, '@');
   dot = qxestrrchr (lfinfo, '.');
   if (!at || !dot) {
-    xfree (lfinfo, Ibyte *);
+    xfree (lfinfo);
     return -1;
   }
   len = at - lfinfo;
@@ -221,7 +231,7 @@
   owner->host[len] = 0;
 
   /* We're done looking at the link info.  */
-  xfree (lfinfo, Ibyte *);
+  xfree (lfinfo);
 
   /* On current host?  */
   if (STRINGP (Fsystem_name ())
@@ -358,7 +368,7 @@
 
   attack = call2_in_buffer (BUFFERP (subject_buf) ? XBUFFER (subject_buf) :
 			    current_buffer, Qask_user_about_lock , fn,
-			    build_intstring (locker));
+			    build_istring (locker));
   if (!NILP (attack) && current_buffer == XBUFFER (old_current_buffer))
     /* User says take the lock */
     {
@@ -474,7 +484,7 @@
   else if (owner == 2)
     ret = Qt;
   else
-    ret = build_intstring (locker.user);
+    ret = build_istring (locker.user);
 
   if (owner > 0)
     FREE_LOCK_INFO (locker);
--- a/src/floatfns.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/floatfns.c	Wed Feb 24 01:58:04 2010 -0600
@@ -26,7 +26,6 @@
 
    Define HAVE_INVERSE_HYPERBOLIC if you have acosh, asinh, and atanh.
    Define HAVE_CBRT if you have cbrt().
-   Define HAVE_RINT if you have rint().
    If you don't define these, then the appropriate routines will be simulated.
 
    Define HAVE_MATHERR if on a system supporting the SysV matherr() callback.
@@ -50,11 +49,8 @@
 #include "syssignal.h"
 #include "sysfloat.h"
 
-/* The code uses emacs_rint, so that it works to undefine HAVE_RINT
-   if `rint' exists but does not work right.  */
-#ifdef HAVE_RINT
-#define emacs_rint rint
-#else
+/* An implementation of rint that always rounds towards the even number in
+   the case of ambiguity. */
 static double
 emacs_rint (double x)
 {
@@ -65,7 +61,6 @@
     r += r < x ? 1.0 : -1.0;
   return r;
 }
-#endif
 
 /* Nonzero while executing in floating point.
    This tells float_error what to do.  */
@@ -181,7 +176,8 @@
 }
 
 static int
-float_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+float_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	     int UNUSED (foldcase))
 {
   return (extract_float (obj1) == extract_float (obj2));
 }
@@ -1760,8 +1756,19 @@
   Lisp_Object res0;
   unsigned long prec = bigfloat_get_prec (number);
 
+#if 0
+  /* This causes the following GCC warning:
+
+  /xemacs/latest-fix/src/floatfns.c:1764: warning: dereferencing type-punned pointer will break strict-aliasing rules
+
+     and furthermore, it's a useless assert, since `number' is stored on
+     the stack and so its address can never be the same as `scratch_bigfloat'
+     or `scratch_bigfloat2', which are stored in the data segment.
+
+  -- ben */
   assert ((bigfloat *)(&number) != (bigfloat *)&scratch_bigfloat
 	  && (bigfloat *)(&number) != (bigfloat *)(&scratch_bigfloat2));
+#endif
 
   bigfloat_set_prec (scratch_bigfloat, prec);
   bigfloat_set_prec (scratch_bigfloat2, prec);
@@ -2446,7 +2453,7 @@
 
   /* if (!strcmp (x->name, "pow")) x->name = "expt"; */
 
-  args = Fcons (build_string (x->name),
+  args = Fcons (build_extstring (x->name, Qerror_message_encoding),
                 Fcons (make_float (x->arg1),
                        ((in_float == 2)
                         ? Fcons (make_float (x->arg2), Qnil)
--- a/src/fns.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/fns.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Random utility Lisp functions.
    Copyright (C) 1985, 86, 87, 93, 94, 95 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -56,6 +56,7 @@
 
 Lisp_Object Qstring_lessp;
 Lisp_Object Qidentity;
+Lisp_Object Qvector, Qarray, Qbit_vector;
 
 Lisp_Object Qbase64_conversion_error;
 
@@ -81,21 +82,22 @@
 
   if (INTP (Vprint_length))
     last = min (len, XINT (Vprint_length));
-  write_c_string (printcharfun, "#*");
+  write_ascstring (printcharfun, "#*");
   for (i = 0; i < last; i++)
     {
       if (bit_vector_bit (v, i))
-	write_c_string (printcharfun, "1");
+	write_ascstring (printcharfun, "1");
       else
-	write_c_string (printcharfun, "0");
+	write_ascstring (printcharfun, "0");
     }
 
   if (last != len)
-    write_c_string (printcharfun, "...");
+    write_ascstring (printcharfun, "...");
 }
 
 static int
-bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+bit_vector_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+		  int UNUSED (foldcase))
 {
   Lisp_Bit_Vector *v1 = XBIT_VECTOR (obj1);
   Lisp_Bit_Vector *v2 = XBIT_VECTOR (obj2);
@@ -216,7 +218,7 @@
 #endif /* LOSING_BYTECODE */
 
 void
-check_losing_bytecode (const char *function, Lisp_Object seq)
+check_losing_bytecode (const Ascbyte *function, Lisp_Object seq)
 {
   if (COMPILED_FUNCTIONP (seq))
     signal_ferror_with_frob
@@ -314,9 +316,12 @@
 Compare the contents of two strings, maybe ignoring case.
 In string STR1, skip the first START1 characters and stop at END1.
 In string STR2, skip the first START2 characters and stop at END2.
-END1 and END2 default to the full lengths of the respective strings.
-
-Case is significant in this comparison if IGNORE-CASE is nil.
+END1 and END2 default to the full lengths of the respective strings,
+and arguments that are outside the string (negative STARTi or ENDi
+greater than length) are coerced to 0 or string length as appropriate.
+
+Optional IGNORE-CASE non-nil means use case-insensitive comparison.
+Case is significant by default.
 
 The value is t if the strings (or specified portions) match.
 If string STR1 is less, the value is a negative number N;
@@ -334,9 +339,9 @@
   CHECK_STRING (str1);
   CHECK_STRING (str2);
   get_string_range_char (str1, start1, end1, &ccstart1, &ccend1,
-			 GB_HISTORICAL_STRING_BEHAVIOR);
+			 GB_HISTORICAL_STRING_BEHAVIOR|GB_COERCE_RANGE);
   get_string_range_char (str2, start2, end2, &ccstart2, &ccend2,
-			 GB_HISTORICAL_STRING_BEHAVIOR);
+			 GB_HISTORICAL_STRING_BEHAVIOR|GB_COERCE_RANGE);
 
   bstart1 = string_index_char_to_byte (str1, ccstart1);
   blen1 = string_offset_char_to_byte_len (str1, bstart1, ccend1 - ccstart1);
@@ -977,6 +982,8 @@
 {
   EMACS_INT len, s, e;
 
+  CHECK_SEQUENCE (sequence);
+
   if (STRINGP (sequence))
     return Fsubstring (sequence, start, end);
 
@@ -1038,38 +1045,136 @@
     }
   else
     {
-      ABORT (); /* unreachable, since Flength (sequence) did not get
-                   an error */
+      ABORT (); /* unreachable, since CHECK_SEQUENCE (sequence) did not
+                   error */
       return Qnil;
     }
 }
 
 /* Split STRING into a list of substrings.  The substrings are the
-   parts of original STRING separated by SEPCHAR.  */
+   parts of original STRING separated by SEPCHAR.
+
+   If UNESCAPE is non-zero, ESCAPECHAR specifies a character that will quote
+   SEPCHAR, and cause it not to split STRING. A double ESCAPECHAR is
+   necessary for ESCAPECHAR to appear once in a substring. */
+
 static Lisp_Object
 split_string_by_ichar_1 (const Ibyte *string, Bytecount size,
-			  Ichar sepchar)
+                         Ichar sepchar, int unescape, Ichar escapechar)
 {
   Lisp_Object result = Qnil;
   const Ibyte *end = string + size;
 
-  while (1)
+  if (unescape)
     {
-      const Ibyte *p = string;
-      while (p < end)
-	{
-	  if (itext_ichar (p) == sepchar)
-	    break;
-	  INC_IBYTEPTR (p);
-	}
-      result = Fcons (make_string (string, p - string), result);
-      if (p < end)
-	{
-	  string = p;
-	  INC_IBYTEPTR (string);	/* skip sepchar */
-	}
-      else
-	break;
+      Ibyte unescape_buffer[64], *unescape_buffer_ptr = unescape_buffer,
+        escaped[MAX_ICHAR_LEN], *unescape_cursor;
+      Bytecount unescape_buffer_size = countof (unescape_buffer),
+        escaped_len = set_itext_ichar (escaped, escapechar);
+      Boolint deleting_escapes, previous_escaped;
+      Ichar pchar;
+
+      while (1)
+        {
+          const Ibyte *p = string, *cursor;
+          deleting_escapes = 0;
+          previous_escaped = 0;
+
+          while (p < end)
+            {
+              pchar = itext_ichar (p);
+
+              if (pchar == sepchar)
+                {
+                  if (!previous_escaped)
+                    {
+                      break;
+                    }
+                }
+              else if (pchar == escapechar
+                       /* Doubled escapes don't escape: */
+                       && !previous_escaped)
+                {
+                  ++deleting_escapes;
+                  previous_escaped = 1;
+                }
+              else
+                {
+                  previous_escaped = 0;
+                }
+
+              INC_IBYTEPTR (p);
+            }
+
+          if (deleting_escapes)
+            {
+              if (((p - string) - (escaped_len * deleting_escapes))
+                  > unescape_buffer_size)
+                {
+                  unescape_buffer_size =
+                    ((p - string) - (escaped_len * deleting_escapes)) * 1.5;
+                  unescape_buffer_ptr = alloca_ibytes (unescape_buffer_size);
+                }
+
+              cursor = string;
+              unescape_cursor = unescape_buffer_ptr;
+              previous_escaped = 0;
+
+              while (cursor < p)
+                {
+                  pchar = itext_ichar (cursor);
+
+                  if (pchar != escapechar || previous_escaped)
+                    {
+                      memcpy (unescape_cursor, cursor,
+                              itext_ichar_len (cursor));
+                      INC_IBYTEPTR (unescape_cursor);
+                    }
+
+                  previous_escaped = !previous_escaped
+                    && (pchar == escapechar);
+
+                  INC_IBYTEPTR (cursor);
+                }
+
+              result = Fcons (make_string (unescape_buffer_ptr,
+                                           unescape_cursor
+                                           - unescape_buffer_ptr),
+                              result);
+            }
+          else
+            {
+              result = Fcons (make_string (string, p - string), result);
+            }
+          if (p < end)
+            {
+              string = p;
+              INC_IBYTEPTR (string);	/* skip sepchar */
+            }
+          else
+            break;
+        }
+    }
+  else
+    {
+      while (1)
+        {
+          const Ibyte *p = string;
+          while (p < end)
+            {
+              if (itext_ichar (p) == sepchar)
+                break;
+              INC_IBYTEPTR (p);
+            }
+          result = Fcons (make_string (string, p - string), result);
+          if (p < end)
+            {
+              string = p;
+              INC_IBYTEPTR (string);	/* skip sepchar */
+            }
+          else
+            break;
+        }
     }
   return Fnreverse (result);
 }
@@ -1094,7 +1199,7 @@
   if (!newlen)
     return Qnil;
 
-  return split_string_by_ichar_1 (newpath, newlen, SEPCHAR);
+  return split_string_by_ichar_1 (newpath, newlen, SEPCHAR, 0, 0);
 }
 
 Lisp_Object
@@ -1107,22 +1212,34 @@
     path = default_;
   if (!path)
     return Qnil;
-  return split_string_by_ichar_1 (path, qxestrlen (path), SEPCHAR);
+  return split_string_by_ichar_1 (path, qxestrlen (path), SEPCHAR, 0, 0);
 }
 
 /* Ben thinks this function should not exist or be exported to Lisp.
    We use it to define split-path-string in subr.el (not!).  */
 
-DEFUN ("split-string-by-char", Fsplit_string_by_char, 2, 2, 0, /*
+DEFUN ("split-string-by-char", Fsplit_string_by_char, 2, 3, 0, /*
 Split STRING into a list of substrings originally separated by SEPCHAR.
+
+With optional ESCAPE-CHAR, any instances of SEPCHAR preceded by that
+character will not split the string, and a double instance of ESCAPE-CHAR
+will be necessary for a single ESCAPE-CHAR to appear in the output string.
 */
-       (string, sepchar))
+       (string, sepchar, escape_char))
 {
+  Ichar escape_ichar = 0;
+
   CHECK_STRING (string);
   CHECK_CHAR (sepchar);
+  if (!NILP (escape_char))
+    {
+      CHECK_CHAR (escape_char);
+      escape_ichar = XCHAR (escape_char);
+    }
   return split_string_by_ichar_1 (XSTRING_DATA (string),
-				   XSTRING_LENGTH (string),
-				   XCHAR (sepchar));
+                                  XSTRING_LENGTH (string),
+                                  XCHAR (sepchar),
+                                  !NILP (escape_char), escape_ichar);
 }
 
 /* #### This was supposed to be in subr.el, but is used VERY early in
@@ -1146,7 +1263,7 @@
 
   return (split_string_by_ichar_1
 	  (XSTRING_DATA (path), XSTRING_LENGTH (path),
-	   itext_ichar (XSTRING_DATA (Vpath_separator))));
+	   itext_ichar (XSTRING_DATA (Vpath_separator)), 0, 0));
 }
 
 
@@ -1978,12 +2095,12 @@
  */
 int
 plists_differ (Lisp_Object a, Lisp_Object b, int nil_means_not_present,
-	       int laxp, int depth)
+	       int laxp, int depth, int foldcase)
 {
   int eqp = (depth == -1);	/* -1 as depth means use eq, not equal. */
   int la, lb, m, i, fill;
   Lisp_Object *keys, *vals;
-  char *flags;
+  Boolbyte *flags;
   Lisp_Object rest;
 
   if (NILP (a) && NILP (b))
@@ -1998,7 +2115,7 @@
   fill = 0;
   keys  = alloca_array (Lisp_Object, m);
   vals  = alloca_array (Lisp_Object, m);
-  flags = alloca_array (char, m);
+  flags = alloca_array (Boolbyte, m);
 
   /* First extract the pairs from A. */
   for (rest = a; !NILP (rest); rest = XCDR (XCDR (rest)))
@@ -2022,12 +2139,13 @@
       if (nil_means_not_present && NILP (v)) continue;
       for (i = 0; i < fill; i++)
 	{
-	  if (!laxp ? EQ (k, keys [i]) : internal_equal (k, keys [i], depth))
+	  if (!laxp ? EQ (k, keys [i]) :
+	      internal_equal_0 (k, keys [i], depth, foldcase))
 	    {
 	      if (eqp
 		  /* We narrowly escaped being Ebolified here. */
 		  ? !EQ_WITH_EBOLA_NOTICE (v, vals [i])
-		  : !internal_equal (v, vals [i], depth))
+		  : !internal_equal_0 (v, vals [i], depth, foldcase))
 		/* a property in B has a different value than in A */
 		goto MISMATCH;
 	      flags [i] = 1;
@@ -2063,7 +2181,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, -1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, -1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2080,7 +2198,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, 1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 0, 1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2100,7 +2218,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, -1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, -1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2119,7 +2237,7 @@
 */
        (a, b, nil_means_not_present))
 {
-  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, 1)
+  return (plists_differ (a, b, !NILP (nil_means_not_present), 1, 1, 0)
 	  ? Qnil : Qt);
 }
 
@@ -2804,7 +2922,7 @@
 
 int
 internal_equal_trapping_problems (Lisp_Object warning_class,
-				  const char *warning_string,
+				  const Ascbyte *warning_string,
 				  int flags,
 				  struct call_trapping_problems_result *p,
 				  int retval,
@@ -2841,49 +2959,78 @@
 
       return (imp1 == imp2) &&
 	/* EQ-ness of the objects was noticed above */
-	(imp1->equal && (imp1->equal) (obj1, obj2, depth));
+	(imp1->equal && (imp1->equal) (obj1, obj2, depth, 0));
     }
 
   return 0;
 }
 
+enum array_type
+  {
+    ARRAY_NONE = 0,
+    ARRAY_STRING,
+    ARRAY_VECTOR,
+    ARRAY_BIT_VECTOR
+  };
+
+static enum array_type
+array_type (Lisp_Object obj)
+{
+  if (STRINGP (obj))
+    return ARRAY_STRING;
+  if (VECTORP (obj))
+    return ARRAY_VECTOR;
+  if (BIT_VECTORP (obj))
+    return ARRAY_BIT_VECTOR;
+  return ARRAY_NONE;
+}
+
 int
 internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth)
 {
   if (depth > 200)
     stack_overflow ("Stack overflow in equalp", Qunbound);
   QUIT;
+
+  /* 1. Objects that are `eq' are equal.  This will catch the common case
+     of two equal fixnums or the same object seen twice. */
   if (EQ_WITH_EBOLA_NOTICE (obj1, obj2))
     return 1;
-#ifdef WITH_NUMBER_TYPES
+
+  /* 2. If both numbers, compare with `='. */
   if (NUMBERP (obj1) && NUMBERP (obj2))
     {
-      switch (promote_args (&obj1, &obj2))
-	{
-	case FIXNUM_T:
-	  return XREALINT (obj1) == XREALINT (obj2);
-#ifdef HAVE_BIGNUM
-	case BIGNUM_T:
-	  return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2));
-#endif
-#ifdef HAVE_RATIO
-	case RATIO_T:
-	  return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2));
-#endif
-	case FLOAT_T:
-	  return XFLOAT_DATA (obj1) == XFLOAT_DATA (obj2);
-#ifdef HAVE_BIGFLOAT
-	case BIGFLOAT_T:
-	  return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2));
-#endif
-	}
+      return (0 == bytecode_arithcompare (obj1, obj2));
     }
-#else
-  if ((INTP (obj1) && FLOATP (obj2)) || (FLOATP (obj1) && INTP (obj2)))
-    return extract_float (obj1) == extract_float (obj2);
-#endif
+
+  /* 3. If characters, compare case-insensitively. */
   if (CHARP (obj1) && CHARP (obj2))
-    return DOWNCASE (0, XCHAR (obj1)) == DOWNCASE (0, XCHAR (obj2));
+    return CANONCASE (0, XCHAR (obj1)) == CANONCASE (0, XCHAR (obj2));
+
+  /* 4. If arrays of different types, compare their lengths, and
+        then compare element-by-element. */
+  {
+    enum array_type artype1, artype2;
+    artype1 = array_type (obj1);
+    artype2 = array_type (obj2);
+    if (artype1 != artype2 && artype1 && artype2)
+      {
+	EMACS_INT i;
+	EMACS_INT l1 = XINT (Flength (obj1));
+	EMACS_INT l2 = XINT (Flength (obj2));
+	/* Both arrays, but of different lengths */
+	if (l1 != l2)
+	  return 0;
+	for (i = 0; i < l1; i++)
+	  if (!internal_equalp (Faref (obj1, make_int (i)),
+				Faref (obj2, make_int (i)), depth + 1))
+	    return 0;
+	return 1;
+      }
+  }
+  /* 5. Else, they must be the same type.  If so, call the equal() method,
+        telling it to fold case.  For objects that care about case-folding
+	their contents, the equal() method will call internal_equal_0(). */
   if (XTYPE (obj1) != XTYPE (obj2))
     return 0;
   if (LRECORDP (obj1))
@@ -2892,16 +3039,23 @@
 	*imp1 = XRECORD_LHEADER_IMPLEMENTATION (obj1),
 	*imp2 = XRECORD_LHEADER_IMPLEMENTATION (obj2);
 
-      /* #### not yet implemented properly, needs another flag to specify
-	 equalp-ness */
       return (imp1 == imp2) &&
 	/* EQ-ness of the objects was noticed above */
-	(imp1->equal && (imp1->equal) (obj1, obj2, depth));
+	(imp1->equal && (imp1->equal) (obj1, obj2, depth, 1));
     }
 
   return 0;
 }
 
+int
+internal_equal_0 (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
+{
+  if (foldcase)
+    return internal_equalp (obj1, obj2, depth);
+  else
+    return internal_equal (obj1, obj2, depth);
+}
+
 /* Note that we may be calling sub-objects that will use
    internal_equal() (instead of internal_old_equal()).  Oh well.
    We will get an Ebola note if there's any possibility of confusion,
@@ -2934,6 +3088,37 @@
   return internal_equal (object1, object2, 0) ? Qt : Qnil;
 }
 
+DEFUN ("equalp", Fequalp, 2, 2, 0, /*
+Return t if two Lisp objects have similar structure and contents.
+
+This is like `equal', except that it accepts numerically equal
+numbers of different types (float, integer, bignum, bigfloat), and also
+compares strings and characters case-insensitively.
+
+Type objects that are arrays (that is, strings, bit-vectors, and vectors)
+of the same length and with contents that are `equalp' are themselves
+`equalp', regardless of whether the two objects have the same type.
+
+Other objects whose primary purpose is as containers of other objects are
+`equalp' if they would otherwise be equal (same length, type, etc.) and
+their contents are `equalp'.  This goes for conses, weak lists,
+weak boxes, ephemerons, specifiers, hash tables, char tables and range
+tables.  However, objects that happen to contain other objects but are not
+primarily designed for this purpose (e.g. compiled functions, events or
+display-related objects such as glyphs, faces or extents) are currently
+compared using `equalp' the same way as using `equal'.
+
+More specifically, two hash tables are `equalp' if they have the same test
+(see `hash-table-test'), the same number of entries, and the same value for
+`hash-table-weakness', and if, for each entry in one hash table, its key is
+equivalent to a key in the other hash table using the hash table test, and
+its value is `equalp' to the other hash table's value for that key.
+*/
+       (object1, object2))
+{
+  return internal_equalp (object1, object2, 0) ? Qt : Qnil;
+}
+
 DEFUN ("old-equal", Fold_equal, 2, 2, 0, /*
 Return t if two Lisp objects have similar structure and contents.
 They must have the same data type.
@@ -3150,204 +3335,762 @@
 
 
 /* This is the guts of several mapping functions.
-   Apply FUNCTION to each element of SEQUENCE, one by one,
-   storing the results into elements of VALS, a C vector of Lisp_Objects.
-   LENI is the length of VALS, which should also be the length of SEQUENCE.
-
-   If VALS is a null pointer, do not accumulate the results. */
+
+   Call FUNCTION CALL_COUNT times, with NSEQUENCES arguments each time,
+   taking the elements from SEQUENCES.  If VALS is non-NULL, store the
+   results into VALS, a C array of Lisp_Objects; else, if LISP_VALS is
+   non-nil, store the results into LISP_VALS, a sequence with sufficient
+   room for CALL_COUNT results (but see the documentation of SOME_OR_EVERY.) 
+   Else, do not accumulate any result.
+
+   If VALS is non-NULL, NSEQUENCES is one, and SEQUENCES[0] is a cons,
+   mapcarX will store the elements of SEQUENCES[0] in stack and GCPRO them,
+   so FUNCTION cannot insert a non-cons into SEQUENCES[0] and throw off
+   mapcarX.
+
+   Otherwise, mapcarX signals a wrong-type-error if it encounters a
+   non-cons, non-array when traversing SEQUENCES.  Common Lisp specifies in
+   MAPPING-DESTRUCTIVE-INTERACTION that it is an error when FUNCTION
+   destructively modifies SEQUENCES in a way that might affect the ongoing
+   traversal operation.
+
+   If SOME_OR_EVERY is SOME_OR_EVERY_SOME, return the (possibly multiple)
+   values given by FUNCTION the first time it is non-nil, and abandon the
+   iterations.  LISP_VALS must be a cons, and the return value will be
+   stored in its car.  If SOME_OR_EVERY is SOME_OR_EVERY_EVERY, store Qnil
+   in the car of LISP_VALS if FUNCTION gives nil; otherwise leave it
+   alone. */
+
+#define SOME_OR_EVERY_NEITHER 0
+#define SOME_OR_EVERY_SOME    1
+#define SOME_OR_EVERY_EVERY   2
 
 static void
-mapcar1 (Elemcount leni, Lisp_Object *vals,
-	 Lisp_Object function, Lisp_Object sequence)
+mapcarX (Elemcount call_count, Lisp_Object *vals, Lisp_Object lisp_vals,
+	 Lisp_Object function, int nsequences, Lisp_Object *sequences, 
+	 int some_or_every)
 {
-  Lisp_Object result;
-  Lisp_Object args[2];
-  struct gcpro gcpro1;
-
-  if (vals)
-    {
-      GCPRO1 (vals[0]);
-      gcpro1.nvars = 0;
-    }
-
+  Lisp_Object called, *args;
+  struct gcpro gcpro1, gcpro2;
+  int i, j;
+  enum lrecord_type lisp_vals_type;
+
+  assert (LRECORDP (lisp_vals));
+  lisp_vals_type = (enum lrecord_type) XRECORD_LHEADER (lisp_vals)->type;
+
+  args = alloca_array (Lisp_Object, nsequences + 1);
   args[0] = function;
-
-  if (LISTP (sequence))
+  for (i = 1; i <= nsequences; ++i)
     {
-      /* A devious `function' could either:
-	 - insert garbage into the list in front of us, causing XCDR to crash
-	 - amputate the list behind us using (setcdr), causing the remaining
-	   elts to lose their GCPRO status.
-
-	 if (vals != 0) we avoid this by copying the elts into the
-	 `vals' array.  By a stroke of luck, `vals' is exactly large
-	 enough to hold the elts left to be traversed as well as the
-	 results computed so far.
-
-	 if (vals == 0) we don't have any free space available and
-	 don't want to eat up any more stack with ALLOCA ().
-	 So we use EXTERNAL_LIST_LOOP_3_NO_DECLARE and GCPRO the tail. */
-
-      if (vals)
-	{
-	  Lisp_Object *val = vals;
-	  Elemcount i;
-
-	  LIST_LOOP_2 (elt, sequence)
-	      *val++ = elt;
-
-	  gcpro1.nvars = leni;
-
-	  for (i = 0; i < leni; i++)
-	    {
-	      args[1] = vals[i];
-	      vals[i] = Ffuncall (2, args);
-	    }
-	}
-      else
+      args[i] = Qnil;
+    }
+
+  if (vals != NULL)
+    {
+      GCPRO2 (args[0], vals[0]);
+      gcpro1.nvars = nsequences + 1;
+      gcpro2.nvars = 0;
+    }
+  else
+    {
+      GCPRO1 (args[0]);
+      gcpro1.nvars = nsequences + 1;
+    }
+
+  /* Be extra nice in the event that we've been handed one list and one
+     only; make it possible for FUNCTION to set cdrs not yet processed to
+     non-cons, non-nil objects without ill-effect, if we have been handed
+     the stack space to do that. */
+  if (vals != NULL && 1 == nsequences && CONSP (sequences[0]))
+    {
+      Lisp_Object lst = sequences[0];
+      Lisp_Object *val = vals;
+      for (i = 0; i < call_count; ++i)
 	{
-	  Lisp_Object elt, tail;
-	  EMACS_INT len_unused;
-	  struct gcpro ngcpro1;
-
-	  NGCPRO1 (tail);
-
-	  {
-	    EXTERNAL_LIST_LOOP_4_NO_DECLARE (elt, sequence, tail, len_unused)
-	      {
-		args[1] = elt;
-		Ffuncall (2, args);
-	      }
-	  }
-
-	  NUNGCPRO;
-	}
-    }
-  else if (VECTORP (sequence))
-    {
-      Lisp_Object *objs = XVECTOR_DATA (sequence);
-      Elemcount i;
-      for (i = 0; i < leni; i++)
-	{
-	  args[1] = *objs++;
-	  result = Ffuncall (2, args);
-	  if (vals) vals[gcpro1.nvars++] = result;
+	  *val++ = XCAR (lst);
+	  lst = XCDR (lst);
 	}
-    }
-  else if (STRINGP (sequence))
-    {
-      /* The string data of `sequence' might be relocated during GC. */
-      Bytecount slen = XSTRING_LENGTH (sequence);
-      Ibyte *p = alloca_ibytes (slen);
-      Ibyte *end = p + slen;
-
-      memcpy (p, XSTRING_DATA (sequence), slen);
-
-      while (p < end)
+      gcpro2.nvars = call_count;
+
+      for (i = 0; i < call_count; ++i)
 	{
-	  args[1] = make_char (itext_ichar (p));
-	  INC_IBYTEPTR (p);
-	  result = Ffuncall (2, args);
-	  if (vals) vals[gcpro1.nvars++] = result;
-	}
-    }
-  else if (BIT_VECTORP (sequence))
-    {
-      Lisp_Bit_Vector *v = XBIT_VECTOR (sequence);
-      Elemcount i;
-      for (i = 0; i < leni; i++)
-	{
-	  args[1] = make_int (bit_vector_bit (v, i));
-	  result = Ffuncall (2, args);
-	  if (vals) vals[gcpro1.nvars++] = result;
+	  args[1] = vals[i];
+	  vals[i] = IGNORE_MULTIPLE_VALUES (Ffuncall (nsequences + 1, args));
 	}
     }
   else
-    ABORT (); /* unreachable, since Flength (sequence) did not get an error */
-
-  if (vals)
-    UNGCPRO;
+    {
+      Binbyte *sequence_types = alloca_array (Binbyte, nsequences);
+      for (j = 0; j < nsequences; ++j)
+	{
+	  sequence_types[j] = XRECORD_LHEADER (sequences[j])->type;
+	}
+
+      for (i = 0; i < call_count; ++i)
+	{
+	  for (j = 0; j < nsequences; ++j)
+	    {
+	      switch (sequence_types[j])
+		{
+		case lrecord_type_cons:
+		  {
+		    if (!CONSP (sequences[j]))
+		      {
+			/* This means FUNCTION has probably messed
+			   around with a cons in one of the sequences,
+			   since we checked the type
+			   (CHECK_SEQUENCE()) and the length and
+			   structure (with Flength()) correctly in our
+			   callers. */
+			dead_wrong_type_argument (Qconsp, sequences[j]);
+		      }
+		    args[j + 1] = XCAR (sequences[j]);
+		    sequences[j] = XCDR (sequences[j]);
+		    break;
+		  }
+		case lrecord_type_vector:
+		  {
+		    args[j + 1] = XVECTOR_DATA (sequences[j])[i];
+		    break;
+		  }
+		case lrecord_type_string:
+		  {
+		    args[j + 1] = make_char (string_ichar (sequences[j], i));
+		    break;
+		  }
+		case lrecord_type_bit_vector:
+		  {
+		    args[j + 1]
+		      = make_int (bit_vector_bit (XBIT_VECTOR (sequences[j]),
+						  i));
+		    break;
+		  }
+		default:
+		  ABORT();
+		}
+	    }
+	  called = Ffuncall (nsequences + 1, args);
+	  if (vals != NULL)
+	    {
+	      vals[i] = IGNORE_MULTIPLE_VALUES (called);
+	      gcpro2.nvars += 1;
+	    }
+	  else
+	    {
+	      switch (lisp_vals_type)
+		{
+		case lrecord_type_symbol:
+		  break;
+		case lrecord_type_cons:
+		  {
+		    if (SOME_OR_EVERY_NEITHER == some_or_every)
+		      {
+			called = IGNORE_MULTIPLE_VALUES (called);
+			if (!CONSP (lisp_vals))
+			  {
+			    /* If FUNCTION has inserted a non-cons non-nil
+			       cdr into the list before we've processed the
+			       relevant part, error. */
+			    dead_wrong_type_argument (Qconsp, lisp_vals);
+			  }
+
+			XSETCAR (lisp_vals, called);
+			lisp_vals = XCDR (lisp_vals);
+			break;
+		      }
+
+		    if (SOME_OR_EVERY_SOME == some_or_every)
+		      {
+			if (!NILP (IGNORE_MULTIPLE_VALUES (called)))
+			  {
+			    XCAR (lisp_vals) = called;
+			    UNGCPRO;
+			    return;
+			  }
+			break;
+		      }
+
+		    if (SOME_OR_EVERY_EVERY == some_or_every)
+		      {
+			called = IGNORE_MULTIPLE_VALUES (called);
+			if (NILP (called))
+			  {
+			    XCAR (lisp_vals) = Qnil;
+			    UNGCPRO;
+			    return;
+			  }
+			break;
+		      }
+
+		    goto bad_some_or_every_flag;
+		  }
+		case lrecord_type_vector:
+		  {
+		    called = IGNORE_MULTIPLE_VALUES (called);
+		    i < XVECTOR_LENGTH (lisp_vals) ?
+		      (XVECTOR_DATA (lisp_vals)[i] = called) :
+		      /* Let #'aset error. */
+		      Faset (lisp_vals, make_int (i), called);
+		    break;
+		  }
+		case lrecord_type_string:
+		  {
+		    /* If this ever becomes a code hotspot, we can keep
+		       around pointers into the data of the string, checking
+		       each time that it hasn't been relocated. */
+		    called = IGNORE_MULTIPLE_VALUES (called);
+		    Faset (lisp_vals, make_int (i), called);
+		    break;
+		  }
+		case lrecord_type_bit_vector:
+		  {
+		    called = IGNORE_MULTIPLE_VALUES (called);
+		    (BITP (called) &&
+		     i < bit_vector_length (XBIT_VECTOR (lisp_vals))) ?
+		      set_bit_vector_bit (XBIT_VECTOR (lisp_vals), i,
+					  XINT (called)) :
+		      (void) Faset (lisp_vals, make_int (i), called);
+		    break;
+		  }
+		bad_some_or_every_flag:
+		default:
+		  {
+		    ABORT();
+		    break;
+		  }
+		}
+	    }
+	}
+    }
+  UNGCPRO;
 }
 
-DEFUN ("mapconcat", Fmapconcat, 3, 3, 0, /*
-Apply FUNCTION to each element of SEQUENCE, and concat the results to a string.
+DEFUN ("mapconcat", Fmapconcat, 3, MANY, 0, /*
+Call FUNCTION on each element of SEQUENCE, and concat results to a string.
 Between each pair of results, insert SEPARATOR.
 
 Each result, and SEPARATOR, should be strings.  Thus, using " " as SEPARATOR
 results in spaces between the values returned by FUNCTION.  SEQUENCE itself
 may be a list, a vector, a bit vector, or a string.
+
+With optional SEQUENCES, call FUNCTION each time with as many arguments as
+there are SEQUENCES, plus one for the element from SEQUENCE.  One element
+from each sequence will be used each time FUNCTION is called, and
+`mapconcat' will give up once the shortest sequence is exhausted.
+
+arguments: (FUNCTION SEQUENCE SEPARATOR &rest SEQUENCES)
 */
-       (function, sequence, separator))
+       (int nargs, Lisp_Object *args))
 {
-  EMACS_INT len = XINT (Flength (sequence));
-  Lisp_Object *args;
-  EMACS_INT i;
-  EMACS_INT nargs = len + len - 1;
-
-  if (len == 0) return build_string ("");
-
-  args = alloca_array (Lisp_Object, nargs);
-
-  mapcar1 (len, args, function, sequence);
+  Lisp_Object function = args[0];
+  Lisp_Object sequence = args[1];
+  Lisp_Object separator = args[2];
+  Elemcount len = EMACS_INT_MAX;
+  Lisp_Object *args0;
+  EMACS_INT i, nargs0;
+
+  args[2] = sequence;
+  args[1] = separator;
+
+  for (i = 2; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  if (len == 0) return build_ascstring ("");
+
+  nargs0 = len + len - 1;
+  args0 = alloca_array (Lisp_Object, nargs0);
+
+  /* Special-case this, it's very common and doesn't require any
+     funcalls. Upside of doing it here, instead of cl-macs.el: no consing,
+     apart from the final string, we allocate everything on the stack. */
+  if (EQ (function, Qidentity) && 3 == nargs && CONSP (sequence))
+    {
+      for (i = 0; i < len; ++i)
+	{
+	  args0[i] = XCAR (sequence);
+	  sequence = XCDR (sequence);
+	}
+    }
+  else
+    {
+      mapcarX (len, args0, Qnil, function, nargs - 2, args + 2,
+	       SOME_OR_EVERY_NEITHER);
+    }
 
   for (i = len - 1; i >= 0; i--)
-    args[i + i] = args[i];
-
-  for (i = 1; i < nargs; i += 2)
-    args[i] = separator;
-
-  return Fconcat (nargs, args);
+    args0[i + i] = args0[i];
+
+  for (i = 1; i < nargs0; i += 2)
+    args0[i] = separator;
+
+  return Fconcat (nargs0, args0);
 }
 
-DEFUN ("mapcar", Fmapcar, 2, 2, 0, /*
-Apply FUNCTION to each element of SEQUENCE; return a list of the results.
+DEFUN ("mapcar*", FmapcarX, 2, MANY, 0, /*
+Call FUNCTION on each element of SEQUENCE; return a list of the results.
 The result is a list of the same length as SEQUENCE.
 SEQUENCE may be a list, a vector, a bit vector, or a string.
+
+With optional SEQUENCES, call FUNCTION each time with as many arguments as
+there are SEQUENCES, plus one for the element from SEQUENCE.  One element
+from each sequence will be used each time FUNCTION is called, and `mapcar'
+stops calling FUNCTION once the shortest sequence is exhausted.
+
+arguments: (FUNCTION SEQUENCE &rest SEQUENCES)
 */
-       (function, sequence))
+       (int nargs, Lisp_Object *args))
 {
-  Elemcount len = XINT (Flength (sequence));
-  Lisp_Object *args = alloca_array (Lisp_Object, len);
-
-  mapcar1 (len, args, function, sequence);
-
-  return Flist ((int) len, args);
+  Lisp_Object function = args[0];
+  Elemcount len = EMACS_INT_MAX;
+  Lisp_Object *args0;
+  int i;
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  args0 = alloca_array (Lisp_Object, len);
+  mapcarX (len, args0, Qnil, function, nargs - 1, args + 1,
+	   SOME_OR_EVERY_NEITHER);
+
+  return Flist ((int) len, args0);
 }
 
-DEFUN ("mapvector", Fmapvector, 2, 2, 0, /*
-Apply FUNCTION to each element of SEQUENCE; return a vector of the results.
+DEFUN ("mapvector", Fmapvector, 2, MANY, 0, /*
+Call FUNCTION on each element of SEQUENCE; return a vector of the results.
 The result is a vector of the same length as SEQUENCE.
 SEQUENCE may be a list, a vector, a bit vector, or a string.
+
+With optional SEQUENCES, call FUNCTION each time with as many arguments as
+there are SEQUENCES, plus one for the element from SEQUENCE.  One element
+from each sequence will be used each time FUNCTION is called, and
+`mapvector' stops calling FUNCTION once the shortest sequence is exhausted.
+
+arguments: (FUNCTION SEQUENCE &rest SEQUENCES)
 */
-       (function, sequence))
+       (int nargs, Lisp_Object *args))
 {
-  Elemcount len = XINT (Flength (sequence));
-  Lisp_Object result = make_vector (len, Qnil);
+  Lisp_Object function = args[0];
+  Elemcount len = EMACS_INT_MAX;
+  Lisp_Object result;
   struct gcpro gcpro1;
-
+  int i;
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  result = make_vector (len, Qnil);
   GCPRO1 (result);
-  mapcar1 (len, XVECTOR_DATA (result), function, sequence);
+  /* Don't pass result as the lisp_object argument, we want mapcarX to protect 
+     a single list argument's elements from being garbage-collected. */
+  mapcarX (len, XVECTOR_DATA (result), Qnil, function, nargs - 1, args +1,
+	   SOME_OR_EVERY_NEITHER);
   UNGCPRO;
 
   return result;
 }
 
-DEFUN ("mapc-internal", Fmapc_internal, 2, 2, 0, /*
-Apply FUNCTION to each element of SEQUENCE.
+DEFUN ("mapcan", Fmapcan, 2, MANY, 0, /*
+Call FUNCTION on each element of SEQUENCE; chain the results together.
+
+FUNCTION must normally return a list; the results will be concatenated
+together using `nconc'.
+
+With optional SEQUENCES, call FUNCTION each time with as many arguments as
+there are SEQUENCES, plus one for the element from SEQUENCE.  One element
+from each sequence will be used each time FUNCTION is called, and
+`mapcan' stops calling FUNCTION once the shortest sequence is exhausted.
+
+arguments: (FUNCTION SEQUENCE &rest SEQUENCES)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  Lisp_Object function = args[0], nconcing;
+  Elemcount len = EMACS_INT_MAX;
+  Lisp_Object *args0;
+  struct gcpro gcpro1;
+  int i;
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  args0 = alloca_array (Lisp_Object, len + 1);
+  mapcarX (len, args0 + 1, Qnil, function, nargs - 1, args + 1,
+	   SOME_OR_EVERY_NEITHER);
+
+  if (len < 2)
+    {
+      return len ? args0[1] : Qnil;
+    }
+
+  /* bytecode_nconc2 can signal and return, we need to GCPRO the args, since
+     mapcarX is no longer doing this for us. */
+  args0[0] = Fcons (Qnil, Qnil);
+  GCPRO1 (args0[0]);
+  gcpro1.nvars = len + 1;
+
+  for (i = 0; i < len; ++i)
+    {
+      nconcing = bytecode_nconc2 (args0 + i);
+      args0[i + 1] = nconcing;
+    }
+
+  RETURN_UNGCPRO (XCDR (nconcing));
+}
+
+DEFUN ("mapc", Fmapc, 2, MANY, 0, /*
+Call FUNCTION on each element of SEQUENCE.
+
 SEQUENCE may be a list, a vector, a bit vector, or a string.
 This function is like `mapcar' but does not accumulate the results,
 which is more efficient if you do not use the results.
 
-The difference between this and `mapc' is that `mapc' supports all
-the spiffy Common Lisp arguments.  You should normally use `mapc'.
+With optional SEQUENCES, call FUNCTION each time with as many arguments as
+there are SEQUENCES, plus one for the elements from SEQUENCE.  One element
+from each sequence will be used each time FUNCTION is called, and
+`mapc' stops calling FUNCTION once the shortest sequence is exhausted.
+
+Return SEQUENCE.
+
+arguments: (FUNCTION SEQUENCE &rest SEQUENCES)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  Elemcount len = EMACS_INT_MAX;
+  Lisp_Object sequence = args[1];
+  struct gcpro gcpro1;
+  int i;
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  /* We need to GCPRO sequence, because mapcarX will modify the
+     elements of the args array handed to it, and this may involve
+     elements of sequence getting garbage collected. */
+  GCPRO1 (sequence);
+  mapcarX (len, NULL, Qnil, args[0], nargs - 1, args + 1,
+	   SOME_OR_EVERY_NEITHER);
+  RETURN_UNGCPRO (sequence);
+}
+
+DEFUN ("map", Fmap, 3, MANY, 0, /*
+Map FUNCTION across one or more sequences, returning a sequence.
+
+TYPE is the sequence type to return, FUNCTION is the function, SEQUENCE is
+the first argument sequence, SEQUENCES are the other argument sequences.
+
+FUNCTION will be called with (1+ (length SEQUENCES)) arguments, and must be
+capable of accepting this number of arguments.
+
+Certain TYPEs are recognised internally by `map', but others are not, and
+`coerce' may throw an error on an attempt to convert to a TYPE it does not
+understand.  A null TYPE means do not accumulate any values.
+
+arguments: (TYPE FUNCTION SEQUENCE &rest SEQUENCES)
 */
-       (function, sequence))
+       (int nargs, Lisp_Object *args))
+{
+  Lisp_Object type = args[0];
+  Lisp_Object function = args[1];
+  Lisp_Object result = Qnil;
+  Lisp_Object *args0 = NULL;
+  Elemcount len = EMACS_INT_MAX;
+  int i;
+  struct gcpro gcpro1;
+
+  for (i = 2; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  if (!NILP (type))
+    {
+      args0 = alloca_array (Lisp_Object, len);
+    }
+
+  mapcarX (len, args0, Qnil, function, nargs - 2, args + 2,
+	   SOME_OR_EVERY_NEITHER);
+
+  if (EQ (type, Qnil))
+    {
+      return result;
+    }
+
+  if (EQ (type, Qvector) || EQ (type, Qarray))
+    {
+      result = Fvector (len, args0);
+    }
+  else if (EQ (type, Qstring))
+    {
+      result = Fstring (len, args0);
+    }
+  else if (EQ (type, Qlist))
+    {
+      result = Flist (len, args0);
+    }
+  else if (EQ (type, Qbit_vector))
+    {
+      result = Fbit_vector (len, args0);
+    }
+  else
+    {
+      result = Flist (len, args0);
+      GCPRO1 (result);
+      result = call2 (Qcoerce, result, type);
+      UNGCPRO;
+    }
+
+  return result;
+}
+
+DEFUN ("map-into", Fmap_into, 2, MANY, 0, /*
+Modify RESULT-SEQUENCE using the return values of FUNCTION on SEQUENCES.
+
+RESULT-SEQUENCE and SEQUENCES can be lists or arrays.
+
+FUNCTION must accept at least as many arguments as there are SEQUENCES
+\(possibly zero).  If RESULT-SEQUENCE and the elements of SEQUENCES are not
+the same length, stop when the shortest is exhausted; any elements of
+RESULT-SEQUENCE beyond that are unmodified.
+
+Return RESULT-SEQUENCE.
+
+arguments: (RESULT-SEQUENCE FUNCTION &rest SEQUENCES)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  Elemcount len = EMACS_INT_MAX;
+  Lisp_Object result_sequence = args[0];
+  Lisp_Object function = args[1];
+  int i;
+
+  args[0] = function;
+  args[1] = result_sequence;
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  mapcarX (len, NULL, result_sequence, function, nargs - 2, args + 2,
+	   SOME_OR_EVERY_NEITHER);
+
+  return result_sequence;
+}
+
+DEFUN ("some", Fsome, 2, MANY, 0, /* 
+Return true if PREDICATE gives non-nil for an element of SEQUENCE.
+
+If so, return the value (possibly multiple) given by PREDICATE.
+
+With optional SEQUENCES, call PREDICATE each time with as many arguments as
+there are SEQUENCES (plus one for the element from SEQUENCE).
+
+arguments: (PREDICATE SEQUENCE &rest SEQUENCES)
+*/
+       (int nargs, Lisp_Object *args))
 {
-  mapcar1 (XINT (Flength (sequence)), 0, function, sequence);
-
-  return sequence;
+  Lisp_Object result_box = Fcons (Qnil, Qnil);
+  struct gcpro gcpro1;
+  Elemcount len = EMACS_INT_MAX;
+  int i;
+
+  GCPRO1 (result_box);
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  mapcarX (len, NULL, result_box, args[0], nargs - 1, args +1,
+	   SOME_OR_EVERY_SOME);
+
+  RETURN_UNGCPRO (XCAR (result_box));
+}
+
+DEFUN ("every", Fevery, 2, MANY, 0, /* 
+Return true if PREDICATE is true of every element of SEQUENCE.
+
+With optional SEQUENCES, call PREDICATE each time with as many arguments as
+there are SEQUENCES (plus one for the element from SEQUENCE).
+
+In contrast to `some', `every' never returns multiple values.
+
+arguments: (PREDICATE SEQUENCE &rest SEQUENCES)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  Lisp_Object result_box = Fcons (Qt, Qnil);
+  struct gcpro gcpro1;
+  Elemcount len = EMACS_INT_MAX;
+  int i;
+
+  GCPRO1 (result_box);
+
+  for (i = 1; i < nargs; ++i)
+    {
+      CHECK_SEQUENCE (args[i]);
+      len = min (len, XINT (Flength (args[i])));
+    }
+
+  mapcarX (len, NULL, result_box, args[0], nargs - 1, args +1,
+	   SOME_OR_EVERY_EVERY);
+
+  RETURN_UNGCPRO (XCAR (result_box));
 }
-
+
+/* Call FUNCTION with NLISTS arguments repeatedly, each Nth argument
+   corresponding to the result of calling (nthcdr ITERATION-COUNT LISTS[N]),
+   until that #'nthcdr expression gives nil for some element of LISTS.
+
+   If MAPLP is zero, return LISTS[0]. Otherwise, return a list of the return
+   values from FUNCTION; if NCONCP is non-zero, nconc them together.
+
+   In contrast to mapcarX, we don't require our callers to check LISTS for
+   well-formedness, we signal wrong-type-argument if it's not a list, or
+   circular-list if it's circular. */
+
+static Lisp_Object
+maplist (Lisp_Object function, int nlists, Lisp_Object *lists, int maplp,
+	 int nconcp)
+{
+  Lisp_Object result = maplp ? lists[0] : Fcons (Qnil, Qnil), funcalled;
+  Lisp_Object nconcing[2], accum = result, *args;
+  struct gcpro gcpro1, gcpro2, gcpro3;
+  int i, j, continuing = (nlists > 0), called_count = 0;
+
+  args = alloca_array (Lisp_Object, nlists + 1);
+  args[0] = function;
+  for (i = 1; i <= nlists; ++i)
+    {
+      args[i] = Qnil;
+    }
+
+  if (nconcp)
+    {
+      nconcing[0] = result;
+      nconcing[1] = Qnil;
+      GCPRO3 (args[0], nconcing[0], result);
+      gcpro1.nvars = 1;
+      gcpro2.nvars = 2;
+    }
+  else
+    {
+      GCPRO2 (args[0], result);
+      gcpro1.nvars = 1;
+    }
+
+  while (continuing)
+    {
+      for (j = 0; j < nlists; ++j)
+	{
+	  if (CONSP (lists[j]))
+	    {
+	      args[j + 1] = lists[j];
+	      lists[j] = XCDR (lists[j]);
+	    }
+	  else if (NILP (lists[j]))
+	    {
+	      continuing = 0;
+	      break;
+	    }
+	  else
+	    {
+	      dead_wrong_type_argument (Qlistp, lists[j]);
+	    }
+	}
+      if (!continuing) break;
+      funcalled = IGNORE_MULTIPLE_VALUES (Ffuncall (nlists + 1, args));
+      if (!maplp)
+	{
+	  if (nconcp)
+	    {
+	      /* This order of calls means we check that each list is
+		 well-formed once and once only. The last result does
+		 not have to be a list. */
+	      nconcing[1] = funcalled;
+	      nconcing[0] = bytecode_nconc2 (nconcing);
+	    }
+	  else
+	    {
+	      /* Add to the end, avoiding the need to call nreverse
+		 once we're done: */
+	      XSETCDR (accum, Fcons (funcalled, Qnil));
+	      accum = XCDR (accum);
+	    }
+	}
+
+      if (++called_count % CIRCULAR_LIST_SUSPICION_LENGTH) continue;
+
+      for (j = 0; j < nlists; ++j)
+	{
+	  EXTERNAL_LIST_LOOP_1 (lists[j])
+	    {
+	      /* Just check the lists aren't circular, using the
+		 EXTERNAL_LIST_LOOP_1 macro. */
+	    }
+	}
+    }
+
+  if (!maplp)
+    {
+      result = XCDR (result);
+    }
+
+  RETURN_UNGCPRO (result);
+}
+
+DEFUN ("maplist", Fmaplist, 2, MANY, 0, /*
+Call FUNCTION on each sublist of LIST and LISTS.
+Like `mapcar', except applies to lists and their cdr's rather than to
+the elements themselves."
+
+arguments: (FUNCTION LIST &rest LISTS)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return maplist (args[0], nargs - 1, args + 1, 0, 0);
+}
+
+DEFUN ("mapl", Fmapl, 2, MANY, 0, /*
+Like `maplist', but do not accumulate values returned by the function.
+
+arguments: (FUNCTION LIST &rest LISTS)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return maplist (args[0], nargs - 1, args + 1, 1, 0);
+}
+
+DEFUN ("mapcon", Fmapcon, 2, MANY, 0, /*
+Like `maplist', but chains together the values returned by FUNCTION.
+
+FUNCTION must return a list (unless it happens to be the last
+iteration); the results will be concatenated together using `nconc'.
+
+arguments: (FUNCTION LIST &rest LISTS)
+*/
+       (int nargs, Lisp_Object *args))
+{
+  return maplist (args[0], nargs - 1, args + 1, 0, 1);
+}
 
 /* Extra random functions */
 
@@ -3391,18 +4134,19 @@
   return old;
 }
 
+
 Lisp_Object
 add_suffix_to_symbol (Lisp_Object symbol, const Ascbyte *ascii_string)
 {
   return Fintern (concat2 (Fsymbol_name (symbol),
-			   build_string (ascii_string)),
+			   build_ascstring (ascii_string)),
 		  Qnil);
 }
 
 Lisp_Object
 add_prefix_to_symbol (const Ascbyte *ascii_string, Lisp_Object symbol)
 {
-  return Fintern (concat2 (build_string (ascii_string),
+  return Fintern (concat2 (build_ascstring (ascii_string),
 			   Fsymbol_name (symbol)),
 		  Qnil);
 }
@@ -3652,7 +4396,7 @@
   (IS_ASCII (Character) && base64_char_to_value[Character] >= 0)
 
 /* Table of characters coding the 64 values.  */
-static char base64_value_to_char[64] =
+static Ascbyte base64_value_to_char[64] =
 {
   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',	/*  0- 9 */
   'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',	/* 10-19 */
@@ -3699,11 +4443,11 @@
    The octets are divided into 6 bit chunks, which are then encoded into
    base64 characters.  */
 
-static DECLARE_DOESNT_RETURN (base64_conversion_error (const char *,
+static DECLARE_DOESNT_RETURN (base64_conversion_error (const Ascbyte *,
 						       Lisp_Object));
 
 static DOESNT_RETURN
-base64_conversion_error (const char *reason, Lisp_Object frob)
+base64_conversion_error (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qbase64_conversion_error, reason, frob);
 }
@@ -3786,7 +4530,7 @@
 } while (1)
 
 #define STORE_BYTE(pos, val, ccnt) do {					\
-  pos += set_itext_ichar (pos, (Ichar)((unsigned char)(val)));	\
+  pos += set_itext_ichar (pos, (Ichar)((Binbyte)(val)));		\
   ++ccnt;								\
 } while (0)
 
@@ -4029,6 +4773,12 @@
 
   DEFSYMBOL (Qstring_lessp);
   DEFSYMBOL (Qidentity);
+  DEFSYMBOL (Qvector);
+  DEFSYMBOL (Qarray);
+  DEFSYMBOL (Qstring);
+  DEFSYMBOL (Qlist);
+  DEFSYMBOL (Qbit_vector);
+
   DEFSYMBOL (Qyes_or_no_p);
 
   DEFERROR_STANDARD (Qbase64_conversion_error, Qconversion_error);
@@ -4102,13 +4852,25 @@
   DEFSUBR (Fremprop);
   DEFSUBR (Fobject_plist);
   DEFSUBR (Fequal);
+  DEFSUBR (Fequalp);
   DEFSUBR (Fold_equal);
   DEFSUBR (Ffillarray);
   DEFSUBR (Fnconc);
-  DEFSUBR (Fmapcar);
+  DEFSUBR (FmapcarX);
   DEFSUBR (Fmapvector);
-  DEFSUBR (Fmapc_internal);
+  DEFSUBR (Fmapcan);
+  DEFSUBR (Fmapc);
   DEFSUBR (Fmapconcat);
+  DEFSUBR (Fmap);
+  DEFSUBR (Fmap_into);
+  DEFSUBR (Fsome);
+  DEFSUBR (Fevery);
+  Ffset (intern ("mapc-internal"), Fsymbol_function (intern ("mapc")));
+  Ffset (intern ("mapcar"), Fsymbol_function (intern ("mapcar*")));
+  DEFSUBR (Fmaplist);
+  DEFSUBR (Fmapl);
+  DEFSUBR (Fmapcon);
+
   DEFSUBR (Freplace_list);
   DEFSUBR (Fload_average);
   DEFSUBR (Ffeaturep);
@@ -4130,7 +4892,7 @@
 The directory separator in search paths, as a string.
 */ );
   {
-    char c = SEPCHAR;
+    Ascbyte c = SEPCHAR;
     Vpath_separator = make_string ((Ibyte *) &c, 1);
   }
 }
--- a/src/font-mgr.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/font-mgr.c	Wed Feb 24 01:58:04 2010 -0600
@@ -46,6 +46,8 @@
 #include "hash.h"
 #include "font-mgr.h"
 
+#include "sysfile.h"
+
 /* #### TO DO ####
    . The "x-xft-*" and "x_xft_*" nomenclature is mostly redundant, especially
      if we separate X fonts from Xft fonts, and use fontconfig more generally.
@@ -159,10 +161,10 @@
    is a Lisp string.
 */
 #define extract_fcapi_string(str) \
-  (NEW_LISP_STRING_TO_EXTERNAL ((str), Qfc_font_name_encoding))
+  (LISP_STRING_TO_EXTERNAL ((str), Qfc_font_name_encoding))
 
 #define build_fcapi_string(str) \
-  (build_ext_string ((Extbyte *) (str), Qfc_font_name_encoding))
+  (build_extstring ((Extbyte *) (str), Qfc_font_name_encoding))
 
 /* #### This homebrew lashup should be replaced with FcConstants.
 
@@ -180,7 +182,7 @@
    ourselves; hash.c hashtables do not interpret the value pointers.
 
    This array should be FcChar8**, but GCC 4.x bitches about signedness. */
-static Extbyte *fc_standard_properties[] = {
+static const Extbyte *fc_standard_properties[] = {
   /* treated specially, ordered first */
   "family", "size",
   /* remaining are alphabetized by group */
@@ -258,8 +260,13 @@
 */
       (pattern))
 {
+  FcChar8 *name;
+  Lisp_Object result;
   CHECK_FCPATTERN(pattern);
-  return build_fcapi_string (FcNameUnparse (XFCPATTERN_PTR (pattern)));
+  name = FcNameUnparse (XFCPATTERN_PTR (pattern));
+  result = build_fcapi_string (name);
+  xfree (name);
+  return result;
 }
 
 DEFUN("fc-pattern-duplicate", Ffc_pattern_duplicate, 1, 1, 0, /* 
@@ -549,8 +556,7 @@
 
   /* #### improve this error message */
   if (!fontset)
-    Fsignal (Qinvalid_state,
-	     list1 (build_string ("failed to create FcFontSet")));
+    invalid_state ("failed to create FcFontSet", Qunbound);
   for (idx = 0; idx < fontset->nfont; ++idx)
     {
       fcpat = XFCPATTERN (ALLOC_LISP_OBJECT (fc_pattern));
@@ -773,8 +779,8 @@
   CHECK_STRING (file);
   if (FcConfigAppFontAddFile
       (XFCCONFIG_PTR (config),
-       /* #### FIXME! is this really Qnative? */
-       (FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((file), Qnative)) == FcFalse)
+       /* #### FIXME! is Qfile_name right? */
+       (FcChar8 *) LISP_STRING_TO_EXTERNAL (file, Qfile_name)) == FcFalse)
     return Qnil;
   else
     return Qt;
@@ -792,8 +798,8 @@
   CHECK_STRING (dir);
   if (FcConfigAppFontAddDir
       (XFCCONFIG_PTR (config),
-       /* #### FIXME! is this really Qnative? */
-       (FcChar8 *) NEW_LISP_STRING_TO_EXTERNAL ((dir), Qnative)) == FcFalse)
+       /* #### FIXME! is Qfile_name right? */
+       (FcChar8 *) LISP_STRING_TO_EXTERNAL (dir, Qfile_name)) == FcFalse)
     return Qnil;
   else
     return Qt;
@@ -830,13 +836,13 @@
      FC_CONFIG_DIR environment variable. */
       (name))
 {
-  char *fcname = "";
+  const Ascbyte *fcname = "";
 
   if (!NILP (name))
     {
       CHECK_STRING (name);
-      /* #### FIXME! is this really Qnative? */
-      fcname = NEW_LISP_STRING_TO_EXTERNAL (name, Qnative);
+       /* #### FIXME! is Qfile_name right? */
+      LISP_PATHNAME_CONVERT_OUT (name, fcname);
     }
   return (build_fcapi_string (FcConfigFilename ((FcChar8 *) fcname)));
 }
@@ -905,17 +911,12 @@
 
   /* There ought to be a standard idiom for this.... */
   if (NILP (kind)
-      || EQ (kind, Qfc_match_font)) {
+      || EQ (kind, Qfc_match_font))
     knd = FcMatchFont;
-  }
-  else if (EQ (kind, Qfc_match_pattern)) {
+  else if (EQ (kind, Qfc_match_pattern))
     knd = FcMatchPattern;
-  }
-  else {
-    Fsignal (Qwrong_type_argument,
-	     list2 (build_string ("need `fc-match-pattern' or `fc-match-font'"),
-		    kind));
-  }
+  else
+    wtaerror ("need `fc-match-pattern' or `fc-match-font'", kind);
 
   /* Typecheck arguments */
   CHECK_FCPATTERN (pattern);
@@ -995,6 +996,7 @@
 
   FcConfigSubstitute (fcc, p, FcMatchPattern);
   FcDefaultSubstitute (p);
+  res = FcResultMatch;
   res_fcpat->fcpatPtr = FcFontMatch (fcc, p, &res);
 
   if (res_fcpat->fcpatPtr == NULL)
@@ -1213,7 +1215,7 @@
   unsigned i;
   Lisp_Object reg = Qnil;
   const Extbyte *re[] = 	/* #### This could just be catenated by
-				   cpp and passed to build_ext_string. */
+				   cpp and passed to build_extstring. */
     {
       /* Regular expression matching XLFDs as defined by XLFD v. 1.5.
 	 Matches must be case-insensitive.
@@ -1260,7 +1262,7 @@
   for (i = 0; i < sizeof(re)/sizeof(Extbyte *); i++)
     {
       /* #### Currently this is Host Portable Coding, not ISO 8859-1. */
-      reg = concat2(reg, build_ext_string (re[i], Qx_font_name_encoding));
+      reg = concat2(reg, build_extstring (re[i], Qx_font_name_encoding));
     }
 
   RETURN_UNGCPRO (reg);
--- a/src/font-mgr.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/font-mgr.h	Wed Feb 24 01:58:04 2010 -0600
@@ -89,7 +89,7 @@
 
 #endif /* FONTCONFIG_EXPOSE_CONFIG */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 
 #ifndef HAVE_FCCONFIGGETRESCANINTERVAL
 /* Older fontconfig versions misspell this function name. */
@@ -164,8 +164,8 @@
     DEBUG_XFT2 (level, "checking if %s handles %s\n", font, lang);	\
   } while (0)
 
-#else /* USE_XFT */
+#else /* HAVE_XFT */
 
-#endif /* USE_XFT */
+#endif /* HAVE_XFT */
 
 #endif /* INCLUDED_font_mgr_h_ */
--- a/src/frame-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/frame-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -61,7 +61,7 @@
 #define STUPID_X_SPECIFIC_GTK_STUFF
 
 #ifdef STUPID_X_SPECIFIC_GTK_STUFF
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 #endif
 
 /* Default properties to use when creating frames.  */
@@ -330,8 +330,7 @@
     for (ptr = value; *ptr; ptr++)
       if (!byte_ascii_p (*ptr))
 	{
-	  char *tmp;
-	  C_STRING_TO_EXTERNAL (value, tmp, Qctext);
+	  char *tmp = ITEXT_TO_EXTERNAL (value, Qctext);
 	  the_text = tmp;
 	  break;
 	}
@@ -810,7 +809,7 @@
 #endif
 
   if (STRINGP (f->name))
-    TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, name, Qctext);
+    name = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
   else
     name = "emacs";
 
@@ -986,9 +985,11 @@
     FRAME_GTK_LISP_WIDGETS (f)[i] = Qnil;
 
   /*
-    Hashtables of callback data for glyphs on the frame.  Make them EQ because
-    we only use ints as keys.  Otherwise we run into stickiness in redisplay
-    because internal_equal() can QUIT.  See enter_redisplay_critical_section().
+    Hashtables of callback data for glyphs on the frame.  [[ Make them EQ
+    because we only use ints as keys.  Otherwise we run into stickiness in
+    redisplay because internal_equal() can QUIT.  See
+    enter_redisplay_critical_section() ]] -- probably not true any more,
+    now that we have internal_equal_trapping_problems(). --ben
 */
   FRAME_GTK_WIDGET_INSTANCE_HASH_TABLE (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
@@ -1155,12 +1156,12 @@
 */
        (frame))
 {
-  char str[255];
+  Ascbyte str[255];
   struct frame *f = decode_gtk_frame (frame);
 
   /* Arrrrggghhh... this defeats the whole purpose of using Gdk... do we really need this? */
   sprintf (str, "%lu", GDK_WINDOW_XWINDOW( GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f))));
-  return build_string (str);
+  return build_ascstring (str);
 }
 #endif
 
@@ -1351,9 +1352,9 @@
     gtk_widget_destroy (w);
 
     if (FRAME_GTK_GEOM_FREE_ME_PLEASE (f))
-	xfree (FRAME_GTK_GEOM_FREE_ME_PLEASE (f), char *);
+	xfree (FRAME_GTK_GEOM_FREE_ME_PLEASE (f));
 #ifndef NEW_GC
-    xfree (f->frame_data, void *);
+    xfree (f->frame_data);
 #endif /* not NEW_GC */
     f->frame_data = 0;
 }
--- a/src/frame-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/frame-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -192,10 +192,11 @@
   FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE (f) = 
     make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
 #endif
-  /* hashtable of instantiated glyphs on the frame.  Make them EQ because
+  /* hashtable of instantiated glyphs on the frame. [[ Make them EQ because
      we only use ints as keys.  Otherwise we run into stickiness in
      redisplay because internal_equal() can QUIT.  See
-     enter_redisplay_critical_section(). */
+     enter_redisplay_critical_section(). ]] -- probably not true any more,
+    now that we have internal_equal_trapping_problems(). --ben */
   FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQ);
   FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f) =
@@ -248,9 +249,9 @@
     const Extbyte *nameext = 0;
 
     if (STRINGP (f->name))
-      LISP_STRING_TO_TSTR (f->name, nameext);
+      nameext = LISP_STRING_TO_TSTR (f->name);
     else if (STRINGP (name))
-      LISP_STRING_TO_TSTR (name, nameext);
+      nameext = LISP_STRING_TO_TSTR (name);
     else
       nameext = XETEXT (XEMACS_CLASS);
     hwnd = qxeCreateWindowEx (exstyle,
@@ -272,7 +273,7 @@
 			   
   FRAME_MSWINDOWS_HANDLE (f) = hwnd;
 
-  qxeSetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID (frame_obj));
+  qxeSetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)STORE_LISP_IN_VOID (frame_obj));
   FRAME_MSWINDOWS_DC (f) = GetDC (hwnd);
   SetTextAlign (FRAME_MSWINDOWS_DC (f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
 
@@ -361,7 +362,7 @@
       ReleaseDC (FRAME_MSWINDOWS_HANDLE (f), FRAME_MSWINDOWS_DC (f));
       DestroyWindow (FRAME_MSWINDOWS_HANDLE (f));
 #ifndef NEW_GC
-      xfree (f->frame_data, void *);
+      xfree (f->frame_data);
 #endif /* not NEW_GC */
     }
   f->frame_data = 0;
@@ -552,7 +553,7 @@
 
   /* Yippie! */
   ScreenToClient (hwnd, &pt);
-  *frame = VOID_TO_LISP ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ));
+  *frame = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ));
   *x = pt.x;
   *y = pt.y;
   return 1;
@@ -592,7 +593,7 @@
       Extbyte *title_ext;
 
       FRAME_MSWINDOWS_TITLE_CHECKSUM (f) = new_checksum;
-      C_STRING_TO_TSTR (title, title_ext);
+      title_ext = ITEXT_TO_TSTR (title);
       qxeSetWindowText (FRAME_MSWINDOWS_HANDLE (f), title_ext);
     }
 }
@@ -604,7 +605,7 @@
   struct frame *f = decode_mswindows_frame (frame);
 
   qxesprintf (str, "%lu", (unsigned long) FRAME_MSWINDOWS_HANDLE (f));
-  return build_intstring (str);
+  return build_istring (str);
 }
 
 static Lisp_Object
@@ -820,7 +821,7 @@
   if (hwnd)
     {
       Lisp_Object parent;
-      parent = VOID_TO_LISP ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ));
+      parent = GET_LISP_FROM_VOID ((void *) qxeGetWindowLong (hwnd, XWL_FRAMEOBJ));
       assert (FRAME_MSWINDOWS_P (XFRAME (parent)));
       return parent;
     }
@@ -995,7 +996,7 @@
     const Extbyte *nameext;
 
     if (STRINGP (f->name))
-      LISP_STRING_TO_TSTR (f->name, nameext);
+      nameext = LISP_STRING_TO_TSTR (f->name);
     else
       nameext = XETEXT ("XEmacs print document");
     di.lpszDocName = (XELPTSTR) nameext;
@@ -1030,7 +1031,7 @@
 	EndPage (hdc);
       if (FRAME_MSPRINTER_JOB_STARTED (f))
 	EndDoc (hdc);
-      xfree (f->frame_data, void *);
+      xfree (f->frame_data);
     }
 
   f->frame_data = 0;
--- a/src/frame-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/frame-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -464,7 +464,7 @@
 init_x_prop_symbols (void)
 {
 #define def(sym, rsrc) \
-   Fput (sym, Qx_resource_name, build_string (rsrc))
+   Fput (sym, Qx_resource_name, build_ascstring (rsrc))
 #define defi(sym,rsrc) \
    def (sym, rsrc); Fput (sym, Qintegerp, Qt)
 
@@ -513,7 +513,7 @@
   color.pixel = pixel;
   XQueryColor (XtDisplay (w), w->core.colormap, &color);
   qxesprintf (buf, "#%04x%04x%04x", color.red, color.green, color.blue);
-  return build_intstring (buf);
+  return build_istring (buf);
 }
 
 static void
@@ -649,10 +649,8 @@
   for (ptr = value; *ptr; ptr++)
     if (!byte_ascii_p (*ptr))
       {
-        const Extbyte *tmp;
         encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f)));
-	C_STRING_TO_EXTERNAL (value, tmp, Qctext);
-        new_XtValue = (String) tmp;
+        new_XtValue = (String) ITEXT_TO_EXTERNAL (value, Qctext);
         break;
       }
 #endif /* MULE */
@@ -760,7 +758,7 @@
 	  if (XSTRING_LENGTH (prop) == 0)
 	    continue;
 
-	  LISP_STRING_TO_EXTERNAL (prop, extprop, Qxt_widget_arg_encoding);
+	  extprop = LISP_STRING_TO_EXTERNAL (prop, Qxt_widget_arg_encoding);
 	  if (STRINGP (val))
 	    {
 	      const Extbyte *extval;
@@ -770,9 +768,8 @@
 		 for the value of a widget argument; it depends on the
 		 semantics of the argument.  So use of
 		 Qxt_widget_arg_encoding is totally bogus. --ben */
-	      TO_EXTERNAL_FORMAT (LISP_STRING, val,
-				  ALLOCA, (extval, extvallen),
-				  Qxt_widget_arg_encoding);
+	      LISP_STRING_TO_SIZED_EXTERNAL (val, extval, extvallen,
+					     Qxt_widget_arg_encoding);
 	      XtVaSetValues (w, XtVaTypedArg, extprop,
 			     /* !!#### Verify this + 1 and document
 				as zero-termination */
@@ -852,7 +849,7 @@
 	      internal_border_width_specified = True;
 	    }
 
-	  LISP_STRING_TO_EXTERNAL (str, strext, Qxt_widget_arg_encoding);
+	  strext = LISP_STRING_TO_EXTERNAL (str, Qxt_widget_arg_encoding);
 	  if (int_p)
 	    {
 	      CHECK_INT (val);
@@ -872,9 +869,8 @@
 	      Bytecount extvallen;
 	      CHECK_STRING (val);
 
-	      TO_EXTERNAL_FORMAT (LISP_STRING, val,
-				  ALLOCA, (extval, extvallen),
-				  Qxt_widget_arg_encoding);
+	      LISP_STRING_TO_SIZED_EXTERNAL (val, extval, extvallen,
+					     Qxt_widget_arg_encoding);
 	      XtVaSetValues (w, XtVaTypedArg,
 			     /* XtN... */
 			     strext,
@@ -988,9 +984,9 @@
 			 shell->core.widget_class->core_class.class_name,
 			 resources, XtNumber (resources), 0, 0);
       if (results[0])
-	Vframe_title_format = build_ext_string (results[0], Qctext);
+	Vframe_title_format = build_extstring (results[0], Qctext);
       if (results[1])
-	Vframe_icon_title_format = build_ext_string (results[1], Qctext);
+	Vframe_icon_title_format = build_extstring (results[1], Qctext);
     }
 
   frame_title_format_already_set = 1;
@@ -1035,9 +1031,9 @@
 	  (*num_items_out)++;
 	}
       eicat_ch (ei, '\0');
-      SIZED_C_STRING_TO_SIZED_EXTERNAL_MALLOC (eidata (ei), eilen (ei),
-					       dnd_data, *len_out,
-					       encoding);
+      TO_EXTERNAL_FORMAT (DATA, (eidata (ei), eilen (ei)),
+			  MALLOC, (dnd_data, *len_out),
+			  encoding);
     }
   else
     {
@@ -1129,7 +1125,7 @@
     }
 
   /* free the data string */
-  xfree (clientData, XtPointer);
+  xfree (clientData);
 
   CurrentDragWidget = NULL;
 }
@@ -1227,7 +1223,7 @@
 		    dnd_destroy_cb_rec,
 		    NULL, 0);
 
-  xfree (dnd_data, Extbyte *);
+  xfree (dnd_data);
 
   return num_items ? Qt : Qnil;
 }
@@ -1268,12 +1264,13 @@
 	  Ibyte *fileint;
 	  Ibyte *hurl;
 
-	  EXTERNAL_TO_C_STRING (transferInfo->dropData->data.files[ii],
-				fileint, Qfile_name);
+	  fileint =
+	    EXTERNAL_TO_ITEXT (transferInfo->dropData->data.files[ii],
+				      Qfile_name);
 
 	  hurl = dnd_url_hexify_string (fileint, "file:");
-	  l_data = Fcons (build_intstring (hurl), l_data);
-	  xfree (hurl, Ibyte *);
+	  l_data = Fcons (build_istring (hurl), l_data);
+	  xfree (hurl);
 	}
     }
   else if (transferInfo->dropData->protocol == DtDND_BUFFER_TRANSFER)
@@ -1295,12 +1292,12 @@
 	  /* let us forget this name thing for now... */
  	  /* filePath = transferInfo->dropData->data.buffers[ii].name;
 	     path = (filePath == NULL) ? Qnil
-	     : build_ext_string (filePath, Q???); */
+	     : build_extstring (filePath, Q???); */
 	  /* what, if the data is no text, and how can I tell it? */
 	  l_data =
-	    Fcons (list3 (list1 (build_string ("text/plain")),
-			  build_string ("8bit"),
-			  make_ext_string
+	    Fcons (list3 (list1 (build_ascstring ("text/plain")),
+			  build_ascstring ("8bit"),
+			  make_extstring
 			  (transferInfo->dropData->data.buffers[ii].bp,
 			   transferInfo->dropData->data.buffers[ii].size,
 			   /* !!#### what goes here? */
@@ -1769,7 +1766,7 @@
 #endif
 
   if (STRINGP (f->name))
-    LISP_STRING_TO_EXTERNAL (f->name, name, Qctext);
+    name = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
   else
     name = "emacs";
 
@@ -2206,7 +2203,7 @@
   struct frame *f = decode_x_frame (frame);
 
   qxesprintf (str, "%lu", XtWindow (FRAME_X_TEXT_WIDGET (f)));
-  return build_intstring (str);
+  return build_istring (str);
 }
 
 
@@ -2604,7 +2601,7 @@
   DtDndDropUnregister (FRAME_X_TEXT_WIDGET (f));
 #endif /* HAVE_CDE */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* If we have an XftDraw structure, we need to free it here.
      We can't ever have an XftDraw without a Display, so we are safe
      to free it in here, and we avoid too much playing around with the 
@@ -2640,14 +2637,14 @@
 
   if (FRAME_X_GEOM_FREE_ME_PLEASE (f))
     {
-      xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f), Ascbyte *);
+      xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f));
       FRAME_X_GEOM_FREE_ME_PLEASE (f) = 0;
     }
 
   if (f->frame_data)
     {
 #ifndef NEW_GC
-      xfree (f->frame_data, void *);
+      xfree (f->frame_data);
 #endif /* not NEW_GC */
       f->frame_data = 0;
     }
@@ -2711,7 +2708,7 @@
        {
 	 if (0)
 	   ;
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 	 else if (FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font)))
 	   {
 	     Xt_SET_ARG (al[ac], XtNxftFont,
--- a/src/frame.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/frame.c	Wed Feb 24 01:58:04 2010 -0600
@@ -271,8 +271,7 @@
   struct frame *frm = XFRAME (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<frame %s 0x%x>",
-				XSTRING_DATA (frm->name), frm->header.uid);
+    printing_unreadable_lcrecord (obj, XSTRING_DATA (frm->name));
 
   write_fmt_string (printcharfun, "#<%s-frame ", !FRAME_LIVE_P (frm) ? "dead" :
 		    FRAME_TYPE_NAME (frm));
@@ -525,17 +524,17 @@
     {
       /* We leave Vdefault_frame_name alone here so that it'll remain Qnil
 	 in the dumped executable, and we can choose it at runtime. */
-      name = build_string("XEmacs");
+      name = build_ascstring ("XEmacs");
     }
   else if (NILP (Vdefault_frame_name))
     {
       if (egetenv ("USE_EMACS_AS_DEFAULT_APPLICATION_CLASS"))
 	{
-	  Vdefault_frame_name = build_string ("emacs");
+	  Vdefault_frame_name = build_ascstring ("emacs");
 	}
       else
 	{
-	  Vdefault_frame_name = build_string ("XEmacs");
+	  Vdefault_frame_name = build_ascstring ("XEmacs");
 	}
     }
 
@@ -581,6 +580,8 @@
 
   update_frame_window_mirror (f);
 
+  /* #### Do we need to be calling reset_face_cachels here, and then again
+     down below? */
   if (initialized && !DEVICE_STREAM_P (d))
     {
       if (!NILP (f->minibuffer_window))
@@ -638,8 +639,19 @@
 	 things. */
       init_frame_toolbars (f);
 #endif
+      /* Added this assert recently (2-1-10); seems there should be only
+	 two windows, root and minibufer.  Probably we should just be
+	 calling reset_*_cachels on the root window directly instead of the
+	 selected window, but I want to make sure they are always the
+	 same. --ben */
+      assert (EQ (FRAME_SELECTED_WINDOW (f), f->root_window));
       reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
       reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
+      if (!NILP (f->minibuffer_window))
+	{
+	  reset_face_cachels (XWINDOW (f->minibuffer_window));
+	  reset_glyph_cachels (XWINDOW (f->minibuffer_window));
+	}
 
       change_frame_size (f, f->height, f->width, 0);
     }
@@ -3487,7 +3499,7 @@
 
   return
     convert_ichar_string_into_malloced_string
-    (Dynarr_atp (title_string_ichar_dynarr, 0),
+    (Dynarr_begin (title_string_ichar_dynarr),
      Dynarr_length (title_string_ichar_dynarr), 0);
 }
 
@@ -3524,7 +3536,7 @@
       if (!EQ (icon_format, title_format) || !title)
 	{
 	  if (title)
-	    xfree (title, Ibyte *);
+	    xfree (title);
 
 	  title = generate_title_string (w, icon_format,
 					 DEFAULT_INDEX, CURRENT_DISP);
@@ -3533,7 +3545,7 @@
     }
 
   if (title)
-    xfree (title, Ibyte *);
+    xfree (title);
 }
 
 
@@ -3858,16 +3870,16 @@
 /* #### I would change this unilaterally but for the wrath of the Kyles
 of the world. */
 #ifdef WIN32_NATIVE
-  Vframe_title_format = build_string ("%b - XEmacs");
+  Vframe_title_format = build_ascstring ("%b - XEmacs");
 #else
-  Vframe_title_format = build_string ("%S: %b");
+  Vframe_title_format = build_ascstring ("%S: %b");
 #endif
 
   DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /*
 Controls the title of the icon corresponding to the selected frame.
 See also the variable `frame-title-format'.
 */ );
-  Vframe_icon_title_format = build_string ("%b");
+  Vframe_icon_title_format = build_ascstring ("%b");
 
   DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /*
 The default name to assign to newly-created frames.
--- a/src/frame.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/frame.h	Wed Feb 24 01:58:04 2010 -0600
@@ -154,7 +154,6 @@
 			     void *closure);
 int device_matches_device_spec (Lisp_Object device, Lisp_Object device_spec);
 Lisp_Object frame_first_window (struct frame *f);
-int show_gc_cursor (struct frame *f, Lisp_Object cursor);
 void set_frame_selected_window (struct frame *f, Lisp_Object window);
 int is_surrogate_for_selected_frame (struct frame *f);
 void update_frame_icon (struct frame *f);
--- a/src/gc.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,6 @@
 /* New incremental garbage collector for XEmacs.
    Copyright (C) 2005 Marcus Crestani.
+   Copyright (C) 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -1376,7 +1377,7 @@
       finalize_elem *temp = rest;
       Vfinalizers_to_run = Fcons (rest->obj, Vfinalizers_to_run);
       Vall_finalizable_objs = rest->next;
-      xfree (temp, finalize_elem *);
+      xfree (temp);
       rest = Vall_finalizable_objs;
     }
 
@@ -1388,7 +1389,7 @@
 	  finalize_elem *temp = rest->next;
 	  Vfinalizers_to_run = Fcons (rest->next->obj, Vfinalizers_to_run);
 	  rest->next = rest->next->next;
-	  xfree (temp, finalize_elem *);
+	  xfree (temp);
 	}
       else
 	{
@@ -1448,7 +1449,7 @@
 #define MAX_SAVE_STACK 0 /* 16000 */
 #endif
 
-void
+static void
 show_gc_cursor_and_message (void) 
 {
   /* Now show the GC cursor/message. */
@@ -1496,7 +1497,7 @@
 	      Lisp_Object args[2], whole_msg;
 	      args[0] = (STRINGP (Vgc_message) ? Vgc_message :
 			 build_msg_string (gc_default_message));
-	      args[1] = build_string ("...");
+	      args[1] = build_ascstring ("...");
 	      whole_msg = Fconcat (2, args);
 	      echo_area_message (f, (Ibyte *) 0, whole_msg, 0, -1,
 				 Qgarbage_collecting);
@@ -1505,7 +1506,7 @@
     }
 }
 
-void
+static void
 remove_gc_cursor_and_message (void)
 {
   /* Now remove the GC cursor/message */
@@ -1535,7 +1536,7 @@
     }
 }
 
-void
+static void
 gc_prepare (void)
 {
 #if MAX_SAVE_STACK > 0
@@ -1567,7 +1568,7 @@
 
   gc_in_progress = 1;
 #ifndef NEW_GC
-  inhibit_non_essential_conversion_operations = 1;
+  inhibit_non_essential_conversion_operations++;
 #endif /* not NEW_GC */
 
 #if MAX_SAVE_STACK > 0
@@ -1603,7 +1604,7 @@
   cleanup_buffer_undo_lists ();
 }
 
-void
+static void
 gc_mark_root_set (
 #ifdef NEW_GC
 		  enum gc_phase phase
@@ -1624,8 +1625,9 @@
 
   { /* staticpro() */
     Lisp_Object **p = Dynarr_begin (staticpros);
+    Elemcount len = Dynarr_length (staticpros);
     Elemcount count;
-    for (count = Dynarr_length (staticpros); count; count--, p++)
+    for (count = 0; count < len; count++, p++)
       /* Need to check if the pointer in the staticpro array is not
 	 NULL. A gc can occur after variable is added to the staticpro
 	 array and _before_ it is correctly initialized. In this case
@@ -1636,8 +1638,9 @@
 
   { /* staticpro_nodump() */
     Lisp_Object **p = Dynarr_begin (staticpros_nodump);
+    Elemcount len = Dynarr_length (staticpros_nodump);
     Elemcount count;
-    for (count = Dynarr_length (staticpros_nodump); count; count--, p++)
+    for (count = 0; count < len; count++, p++)
       /* Need to check if the pointer in the staticpro array is not
 	 NULL. A gc can occur after variable is added to the staticpro
 	 array and _before_ it is correctly initialized. In this case
@@ -1649,9 +1652,10 @@
 #ifdef NEW_GC
   { /* mcpro () */
     Lisp_Object *p = Dynarr_begin (mcpros);
+    Elemcount len = Dynarr_length (mcpros);
     Elemcount count;
-    for (count = Dynarr_length (mcpros); count; count--)
-      mark_object (*p++);
+    for (count = 0; count < len; count++, p++)
+      mark_object (*p);
   }
 #endif /* NEW_GC */
 
@@ -1707,7 +1711,7 @@
 #endif
 }
 
-void
+static void
 gc_finish_mark (void)
 {
 #ifdef NEW_GC
@@ -1754,14 +1758,14 @@
 }
 
 #ifdef NEW_GC
-void
+static void
 gc_finalize (void)
 {
   GC_SET_PHASE (FINALIZE);
   register_for_finalization ();
 }
 
-void
+static void
 gc_sweep (void)
 {
   GC_SET_PHASE (SWEEP);
@@ -1770,7 +1774,7 @@
 #endif /* NEW_GC */
 
 
-void
+static void
 gc_finish (void)
 {
 #ifdef NEW_GC
@@ -1785,7 +1789,7 @@
   recompute_need_to_garbage_collect ();
 
 #ifndef NEW_GC
-  inhibit_non_essential_conversion_operations = 0;
+  inhibit_non_essential_conversion_operations--;
 #endif /* not NEW_GC */
   gc_in_progress = 0;
 
@@ -1811,7 +1815,7 @@
 }
 
 #ifdef NEW_GC
-void
+static void
 gc_suspend_mark_phase (void)
 {
   PROFILE_RECORD_EXITING_SECTION (QSin_garbage_collection);
@@ -1820,7 +1824,7 @@
   vdb_start_dirty_bits_recording ();
 }
 
-int
+static int
 gc_resume_mark_phase (void)
 {
   PROFILE_RECORD_ENTERING_SECTION (QSin_garbage_collection);
@@ -1830,7 +1834,7 @@
   return vdb_read_dirty_bits ();
 }
 
-int
+static int
 gc_mark (int incremental)
 {
   GC_SET_PHASE (MARK);
@@ -1850,7 +1854,7 @@
   return 1;
 }
 
-int
+static int
 gc_resume_mark (int incremental)
 {
   if (!incremental)
@@ -2098,7 +2102,7 @@
 {
   staticpro_nodump (&pre_gc_cursor);
 
-  QSin_garbage_collection = build_msg_string ("(in garbage collection)");
+  QSin_garbage_collection = build_defer_string ("(in garbage collection)");
   staticpro (&QSin_garbage_collection);
 
   DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold /*
@@ -2193,7 +2197,7 @@
 image instance) in the domain of the selected frame, the mouse pointer
 will change instead of this message being printed.
 */ );
-  Vgc_message = build_string (gc_default_message);
+  Vgc_message = build_defer_string (gc_default_message);
 
   DEFVAR_LISP ("gc-pointer-glyph", &Vgc_pointer_glyph /*
 Pointer glyph used to indicate that a garbage collection is in progress.
--- a/src/gccache-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gccache-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -21,7 +21,7 @@
 
 /* Synched up with: Not in FSF. */
 
-/* Emacs uses a lot of different display attributes; for example, assume
+/* XEmacs uses a lot of different display attributes; for example, assume
    that only four fonts are in use (normal, bold, italic, and bold-italic).
    Then assume that one stipple or background is used for text selections,
    and another is used for highlighting mousable regions.  That makes 16
@@ -53,19 +53,15 @@
  */
 
 #include <config.h>
-#include <gtk/gtk.h>
 #include "lisp.h"
+#include "hash.h"
+
 #include "gccache-gtk.h"
 
 #define GC_CACHE_SIZE 100
 
 #define GCCACHE_HASH
 
-#ifdef GCCACHE_HASH
-#include "lisp.h"
-#include "hash.h"
-#endif
-
 struct gcv_and_mask {
 	GdkGCValues gcv;
 	unsigned long mask; /* contains a GdkGCValuesMask bitmask. */
@@ -145,13 +141,13 @@
     {
       gdk_gc_destroy(rest->gc);
       next = rest->next;
-      xfree (rest, struct gc_cache_cell *);
+      xfree (rest);
       rest = next;
     }
 #ifdef GCCACHE_HASH
   free_hash_table (cache->table);
 #endif
-  xfree (cache, struct gc_cache *);
+  xfree (cache);
 }
 
 GdkGC *
--- a/src/gccache-gtk.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gccache-gtk.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-/* Efficient caching of X GCs (graphics contexts).
+/* Efficient caching of GTK GCs (graphics contexts).
    Copyright (C) 1993 Free Software Foundation, Inc.
 
 
@@ -27,9 +27,11 @@
 #ifndef _GCCACHE_GTK_H_
 #define _GCCACHE_GTK_H_
 
+#include "sysgtk.h"
+
 struct gc_cache;
 struct gc_cache *make_gc_cache (GtkWidget *);
 void free_gc_cache (struct gc_cache *cache);
 GdkGC *gc_cache_lookup (struct gc_cache *, GdkGCValues *, unsigned long mask);
 
-#endif /* _XGCCACHE_H_ */
+#endif /* _GCCACHE_GTK_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gccache-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,362 @@
+/* Efficient caching of X GCs (graphics contexts).
+   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Emacs uses a lot of different display attributes; for example, assume
+   that only four fonts are in use (normal, bold, italic, and bold-italic).
+   Then assume that one stipple or background is used for text selections,
+   and another is used for highlighting mousable regions.  That makes 16
+   GCs already.  Add in the fact that another GC may be needed to display
+   the text cursor in any of those regions, and you've got 32.  Add in
+   more fonts, and it keeps increasing exponentially.
+
+   We used to keep these GCs in a cache of merged (fully qualified) faces.
+   However, a lot of other code in xterm.c used XChangeGC of existing GCs,
+   which is kind of slow and kind of random.  Also, managing the face cache
+   was tricky because it was hard to know when a face was no longer visible
+   on the frame -- we had to mark all frames as garbaged whenever a face
+   was changed, which caused an unpleasant amount of flicker (since faces are
+   created/destroyed (= changed) whenever a frame is created/destroyed.
+
+   So this code maintains a cache at the GC level instead of at the face
+   level.  There is an upper limit on the size of the cache, after which we
+   will stop creating GCs and start reusing them (reusing the least-recently-
+   used ones first).  So if faces get changed, their GCs will eventually be
+   recycled.  Also more sharing of GCs is possible.
+
+   This code uses hash tables.  It could be that, if the cache size is small
+   enough, a linear search might be faster; but I doubt it, since we need
+   `equal' comparisons, not `eq', and I expect that the optimal cache size
+   will be ~100.
+
+   Written by jwz, 14 jun 93
+ */
+
+#include <config.h>
+#include "lisp.h"
+#include "hash.h"
+
+#include "gccache-x.h"
+
+#define GC_CACHE_SIZE 100
+
+#define GCCACHE_HASH
+
+struct gcv_and_mask {
+  XGCValues gcv;
+  unsigned long mask;
+};
+
+struct gc_cache_cell {
+  GC gc;
+  struct gcv_and_mask gcvm;
+  struct gc_cache_cell *prev, *next;
+};
+
+struct gc_cache {
+  Display *dpy;		/* used only as arg to XCreateGC/XFreeGC */
+  Window window;	/* used only as arg to XCreateGC */
+  int size;
+  struct gc_cache_cell *head;
+  struct gc_cache_cell *tail;
+#ifdef GCCACHE_HASH
+  struct hash_table *table;
+#endif
+
+  int create_count;
+  int delete_count;
+};
+
+#ifdef GCCACHE_HASH
+static Hashcode
+gc_cache_hash (const void *arg)
+{
+  const struct gcv_and_mask *gcvm = (const struct gcv_and_mask *) arg;
+  unsigned long *longs = (unsigned long *) &gcvm->gcv;
+  Hashcode hash = gcvm->mask;
+  int i;
+  /* This could look at the mask and only use the used slots in the
+     hash code.  That would win in that we wouldn't have to initialize
+     every slot of the gcv when calling gc_cache_lookup.  But we need
+     the hash function to be as fast as possible; some timings should
+     be done. */
+  for (i = 0; i < (int) (sizeof (XGCValues) / sizeof (unsigned long)); i++)
+    hash = (hash << 1) ^ *longs++;
+  return hash;
+}
+
+#endif /* GCCACHE_HASH */
+
+static int
+gc_cache_eql (const void *arg1, const void *arg2)
+{
+  /* See comment in gc_cache_hash */
+  return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask));
+}
+
+struct gc_cache *
+make_gc_cache (Display *dpy, Window window)
+{
+  struct gc_cache *cache = xnew (struct gc_cache);
+  cache->dpy = dpy;
+  cache->window = window;
+  cache->size = 0;
+  cache->head = cache->tail = 0;
+  cache->create_count = cache->delete_count = 0;
+#ifdef GCCACHE_HASH
+  cache->table =
+    make_general_hash_table (GC_CACHE_SIZE, gc_cache_hash, gc_cache_eql);
+#endif
+  return cache;
+}
+
+void
+free_gc_cache (struct gc_cache *cache)
+{
+  struct gc_cache_cell *rest, *next;
+  rest = cache->head;
+  while (rest)
+    {
+      XFreeGC (cache->dpy, rest->gc);
+      next = rest->next;
+      xfree (rest);
+      rest = next;
+    }
+#ifdef GCCACHE_HASH
+  free_hash_table (cache->table);
+#endif
+  xfree (cache);
+}
+
+GC
+gc_cache_lookup (struct gc_cache *cache, XGCValues *gcv, unsigned long mask)
+{
+  struct gc_cache_cell *cell, *next, *prev;
+  struct gcv_and_mask gcvm;
+
+#ifdef DEBUG_XEMACS
+  (void) describe_gc_cache (cache, DGCCFLAG_DISABLE);
+#endif
+
+  if ((!!cache->head) != (!!cache->tail)) ABORT ();
+  if (cache->head && (cache->head->prev || cache->tail->next)) ABORT ();
+
+  gcvm.mask = mask;
+  gcvm.gcv = *gcv;	/* this copies... */
+
+#ifdef GCCACHE_HASH
+
+  /* The intermediate cast fools gcc into not outputting strict-aliasing
+     complaints */
+  if (gethash (&gcvm, cache->table, (const void **) (void *) &cell))
+
+#else /* !GCCACHE_HASH */
+
+  cell = cache->tail;	/* start at the end (most recently used) */
+  while (cell)
+    {
+      if (gc_cache_eql (&gcvm, &cell->gcvm))
+	break;
+      else
+	cell = cell->prev;
+    }
+
+  /* #### This whole file needs some serious overhauling. */
+  if (!(mask | GCTile) && cell->gc->values.tile)
+    cell = 0;
+  else if (!(mask | GCStipple) && cell->gc->values.stipple)
+    cell = 0;
+
+  if (cell)
+
+#endif /* !GCCACHE_HASH */
+
+    {
+      /* Found a cell.  Move this cell to the end of the list, so that it
+	 will be less likely to be collected than a cell that was accessed
+	 less recently.
+       */
+#if 0
+      debug_out ("Returning cached GC: %08lx\n", XE_GCONTEXT(cell));
+#endif
+      if (cell == cache->tail)
+	return cell->gc;
+
+      next = cell->next;
+      prev = cell->prev;
+      if (prev) prev->next = next;
+      if (next) next->prev = prev;
+      if (cache->head == cell) cache->head = next;
+      cell->next = 0;
+      cell->prev = cache->tail;
+      cache->tail->next = cell;
+      cache->tail = cell;
+      if (cache->head == cell) ABORT ();
+      if (cell->next) ABORT ();
+      if (cache->head->prev) ABORT ();
+      if (cache->tail->next) ABORT ();
+      return cell->gc;
+    }
+
+  /* else, cache miss. */
+
+  if (cache->size == GC_CACHE_SIZE)
+    /* Reuse the first cell on the list (least-recently-used).
+       Remove it from the list, and unhash it from the table.
+     */
+    {
+      cell = cache->head;
+      cache->head = cell->next;
+      cache->head->prev = 0;
+      if (cache->tail == cell) cache->tail = 0; /* only one */
+#if 0
+      debug_out ("Cache full, freeing GC: %08lx\n  ", XE_GCONTEXT(cell));
+#endif
+      XFreeGC (cache->dpy, cell->gc);
+      cache->delete_count++;
+#ifdef GCCACHE_HASH
+      remhash (&cell->gcvm, cache->table);
+#endif
+    }
+  else if (cache->size > GC_CACHE_SIZE)
+    ABORT ();
+  else
+    {
+      /* Allocate a new cell (don't put it in the list or table yet). */
+      cell = xnew (struct gc_cache_cell);
+      cache->size++;
+    }
+
+  /* Now we've got a cell (new or reused).  Fill it in. */
+  memcpy (&cell->gcvm.gcv, gcv, sizeof (XGCValues));
+  cell->gcvm.mask = mask;
+
+  /* Put the cell on the end of the list. */
+  cell->next = 0;
+  cell->prev = cache->tail;
+  if (cache->tail) cache->tail->next = cell;
+  cache->tail = cell;
+  if (! cache->head) cache->head = cell;
+
+  cache->create_count++;
+#ifdef GCCACHE_HASH
+  /* Hash it in the table */
+  puthash (&cell->gcvm, cell, cache->table);
+#endif
+
+  /* Now make and return the GC. */
+  cell->gc = XCreateGC (cache->dpy, cache->window, mask, gcv);
+
+  /* debug */
+  assert (cell->gc == gc_cache_lookup (cache, gcv, mask));
+
+#if 0
+  debug_out ("Returning new GC: %08lx\n  ", XE_GCONTEXT(cell));
+#endif
+  return cell->gc;
+}
+
+
+#ifdef DEBUG_XEMACS
+
+/* FLAGS
+   The flags argument is a bitwise or of any of the following:
+
+   DGCCFLAG_SUMMARY		Summary statistics for cache
+   DGCCFLAG_LIST_CELLS		If summary is being printed, print cell IDs too.
+   DGCCFLAG_CELL_DETAILS	If cell IDs are being printed, additionally
+				print the internal fields used and values.
+
+   DGCCFLAG_DEFAULT		A predefined combination giving whatever the
+				maintainers are currently interested in seeing.
+*/
+void
+describe_gc_cache (struct gc_cache *cache, int flags)
+{
+  int count = 0;
+  struct gc_cache_cell *cell = cache->head;
+
+  if (! flags & DGCCFLAG_SUMMARY) return;
+
+  stderr_out ("\nsize:    %d", cache->size);
+  stderr_out ("\ncreated: %d", cache->create_count);
+  stderr_out ("\ndeleted: %d", cache->delete_count);
+
+  if (flags & DGCCFLAG_LIST_CELLS)
+    while (cell)
+      {
+	struct gc_cache_cell *cell2;
+	int i = 0;
+	stderr_out ("\n%d:\t0x%lx  GC: 0x%08lx  hash: 0x%08lx\n",
+		    count, (long) cell, (long) XE_GCONTEXT(cell),
+		    gc_cache_hash (&cell->gcvm));
+
+	for (cell2 = cache->head; cell2; cell2 = cell2->next, i++)
+	  if (count != i &&
+	      gc_cache_hash (&cell->gcvm) == gc_cache_hash (&cell2->gcvm))
+	    stderr_out ("\tHASH COLLISION with cell %d\n", i);
+	stderr_out ("\tmask:       %8lx\n", cell->gcvm.mask);
+
+	if (flags & DGCCFLAG_CELL_DETAILS)
+	  {
+#define FROB(field) do {						\
+  if ((int)cell->gcvm.gcv.field != (~0))				\
+    stderr_out ("\t%-12s%8x\n", #field ":", (int)cell->gcvm.gcv.field);	\
+} while (0)
+	    FROB (function);
+	    FROB (plane_mask);
+	    FROB (foreground);
+	    FROB (background);
+	    FROB (line_width);
+	    FROB (line_style);
+	    FROB (cap_style);
+	    FROB (join_style);
+	    FROB (fill_style);
+	    FROB (fill_rule);
+	    FROB (arc_mode);
+	    FROB (tile);
+	    FROB (stipple);
+	    FROB (ts_x_origin);
+	    FROB (ts_y_origin);
+	    FROB (font);
+	    FROB (subwindow_mode);
+	    FROB (graphics_exposures);
+	    FROB (clip_x_origin);
+	    FROB (clip_y_origin);
+	    FROB (clip_mask);
+	    FROB (dash_offset);
+#undef FROB
+	  }
+
+	count++;
+	if (cell->next && cell == cache->tail)
+	  stderr_out ("\nERROR!  tail is here!\n\n");
+	else if (!cell->next && cell != cache->tail)
+	  stderr_out ("\nERROR!  tail is not at the end\n\n");
+	cell = cell->next;
+      }	/* while (cell) */
+
+  if (count != cache->size)
+    stderr_out ("\nERROR!  count should be %d\n\n", cache->size);
+}
+
+#endif /* DEBUG_XEMACS */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gccache-x.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,50 @@
+/* Efficient caching of X GCs (graphics contexts).
+   Copyright (C) 1993 Free Software Foundation, Inc.
+
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Written by jwz, 14 jun 93 */
+
+#ifndef INCLUDED_gccache_x_h_
+#define INCLUDED_gccache_x_h_
+
+#include <X11/Xlib.h>
+
+struct gc_cache;
+struct gc_cache *make_gc_cache (Display *, Window);
+void free_gc_cache (struct gc_cache *cache);
+GC gc_cache_lookup (struct gc_cache *, XGCValues *, unsigned long mask);
+
+#define XE_GCONTEXT(cell) (XGContextFromGC(cell->gc))
+
+#ifdef DEBUG_XEMACS
+
+void describe_gc_cache (struct gc_cache *cache, int flags);
+
+#define DGCCFLAG_DISABLE		0
+#define DGCCFLAG_SUMMARY		1 << 0
+#define DGCCFLAG_LIST_CELLS		1 << 1
+#define DGCCFLAG_CELL_DETAILS		1 << 2
+/* A combination of the flags above. */
+#define DGCCFLAG_DEFAULT		DGCCFLAG_SUMMARY | DGCCFLAG_LIST_CELLS
+#endif
+
+#endif /* INCLUDED_gccache_x_h_ */
--- a/src/general-slots.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/general-slots.h	Wed Feb 24 01:58:04 2010 -0600
@@ -83,6 +83,7 @@
 SYMBOL (Qchars);
 SYMBOL (Qcode_page);
 SYMBOL (Qcoding_system);
+SYMBOL (Qcoerce);
 SYMBOL (Qcolor);
 SYMBOL (Qcolumns);
 SYMBOL (Qcommand);
--- a/src/glade.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glade.c	Wed Feb 24 01:58:04 2010 -0600
@@ -48,7 +48,7 @@
   Lisp_Object func;
   Lisp_Object lisp_data = Qnil;
 
-  func = VOID_TO_LISP (user_data);
+  func = GET_LISP_FROM_VOID (user_data);
 
   if (NILP (func))
     {
@@ -59,7 +59,7 @@
   if (signal_data && signal_data[0])
     {
       lisp_data
-        = IGNORE_MULTIPLE_VALUES (Feval (Fread (build_string (signal_data))));
+        = IGNORE_MULTIPLE_VALUES (Feval (Fread (build_cistring (signal_data))));
     }
 
   /* obj, name, func, cb_data, object_signal, after_p */
@@ -97,7 +97,7 @@
 
   glade_xml_signal_connect_full (GLADE_XML (XGTK_OBJECT (xml)->object),
 				 (char*) XSTRING_DATA (handler_name),
-				 connector, LISP_TO_VOID (func));
+				 connector, STORE_LISP_IN_VOID (func));
   return (Qt);
 }
 
@@ -109,7 +109,7 @@
   CHECK_GTK_OBJECT (xml);
 
   glade_xml_signal_autoconnect_full (GLADE_XML (XGTK_OBJECT (xml)->object),
-				     connector, LISP_TO_VOID (Qnil));
+				     connector, STORE_LISP_IN_VOID (Qnil));
   return (Qt);
 }
 
@@ -132,7 +132,7 @@
 #else
   the_domain = GLADE_XML (XGTK_OBJECT (xml)->object)->textdomain;
 #endif  
-  return (build_string (the_domain));
+  return (build_cistring (the_domain));
 }
 
 void syms_of_glade (void)
--- a/src/glyphs-eimage.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs-eimage.c	Wed Feb 24 01:58:04 2010 -0600
@@ -100,13 +100,13 @@
 
 BEGIN_C_DECLS
 
-#ifdef WIN32_NATIVE
-/* #### Yuck!  More horrifitude.  tiffio.h, below, includes <windows.h>,
-   which defines INT32 and INT16, the former differently and incompatibly
-   from jmorecfg.h, included by jpeglib.h.  We can disable the stuff in
-   jmorecfg.h by defining XMD_H (clever, huh?); then we define these
-   typedefs the way that <windows.h> wants them (which is more correct,
-   anyway; jmorecfg.h defines INT32 as `long'). */
+#ifdef WIN32_ANY
+/* #### Yuck!  More horrifitude.  tiffio.h, below, and sysfile.h above,
+   include <windows.h>, which defines INT32 and INT16, the former
+   differently and incompatibly from jmorecfg.h, included by jpeglib.h.  We
+   can disable the stuff in jmorecfg.h by defining XMD_H (clever, huh?);
+   then we define these typedefs the way that <windows.h> wants them (which
+   is more correct, anyway; jmorecfg.h defines INT32 as `long'). */
 #define XMD_H
 typedef signed int INT32;
 typedef signed short INT16;
@@ -120,8 +120,15 @@
 #define HAVE_BOOLEAN		/* prevent jmorecfg.h from redefining it */
 #endif
 
+/* Yet more breakage... jmorecfg.h unconditionally defines FAR either as
+   "far" or as blank.  Windef.h unconditionally defines FAR as "far".
+   We'll avoid the compile warning by redefing FAR the way windows defines it,
+   after loading the JPEG headers. */
+#undef FAR
 #include <jpeglib.h>
 #include <jerror.h>
+#undef FAR
+#define FAR far
 
 END_C_DECLS
 
@@ -173,7 +180,7 @@
     retry_fclose (data->instream);
 
   if (data->eimage)
-    xfree (data->eimage, Binbyte *);
+    xfree (data->eimage);
 
   return Qnil;
 }
@@ -321,7 +328,7 @@
 
   /* Create the message */
   (*cinfo->err->format_message) (cinfo, buffer);
-  EXTERNAL_TO_C_STRING (buffer, intbuf, Qnative);
+  intbuf = EXTERNAL_TO_ITEXT (buffer, Qjpeg_error_message_encoding);
   warn_when_safe (Qjpeg, Qinfo, "%s", intbuf);
 }
 
@@ -375,7 +382,7 @@
 
 	/* Create the message */
 	(*cinfo.err->format_message) ((j_common_ptr) &cinfo, buffer);
-	errstring = build_ext_string (buffer, Qnative);
+	errstring = build_extstring (buffer, Qjpeg_error_message_encoding);
 
 	signal_image_error_2 ("JPEG decoding error",
 			      errstring, instantiator);
@@ -396,7 +403,7 @@
     /* #### This is a definite problem under Mule due to the amount of
        stack data it might allocate.  Need to be able to convert and
        write out to a file. */
-    TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
+    LISP_STRING_TO_SIZED_EXTERNAL (data, bytes, len, Qbinary);
     jpeg_memory_src (&cinfo, (JOCTET *) bytes, len);
   }
 
@@ -573,7 +580,7 @@
       FreeSavedImages(data->giffile);
     }
   if (data->eimage)
-    xfree (data->eimage, Binbyte *);
+    xfree (data->eimage);
 
   return Qnil;
 }
@@ -598,7 +605,7 @@
 }
 
 static const char *
-gif_decode_error_string ()
+gif_decode_error_string (void)
 {
   switch (GifLastError ())
     {
@@ -660,7 +667,7 @@
 
     assert (!NILP (data));
 
-    TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
+    LISP_STRING_TO_SIZED_EXTERNAL (data, bytes, len, Qbinary); 
     mem_struct.bytes = bytes;
     mem_struct.len = len;
     mem_struct.index = 0;
@@ -874,7 +881,7 @@
     retry_fclose (data->instream);
 
   if (data->eimage)
-    xfree(data->eimage, Binbyte *);
+    xfree (data->eimage);
 
   return Qnil;
 }
@@ -902,7 +909,8 @@
       /* Something blew up:
 	 just display the error (cleanup happens in the unwind) */
       signal_image_error_2 ("Error decoding PNG",
-			     build_string(png_err_stct.err_str),
+			     build_extstring (png_err_stct.err_str,
+					       Qerror_message_encoding),
 			     instantiator);
     }
 
@@ -942,7 +950,7 @@
 
     /* #### This is a definite problem under Mule due to the amount of
        stack data it might allocate.  Need to think about using Lstreams */
-    TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
+    LISP_STRING_TO_SIZED_EXTERNAL (data, bytes, len, Qbinary); 
     tbr.bytes = bytes;
     tbr.len = len;
     tbr.index = 0;
@@ -1069,7 +1077,7 @@
 	}
     }
 
-    xfree (row_pointers, Binbyte **);
+    xfree (row_pointers);
   }
 
   /* now instantiate */
@@ -1129,7 +1137,7 @@
       TIFFClose(data->tiff);
     }
   if (data->eimage)
-    xfree (data->eimage, Binbyte *);
+    xfree (data->eimage);
 
   return Qnil;
 }
@@ -1300,7 +1308,8 @@
       /* An error was signaled. No clean up is needed, as unwind handles that
 	 for us.  Just pass the error along. */
       signal_image_error_2 ("TIFF decoding error",
-			    build_string(tiff_err_data.err_str),
+			    build_extstring (tiff_err_data.err_str,
+					      Qerror_message_encoding),
 			    instantiator);
     }
   TIFFSetErrorHandler ((TIFFErrorHandler)tiff_error_func);
@@ -1318,9 +1327,7 @@
 
     /* #### This is a definite problem under Mule due to the amount of
        stack data it might allocate.  Think about Lstreams... */
-    TO_EXTERNAL_FORMAT (LISP_STRING, data,
-			ALLOCA, (bytes, len),
-			Qbinary);
+    LISP_STRING_TO_SIZED_EXTERNAL (data, bytes, len, Qbinary);
     mem_struct.bytes = bytes;
     mem_struct.len = len;
     mem_struct.index = 0;
--- a/src/glyphs-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -268,7 +268,7 @@
 #endif
 	    }
 	}
-      xfree(qtable, quant_table *);
+      xfree (qtable);
     } else {
       unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
       junk = vis->red_mask;
@@ -362,7 +362,7 @@
       if (IMAGE_INSTANCE_GTK_MASK (p))
 	write_fmt_string (printcharfun, "/0x%lx",
 			  (unsigned long) IMAGE_INSTANCE_GTK_MASK (p));
-      write_c_string (printcharfun, ")");
+      write_ascstring (printcharfun, ")");
       break;
 #ifdef HAVE_SUBWINDOWS
     case IMAGE_SUBWINDOW:
@@ -422,7 +422,7 @@
 		    gdk_pixmap_unref (IMAGE_INSTANCE_GTK_PIXMAP_SLICE (p,i));
 		    IMAGE_INSTANCE_GTK_PIXMAP_SLICE (p, i) = 0;
 		  }
-	      xfree (IMAGE_INSTANCE_GTK_PIXMAP_SLICES (p), GdkPixmap **);
+	      xfree (IMAGE_INSTANCE_GTK_PIXMAP_SLICES (p));
 	      IMAGE_INSTANCE_GTK_PIXMAP_SLICES (p) = 0;
 	    }
 
@@ -450,11 +450,11 @@
       && IMAGE_INSTANCE_TYPE (p) != IMAGE_SUBWINDOW
       && IMAGE_INSTANCE_GTK_PIXELS (p))
     {
-      xfree (IMAGE_INSTANCE_GTK_PIXELS (p), unsigned long *);
+      xfree (IMAGE_INSTANCE_GTK_PIXELS (p));
       IMAGE_INSTANCE_GTK_PIXELS (p) = 0;
     }
 
-  xfree (p->data, void *);
+  xfree (p->data);
   p->data = 0;
 }
 
@@ -907,7 +907,7 @@
       if (!gdk_image)
 	{
 	  if (pixtbl)
-	    xfree (pixtbl, unsigned long *);
+	    xfree (pixtbl);
 	  signal_image_error("EImage to GdkImage conversion failed", instantiator);
 	}
 
@@ -1089,9 +1089,9 @@
 
   if (!NILP (mask_data))
     {
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))),
-			  C_STRING_ALLOCA, gcc_may_you_rot_in_hell,
-			  Qfile_name);
+      gcc_may_you_rot_in_hell =
+	LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))),
+				 Qfile_name);
       mask =
 	pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii),
 				XINT (XCAR (mask_data)),
@@ -1116,9 +1116,7 @@
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))),
-		      C_STRING_ALLOCA, gcc_go_home,
-		      Qbinary);
+  gcc_go_home = LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), Qbinary);
 
   xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
 		     pointer_bg, dest_mask, XINT (XCAR (data)),
@@ -1256,7 +1254,7 @@
 					   &nsymbols);
   assert (!NILP (data));
 
-  LISP_STRING_TO_EXTERNAL(data, dstring, Qbinary);
+  dstring = LISP_STRING_TO_EXTERNAL (data, Qbinary);
 
   /*
    * GTK only uses the 'c' color entry of an XPM and doesn't use the symbolic
@@ -1302,7 +1300,7 @@
   }
 
   if (color_symbols)
-    xfree (color_symbols, struct color_symbol *);
+    xfree (color_symbols);
 
   if (!pixmap)
     signal_image_error ("Error reading pixmap", data);
@@ -1383,7 +1381,7 @@
 
   assert (!NILP (data));
 
-  LISP_STRING_TO_EXTERNAL (data, dstring, Qbinary);
+  dstring = LISP_STRING_TO_EXTERNAL (data, Qbinary);
 
   if ((p = strchr (dstring, ':')))
     {
@@ -1775,7 +1773,7 @@
   source = gdk_font_load (source_name);
   if (! source)
     gui_error_2 ("couldn't load font",
-			   build_string (source_name),
+			   build_cistring (source_name),
 			   data);
   if (count == 2)
     mask = 0;
@@ -1787,7 +1785,7 @@
       if (!mask)
 	/* continuable */
 	Fsignal (Qgui_error, list3 (build_msg_string ("couldn't load font"),
-				    build_string (mask_name), data));
+				    build_cistring (mask_name), data));
     }
   if (!mask)
     mask_char = 0;
@@ -1930,9 +1928,7 @@
   if (!(dest_mask & IMAGE_POINTER_MASK))
     incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-		      C_STRING_ALLOCA, name_ext,
-		      Qfile_name);
+  name_ext = LISP_STRING_TO_EXTERNAL (data, Qfile_name);
 
   if ((i = cursor_name_to_index (name_ext)) == -1)
     invalid_argument ("Unrecognized cursor-font name", data);
@@ -2131,7 +2127,7 @@
     {
       char* str;
       Lisp_Object val = IMAGE_INSTANCE_WIDGET_TEXT (p);
-      LISP_STRING_TO_EXTERNAL (val, str, Qnative);
+      str = LISP_STRING_TO_EXTERNAL (val, Qnative);
 
       /* #### Need to special case each type of GtkWidget here! */
     }
@@ -2279,7 +2275,7 @@
 
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
     {
-      LISP_STRING_TO_EXTERNAL (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm, Qnative);
+      nm = LISP_STRING_TO_EXTERNAL (IMAGE_INSTANCE_WIDGET_TEXT (ii), Qnative);
     }
 
   ii->data = xnew_and_zero (struct gtk_subwindow_data);
@@ -2534,9 +2530,7 @@
       name = item;
     }
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, name,
-		      C_STRING_ALLOCA, c_name,
-		      Qctext);
+  c_name = LISP_STRING_TO_EXTERNAL (name, Qctext);
 
   /* Dummy widget that the notbook wants to display when a tab is selected. */
   box = gtk_vbox_new (FALSE, 3);
@@ -2941,7 +2935,7 @@
      vector3 (Qxbm, Q_data,					\
 	      list3 (make_int (name##_width),			\
 		     make_int (name##_height),			\
-		     make_ext_string ((Extbyte*) name##_bits,	\
+		     make_extstring ((Extbyte*) name##_bits,	\
 				      sizeof (name##_bits),	\
 				      Qbinary))),		\
      Qglobal, Qgtk, Qnil)
@@ -2955,7 +2949,7 @@
 }
 
 /* X specific crap */
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 /* #### Should remove all this X specific stuff when GTK/GDK matures a
    bit more and provides an abstraction for it. */
 static int
--- a/src/glyphs-gtk.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs-gtk.h	Wed Feb 24 01:58:04 2010 -0600
@@ -28,11 +28,10 @@
 #define _XEMACS_GLYPHS_GTK_H_
 
 #include "glyphs.h"
+#include "sysgtk.h"
 
 #ifdef HAVE_GTK
 
-#include <gtk/gtk.h>
-
 /****************************************************************************
  *                         Image-Instance Object                            *
  ****************************************************************************/
--- a/src/glyphs-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -202,7 +202,7 @@
 
       if (!bmp_data)
 	{
-	  xfree (bmp_info, BITMAPINFO *);
+	  xfree (bmp_info);
 	  return NULL;
 	}
 
@@ -233,7 +233,7 @@
 					     sizeof(RGBQUAD) * ncolors);
       if (!bmp_info)
 	{
-	  xfree (qtable, quant_table *);
+	  xfree (qtable);
 	  return NULL;
 	}
 
@@ -251,8 +251,8 @@
 
       if (!*bmp_data)
 	{
-	  xfree (qtable, quant_table *);
-	  xfree (bmp_info, BITMAPINFO *);
+	  xfree (qtable);
+	  xfree (bmp_info);
 	  return NULL;
 	}
 
@@ -279,7 +279,7 @@
 	      *dp++ = QUANT_GET_COLOR (qtable,rd,gr,bl);
 	    }
 	}
-      xfree (qtable, quant_table *);
+      xfree (qtable);
     }
   /* fix up the standard stuff */
   bmp_info->bmiHeader.biWidth = width;
@@ -474,8 +474,8 @@
 	image_instance_add_dibitmap (ii, bmp_info, bmp_data, bmp_bits, slice,
 				     instantiator);
 
-      xfree (bmp_info, BITMAPINFO *);
-      xfree (bmp_data, Binbyte *);
+      xfree (bmp_info);
+      xfree (bmp_data);
     }
 }
 
@@ -543,7 +543,7 @@
 				 (void **) (void *) &and_bits,
 				 0,0)))
     {
-      xfree (bmp_info, BITMAPINFO *);
+      xfree (bmp_info);
       return;
     }
 
@@ -570,7 +570,7 @@
 		 bmp_info,
 		 DIB_RGB_COLORS) <= 0)
     {
-      xfree (bmp_info, BITMAPINFO *);
+      xfree (bmp_info);
       return;
     }
 
@@ -602,8 +602,8 @@
 	     bmp_info,
 	     DIB_RGB_COLORS);
 
-  xfree (bmp_info, BITMAPINFO *);
-  xfree (dibits, Binbyte *);
+  xfree (bmp_info);
+  xfree (dibits);
 
   SelectObject(hcdc, old);
 
@@ -854,7 +854,7 @@
   colortbl = xnew_array_and_zero (COLORREF, xpmimage.ncolors);
   if (!colortbl)
     {
-      xfree (*data, Binbyte *);
+      xfree (*data);
       XpmFreeXpmImage (&xpmimage);
       XpmFreeXpmInfo (&xpminfo);
       return 0;
@@ -910,8 +910,8 @@
 	}
 
     label_no_color:
-      xfree (*data, Binbyte *);
-      xfree (colortbl, COLORREF *);
+      xfree (*data);
+      xfree (colortbl);
       XpmFreeXpmImage (&xpmimage);
       XpmFreeXpmInfo (&xpminfo);
       return 0;
@@ -937,7 +937,7 @@
 
   XpmFreeXpmImage (&xpmimage);
   XpmFreeXpmInfo (&xpminfo);
-  xfree (colortbl, COLORREF *);
+  xfree (colortbl);
   return TRUE;
 }
 
@@ -968,9 +968,7 @@
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-		      ALLOCA, (bytes, len),
-		      Qbinary);
+  LISP_STRING_TO_SIZED_EXTERNAL (data, bytes, len, Qbinary);
 
   /* in case we have color symbols */
   color_symbols = extract_xpm_color_names (device, domain,
@@ -988,9 +986,9 @@
     {
       while (nsymbols--)
 	{
-	  xfree (color_symbols[nsymbols].name, Ibyte *);
+	  xfree (color_symbols[nsymbols].name);
 	}
-      xfree(color_symbols, struct color_symbol *);
+      xfree (color_symbols);
     }
 
   /* build a bitmap from the eimage */
@@ -1000,15 +998,15 @@
       signal_image_error ("XPM to EImage conversion failed",
 			  image_instance);
     }
-  xfree (eimage, Binbyte *);
+  xfree (eimage);
 
   /* Now create the pixmap and set up the image instance */
   init_image_instance_from_dibitmap (ii, bmp_info, dest_mask,
 				     bmp_data, bmp_bits, 1, instantiator,
 				     x_hot, y_hot, transp);
 
-  xfree (bmp_info, BITMAPINFO *);
-  xfree (bmp_data, Binbyte *);
+  xfree (bmp_info);
+  xfree (bmp_data);
 }
 #endif /* HAVE_XPM */
 
@@ -1055,9 +1053,7 @@
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-		      ALLOCA, (bytes, len),
-		      Qbinary);
+  LISP_STRING_TO_SIZED_EXTERNAL (data, bytes, len, Qbinary);
 
   /* Then slurp the image into memory, decoding along the way.
      The result is the image in a simple one-byte-per-pixel
@@ -1101,7 +1097,7 @@
 
 typedef struct
 {
-  CIbyte *name;
+  const Ascbyte *name;
   int	resource_id;
 } resource_t;
 
@@ -1243,7 +1239,7 @@
     {
       Extbyte *fname;
 
-      LOCAL_FILE_FORMAT_TO_TSTR (file, fname);
+      LISP_LOCAL_FILE_FORMAT_TO_TSTR (file, fname);
 
       if (NILP (resource_id))
 	resid = fname;
@@ -1254,7 +1250,7 @@
 							      type));
 
 	  if (!resid)
-	    LISP_STRING_TO_TSTR (resource_id, resid);
+	    resid = LISP_STRING_TO_TSTR (resource_id);
 	}
     }
   else if (!(resid = MAKEINTRESOURCE (resource_name_to_resource (resource_id,
@@ -1361,7 +1357,7 @@
 
   if (!new_data)
     {
-      xfree (bmp_info, BITMAPINFO *);
+      xfree (bmp_info);
       return NULL;
     }
 
@@ -1412,17 +1408,17 @@
 			     &bmp_buf,
 			     0,0);
 
-  xfree (bmp_info, BITMAPINFO *);
+  xfree (bmp_info);
 
   if (!bitmap || !bmp_buf)
     {
-      xfree (new_data, Binbyte *);
+      xfree (new_data);
       return NULL;
     }
 
   /* copy in the actual bitmap */
   memcpy (bmp_buf, new_data, height * new_width);
-  xfree (new_data, Binbyte *);
+  xfree (new_data);
 
   return bitmap;
 }
@@ -1573,9 +1569,9 @@
     {
       Binbyte *ext_data;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))),
-			  C_STRING_ALLOCA, ext_data,
-			  Qbinary);
+      ext_data =
+	(Binbyte *) LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))),
+					     Qbinary);
       mask = xbm_create_bitmap_from_data (hdc,
 					  ext_data,
 					  XINT (XCAR (mask_data)),
@@ -1603,9 +1599,9 @@
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))),
-		      C_STRING_ALLOCA, ext_data,
-		      Qbinary);
+  ext_data =
+    (const Binbyte *) LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))),
+					       Qbinary);
 
   xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
 		     pointer_bg, dest_mask, XINT (XCAR (data)),
@@ -1650,9 +1646,7 @@
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-		      C_STRING_ALLOCA, dstring,
-		      Qbinary);
+  dstring = (const Binbyte *) LISP_STRING_TO_EXTERNAL (data, Qbinary);
 
   if ((p = (Binbyte *) strchr ((char *) dstring, ':')))
     {
@@ -1724,7 +1718,7 @@
 	  write_fmt_string (printcharfun, "/0x%lx",
 			    (unsigned long) IMAGE_INSTANCE_MSWINDOWS_MASK (p));
 	}
-      write_c_string (printcharfun, ")");
+      write_ascstring (printcharfun, ")");
       break;
 
     default:
@@ -1784,7 +1778,7 @@
 		    DeleteObject (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (p, i));
 		  IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICE (p, i) = 0;
 		}
-	      xfree (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (p), HBITMAP *);
+	      xfree (IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (p));
 	      IMAGE_INSTANCE_MSWINDOWS_BITMAP_SLICES (p) = 0;
 	    }
 	  if (IMAGE_INSTANCE_MSWINDOWS_MASK (p))
@@ -1798,7 +1792,7 @@
 
   if (p->data)
     {
-      xfree (p->data, void *);
+      xfree (p->data);
       p->data = 0;
     }
 }
@@ -2032,7 +2026,7 @@
       && !NILP (IMAGE_INSTANCE_WIDGET_TEXT (p)))
     {
       Extbyte *lparam = 0;
-      LISP_STRING_TO_TSTR (IMAGE_INSTANCE_WIDGET_TEXT (p), lparam);
+      lparam = LISP_STRING_TO_TSTR (IMAGE_INSTANCE_WIDGET_TEXT (p));
       qxeSendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p),
 		      WM_SETTEXT, 0, (LPARAM) lparam);
     }
@@ -2146,7 +2140,7 @@
 			  GWL_HINSTANCE),
 			 NULL);
 
-  qxeSetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance));
+  qxeSetWindowLong (wnd, GWL_USERDATA, (LONG)STORE_LISP_IN_VOID(image_instance));
   IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd;
 }
 
@@ -2250,7 +2244,7 @@
     }
 
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
-    LISP_STRING_TO_TSTR (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm);
+    nm = LISP_STRING_TO_TSTR (IMAGE_INSTANCE_WIDGET_TEXT (ii));
 
   /* allocate space for the clip window and then allocate the clip window */
   ii->data = xnew_and_zero (struct mswindows_subwindow_data);
@@ -2272,7 +2266,7 @@
     gui_error ("window creation failed with code",
 	       make_int (GetLastError()));
 
-  C_STRING_TO_TSTR (class_, classext);
+  classext = ITEXT_TO_TSTR (class_);
 
   if ((wnd = qxeCreateWindowEx (exflags /* | WS_EX_NOPARENTNOTIFY*/,
 				classext,
@@ -2294,7 +2288,7 @@
 	       make_int (GetLastError()));
 
   IMAGE_INSTANCE_SUBWINDOW_ID (ii) = wnd;
-  qxeSetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance));
+  qxeSetWindowLong (wnd, GWL_USERDATA, (LONG)STORE_LISP_IN_VOID(image_instance));
   /* set the widget font from the widget face */
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
     qxeSendMessage (wnd, WM_SETFONT,
@@ -2486,10 +2480,11 @@
       tvitem.item.lParam =
 	mswindows_register_gui_item (image_instance, item, domain);
       tvitem.item.mask |= TVIF_PARAM;
-      LISP_STRING_TO_TSTR (XGUI_ITEM (item)->name, tvitem.item.pszText);
+      tvitem.item.pszText =
+	(LPWSTR) LISP_STRING_TO_TSTR (XGUI_ITEM (item)->name);
     }
   else
-    LISP_STRING_TO_TSTR (item, tvitem.item.pszText);
+    tvitem.item.pszText = (LPWSTR) LISP_STRING_TO_TSTR (item);
       
   tvitem.item.cchTextMax = qxetcslen ((Extbyte *) tvitem.item.pszText);
       
@@ -2602,12 +2597,12 @@
       tcitem.lParam =
 	mswindows_register_gui_item (image_instance, item, domain);
       tcitem.mask |= TCIF_PARAM;
-      LISP_STRING_TO_TSTR (XGUI_ITEM (item)->name, tcitem.pszText);
+      tcitem.pszText = (XELPTSTR) LISP_STRING_TO_TSTR (XGUI_ITEM (item)->name);
     }
   else
     {
       CHECK_STRING (item);
-      LISP_STRING_TO_TSTR (item, tcitem.pszText);
+      tcitem.pszText = (XELPTSTR) LISP_STRING_TO_TSTR (item);
     }
 
   tcitem.cchTextMax = qxetcslen ((Extbyte *) tcitem.pszText);
@@ -2813,7 +2808,7 @@
   LIST_LOOP (rest, items)
     {
       Extbyte *lparam;
-      LISP_STRING_TO_TSTR (XCAR (rest), lparam);
+      lparam = LISP_STRING_TO_TSTR (XCAR (rest));
       if (qxeSendMessage (wnd, CB_ADDSTRING, 0, (LPARAM)lparam) == CB_ERR)
 	gui_error ("error adding combo entries", instantiator);
     }
@@ -2930,8 +2925,7 @@
       SIZE size;
 
       SelectObject (hdc, mswindows_widget_hfont (face, domain, string));
-      TO_EXTERNAL_FORMAT (LISP_STRING, string, ALLOCA, (str, len),
-			  Qmswindows_tstr);
+      LISP_STRING_TO_SIZED_EXTERNAL (string, str, len, Qmswindows_tstr);
       qxeGetTextExtentPoint32 (hdc, str, len / XETCHAR_SIZE, &size);
       *width = size.cx;
     }
--- a/src/glyphs-shared.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs-shared.c	Wed Feb 24 01:58:04 2010 -0600
@@ -328,7 +328,7 @@
   int status;
   Extbyte *fileext;
 
-  LISP_STRING_TO_EXTERNAL (filename, fileext, Qnative);
+  LISP_PATHNAME_CONVERT_OUT (filename, fileext);
   if ((fstream = fopen (fileext, "r")) == NULL)
     return BitmapOpenFailed;
   status = read_bitmap_data (fstream, width, height, datap, x_hot, y_hot);
--- a/src/glyphs-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -272,7 +272,7 @@
 #endif
 	    }
 	}
-      xfree (qtable, quant_table *);
+      xfree (qtable);
     } else {
       unsigned long rshift,gshift,bshift,rbits,gbits,bbits,junk;
       junk = vis->red_mask;
@@ -370,7 +370,7 @@
 	  write_fmt_string (printcharfun, "/0x%lx",
 			    (unsigned long) IMAGE_INSTANCE_X_MASK (p));
 	}
-      write_c_string (printcharfun, ")");
+      write_ascstring (printcharfun, ")");
       break;
     default:
       break;
@@ -438,7 +438,7 @@
 		    XFreePixmap (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE (p,i));
 		    IMAGE_INSTANCE_X_PIXMAP_SLICE (p, i) = 0;
 		  }
-	      xfree (IMAGE_INSTANCE_X_PIXMAP_SLICES (p), Pixmap *);
+	      xfree (IMAGE_INSTANCE_X_PIXMAP_SLICES (p));
 	      IMAGE_INSTANCE_X_PIXMAP_SLICES (p) = 0;
 	    }
 
@@ -466,11 +466,11 @@
       && IMAGE_INSTANCE_TYPE (p) != IMAGE_SUBWINDOW
       && IMAGE_INSTANCE_X_PIXELS (p))
     {
-      xfree (IMAGE_INSTANCE_X_PIXELS (p), unsigned long *);
+      xfree (IMAGE_INSTANCE_X_PIXELS (p));
       IMAGE_INSTANCE_X_PIXELS (p) = 0;
     }
 
-  xfree (p->data, void *);
+  xfree (p->data);
   p->data = 0;
 }
 
@@ -594,15 +594,15 @@
 	Extbyte *pathext;
 	SubstitutionRec subs[1];
 	subs[0].match = 'B';
-	LISP_STRING_TO_EXTERNAL (name, subs[0].substitution, Qfile_name);
-	C_STRING_TO_EXTERNAL (path, pathext, Qfile_name);
+	LISP_PATHNAME_CONVERT_OUT (name, subs[0].substitution);
+	pathext = ITEXT_TO_EXTERNAL (path, Qfile_name);
 	/* #### Motif uses a big hairy default if $XBMLANGPATH isn't set.
 	   We don't.  If you want it used, set it. */
 	if (pathext &&
 	    (pathext = XtResolvePathname (display, "bitmaps", 0, 0, pathext,
 					  subs, XtNumber (subs), 0)))
 	  {
-	    name = build_ext_string (pathext, Qfile_name);
+	    name = build_extstring (pathext, Qfile_name);
 	    XtFree (pathext);
 	    return (name);
 	  }
@@ -620,7 +620,7 @@
 	{
 	  Ibyte *path;
 
-	  EXTERNAL_TO_C_STRING (value.addr, path, Qfile_name);
+	  path = EXTERNAL_TO_ITEXT (value.addr, Qfile_name);
 	  Vx_bitmap_file_path = split_env_path (0, path);
 	}
       Vx_bitmap_file_path = nconc2 (Vx_bitmap_file_path,
@@ -1033,7 +1033,7 @@
       if (!ximage)
 	{
 	  if (pixtbl)
-	    xfree (pixtbl, unsigned long *);
+	    xfree (pixtbl);
 	  signal_image_error ("EImage to XImage conversion failed",
 			      instantiator);
 	}
@@ -1051,7 +1051,7 @@
 	{
 	  if (ximage->data)
 	    {
-	      xfree (ximage->data, char *);
+	      xfree (ximage->data);
 	      ximage->data = 0;
 	    }
 	  XDestroyImage (ximage);
@@ -1228,8 +1228,8 @@
     {
       CBinbyte *ext_data;
 
-      LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), ext_data,
-			       Qbinary);
+      ext_data = LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), 
+					  Qbinary);
       mask = pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii),
 				     XINT (XCAR (mask_data)),
 				     XINT (XCAR (XCDR (mask_data))),
@@ -1253,7 +1253,7 @@
 
   assert (!NILP (data));
 
-  LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), ext_data, Qbinary);
+  ext_data = LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), Qbinary);
 
   xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
 		     pointer_bg, dest_mask, XINT (XCAR (data)),
@@ -1338,8 +1338,8 @@
       if (! XAllocColor (dpy, cmap, &color))
 	ABORT ();  /* it must be allocable since we're just duplicating it */
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (cons), C_STRING_MALLOC,
-			  symbols[i].name, Qctext);
+      
+      symbols[i].name = LISP_STRING_TO_EXTERNAL_MALLOC (XCAR (cons), Qctext);
       symbols[i].pixel = color.pixel;
       symbols[i].value = 0;
       free_cons (cons);
@@ -1460,7 +1460,7 @@
   {
     Extbyte *dataext;
 
-    LISP_STRING_TO_EXTERNAL (data, dataext, Qctext);
+    dataext = LISP_STRING_TO_EXTERNAL (data, Qctext);
 
     result =
       XpmCreatePixmapFromBuffer (dpy,
@@ -1474,8 +1474,8 @@
       int i;
 
       for (i = 0; i < (int) xpmattrs.numsymbols; i++)
-	xfree (color_symbols[i].name, char *);
-      xfree (color_symbols, XpmColorSymbol *);
+	xfree (color_symbols[i].name);
+      xfree (color_symbols);
       xpmattrs.colorsymbols = 0; /* in case XpmFreeAttr is too smart... */
       xpmattrs.numsymbols = 0;
     }
@@ -1612,9 +1612,7 @@
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-		      C_STRING_ALLOCA, dstring,
-		      Qbinary);
+  dstring = (const Binbyte *) LISP_STRING_TO_EXTERNAL (data, Qbinary);
 
   if ((p = (Binbyte *) strchr ((char *) dstring, ':')))
     {
@@ -1787,7 +1785,7 @@
   if (dest_mask & IMAGE_POINTER_MASK)
     {
       const char *name_ext;
-      LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name);
+      LISP_PATHNAME_CONVERT_OUT (data, name_ext);
       if (XmuCursorNameToIndex (name_ext) != -1)
 	{
 	  result = alist_to_tagged_vector (Qcursor_font, alist);
@@ -1851,13 +1849,11 @@
 {
   Font font;
   int (*old_handler) (Display *, XErrorEvent *);
-  Extbyte *nameext;
 
   XLoadFont_got_error = 0;
   XSync (dpy, 0);
   old_handler = XSetErrorHandler (XLoadFont_error_handler);
-  C_STRING_TO_EXTERNAL (name, nameext, Qfile_name);
-  font = XLoadFont (dpy, nameext);
+  font = XLoadFont (dpy, ITEXT_TO_EXTERNAL (name, Qfile_name));
   XSync (dpy, 0);
   XSetErrorHandler (old_handler);
   if (XLoadFont_got_error) return 0;
@@ -1923,7 +1919,7 @@
   source = safe_XLoadFont (dpy, source_name);
   if (! source)
     signal_error_2 (Qgui_error,
-		    "couldn't load font", build_intstring (source_name), data);
+		    "couldn't load font", build_istring (source_name), data);
   if (count == 2)
     mask = 0;
   else if (!mask_name[0])
@@ -1934,7 +1930,7 @@
       if (!mask)
 	signal_continuable_error_2 (Qgui_error,
 				    "couldn't load font",
-				    build_intstring (mask_name), data);
+				    build_istring (mask_name), data);
     }
   if (!mask)
     mask_char = 0;
@@ -1990,7 +1986,7 @@
   if (!(dest_mask & IMAGE_POINTER_MASK))
     incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK);
 
-  LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name);
+  LISP_PATHNAME_CONVERT_OUT (data, name_ext);
   if ((i = XmuCursorNameToIndex (name_ext)) == -1)
     invalid_argument ("Unrecognized cursor-font name", data);
 
@@ -2201,7 +2197,7 @@
     {
       Extbyte* str;
       Lisp_Object val = IMAGE_INSTANCE_WIDGET_TEXT (p);
-      LISP_STRING_TO_EXTERNAL (val, str, Qnative);
+      str = LISP_STRING_TO_EXTERNAL (val, Qlwlib_encoding);
       wv->value = str;
     }
 
@@ -2333,8 +2329,7 @@
 			 (FRAME_DEVICE (XFRAME (sw->frame))));
 
   LISP_TO_EXTERNAL (property, propext, Qctext);
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-		      ALLOCA, (dataext, datalen), Qctext);
+  LISP_STRING_TO_SIZED_EXTERNAL (data, dataext, datalen, Qctext); 
   property_atom = XInternAtom (dpy, propext, False);
   XChangeProperty (dpy, sw->subwindow, property_atom, XA_STRING, 8,
 		   PropModeReplace, dataext, datalen);
@@ -2376,13 +2371,13 @@
 					 face,
 					 domain));
     XFontStruct *fs = FONT_INSTANCE_X_FONT (fi);
-#ifdef USE_XFT
+#ifdef HAVE_XFT
     XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
 
     if (rf)
       {
 	/* #### What to do about Motif? */
-	lw_add_widget_value_arg (wv, XtNxftFont, (XtArgVal) rf);
+	lw_add_widget_value_arg (wv, (String) XtNxftFont, (XtArgVal) rf);
       }
 #endif
 
@@ -2395,12 +2390,12 @@
 	lw_add_widget_value_arg (wv, XtNfont, (XtArgVal) fs);
       }
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
     /* #### sanity check, should wrap in appropriate ERROR_CHECK macro */
     if (!rf && !fs)
       warn_when_safe_lispobj
 	(intern ("xft"), Qdebug,
-	 Fcons (build_string ("missing font in update_widget_face"),
+	 Fcons (build_msg_string ("missing font in update_widget_face"),
 		Fface_name (face)));
 #endif
   }
@@ -2469,7 +2464,8 @@
   IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
 
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
-    LISP_STRING_TO_EXTERNAL (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm, Qnative);
+    nm = LISP_STRING_TO_EXTERNAL (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+				  Qlwlib_encoding);
 
   ii->data = xnew_and_zero (struct x_subwindow_data);
 
@@ -2560,7 +2556,7 @@
   if (EQ (prop, Q_text))
     {
       widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii));
-      return build_ext_string (wv->value, Qnative);
+      return build_extstring (wv->value, Qlwlib_encoding);
     }
   return Qunbound;
 }
@@ -2775,8 +2771,9 @@
 		  unsigned int num_children, i;
 		  Widget* children;
 
-		  LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name,
-					   name, Qnative);
+		  name =
+		    LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name,
+					     Qlwlib_encoding);
 		  /* The name may contain a `.' which confuses
 		     XtNameToWidget, so we do it ourselves. */
 		  children =
@@ -3012,7 +3009,7 @@
      vector3 (Qxbm, Q_data,					\
 	      list3 (make_int (name##_width),			\
 		     make_int (name##_height),			\
-		     make_ext_string ((Extbyte *) name##_bits,	\
+		     make_extstring ((Extbyte *) name##_bits,	\
 				      sizeof (name##_bits),	\
 				      Qbinary))),		\
      Qglobal, Qx, Qnil)
--- a/src/glyphs.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs.c	Wed Feb 24 01:58:04 2010 -0600
@@ -592,7 +592,7 @@
 
   specbind (Qinhibit_quit, Qt);
   record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
-  temp_buffer = Fget_buffer_create (build_string (" *pixmap conversion*"));
+  temp_buffer = Fget_buffer_create (build_ascstring (" *pixmap conversion*"));
   GCPRO1 (temp_buffer);
   set_buffer_internal (XBUFFER (temp_buffer));
   Ferase_buffer (Qnil);
@@ -660,7 +660,7 @@
   if (!NILP (value))
     {
       Lisp_Object window;
-      window = VOID_TO_LISP (flag_closure);
+      window = GET_LISP_FROM_VOID (flag_closure);
       assert (EQ (XIMAGE_INSTANCE_DOMAIN (value), window));
     }
 
@@ -676,7 +676,7 @@
   assert (!NILP (w->subwindow_instance_cache));
   elisp_maphash (check_instance_cache_mapper,
 		 w->subwindow_instance_cache,
-		 LISP_TO_VOID (window));
+		 STORE_LISP_IN_VOID (window));
 }
 
 void
@@ -992,8 +992,7 @@
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<image-instance 0x%x>",
-	   ii->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
   write_fmt_string_lisp (printcharfun, "#<image-instance (%s) ", 1,
 			 Fimage_instance_type (obj));
   if (!NILP (ii->name))
@@ -1017,7 +1016,7 @@
 	  Lisp_Object filename = IMAGE_INSTANCE_PIXMAP_FILENAME (ii);
 	  s = qxestrrchr (XSTRING_DATA (filename), '/');
 	  if (s)
-	    print_internal (build_intstring (s + 1), printcharfun, 1);
+	    print_internal (build_istring (s + 1), printcharfun, 1);
 	  else
 	    print_internal (filename, printcharfun, 1);
 	}
@@ -1033,37 +1032,37 @@
       if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)) ||
 	  !NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii)))
 	{
-	  write_c_string (printcharfun, " @");
+	  write_ascstring (printcharfun, " @");
 	  if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)))
 	    write_fmt_string (printcharfun, "%ld",
 			      XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (ii)));
 	  else
-	    write_c_string (printcharfun, "??");
-	  write_c_string (printcharfun, ",");
+	    write_ascstring (printcharfun, "??");
+	  write_ascstring (printcharfun, ",");
 	  if (!NILP (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii)))
 	    write_fmt_string (printcharfun, "%ld",
 			      XINT (IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (ii)));
 	  else
-	    write_c_string (printcharfun, "??");
+	    write_ascstring (printcharfun, "??");
 	}
       if (!NILP (IMAGE_INSTANCE_PIXMAP_FG (ii)) ||
 	  !NILP (IMAGE_INSTANCE_PIXMAP_BG (ii)))
 	{
-	  write_c_string (printcharfun, " (");
+	  write_ascstring (printcharfun, " (");
 	  if (!NILP (IMAGE_INSTANCE_PIXMAP_FG (ii)))
 	    {
 	      print_internal
 		(XCOLOR_INSTANCE
 		 (IMAGE_INSTANCE_PIXMAP_FG (ii))->name, printcharfun, 0);
 	    }
-	  write_c_string (printcharfun, "/");
+	  write_ascstring (printcharfun, "/");
 	  if (!NILP (IMAGE_INSTANCE_PIXMAP_BG (ii)))
 	    {
 	      print_internal
 		(XCOLOR_INSTANCE
 		 (IMAGE_INSTANCE_PIXMAP_BG (ii))->name, printcharfun, 0);
 	    }
-	  write_c_string (printcharfun, ")");
+	  write_ascstring (printcharfun, ")");
 	}
       break;
 
@@ -1087,17 +1086,17 @@
 	 are specific to a particular frame so we want to print in their
 	 description what that frame is. */
 
-      write_c_string (printcharfun, " on #<");
+      write_ascstring (printcharfun, " on #<");
       {
 	struct frame* f  = XFRAME (IMAGE_INSTANCE_FRAME (ii));
 
 	if (!FRAME_LIVE_P (f))
-	  write_c_string (printcharfun, "dead");
+	  write_ascstring (printcharfun, "dead");
 	else
-	  write_c_string (printcharfun,
+	  write_ascstring (printcharfun,
 			  DEVICE_TYPE_NAME (XDEVICE (FRAME_DEVICE (f))));
       }
-      write_c_string (printcharfun, "-frame>");
+      write_ascstring (printcharfun, "-frame>");
       write_fmt_string (printcharfun, " 0x%p",
 			IMAGE_INSTANCE_SUBWINDOW_ID (ii));
 
@@ -1133,7 +1132,8 @@
 }
 
 static int
-image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		      int UNUSED (foldcase))
 {
   Lisp_Image_Instance *i1 = XIMAGE_INSTANCE (obj1);
   Lisp_Image_Instance *i2 = XIMAGE_INSTANCE (obj2);
@@ -2216,34 +2216,35 @@
 /*                              error helpers                           */
 /************************************************************************/
 DOESNT_RETURN
-signal_image_error (const CIbyte *reason, Lisp_Object frob)
+signal_image_error (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qimage_conversion_error, reason, frob);
 }
 
 DOESNT_RETURN
-signal_image_error_2 (const CIbyte *reason, Lisp_Object frob0, Lisp_Object frob1)
+signal_image_error_2 (const Ascbyte *reason, Lisp_Object frob0,
+		      Lisp_Object frob1)
 {
   signal_error_2 (Qimage_conversion_error, reason, frob0, frob1);
 }
 
 DOESNT_RETURN
-signal_double_image_error (const CIbyte *string1, const CIbyte *string2,
+signal_double_image_error (const Ascbyte *reason1, const Ascbyte *reason2,
 			   Lisp_Object data)
 {
   signal_error_1 (Qimage_conversion_error,
-		list3 (build_msg_string (string1),
-		       build_msg_string (string2),
+		list3 (build_msg_string (reason1),
+		       build_msg_string (reason2),
 		       data));
 }
 
 DOESNT_RETURN
-signal_double_image_error_2 (const CIbyte *string1, const CIbyte *string2,
+signal_double_image_error_2 (const Ascbyte *reason1, const Ascbyte *reason2,
 			     Lisp_Object data1, Lisp_Object data2)
 {
   signal_error_1 (Qimage_conversion_error,
-		list4 (build_msg_string (string1),
-		       build_msg_string (string2),
+		list4 (build_msg_string (reason1),
+		       build_msg_string (reason2),
 		       data1, data2));
 }
 
@@ -2375,9 +2376,10 @@
 {
   struct font_metric_info fm;
   unsigned char charsets[NUM_LEADING_BYTES];
-  struct face_cachel frame_cachel;
-  struct face_cachel *cachel;
-  Lisp_Object frame = DOMAIN_FRAME (domain);
+  struct face_cachel cachel;
+  struct face_cachel *the_cachel;
+  Lisp_Object window = DOMAIN_WINDOW (domain);
+  Lisp_Object frame  = DOMAIN_FRAME  (domain);
 
   CHECK_STRING (string);
 
@@ -2392,18 +2394,22 @@
       /* Fallback to the default face if none was provided. */
       if (!NILP (face))
 	{
-	  reset_face_cachel (&frame_cachel);
-	  update_face_cachel_data (&frame_cachel, frame, face);
-	  cachel = &frame_cachel;
+	  reset_face_cachel (&cachel);
+	  update_face_cachel_data (&cachel,
+				   /* #### NOTE: in fact, I'm not sure if it's
+				      #### possible to *not* get a window
+				      #### here, but you never know...
+				      #### -- dvl */
+				   NILP (window) ? frame : window,
+				   face);
+	  the_cachel = &cachel;
 	}
       else
-	{
-	  cachel = WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain),
-				       DEFAULT_INDEX);
-	}
-
-      ensure_face_cachel_complete (cachel, domain, charsets);
-      face_cachel_charset_font_metric_info (cachel, charsets, &fm);
+	the_cachel = WINDOW_FACE_CACHEL (DOMAIN_XWINDOW (domain),
+					 DEFAULT_INDEX);
+
+      ensure_face_cachel_complete (the_cachel, domain, charsets);
+      face_cachel_charset_font_metric_info (the_cachel, charsets, &fm);
 
       *height = fm.ascent + fm.descent;
       /* #### descent only gets set if we query the height as well. */
@@ -2413,48 +2419,33 @@
 
   /* Compute width */
   if (width)
-    {
-      if (!NILP (face))
-	*width = redisplay_frame_text_width_string (XFRAME (frame),
-						    face,
-						    0, string, 0, -1);
-      else
-	*width = redisplay_frame_text_width_string (XFRAME (frame),
-						    Vdefault_face,
-						    0, string, 0, -1);
-    }
+    *width = redisplay_text_width_string (domain,
+					  NILP (face) ? Vdefault_face : face,
+					  0, string, 0, -1);
 }
 
 Lisp_Object
 query_string_font (Lisp_Object string, Lisp_Object face, Lisp_Object domain)
 {
   unsigned char charsets[NUM_LEADING_BYTES];
-  struct face_cachel frame_cachel;
-  struct face_cachel *cachel;
+  struct face_cachel cachel;
   int i;
-  Lisp_Object frame = DOMAIN_FRAME (domain);
+  Lisp_Object window = DOMAIN_WINDOW (domain);
+  Lisp_Object frame  = DOMAIN_FRAME  (domain);
 
   /* Compute string font info */
   find_charsets_in_ibyte_string (charsets,
-				   XSTRING_DATA   (string),
-				   XSTRING_LENGTH (string));
-
-  reset_face_cachel (&frame_cachel);
-  update_face_cachel_data (&frame_cachel, frame, face);
-  cachel = &frame_cachel;
-
-  ensure_face_cachel_complete (cachel, domain, charsets);
+				 XSTRING_DATA   (string),
+				 XSTRING_LENGTH (string));
+
+  reset_face_cachel (&cachel);
+  update_face_cachel_data (&cachel, NILP (window) ? frame : window, face);
+  ensure_face_cachel_complete (&cachel, domain, charsets);
 
   for (i = 0; i < NUM_LEADING_BYTES; i++)
-    {
-      if (charsets[i])
-	{
-	  return FACE_CACHEL_FONT (cachel,
-				   charset_by_leading_byte (i +
-							    MIN_LEADING_BYTE));
-
-	}
-    }
+    if (charsets[i])
+      return FACE_CACHEL_FONT
+	((&cachel), charset_by_leading_byte (i + MIN_LEADING_BYTE));
 
   return Qnil;			/* NOT REACHED */
 }
@@ -2702,7 +2693,7 @@
       int len = (w + 7) / 8 * h;
 
       retval = list3 (make_int (w), make_int (h),
-		      make_ext_string ((Extbyte *) data, len, Qbinary));
+		      make_extstring ((Extbyte *) data, len, Qbinary));
       XFree (data);
       return retval;
     }
@@ -2755,11 +2746,11 @@
     {
       mask_file = MAYBE_LISP_CONTYPE_METH
 	(decode_console_type(console_type, ERROR_ME),
-	 locate_pixmap_file, (concat2 (file, build_string ("Mask"))));
+	 locate_pixmap_file, (concat2 (file, build_ascstring ("Mask"))));
       if (NILP (mask_file))
 	mask_file = MAYBE_LISP_CONTYPE_METH
 	  (decode_console_type(console_type, ERROR_ME),
-	   locate_pixmap_file, (concat2 (file, build_string ("msk"))));
+	   locate_pixmap_file, (concat2 (file, build_ascstring ("msk"))));
     }
 
   if (!NILP (mask_file))
@@ -2942,7 +2933,7 @@
 #ifdef HAVE_GTK
 /* Gtk has to be gratuitously different, eh? */
 Lisp_Object
-pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
+pixmap_to_lisp_data (Lisp_Object name, int UNUSED (ok_if_data_invalid))
 {
   return (make_string_from_file (name));
 }
@@ -2956,7 +2947,7 @@
   Ibyte *resolved;
 
   LISP_PATHNAME_RESOLVE_LINKS (name, resolved);
-  C_STRING_TO_EXTERNAL (resolved, fname, Qfile_name);
+  fname = ITEXT_TO_EXTERNAL (resolved, Qfile_name);
   result = XpmReadFileToData (fname, &data);
 
   if (result == XpmSuccess)
@@ -2964,7 +2955,7 @@
       Lisp_Object retval = Qnil;
       struct buffer *old_buffer = current_buffer;
       Lisp_Object temp_buffer =
-	Fget_buffer_create (build_string (" *pixmap conversion*"));
+	Fget_buffer_create (build_ascstring (" *pixmap conversion*"));
       int elt;
       int height, width, ncolors;
       struct gcpro gcpro1, gcpro2, gcpro3;
@@ -2976,19 +2967,19 @@
       set_buffer_internal (XBUFFER (temp_buffer));
       Ferase_buffer (Qnil);
 
-      buffer_insert_c_string (current_buffer, "/* XPM */\r");
-      buffer_insert_c_string (current_buffer, "static char *pixmap[] = {\r");
+      buffer_insert_ascstring (current_buffer, "/* XPM */\r");
+      buffer_insert_ascstring (current_buffer, "static char *pixmap[] = {\r");
 
       sscanf (data[0], "%d %d %d", &height, &width, &ncolors);
       for (elt = 0; elt <= width + ncolors; elt++)
 	{
-	  buffer_insert_c_string (current_buffer, "\"");
-	  buffer_insert_c_string (current_buffer, data[elt]);
+	  buffer_insert_ascstring (current_buffer, "\"");
+	  buffer_insert_ascstring (current_buffer, data[elt]);
 
 	  if (elt < width + ncolors)
-	    buffer_insert_c_string (current_buffer, "\",\r");
+	    buffer_insert_ascstring (current_buffer, "\",\r");
 	  else
-	    buffer_insert_c_string (current_buffer, "\"};\r");
+	    buffer_insert_ascstring (current_buffer, "\"};\r");
 	}
 
       retval = Fbuffer_substring (Qnil, Qnil, Qnil);
@@ -3699,7 +3690,7 @@
   Lisp_Glyph *glyph = XGLYPH (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<glyph 0x%x>", glyph->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string_lisp (printcharfun, "#<glyph (%s", 1, Fglyph_type (obj));
   write_fmt_string_lisp (printcharfun, ") %S", 1, glyph->image);
@@ -3713,7 +3704,8 @@
    This isn't concerned with "unspecified" attributes, that's what
    #'glyph-differs-from-default-p is for. */
 static int
-glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+glyph_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	     int UNUSED (foldcase))
 {
   Lisp_Glyph *g1 = XGLYPH (obj1);
   Lisp_Glyph *g2 = XGLYPH (obj2);
@@ -3724,7 +3716,7 @@
 	  internal_equal (g1->contrib_p, g2->contrib_p, depth) &&
 	  internal_equal (g1->baseline,  g2->baseline,  depth) &&
 	  internal_equal (g1->face,      g2->face,      depth) &&
-	  !plists_differ (g1->plist,     g2->plist, 0, 0, depth + 1));
+	  !plists_differ (g1->plist,     g2->plist, 0, 0, depth + 1, 0));
 }
 
 static Hashcode
@@ -4279,9 +4271,19 @@
 
 
 /*****************************************************************************
- *                     glyph cachel functions	     *
+ *                          glyph cachel functions                           *
  *****************************************************************************/
 
+#define NUM_PRECACHED_GLYPHS 6
+#define LOOP_OVER_PRECACHED_GLYPHS			\
+  FROB (Vcontinuation_glyph, CONT_GLYPH_INDEX)		\
+  FROB (Vtruncation_glyph, TRUN_GLYPH_INDEX)		\
+  FROB (Vhscroll_glyph, HSCROLL_GLYPH_INDEX)		\
+  FROB (Vcontrol_arrow_glyph, CONTROL_GLYPH_INDEX)	\
+  FROB (Voctal_escape_glyph, OCT_ESC_GLYPH_INDEX)	\
+  FROB (Vinvisible_text_glyph, INVIS_GLYPH_INDEX)
+
+
 /* #### All of this is 95% copied from face cachels.  Consider
   consolidating.
 
@@ -4355,6 +4357,27 @@
   Dynarr_add (w->glyph_cachels, new_cachel);
 }
 
+#ifdef ERROR_CHECK_GLYPHS
+
+/* The precached glyphs should always occur in slots 0 - 5, with each glyph in the
+   slot reserved for it.  Meanwhile any other glyphs should always occur in slots
+   6 or greater. */
+static void
+verify_glyph_index (Lisp_Object glyph, glyph_index idx)
+{
+  if (0)
+    ;
+#define FROB(glyph_obj, gindex)			\
+  else if (EQ (glyph, glyph_obj))		\
+    assert (gindex == idx);
+  LOOP_OVER_PRECACHED_GLYPHS
+  else
+    assert (idx >= NUM_PRECACHED_GLYPHS);
+#undef FROB
+}
+
+#endif /* ERROR_CHECK_GLYPHS */
+
 glyph_index
 get_glyph_cachel_index (struct window *w, Lisp_Object glyph)
 {
@@ -4370,6 +4393,9 @@
 
       if (EQ (cachel->glyph, glyph) && !NILP (glyph))
 	{
+#ifdef ERROR_CHECK_GLYPHS
+	  verify_glyph_index (glyph, elt);
+#endif /* ERROR_CHECK_GLYPHS */
 	  update_glyph_cachel_data (w, glyph, cachel);
 	  return elt;
 	}
@@ -4384,12 +4410,10 @@
 reset_glyph_cachels (struct window *w)
 {
   Dynarr_reset (w->glyph_cachels);
-  get_glyph_cachel_index (w, Vcontinuation_glyph);
-  get_glyph_cachel_index (w, Vtruncation_glyph);
-  get_glyph_cachel_index (w, Vhscroll_glyph);
-  get_glyph_cachel_index (w, Vcontrol_arrow_glyph);
-  get_glyph_cachel_index (w, Voctal_escape_glyph);
-  get_glyph_cachel_index (w, Vinvisible_text_glyph);
+#define FROB(glyph_obj, gindex)			\
+  get_glyph_cachel_index (w, glyph_obj);
+  LOOP_OVER_PRECACHED_GLYPHS
+#undef FROB
 }
 
 void
@@ -4397,19 +4421,18 @@
 {
   int elt;
 
+  /* A previous bug resulted from the glyph cachels never getting reset
+     in the minibuffer window after creation, and another glyph added before
+     we got a chance to add the six normal glyphs that should go first, and
+     we got called with only one glyph present. */
+  assert (Dynarr_length (w->glyph_cachels) >= NUM_PRECACHED_GLYPHS);
   /* We need to have a dirty flag to tell if the glyph has changed.
      We can check to see if each glyph variable is actually a
      completely different glyph, though. */
 #define FROB(glyph_obj, gindex)						\
   update_glyph_cachel_data (w, glyph_obj,				\
-			      Dynarr_atp (w->glyph_cachels, gindex))
-
-  FROB (Vcontinuation_glyph, CONT_GLYPH_INDEX);
-  FROB (Vtruncation_glyph, TRUN_GLYPH_INDEX);
-  FROB (Vhscroll_glyph, HSCROLL_GLYPH_INDEX);
-  FROB (Vcontrol_arrow_glyph, CONTROL_GLYPH_INDEX);
-  FROB (Voctal_escape_glyph, OCT_ESC_GLYPH_INDEX);
-  FROB (Vinvisible_text_glyph, INVIS_GLYPH_INDEX);
+			    Dynarr_atp (w->glyph_cachels, gindex));
+  LOOP_OVER_PRECACHED_GLYPHS
 #undef FROB
 
   for (elt = 0; elt < Dynarr_length (w->glyph_cachels); elt++)
@@ -4452,7 +4475,7 @@
 
 
 /*****************************************************************************
- *                     subwindow cachel functions	     *
+ *                        subwindow cachel functions                         *
  *****************************************************************************/
 /* Subwindows are curious in that you have to physically unmap them to
    not display them. It is problematic deciding what to do in
@@ -4549,7 +4572,7 @@
 }
 
 /*****************************************************************************
- *                              subwindow exposure ignorance                    *
+ *                           subwindow exposure ignorance                    *
  *****************************************************************************/
 /* when we unmap subwindows the associated window system will generate
    expose events. This we do not want as redisplay already copes with
--- a/src/glyphs.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/glyphs.h	Wed Feb 24 01:58:04 2010 -0600
@@ -386,14 +386,16 @@
 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
                                                  int given_dest_mask,
                                                  int desired_dest_mask));
-DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object));
-DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object,
-					     Lisp_Object));
-DECLARE_DOESNT_RETURN (signal_double_image_error (const char *string1,
-						  const char *string2,
+DECLARE_DOESNT_RETURN (signal_image_error (const Ascbyte *reason,
+					   Lisp_Object frob));
+DECLARE_DOESNT_RETURN (signal_image_error_2 (const Ascbyte *reason,
+					     Lisp_Object frob0,
+					     Lisp_Object frob1));
+DECLARE_DOESNT_RETURN (signal_double_image_error (const Ascbyte *reason1,
+						  const Ascbyte *reason2,
 						  Lisp_Object data));
-DECLARE_DOESNT_RETURN (signal_double_image_error_2 (const char *string1,
-						    const char *string2,
+DECLARE_DOESNT_RETURN (signal_double_image_error_2 (const Ascbyte *reason1,
+						    const Ascbyte *reason2,
 						    Lisp_Object data1,
 						    Lisp_Object data2));
 
--- a/src/gpmevent.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gpmevent.c	Wed Feb 24 01:58:04 2010 -0600
@@ -186,7 +186,7 @@
 
 static void turn_off_gpm (char *process_name)
 {
-  Lisp_Object process = Fget_process (build_string (process_name));
+  Lisp_Object process = Fget_process (build_cistring (process_name));
   int fd = -1;
 
   if (NILP (process))
@@ -201,7 +201,7 @@
 
   clear_gpm_state (fd);
 
-  Fdelete_process (build_string (process_name));
+  Fdelete_process (build_cistring (process_name));
 }
 
 #ifdef TIOCLINUX
@@ -493,7 +493,7 @@
   snprintf (process_name, sizeof(process_name) - 1, "gpm for %s",
 	    console_name);
 
-  proc = Fget_process (build_string (process_name));
+  proc = Fget_process (build_cistring (process_name));
 
   if (NILP (proc))
     return (Qnil);
@@ -585,7 +585,7 @@
       set_descriptor_non_blocking (gpm_fd);
       store_gpm_state (gpm_fd);
       gpm_process =
-	connect_to_file_descriptor (build_string (process_name), Qnil,
+	connect_to_file_descriptor (build_cistring (process_name), Qnil,
 				    make_int (gpm_fd),
 				    make_int (gpm_fd));
 
--- a/src/gtk-glue.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gtk-glue.c	Wed Feb 24 01:58:04 2010 -0600
@@ -25,6 +25,7 @@
 GtkType GTK_TYPE_OBJECT_LIST = 0;
 GtkType GTK_TYPE_GDK_GC = 0;
 
+#include "console-gtk.h"
 #include "objects-gtk-impl.h"
 
 static GtkType
@@ -86,7 +87,7 @@
 	  temp = XCDR (temp);
 	}
 
-      GTK_VALUE_POINTER(*arg) = strings;
+      GTK_VALUE_POINTER (*arg) = strings;
     }
   else if (arg->type == GTK_TYPE_OBJECT_LIST)
     {
@@ -107,11 +108,11 @@
 	  temp = XCDR (temp);
 	}
 
-      GTK_VALUE_POINTER(*arg) = objects;
+      GTK_VALUE_POINTER (*arg) = objects;
     }
   else
     {
-      ABORT();
+      ABORT ();
     }
 }
 
@@ -128,7 +129,7 @@
 {
   Lisp_Object *rv = (Lisp_Object *) user_data;
 
-  *rv = Fcons (build_string ((char *)data), *rv);
+  *rv = Fcons (build_cistring ((char *)data), *rv);
 }
 
 static Lisp_Object
@@ -148,7 +149,7 @@
 	}
       else
 	{
-	  ABORT();
+	  ABORT ();
 	}
     }
   return (rval);
@@ -182,41 +183,42 @@
 	temp = XCDR (temp);					\
       }								\
 								\
-    GTK_VALUE_POINTER(*arg) = array;				\
+    GTK_VALUE_POINTER (*arg) = array;				\
   } while (0);
   
   if (arg->type == GTK_TYPE_STRING_ARRAY)
     {
-      FROB(gchar *, CHECK_STRING, (gchar*) XSTRING_DATA);
+      FROB (gchar *, CHECK_STRING, (gchar*) XSTRING_DATA);
     }
   else if (arg->type == GTK_TYPE_FLOAT_ARRAY)
     {
-      FROB(gfloat, CHECK_FLOAT, extract_float);
+      FROB (gfloat, CHECK_FLOAT, extract_float);
     }
   else if (arg->type == GTK_TYPE_INT_ARRAY)
     {
-      FROB(gint, CHECK_INT, XINT);
+      FROB (gint, CHECK_INT, XINT);
     }
   else
     {
-      ABORT();
+      ABORT ();
     }
 #undef FROB
 }
 
-extern GdkGC *gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
-			  Lisp_Object bg_pmap, Lisp_Object lwidth);
-
 static GdkGC *
 face_to_gc (Lisp_Object face)
 {
   Lisp_Object device = Fselected_device (Qnil);
 
   return (gtk_get_gc (XDEVICE (device),
-		      Fspecifier_instance (Fget (face, Qfont, Qnil), device, Qnil, Qnil),
-		      Fspecifier_instance (Fget (face, Qforeground, Qnil), device, Qnil, Qnil),
-		      Fspecifier_instance (Fget (face, Qbackground, Qnil), device, Qnil, Qnil),
-		      Fspecifier_instance (Fget (face, Qbackground_pixmap, Qnil), device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qfont, Qnil),
+					   device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qforeground, Qnil),
+					   device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qbackground, Qnil),
+					   device, Qnil, Qnil),
+		      Fspecifier_instance (Fget (face, Qbackground_pixmap,
+						 Qnil), device, Qnil, Qnil),
 		      Qnil));
 }
 
@@ -227,17 +229,24 @@
   GtkStyle *style = gtk_style_new ();
   int i;
 
-  Lisp_Object font = Fspecifier_instance (Fget (face, Qfont, Qnil), device, Qnil, Qnil);
-  Lisp_Object fg = Fspecifier_instance (Fget (face, Qforeground, Qnil), device, Qnil, Qnil);
-  Lisp_Object bg = Fspecifier_instance (Fget (face, Qbackground, Qnil), device, Qnil, Qnil);
-  Lisp_Object pm = Fspecifier_instance (Fget (face, Qbackground_pixmap, Qnil), device, Qnil, Qnil);
+  Lisp_Object font = Fspecifier_instance (Fget (face, Qfont, Qnil),
+					  device, Qnil, Qnil);
+  Lisp_Object fg = Fspecifier_instance (Fget (face, Qforeground, Qnil),
+					device, Qnil, Qnil);
+  Lisp_Object bg = Fspecifier_instance (Fget (face, Qbackground, Qnil),
+					device, Qnil, Qnil);
+  Lisp_Object pm = Fspecifier_instance (Fget (face, Qbackground_pixmap,
+					      Qnil), device, Qnil, Qnil);
 
-  for (i = 0; i < 5; i++) style->fg[i] = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (fg));
-  for (i = 0; i < 5; i++) style->bg[i] = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (bg));
+  for (i = 0; i < 5; i++)
+    style->fg[i] = *COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (fg));
+  for (i = 0; i < 5; i++)
+    style->bg[i] = *COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (bg));
 
   if (IMAGE_INSTANCEP (pm))
     {
-      for (i = 0; i < 5; i++) style->bg_pixmap[i] = XIMAGE_INSTANCE_GTK_PIXMAP (pm);
+      for (i = 0; i < 5; i++)
+	style->bg_pixmap[i] = XIMAGE_INSTANCE_GTK_PIXMAP (pm);
     }
 
   style->font = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font));
@@ -246,7 +255,7 @@
 }
 
 static Lisp_Object
-gdk_event_to_emacs_event(GdkEvent *ev)
+gdk_event_to_emacs_event (GdkEvent *ev)
 {
   Lisp_Object event = Qnil;
 
--- a/src/gtk-xemacs.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gtk-xemacs.c	Wed Feb 24 01:58:04 2010 -0600
@@ -21,22 +21,21 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #include <config.h>
 
 #include "lisp.h"
-#include "console-gtk.h"
-#include "objects-gtk.h"
-#include "gtk-xemacs.h"
+
 #include "device.h"
+#include "faces.h"
 #include "glyphs.h"
 #include "window.h"
-#include "faces.h"
-#include "event-gtk.h"
+
 #include "frame-impl.h"
 #include "console-gtk-impl.h"
 #include "device-impl.h"
+#include "gtk-xemacs.h"
+#include "objects-gtk.h"
 
 extern Lisp_Object Vmodeline_face;
 extern Lisp_Object Vscrollbar_on_left_p;
@@ -179,7 +178,7 @@
 	if (style->rc_style && style->rc_style->bg_pixmap_name[GTK_STATE_NORMAL])	\
 	{										\
 		FROB (Vdefault_face, Qbackground_pixmap,				\
-			Fmake_image_instance (build_string (style->rc_style->bg_pixmap_name[GTK_STATE_NORMAL]), \
+			Fmake_image_instance (build_cistring (style->rc_style->bg_pixmap_name[GTK_STATE_NORMAL]), \
 					  f->device, Qnil, make_int (5)));			\
 	}										\
 	else										\
@@ -437,5 +436,5 @@
 
   sprintf (color_buf, "#%04x%04x%04x", c->red, c->green, c->blue);
 
-  return (build_string (color_buf));
+  return (build_cistring (color_buf));
 }
--- a/src/gtk-xemacs.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gtk-xemacs.h	Wed Feb 24 01:58:04 2010 -0600
@@ -21,16 +21,10 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #ifndef __GTK_XEMACS_H__
 #define __GTK_XEMACS_H__
 
-#include <config.h>
-#include "frame.h"
-#include <gdk/gdk.h>
-#include <gtk/gtkfixed.h>
-
 BEGIN_C_DECLS
 
 #define GTK_XEMACS(obj)			GTK_CHECK_CAST (obj, gtk_xemacs_get_type (), GtkXEmacs)
@@ -38,22 +32,22 @@
 #define GTK_IS_XEMACS(obj)		GTK_CHECK_TYPE (obj, gtk_xemacs_get_type ())
 #define GTK_XEMACS_FRAME(obj)	GTK_XEMACS (obj)->f
 
-	typedef struct _GtkXEmacs GtkXEmacs;
-	typedef struct _GtkXEmacsClass GtkXEmacsClass;
+typedef struct _GtkXEmacs GtkXEmacs;
+typedef struct _GtkXEmacsClass GtkXEmacsClass;
 
-	struct _GtkXEmacs
-	{
-		GtkFixed fixed;
-		struct frame *f;
-	};
+struct _GtkXEmacs
+{
+  GtkFixed fixed;
+  struct frame *f;
+};
 
-	struct _GtkXEmacsClass
-	{
-		GtkFixedClass parent_class;
-	};
+struct _GtkXEmacsClass
+{
+  GtkFixedClass parent_class;
+};
 
-	guint gtk_xemacs_get_type (void);
-	GtkWidget *gtk_xemacs_new (struct frame *f);
+guint gtk_xemacs_get_type (void);
+GtkWidget *gtk_xemacs_new (struct frame *f);
 
 END_C_DECLS
 
--- a/src/gui-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gui-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -81,9 +81,9 @@
   struct widget_value_mapper *z = (struct widget_value_mapper *) closure;
 
   if (val->call_data)
-    z->protect_me = Fcons (VOID_TO_LISP (val->call_data), z->protect_me);
+    z->protect_me = Fcons (GET_LISP_FROM_VOID (val->call_data), z->protect_me);
   if (val->accel)
-    z->protect_me = Fcons (VOID_TO_LISP (val->accel), z->protect_me);
+    z->protect_me = Fcons (GET_LISP_FROM_VOID (val->accel), z->protect_me);
 
   return 0;
 }
@@ -198,9 +198,9 @@
 free_popup_widget_value_tree (widget_value *wv)
 {
   if (! wv) return;
-  if (wv->key) xfree (wv->key, char *);
-  if (wv->value) xfree (wv->value, char *);
-  if (wv->name) xfree (wv->name, char *);
+  if (wv->key) xfree (wv->key);
+  if (wv->value) xfree (wv->value);
+  if (wv->name) xfree (wv->name);
 
   wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; /* -559038737 base 10*/
 
@@ -243,7 +243,7 @@
     return;
   if (((EMACS_INT) client_data) == 0)
     return;
-  data = VOID_TO_LISP (client_data);
+  data = GET_LISP_FROM_VOID (client_data);
   frame = wrap_frame (f);
 
 #if 0
@@ -360,10 +360,7 @@
 	    : xstrdup ("shadowDoubleEtchedIn"));
   else if (*p == ':')
     {
-      Extbyte *retval;
-
-      C_STRING_TO_EXTERNAL_MALLOC (p + 1, retval, Qlwlib_encoding);
-      return retval;
+      return ITEXT_TO_EXTERNAL_MALLOC (p + 1, Qlwlib_encoding);
     }
 
   return NULL;
@@ -385,7 +382,7 @@
       }
 
   if (found_accel)
-    LISP_STRING_TO_EXTERNAL_MALLOC (string, retval, Qlwlib_encoding);
+    retval = LISP_STRING_TO_EXTERNAL_MALLOC (string, Qlwlib_encoding);
   else
     {
       Bytecount namelen = XSTRING_LENGTH (string);
@@ -393,7 +390,7 @@
       chars[0] = '%';
       chars[1] = '_';
       memcpy (chars + 2, name, namelen + 1);
-      C_STRING_TO_EXTERNAL_MALLOC (chars, retval, Qlwlib_encoding);
+      retval = ITEXT_TO_EXTERNAL_MALLOC (chars, Qlwlib_encoding);
     }
 
   return retval;
@@ -417,7 +414,7 @@
       if (accel_p)
 	wv->name = add_accel_and_to_external (gui_item);
       else
-	LISP_STRING_TO_EXTERNAL_MALLOC (gui_item, wv->name, Qlwlib_encoding);
+	wv->name = LISP_STRING_TO_EXTERNAL_MALLOC (gui_item, Qlwlib_encoding);
       return 1;
     }
   else if (!GUI_ITEMP (gui_item))
@@ -443,12 +440,12 @@
   if (accel_p)
     {
       wv->name = add_accel_and_to_external (pgui->name);
-      wv->accel = LISP_TO_VOID (gui_item_accelerator (gui_item));
+      wv->accel = STORE_LISP_IN_VOID (gui_item_accelerator (gui_item));
     }
   else
     {
-      LISP_STRING_TO_EXTERNAL_MALLOC (pgui->name, wv->name, Qlwlib_encoding);
-      wv->accel = LISP_TO_VOID (Qnil);
+      wv->name = LISP_STRING_TO_EXTERNAL_MALLOC (pgui->name, Qlwlib_encoding);
+      wv->accel = STORE_LISP_IN_VOID (Qnil);
     }
 
   if (!NILP (pgui->suffix))
@@ -464,14 +461,14 @@
 	  CHECK_STRING (suffix2);
 	}
 
-      LISP_STRING_TO_EXTERNAL_MALLOC (suffix2, wv->value, Qlwlib_encoding);
+      wv->value = LISP_STRING_TO_EXTERNAL_MALLOC (suffix2, Qlwlib_encoding);
     }
 
   wv_set_evalable_slot (wv->enabled, pgui->active);
   wv_set_evalable_slot (wv->selected, pgui->selected);
 
   if (!NILP (pgui->callback) || !NILP (pgui->callback_ex))
-    wv->call_data = LISP_TO_VOID (cons3 (gui_object_instance,
+    wv->call_data = STORE_LISP_IN_VOID (cons3 (gui_object_instance,
 					 pgui->callback,
 					 pgui->callback_ex));
 
@@ -486,7 +483,7 @@
       CHECK_STRING (pgui->keys);
       pgui->keys = Fsubstitute_command_keys (pgui->keys);
       if (XSTRING_LENGTH (pgui->keys) > 0)
-	LISP_STRING_TO_EXTERNAL_MALLOC (pgui->keys, wv->key, Qlwlib_encoding);
+	wv->key = LISP_STRING_TO_EXTERNAL_MALLOC (pgui->keys, Qlwlib_encoding);
       else
 	wv->key = 0;
     }
@@ -496,7 +493,7 @@
       /* #### Warning, dependency here on current_buffer and point */
       where_is_to_char (pgui->callback, buf);
       if (eilen (buf) > 0)
-	C_STRING_TO_EXTERNAL_MALLOC (eidata (buf), wv->key, Qlwlib_encoding);
+	wv->key = ITEXT_TO_EXTERNAL_MALLOC (eidata (buf), Qlwlib_encoding);
       else
 	wv->key = 0;
       eifree (buf);
--- a/src/gui.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gui.c	Wed Feb 24 01:58:04 2010 -0600
@@ -512,7 +512,7 @@
 	  CHECK_STRING (suffix);
 	}
 
-      retval = concat3 (pgui_item->name, build_string (" "), suffix);
+      retval = concat3 (pgui_item->name, build_ascstring (" "), suffix);
     }
 
   return retval;
@@ -674,7 +674,8 @@
 }
 
 static int
-gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		int UNUSED (foldcase))
 {
   Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
   Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
@@ -692,7 +693,7 @@
   Lisp_Gui_Item *g = XGUI_ITEM (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<gui-item 0x%x>", g->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string (printcharfun, "#<gui-item 0x%x>", g->header.uid);
 }
--- a/src/gutter.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/gutter.c	Wed Feb 24 01:58:04 2010 -0600
@@ -302,7 +302,7 @@
 	{
 	  dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
 	  size = (dl->ypos + dl->descent - dl->clip)
-	    - (Dynarr_atp (ddla, 0)->ypos - Dynarr_atp (ddla, 0)->ascent);
+	    - (Dynarr_begin (ddla)->ypos - Dynarr_begin (ddla)->ascent);
 	}
     }
   /* For left and right we have to do some maths. */
@@ -450,13 +450,13 @@
       /* If the number of display lines has shrunk, adjust. */
       if (cdla_len > Dynarr_length (ddla))
 	{
-	  Dynarr_length (cdla) = Dynarr_length (ddla);
+	  Dynarr_set_length (cdla, Dynarr_length (ddla));
 	}
 
       /* grab coordinates of last line and blank after it. */
       if (Dynarr_length (ddla) > 0)
 	{
-	  dl = Dynarr_atp (ddla, Dynarr_length (ddla) - 1);
+	  dl = Dynarr_lastp (ddla);
 	  ypos = dl->ypos + dl->descent - dl->clip;
 	}
       else
--- a/src/hash.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/hash.c	Wed Feb 24 01:58:04 2010 -0600
@@ -174,8 +174,8 @@
 void
 free_hash_table (struct hash_table *hash_table)
 {
-  xfree (hash_table->harray, hentry *);
-  xfree (hash_table, struct hash_table *);
+  xfree (hash_table->harray);
+  xfree (hash_table);
 }
 
 struct hash_table *
@@ -224,7 +224,7 @@
     rehash (old_harray, hash_table, old_size);
   }
 
-  xfree (old_harray, hentry *);
+  xfree (old_harray);
 }
 
 void
--- a/src/hpplay.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/hpplay.c	Wed Feb 24 01:58:04 2010 -0600
@@ -73,9 +73,9 @@
   Ibyte *interr;
 
   AGetErrorText (audio, errorCode, errorbuff, 131);
-  EXTERNAL_TO_C_STRING (errorbuf, interr, Qnative);
+  interr = EXTERNAL_TO_ITEXT (errorbuf, Qerror_message_encoding);
   
-  signal_error (Qsound_error, text, build_string (interr));
+  signal_error (Qsound_error, text, build_istring (interr));
 }
 
 long
@@ -148,7 +148,8 @@
   Extbyte *server;
 
   if (STRINGP (Vhp_play_server))
-    LISP_STRING_TO_EXTERNAL (Vhp_play_server, server, Qnative);
+    server = LISP_STRING_TO_EXTERNAL (Vhp_play_server,
+				      Qunix_host_name_encoding);
   else
     server = "";
 
@@ -201,7 +202,8 @@
        
     
   if (STRINGP (Vhp_play_server))
-    LISP_STRING_TO_EXTERNAL (Vhp_play_server, server, Qnative);
+    server = LISP_STRING_TO_EXTERNAL (Vhp_play_server,
+				      Qunix_host_name_encoding);
   else
     server = "";
 
--- a/src/imgproc.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/imgproc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -536,7 +536,7 @@
   qt->num_active_colors = i;
 
   /* We're done with the boxes now */
-  xfree (box_list, Colorbox *);
+  xfree (box_list);
   qt->freeboxes = qt->usedboxes = NULL;
 
   /*
@@ -551,13 +551,13 @@
   /* 5c: done with ColorCells */
   for (i = 0; i < C_LEN*C_LEN*C_LEN; i++)
     if (qt->ColorCells[i])
-      xfree (qt->ColorCells[i], C_cell *);
-  xfree (qt->ColorCells, C_cell **);
+      xfree (qt->ColorCells[i]);
+  xfree (qt->ColorCells);
   
   if (res)
     {
       /* we failed in memory allocation, so clean up and leave */
-      xfree(qt, quant_table *);
+      xfree (qt);
       return NULL;
     }
   
--- a/src/indent.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/indent.c	Wed Feb 24 01:58:04 2010 -0600
@@ -41,8 +41,6 @@
 #endif
 #include "window.h"
 
-Lisp_Object Qcoerce;
-
 /* Indentation can insert tabs if this is non-zero;
    otherwise always uses spaces */
 int indent_tabs_mode;
@@ -663,7 +661,7 @@
           if (ret_vpix)
             *ret_vpix = vpix_motion (w->line_start_cache, 0, elt);
 	  /* #### This should be BUF_BEGV (b), right? */
-	  return Dynarr_atp (w->line_start_cache, 0)->start;
+	  return Dynarr_begin (w->line_start_cache)->start;
 	}
       else
 	{
@@ -937,8 +935,6 @@
 #endif
   DEFSUBR (Fvertical_motion);
   DEFSUBR (Fvertical_motion_pixels);
-
-  DEFSYMBOL (Qcoerce);
 }
 
 void
--- a/src/inline.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/inline.c	Wed Feb 24 01:58:04 2010 -0600
@@ -103,7 +103,7 @@
 
 #ifdef HAVE_X_WINDOWS
 #include "console-x-impl.h"
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #include "font-mgr.h"
 #endif
 #endif
--- a/src/insdel.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/insdel.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1305,11 +1305,12 @@
 /* Insert the null-terminated string S (in external format). */
 
 Charcount
-buffer_insert_c_string_1 (struct buffer *buf, Charbpos pos, const char *s,
+buffer_insert_ascstring_1 (struct buffer *buf, Charbpos pos, const Ascbyte *s,
 			  int flags)
 {
   /* This function can GC */
-  const char *translated = GETTEXT (s);
+  const CIbyte *translated = GETTEXT (s);
+  ASSERT_ASCTEXT_ASCII (s);
   return buffer_insert_string_1 (buf, pos, (const Ibyte *) translated, Qnil,
 				 0, strlen (translated), flags);
 }
@@ -1837,9 +1838,9 @@
   if (!b->base_buffer)
     {
       BUFFER_FREE (b->text->beg);
-      xfree (b->text->changes, struct buffer_text_change_data *);
+      xfree (b->text->changes);
     }
-  xfree (b->changes, struct each_buffer_change_data *);
+  xfree (b->changes);
 
 #ifdef REGION_CACHE_NEEDS_WORK
   if (b->newline_cache)
--- a/src/insdel.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/insdel.h	Wed Feb 24 01:58:04 2010 -0600
@@ -46,8 +46,8 @@
 				      Bytecount length, int flags);
 Charcount buffer_insert_lisp_string_1 (struct buffer *buf, Charbpos pos,
 				       Lisp_Object str, int flags);
-Charcount buffer_insert_c_string_1 (struct buffer *buf, Charbpos pos,
-				    const char *s, int flags);
+Charcount buffer_insert_ascstring_1 (struct buffer *buf, Charbpos pos,
+				    const Ascbyte *s, int flags);
 Charcount buffer_insert_emacs_char_1 (struct buffer *buf, Charbpos pos,
 				      Ichar ch, int flags);
 Charcount buffer_insert_c_char_1 (struct buffer *buf, Charbpos pos, char c,
@@ -63,8 +63,8 @@
   buffer_insert_string_1 (buf, -1, nonreloc, reloc, offset, length, 0)
 #define buffer_insert_raw_string(buf, string, length) \
   buffer_insert_raw_string_1 (buf, -1, string, length, 0)
-#define buffer_insert_c_string(buf, s) \
-  buffer_insert_c_string_1 (buf, -1, s, 0)
+#define buffer_insert_ascstring(buf, s) \
+  buffer_insert_ascstring_1 (buf, -1, s, 0)
 #define buffer_insert_lisp_string(buf, str) \
   buffer_insert_lisp_string_1 (buf, -1, str, 0)
 #define buffer_insert_c_char(buf, c) \
--- a/src/intl-auto-encap-win32.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/intl-auto-encap-win32.c	Wed Feb 24 01:58:04 2010 -0600
@@ -13,10 +13,127 @@
 
 
 /*----------------------------------------------------------------------*/
+/*                       Processing file WINCON.H                       */
+/*----------------------------------------------------------------------*/
+
+/* Error if FillConsoleOutputCharacter used: split CHAR */
+
+DWORD
+qxeGetConsoleTitle (Extbyte * arg1, DWORD arg2)
+{
+  if (XEUNICODE_P)
+    return GetConsoleTitleW ((LPWSTR) arg1, arg2);
+  else
+    return GetConsoleTitleA ((LPSTR) arg1, arg2);
+}
+
+BOOL
+qxePeekConsoleInput (HANDLE arg1, PINPUT_RECORD arg2, DWORD arg3, PDWORD arg4)
+{
+  if (XEUNICODE_P)
+    return PeekConsoleInputW (arg1, arg2, arg3, arg4);
+  else
+    return PeekConsoleInputA (arg1, arg2, arg3, arg4);
+}
+
+BOOL
+qxeReadConsole (HANDLE arg1, PVOID arg2, DWORD arg3, PDWORD arg4, PVOID arg5)
+{
+  if (XEUNICODE_P)
+    return ReadConsoleW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return ReadConsoleA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeReadConsoleInput (HANDLE arg1, PINPUT_RECORD arg2, DWORD arg3, PDWORD arg4)
+{
+  if (XEUNICODE_P)
+    return ReadConsoleInputW (arg1, arg2, arg3, arg4);
+  else
+    return ReadConsoleInputA (arg1, arg2, arg3, arg4);
+}
+
+BOOL
+qxeReadConsoleOutputCharacter (HANDLE arg1, Extbyte * arg2, DWORD arg3, COORD arg4, PDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return ReadConsoleOutputCharacterW (arg1, (LPWSTR) arg2, arg3, arg4, arg5);
+  else
+    return ReadConsoleOutputCharacterA (arg1, (LPSTR) arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeReadConsoleOutput (HANDLE arg1, PCHAR_INFO arg2, COORD arg3, COORD arg4, PSMALL_RECT arg5)
+{
+  if (XEUNICODE_P)
+    return ReadConsoleOutputW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return ReadConsoleOutputA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeScrollConsoleScreenBuffer (HANDLE arg1, const SMALL_RECT* arg2, const SMALL_RECT* arg3, COORD arg4, const CHAR_INFO* arg5)
+{
+  if (XEUNICODE_P)
+    return ScrollConsoleScreenBufferW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return ScrollConsoleScreenBufferA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeSetConsoleTitle (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return SetConsoleTitleW ((LPCWSTR) arg1);
+  else
+    return SetConsoleTitleA ((LPCSTR) arg1);
+}
+
+BOOL
+qxeWriteConsole (HANDLE arg1, PCVOID arg2, DWORD arg3, PDWORD arg4, PVOID arg5)
+{
+  if (XEUNICODE_P)
+    return WriteConsoleW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return WriteConsoleA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeWriteConsoleInput (HANDLE arg1, const INPUT_RECORD* arg2, DWORD arg3, PDWORD arg4)
+{
+  if (XEUNICODE_P)
+    return WriteConsoleInputW (arg1, arg2, arg3, arg4);
+  else
+    return WriteConsoleInputA (arg1, arg2, arg3, arg4);
+}
+
+BOOL
+qxeWriteConsoleOutput (HANDLE arg1, const CHAR_INFO* arg2, COORD arg3, COORD arg4, PSMALL_RECT arg5)
+{
+  if (XEUNICODE_P)
+    return WriteConsoleOutputW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return WriteConsoleOutputA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeWriteConsoleOutputCharacter (HANDLE arg1, const Extbyte * arg2, DWORD arg3, COORD arg4, PDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return WriteConsoleOutputCharacterW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return WriteConsoleOutputCharacterA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+
+/*----------------------------------------------------------------------*/
 /*                      Processing file SHELLAPI.H                      */
 /*----------------------------------------------------------------------*/
 
-UINT 
+/* Error if CommandLineToArgv used: Unicode-only */
+
+UINT
 qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4)
 {
   if (XEUNICODE_P)
@@ -25,103 +142,103 @@
     return DragQueryFileA (arg1, arg2, (LPSTR) arg3, arg4);
 }
 
-HINSTANCE 
-qxeShellExecute (HWND hwnd, const Extbyte * lpOperation, const Extbyte * lpFile, const Extbyte * lpParameters, const Extbyte * lpDirectory, INT nShowCmd)
-{
-  if (XEUNICODE_P)
-    return ShellExecuteW (hwnd, (LPCWSTR) lpOperation, (LPCWSTR) lpFile, (LPCWSTR) lpParameters, (LPCWSTR) lpDirectory, nShowCmd);
-  else
-    return ShellExecuteA (hwnd, (LPCSTR) lpOperation, (LPCSTR) lpFile, (LPCSTR) lpParameters, (LPCSTR) lpDirectory, nShowCmd);
-}
-
-HINSTANCE 
-qxeFindExecutable (const Extbyte * lpFile, const Extbyte * lpDirectory, Extbyte * lpResult)
-{
-  if (XEUNICODE_P)
-    return FindExecutableW ((LPCWSTR) lpFile, (LPCWSTR) lpDirectory, (LPWSTR) lpResult);
-  else
-    return FindExecutableA ((LPCSTR) lpFile, (LPCSTR) lpDirectory, (LPSTR) lpResult);
-}
-
-/* Error if CommandLineToArgv used: Unicode-only */
-
-INT       
-qxeShellAbout (HWND hWnd, const Extbyte * szApp, const Extbyte * szOtherStuff, HICON hIcon)
-{
-  if (XEUNICODE_P)
-    return ShellAboutW (hWnd, (LPCWSTR) szApp, (LPCWSTR) szOtherStuff, hIcon);
-  else
-    return ShellAboutA (hWnd, (LPCSTR) szApp, (LPCSTR) szOtherStuff, hIcon);
-}
-
-HICON     
-qxeExtractAssociatedIcon (HINSTANCE hInst, Extbyte * lpIconPath, LPWORD lpiIcon)
-{
-  if (XEUNICODE_P)
-    return ExtractAssociatedIconW (hInst, (LPWSTR) lpIconPath, lpiIcon);
-  else
-    return ExtractAssociatedIconA (hInst, (LPSTR) lpIconPath, lpiIcon);
-}
-
-HICON     
-qxeExtractIcon (HINSTANCE hInst, const Extbyte * lpszExeFileName, UINT nIconIndex)
-{
-  if (XEUNICODE_P)
-    return ExtractIconW (hInst, (LPCWSTR) lpszExeFileName, nIconIndex);
-  else
-    return ExtractIconA (hInst, (LPCSTR) lpszExeFileName, nIconIndex);
-}
-
-#if !defined (CYGWIN_HEADERS)
-
-/* NOTE: NT 4.0+ only */
-DWORD   
-qxeDoEnvironmentSubst (Extbyte * szString, UINT cbString)
-{
-  if (XEUNICODE_P)
-    return DoEnvironmentSubstW ((LPWSTR) szString, cbString);
-  else
-    return DoEnvironmentSubstA ((LPSTR) szString, cbString);
-}
-
-#endif /* !defined (CYGWIN_HEADERS) */
-
-/* Error if FindEnvironmentString used: causes link error; NT 4.0+ only */
-
-/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */
-
-/* NOTE: NT 4.0+ only */
+/* NOTE: error arg2, Cygwin prototype, extra const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           HICON WINAPI ExtractAssociatedIcon(HINSTANCE,LPCWSTR,PWORD)
+         Overridden with:
+           HICON ExtractAssociatedIcon(HINSTANCE, LPWSTR, LPWORD)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
+HICON
+qxeExtractAssociatedIcon (HINSTANCE arg1, Extbyte * arg2, LPWORD arg3)
+{
+  if (XEUNICODE_P)
+    return ExtractAssociatedIconW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return ExtractAssociatedIconA (arg1, (LPSTR) arg2, arg3);
+}
+
+HICON
+qxeExtractIcon (HINSTANCE arg1, const Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return ExtractIconW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return ExtractIconA (arg1, (LPCSTR) arg2, arg3);
+}
+
+/* NOTE: NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10) */
+UINT
+qxeExtractIconEx (const Extbyte * arg1, int arg2, HICON* arg3, HICON* arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return ExtractIconExW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5);
+  else
+    return ExtractIconExA ((LPCSTR) arg1, arg2, arg3, arg4, arg5);
+}
+
+HINSTANCE
+qxeFindExecutable (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return FindExecutableW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPWSTR) arg3);
+  else
+    return FindExecutableA ((LPCSTR) arg1, (LPCSTR) arg2, (LPSTR) arg3);
+}
+
+/* Error if Shell_NotifyIcon used: split-sized NOTIFYICONDATA, NT 4.0+ only */
+
 int
-qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp)
-{
-  if (XEUNICODE_P)
-    return SHFileOperationW (lpFileOp);
-  else
-    return SHFileOperationA ((LPSHFILEOPSTRUCTA) lpFileOp);
+qxeShellAbout (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, HICON arg4)
+{
+  if (XEUNICODE_P)
+    return ShellAboutW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4);
+  else
+    return ShellAboutA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4);
+}
+
+HINSTANCE
+qxeShellExecute (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4, const Extbyte * arg5, INT arg6)
+{
+  if (XEUNICODE_P)
+    return ShellExecuteW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4, (LPCWSTR) arg5, arg6);
+  else
+    return ShellExecuteA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4, (LPCSTR) arg5, arg6);
 }
 
 /* NOTE: NT 4.0+ only */
 BOOL
-qxeShellExecuteEx (LPSHELLEXECUTEINFOW lpExecInfo)
-{
-  if (XEUNICODE_P)
-    return ShellExecuteExW (lpExecInfo);
-  else
-    return ShellExecuteExA ((LPSHELLEXECUTEINFOA) lpExecInfo);
-}
-
-/* Error if WinExecError used: causes link error; NT 4.0+ only */
+qxeShellExecuteEx (LPSHELLEXECUTEINFOW arg1)
+{
+  if (XEUNICODE_P)
+    return ShellExecuteExW (arg1);
+  else
+    return ShellExecuteExA ((LPSHELLEXECUTEINFOA) arg1);
+}
+
+/* NOTE: NT 4.0+ only */
+int
+qxeSHFileOperation (LPSHFILEOPSTRUCTW arg1)
+{
+  if (XEUNICODE_P)
+    return SHFileOperationW (arg1);
+  else
+    return SHFileOperationA ((LPSHFILEOPSTRUCTA) arg1);
+}
+
+/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */
 
 #if !defined (CYGWIN_HEADERS)
 
 /* NOTE: NT 4.0+ only */
 HRESULT
-qxeSHQueryRecycleBin (const Extbyte * pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo)
-{
-  if (XEUNICODE_P)
-    return SHQueryRecycleBinW ((LPCWSTR) pszRootPath, pSHQueryRBInfo);
-  else
-    return SHQueryRecycleBinA ((LPCSTR) pszRootPath, pSHQueryRBInfo);
+qxeSHQueryRecycleBin (const Extbyte * arg1, LPSHQUERYRBINFO arg2)
+{
+  if (XEUNICODE_P)
+    return SHQueryRecycleBinW ((LPCWSTR) arg1, arg2);
+  else
+    return SHQueryRecycleBinA ((LPCSTR) arg1, arg2);
 }
 
 #endif /* !defined (CYGWIN_HEADERS) */
@@ -130,46 +247,12 @@
 
 /* NOTE: NT 4.0+ only */
 HRESULT
-qxeSHEmptyRecycleBin (HWND hwnd, const Extbyte * pszRootPath, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return SHEmptyRecycleBinW (hwnd, (LPCWSTR) pszRootPath, dwFlags);
-  else
-    return SHEmptyRecycleBinA (hwnd, (LPCSTR) pszRootPath, dwFlags);
-}
-
-#endif /* !defined (CYGWIN_HEADERS) */
-
-/* Error if Shell_NotifyIcon used: split-sized NOTIFYICONDATA, NT 4.0+ only */
-
-/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */
-
-/* Error if SHGetDiskFreeSpace used: causes link error; NT 4.0+ only */
-
-#if !defined (CYGWIN_HEADERS)
-
-/* NOTE: NT 4.0+ only */
-BOOL
-qxeSHGetNewLinkInfo (const Extbyte * pszLinkTo, const Extbyte * pszDir, Extbyte * pszName, BOOL * pfMustCopy, UINT uFlags)
-{
-  if (XEUNICODE_P)
-    return SHGetNewLinkInfoW ((LPCWSTR) pszLinkTo, (LPCWSTR) pszDir, (LPWSTR) pszName, pfMustCopy, uFlags);
-  else
-    return SHGetNewLinkInfoA ((LPCSTR) pszLinkTo, (LPCSTR) pszDir, (LPSTR) pszName, pfMustCopy, uFlags);
-}
-
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#if !defined (CYGWIN_HEADERS)
-
-/* NOTE: NT 4.0+ only */
-BOOL
-qxeSHInvokePrinterCommand (HWND hwnd, UINT uAction, const Extbyte * lpBuf1, const Extbyte * lpBuf2, BOOL fModal)
-{
-  if (XEUNICODE_P)
-    return SHInvokePrinterCommandW (hwnd, uAction, (LPCWSTR) lpBuf1, (LPCWSTR) lpBuf2, fModal);
-  else
-    return SHInvokePrinterCommandA (hwnd, uAction, (LPCSTR) lpBuf1, (LPCSTR) lpBuf2, fModal);
+qxeSHEmptyRecycleBin (HWND arg1, const Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return SHEmptyRecycleBinW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return SHEmptyRecycleBinA (arg1, (LPCSTR) arg2, arg3);
 }
 
 #endif /* !defined (CYGWIN_HEADERS) */
@@ -181,33 +264,195 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
+/* Error if AddForm used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddJob used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddMonitor used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddPort used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddPrinter used: split-sized DEVMODE pointer in split PRINTER_INFO_2 */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddPrinterConnection used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddPrinterDriver used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddPrintProcessor used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddPrintProvidor used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AdvancedDocumentProperties used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if ConfigurePort used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeleteForm used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeleteMonitor used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeletePort used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeletePrinterConnection used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeletePrinterData used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeletePrinterDriver used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeletePrintProcessor used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if DeletePrintProvidor used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping DocumentProperties because split-sized DEVMODE, error in Cygwin prototype */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumForms used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumJobs used: split-sized DEVMODE pointer in split JOB_INFO_2 */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumMonitors used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumPorts used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumPrinterData used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumPrinterDrivers used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
 /* NOTE: #### problems with DEVMODE pointer in PRINTER_INFO_2 */
 BOOL
-qxeEnumPrinters (DWORD Flags, Extbyte * Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
-{
-  if (XEUNICODE_P)
-    return EnumPrintersW (Flags, (LPWSTR) Name, Level, pPrinterEnum, cbBuf, pcbNeeded, pcReturned);
-  else
-    return EnumPrintersA (Flags, (LPSTR) Name, Level, pPrinterEnum, cbBuf, pcbNeeded, pcReturned);
+qxeEnumPrinters (DWORD arg1, Extbyte * arg2, DWORD arg3, PBYTE arg4, DWORD arg5, PDWORD arg6, PDWORD arg7)
+{
+  if (XEUNICODE_P)
+    return EnumPrintersW (arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6, arg7);
+  else
+    return EnumPrintersA (arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6, arg7);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Skipping OpenPrinter because split-sized DEVMODE pointer in split PRINTER_DEFAULTS */
+/* Error if EnumPrintProcessorDatatypes used: not used, complicated interface with split structures */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if ResetPrinter used: split-sized DEVMODE pointer in split PRINTER_DEFAULTS */
+/* Error if EnumPrintProcessors used: not used, complicated interface with split structures */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if SetJob used: split-sized DEVMODE pointer in split JOB_INFO_2 */
+/* Error if GetDefaultPrinter used: Function needs review to determine how to handle it */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if GetForm used: not used, complicated interface with split structures */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
@@ -219,43 +464,13 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if EnumJobs used: split-sized DEVMODE pointer in split JOB_INFO_2 */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if AddPrinter used: split-sized DEVMODE pointer in split PRINTER_INFO_2 */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if SetPrinter used: split-sized DEVMODE pointer in split PRINTER_INFO_2 */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
 /* Error if GetPrinter used: split-sized DEVMODE pointer in split PRINTER_INFO_2 */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if AddPrinterDriver used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if AddPrinterDriverEx used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if EnumPrinterDrivers used: not used, complicated interface with split structures */
+/* Error if GetPrinterData used: not used, complicated interface with split structures */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
@@ -273,145 +488,13 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if DeletePrinterDriver used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeletePrinterDriverEx used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if AddPerMachineConnection used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeletePerMachineConnection used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if EnumPerMachineConnections used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if AddPrintProcessor used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if EnumPrintProcessors used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
 /* Error if GetPrintProcessorDirectory used: not used, complicated interface with split structures */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if EnumPrintProcessorDatatypes used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeletePrintProcessor used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if StartDocPrinter used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if AddJob used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Skipping DocumentProperties because split-sized DEVMODE, error in Cygwin prototype */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if AdvancedDocumentProperties used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if GetPrinterData used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if GetPrinterDataEx used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if EnumPrinterData used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if EnumPrinterDataEx used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if EnumPrinterKey used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if SetPrinterData used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if SetPrinterDataEx used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeletePrinterData used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeletePrinterDataEx used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeletePrinterKey used: not used, complicated interface with split structures */
+/* Skipping OpenPrinter because split-sized DEVMODE pointer in split PRINTER_DEFAULTS */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
@@ -423,19 +506,7 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if AddForm used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if DeleteForm used: not used, complicated interface with split structures */
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* Error if GetForm used: not used, complicated interface with split structures */
+/* Error if ResetPrinter used: split-sized DEVMODE pointer in split PRINTER_DEFAULTS */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
@@ -447,97 +518,270 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if EnumForms used: not used, complicated interface with split structures */
+/* Error if SetJob used: split-sized DEVMODE pointer in split JOB_INFO_2 */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if SetPrinter used: split-sized DEVMODE pointer in split PRINTER_INFO_2 */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if SetPrinterData used: not used, complicated interface with split structures */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if EnumMonitors used: not used, complicated interface with split structures */
+/* Error if StartDocPrinter used: not used, complicated interface with split structures */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+
+/*----------------------------------------------------------------------*/
+/*                      Processing file WINNETWK.H                      */
+/*----------------------------------------------------------------------*/
+
+#if defined (HAVE_MS_WINDOWS)
+
+DWORD 
+qxeWNetAddConnection (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return WNetAddConnectionW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3);
+  else
+    return WNetAddConnectionA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if AddMonitor used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetAddConnection2 (LPNETRESOURCEW arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return WNetAddConnection2W (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4);
+  else
+    return WNetAddConnection2A ((LPNETRESOURCEA) arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if DeleteMonitor used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetAddConnection3 (HWND arg1, LPNETRESOURCEW arg2, const Extbyte * arg3, const Extbyte * arg4, DWORD arg5)
+{
+  if (XEUNICODE_P)
+    return WNetAddConnection3W (arg1, arg2, (LPCWSTR) arg3, (LPCWSTR) arg4, arg5);
+  else
+    return WNetAddConnection3A (arg1, (LPNETRESOURCEA) arg2, (LPCSTR) arg3, (LPCSTR) arg4, arg5);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+DWORD 
+qxeWNetCancelConnection (const Extbyte * arg1, BOOL arg2)
+{
+  if (XEUNICODE_P)
+    return WNetCancelConnectionW ((LPCWSTR) arg1, arg2);
+  else
+    return WNetCancelConnectionA ((LPCSTR) arg1, arg2);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if EnumPorts used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetCancelConnection2 (const Extbyte * arg1, DWORD arg2, BOOL arg3)
+{
+  if (XEUNICODE_P)
+    return WNetCancelConnection2W ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return WNetCancelConnection2A ((LPCSTR) arg1, arg2, arg3);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if AddPort used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetGetConnection (const Extbyte * arg1, Extbyte * arg2, PDWORD arg3)
+{
+  if (XEUNICODE_P)
+    return WNetGetConnectionW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return WNetGetConnectionA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if ConfigurePort used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetUseConnection (HWND arg1, LPNETRESOURCEW arg2, const Extbyte * arg3, const Extbyte * arg4, DWORD arg5, Extbyte * arg6, PDWORD arg7, PDWORD arg8)
+{
+  if (XEUNICODE_P)
+    return WNetUseConnectionW (arg1, arg2, (LPCWSTR) arg3, (LPCWSTR) arg4, arg5, (LPWSTR) arg6, arg7, arg8);
+  else
+    return WNetUseConnectionA (arg1, (LPNETRESOURCEA) arg2, (LPCSTR) arg3, (LPCSTR) arg4, arg5, (LPSTR) arg6, arg7, arg8);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if WNetSetConnection used: Function needs review to determine how to handle it */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if DeletePort used: not used, complicated interface with split structures */
+/* NOTE: contains split-simple LPNETRESOURCE */
+DWORD 
+qxeWNetConnectionDialog1 (LPCONNECTDLGSTRUCTW arg1)
+{
+  if (XEUNICODE_P)
+    return WNetConnectionDialog1W (arg1);
+  else
+    return WNetConnectionDialog1A ((LPCONNECTDLGSTRUCTA) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+DWORD 
+qxeWNetDisconnectDialog1 (LPDISCDLGSTRUCTW arg1)
+{
+  if (XEUNICODE_P)
+    return WNetDisconnectDialog1W (arg1);
+  else
+    return WNetDisconnectDialog1A ((LPDISCDLGSTRUCTA) arg1);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if XcvData used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetOpenEnum (DWORD arg1, DWORD arg2, DWORD arg3, LPNETRESOURCEW arg4, LPHANDLE arg5)
+{
+  if (XEUNICODE_P)
+    return WNetOpenEnumW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return WNetOpenEnumA (arg1, arg2, arg3, (LPNETRESOURCEA) arg4, arg5);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if SetPort used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetEnumResource (HANDLE arg1, PDWORD arg2, PVOID arg3, PDWORD arg4)
+{
+  if (XEUNICODE_P)
+    return WNetEnumResourceW (arg1, arg2, arg3, arg4);
+  else
+    return WNetEnumResourceA (arg1, arg2, arg3, arg4);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if AddPrinterConnection used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetGetUniversalName (const Extbyte * arg1, DWORD arg2, PVOID arg3, PDWORD arg4)
+{
+  if (XEUNICODE_P)
+    return WNetGetUniversalNameW ((LPCWSTR) arg1, arg2, arg3, arg4);
+  else
+    return WNetGetUniversalNameA ((LPCSTR) arg1, arg2, arg3, arg4);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if DeletePrinterConnection used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetGetUser (const Extbyte * arg1, Extbyte * arg2, PDWORD arg3)
+{
+  if (XEUNICODE_P)
+    return WNetGetUserW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return WNetGetUserA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if AddPrintProvidor used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetGetProviderName (DWORD arg1, Extbyte * arg2, PDWORD arg3)
+{
+  if (XEUNICODE_P)
+    return WNetGetProviderNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return WNetGetProviderNameA (arg1, (LPSTR) arg2, arg3);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if DeletePrintProvidor used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetGetNetworkInformation (const Extbyte * arg1, LPNETINFOSTRUCT arg2)
+{
+  if (XEUNICODE_P)
+    return WNetGetNetworkInformationW ((LPCWSTR) arg1, arg2);
+  else
+    return WNetGetNetworkInformationA ((LPCSTR) arg1, arg2);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if WNetGetResourceInformation used: Function needs review to determine how to handle it */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if SetPrinterHTMLView used: not used, complicated interface with split structures */
+/* Error if WNetGetResourceParent used: Function needs review to determine how to handle it */
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
 
-/* Error if GetPrinterHTMLView used: not used, complicated interface with split structures */
+DWORD 
+qxeWNetGetLastError (PDWORD arg1, Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5)
+{
+  if (XEUNICODE_P)
+    return WNetGetLastErrorW (arg1, (LPWSTR) arg2, arg3, (LPWSTR) arg4, arg5);
+  else
+    return WNetGetLastErrorA (arg1, (LPSTR) arg2, arg3, (LPSTR) arg4, arg5);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+DWORD 
+qxeMultinetGetConnectionPerformance (LPNETRESOURCEW arg1, LPNETCONNECTINFOSTRUCT arg2)
+{
+  if (XEUNICODE_P)
+    return MultinetGetConnectionPerformanceW (arg1, arg2);
+  else
+    return MultinetGetConnectionPerformanceA ((LPNETRESOURCEA) arg1, arg2);
+}
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
@@ -546,207 +790,382 @@
 /*                      Processing file WINUSER.H                       */
 /*----------------------------------------------------------------------*/
 
-int
-qxewvsprintf (Extbyte * arg1, const Extbyte * arg2, va_list arglist)
-{
-  if (XEUNICODE_P)
-    return wvsprintfW ((LPWSTR) arg1, (LPCWSTR) arg2, arglist);
-  else
-    return wvsprintfA ((LPSTR) arg1, (LPCSTR) arg2, arglist);
-}
-
-HKL
-qxeLoadKeyboardLayout (const Extbyte * pwszKLID, UINT Flags)
-{
-  if (XEUNICODE_P)
-    return LoadKeyboardLayoutW ((LPCWSTR) pwszKLID, Flags);
-  else
-    return LoadKeyboardLayoutA ((LPCSTR) pwszKLID, Flags);
+BOOL
+qxeAppendMenu (HMENU arg1, UINT arg2, UINT_PTR arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return AppendMenuW (arg1, arg2, arg3, (LPCWSTR) arg4);
+  else
+    return AppendMenuA (arg1, arg2, arg3, (LPCSTR) arg4);
+}
+
+/* Error if BroadcastSystemMessage used: win95 version not split; NT 4.0+ only */
+
+/* Error if BroadcastSystemMessageEx used: Function needs review to determine how to handle it */
+
+#if !defined (CYGWIN_HEADERS)
+
+BOOL
+qxeCallMsgFilter (LPMSG arg1, INT arg2)
+{
+  if (XEUNICODE_P)
+    return CallMsgFilterW (arg1, arg2);
+  else
+    return CallMsgFilterA (arg1, arg2);
+}
+
+#endif /* !defined (CYGWIN_HEADERS) */
+
+/* Error if CallWindowProc used: two versions, STRICT and non-STRICT */
+
+/* Error if ChangeDisplaySettings used: split-sized LPDEVMODE */
+
+/* Error if ChangeDisplaySettingsEx used: split-sized LPDEVMODE; NT 5.0/Win98+ only */
+
+BOOL
+qxeChangeMenu (HMENU arg1, UINT arg2, const Extbyte * arg3, UINT arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return ChangeMenuW (arg1, arg2, (LPCWSTR) arg3, arg4, arg5);
+  else
+    return ChangeMenuA (arg1, arg2, (LPCSTR) arg3, arg4, arg5);
+}
+
+Extbyte *
+qxeCharLower (Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) CharLowerW ((LPWSTR) arg1);
+  else
+    return (Extbyte *) CharLowerA ((LPSTR) arg1);
+}
+
+DWORD
+qxeCharLowerBuff (Extbyte * arg1, DWORD arg2)
+{
+  if (XEUNICODE_P)
+    return CharLowerBuffW ((LPWSTR) arg1, arg2);
+  else
+    return CharLowerBuffA ((LPSTR) arg1, arg2);
+}
+
+Extbyte *
+qxeCharNext (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) CharNextW ((LPCWSTR) arg1);
+  else
+    return (Extbyte *) CharNextA ((LPCSTR) arg1);
+}
+
+Extbyte *
+qxeCharPrev (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) CharPrevW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return (Extbyte *) CharPrevA ((LPCSTR) arg1, (LPCSTR) arg2);
 }
 
 BOOL
-qxeGetKeyboardLayoutName (Extbyte * pwszKLID)
-{
-  if (XEUNICODE_P)
-    return GetKeyboardLayoutNameW ((LPWSTR) pwszKLID);
-  else
-    return GetKeyboardLayoutNameA ((LPSTR) pwszKLID);
+qxeCharToOem (const Extbyte * arg1, LPSTR arg2)
+{
+  if (XEUNICODE_P)
+    return CharToOemW ((LPCWSTR) arg1, arg2);
+  else
+    return CharToOemA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeCharToOemBuff (const Extbyte * arg1, LPSTR arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return CharToOemBuffW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return CharToOemBuffA ((LPCSTR) arg1, arg2, arg3);
+}
+
+Extbyte *
+qxeCharUpper (Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) CharUpperW ((LPWSTR) arg1);
+  else
+    return (Extbyte *) CharUpperA ((LPSTR) arg1);
+}
+
+DWORD
+qxeCharUpperBuff (Extbyte * arg1, DWORD arg2)
+{
+  if (XEUNICODE_P)
+    return CharUpperBuffW ((LPWSTR) arg1, arg2);
+  else
+    return CharUpperBuffA ((LPSTR) arg1, arg2);
+}
+
+int
+qxeCopyAcceleratorTable (HACCEL arg1, LPACCEL arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return CopyAcceleratorTableW (arg1, arg2, arg3);
+  else
+    return CopyAcceleratorTableA (arg1, arg2, arg3);
+}
+
+HACCEL
+qxeCreateAcceleratorTable (LPACCEL arg1, int arg2)
+{
+  if (XEUNICODE_P)
+    return CreateAcceleratorTableW (arg1, arg2);
+  else
+    return CreateAcceleratorTableA (arg1, arg2);
 }
 
 /* Error if CreateDesktop used: split-sized LPDEVMODE */
 
-HDESK
-qxeOpenDesktop (Extbyte * lpszDesktop, DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
-{
-  if (XEUNICODE_P)
-    return OpenDesktopW ((LPWSTR) lpszDesktop, dwFlags, fInherit, dwDesiredAccess);
-  else
-    return OpenDesktopA ((LPSTR) lpszDesktop, dwFlags, fInherit, dwDesiredAccess);
-}
-
-/* NOTE: // callback fun differs only in string pointer type */
+/* NOTE: error in Cygwin prototype (no split) but fixable with typedef */
+HWND
+qxeCreateDialogIndirectParam (HINSTANCE arg1, LPCDLGTEMPLATE arg2, HWND arg3, DLGPROC arg4, LPARAM arg5)
+{
+  if (XEUNICODE_P)
+    return CreateDialogIndirectParamW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return CreateDialogIndirectParamA (arg1, arg2, arg3, arg4, arg5);
+}
+
+HWND
+qxeCreateDialogParam (HINSTANCE arg1, const Extbyte * arg2, HWND arg3, DLGPROC arg4, LPARAM arg5)
+{
+  if (XEUNICODE_P)
+    return CreateDialogParamW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return CreateDialogParamA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+/* NOTE: error arg 1, VS6 prototype, missing const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           WINUSERAPI HWND WINAPI CreateMDIWindow(LPCWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
+         Overridden with:
+           HWND CreateMDIWindow(LPWSTR,LPWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
+HWND
+qxeCreateMDIWindow (Extbyte * arg1, Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10)
+{
+  if (XEUNICODE_P)
+    return CreateMDIWindowW ((LPWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+  else
+    return CreateMDIWindowA ((LPSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+}
+
+HWND
+qxeCreateWindowEx (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4, int arg5, int arg6, int arg7, int arg8, HWND arg9, HMENU arg10, HINSTANCE arg11, LPVOID arg12)
+{
+  if (XEUNICODE_P)
+    return CreateWindowExW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+  else
+    return CreateWindowExA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+}
+
+/* NOTE: error arg 1, VS6 prototype, missing const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           WINUSERAPI HWINSTA WINAPI CreateWindowStation(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES)
+         Overridden with:
+           HWINSTA CreateWindowStation(LPWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
+HWINSTA
+qxeCreateWindowStation (Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4)
+{
+  if (XEUNICODE_P)
+    return CreateWindowStationW ((LPWSTR) arg1, arg2, arg3, arg4);
+  else
+    return CreateWindowStationA ((LPSTR) arg1, arg2, arg3, arg4);
+}
+
+/* Error if DefDlgProc used: return value is conditionalized on _MAC, messes up parser */
+
+LRESULT
+qxeDefFrameProc (HWND arg1, HWND arg2, UINT arg3, WPARAM arg4, LPARAM arg5)
+{
+  if (XEUNICODE_P)
+    return DefFrameProcW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return DefFrameProcA (arg1, arg2, arg3, arg4, arg5);
+}
+
+/* Error if DefMDIChildProc used: return value is conditionalized on _MAC, messes up parser */
+
+/* Skipping DefWindowProc because return value is conditionalized on _MAC, messes up parser */
+
+/* NOTE: error in Cygwin prototype (no split) but fixable with typedef */
+int
+qxeDialogBoxIndirectParam (HINSTANCE arg1, LPCDLGTEMPLATE arg2, HWND arg3, DLGPROC arg4, LPARAM arg5)
+{
+  if (XEUNICODE_P)
+    return DialogBoxIndirectParamW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return DialogBoxIndirectParamA (arg1, arg2, arg3, arg4, arg5);
+}
+
+int
+qxeDialogBoxParam (HINSTANCE arg1, const Extbyte * arg2, HWND arg3, DLGPROC arg4, LPARAM arg5)
+{
+  if (XEUNICODE_P)
+    return DialogBoxParamW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return DialogBoxParamA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+LONG
+qxeDispatchMessage (const MSG* arg1)
+{
+  if (XEUNICODE_P)
+    return DispatchMessageW (arg1);
+  else
+    return DispatchMessageA (arg1);
+}
+
+int
+qxeDlgDirList (HWND arg1, Extbyte * arg2, int arg3, int arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return DlgDirListW (arg1, (LPWSTR) arg2, arg3, arg4, arg5);
+  else
+    return DlgDirListA (arg1, (LPSTR) arg2, arg3, arg4, arg5);
+}
+
+int
+qxeDlgDirListComboBox (HWND arg1, Extbyte * arg2, int arg3, int arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return DlgDirListComboBoxW (arg1, (LPWSTR) arg2, arg3, arg4, arg5);
+  else
+    return DlgDirListComboBoxA (arg1, (LPSTR) arg2, arg3, arg4, arg5);
+}
+
 BOOL
-qxeEnumDesktops (HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return EnumDesktopsW (hwinsta, lpEnumFunc, lParam);
-  else
-    return EnumDesktopsA (hwinsta, (DESKTOPENUMPROCA) lpEnumFunc, lParam);
-}
-
-HWINSTA
-qxeCreateWindowStation (Extbyte * lpwinsta, DWORD dwReserved, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
-{
-  if (XEUNICODE_P)
-    return CreateWindowStationW ((LPWSTR) lpwinsta, dwReserved, dwDesiredAccess, lpsa);
-  else
-    return CreateWindowStationA ((LPSTR) lpwinsta, dwReserved, dwDesiredAccess, lpsa);
-}
-
-HWINSTA
-qxeOpenWindowStation (Extbyte * lpszWinSta, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
-{
-  if (XEUNICODE_P)
-    return OpenWindowStationW ((LPWSTR) lpszWinSta, fInherit, dwDesiredAccess);
-  else
-    return OpenWindowStationA ((LPSTR) lpszWinSta, fInherit, dwDesiredAccess);
+qxeDlgDirSelectComboBoxEx (HWND arg1, Extbyte * arg2, int arg3, int arg4)
+{
+  if (XEUNICODE_P)
+    return DlgDirSelectComboBoxExW (arg1, (LPWSTR) arg2, arg3, arg4);
+  else
+    return DlgDirSelectComboBoxExA (arg1, (LPSTR) arg2, arg3, arg4);
+}
+
+BOOL
+qxeDlgDirSelectEx (HWND arg1, Extbyte * arg2, int arg3, int arg4)
+{
+  if (XEUNICODE_P)
+    return DlgDirSelectExW (arg1, (LPWSTR) arg2, arg3, arg4);
+  else
+    return DlgDirSelectExA (arg1, (LPSTR) arg2, arg3, arg4);
+}
+
+/* NOTE: NT 4.0+ only */
+BOOL
+qxeDrawState (HDC arg1, HBRUSH arg2, DRAWSTATEPROC arg3, LPARAM arg4, WPARAM arg5, int arg6, int arg7, int arg8, int arg9, UINT arg10)
+{
+  if (XEUNICODE_P)
+    return DrawStateW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+  else
+    return DrawStateA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+}
+
+int
+qxeDrawText (HDC arg1, const Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return DrawTextW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return DrawTextA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+/* NOTE: NT 4.0+ only */
+int
+qxeDrawTextEx (HDC arg1, Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5, LPDRAWTEXTPARAMS arg6)
+{
+  if (XEUNICODE_P)
+    return DrawTextExW (arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6);
+  else
+    return DrawTextExA (arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6);
 }
 
 /* NOTE: // callback fun differs only in string pointer type */
 BOOL
-qxeEnumWindowStations (WINSTAENUMPROCW lpEnumFunc, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return EnumWindowStationsW (lpEnumFunc, lParam);
-  else
-    return EnumWindowStationsA ((WINSTAENUMPROCA) lpEnumFunc, lParam);
-}
-
-BOOL
-qxeGetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength, LPDWORD lpnLengthNeeded)
-{
-  if (XEUNICODE_P)
-    return GetUserObjectInformationW (hObj, nIndex, pvInfo, nLength, lpnLengthNeeded);
-  else
-    return GetUserObjectInformationA (hObj, nIndex, pvInfo, nLength, lpnLengthNeeded);
-}
-
+qxeEnumDesktops (HWINSTA arg1, DESKTOPENUMPROCW arg2, LPARAM arg3)
+{
+  if (XEUNICODE_P)
+    return EnumDesktopsW (arg1, arg2, arg3);
+  else
+    return EnumDesktopsA (arg1, (DESKTOPENUMPROCA) arg2, arg3);
+}
+
+/* Error if EnumDisplaySettings used: split-sized LPDEVMODE */
+
+/* Error if EnumDisplaySettingsEx used: Function needs review to determine how to handle it */
+
+/* Error if EnumDisplayDevices used: split-sized PDISPLAY_DEVICE; NT 5.0+ only, no Win98 */
+
+/* NOTE: // callback fun differs only in string pointer type */
+int
+qxeEnumProps (HWND arg1, PROPENUMPROCW arg2)
+{
+  if (XEUNICODE_P)
+    return EnumPropsW (arg1, arg2);
+  else
+    return EnumPropsA (arg1, (PROPENUMPROCA) arg2);
+}
+
+/* NOTE: // callback fun differs only in string pointer type */
+int
+qxeEnumPropsEx (HWND arg1, PROPENUMPROCEXW arg2, LPARAM arg3)
+{
+  if (XEUNICODE_P)
+    return EnumPropsExW (arg1, arg2, arg3);
+  else
+    return EnumPropsExA (arg1, (PROPENUMPROCEXA) arg2, arg3);
+}
+
+/* NOTE: // callback fun differs only in string pointer type */
 BOOL
-qxeSetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength)
-{
-  if (XEUNICODE_P)
-    return SetUserObjectInformationW (hObj, nIndex, pvInfo, nLength);
-  else
-    return SetUserObjectInformationA (hObj, nIndex, pvInfo, nLength);
-}
-
-UINT
-qxeRegisterWindowMessage (const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return RegisterWindowMessageW ((LPCWSTR) lpString);
-  else
-    return RegisterWindowMessageA ((LPCSTR) lpString);
-}
-
-BOOL
-qxeGetMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
-{
-  if (XEUNICODE_P)
-    return GetMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
-  else
-    return GetMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
-}
-
-LONG
-qxeDispatchMessage (CONST MSG * lpMsg)
-{
-  if (XEUNICODE_P)
-    return DispatchMessageW (lpMsg);
-  else
-    return DispatchMessageA (lpMsg);
+qxeEnumWindowStations (WINSTAENUMPROCW arg1, LPARAM arg2)
+{
+  if (XEUNICODE_P)
+    return EnumWindowStationsW (arg1, arg2);
+  else
+    return EnumWindowStationsA ((WINSTAENUMPROCA) arg1, arg2);
+}
+
+/* NOTE: NT 4.0+ only */
+HWND
+qxeFindWindowEx (HWND arg1, HWND arg2, const Extbyte * arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return FindWindowExW (arg1, arg2, (LPCWSTR) arg3, (LPCWSTR) arg4);
+  else
+    return FindWindowExA (arg1, arg2, (LPCSTR) arg3, (LPCSTR) arg4);
+}
+
+HWND
+qxeFindWindow (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return FindWindowW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return FindWindowA ((LPCSTR) arg1, (LPCSTR) arg2);
 }
 
 BOOL
-qxePeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
-{
-  if (XEUNICODE_P)
-    return PeekMessageW (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
-  else
-    return PeekMessageA (lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
-}
-
-/* Skipping SendMessage because split messages and structures */
-
-LRESULT
-qxeSendMessageTimeout (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, LPDWORD lpdwResult)
-{
-  if (XEUNICODE_P)
-    return SendMessageTimeoutW (hWnd, Msg, wParam, lParam, fuFlags, uTimeout, lpdwResult);
-  else
-    return SendMessageTimeoutA (hWnd, Msg, wParam, lParam, fuFlags, uTimeout, lpdwResult);
-}
-
-BOOL
-qxeSendNotifyMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return SendNotifyMessageW (hWnd, Msg, wParam, lParam);
-  else
-    return SendNotifyMessageA (hWnd, Msg, wParam, lParam);
-}
-
-BOOL
-qxeSendMessageCallback (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpResultCallBack, DWORD dwData)
-{
-  if (XEUNICODE_P)
-    return SendMessageCallbackW (hWnd, Msg, wParam, lParam, lpResultCallBack, dwData);
-  else
-    return SendMessageCallbackA (hWnd, Msg, wParam, lParam, lpResultCallBack, dwData);
-}
-
-/* Error if BroadcastSystemMessage used: win95 version not split; NT 4.0+ only */
-
-/* Error if RegisterDeviceNotification used: NT 5.0+ only */
-
-BOOL
-qxePostMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return PostMessageW (hWnd, Msg, wParam, lParam);
-  else
-    return PostMessageA (hWnd, Msg, wParam, lParam);
-}
-
-BOOL
-qxePostThreadMessage (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return PostThreadMessageW (idThread, Msg, wParam, lParam);
-  else
-    return PostThreadMessageA (idThread, Msg, wParam, lParam);
-}
-
-/* Skipping DefWindowProc because return value is conditionalized on _MAC, messes up parser */
-
-/* Error if CallWindowProc used: two versions, STRICT and non-STRICT */
-
-/* Error if CallWindowProc used: two versions, STRICT and non-STRICT */
-
-/* Skipping RegisterClass because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS */
-
-/* Skipping UnregisterClass because need to intercept for reasons related to RegisterClass */
-
-BOOL
-qxeGetClassInfo (HINSTANCE hInstance, const Extbyte * lpClassName, LPWNDCLASSW lpWndClass)
-{
-  if (XEUNICODE_P)
-    return GetClassInfoW (hInstance, (LPCWSTR) lpClassName, lpWndClass);
-  else
-    return GetClassInfoA (hInstance, (LPCSTR) lpClassName, (LPWNDCLASSA) lpWndClass);
-}
-
-/* Skipping RegisterClassEx because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only */
+qxeGetClassInfo (HINSTANCE arg1, const Extbyte * arg2, LPWNDCLASSW arg3)
+{
+  if (XEUNICODE_P)
+    return GetClassInfoW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return GetClassInfoA (arg1, (LPCSTR) arg2, (LPWNDCLASSA) arg3);
+}
 
 /* NOTE: NT 4.0+ only */
 BOOL
@@ -758,340 +1177,170 @@
     return GetClassInfoExA (arg1, (LPCSTR) arg2, (LPWNDCLASSEXA) arg3);
 }
 
-HWND
-qxeCreateWindowEx (DWORD dwExStyle, const Extbyte * lpClassName, const Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)
-{
-  if (XEUNICODE_P)
-    return CreateWindowExW (dwExStyle, (LPCWSTR) lpClassName, (LPCWSTR) lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
-  else
-    return CreateWindowExA (dwExStyle, (LPCSTR) lpClassName, (LPCSTR) lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
-}
-
-HWND
-qxeCreateDialogParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
-{
-  if (XEUNICODE_P)
-    return CreateDialogParamW (hInstance, (LPCWSTR) lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
-  else
-    return CreateDialogParamA (hInstance, (LPCSTR) lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
-}
-
-/* NOTE: error in Cygwin prototype (no split) but fixable with typedef */
-HWND
-qxeCreateDialogIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
-{
-  if (XEUNICODE_P)
-    return CreateDialogIndirectParamW (hInstance, lpTemplate, hWndParent, lpDialogFunc, dwInitParam);
-  else
-    return CreateDialogIndirectParamA (hInstance, (LPCDLGTEMPLATEA) lpTemplate, hWndParent, lpDialogFunc, dwInitParam);
+DWORD
+qxeGetClassLong (HWND arg1, int arg2)
+{
+  if (XEUNICODE_P)
+    return GetClassLongW (arg1, arg2);
+  else
+    return GetClassLongA (arg1, arg2);
+}
+
+/* Error if GetClassLongPtr used: Function needs review to determine how to handle it */
+
+int
+qxeGetClassName (HWND arg1, Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return GetClassNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetClassNameA (arg1, (LPSTR) arg2, arg3);
 }
 
 int
-qxeDialogBoxParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
-{
-  if (XEUNICODE_P)
-    return DialogBoxParamW (hInstance, (LPCWSTR) lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
-  else
-    return DialogBoxParamA (hInstance, (LPCSTR) lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
-}
-
-/* NOTE: error in Cygwin prototype (no split) but fixable with typedef */
-int
-qxeDialogBoxIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam)
-{
-  if (XEUNICODE_P)
-    return DialogBoxIndirectParamW (hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
-  else
-    return DialogBoxIndirectParamA (hInstance, (LPCDLGTEMPLATEA) hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
-}
-
-BOOL
-qxeSetDlgItemText (HWND hDlg, int nIDDlgItem, const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return SetDlgItemTextW (hDlg, nIDDlgItem, (LPCWSTR) lpString);
-  else
-    return SetDlgItemTextA (hDlg, nIDDlgItem, (LPCSTR) lpString);
+qxeGetClipboardFormatName (UINT arg1, Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return GetClipboardFormatNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetClipboardFormatNameA (arg1, (LPSTR) arg2, arg3);
 }
 
 UINT
-qxeGetDlgItemText (HWND hDlg, int nIDDlgItem, Extbyte * lpString, int nMaxCount)
-{
-  if (XEUNICODE_P)
-    return GetDlgItemTextW (hDlg, nIDDlgItem, (LPWSTR) lpString, nMaxCount);
-  else
-    return GetDlgItemTextA (hDlg, nIDDlgItem, (LPSTR) lpString, nMaxCount);
-}
-
-LONG
-qxeSendDlgItemMessage (HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return SendDlgItemMessageW (hDlg, nIDDlgItem, Msg, wParam, lParam);
-  else
-    return SendDlgItemMessageA (hDlg, nIDDlgItem, Msg, wParam, lParam);
-}
-
-/* Error if DefDlgProc used: return value is conditionalized on _MAC, messes up parser */
-
-#if !defined (CYGWIN_HEADERS)
+qxeGetDlgItemText (HWND arg1, int arg2, Extbyte * arg3, int arg4)
+{
+  if (XEUNICODE_P)
+    return GetDlgItemTextW (arg1, arg2, (LPWSTR) arg3, arg4);
+  else
+    return GetDlgItemTextA (arg1, arg2, (LPSTR) arg3, arg4);
+}
 
 BOOL
-qxeCallMsgFilter (LPMSG lpMsg, int nCode)
-{
-  if (XEUNICODE_P)
-    return CallMsgFilterW (lpMsg, nCode);
-  else
-    return CallMsgFilterA (lpMsg, nCode);
-}
-
-#endif /* !defined (CYGWIN_HEADERS) */
-
-UINT
-qxeRegisterClipboardFormat (const Extbyte * lpszFormat)
-{
-  if (XEUNICODE_P)
-    return RegisterClipboardFormatW ((LPCWSTR) lpszFormat);
-  else
-    return RegisterClipboardFormatA ((LPCSTR) lpszFormat);
+qxeGetKeyboardLayoutName (Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GetKeyboardLayoutNameW ((LPWSTR) arg1);
+  else
+    return GetKeyboardLayoutNameA ((LPSTR) arg1);
 }
 
 int
-qxeGetClipboardFormatName (UINT format, Extbyte * lpszFormatName, int cchMaxCount)
-{
-  if (XEUNICODE_P)
-    return GetClipboardFormatNameW (format, (LPWSTR) lpszFormatName, cchMaxCount);
-  else
-    return GetClipboardFormatNameA (format, (LPSTR) lpszFormatName, cchMaxCount);
-}
-
+qxeGetKeyNameText (LONG arg1, Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return GetKeyNameTextW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetKeyNameTextA (arg1, (LPSTR) arg2, arg3);
+}
+
+/* NOTE: NT 4.0+ only */
 BOOL
-qxeCharToOem (const Extbyte * lpszSrc, LPSTR lpszDst)
-{
-  if (XEUNICODE_P)
-    return CharToOemW ((LPCWSTR) lpszSrc, lpszDst);
-  else
-    return CharToOemA ((LPCSTR) lpszSrc, lpszDst);
-}
-
-BOOL
-qxeOemToChar (LPCSTR lpszSrc, Extbyte * lpszDst)
-{
-  if (XEUNICODE_P)
-    return OemToCharW (lpszSrc, (LPWSTR) lpszDst);
-  else
-    return OemToCharA (lpszSrc, (LPSTR) lpszDst);
-}
-
-BOOL
-qxeCharToOemBuff (const Extbyte * lpszSrc, LPSTR lpszDst, DWORD cchDstLength)
-{
-  if (XEUNICODE_P)
-    return CharToOemBuffW ((LPCWSTR) lpszSrc, lpszDst, cchDstLength);
-  else
-    return CharToOemBuffA ((LPCSTR) lpszSrc, lpszDst, cchDstLength);
+qxeGetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPMENUITEMINFOW arg4)
+{
+  if (XEUNICODE_P)
+    return GetMenuItemInfoW (arg1, arg2, arg3, arg4);
+  else
+    return GetMenuItemInfoA (arg1, arg2, arg3, (LPMENUITEMINFOA) arg4);
+}
+
+int
+qxeGetMenuString (HMENU arg1, UINT arg2, Extbyte * arg3, int arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return GetMenuStringW (arg1, arg2, (LPWSTR) arg3, arg4, arg5);
+  else
+    return GetMenuStringA (arg1, arg2, (LPSTR) arg3, arg4, arg5);
 }
 
 BOOL
-qxeOemToCharBuff (LPCSTR lpszSrc, Extbyte * lpszDst, DWORD cchDstLength)
-{
-  if (XEUNICODE_P)
-    return OemToCharBuffW (lpszSrc, (LPWSTR) lpszDst, cchDstLength);
-  else
-    return OemToCharBuffA (lpszSrc, (LPSTR) lpszDst, cchDstLength);
-}
-
-Extbyte *
-qxeCharUpper (Extbyte * lpsz)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) CharUpperW ((LPWSTR) lpsz);
-  else
-    return (Extbyte *) CharUpperA ((LPSTR) lpsz);
-}
-
-DWORD
-qxeCharUpperBuff (Extbyte * lpsz, DWORD cchLength)
-{
-  if (XEUNICODE_P)
-    return CharUpperBuffW ((LPWSTR) lpsz, cchLength);
-  else
-    return CharUpperBuffA ((LPSTR) lpsz, cchLength);
-}
-
-Extbyte *
-qxeCharLower (Extbyte * lpsz)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) CharLowerW ((LPWSTR) lpsz);
-  else
-    return (Extbyte *) CharLowerA ((LPSTR) lpsz);
-}
+qxeGetMessage (LPMSG arg1, HWND arg2, UINT arg3, UINT arg4)
+{
+  if (XEUNICODE_P)
+    return GetMessageW (arg1, arg2, arg3, arg4);
+  else
+    return GetMessageA (arg1, arg2, arg3, arg4);
+}
+
+HANDLE
+qxeGetProp (HWND arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return GetPropW (arg1, (LPCWSTR) arg2);
+  else
+    return GetPropA (arg1, (LPCSTR) arg2);
+}
+
+/* Error if GetRawInputDeviceInfo used: Function needs review to determine how to handle it */
 
 DWORD
-qxeCharLowerBuff (Extbyte * lpsz, DWORD cchLength)
-{
-  if (XEUNICODE_P)
-    return CharLowerBuffW ((LPWSTR) lpsz, cchLength);
-  else
-    return CharLowerBuffA ((LPSTR) lpsz, cchLength);
-}
-
-Extbyte *
-qxeCharNext (const Extbyte * lpsz)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) CharNextW ((LPCWSTR) lpsz);
-  else
-    return (Extbyte *) CharNextA ((LPCSTR) lpsz);
-}
-
-Extbyte *
-qxeCharPrev (const Extbyte * lpszStart, const Extbyte * lpszCurrent)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) CharPrevW ((LPCWSTR) lpszStart, (LPCWSTR) lpszCurrent);
-  else
-    return (Extbyte *) CharPrevA ((LPCSTR) lpszStart, (LPCSTR) lpszCurrent);
-}
-
-/* Error if IsCharAlpha used: split CHAR */
-
-/* Error if IsCharAlphaNumeric used: split CHAR */
-
-/* Error if IsCharUpper used: split CHAR */
-
-/* Error if IsCharLower used: split CHAR */
-
-int
-qxeGetKeyNameText (LONG lParam, Extbyte * lpString, int nSize)
-{
-  if (XEUNICODE_P)
-    return GetKeyNameTextW (lParam, (LPWSTR) lpString, nSize);
-  else
-    return GetKeyNameTextA (lParam, (LPSTR) lpString, nSize);
-}
-
-/* Skipping VkKeyScan because split CHAR */
-
-/* Error if VkKeyScanEx used: split CHAR; NT 4.0+ only */
-
-UINT
-qxeMapVirtualKey (UINT uCode, UINT uMapType)
-{
-  if (XEUNICODE_P)
-    return MapVirtualKeyW (uCode, uMapType);
-  else
-    return MapVirtualKeyA (uCode, uMapType);
-}
-
-/* NOTE: NT 4.0+ only */
-UINT
-qxeMapVirtualKeyEx (UINT uCode, UINT uMapType, HKL dwhkl)
-{
-  if (XEUNICODE_P)
-    return MapVirtualKeyExW (uCode, uMapType, dwhkl);
-  else
-    return MapVirtualKeyExA (uCode, uMapType, dwhkl);
-}
-
-HACCEL
-qxeLoadAccelerators (HINSTANCE hInstance, const Extbyte * lpTableName)
-{
-  if (XEUNICODE_P)
-    return LoadAcceleratorsW (hInstance, (LPCWSTR) lpTableName);
-  else
-    return LoadAcceleratorsA (hInstance, (LPCSTR) lpTableName);
-}
-
-HACCEL
-qxeCreateAcceleratorTable (LPACCEL arg1, int arg2)
-{
-  if (XEUNICODE_P)
-    return CreateAcceleratorTableW (arg1, arg2);
-  else
-    return CreateAcceleratorTableA (arg1, arg2);
+qxeGetTabbedTextExtent (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5)
+{
+  if (XEUNICODE_P)
+    return GetTabbedTextExtentW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return GetTabbedTextExtentA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+LONG
+qxeGetWindowLong (HWND arg1, int arg2)
+{
+  if (XEUNICODE_P)
+    return GetWindowLongW (arg1, arg2);
+  else
+    return GetWindowLongA (arg1, arg2);
+}
+
+/* Error if GetWindowLongPtr used: Function needs review to determine how to handle it */
+
+BOOL
+qxeGetUserObjectInformation (HANDLE arg1, int arg2, PVOID arg3, DWORD arg4, PDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return GetUserObjectInformationW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return GetUserObjectInformationA (arg1, arg2, arg3, arg4, arg5);
 }
 
 int
-qxeCopyAcceleratorTable (HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries)
-{
-  if (XEUNICODE_P)
-    return CopyAcceleratorTableW (hAccelSrc, lpAccelDst, cAccelEntries);
-  else
-    return CopyAcceleratorTableA (hAccelSrc, lpAccelDst, cAccelEntries);
+qxeGetWindowTextLength (HWND arg1)
+{
+  if (XEUNICODE_P)
+    return GetWindowTextLengthW (arg1);
+  else
+    return GetWindowTextLengthA (arg1);
 }
 
 int
-qxeTranslateAccelerator (HWND hWnd, HACCEL hAccTable, LPMSG lpMsg)
-{
-  if (XEUNICODE_P)
-    return TranslateAcceleratorW (hWnd, hAccTable, lpMsg);
-  else
-    return TranslateAcceleratorA (hWnd, hAccTable, lpMsg);
-}
-
-HMENU
-qxeLoadMenu (HINSTANCE hInstance, const Extbyte * lpMenuName)
-{
-  if (XEUNICODE_P)
-    return LoadMenuW (hInstance, (LPCWSTR) lpMenuName);
-  else
-    return LoadMenuA (hInstance, (LPCSTR) lpMenuName);
-}
-
-HMENU
-qxeLoadMenuIndirect (CONST MENUTEMPLATEW * lpMenuTemplate)
-{
-  if (XEUNICODE_P)
-    return LoadMenuIndirectW (lpMenuTemplate);
-  else
-    return LoadMenuIndirectA ((CONST MENUTEMPLATEA *) lpMenuTemplate);
+qxeGetWindowText (HWND arg1, Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return GetWindowTextW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetWindowTextA (arg1, (LPSTR) arg2, arg3);
+}
+
+/* Error if GetAltTabInfo used: NT 5.0+ only */
+
+/* Error if GetMonitorInfo used: NT 5.0/Win98+ only */
+
+/* Error if GetWindowModuleFileName used: NT 5.0+ only */
+
+BOOL
+qxeGrayString (HDC arg1, HBRUSH arg2, GRAYSTRINGPROC arg3, LPARAM arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
+{
+  if (XEUNICODE_P)
+    return GrayStringW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
+  else
+    return GrayStringA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
 }
 
 BOOL
-qxeChangeMenu (HMENU hMenu, UINT cmd, const Extbyte * lpszNewItem, UINT cmdInsert, UINT flags)
-{
-  if (XEUNICODE_P)
-    return ChangeMenuW (hMenu, cmd, (LPCWSTR) lpszNewItem, cmdInsert, flags);
-  else
-    return ChangeMenuA (hMenu, cmd, (LPCSTR) lpszNewItem, cmdInsert, flags);
-}
-
-int
-qxeGetMenuString (HMENU hMenu, UINT uIDItem, Extbyte * lpString, int nMaxCount, UINT uFlag)
-{
-  if (XEUNICODE_P)
-    return GetMenuStringW (hMenu, uIDItem, (LPWSTR) lpString, nMaxCount, uFlag);
-  else
-    return GetMenuStringA (hMenu, uIDItem, (LPSTR) lpString, nMaxCount, uFlag);
-}
-
-BOOL
-qxeInsertMenu (HMENU hMenu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem)
-{
-  if (XEUNICODE_P)
-    return InsertMenuW (hMenu, uPosition, uFlags, uIDNewItem, (LPCWSTR) lpNewItem);
-  else
-    return InsertMenuA (hMenu, uPosition, uFlags, uIDNewItem, (LPCSTR) lpNewItem);
-}
-
-BOOL
-qxeAppendMenu (HMENU hMenu, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem)
-{
-  if (XEUNICODE_P)
-    return AppendMenuW (hMenu, uFlags, uIDNewItem, (LPCWSTR) lpNewItem);
-  else
-    return AppendMenuA (hMenu, uFlags, uIDNewItem, (LPCSTR) lpNewItem);
-}
-
-BOOL
-qxeModifyMenu (HMENU hMnu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem)
-{
-  if (XEUNICODE_P)
-    return ModifyMenuW (hMnu, uPosition, uFlags, uIDNewItem, (LPCWSTR) lpNewItem);
-  else
-    return ModifyMenuA (hMnu, uPosition, uFlags, uIDNewItem, (LPCSTR) lpNewItem);
+qxeInsertMenu (HMENU arg1, UINT arg2, UINT arg3, UINT arg4, const Extbyte * arg5)
+{
+  if (XEUNICODE_P)
+    return InsertMenuW (arg1, arg2, arg3, arg4, (LPCWSTR) arg5);
+  else
+    return InsertMenuA (arg1, arg2, arg3, arg4, (LPCSTR) arg5);
 }
 
 /* NOTE: NT 4.0+ only */
@@ -1104,14 +1353,309 @@
     return InsertMenuItemA (arg1, arg2, arg3, (LPCMENUITEMINFOA) arg4);
 }
 
+/* Error if IsCharAlphaNumeric used: split CHAR */
+
+/* Error if IsCharAlpha used: split CHAR */
+
+/* Error if IsCharLower used: split CHAR */
+
+/* Error if IsCharUpper used: split CHAR */
+
+BOOL
+qxeIsDialogMessage (HWND arg1, LPMSG arg2)
+{
+  if (XEUNICODE_P)
+    return IsDialogMessageW (arg1, arg2);
+  else
+    return IsDialogMessageA (arg1, arg2);
+}
+
+HACCEL
+qxeLoadAccelerators (HINSTANCE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return LoadAcceleratorsW (arg1, (LPCWSTR) arg2);
+  else
+    return LoadAcceleratorsA (arg1, (LPCSTR) arg2);
+}
+
+HBITMAP
+qxeLoadBitmap (HINSTANCE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return LoadBitmapW (arg1, (LPCWSTR) arg2);
+  else
+    return LoadBitmapA (arg1, (LPCSTR) arg2);
+}
+
+HCURSOR
+qxeLoadCursorFromFile (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return LoadCursorFromFileW ((LPCWSTR) arg1);
+  else
+    return LoadCursorFromFileA ((LPCSTR) arg1);
+}
+
+HCURSOR
+qxeLoadCursor (HINSTANCE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return LoadCursorW (arg1, (LPCWSTR) arg2);
+  else
+    return LoadCursorA (arg1, (LPCSTR) arg2);
+}
+
+HICON
+qxeLoadIcon (HINSTANCE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return LoadIconW (arg1, (LPCWSTR) arg2);
+  else
+    return LoadIconA (arg1, (LPCSTR) arg2);
+}
+
 /* NOTE: NT 4.0+ only */
+HANDLE
+qxeLoadImage (HINSTANCE arg1, const Extbyte * arg2, UINT arg3, int arg4, int arg5, UINT arg6)
+{
+  if (XEUNICODE_P)
+    return LoadImageW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
+  else
+    return LoadImageA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6);
+}
+
+HKL
+qxeLoadKeyboardLayout (const Extbyte * arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return LoadKeyboardLayoutW ((LPCWSTR) arg1, arg2);
+  else
+    return LoadKeyboardLayoutA ((LPCSTR) arg1, arg2);
+}
+
+HMENU
+qxeLoadMenuIndirect (const MENUTEMPLATE* arg1)
+{
+  if (XEUNICODE_P)
+    return LoadMenuIndirectW (arg1);
+  else
+    return LoadMenuIndirectA (arg1);
+}
+
+HMENU
+qxeLoadMenu (HINSTANCE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return LoadMenuW (arg1, (LPCWSTR) arg2);
+  else
+    return LoadMenuA (arg1, (LPCSTR) arg2);
+}
+
+int
+qxeLoadString (HINSTANCE arg1, UINT arg2, Extbyte * arg3, int arg4)
+{
+  if (XEUNICODE_P)
+    return LoadStringW (arg1, arg2, (LPWSTR) arg3, arg4);
+  else
+    return LoadStringA (arg1, arg2, (LPSTR) arg3, arg4);
+}
+
+/* NOTE: NT 4.0+ only */
+UINT
+qxeMapVirtualKeyEx (UINT arg1, UINT arg2, HKL arg3)
+{
+  if (XEUNICODE_P)
+    return MapVirtualKeyExW (arg1, arg2, arg3);
+  else
+    return MapVirtualKeyExA (arg1, arg2, arg3);
+}
+
+UINT
+qxeMapVirtualKey (UINT arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return MapVirtualKeyW (arg1, arg2);
+  else
+    return MapVirtualKeyA (arg1, arg2);
+}
+
+int
+qxeMessageBox (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, UINT arg4)
+{
+  if (XEUNICODE_P)
+    return MessageBoxW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4);
+  else
+    return MessageBoxA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4);
+}
+
+int
+qxeMessageBoxEx (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, UINT arg4, WORD arg5)
+{
+  if (XEUNICODE_P)
+    return MessageBoxExW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4, arg5);
+  else
+    return MessageBoxExA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, arg5);
+}
+
+/* Error if MessageBoxIndirect used: Cygwin has split MSGBOXPARAMS* instead of LPMSGBOXPARAMS */
+
 BOOL
-qxeGetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPMENUITEMINFOW arg4)
-{
-  if (XEUNICODE_P)
-    return GetMenuItemInfoW (arg1, arg2, arg3, arg4);
-  else
-    return GetMenuItemInfoA (arg1, arg2, arg3, (LPMENUITEMINFOA) arg4);
+qxeModifyMenu (HMENU arg1, UINT arg2, UINT arg3, UINT arg4, const Extbyte * arg5)
+{
+  if (XEUNICODE_P)
+    return ModifyMenuW (arg1, arg2, arg3, arg4, (LPCWSTR) arg5);
+  else
+    return ModifyMenuA (arg1, arg2, arg3, arg4, (LPCSTR) arg5);
+}
+
+BOOL
+qxeOemToCharBuff (LPCSTR arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return OemToCharBuffW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return OemToCharBuffA (arg1, (LPSTR) arg2, arg3);
+}
+
+BOOL
+qxeOemToChar (LPCSTR arg1, Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return OemToCharW (arg1, (LPWSTR) arg2);
+  else
+    return OemToCharA (arg1, (LPSTR) arg2);
+}
+
+HDESK
+qxeOpenDesktop (Extbyte * arg1, DWORD arg2, BOOL arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return OpenDesktopW ((LPWSTR) arg1, arg2, arg3, arg4);
+  else
+    return OpenDesktopA ((LPSTR) arg1, arg2, arg3, arg4);
+}
+
+HWINSTA
+qxeOpenWindowStation (Extbyte * arg1, BOOL arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return OpenWindowStationW ((LPWSTR) arg1, arg2, arg3);
+  else
+    return OpenWindowStationA ((LPSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxePeekMessage (LPMSG arg1, HWND arg2, UINT arg3, UINT arg4, UINT arg5)
+{
+  if (XEUNICODE_P)
+    return PeekMessageW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return PeekMessageA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxePostMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
+{
+  if (XEUNICODE_P)
+    return PostMessageW (arg1, arg2, arg3, arg4);
+  else
+    return PostMessageA (arg1, arg2, arg3, arg4);
+}
+
+BOOL
+qxePostThreadMessage (DWORD arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
+{
+  if (XEUNICODE_P)
+    return PostThreadMessageW (arg1, arg2, arg3, arg4);
+  else
+    return PostThreadMessageA (arg1, arg2, arg3, arg4);
+}
+
+/* Error if RealGetWindowClass used: NT 5.0+ only */
+
+/* Skipping RegisterClass because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS */
+
+/* Skipping RegisterClassEx because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only */
+
+UINT
+qxeRegisterClipboardFormat (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return RegisterClipboardFormatW ((LPCWSTR) arg1);
+  else
+    return RegisterClipboardFormatA ((LPCSTR) arg1);
+}
+
+/* Error if RegisterDeviceNotification used: NT 5.0+ only */
+
+UINT
+qxeRegisterWindowMessage (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return RegisterWindowMessageW ((LPCWSTR) arg1);
+  else
+    return RegisterWindowMessageA ((LPCSTR) arg1);
+}
+
+HANDLE
+qxeRemoveProp (HWND arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return RemovePropW (arg1, (LPCWSTR) arg2);
+  else
+    return RemovePropA (arg1, (LPCSTR) arg2);
+}
+
+LONG
+qxeSendDlgItemMessage (HWND arg1, int arg2, UINT arg3, WPARAM arg4, LPARAM arg5)
+{
+  if (XEUNICODE_P)
+    return SendDlgItemMessageW (arg1, arg2, arg3, arg4, arg5);
+  else
+    return SendDlgItemMessageA (arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeSendMessageCallback (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4, SENDASYNCPROC arg5, DWORD arg6)
+{
+  if (XEUNICODE_P)
+    return SendMessageCallbackW (arg1, arg2, arg3, arg4, arg5, arg6);
+  else
+    return SendMessageCallbackA (arg1, arg2, arg3, arg4, arg5, arg6);
+}
+
+/* Error if SendMessageTimeout used: VS6 has erroneous seventh parameter DWORD_PTR instead of PDWORD_PTR */
+
+/* Skipping SendMessage because split messages and structures */
+
+BOOL
+qxeSendNotifyMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
+{
+  if (XEUNICODE_P)
+    return SendNotifyMessageW (arg1, arg2, arg3, arg4);
+  else
+    return SendNotifyMessageA (arg1, arg2, arg3, arg4);
+}
+
+DWORD
+qxeSetClassLong (HWND arg1, int arg2, LONG arg3)
+{
+  if (XEUNICODE_P)
+    return SetClassLongW (arg1, arg2, arg3);
+  else
+    return SetClassLongA (arg1, arg2, arg3);
+}
+
+/* Error if SetClassLongPtr used: Function needs review to determine how to handle it */
+
+BOOL
+qxeSetDlgItemText (HWND arg1, int arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return SetDlgItemTextW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return SetDlgItemTextA (arg1, arg2, (LPCSTR) arg3);
 }
 
 /* NOTE: NT 4.0+ only */
@@ -1124,402 +1668,1079 @@
     return SetMenuItemInfoA (arg1, arg2, arg3, (LPCMENUITEMINFOA) arg4);
 }
 
-int
-qxeDrawText (HDC hDC, const Extbyte * lpString, int nCount, LPRECT lpRect, UINT uFormat)
-{
-  if (XEUNICODE_P)
-    return DrawTextW (hDC, (LPCWSTR) lpString, nCount, lpRect, uFormat);
-  else
-    return DrawTextA (hDC, (LPCSTR) lpString, nCount, lpRect, uFormat);
-}
-
-/* NOTE: NT 4.0+ only */
-int
-qxeDrawTextEx (HDC arg1, Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5, LPDRAWTEXTPARAMS arg6)
-{
-  if (XEUNICODE_P)
-    return DrawTextExW (arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6);
-  else
-    return DrawTextExA (arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6);
-}
-
 BOOL
-qxeGrayString (HDC hDC, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc, LPARAM lpData, int nCount, int X, int Y, int nWidth, int nHeight)
-{
-  if (XEUNICODE_P)
-    return GrayStringW (hDC, hBrush, lpOutputFunc, lpData, nCount, X, Y, nWidth, nHeight);
-  else
-    return GrayStringA (hDC, hBrush, lpOutputFunc, lpData, nCount, X, Y, nWidth, nHeight);
-}
-
-/* NOTE: NT 4.0+ only */
-BOOL
-qxeDrawState (HDC arg1, HBRUSH arg2, DRAWSTATEPROC arg3, LPARAM arg4, WPARAM arg5, int arg6, int arg7, int arg8, int arg9, UINT arg10)
-{
-  if (XEUNICODE_P)
-    return DrawStateW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
-  else
-    return DrawStateA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
-}
-
-LONG
-qxeTabbedTextOut (HDC hDC, int X, int Y, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
-{
-  if (XEUNICODE_P)
-    return TabbedTextOutW (hDC, X, Y, (LPCWSTR) lpString, nCount, nTabPositions, lpnTabStopPositions, nTabOrigin);
-  else
-    return TabbedTextOutA (hDC, X, Y, (LPCSTR) lpString, nCount, nTabPositions, lpnTabStopPositions, nTabOrigin);
-}
-
-DWORD
-qxeGetTabbedTextExtent (HDC hDC, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
-{
-  if (XEUNICODE_P)
-    return GetTabbedTextExtentW (hDC, (LPCWSTR) lpString, nCount, nTabPositions, lpnTabStopPositions);
-  else
-    return GetTabbedTextExtentA (hDC, (LPCSTR) lpString, nCount, nTabPositions, lpnTabStopPositions);
-}
-
-BOOL
-qxeSetProp (HWND hWnd, const Extbyte * lpString, HANDLE hData)
-{
-  if (XEUNICODE_P)
-    return SetPropW (hWnd, (LPCWSTR) lpString, hData);
-  else
-    return SetPropA (hWnd, (LPCSTR) lpString, hData);
-}
-
-HANDLE
-qxeGetProp (HWND hWnd, const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return GetPropW (hWnd, (LPCWSTR) lpString);
-  else
-    return GetPropA (hWnd, (LPCSTR) lpString);
-}
-
-HANDLE
-qxeRemoveProp (HWND hWnd, const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return RemovePropW (hWnd, (LPCWSTR) lpString);
-  else
-    return RemovePropA (hWnd, (LPCSTR) lpString);
-}
-
-/* NOTE: // callback fun differs only in string pointer type */
-int
-qxeEnumPropsEx (HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return EnumPropsExW (hWnd, lpEnumFunc, lParam);
-  else
-    return EnumPropsExA (hWnd, (PROPENUMPROCEXA) lpEnumFunc, lParam);
-}
-
-/* NOTE: // callback fun differs only in string pointer type */
-int
-qxeEnumProps (HWND hWnd, PROPENUMPROCW lpEnumFunc)
-{
-  if (XEUNICODE_P)
-    return EnumPropsW (hWnd, lpEnumFunc);
-  else
-    return EnumPropsA (hWnd, (PROPENUMPROCA) lpEnumFunc);
+qxeSetProp (HWND arg1, const Extbyte * arg2, HANDLE arg3)
+{
+  if (XEUNICODE_P)
+    return SetPropW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return SetPropA (arg1, (LPCSTR) arg2, arg3);
 }
 
 BOOL
-qxeSetWindowText (HWND hWnd, const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return SetWindowTextW (hWnd, (LPCWSTR) lpString);
-  else
-    return SetWindowTextA (hWnd, (LPCSTR) lpString);
-}
-
-int
-qxeGetWindowText (HWND hWnd, Extbyte * lpString, int nMaxCount)
-{
-  if (XEUNICODE_P)
-    return GetWindowTextW (hWnd, (LPWSTR) lpString, nMaxCount);
-  else
-    return GetWindowTextA (hWnd, (LPSTR) lpString, nMaxCount);
-}
-
-int
-qxeGetWindowTextLength (HWND hWnd)
-{
-  if (XEUNICODE_P)
-    return GetWindowTextLengthW (hWnd);
-  else
-    return GetWindowTextLengthA (hWnd);
-}
-
-int
-qxeMessageBox (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType)
-{
-  if (XEUNICODE_P)
-    return MessageBoxW (hWnd, (LPCWSTR) lpText, (LPCWSTR) lpCaption, uType);
-  else
-    return MessageBoxA (hWnd, (LPCSTR) lpText, (LPCSTR) lpCaption, uType);
-}
-
-int
-qxeMessageBoxEx (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType, WORD wLanguageId)
-{
-  if (XEUNICODE_P)
-    return MessageBoxExW (hWnd, (LPCWSTR) lpText, (LPCWSTR) lpCaption, uType, wLanguageId);
-  else
-    return MessageBoxExA (hWnd, (LPCSTR) lpText, (LPCSTR) lpCaption, uType, wLanguageId);
-}
-
-/* NOTE: NT 4.0+ only */
-int
-qxeMessageBoxIndirect (LPMSGBOXPARAMSW arg1)
-{
-  if (XEUNICODE_P)
-    return MessageBoxIndirectW (arg1);
-  else
-    return MessageBoxIndirectA ((LPMSGBOXPARAMSA) arg1);
+qxeSetUserObjectInformation (HANDLE arg1, int arg2, PVOID arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return SetUserObjectInformationW (arg1, arg2, arg3, arg4);
+  else
+    return SetUserObjectInformationA (arg1, arg2, arg3, arg4);
 }
 
 LONG
-qxeGetWindowLong (HWND hWnd, int nIndex)
-{
-  if (XEUNICODE_P)
-    return GetWindowLongW (hWnd, nIndex);
-  else
-    return GetWindowLongA (hWnd, nIndex);
-}
-
-LONG
-qxeSetWindowLong (HWND hWnd, int nIndex, LONG dwNewLong)
-{
-  if (XEUNICODE_P)
-    return SetWindowLongW (hWnd, nIndex, dwNewLong);
-  else
-    return SetWindowLongA (hWnd, nIndex, dwNewLong);
-}
-
-DWORD
-qxeGetClassLong (HWND hWnd, int nIndex)
-{
-  if (XEUNICODE_P)
-    return GetClassLongW (hWnd, nIndex);
-  else
-    return GetClassLongA (hWnd, nIndex);
-}
-
-DWORD
-qxeSetClassLong (HWND hWnd, int nIndex, LONG dwNewLong)
-{
-  if (XEUNICODE_P)
-    return SetClassLongW (hWnd, nIndex, dwNewLong);
-  else
-    return SetClassLongA (hWnd, nIndex, dwNewLong);
-}
-
-HWND
-qxeFindWindow (const Extbyte * lpClassName, const Extbyte * lpWindowName)
-{
-  if (XEUNICODE_P)
-    return FindWindowW ((LPCWSTR) lpClassName, (LPCWSTR) lpWindowName);
-  else
-    return FindWindowA ((LPCSTR) lpClassName, (LPCSTR) lpWindowName);
-}
-
-/* NOTE: NT 4.0+ only */
-HWND
-qxeFindWindowEx (HWND arg1, HWND arg2, const Extbyte * arg3, const Extbyte * arg4)
-{
-  if (XEUNICODE_P)
-    return FindWindowExW (arg1, arg2, (LPCWSTR) arg3, (LPCWSTR) arg4);
-  else
-    return FindWindowExA (arg1, arg2, (LPCSTR) arg3, (LPCSTR) arg4);
-}
-
-int
-qxeGetClassName (HWND hWnd, Extbyte * lpClassName, int nMaxCount)
-{
-  if (XEUNICODE_P)
-    return GetClassNameW (hWnd, (LPWSTR) lpClassName, nMaxCount);
-  else
-    return GetClassNameA (hWnd, (LPSTR) lpClassName, nMaxCount);
-}
-
-/* Error if SetWindowsHook used: obsolete; two versions, STRICT and non-STRICT */
+qxeSetWindowLong (HWND arg1, int arg2, LONG arg3)
+{
+  if (XEUNICODE_P)
+    return SetWindowLongW (arg1, arg2, arg3);
+  else
+    return SetWindowLongA (arg1, arg2, arg3);
+}
+
+/* Error if SetWindowLongPtr used: Function needs review to determine how to handle it */
 
 /* Error if SetWindowsHook used: obsolete; two versions, STRICT and non-STRICT */
 
 HHOOK
-qxeSetWindowsHookEx (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId)
-{
-  if (XEUNICODE_P)
-    return SetWindowsHookExW (idHook, lpfn, hmod, dwThreadId);
-  else
-    return SetWindowsHookExA (idHook, lpfn, hmod, dwThreadId);
-}
-
-HBITMAP
-qxeLoadBitmap (HINSTANCE hInstance, const Extbyte * lpBitmapName)
-{
-  if (XEUNICODE_P)
-    return LoadBitmapW (hInstance, (LPCWSTR) lpBitmapName);
-  else
-    return LoadBitmapA (hInstance, (LPCSTR) lpBitmapName);
-}
-
-HCURSOR
-qxeLoadCursor (HINSTANCE hInstance, const Extbyte * lpCursorName)
-{
-  if (XEUNICODE_P)
-    return LoadCursorW (hInstance, (LPCWSTR) lpCursorName);
-  else
-    return LoadCursorA (hInstance, (LPCSTR) lpCursorName);
-}
-
-HCURSOR
-qxeLoadCursorFromFile (const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return LoadCursorFromFileW ((LPCWSTR) lpFileName);
-  else
-    return LoadCursorFromFileA ((LPCSTR) lpFileName);
-}
-
-HICON
-qxeLoadIcon (HINSTANCE hInstance, const Extbyte * lpIconName)
-{
-  if (XEUNICODE_P)
-    return LoadIconW (hInstance, (LPCWSTR) lpIconName);
-  else
-    return LoadIconA (hInstance, (LPCSTR) lpIconName);
-}
-
-/* NOTE: NT 4.0+ only */
-HANDLE
-qxeLoadImage (HINSTANCE arg1, const Extbyte * arg2, UINT arg3, int arg4, int arg5, UINT arg6)
-{
-  if (XEUNICODE_P)
-    return LoadImageW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
-  else
-    return LoadImageA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6);
+qxeSetWindowsHookEx (int arg1, HOOKPROC arg2, HINSTANCE arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return SetWindowsHookExW (arg1, arg2, arg3, arg4);
+  else
+    return SetWindowsHookExA (arg1, arg2, arg3, arg4);
+}
+
+BOOL
+qxeSetWindowText (HWND arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return SetWindowTextW (arg1, (LPCWSTR) arg2);
+  else
+    return SetWindowTextA (arg1, (LPCSTR) arg2);
+}
+
+/* NOTE: probs w/ICONMETRICS, NONCLIENTMETRICS */
+BOOL
+qxeSystemParametersInfo (UINT arg1, UINT arg2, PVOID arg3, UINT arg4)
+{
+  if (XEUNICODE_P)
+    return SystemParametersInfoW (arg1, arg2, arg3, arg4);
+  else
+    return SystemParametersInfoA (arg1, arg2, arg3, arg4);
+}
+
+LONG
+qxeTabbedTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5, int arg6, LPINT arg7, int arg8)
+{
+  if (XEUNICODE_P)
+    return TabbedTextOutW (arg1, arg2, arg3, (LPCWSTR) arg4, arg5, arg6, arg7, arg8);
+  else
+    return TabbedTextOutA (arg1, arg2, arg3, (LPCSTR) arg4, arg5, arg6, arg7, arg8);
+}
+
+int
+qxeTranslateAccelerator (HWND arg1, HACCEL arg2, LPMSG arg3)
+{
+  if (XEUNICODE_P)
+    return TranslateAcceleratorW (arg1, arg2, arg3);
+  else
+    return TranslateAcceleratorA (arg1, arg2, arg3);
+}
+
+/* Skipping UnregisterClass because need to intercept for reasons related to RegisterClass */
+
+/* Error if VkKeyScanEx used: split CHAR; NT 4.0+ only */
+
+/* Skipping VkKeyScan because split CHAR */
+
+BOOL
+qxeWinHelp (HWND arg1, const Extbyte * arg2, UINT arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return WinHelpW (arg1, (LPCWSTR) arg2, arg3, arg4);
+  else
+    return WinHelpA (arg1, (LPCSTR) arg2, arg3, arg4);
 }
 
 int
-qxeLoadString (HINSTANCE hInstance, UINT uID, Extbyte * lpBuffer, int nBufferMax)
-{
-  if (XEUNICODE_P)
-    return LoadStringW (hInstance, uID, (LPWSTR) lpBuffer, nBufferMax);
-  else
-    return LoadStringA (hInstance, uID, (LPSTR) lpBuffer, nBufferMax);
-}
-
+qxewvsprintf (Extbyte * arg1, const Extbyte * arg2, va_list arglist)
+{
+  if (XEUNICODE_P)
+    return wvsprintfW ((LPWSTR) arg1, (LPCWSTR) arg2, arglist);
+  else
+    return wvsprintfA ((LPSTR) arg1, (LPCSTR) arg2, arglist);
+}
+
+
+/*----------------------------------------------------------------------*/
+/*                       Processing file DDEML.H                        */
+/*----------------------------------------------------------------------*/
+
+/* NOTE: former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10) */
+HSZ
+qxeDdeCreateStringHandle (DWORD arg1, const Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return DdeCreateStringHandleW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return DdeCreateStringHandleA (arg1, (LPCSTR) arg2, arg3);
+}
+
+UINT
+qxeDdeInitialize (PDWORD arg1, PFNCALLBACK arg2, DWORD arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return DdeInitializeW (arg1, arg2, arg3, arg4);
+  else
+    return DdeInitializeA (arg1, arg2, arg3, arg4);
+}
+
+DWORD
+qxeDdeQueryString (DWORD arg1, HSZ arg2, Extbyte * arg3, DWORD arg4, int arg5)
+{
+  if (XEUNICODE_P)
+    return DdeQueryStringW (arg1, arg2, (LPWSTR) arg3, arg4, arg5);
+  else
+    return DdeQueryStringA (arg1, arg2, (LPSTR) arg3, arg4, arg5);
+}
+
+
+/*----------------------------------------------------------------------*/
+/*                       Processing file WINREG.H                       */
+/*----------------------------------------------------------------------*/
+
+/* NOTE: error arg 1, Cygwin prototype, extra const.
+   NOTE: Prototype manually overridden.
+         Header file claims:
+           WINADVAPI BOOL WINAPI AbortSystemShutdown(LPCWSTR)
+         Overridden with:
+           BOOL AbortSystemShutdown(LPWSTR)
+         Differences in return-type qualifiers, e.g. WINAPI, are not important.
+ */
 BOOL
-qxeIsDialogMessage (HWND hDlg, LPMSG lpMsg)
-{
-  if (XEUNICODE_P)
-    return IsDialogMessageW (hDlg, lpMsg);
-  else
-    return IsDialogMessageA (hDlg, lpMsg);
-}
-
-int
-qxeDlgDirList (HWND hDlg, Extbyte * lpPathSpec, int nIDListBox, int nIDStaticPath, UINT uFileType)
-{
-  if (XEUNICODE_P)
-    return DlgDirListW (hDlg, (LPWSTR) lpPathSpec, nIDListBox, nIDStaticPath, uFileType);
-  else
-    return DlgDirListA (hDlg, (LPSTR) lpPathSpec, nIDListBox, nIDStaticPath, uFileType);
+qxeAbortSystemShutdown (Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return AbortSystemShutdownW ((LPWSTR) arg1);
+  else
+    return AbortSystemShutdownA ((LPSTR) arg1);
 }
 
 BOOL
-qxeDlgDirSelectEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDListBox)
-{
-  if (XEUNICODE_P)
-    return DlgDirSelectExW (hDlg, (LPWSTR) lpString, nCount, nIDListBox);
-  else
-    return DlgDirSelectExA (hDlg, (LPSTR) lpString, nCount, nIDListBox);
-}
+qxeInitiateSystemShutdown (Extbyte * arg1, Extbyte * arg2, DWORD arg3, BOOL arg4, BOOL arg5)
+{
+  if (XEUNICODE_P)
+    return InitiateSystemShutdownW ((LPWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5);
+  else
+    return InitiateSystemShutdownA ((LPSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5);
+}
+
+/* NOTE: former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10) */
+LONG
+qxeRegConnectRegistry (const Extbyte * arg1, HKEY arg2, PHKEY arg3)
+{
+  if (XEUNICODE_P)
+    return RegConnectRegistryW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return RegConnectRegistryA ((LPCSTR) arg1, arg2, arg3);
+}
+
+LONG
+qxeRegCreateKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5, REGSAM arg6, LPSECURITY_ATTRIBUTES arg7, PHKEY arg8, PDWORD arg9)
+{
+  if (XEUNICODE_P)
+    return RegCreateKeyExW (arg1, (LPCWSTR) arg2, arg3, (LPWSTR) arg4, arg5, arg6, arg7, arg8, arg9);
+  else
+    return RegCreateKeyExA (arg1, (LPCSTR) arg2, arg3, (LPSTR) arg4, arg5, arg6, arg7, arg8, arg9);
+}
+
+LONG
+qxeRegCreateKey (HKEY arg1, const Extbyte * arg2, PHKEY arg3)
+{
+  if (XEUNICODE_P)
+    return RegCreateKeyW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return RegCreateKeyA (arg1, (LPCSTR) arg2, arg3);
+}
+
+LONG
+qxeRegDeleteKey (HKEY arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return RegDeleteKeyW (arg1, (LPCWSTR) arg2);
+  else
+    return RegDeleteKeyA (arg1, (LPCSTR) arg2);
+}
+
+/* Error if RegDeleteKeyEx used: Function needs review to determine how to handle it */
+
+LONG
+qxeRegDeleteValue (HKEY arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return RegDeleteValueW (arg1, (LPCWSTR) arg2);
+  else
+    return RegDeleteValueA (arg1, (LPCSTR) arg2);
+}
+
+LONG
+qxeRegEnumKey (HKEY arg1, DWORD arg2, Extbyte * arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return RegEnumKeyW (arg1, arg2, (LPWSTR) arg3, arg4);
+  else
+    return RegEnumKeyA (arg1, arg2, (LPSTR) arg3, arg4);
+}
+
+LONG
+qxeRegEnumKeyEx (HKEY arg1, DWORD arg2, Extbyte * arg3, PDWORD arg4, PDWORD arg5, Extbyte * arg6, PDWORD arg7, PFILETIME arg8)
+{
+  if (XEUNICODE_P)
+    return RegEnumKeyExW (arg1, arg2, (LPWSTR) arg3, arg4, arg5, (LPWSTR) arg6, arg7, arg8);
+  else
+    return RegEnumKeyExA (arg1, arg2, (LPSTR) arg3, arg4, arg5, (LPSTR) arg6, arg7, arg8);
+}
+
+LONG
+qxeRegEnumValue (HKEY arg1, DWORD arg2, Extbyte * arg3, PDWORD arg4, PDWORD arg5, PDWORD arg6, LPBYTE arg7, PDWORD arg8)
+{
+  if (XEUNICODE_P)
+    return RegEnumValueW (arg1, arg2, (LPWSTR) arg3, arg4, arg5, arg6, arg7, arg8);
+  else
+    return RegEnumValueA (arg1, arg2, (LPSTR) arg3, arg4, arg5, arg6, arg7, arg8);
+}
+
+LONG
+qxeRegLoadKey (HKEY arg1, const Extbyte * arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return RegLoadKeyW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3);
+  else
+    return RegLoadKeyA (arg1, (LPCSTR) arg2, (LPCSTR) arg3);
+}
+
+LONG
+qxeRegOpenKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, REGSAM arg4, PHKEY arg5)
+{
+  if (XEUNICODE_P)
+    return RegOpenKeyExW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return RegOpenKeyExA (arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+LONG
+qxeRegOpenKey (HKEY arg1, const Extbyte * arg2, PHKEY arg3)
+{
+  if (XEUNICODE_P)
+    return RegOpenKeyW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return RegOpenKeyA (arg1, (LPCSTR) arg2, arg3);
+}
+
+LONG
+qxeRegQueryInfoKey (HKEY arg1, Extbyte * arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5, PDWORD arg6, PDWORD arg7, PDWORD arg8, PDWORD arg9, PDWORD arg10, PDWORD arg11, PFILETIME arg12)
+{
+  if (XEUNICODE_P)
+    return RegQueryInfoKeyW (arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+  else
+    return RegQueryInfoKeyA (arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+}
+
+LONG
+qxeRegQueryMultipleValues (HKEY arg1, PVALENTW arg2, DWORD arg3, Extbyte * arg4, LPDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return RegQueryMultipleValuesW (arg1, arg2, arg3, (LPWSTR) arg4, arg5);
+  else
+    return RegQueryMultipleValuesA (arg1, (PVALENTA) arg2, arg3, (LPSTR) arg4, arg5);
+}
+
+LONG
+qxeRegQueryValueEx (HKEY arg1, const Extbyte * arg2, LPDWORD arg3, LPDWORD arg4, LPBYTE arg5, LPDWORD arg6)
+{
+  if (XEUNICODE_P)
+    return RegQueryValueExW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
+  else
+    return RegQueryValueExA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6);
+}
+
+LONG
+qxeRegQueryValue (HKEY arg1, const Extbyte * arg2, Extbyte * arg3, PLONG arg4)
+{
+  if (XEUNICODE_P)
+    return RegQueryValueW (arg1, (LPCWSTR) arg2, (LPWSTR) arg3, arg4);
+  else
+    return RegQueryValueA (arg1, (LPCSTR) arg2, (LPSTR) arg3, arg4);
+}
+
+LONG
+qxeRegReplaceKey (HKEY arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return RegReplaceKeyW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4);
+  else
+    return RegReplaceKeyA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4);
+}
+
+LONG
+qxeRegRestoreKey (HKEY arg1, const Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return RegRestoreKeyW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return RegRestoreKeyA (arg1, (LPCSTR) arg2, arg3);
+}
+
+LONG
+qxeRegSaveKey (HKEY arg1, const Extbyte * arg2, LPSECURITY_ATTRIBUTES arg3)
+{
+  if (XEUNICODE_P)
+    return RegSaveKeyW (arg1, (LPCWSTR) arg2, arg3);
+  else
+    return RegSaveKeyA (arg1, (LPCSTR) arg2, arg3);
+}
+
+LONG
+qxeRegSetValueEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, DWORD arg4, const BYTE* arg5, DWORD arg6)
+{
+  if (XEUNICODE_P)
+    return RegSetValueExW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
+  else
+    return RegSetValueExA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6);
+}
+
+LONG
+qxeRegSetValue (HKEY arg1, const Extbyte * arg2, DWORD arg3, const Extbyte * arg4, DWORD arg5)
+{
+  if (XEUNICODE_P)
+    return RegSetValueW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4, arg5);
+  else
+    return RegSetValueA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4, arg5);
+}
+
+LONG
+qxeRegUnLoadKey (HKEY arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return RegUnLoadKeyW (arg1, (LPCWSTR) arg2);
+  else
+    return RegUnLoadKeyA (arg1, (LPCSTR) arg2);
+}
+
+
+/*----------------------------------------------------------------------*/
+/*                       Processing file WINNLS.H                       */
+/*----------------------------------------------------------------------*/
+
+/* Error if CompareString used: not used, not examined yet */
+
+/* Error if EnumCalendarInfo used: not used, not examined yet */
+
+/* Error if EnumDateFormats used: not used, not examined yet */
+
+/* Error if EnumSystemCodePages used: not used, not examined yet */
+
+/* Error if EnumSystemLocales used: not used, not examined yet */
+
+/* Error if EnumTimeFormats used: not used, not examined yet */
+
+/* Error if FoldString used: not used, not examined yet */
+
+/* Error if GetCalendarInfo used: Function needs review to determine how to handle it */
+
+/* Error if GetCPInfoEx used: not used, not examined yet */
+
+/* Error if GetCurrencyFormat used: not used, not examined yet */
+
+/* Error if GetDateFormat used: not used, not examined yet */
+
+/* Error if GetGeoInfo used: Function needs review to determine how to handle it */
 
 int
-qxeDlgDirListComboBox (HWND hDlg, Extbyte * lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT uFiletype)
-{
-  if (XEUNICODE_P)
-    return DlgDirListComboBoxW (hDlg, (LPWSTR) lpPathSpec, nIDComboBox, nIDStaticPath, uFiletype);
-  else
-    return DlgDirListComboBoxA (hDlg, (LPSTR) lpPathSpec, nIDComboBox, nIDStaticPath, uFiletype);
-}
+qxeGetLocaleInfo (LCID arg1, LCTYPE arg2, Extbyte * arg3, int arg4)
+{
+  if (XEUNICODE_P)
+    return GetLocaleInfoW (arg1, arg2, (LPWSTR) arg3, arg4);
+  else
+    return GetLocaleInfoA (arg1, arg2, (LPSTR) arg3, arg4);
+}
+
+/* Error if GetNumberFormat used: not used, not examined yet */
+
+/* Error if GetStringType used: no such fun; A and W versions have different nos. of args */
+
+/* Error if GetStringTypeEx used: not used, not examined yet */
+
+/* Error if GetTimeFormat used: not used, not examined yet */
+
+/* Error if LCMapString used: not used, not examined yet */
+
+/* Error if SetCalendarInfo used: Function needs review to determine how to handle it */
 
 BOOL
-qxeDlgDirSelectComboBoxEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDComboBox)
-{
-  if (XEUNICODE_P)
-    return DlgDirSelectComboBoxExW (hDlg, (LPWSTR) lpString, nCount, nIDComboBox);
-  else
-    return DlgDirSelectComboBoxExA (hDlg, (LPSTR) lpString, nCount, nIDComboBox);
-}
-
-LRESULT
-qxeDefFrameProc (HWND hWnd, HWND hWndMDIClient, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return DefFrameProcW (hWnd, hWndMDIClient, uMsg, wParam, lParam);
-  else
-    return DefFrameProcA (hWnd, hWndMDIClient, uMsg, wParam, lParam);
-}
-
-/* Error if DefMDIChildProc used: return value is conditionalized on _MAC, messes up parser */
-
-HWND
-qxeCreateMDIWindow (Extbyte * lpClassName, Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HINSTANCE hInstance, LPARAM lParam)
-{
-  if (XEUNICODE_P)
-    return CreateMDIWindowW ((LPWSTR) lpClassName, (LPWSTR) lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hInstance, lParam);
-  else
-    return CreateMDIWindowA ((LPSTR) lpClassName, (LPSTR) lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hInstance, lParam);
-}
-
-BOOL
-qxeWinHelp (HWND hWndMain, const Extbyte * lpszHelp, UINT uCommand, DWORD dwData)
-{
-  if (XEUNICODE_P)
-    return WinHelpW (hWndMain, (LPCWSTR) lpszHelp, uCommand, dwData);
-  else
-    return WinHelpA (hWndMain, (LPCSTR) lpszHelp, uCommand, dwData);
-}
-
-/* Error if ChangeDisplaySettings used: split-sized LPDEVMODE */
-
-/* Error if ChangeDisplaySettingsEx used: split-sized LPDEVMODE; NT 5.0/Win98+ only */
-
-/* Error if EnumDisplaySettings used: split-sized LPDEVMODE */
-
-/* Error if EnumDisplayDevices used: split-sized PDISPLAY_DEVICE; NT 5.0+ only, no Win98 */
-
-/* NOTE: probs w/ICONMETRICS, NONCLIENTMETRICS */
-BOOL
-qxeSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
-{
-  if (XEUNICODE_P)
-    return SystemParametersInfoW (uiAction, uiParam, pvParam, fWinIni);
-  else
-    return SystemParametersInfoA (uiAction, uiParam, pvParam, fWinIni);
-}
-
-/* Error if GetMonitorInfo used: NT 5.0/Win98+ only */
-
-/* Error if GetWindowModuleFileName used: NT 5.0+ only */
-
-/* Error if RealGetWindowClass used: NT 5.0+ only */
-
-/* Error if GetAltTabInfo used: NT 5.0+ only */
+qxeSetLocaleInfo (LCID arg1, LCTYPE arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return SetLocaleInfoW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return SetLocaleInfoA (arg1, arg2, (LPCSTR) arg3);
+}
+
+/* Error if EnumCalendarInfoEx used: not used, not examined yet */
+
+/* Error if EnumDateFormatsEx used: not used, not examined yet */
+
+/* Error if EnumSystemLanguageGroups used: Function needs review to determine how to handle it */
+
+/* Error if EnumLanguageGroupLocales used: Function needs review to determine how to handle it */
+
+/* Error if EnumUILanguages used: Function needs review to determine how to handle it */
 
 
 /*----------------------------------------------------------------------*/
-/*                        Processing file IME.H                         */
+/*                       Processing file WINGDI.H                       */
 /*----------------------------------------------------------------------*/
 
-/* Error if SendIMEMessageEx used: obsolete, no docs available */
+#if defined (HAVE_MS_WINDOWS)
+
+int
+qxeAddFontResource (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return AddFontResourceW ((LPCWSTR) arg1);
+  else
+    return AddFontResourceA ((LPCSTR) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if AddFontResourceEx used: NT 5.0+ only */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HENHMETAFILE
+qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return CopyEnhMetaFileW (arg1, (LPCWSTR) arg2);
+  else
+    return CopyEnhMetaFileA (arg1, (LPCSTR) arg2);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HMETAFILE
+qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return CopyMetaFileW (arg1, (LPCWSTR) arg2);
+  else
+    return CopyMetaFileA (arg1, (LPCSTR) arg2);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if CreateColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping CreateDC because split-sized DEVMODE */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HDC
+qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, LPCRECT arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return CreateEnhMetaFileW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4);
+  else
+    return CreateEnhMetaFileA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HFONT
+qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14)
+{
+  if (XEUNICODE_P)
+    return CreateFontW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCWSTR) arg14);
+  else
+    return CreateFontA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCSTR) arg14);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping CreateFontIndirect because split-sized LOGFONT */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping CreateIC because split-sized DEVMODE */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HDC
+qxeCreateMetaFile (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return CreateMetaFileW ((LPCWSTR) arg1);
+  else
+    return CreateMetaFileA ((LPCSTR) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return CreateScalableFontResourceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4);
+  else
+    return CreateScalableFontResourceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping DeviceCapabilities because split-sized DEVMODE */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumFontFamilies used: split-complex FONTENUMPROC */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if EnumFonts used: split-complex FONTENUMPROC */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* NOTE: NT 4.0+ only */
+int
+qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3)
+{
+  if (XEUNICODE_P)
+    return EnumICMProfilesW (arg1, arg2, arg3);
+  else
+    return EnumICMProfilesA (arg1, (ICMENUMPROCA) arg2, arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, LPCRECT arg5, const Extbyte * arg6, UINT arg7, const INT* arg8)
+{
+  if (XEUNICODE_P)
+    return ExtTextOutW (arg1, arg2, arg3, arg4, arg5, (LPCWSTR) arg6, arg7, arg8);
+  else
+    return ExtTextOutA (arg1, arg2, arg3, arg4, arg5, (LPCSTR) arg6, arg7, arg8);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4)
+{
+  if (XEUNICODE_P)
+    return GetCharABCWidthsW (arg1, arg2, arg3, arg4);
+  else
+    return GetCharABCWidthsA (arg1, arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4)
+{
+  if (XEUNICODE_P)
+    return GetCharABCWidthsFloatW (arg1, arg2, arg3, arg4);
+  else
+    return GetCharABCWidthsFloatA (arg1, arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* NOTE: NT 4.0+ only */
+DWORD
+qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6)
+{
+  if (XEUNICODE_P)
+    return GetCharacterPlacementW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
+  else
+    return GetCharacterPlacementA (arg1, (LPCSTR) arg2, arg3, arg4, (LPGCP_RESULTSA) arg5, arg6);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4)
+{
+  if (XEUNICODE_P)
+    return GetCharWidth32W (arg1, arg2, arg3, arg4);
+  else
+    return GetCharWidth32A (arg1, arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4)
+{
+  if (XEUNICODE_P)
+    return GetCharWidthW (arg1, arg2, arg3, arg4);
+  else
+    return GetCharWidthA (arg1, arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4)
+{
+  if (XEUNICODE_P)
+    return GetCharWidthFloatW (arg1, arg2, arg3, arg4);
+  else
+    return GetCharWidthFloatA (arg1, arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HENHMETAFILE
+qxeGetEnhMetaFile (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GetEnhMetaFileW ((LPCWSTR) arg1);
+  else
+    return GetEnhMetaFileA ((LPCSTR) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+UINT
+qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return GetEnhMetaFileDescriptionW (arg1, arg2, (LPWSTR) arg3);
+  else
+    return GetEnhMetaFileDescriptionA (arg1, arg2, (LPSTR) arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+DWORD
+qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, PVOID arg6, const MAT2* arg7)
+{
+  if (XEUNICODE_P)
+    return GetGlyphOutlineW (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+  else
+    return GetGlyphOutlineA (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* NOTE: NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10) */
+BOOL
+qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
+  else
+    return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+DWORD
+qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3)
+{
+  if (XEUNICODE_P)
+    return GetKerningPairsW (arg1, arg2, arg3);
+  else
+    return GetKerningPairsA (arg1, arg2, arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if GetLogColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HMETAFILE
+qxeGetMetaFile (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GetMetaFileW ((LPCWSTR) arg1);
+  else
+    return GetMetaFileA ((LPCSTR) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping GetObject because split-sized LOGFONT */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if GetOutlineTextMetrics used: split-sized LPOUTLINETEXTMETRIC */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7)
+{
+  if (XEUNICODE_P)
+    return GetTextExtentExPointW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7);
+  else
+    return GetTextExtentExPointA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4)
+{
+  if (XEUNICODE_P)
+    return GetTextExtentPointW (arg1, (LPCWSTR) arg2, arg3, arg4);
+  else
+    return GetTextExtentPointA (arg1, (LPCSTR) arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4)
+{
+  if (XEUNICODE_P)
+    return GetTextExtentPoint32W (arg1, (LPCWSTR) arg2, arg3, arg4);
+  else
+    return GetTextExtentPoint32A (arg1, (LPCSTR) arg2, arg3, arg4);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+int
+qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return GetTextFaceW (arg1, arg2, (LPWSTR) arg3);
+  else
+    return GetTextFaceA (arg1, arg2, (LPSTR) arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxePolyTextOut (HDC arg1, const POLYTEXTW* arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return PolyTextOutW (arg1, arg2, arg3);
+  else
+    return PolyTextOutA (arg1, (const POLYTEXTA*) arg2, arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeRemoveFontResource (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return RemoveFontResourceW ((LPCWSTR) arg1);
+  else
+    return RemoveFontResourceA ((LPCSTR) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if RemoveFontResourceEx used: NT 5.0+ only */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping ResetDC because split-sized DEVMODE */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* NOTE: NT 4.0+ only */
+BOOL
+qxeSetICMProfile (HDC arg1, Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return SetICMProfileW (arg1, (LPWSTR) arg2);
+  else
+    return SetICMProfileA (arg1, (LPSTR) arg2);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+int
+qxeStartDoc (HDC arg1, const DOCINFOW* arg2)
+{
+  if (XEUNICODE_P)
+    return StartDocW (arg1, arg2);
+  else
+    return StartDocA (arg1, (const DOCINFOA*) arg2);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5)
+{
+  if (XEUNICODE_P)
+    return TextOutW (arg1, arg2, arg3, (LPCWSTR) arg4, arg5);
+  else
+    return TextOutA (arg1, arg2, arg3, (LPCSTR) arg4, arg5);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if wglUseFontBitmaps used: causes link error */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if wglUseFontOutlines used: causes link error */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if GetGlyphIndices used: NT 5.0+ only */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+
+/*----------------------------------------------------------------------*/
+/*                       Processing file SHLOBJ.H                       */
+/*----------------------------------------------------------------------*/
+
+/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */
+
+/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */
+
+BOOL
+qxeSHGetPathFromIDList (LPCITEMIDLIST arg1, Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return SHGetPathFromIDListW (arg1, (LPWSTR) arg2);
+  else
+    return SHGetPathFromIDListA (arg1, (LPSTR) arg2);
+}
+
+/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */
+
+/* Error if SHGetFolderPath used: Function needs review to determine how to handle it */
+
+/* Error if SHGetIconOverlayIndex used: Function needs review to determine how to handle it */
+
+/* Error if SHCreateDirectoryEx used: Function needs review to determine how to handle it */
+
+/* Error if SHGetFolderPathAndSubDir used: Function needs review to determine how to handle it */
+
+
+/*----------------------------------------------------------------------*/
+/*                      Processing file COMMDLG.H                       */
+/*----------------------------------------------------------------------*/
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeChooseColor (LPCHOOSECOLORW arg1)
+{
+  if (XEUNICODE_P)
+    return ChooseColorW (arg1);
+  else
+    return ChooseColorA ((LPCHOOSECOLORA) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if ChooseFont used: split-sized LPLOGFONT in LPCHOOSEFONT */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HWND
+qxeFindText (LPFINDREPLACEW arg1)
+{
+  if (XEUNICODE_P)
+    return FindTextW (arg1);
+  else
+    return FindTextA ((LPFINDREPLACEA) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+short
+qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3)
+{
+  if (XEUNICODE_P)
+    return GetFileTitleW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetFileTitleA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetOpenFileName (LPOPENFILENAMEW arg1)
+{
+  if (XEUNICODE_P)
+    return GetOpenFileNameW (arg1);
+  else
+    return GetOpenFileNameA ((LPOPENFILENAMEA) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+BOOL
+qxeGetSaveFileName (LPOPENFILENAMEW arg1)
+{
+  if (XEUNICODE_P)
+    return GetSaveFileNameW (arg1);
+  else
+    return GetSaveFileNameA ((LPOPENFILENAMEA) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+HWND
+qxeReplaceText (LPFINDREPLACEW arg1)
+{
+  if (XEUNICODE_P)
+    return ReplaceTextW (arg1);
+  else
+    return ReplaceTextA ((LPFINDREPLACEA) arg1);
+}
+
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+
+/* Error if PrintDlgEx used: Function needs review to determine how to handle it */
+
+#endif /* defined (HAVE_MS_WINDOWS) */
 
 
 /*----------------------------------------------------------------------*/
@@ -1529,12 +2750,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 HKL
-qxeImmInstallIME (const Extbyte * lpszIMEFileName, const Extbyte * lpszLayoutText)
-{
-  if (XEUNICODE_P)
-    return ImmInstallIMEW ((LPCWSTR) lpszIMEFileName, (LPCWSTR) lpszLayoutText);
-  else
-    return ImmInstallIMEA ((LPCSTR) lpszIMEFileName, (LPCSTR) lpszLayoutText);
+qxeImmInstallIME (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return ImmInstallIMEW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return ImmInstallIMEA ((LPCSTR) arg1, (LPCSTR) arg2);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1542,12 +2763,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 UINT
-qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT uBufLen)
-{
-  if (XEUNICODE_P)
-    return ImmGetDescriptionW (arg1, (LPWSTR) arg2, uBufLen);
-  else
-    return ImmGetDescriptionA (arg1, (LPSTR) arg2, uBufLen);
+qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return ImmGetDescriptionW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return ImmGetDescriptionA (arg1, (LPSTR) arg2, arg3);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1555,12 +2776,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 UINT
-qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT uBufLen)
-{
-  if (XEUNICODE_P)
-    return ImmGetIMEFileNameW (arg1, (LPWSTR) arg2, uBufLen);
-  else
-    return ImmGetIMEFileNameA (arg1, (LPSTR) arg2, uBufLen);
+qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return ImmGetIMEFileNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return ImmGetIMEFileNameA (arg1, (LPSTR) arg2, arg3);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1568,7 +2789,7 @@
 #if defined (HAVE_MS_WINDOWS)
 
 LONG
-qxeImmGetCompositionString (HIMC arg1, DWORD arg2, LPVOID arg3, DWORD arg4)
+qxeImmGetCompositionString (HIMC arg1, DWORD arg2, PVOID arg3, DWORD arg4)
 {
   if (XEUNICODE_P)
     return ImmGetCompositionStringW (arg1, arg2, arg3, arg4);
@@ -1587,12 +2808,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 DWORD
-qxeImmGetCandidateListCount (HIMC arg1, LPDWORD lpdwListCount)
-{
-  if (XEUNICODE_P)
-    return ImmGetCandidateListCountW (arg1, lpdwListCount);
-  else
-    return ImmGetCandidateListCountA (arg1, lpdwListCount);
+qxeImmGetCandidateListCount (HIMC arg1, PDWORD arg2)
+{
+  if (XEUNICODE_P)
+    return ImmGetCandidateListCountW (arg1, arg2);
+  else
+    return ImmGetCandidateListCountA (arg1, arg2);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1600,12 +2821,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 DWORD
-qxeImmGetCandidateList (HIMC arg1, DWORD deIndex, LPCANDIDATELIST arg3, DWORD dwBufLen)
-{
-  if (XEUNICODE_P)
-    return ImmGetCandidateListW (arg1, deIndex, arg3, dwBufLen);
-  else
-    return ImmGetCandidateListA (arg1, deIndex, arg3, dwBufLen);
+qxeImmGetCandidateList (HIMC arg1, DWORD arg2, PCANDIDATELIST arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return ImmGetCandidateListW (arg1, arg2, arg3, arg4);
+  else
+    return ImmGetCandidateListA (arg1, arg2, arg3, arg4);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1613,12 +2834,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 DWORD
-qxeImmGetGuideLine (HIMC arg1, DWORD dwIndex, Extbyte * arg3, DWORD dwBufLen)
-{
-  if (XEUNICODE_P)
-    return ImmGetGuideLineW (arg1, dwIndex, (LPWSTR) arg3, dwBufLen);
-  else
-    return ImmGetGuideLineA (arg1, dwIndex, (LPSTR) arg3, dwBufLen);
+qxeImmGetGuideLine (HIMC arg1, DWORD arg2, Extbyte * arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return ImmGetGuideLineW (arg1, arg2, (LPWSTR) arg3, arg4);
+  else
+    return ImmGetGuideLineA (arg1, arg2, (LPSTR) arg3, arg4);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1639,7 +2860,7 @@
 
 /* NOTE: // split-simple REGISTERWORD */
 BOOL
-qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, LPVOID arg4)
+qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, PVOID arg4)
 {
   if (XEUNICODE_P)
     return ImmConfigureIMEW (arg1, arg2, arg3, arg4);
@@ -1653,7 +2874,7 @@
 
 /* NOTE: // strings of various sorts */
 LRESULT
-qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, LPVOID arg4)
+qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, PVOID arg4)
 {
   if (XEUNICODE_P)
     return ImmEscapeW (arg1, arg2, arg3, arg4);
@@ -1666,12 +2887,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 DWORD
-qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, LPCANDIDATELIST arg4, DWORD dwBufLen, UINT uFlag)
-{
-  if (XEUNICODE_P)
-    return ImmGetConversionListW (arg1, arg2, (LPCWSTR) arg3, arg4, dwBufLen, uFlag);
-  else
-    return ImmGetConversionListA (arg1, arg2, (LPCSTR) arg3, arg4, dwBufLen, uFlag);
+qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, PCANDIDATELIST arg4, DWORD arg5, UINT arg6)
+{
+  if (XEUNICODE_P)
+    return ImmGetConversionListW (arg1, arg2, (LPCWSTR) arg3, arg4, arg5, arg6);
+  else
+    return ImmGetConversionListA (arg1, arg2, (LPCSTR) arg3, arg4, arg5, arg6);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1692,12 +2913,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 BOOL
-qxeImmRegisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszRegister)
-{
-  if (XEUNICODE_P)
-    return ImmRegisterWordW (arg1, (LPCWSTR) lpszReading, arg3, (LPCWSTR) lpszRegister);
-  else
-    return ImmRegisterWordA (arg1, (LPCSTR) lpszReading, arg3, (LPCSTR) lpszRegister);
+qxeImmRegisterWord (HKL arg1, const Extbyte * arg2, DWORD arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return ImmRegisterWordW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4);
+  else
+    return ImmRegisterWordA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1705,12 +2926,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 BOOL
-qxeImmUnregisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszUnregister)
-{
-  if (XEUNICODE_P)
-    return ImmUnregisterWordW (arg1, (LPCWSTR) lpszReading, arg3, (LPCWSTR) lpszUnregister);
-  else
-    return ImmUnregisterWordA (arg1, (LPCSTR) lpszReading, arg3, (LPCSTR) lpszUnregister);
+qxeImmUnregisterWord (HKL arg1, const Extbyte * arg2, DWORD arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return ImmUnregisterWordW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4);
+  else
+    return ImmUnregisterWordA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1724,12 +2945,12 @@
 #if defined (HAVE_MS_WINDOWS)
 
 UINT
-qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * lpszReading, DWORD arg4, const Extbyte * lpszRegister, LPVOID arg6)
-{
-  if (XEUNICODE_P)
-    return ImmEnumRegisterWordW (arg1, arg2, (LPCWSTR) lpszReading, arg4, (LPCWSTR) lpszRegister, arg6);
-  else
-    return ImmEnumRegisterWordA (arg1, (REGISTERWORDENUMPROCA) arg2, (LPCSTR) lpszReading, arg4, (LPCSTR) lpszRegister, arg6);
+qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * arg3, DWORD arg4, const Extbyte * arg5, PVOID arg6)
+{
+  if (XEUNICODE_P)
+    return ImmEnumRegisterWordW (arg1, arg2, (LPCWSTR) arg3, arg4, (LPCWSTR) arg5, arg6);
+  else
+    return ImmEnumRegisterWordA (arg1, (REGISTERWORDENUMPROCA) arg2, (LPCSTR) arg3, arg4, (LPCSTR) arg5, arg6);
 }
 
 #endif /* defined (HAVE_MS_WINDOWS) */
@@ -1742,69 +2963,1311 @@
 
 
 /*----------------------------------------------------------------------*/
+/*                      Processing file WINBASE.H                       */
+/*----------------------------------------------------------------------*/
+
+BOOL
+qxeAccessCheckAndAuditAlarm (const Extbyte * arg1, LPVOID arg2, Extbyte * arg3, Extbyte * arg4, PSECURITY_DESCRIPTOR arg5, DWORD arg6, PGENERIC_MAPPING arg7, BOOL arg8, PDWORD arg9, PBOOL arg10, PBOOL arg11)
+{
+  if (XEUNICODE_P)
+    return AccessCheckAndAuditAlarmW ((LPCWSTR) arg1, arg2, (LPWSTR) arg3, (LPWSTR) arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
+  else
+    return AccessCheckAndAuditAlarmA ((LPCSTR) arg1, arg2, (LPSTR) arg3, (LPSTR) arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
+}
+
+ATOM
+qxeAddAtom (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return AddAtomW ((LPCWSTR) arg1);
+  else
+    return AddAtomA ((LPCSTR) arg1);
+}
+
+BOOL
+qxeBackupEventLog (HANDLE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return BackupEventLogW (arg1, (LPCWSTR) arg2);
+  else
+    return BackupEventLogA (arg1, (LPCSTR) arg2);
+}
+
+HANDLE
+qxeBeginUpdateResource (const Extbyte * arg1, BOOL arg2)
+{
+  if (XEUNICODE_P)
+    return BeginUpdateResourceW ((LPCWSTR) arg1, arg2);
+  else
+    return BeginUpdateResourceA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeBuildCommDCB (const Extbyte * arg1, LPDCB arg2)
+{
+  if (XEUNICODE_P)
+    return BuildCommDCBW ((LPCWSTR) arg1, arg2);
+  else
+    return BuildCommDCBA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeBuildCommDCBAndTimeouts (const Extbyte * arg1, LPDCB arg2, LPCOMMTIMEOUTS arg3)
+{
+  if (XEUNICODE_P)
+    return BuildCommDCBAndTimeoutsW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return BuildCommDCBAndTimeoutsA ((LPCSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxeCallNamedPipe (const Extbyte * arg1, PVOID arg2, DWORD arg3, PVOID arg4, DWORD arg5, PDWORD arg6, DWORD arg7)
+{
+  if (XEUNICODE_P)
+    return CallNamedPipeW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+  else
+    return CallNamedPipeA ((LPCSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+}
+
+/* Error if CheckNameLegalDOS8Dot3 used: Function needs review to determine how to handle it */
+
+BOOL
+qxeClearEventLog (HANDLE arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return ClearEventLogW (arg1, (LPCWSTR) arg2);
+  else
+    return ClearEventLogA (arg1, (LPCSTR) arg2);
+}
+
+BOOL
+qxeCommConfigDialog (const Extbyte * arg1, HWND arg2, LPCOMMCONFIG arg3)
+{
+  if (XEUNICODE_P)
+    return CommConfigDialogW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return CommConfigDialogA ((LPCSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxeCopyFile (const Extbyte * arg1, const Extbyte * arg2, BOOL arg3)
+{
+  if (XEUNICODE_P)
+    return CopyFileW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3);
+  else
+    return CopyFileA ((LPCSTR) arg1, (LPCSTR) arg2, arg3);
+}
+
+/* NOTE: NT 4.0+ only */
+BOOL
+qxeCopyFileEx (const Extbyte * arg1, const Extbyte * arg2, LPPROGRESS_ROUTINE arg3, LPVOID arg4, LPBOOL arg5, DWORD arg6)
+{
+  if (XEUNICODE_P)
+    return CopyFileExW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
+  else
+    return CopyFileExA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6);
+}
+
+/* Error if CreateActCtx used: Function needs review to determine how to handle it */
+
+BOOL
+qxeCreateDirectory (const Extbyte * arg1, LPSECURITY_ATTRIBUTES arg2)
+{
+  if (XEUNICODE_P)
+    return CreateDirectoryW ((LPCWSTR) arg1, arg2);
+  else
+    return CreateDirectoryA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeCreateDirectoryEx (const Extbyte * arg1, const Extbyte * arg2, LPSECURITY_ATTRIBUTES arg3)
+{
+  if (XEUNICODE_P)
+    return CreateDirectoryExW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3);
+  else
+    return CreateDirectoryExA ((LPCSTR) arg1, (LPCSTR) arg2, arg3);
+}
+
+HANDLE
+qxeCreateEvent (LPSECURITY_ATTRIBUTES arg1, BOOL arg2, BOOL arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return CreateEventW (arg1, arg2, arg3, (LPCWSTR) arg4);
+  else
+    return CreateEventA (arg1, arg2, arg3, (LPCSTR) arg4);
+}
+
+HANDLE
+qxeCreateFile (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4, DWORD arg5, DWORD arg6, HANDLE arg7)
+{
+  if (XEUNICODE_P)
+    return CreateFileW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+  else
+    return CreateFileA ((LPCSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+}
+
+HANDLE
+qxeCreateFileMapping (HANDLE arg1, LPSECURITY_ATTRIBUTES arg2, DWORD arg3, DWORD arg4, DWORD arg5, const Extbyte * arg6)
+{
+  if (XEUNICODE_P)
+    return CreateFileMappingW (arg1, arg2, arg3, arg4, arg5, (LPCWSTR) arg6);
+  else
+    return CreateFileMappingA (arg1, arg2, arg3, arg4, arg5, (LPCSTR) arg6);
+}
+
+/* Error if CreateHardLink used: NT 5.0+ only */
+
+/* Error if CreateJobObject used: NT 5.0+ only */
+
+HANDLE
+qxeCreateMailslot (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4)
+{
+  if (XEUNICODE_P)
+    return CreateMailslotW ((LPCWSTR) arg1, arg2, arg3, arg4);
+  else
+    return CreateMailslotA ((LPCSTR) arg1, arg2, arg3, arg4);
+}
+
+HANDLE
+qxeCreateMutex (LPSECURITY_ATTRIBUTES arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return CreateMutexW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return CreateMutexA (arg1, arg2, (LPCSTR) arg3);
+}
+
+HANDLE
+qxeCreateNamedPipe (const Extbyte * arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, LPSECURITY_ATTRIBUTES arg8)
+{
+  if (XEUNICODE_P)
+    return CreateNamedPipeW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+  else
+    return CreateNamedPipeA ((LPCSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+}
+
+BOOL
+qxeCreateProcess (const Extbyte * arg1, Extbyte * arg2, LPSECURITY_ATTRIBUTES arg3, LPSECURITY_ATTRIBUTES arg4, BOOL arg5, DWORD arg6, PVOID arg7, const Extbyte * arg8, LPSTARTUPINFOW arg9, LPPROCESS_INFORMATION arg10)
+{
+  if (XEUNICODE_P)
+    return CreateProcessW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6, arg7, (LPCWSTR) arg8, arg9, arg10);
+  else
+    return CreateProcessA ((LPCSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6, arg7, (LPCSTR) arg8, (LPSTARTUPINFOA) arg9, arg10);
+}
+
+BOOL
+qxeCreateProcessAsUser (HANDLE arg1, const Extbyte * arg2, Extbyte * arg3, LPSECURITY_ATTRIBUTES arg4, LPSECURITY_ATTRIBUTES arg5, BOOL arg6, DWORD arg7, PVOID arg8, const Extbyte * arg9, LPSTARTUPINFOW arg10, LPPROCESS_INFORMATION arg11)
+{
+  if (XEUNICODE_P)
+    return CreateProcessAsUserW (arg1, (LPCWSTR) arg2, (LPWSTR) arg3, arg4, arg5, arg6, arg7, arg8, (LPCWSTR) arg9, arg10, arg11);
+  else
+    return CreateProcessAsUserA (arg1, (LPCSTR) arg2, (LPSTR) arg3, arg4, arg5, arg6, arg7, arg8, (LPCSTR) arg9, (LPSTARTUPINFOA) arg10, arg11);
+}
+
+/* Error if CreateProcessWithLogon used: Function needs review to determine how to handle it */
+
+HANDLE
+qxeCreateSemaphore (LPSECURITY_ATTRIBUTES arg1, LONG arg2, LONG arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return CreateSemaphoreW (arg1, arg2, arg3, (LPCWSTR) arg4);
+  else
+    return CreateSemaphoreA (arg1, arg2, arg3, (LPCSTR) arg4);
+}
+
+HANDLE
+qxeCreateWaitableTimer (LPSECURITY_ATTRIBUTES arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return CreateWaitableTimerW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return CreateWaitableTimerA (arg1, arg2, (LPCSTR) arg3);
+}
+
+BOOL
+qxeDefineDosDevice (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return DefineDosDeviceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3);
+  else
+    return DefineDosDeviceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3);
+}
+
+BOOL
+qxeDeleteFile (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return DeleteFileW ((LPCWSTR) arg1);
+  else
+    return DeleteFileA ((LPCSTR) arg1);
+}
+
+/* Error if DeleteVolumeMountPoint used: Function needs review to determine how to handle it */
+
+/* Error if DnsHostnameToComputerName used: Function needs review to determine how to handle it */
+
+#if !defined (CYGWIN_HEADERS)
+
+/* Error if EncryptFile used: Win2K+ only */
+
+#endif /* !defined (CYGWIN_HEADERS) */
+
+BOOL
+qxeEndUpdateResource (HANDLE arg1, BOOL arg2)
+{
+  if (XEUNICODE_P)
+    return EndUpdateResourceW (arg1, arg2);
+  else
+    return EndUpdateResourceA (arg1, arg2);
+}
+
+/* Skipping EnumResourceLanguages because different prototypes in VC6 and VC7 */
+
+/* Skipping EnumResourceNames because different prototypes in VC6 and VC7 */
+
+/* Skipping EnumResourceTypes because different prototypes in VC6 and VC7 */
+
+DWORD
+qxeExpandEnvironmentStrings (const Extbyte * arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return ExpandEnvironmentStringsW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return ExpandEnvironmentStringsA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
+
+void
+qxeFatalAppExit (UINT arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    FatalAppExitW (arg1, (LPCWSTR) arg2);
+  else
+    FatalAppExitA (arg1, (LPCSTR) arg2);
+}
+
+/* Error if FileEncryptionStatus used: Function needs review to determine how to handle it */
+
+/* Error if FindActCtxSectionString used: Function needs review to determine how to handle it */
+
+ATOM
+qxeFindAtom (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return FindAtomW ((LPCWSTR) arg1);
+  else
+    return FindAtomA ((LPCSTR) arg1);
+}
+
+HANDLE
+qxeFindFirstChangeNotification (const Extbyte * arg1, BOOL arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return FindFirstChangeNotificationW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return FindFirstChangeNotificationA ((LPCSTR) arg1, arg2, arg3);
+}
+
+/* Skipping FindFirstFile because split-sized LPWIN32_FIND_DATA */
+
+/* Error if FindFirstFileEx used: split-sized LPWIN32_FIND_DATA; not used, NT 4.0+ only */
+
+/* Error if FindFirstVolume used: Function needs review to determine how to handle it */
+
+/* Error if FindFirstVolumeMountPoint used: Function needs review to determine how to handle it */
+
+/* Skipping FindNextFile because split-sized LPWIN32_FIND_DATA */
+
+/* Error if FindNextVolume used: Function needs review to determine how to handle it */
+
+/* Error if FindNextVolumeMountPoint used: Function needs review to determine how to handle it */
+
+HRSRC
+qxeFindResource (HINSTANCE arg1, const Extbyte * arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return FindResourceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3);
+  else
+    return FindResourceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3);
+}
+
+HRSRC
+qxeFindResourceEx (HINSTANCE arg1, const Extbyte * arg2, const Extbyte * arg3, WORD arg4)
+{
+  if (XEUNICODE_P)
+    return FindResourceExW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4);
+  else
+    return FindResourceExA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4);
+}
+
+/* Error if GetFirmwareEnvironmentVariable used: Function needs review to determine how to handle it */
+
+DWORD
+qxeFormatMessage (DWORD arg1, PCVOID arg2, DWORD arg3, DWORD arg4, Extbyte * arg5, DWORD arg6, va_list* arg7)
+{
+  if (XEUNICODE_P)
+    return FormatMessageW (arg1, arg2, arg3, arg4, (LPWSTR) arg5, arg6, arg7);
+  else
+    return FormatMessageA (arg1, arg2, arg3, arg4, (LPSTR) arg5, arg6, arg7);
+}
+
+BOOL
+qxeFreeEnvironmentStrings (Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return FreeEnvironmentStringsW ((LPWSTR) arg1);
+  else
+    return FreeEnvironmentStringsA ((LPSTR) arg1);
+}
+
+UINT
+qxeGetAtomName (ATOM arg1, Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return GetAtomNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetAtomNameA (arg1, (LPSTR) arg2, arg3);
+}
+
+BOOL
+qxeGetBinaryType (const Extbyte * arg1, PDWORD arg2)
+{
+  if (XEUNICODE_P)
+    return GetBinaryTypeW ((LPCWSTR) arg1, arg2);
+  else
+    return GetBinaryTypeA ((LPCSTR) arg1, arg2);
+}
+
+Extbyte *
+qxeGetCommandLine (void)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) GetCommandLineW ();
+  else
+    return (Extbyte *) GetCommandLineA ();
+}
+
+DWORD
+qxeGetCompressedFileSize (const Extbyte * arg1, PDWORD arg2)
+{
+  if (XEUNICODE_P)
+    return GetCompressedFileSizeW ((LPCWSTR) arg1, arg2);
+  else
+    return GetCompressedFileSizeA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeGetComputerName (Extbyte * arg1, PDWORD arg2)
+{
+  if (XEUNICODE_P)
+    return GetComputerNameW ((LPWSTR) arg1, arg2);
+  else
+    return GetComputerNameA ((LPSTR) arg1, arg2);
+}
+
+/* Error if GetComputerNameEx used: Function needs review to determine how to handle it */
+
+DWORD
+qxeGetCurrentDirectory (DWORD arg1, Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return GetCurrentDirectoryW (arg1, (LPWSTR) arg2);
+  else
+    return GetCurrentDirectoryA (arg1, (LPSTR) arg2);
+}
+
+/* Error if GetCurrentHwProfile used: split-sized LPHW_PROFILE_INFO; NT 4.0+ only */
+
+BOOL
+qxeGetDefaultCommConfig (const Extbyte * arg1, LPCOMMCONFIG arg2, PDWORD arg3)
+{
+  if (XEUNICODE_P)
+    return GetDefaultCommConfigW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return GetDefaultCommConfigA ((LPCSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxeGetDiskFreeSpace (const Extbyte * arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return GetDiskFreeSpaceW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5);
+  else
+    return GetDiskFreeSpaceA ((LPCSTR) arg1, arg2, arg3, arg4, arg5);
+}
+
+BOOL
+qxeGetDiskFreeSpaceEx (const Extbyte * arg1, PULARGE_INTEGER arg2, PULARGE_INTEGER arg3, PULARGE_INTEGER arg4)
+{
+  if (XEUNICODE_P)
+    return GetDiskFreeSpaceExW ((LPCWSTR) arg1, arg2, arg3, arg4);
+  else
+    return GetDiskFreeSpaceExA ((LPCSTR) arg1, arg2, arg3, arg4);
+}
+
+/* Error if GetDllDirectory used: Function needs review to determine how to handle it */
+
+UINT
+qxeGetDriveType (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GetDriveTypeW ((LPCWSTR) arg1);
+  else
+    return GetDriveTypeA ((LPCSTR) arg1);
+}
+
+DWORD
+qxeGetEnvironmentVariable (const Extbyte * arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return GetEnvironmentVariableW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetEnvironmentVariableA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
+
+DWORD
+qxeGetFileAttributes (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GetFileAttributesW ((LPCWSTR) arg1);
+  else
+    return GetFileAttributesA ((LPCSTR) arg1);
+}
+
+BOOL
+qxeGetFileAttributesEx (const Extbyte * arg1, GET_FILEEX_INFO_LEVELS arg2, PVOID arg3)
+{
+  if (XEUNICODE_P)
+    return GetFileAttributesExW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return GetFileAttributesExA ((LPCSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxeGetFileSecurity (const Extbyte * arg1, SECURITY_INFORMATION arg2, PSECURITY_DESCRIPTOR arg3, DWORD arg4, PDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return GetFileSecurityW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5);
+  else
+    return GetFileSecurityA ((LPCSTR) arg1, arg2, arg3, arg4, arg5);
+}
+
+DWORD
+qxeGetFullPathName (const Extbyte * arg1, DWORD arg2, Extbyte * arg3, Extbyte ** arg4)
+{
+  if (XEUNICODE_P)
+    return GetFullPathNameW ((LPCWSTR) arg1, arg2, (LPWSTR) arg3, (LPWSTR*) arg4);
+  else
+    return GetFullPathNameA ((LPCSTR) arg1, arg2, (LPSTR) arg3, (LPSTR*) arg4);
+}
+
+DWORD
+qxeGetLogicalDriveStrings (DWORD arg1, Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return GetLogicalDriveStringsW (arg1, (LPWSTR) arg2);
+  else
+    return GetLogicalDriveStringsA (arg1, (LPSTR) arg2);
+}
+
+/* Error if GetLongPathName used: Win98/2K+ only */
+
+DWORD
+qxeGetModuleFileName (HINSTANCE arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return GetModuleFileNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetModuleFileNameA (arg1, (LPSTR) arg2, arg3);
+}
+
+HMODULE
+qxeGetModuleHandle (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GetModuleHandleW ((LPCWSTR) arg1);
+  else
+    return GetModuleHandleA ((LPCSTR) arg1);
+}
+
+/* Error if GetModuleHandleEx used: Function needs review to determine how to handle it */
+
+BOOL
+qxeGetNamedPipeHandleState (HANDLE arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5, Extbyte * arg6, DWORD arg7)
+{
+  if (XEUNICODE_P)
+    return GetNamedPipeHandleStateW (arg1, arg2, arg3, arg4, arg5, (LPWSTR) arg6, arg7);
+  else
+    return GetNamedPipeHandleStateA (arg1, arg2, arg3, arg4, arg5, (LPSTR) arg6, arg7);
+}
+
+UINT
+qxeGetPrivateProfileInt (const Extbyte * arg1, const Extbyte * arg2, INT arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return GetPrivateProfileIntW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4);
+  else
+    return GetPrivateProfileIntA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4);
+}
+
+DWORD
+qxeGetPrivateProfileSection (const Extbyte * arg1, Extbyte * arg2, DWORD arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return GetPrivateProfileSectionW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3, (LPCWSTR) arg4);
+  else
+    return GetPrivateProfileSectionA ((LPCSTR) arg1, (LPSTR) arg2, arg3, (LPCSTR) arg4);
+}
+
+DWORD
+qxeGetPrivateProfileSectionNames (Extbyte * arg1, DWORD arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return GetPrivateProfileSectionNamesW ((LPWSTR) arg1, arg2, (LPCWSTR) arg3);
+  else
+    return GetPrivateProfileSectionNamesA ((LPSTR) arg1, arg2, (LPCSTR) arg3);
+}
+
+DWORD
+qxeGetPrivateProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, Extbyte * arg4, DWORD arg5, const Extbyte * arg6)
+{
+  if (XEUNICODE_P)
+    return GetPrivateProfileStringW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPWSTR) arg4, arg5, (LPCWSTR) arg6);
+  else
+    return GetPrivateProfileStringA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPSTR) arg4, arg5, (LPCSTR) arg6);
+}
+
+BOOL
+qxeGetPrivateProfileStruct (const Extbyte * arg1, const Extbyte * arg2, LPVOID arg3, UINT arg4, const Extbyte * arg5)
+{
+  if (XEUNICODE_P)
+    return GetPrivateProfileStructW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, (LPCWSTR) arg5);
+  else
+    return GetPrivateProfileStructA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, (LPCSTR) arg5);
+}
+
+UINT
+qxeGetProfileInt (const Extbyte * arg1, const Extbyte * arg2, INT arg3)
+{
+  if (XEUNICODE_P)
+    return GetProfileIntW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3);
+  else
+    return GetProfileIntA ((LPCSTR) arg1, (LPCSTR) arg2, arg3);
+}
+
+DWORD
+qxeGetProfileSection (const Extbyte * arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return GetProfileSectionW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetProfileSectionA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
+
+DWORD
+qxeGetProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, Extbyte * arg4, DWORD arg5)
+{
+  if (XEUNICODE_P)
+    return GetProfileStringW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPWSTR) arg4, arg5);
+  else
+    return GetProfileStringA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPSTR) arg4, arg5);
+}
+
+DWORD
+qxeGetShortPathName (const Extbyte * arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return GetShortPathNameW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return GetShortPathNameA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
+
+VOID
+qxeGetStartupInfo (LPSTARTUPINFOW arg1)
+{
+  if (XEUNICODE_P)
+    GetStartupInfoW (arg1);
+  else
+    GetStartupInfoA ((LPSTARTUPINFOA) arg1);
+}
+
+UINT
+qxeGetSystemDirectory (Extbyte * arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return GetSystemDirectoryW ((LPWSTR) arg1, arg2);
+  else
+    return GetSystemDirectoryA ((LPSTR) arg1, arg2);
+}
+
+/* Error if GetSystemWindowsDirectory used: Function needs review to determine how to handle it */
+
+/* Error if GetSystemWow64Directory used: Function needs review to determine how to handle it */
+
+UINT
+qxeGetTempFileName (const Extbyte * arg1, const Extbyte * arg2, UINT arg3, Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return GetTempFileNameW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, (LPWSTR) arg4);
+  else
+    return GetTempFileNameA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, (LPSTR) arg4);
+}
+
+DWORD
+qxeGetTempPath (DWORD arg1, Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return GetTempPathW (arg1, (LPWSTR) arg2);
+  else
+    return GetTempPathA (arg1, (LPSTR) arg2);
+}
+
+BOOL
+qxeGetUserName (Extbyte * arg1, PDWORD arg2)
+{
+  if (XEUNICODE_P)
+    return GetUserNameW ((LPWSTR) arg1, arg2);
+  else
+    return GetUserNameA ((LPSTR) arg1, arg2);
+}
+
+/* Error if GetVersionEx used: split-sized LPOSVERSIONINFO */
+
+BOOL
+qxeGetVolumeInformation (const Extbyte * arg1, Extbyte * arg2, DWORD arg3, PDWORD arg4, PDWORD arg5, PDWORD arg6, Extbyte * arg7, DWORD arg8)
+{
+  if (XEUNICODE_P)
+    return GetVolumeInformationW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3, arg4, arg5, arg6, (LPWSTR) arg7, arg8);
+  else
+    return GetVolumeInformationA ((LPCSTR) arg1, (LPSTR) arg2, arg3, arg4, arg5, arg6, (LPSTR) arg7, arg8);
+}
+
+/* Error if GetVolumeNameForVolumeMountPoint used: Function needs review to determine how to handle it */
+
+/* Error if GetVolumePathName used: Function needs review to determine how to handle it */
+
+/* Error if GetVolumePathNamesForVolumeName used: Function needs review to determine how to handle it */
+
+UINT
+qxeGetWindowsDirectory (Extbyte * arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return GetWindowsDirectoryW ((LPWSTR) arg1, arg2);
+  else
+    return GetWindowsDirectoryA ((LPSTR) arg1, arg2);
+}
+
+ATOM
+qxeGlobalAddAtom (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GlobalAddAtomW ((LPCWSTR) arg1);
+  else
+    return GlobalAddAtomA ((LPCSTR) arg1);
+}
+
+ATOM
+qxeGlobalFindAtom (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return GlobalFindAtomW ((LPCWSTR) arg1);
+  else
+    return GlobalFindAtomA ((LPCSTR) arg1);
+}
+
+UINT
+qxeGlobalGetAtomName (ATOM arg1, Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return GlobalGetAtomNameW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return GlobalGetAtomNameA (arg1, (LPSTR) arg2, arg3);
+}
+
+BOOL
+qxeIsBadStringPtr (const Extbyte * arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return IsBadStringPtrW ((LPCWSTR) arg1, arg2);
+  else
+    return IsBadStringPtrA ((LPCSTR) arg1, arg2);
+}
+
+HINSTANCE
+qxeLoadLibraryEx (const Extbyte * arg1, HANDLE arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return LoadLibraryExW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return LoadLibraryExA ((LPCSTR) arg1, arg2, arg3);
+}
+
+HINSTANCE
+qxeLoadLibrary (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return LoadLibraryW ((LPCWSTR) arg1);
+  else
+    return LoadLibraryA ((LPCSTR) arg1);
+}
+
+BOOL
+qxeLogonUser (Extbyte * arg1, Extbyte * arg2, Extbyte * arg3, DWORD arg4, DWORD arg5, PHANDLE arg6)
+{
+  if (XEUNICODE_P)
+    return LogonUserW ((LPWSTR) arg1, (LPWSTR) arg2, (LPWSTR) arg3, arg4, arg5, arg6);
+  else
+    return LogonUserA ((LPSTR) arg1, (LPSTR) arg2, (LPSTR) arg3, arg4, arg5, arg6);
+}
+
+BOOL
+qxeLookupAccountName (const Extbyte * arg1, const Extbyte * arg2, PSID arg3, PDWORD arg4, Extbyte * arg5, PDWORD arg6, PSID_NAME_USE arg7)
+{
+  if (XEUNICODE_P)
+    return LookupAccountNameW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, (LPWSTR) arg5, arg6, arg7);
+  else
+    return LookupAccountNameA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, (LPSTR) arg5, arg6, arg7);
+}
+
+BOOL
+qxeLookupAccountSid (const Extbyte * arg1, PSID arg2, Extbyte * arg3, PDWORD arg4, Extbyte * arg5, PDWORD arg6, PSID_NAME_USE arg7)
+{
+  if (XEUNICODE_P)
+    return LookupAccountSidW ((LPCWSTR) arg1, arg2, (LPWSTR) arg3, arg4, (LPWSTR) arg5, arg6, arg7);
+  else
+    return LookupAccountSidA ((LPCSTR) arg1, arg2, (LPSTR) arg3, arg4, (LPSTR) arg5, arg6, arg7);
+}
+
+BOOL
+qxeLookupPrivilegeDisplayName (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3, PDWORD arg4, PDWORD arg5)
+{
+  if (XEUNICODE_P)
+    return LookupPrivilegeDisplayNameW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPWSTR) arg3, arg4, arg5);
+  else
+    return LookupPrivilegeDisplayNameA ((LPCSTR) arg1, (LPCSTR) arg2, (LPSTR) arg3, arg4, arg5);
+}
+
+BOOL
+qxeLookupPrivilegeName (const Extbyte * arg1, PLUID arg2, Extbyte * arg3, PDWORD arg4)
+{
+  if (XEUNICODE_P)
+    return LookupPrivilegeNameW ((LPCWSTR) arg1, arg2, (LPWSTR) arg3, arg4);
+  else
+    return LookupPrivilegeNameA ((LPCSTR) arg1, arg2, (LPSTR) arg3, arg4);
+}
+
+BOOL
+qxeLookupPrivilegeValue (const Extbyte * arg1, const Extbyte * arg2, PLUID arg3)
+{
+  if (XEUNICODE_P)
+    return LookupPrivilegeValueW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3);
+  else
+    return LookupPrivilegeValueA ((LPCSTR) arg1, (LPCSTR) arg2, arg3);
+}
+
+Extbyte *
+qxelstrcat (Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) lstrcatW ((LPWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return (Extbyte *) lstrcatA ((LPSTR) arg1, (LPCSTR) arg2);
+}
+
+int
+qxelstrcmpi (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return lstrcmpiW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return lstrcmpiA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+int
+qxelstrcmp (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return lstrcmpW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return lstrcmpA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+Extbyte *
+qxelstrcpyn (Extbyte * arg1, const Extbyte * arg2, int arg3)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) lstrcpynW ((LPWSTR) arg1, (LPCWSTR) arg2, arg3);
+  else
+    return (Extbyte *) lstrcpynA ((LPSTR) arg1, (LPCSTR) arg2, arg3);
+}
+
+Extbyte *
+qxelstrcpy (Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return (Extbyte *) lstrcpyW ((LPWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return (Extbyte *) lstrcpyA ((LPSTR) arg1, (LPCSTR) arg2);
+}
+
+int
+qxelstrlen (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return lstrlenW ((LPCWSTR) arg1);
+  else
+    return lstrlenA ((LPCSTR) arg1);
+}
+
+BOOL
+qxeMoveFileEx (const Extbyte * arg1, const Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return MoveFileExW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3);
+  else
+    return MoveFileExA ((LPCSTR) arg1, (LPCSTR) arg2, arg3);
+}
+
+BOOL
+qxeMoveFile (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return MoveFileW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return MoveFileA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+BOOL
+qxeObjectCloseAuditAlarm (const Extbyte * arg1, PVOID arg2, BOOL arg3)
+{
+  if (XEUNICODE_P)
+    return ObjectCloseAuditAlarmW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return ObjectCloseAuditAlarmA ((LPCSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxeObjectDeleteAuditAlarm (const Extbyte * arg1, PVOID arg2, BOOL arg3)
+{
+  if (XEUNICODE_P)
+    return ObjectDeleteAuditAlarmW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return ObjectDeleteAuditAlarmA ((LPCSTR) arg1, arg2, arg3);
+}
+
+BOOL
+qxeObjectOpenAuditAlarm (const Extbyte * arg1, PVOID arg2, Extbyte * arg3, Extbyte * arg4, PSECURITY_DESCRIPTOR arg5, HANDLE arg6, DWORD arg7, DWORD arg8, PPRIVILEGE_SET arg9, BOOL arg10, BOOL arg11, PBOOL arg12)
+{
+  if (XEUNICODE_P)
+    return ObjectOpenAuditAlarmW ((LPCWSTR) arg1, arg2, (LPWSTR) arg3, (LPWSTR) arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+  else
+    return ObjectOpenAuditAlarmA ((LPCSTR) arg1, arg2, (LPSTR) arg3, (LPSTR) arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+}
+
+BOOL
+qxeObjectPrivilegeAuditAlarm (const Extbyte * arg1, PVOID arg2, HANDLE arg3, DWORD arg4, PPRIVILEGE_SET arg5, BOOL arg6)
+{
+  if (XEUNICODE_P)
+    return ObjectPrivilegeAuditAlarmW ((LPCWSTR) arg1, arg2, arg3, arg4, arg5, arg6);
+  else
+    return ObjectPrivilegeAuditAlarmA ((LPCSTR) arg1, arg2, arg3, arg4, arg5, arg6);
+}
+
+HANDLE
+qxeOpenBackupEventLog (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return OpenBackupEventLogW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return OpenBackupEventLogA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+HANDLE
+qxeOpenEventLog (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return OpenEventLogW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return OpenEventLogA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+HANDLE
+qxeOpenEvent (DWORD arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return OpenEventW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return OpenEventA (arg1, arg2, (LPCSTR) arg3);
+}
+
+HANDLE
+qxeOpenFileMapping (DWORD arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return OpenFileMappingW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return OpenFileMappingA (arg1, arg2, (LPCSTR) arg3);
+}
+
+HANDLE
+qxeOpenMutex (DWORD arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return OpenMutexW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return OpenMutexA (arg1, arg2, (LPCSTR) arg3);
+}
+
+HANDLE
+qxeOpenSemaphore (DWORD arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return OpenSemaphoreW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return OpenSemaphoreA (arg1, arg2, (LPCSTR) arg3);
+}
+
+HANDLE
+qxeOpenWaitableTimer (DWORD arg1, BOOL arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return OpenWaitableTimerW (arg1, arg2, (LPCWSTR) arg3);
+  else
+    return OpenWaitableTimerA (arg1, arg2, (LPCSTR) arg3);
+}
+
+void
+qxeOutputDebugString (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    OutputDebugStringW ((LPCWSTR) arg1);
+  else
+    OutputDebugStringA ((LPCSTR) arg1);
+}
+
+BOOL
+qxePrivilegedServiceAuditAlarm (const Extbyte * arg1, const Extbyte * arg2, HANDLE arg3, PPRIVILEGE_SET arg4, BOOL arg5)
+{
+  if (XEUNICODE_P)
+    return PrivilegedServiceAuditAlarmW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, arg5);
+  else
+    return PrivilegedServiceAuditAlarmA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, arg5);
+}
+
+/* Error if QueryActCtx used: Function needs review to determine how to handle it */
+
+DWORD
+qxeQueryDosDevice (const Extbyte * arg1, Extbyte * arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return QueryDosDeviceW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
+  else
+    return QueryDosDeviceA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
+}
+
+/* Error if ReadDirectoryChanges used: Unicode-only */
+
+BOOL
+qxeReadEventLog (HANDLE arg1, DWORD arg2, DWORD arg3, PVOID arg4, DWORD arg5, DWORD * arg6, DWORD * arg7)
+{
+  if (XEUNICODE_P)
+    return ReadEventLogW (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+  else
+    return ReadEventLogA (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+}
+
+HANDLE
+qxeRegisterEventSource (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return RegisterEventSourceW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return RegisterEventSourceA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+BOOL
+qxeRemoveDirectory (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return RemoveDirectoryW ((LPCWSTR) arg1);
+  else
+    return RemoveDirectoryA ((LPCSTR) arg1);
+}
+
+/* Error if ReplaceFile used: Function needs review to determine how to handle it */
+
+BOOL
+qxeReportEvent (HANDLE arg1, WORD arg2, WORD arg3, DWORD arg4, PSID arg5, WORD arg6, DWORD arg7, const Extbyte ** arg8, PVOID arg9)
+{
+  if (XEUNICODE_P)
+    return ReportEventW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, (LPCWSTR*) arg8, arg9);
+  else
+    return ReportEventA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, (LPCSTR*) arg8, arg9);
+}
+
+DWORD
+qxeSearchPath (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4, Extbyte * arg5, Extbyte ** arg6)
+{
+  if (XEUNICODE_P)
+    return SearchPathW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4, (LPWSTR) arg5, (LPWSTR*) arg6);
+  else
+    return SearchPathA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, (LPSTR) arg5, (LPSTR*) arg6);
+}
+
+BOOL
+qxeSetComputerName (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return SetComputerNameW ((LPCWSTR) arg1);
+  else
+    return SetComputerNameA ((LPCSTR) arg1);
+}
+
+/* Error if SetComputerNameEx used: Function needs review to determine how to handle it */
+
+BOOL
+qxeSetCurrentDirectory (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return SetCurrentDirectoryW ((LPCWSTR) arg1);
+  else
+    return SetCurrentDirectoryA ((LPCSTR) arg1);
+}
+
+BOOL
+qxeSetDefaultCommConfig (const Extbyte * arg1, LPCOMMCONFIG arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return SetDefaultCommConfigW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return SetDefaultCommConfigA ((LPCSTR) arg1, arg2, arg3);
+}
+
+/* Error if SetDllDirectory used: Function needs review to determine how to handle it */
+
+BOOL
+qxeSetEnvironmentVariable (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return SetEnvironmentVariableW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return SetEnvironmentVariableA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+BOOL
+qxeSetFileAttributes (const Extbyte * arg1, DWORD arg2)
+{
+  if (XEUNICODE_P)
+    return SetFileAttributesW ((LPCWSTR) arg1, arg2);
+  else
+    return SetFileAttributesA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeSetFileSecurity (const Extbyte * arg1, SECURITY_INFORMATION arg2, PSECURITY_DESCRIPTOR arg3)
+{
+  if (XEUNICODE_P)
+    return SetFileSecurityW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return SetFileSecurityA ((LPCSTR) arg1, arg2, arg3);
+}
+
+/* Error if SetFileShortName used: Function needs review to determine how to handle it */
+
+/* Error if SetFirmwareEnvironmentVariable used: Function needs review to determine how to handle it */
+
+BOOL
+qxeSetVolumeLabel (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return SetVolumeLabelW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return SetVolumeLabelA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+/* Error if SetVolumeMountPoint used: Function needs review to determine how to handle it */
+
+BOOL
+qxeUpdateResource (HANDLE arg1, const Extbyte * arg2, const Extbyte * arg3, WORD arg4, PVOID arg5, DWORD arg6)
+{
+  if (XEUNICODE_P)
+    return UpdateResourceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, arg4, arg5, arg6);
+  else
+    return UpdateResourceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, arg4, arg5, arg6);
+}
+
+/* Error if VerifyVersionInfo used: Function needs review to determine how to handle it */
+
+BOOL
+qxeWaitNamedPipe (const Extbyte * arg1, DWORD arg2)
+{
+  if (XEUNICODE_P)
+    return WaitNamedPipeW ((LPCWSTR) arg1, arg2);
+  else
+    return WaitNamedPipeA ((LPCSTR) arg1, arg2);
+}
+
+BOOL
+qxeWritePrivateProfileSection (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return WritePrivateProfileSectionW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3);
+  else
+    return WritePrivateProfileSectionA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3);
+}
+
+BOOL
+qxeWritePrivateProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4)
+{
+  if (XEUNICODE_P)
+    return WritePrivateProfileStringW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4);
+  else
+    return WritePrivateProfileStringA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4);
+}
+
+BOOL
+qxeWritePrivateProfileStruct (const Extbyte * arg1, const Extbyte * arg2, LPVOID arg3, UINT arg4, const Extbyte * arg5)
+{
+  if (XEUNICODE_P)
+    return WritePrivateProfileStructW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4, (LPCWSTR) arg5);
+  else
+    return WritePrivateProfileStructA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4, (LPCSTR) arg5);
+}
+
+BOOL
+qxeWriteProfileSection (const Extbyte * arg1, const Extbyte * arg2)
+{
+  if (XEUNICODE_P)
+    return WriteProfileSectionW ((LPCWSTR) arg1, (LPCWSTR) arg2);
+  else
+    return WriteProfileSectionA ((LPCSTR) arg1, (LPCSTR) arg2);
+}
+
+BOOL
+qxeWriteProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3)
+{
+  if (XEUNICODE_P)
+    return WriteProfileStringW ((LPCWSTR) arg1, (LPCWSTR) arg2, (LPCWSTR) arg3);
+  else
+    return WriteProfileStringA ((LPCSTR) arg1, (LPCSTR) arg2, (LPCSTR) arg3);
+}
+
+
+/*----------------------------------------------------------------------*/
+/*                       Processing file ACLAPI.h                       */
+/*----------------------------------------------------------------------*/
+
+/* Error if BuildExplicitAccessWithName used: Function needs review to determine how to handle it */
+
+/* Error if BuildSecurityDescriptor used: Function needs review to determine how to handle it */
+
+/* Error if BuildTrusteeWithName used: Function needs review to determine how to handle it */
+
+/* Error if BuildTrusteeWithObjectsAndName used: Function needs review to determine how to handle it */
+
+/* Error if BuildTrusteeWithObjectsAndSid used: Function needs review to determine how to handle it */
+
+/* Error if BuildTrusteeWithSid used: Function needs review to determine how to handle it */
+
+/* Error if GetAuditedPermissionsFromAcl used: Function needs review to determine how to handle it */
+
+/* Error if GetEffectiveRightsFromAcl used: Function needs review to determine how to handle it */
+
+/* Error if GetExplicitEntriesFromAcl used: Function needs review to determine how to handle it */
+
+DWORD
+qxeGetNamedSecurityInfo (Extbyte * arg1, SE_OBJECT_TYPE arg2, SECURITY_INFORMATION arg3, PSID* arg4, PSID* arg5, PACL* arg6, PACL* arg7, PSECURITY_DESCRIPTOR* arg8)
+{
+  if (XEUNICODE_P)
+    return GetNamedSecurityInfoW ((LPWSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+  else
+    return GetNamedSecurityInfoA ((LPSTR) arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+}
+
+/* Error if GetTrusteeForm used: Function needs review to determine how to handle it */
+
+/* Error if GetTrusteeName used: Function needs review to determine how to handle it */
+
+/* Error if GetTrusteeType used: Function needs review to determine how to handle it */
+
+/* Error if LookupSecurityDescriptorParts used: Function needs review to determine how to handle it */
+
+/* Error if SetEntriesInAcl used: Function needs review to determine how to handle it */
+
+/* Error if SetNamedSecurityInfo used: Function needs review to determine how to handle it */
+
+/* Error if BuildImpersonateExplicitAccessWithName used: Function needs review to determine how to handle it */
+
+/* Error if BuildImpersonateTrustee used: Function needs review to determine how to handle it */
+
+/* Error if GetMultipleTrustee used: Function needs review to determine how to handle it */
+
+/* Error if GetMultipleTrusteeOperation used: Function needs review to determine how to handle it */
+
+
+/*----------------------------------------------------------------------*/
 /*                      Processing file MMSYSTEM.H                      */
 /*----------------------------------------------------------------------*/
 
 BOOL
-qxesndPlaySound (const Extbyte * pszSound, UINT fuSound)
-{
-  if (XEUNICODE_P)
-    return sndPlaySoundW ((LPCWSTR) pszSound, fuSound);
-  else
-    return sndPlaySoundA ((LPCSTR) pszSound, fuSound);
+qxesndPlaySound (const Extbyte * arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return sndPlaySoundW ((LPCWSTR) arg1, arg2);
+  else
+    return sndPlaySoundA ((LPCSTR) arg1, arg2);
 }
 
 BOOL
-qxePlaySound (const Extbyte * pszSound, HMODULE hmod, DWORD fdwSound)
-{
-  if (XEUNICODE_P)
-    return PlaySoundW ((LPCWSTR) pszSound, hmod, fdwSound);
-  else
-    return PlaySoundA ((LPCSTR) pszSound, hmod, fdwSound);
+qxePlaySound (const Extbyte * arg1, HMODULE arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return PlaySoundW ((LPCWSTR) arg1, arg2, arg3);
+  else
+    return PlaySoundA ((LPCSTR) arg1, arg2, arg3);
 }
 
 /* Error if waveOutGetDevCaps used: split-sized LPWAVEOUTCAPS */
 
 MMRESULT
-qxewaveOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText)
-{
-  if (XEUNICODE_P)
-    return waveOutGetErrorTextW (mmrError, (LPWSTR) pszText, cchText);
-  else
-    return waveOutGetErrorTextA (mmrError, (LPSTR) pszText, cchText);
+qxewaveOutGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return waveOutGetErrorTextW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return waveOutGetErrorTextA (arg1, (LPSTR) arg2, arg3);
 }
 
 /* Error if waveInGetDevCaps used: split-sized LPWAVEINCAPS */
 
 MMRESULT
-qxewaveInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText)
-{
-  if (XEUNICODE_P)
-    return waveInGetErrorTextW (mmrError, (LPWSTR) pszText, cchText);
-  else
-    return waveInGetErrorTextA (mmrError, (LPSTR) pszText, cchText);
+qxewaveInGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return waveInGetErrorTextW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return waveInGetErrorTextA (arg1, (LPSTR) arg2, arg3);
 }
 
 /* Error if midiOutGetDevCaps used: split-sized LPMIDIOUTCAPS */
 
 MMRESULT
-qxemidiOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText)
-{
-  if (XEUNICODE_P)
-    return midiOutGetErrorTextW (mmrError, (LPWSTR) pszText, cchText);
-  else
-    return midiOutGetErrorTextA (mmrError, (LPSTR) pszText, cchText);
+qxemidiOutGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return midiOutGetErrorTextW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return midiOutGetErrorTextA (arg1, (LPSTR) arg2, arg3);
 }
 
 /* Error if midiInGetDevCaps used: split-sized LPMIDIOUTCAPS */
 
 MMRESULT
-qxemidiInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText)
-{
-  if (XEUNICODE_P)
-    return midiInGetErrorTextW (mmrError, (LPWSTR) pszText, cchText);
-  else
-    return midiInGetErrorTextA (mmrError, (LPSTR) pszText, cchText);
+qxemidiInGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return midiInGetErrorTextW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return midiInGetErrorTextA (arg1, (LPSTR) arg2, arg3);
 }
 
 /* Error if auxGetDevCaps used: split-sized LPAUXCAPS */
@@ -1820,66 +4283,66 @@
 /* Error if joyGetDevCaps used: split-sized LPJOYCAPS */
 
 FOURCC
-qxemmioStringToFOURCC (const Extbyte * sz, UINT uFlags)
-{
-  if (XEUNICODE_P)
-    return mmioStringToFOURCCW ((LPCWSTR) sz, uFlags);
-  else
-    return mmioStringToFOURCCA ((LPCSTR) sz, uFlags);
+qxemmioStringToFOURCC (const Extbyte * arg1, UINT arg2)
+{
+  if (XEUNICODE_P)
+    return mmioStringToFOURCCW ((LPCWSTR) arg1, arg2);
+  else
+    return mmioStringToFOURCCA ((LPCSTR) arg1, arg2);
 }
 
 LPMMIOPROC
-qxemmioInstallIOProc (FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return mmioInstallIOProcW (fccIOProc, pIOProc, dwFlags);
-  else
-    return mmioInstallIOProcA (fccIOProc, pIOProc, dwFlags);
+qxemmioInstallIOProc (FOURCC arg1, LPMMIOPROC arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return mmioInstallIOProcW (arg1, arg2, arg3);
+  else
+    return mmioInstallIOProcA (arg1, arg2, arg3);
 }
 
 HMMIO
-qxemmioOpen (Extbyte * pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen)
-{
-  if (XEUNICODE_P)
-    return mmioOpenW ((LPWSTR) pszFileName, pmmioinfo, fdwOpen);
-  else
-    return mmioOpenA ((LPSTR) pszFileName, pmmioinfo, fdwOpen);
+qxemmioOpen (Extbyte * arg1, LPMMIOINFO arg2, DWORD arg3)
+{
+  if (XEUNICODE_P)
+    return mmioOpenW ((LPWSTR) arg1, arg2, arg3);
+  else
+    return mmioOpenA ((LPSTR) arg1, arg2, arg3);
 }
 
 MMRESULT
-qxemmioRename (const Extbyte * pszFileName, const Extbyte * pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename)
-{
-  if (XEUNICODE_P)
-    return mmioRenameW ((LPCWSTR) pszFileName, (LPCWSTR) pszNewFileName, pmmioinfo, fdwRename);
-  else
-    return mmioRenameA ((LPCSTR) pszFileName, (LPCSTR) pszNewFileName, pmmioinfo, fdwRename);
+qxemmioRename (const Extbyte * arg1, const Extbyte * arg2, LPCMMIOINFO arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return mmioRenameW ((LPCWSTR) arg1, (LPCWSTR) arg2, arg3, arg4);
+  else
+    return mmioRenameA ((LPCSTR) arg1, (LPCSTR) arg2, arg3, arg4);
 }
 
 MCIERROR
-qxemciSendCommand (MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2)
-{
-  if (XEUNICODE_P)
-    return mciSendCommandW (mciId, uMsg, dwParam1, dwParam2);
-  else
-    return mciSendCommandA (mciId, uMsg, dwParam1, dwParam2);
+qxemciSendCommand (MCIDEVICEID arg1, UINT arg2, DWORD arg3, DWORD arg4)
+{
+  if (XEUNICODE_P)
+    return mciSendCommandW (arg1, arg2, arg3, arg4);
+  else
+    return mciSendCommandA (arg1, arg2, arg3, arg4);
 }
 
 MCIERROR
-qxemciSendString (const Extbyte * lpstrCommand, Extbyte * lpstrReturnString, UINT uReturnLength, HWND hwndCallback)
-{
-  if (XEUNICODE_P)
-    return mciSendStringW ((LPCWSTR) lpstrCommand, (LPWSTR) lpstrReturnString, uReturnLength, hwndCallback);
-  else
-    return mciSendStringA ((LPCSTR) lpstrCommand, (LPSTR) lpstrReturnString, uReturnLength, hwndCallback);
+qxemciSendString (const Extbyte * arg1, Extbyte * arg2, UINT arg3, HWND arg4)
+{
+  if (XEUNICODE_P)
+    return mciSendStringW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3, arg4);
+  else
+    return mciSendStringA ((LPCSTR) arg1, (LPSTR) arg2, arg3, arg4);
 }
 
 MCIDEVICEID
-qxemciGetDeviceID (const Extbyte * pszDevice)
-{
-  if (XEUNICODE_P)
-    return mciGetDeviceIDW ((LPCWSTR) pszDevice);
-  else
-    return mciGetDeviceIDA ((LPCSTR) pszDevice);
+qxemciGetDeviceID (const Extbyte * arg1)
+{
+  if (XEUNICODE_P)
+    return mciGetDeviceIDW ((LPCWSTR) arg1);
+  else
+    return mciGetDeviceIDA ((LPCSTR) arg1);
 }
 
 #if !defined (MINGW)
@@ -1889,2228 +4352,11 @@
 #endif /* !defined (MINGW) */
 
 BOOL
-qxemciGetErrorString (MCIERROR mcierr, Extbyte * pszText, UINT cchText)
-{
-  if (XEUNICODE_P)
-    return mciGetErrorStringW (mcierr, (LPWSTR) pszText, cchText);
-  else
-    return mciGetErrorStringA (mcierr, (LPSTR) pszText, cchText);
-}
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file WINCON.H                       */
-/*----------------------------------------------------------------------*/
-
-BOOL
-qxePeekConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead)
-{
-  if (XEUNICODE_P)
-    return PeekConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead);
-  else
-    return PeekConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead);
-}
-
-BOOL
-qxeReadConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead)
-{
-  if (XEUNICODE_P)
-    return ReadConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead);
-  else
-    return ReadConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsRead);
-}
-
-BOOL
-qxeWriteConsoleInput (HANDLE hConsoleInput, CONST INPUT_RECORD * lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsWritten)
-{
-  if (XEUNICODE_P)
-    return WriteConsoleInputW (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsWritten);
-  else
-    return WriteConsoleInputA (hConsoleInput, lpBuffer, nLength, lpNumberOfEventsWritten);
-}
-
-BOOL
-qxeReadConsoleOutput (HANDLE hConsoleOutput, PCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpReadRegion)
-{
-  if (XEUNICODE_P)
-    return ReadConsoleOutputW (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpReadRegion);
-  else
-    return ReadConsoleOutputA (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpReadRegion);
-}
-
-BOOL
-qxeWriteConsoleOutput (HANDLE hConsoleOutput, CONST CHAR_INFO * lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpWriteRegion)
-{
-  if (XEUNICODE_P)
-    return WriteConsoleOutputW (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpWriteRegion);
-  else
-    return WriteConsoleOutputA (hConsoleOutput, lpBuffer, dwBufferSize, dwBufferCoord, lpWriteRegion);
-}
-
-BOOL
-qxeReadConsoleOutputCharacter (HANDLE hConsoleOutput, Extbyte * lpCharacter, DWORD nLength, COORD dwReadCoord, LPDWORD lpNumberOfCharsRead)
-{
-  if (XEUNICODE_P)
-    return ReadConsoleOutputCharacterW (hConsoleOutput, (LPWSTR) lpCharacter, nLength, dwReadCoord, lpNumberOfCharsRead);
-  else
-    return ReadConsoleOutputCharacterA (hConsoleOutput, (LPSTR) lpCharacter, nLength, dwReadCoord, lpNumberOfCharsRead);
-}
-
-BOOL
-qxeWriteConsoleOutputCharacter (HANDLE hConsoleOutput, const Extbyte * lpCharacter, DWORD nLength, COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten)
-{
-  if (XEUNICODE_P)
-    return WriteConsoleOutputCharacterW (hConsoleOutput, (LPCWSTR) lpCharacter, nLength, dwWriteCoord, lpNumberOfCharsWritten);
-  else
-    return WriteConsoleOutputCharacterA (hConsoleOutput, (LPCSTR) lpCharacter, nLength, dwWriteCoord, lpNumberOfCharsWritten);
-}
-
-/* Error if FillConsoleOutputCharacter used: split CHAR */
-
-BOOL
-qxeScrollConsoleScreenBuffer (HANDLE hConsoleOutput, CONST SMALL_RECT * lpScrollRectangle, CONST SMALL_RECT * lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO * lpFill)
-{
-  if (XEUNICODE_P)
-    return ScrollConsoleScreenBufferW (hConsoleOutput, lpScrollRectangle, lpClipRectangle, dwDestinationOrigin, lpFill);
-  else
-    return ScrollConsoleScreenBufferA (hConsoleOutput, lpScrollRectangle, lpClipRectangle, dwDestinationOrigin, lpFill);
-}
-
-DWORD
-qxeGetConsoleTitle (Extbyte * lpConsoleTitle, DWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetConsoleTitleW ((LPWSTR) lpConsoleTitle, nSize);
-  else
-    return GetConsoleTitleA ((LPSTR) lpConsoleTitle, nSize);
-}
-
-BOOL
-qxeSetConsoleTitle (const Extbyte * lpConsoleTitle)
-{
-  if (XEUNICODE_P)
-    return SetConsoleTitleW ((LPCWSTR) lpConsoleTitle);
-  else
-    return SetConsoleTitleA ((LPCSTR) lpConsoleTitle);
-}
-
-BOOL
-qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved)
-{
-  if (XEUNICODE_P)
-    return ReadConsoleW (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved);
-  else
-    return ReadConsoleA (hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved);
-}
-
-BOOL
-qxeWriteConsole (HANDLE hConsoleOutput, CONST VOID * lpBuffer, DWORD nNumberOfCharsToWrite, LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved)
-{
-  if (XEUNICODE_P)
-    return WriteConsoleW (hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved);
-  else
-    return WriteConsoleA (hConsoleOutput, lpBuffer, nNumberOfCharsToWrite, lpNumberOfCharsWritten, lpReserved);
-}
-
-
-/*----------------------------------------------------------------------*/
-/*                      Processing file WINNETWK.H                      */
-/*----------------------------------------------------------------------*/
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetAddConnection (const Extbyte * lpRemoteName, const Extbyte * lpPassword, const Extbyte * lpLocalName)
-{
-  if (XEUNICODE_P)
-    return WNetAddConnectionW ((LPCWSTR) lpRemoteName, (LPCWSTR) lpPassword, (LPCWSTR) lpLocalName);
-  else
-    return WNetAddConnectionA ((LPCSTR) lpRemoteName, (LPCSTR) lpPassword, (LPCSTR) lpLocalName);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetAddConnection2 (LPNETRESOURCEW lpNetResource, const Extbyte * lpPassword, const Extbyte * lpUserName, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return WNetAddConnection2W (lpNetResource, (LPCWSTR) lpPassword, (LPCWSTR) lpUserName, dwFlags);
-  else
-    return WNetAddConnection2A ((LPNETRESOURCEA) lpNetResource, (LPCSTR) lpPassword, (LPCSTR) lpUserName, dwFlags);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetAddConnection3 (HWND hwndOwner, LPNETRESOURCEW lpNetResource, const Extbyte * lpPassword, const Extbyte * lpUserName, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return WNetAddConnection3W (hwndOwner, lpNetResource, (LPCWSTR) lpPassword, (LPCWSTR) lpUserName, dwFlags);
-  else
-    return WNetAddConnection3A (hwndOwner, (LPNETRESOURCEA) lpNetResource, (LPCSTR) lpPassword, (LPCSTR) lpUserName, dwFlags);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetCancelConnection (const Extbyte * lpName, BOOL fForce)
-{
-  if (XEUNICODE_P)
-    return WNetCancelConnectionW ((LPCWSTR) lpName, fForce);
-  else
-    return WNetCancelConnectionA ((LPCSTR) lpName, fForce);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetCancelConnection2 (const Extbyte * lpName, DWORD dwFlags, BOOL fForce)
-{
-  if (XEUNICODE_P)
-    return WNetCancelConnection2W ((LPCWSTR) lpName, dwFlags, fForce);
-  else
-    return WNetCancelConnection2A ((LPCSTR) lpName, dwFlags, fForce);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetGetConnection (const Extbyte * lpLocalName, Extbyte * lpRemoteName, LPDWORD lpnLength)
-{
-  if (XEUNICODE_P)
-    return WNetGetConnectionW ((LPCWSTR) lpLocalName, (LPWSTR) lpRemoteName, lpnLength);
-  else
-    return WNetGetConnectionA ((LPCSTR) lpLocalName, (LPSTR) lpRemoteName, lpnLength);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetUseConnection (HWND hwndOwner, LPNETRESOURCEW lpNetResource, const Extbyte * lpUserID, const Extbyte * lpPassword, DWORD dwFlags, Extbyte * lpAccessName, LPDWORD lpBufferSize, LPDWORD lpResult)
-{
-  if (XEUNICODE_P)
-    return WNetUseConnectionW (hwndOwner, lpNetResource, (LPCWSTR) lpUserID, (LPCWSTR) lpPassword, dwFlags, (LPWSTR) lpAccessName, lpBufferSize, lpResult);
-  else
-    return WNetUseConnectionA (hwndOwner, (LPNETRESOURCEA) lpNetResource, (LPCSTR) lpUserID, (LPCSTR) lpPassword, dwFlags, (LPSTR) lpAccessName, lpBufferSize, lpResult);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-/* NOTE: contains split-simple LPNETRESOURCE */
-DWORD 
-qxeWNetConnectionDialog1 (LPCONNECTDLGSTRUCTW lpConnDlgStruct)
-{
-  if (XEUNICODE_P)
-    return WNetConnectionDialog1W (lpConnDlgStruct);
-  else
-    return WNetConnectionDialog1A ((LPCONNECTDLGSTRUCTA) lpConnDlgStruct);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetDisconnectDialog1 (LPDISCDLGSTRUCTW lpConnDlgStruct)
-{
-  if (XEUNICODE_P)
-    return WNetDisconnectDialog1W (lpConnDlgStruct);
-  else
-    return WNetDisconnectDialog1A ((LPDISCDLGSTRUCTA) lpConnDlgStruct);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetOpenEnum (DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum)
-{
-  if (XEUNICODE_P)
-    return WNetOpenEnumW (dwScope, dwType, dwUsage, lpNetResource, lphEnum);
-  else
-    return WNetOpenEnumA (dwScope, dwType, dwUsage, (LPNETRESOURCEA) lpNetResource, lphEnum);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetEnumResource (HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize)
-{
-  if (XEUNICODE_P)
-    return WNetEnumResourceW (hEnum, lpcCount, lpBuffer, lpBufferSize);
-  else
-    return WNetEnumResourceA (hEnum, lpcCount, lpBuffer, lpBufferSize);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetGetUniversalName (const Extbyte * lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize)
-{
-  if (XEUNICODE_P)
-    return WNetGetUniversalNameW ((LPCWSTR) lpLocalPath, dwInfoLevel, lpBuffer, lpBufferSize);
-  else
-    return WNetGetUniversalNameA ((LPCSTR) lpLocalPath, dwInfoLevel, lpBuffer, lpBufferSize);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetGetUser (const Extbyte * lpName, Extbyte * lpUserName, LPDWORD lpnLength)
-{
-  if (XEUNICODE_P)
-    return WNetGetUserW ((LPCWSTR) lpName, (LPWSTR) lpUserName, lpnLength);
-  else
-    return WNetGetUserA ((LPCSTR) lpName, (LPSTR) lpUserName, lpnLength);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetGetProviderName (DWORD dwNetType, Extbyte * lpProviderName, LPDWORD lpBufferSize)
-{
-  if (XEUNICODE_P)
-    return WNetGetProviderNameW (dwNetType, (LPWSTR) lpProviderName, lpBufferSize);
-  else
-    return WNetGetProviderNameA (dwNetType, (LPSTR) lpProviderName, lpBufferSize);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetGetNetworkInformation (const Extbyte * lpProvider, LPNETINFOSTRUCT lpNetInfoStruct)
-{
-  if (XEUNICODE_P)
-    return WNetGetNetworkInformationW ((LPCWSTR) lpProvider, lpNetInfoStruct);
-  else
-    return WNetGetNetworkInformationA ((LPCSTR) lpProvider, lpNetInfoStruct);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeWNetGetLastError (LPDWORD lpError, Extbyte * lpErrorBuf, DWORD nErrorBufSize, Extbyte * lpNameBuf, DWORD nNameBufSize)
-{
-  if (XEUNICODE_P)
-    return WNetGetLastErrorW (lpError, (LPWSTR) lpErrorBuf, nErrorBufSize, (LPWSTR) lpNameBuf, nNameBufSize);
-  else
-    return WNetGetLastErrorA (lpError, (LPSTR) lpErrorBuf, nErrorBufSize, (LPSTR) lpNameBuf, nNameBufSize);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-
-DWORD 
-qxeMultinetGetConnectionPerformance (LPNETRESOURCEW lpNetResource, LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct)
-{
-  if (XEUNICODE_P)
-    return MultinetGetConnectionPerformanceW (lpNetResource, lpNetConnectInfoStruct);
-  else
-    return MultinetGetConnectionPerformanceA ((LPNETRESOURCEA) lpNetResource, lpNetConnectInfoStruct);
-}
-
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file DDEML.H                        */
-/*----------------------------------------------------------------------*/
-
-UINT
-qxeDdeInitialize (LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes)
-{
-  if (XEUNICODE_P)
-    return DdeInitializeW (pidInst, pfnCallback, afCmd, ulRes);
-  else
-    return DdeInitializeA (pidInst, pfnCallback, afCmd, ulRes);
-}
-
-/* Skipping DdeCreateStringHandle because error in Cygwin prototype */
-
-DWORD
-qxeDdeQueryString (DWORD idInst, HSZ hsz, Extbyte * psz, DWORD cchMax, int iCodePage)
-{
-  if (XEUNICODE_P)
-    return DdeQueryStringW (idInst, hsz, (LPWSTR) psz, cchMax, iCodePage);
-  else
-    return DdeQueryStringA (idInst, hsz, (LPSTR) psz, cchMax, iCodePage);
-}
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file WINGDI.H                       */
-/*----------------------------------------------------------------------*/
-
-int
-qxeAddFontResource (const Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return AddFontResourceW ((LPCWSTR) arg1);
-  else
-    return AddFontResourceA ((LPCSTR) arg1);
-}
-
-HMETAFILE
-qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2)
-{
-  if (XEUNICODE_P)
-    return CopyMetaFileW (arg1, (LPCWSTR) arg2);
-  else
-    return CopyMetaFileA (arg1, (LPCSTR) arg2);
-}
-
-/* Skipping CreateDC because split-sized DEVMODE */
-
-/* Skipping CreateFontIndirect because split-sized LOGFONT */
-
-HFONT
-qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14)
-{
-  if (XEUNICODE_P)
-    return CreateFontW (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCWSTR) arg14);
-  else
-    return CreateFontA (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, (LPCSTR) arg14);
-}
-
-/* Skipping CreateIC because split-sized DEVMODE */
-
-HDC
-qxeCreateMetaFile (const Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return CreateMetaFileW ((LPCWSTR) arg1);
-  else
-    return CreateMetaFileA ((LPCSTR) arg1);
-}
-
-BOOL
-qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4)
-{
-  if (XEUNICODE_P)
-    return CreateScalableFontResourceW (arg1, (LPCWSTR) arg2, (LPCWSTR) arg3, (LPCWSTR) arg4);
-  else
-    return CreateScalableFontResourceA (arg1, (LPCSTR) arg2, (LPCSTR) arg3, (LPCSTR) arg4);
-}
-
-/* Skipping DeviceCapabilities because split-sized DEVMODE */
-
-/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */
-
-/* Error if EnumFontFamilies used: split-complex FONTENUMPROC */
-
-/* Error if EnumFonts used: split-complex FONTENUMPROC */
-
-BOOL
-qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4)
-{
-  if (XEUNICODE_P)
-    return GetCharWidthW (arg1, arg2, arg3, arg4);
-  else
-    return GetCharWidthA (arg1, arg2, arg3, arg4);
-}
-
-BOOL
-qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4)
-{
-  if (XEUNICODE_P)
-    return GetCharWidth32W (arg1, arg2, arg3, arg4);
-  else
-    return GetCharWidth32A (arg1, arg2, arg3, arg4);
-}
-
-BOOL  
-qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4)
-{
-  if (XEUNICODE_P)
-    return GetCharWidthFloatW (arg1, arg2, arg3, arg4);
-  else
-    return GetCharWidthFloatA (arg1, arg2, arg3, arg4);
-}
-
-BOOL  
-qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4)
-{
-  if (XEUNICODE_P)
-    return GetCharABCWidthsW (arg1, arg2, arg3, arg4);
-  else
-    return GetCharABCWidthsA (arg1, arg2, arg3, arg4);
-}
-
-BOOL  
-qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4)
-{
-  if (XEUNICODE_P)
-    return GetCharABCWidthsFloatW (arg1, arg2, arg3, arg4);
-  else
-    return GetCharABCWidthsFloatA (arg1, arg2, arg3, arg4);
-}
-
-DWORD
-qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, LPVOID arg6, CONST MAT2 * arg7)
-{
-  if (XEUNICODE_P)
-    return GetGlyphOutlineW (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
-  else
-    return GetGlyphOutlineA (arg1, arg2, arg3, arg4, arg5, arg6, arg7);
-}
-
-HMETAFILE
-qxeGetMetaFile (const Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return GetMetaFileW ((LPCWSTR) arg1);
-  else
-    return GetMetaFileA ((LPCSTR) arg1);
-}
-
-/* Error if GetOutlineTextMetrics used: split-sized LPOUTLINETEXTMETRIC */
-
-BOOL  
-qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4)
-{
-  if (XEUNICODE_P)
-    return GetTextExtentPointW (arg1, (LPCWSTR) arg2, arg3, arg4);
-  else
-    return GetTextExtentPointA (arg1, (LPCSTR) arg2, arg3, arg4);
-}
-
-BOOL  
-qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4)
-{
-  if (XEUNICODE_P)
-    return GetTextExtentPoint32W (arg1, (LPCWSTR) arg2, arg3, arg4);
-  else
-    return GetTextExtentPoint32A (arg1, (LPCSTR) arg2, arg3, arg4);
-}
-
-BOOL  
-qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7)
-{
-  if (XEUNICODE_P)
-    return GetTextExtentExPointW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6, arg7);
-  else
-    return GetTextExtentExPointA (arg1, (LPCSTR) arg2, arg3, arg4, arg5, arg6, arg7);
-}
-
-/* NOTE: NT 4.0+ only */
-DWORD
-qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6)
-{
-  if (XEUNICODE_P)
-    return GetCharacterPlacementW (arg1, (LPCWSTR) arg2, arg3, arg4, arg5, arg6);
-  else
-    return GetCharacterPlacementA (arg1, (LPCSTR) arg2, arg3, arg4, (LPGCP_RESULTSA) arg5, arg6);
-}
-
-/* Error if GetGlyphIndices used: NT 5.0+ only */
-
-/* Error if AddFontResourceEx used: NT 5.0+ only */
-
-/* Error if RemoveFontResourceEx used: NT 5.0+ only */
-
-/* Error if CreateFontIndirectEx used: split-sized ENUMLOGFONTEXDV; NT 5.0+ only */
-
-/* Skipping ResetDC because split-sized DEVMODE */
-
-BOOL
-qxeRemoveFontResource (const Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return RemoveFontResourceW ((LPCWSTR) arg1);
-  else
-    return RemoveFontResourceA ((LPCSTR) arg1);
-}
-
-HENHMETAFILE
-qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2)
-{
-  if (XEUNICODE_P)
-    return CopyEnhMetaFileW (arg1, (LPCWSTR) arg2);
-  else
-    return CopyEnhMetaFileA (arg1, (LPCSTR) arg2);
-}
-
-HDC
-qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, CONST RECT * arg3, const Extbyte * arg4)
-{
-  if (XEUNICODE_P)
-    return CreateEnhMetaFileW (arg1, (LPCWSTR) arg2, arg3, (LPCWSTR) arg4);
-  else
-    return CreateEnhMetaFileA (arg1, (LPCSTR) arg2, arg3, (LPCSTR) arg4);
-}
-
-HENHMETAFILE
-qxeGetEnhMetaFile (const Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return GetEnhMetaFileW ((LPCWSTR) arg1);
-  else
-    return GetEnhMetaFileA ((LPCSTR) arg1);
-}
-
-UINT
-qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3)
-{
-  if (XEUNICODE_P)
-    return GetEnhMetaFileDescriptionW (arg1, arg2, (LPWSTR) arg3);
-  else
-    return GetEnhMetaFileDescriptionA (arg1, arg2, (LPSTR) arg3);
-}
-
-/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */
-
-int
-qxeStartDoc (HDC arg1, CONST DOCINFOW * arg2)
-{
-  if (XEUNICODE_P)
-    return StartDocW (arg1, arg2);
-  else
-    return StartDocA (arg1, (CONST DOCINFOA *) arg2);
-}
-
-/* Skipping GetObject because split-sized LOGFONT */
-
-BOOL
-qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5)
-{
-  if (XEUNICODE_P)
-    return TextOutW (arg1, arg2, arg3, (LPCWSTR) arg4, arg5);
-  else
-    return TextOutA (arg1, arg2, arg3, (LPCSTR) arg4, arg5);
-}
-
-BOOL
-qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, CONST RECT * arg5, const Extbyte * arg6, UINT arg7, CONST INT * arg8)
-{
-  if (XEUNICODE_P)
-    return ExtTextOutW (arg1, arg2, arg3, arg4, arg5, (LPCWSTR) arg6, arg7, arg8);
-  else
-    return ExtTextOutA (arg1, arg2, arg3, arg4, arg5, (LPCSTR) arg6, arg7, arg8);
-}
-
-BOOL
-qxePolyTextOut (HDC arg1, CONST POLYTEXTW * arg2, int arg3)
-{
-  if (XEUNICODE_P)
-    return PolyTextOutW (arg1, arg2, arg3);
-  else
-    return PolyTextOutA (arg1, (CONST POLYTEXTA *) arg2, arg3);
-}
-
-int
-qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3)
-{
-  if (XEUNICODE_P)
-    return GetTextFaceW (arg1, arg2, (LPWSTR) arg3);
-  else
-    return GetTextFaceA (arg1, arg2, (LPSTR) arg3);
-}
-
-DWORD
-qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3)
-{
-  if (XEUNICODE_P)
-    return GetKerningPairsW (arg1, arg2, arg3);
-  else
-    return GetKerningPairsA (arg1, arg2, arg3);
-}
-
-/* Error if GetLogColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */
-
-/* Error if CreateColorSpace used: split-sized LPLOGCOLORSPACE; NT 4.0+ only */
-
-/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */
-
-/* NOTE: NT 4.0+ only */
-BOOL
-qxeSetICMProfile (HDC arg1, Extbyte * arg2)
-{
-  if (XEUNICODE_P)
-    return SetICMProfileW (arg1, (LPWSTR) arg2);
-  else
-    return SetICMProfileA (arg1, (LPSTR) arg2);
-}
-
-/* NOTE: NT 4.0+ only */
-int
-qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3)
-{
-  if (XEUNICODE_P)
-    return EnumICMProfilesW (arg1, arg2, arg3);
-  else
-    return EnumICMProfilesA (arg1, (ICMENUMPROCA) arg2, arg3);
-}
-
-/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */
-
-/* Error if wglUseFontBitmaps used: causes link error */
-
-/* Error if wglUseFontOutlines used: causes link error */
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file WINNLS.H                       */
-/*----------------------------------------------------------------------*/
-
-/* Error if GetCPInfoEx used: not used, not examined yet */
-
-/* Error if CompareString used: not used, not examined yet */
-
-/* Error if LCMapString used: not used, not examined yet */
-
-int
-qxeGetLocaleInfo (LCID Locale, LCTYPE LCType, Extbyte * lpLCData, int cchData)
-{
-  if (XEUNICODE_P)
-    return GetLocaleInfoW (Locale, LCType, (LPWSTR) lpLCData, cchData);
-  else
-    return GetLocaleInfoA (Locale, LCType, (LPSTR) lpLCData, cchData);
-}
-
-BOOL
-qxeSetLocaleInfo (LCID Locale, LCTYPE LCType, const Extbyte * lpLCData)
-{
-  if (XEUNICODE_P)
-    return SetLocaleInfoW (Locale, LCType, (LPCWSTR) lpLCData);
-  else
-    return SetLocaleInfoA (Locale, LCType, (LPCSTR) lpLCData);
-}
-
-/* Error if GetTimeFormat used: not used, not examined yet */
-
-/* Error if GetDateFormat used: not used, not examined yet */
-
-/* Error if GetNumberFormat used: not used, not examined yet */
-
-/* Error if GetCurrencyFormat used: not used, not examined yet */
-
-/* Error if EnumCalendarInfo used: not used, not examined yet */
-
-/* Error if EnumCalendarInfoEx used: not used, not examined yet */
-
-/* Error if EnumTimeFormats used: not used, not examined yet */
-
-/* Error if EnumDateFormats used: not used, not examined yet */
-
-/* Error if EnumDateFormatsEx used: not used, not examined yet */
-
-/* Error if GetStringTypeEx used: not used, not examined yet */
-
-/* Error if GetStringType used: no such fun; A and W versions have different nos. of args */
-
-/* Error if FoldString used: not used, not examined yet */
-
-/* Error if EnumSystemLocales used: not used, not examined yet */
-
-/* Error if EnumSystemCodePages used: not used, not examined yet */
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file WINREG.H                       */
-/*----------------------------------------------------------------------*/
-
-/* Skipping RegConnectRegistry because error in Cygwin prototype */
-
-LONG
-
-qxeRegCreateKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult)
-{
-  if (XEUNICODE_P)
-    return RegCreateKeyW (hKey, (LPCWSTR) lpSubKey, phkResult);
-  else
-    return RegCreateKeyA (hKey, (LPCSTR) lpSubKey, phkResult);
-}
-
-LONG
-
-qxeRegCreateKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD Reserved, Extbyte * lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition)
-{
-  if (XEUNICODE_P)
-    return RegCreateKeyExW (hKey, (LPCWSTR) lpSubKey, Reserved, (LPWSTR) lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
-  else
-    return RegCreateKeyExA (hKey, (LPCSTR) lpSubKey, Reserved, (LPSTR) lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
-}
-
-LONG
-
-qxeRegDeleteKey (HKEY hKey, const Extbyte * lpSubKey)
-{
-  if (XEUNICODE_P)
-    return RegDeleteKeyW (hKey, (LPCWSTR) lpSubKey);
-  else
-    return RegDeleteKeyA (hKey, (LPCSTR) lpSubKey);
-}
-
-LONG
-
-qxeRegDeleteValue (HKEY hKey, const Extbyte * lpValueName)
-{
-  if (XEUNICODE_P)
-    return RegDeleteValueW (hKey, (LPCWSTR) lpValueName);
-  else
-    return RegDeleteValueA (hKey, (LPCSTR) lpValueName);
-}
-
-LONG
-
-qxeRegEnumKey (HKEY hKey, DWORD dwIndex, Extbyte * lpName, DWORD cbName)
-{
-  if (XEUNICODE_P)
-    return RegEnumKeyW (hKey, dwIndex, (LPWSTR) lpName, cbName);
-  else
-    return RegEnumKeyA (hKey, dwIndex, (LPSTR) lpName, cbName);
-}
-
-LONG
-
-qxeRegEnumKeyEx (HKEY hKey, DWORD dwIndex, Extbyte * lpName, LPDWORD lpcbName, LPDWORD lpReserved, Extbyte * lpClass, LPDWORD lpcbClass, PFILETIME lpftLastWriteTime)
-{
-  if (XEUNICODE_P)
-    return RegEnumKeyExW (hKey, dwIndex, (LPWSTR) lpName, lpcbName, lpReserved, (LPWSTR) lpClass, lpcbClass, lpftLastWriteTime);
-  else
-    return RegEnumKeyExA (hKey, dwIndex, (LPSTR) lpName, lpcbName, lpReserved, (LPSTR) lpClass, lpcbClass, lpftLastWriteTime);
-}
-
-LONG
-
-qxeRegEnumValue (HKEY hKey, DWORD dwIndex, Extbyte * lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
-{
-  if (XEUNICODE_P)
-    return RegEnumValueW (hKey, dwIndex, (LPWSTR) lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData);
-  else
-    return RegEnumValueA (hKey, dwIndex, (LPSTR) lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData);
-}
-
-LONG
-
-qxeRegLoadKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpFile)
-{
-  if (XEUNICODE_P)
-    return RegLoadKeyW (hKey, (LPCWSTR) lpSubKey, (LPCWSTR) lpFile);
-  else
-    return RegLoadKeyA (hKey, (LPCSTR) lpSubKey, (LPCSTR) lpFile);
-}
-
-LONG
-
-qxeRegOpenKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult)
-{
-  if (XEUNICODE_P)
-    return RegOpenKeyW (hKey, (LPCWSTR) lpSubKey, phkResult);
-  else
-    return RegOpenKeyA (hKey, (LPCSTR) lpSubKey, phkResult);
-}
-
-LONG
-
-qxeRegOpenKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
-{
-  if (XEUNICODE_P)
-    return RegOpenKeyExW (hKey, (LPCWSTR) lpSubKey, ulOptions, samDesired, phkResult);
-  else
-    return RegOpenKeyExA (hKey, (LPCSTR) lpSubKey, ulOptions, samDesired, phkResult);
-}
-
-LONG
-
-qxeRegQueryInfoKey (HKEY hKey, Extbyte * lpClass, LPDWORD lpcbClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcbMaxSubKeyLen, LPDWORD lpcbMaxClassLen, LPDWORD lpcValues, LPDWORD lpcbMaxValueNameLen, LPDWORD lpcbMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
-{
-  if (XEUNICODE_P)
-    return RegQueryInfoKeyW (hKey, (LPWSTR) lpClass, lpcbClass, lpReserved, lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime);
-  else
-    return RegQueryInfoKeyA (hKey, (LPSTR) lpClass, lpcbClass, lpReserved, lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime);
-}
-
-LONG
-
-qxeRegQueryValue (HKEY hKey, const Extbyte * lpSubKey, Extbyte * lpValue, PLONG lpcbValue)
-{
-  if (XEUNICODE_P)
-    return RegQueryValueW (hKey, (LPCWSTR) lpSubKey, (LPWSTR) lpValue, lpcbValue);
-  else
-    return RegQueryValueA (hKey, (LPCSTR) lpSubKey, (LPSTR) lpValue, lpcbValue);
-}
-
-LONG
-
-qxeRegQueryMultipleValues (HKEY hKey, PVALENTW val_list, DWORD num_vals, Extbyte * lpValueBuf, LPDWORD ldwTotsize)
-{
-  if (XEUNICODE_P)
-    return RegQueryMultipleValuesW (hKey, val_list, num_vals, (LPWSTR) lpValueBuf, ldwTotsize);
-  else
-    return RegQueryMultipleValuesA (hKey, (PVALENTA) val_list, num_vals, (LPSTR) lpValueBuf, ldwTotsize);
-}
-
-LONG
-
-qxeRegQueryValueEx (HKEY hKey, const Extbyte * lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData)
-{
-  if (XEUNICODE_P)
-    return RegQueryValueExW (hKey, (LPCWSTR) lpValueName, lpReserved, lpType, lpData, lpcbData);
-  else
-    return RegQueryValueExA (hKey, (LPCSTR) lpValueName, lpReserved, lpType, lpData, lpcbData);
-}
-
-LONG
-
-qxeRegReplaceKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpNewFile, const Extbyte * lpOldFile)
-{
-  if (XEUNICODE_P)
-    return RegReplaceKeyW (hKey, (LPCWSTR) lpSubKey, (LPCWSTR) lpNewFile, (LPCWSTR) lpOldFile);
-  else
-    return RegReplaceKeyA (hKey, (LPCSTR) lpSubKey, (LPCSTR) lpNewFile, (LPCSTR) lpOldFile);
-}
-
-LONG
-
-qxeRegRestoreKey (HKEY hKey, const Extbyte * lpFile, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return RegRestoreKeyW (hKey, (LPCWSTR) lpFile, dwFlags);
-  else
-    return RegRestoreKeyA (hKey, (LPCSTR) lpFile, dwFlags);
-}
-
-LONG
-
-qxeRegSaveKey (HKEY hKey, const Extbyte * lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
-  if (XEUNICODE_P)
-    return RegSaveKeyW (hKey, (LPCWSTR) lpFile, lpSecurityAttributes);
-  else
-    return RegSaveKeyA (hKey, (LPCSTR) lpFile, lpSecurityAttributes);
-}
-
-LONG
-
-qxeRegSetValue (HKEY hKey, const Extbyte * lpSubKey, DWORD dwType, const Extbyte * lpData, DWORD cbData)
-{
-  if (XEUNICODE_P)
-    return RegSetValueW (hKey, (LPCWSTR) lpSubKey, dwType, (LPCWSTR) lpData, cbData);
-  else
-    return RegSetValueA (hKey, (LPCSTR) lpSubKey, dwType, (LPCSTR) lpData, cbData);
-}
-
-LONG
-
-qxeRegSetValueEx (HKEY hKey, const Extbyte * lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData)
-{
-  if (XEUNICODE_P)
-    return RegSetValueExW (hKey, (LPCWSTR) lpValueName, Reserved, dwType, lpData, cbData);
-  else
-    return RegSetValueExA (hKey, (LPCSTR) lpValueName, Reserved, dwType, lpData, cbData);
-}
-
-LONG
-
-qxeRegUnLoadKey (HKEY hKey, const Extbyte * lpSubKey)
-{
-  if (XEUNICODE_P)
-    return RegUnLoadKeyW (hKey, (LPCWSTR) lpSubKey);
-  else
-    return RegUnLoadKeyA (hKey, (LPCSTR) lpSubKey);
-}
-
-BOOL
-
-qxeInitiateSystemShutdown (Extbyte * lpMachineName, Extbyte * lpMessage, DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown)
-{
-  if (XEUNICODE_P)
-    return InitiateSystemShutdownW ((LPWSTR) lpMachineName, (LPWSTR) lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown);
-  else
-    return InitiateSystemShutdownA ((LPSTR) lpMachineName, (LPSTR) lpMessage, dwTimeout, bForceAppsClosed, bRebootAfterShutdown);
-}
-
-BOOL
-
-qxeAbortSystemShutdown (Extbyte * lpMachineName)
-{
-  if (XEUNICODE_P)
-    return AbortSystemShutdownW ((LPWSTR) lpMachineName);
-  else
-    return AbortSystemShutdownA ((LPSTR) lpMachineName);
-}
-
-
-/*----------------------------------------------------------------------*/
-/*                      Processing file COMMDLG.H                       */
-/*----------------------------------------------------------------------*/
-
-BOOL  
-qxeGetOpenFileName (LPOPENFILENAMEW arg1)
-{
-  if (XEUNICODE_P)
-    return GetOpenFileNameW (arg1);
-  else
-    return GetOpenFileNameA ((LPOPENFILENAMEA) arg1);
-}
-
-BOOL  
-qxeGetSaveFileName (LPOPENFILENAMEW arg1)
-{
-  if (XEUNICODE_P)
-    return GetSaveFileNameW (arg1);
-  else
-    return GetSaveFileNameA ((LPOPENFILENAMEA) arg1);
-}
-
-short 
-qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3)
-{
-  if (XEUNICODE_P)
-    return GetFileTitleW ((LPCWSTR) arg1, (LPWSTR) arg2, arg3);
-  else
-    return GetFileTitleA ((LPCSTR) arg1, (LPSTR) arg2, arg3);
-}
-
-BOOL  
-qxeChooseColor (LPCHOOSECOLORW arg1)
-{
-  if (XEUNICODE_P)
-    return ChooseColorW (arg1);
-  else
-    return ChooseColorA ((LPCHOOSECOLORA) arg1);
-}
-
-HWND  
-qxeFindText (LPFINDREPLACEW arg1)
-{
-  if (XEUNICODE_P)
-    return FindTextW (arg1);
-  else
-    return FindTextA ((LPFINDREPLACEA) arg1);
-}
-
-HWND  
-qxeReplaceText (LPFINDREPLACEW arg1)
-{
-  if (XEUNICODE_P)
-    return ReplaceTextW (arg1);
-  else
-    return ReplaceTextA ((LPFINDREPLACEA) arg1);
-}
-
-/* Error if AfxReplaceText used: mac only */
-
-/* Error if ChooseFont used: split-sized LPLOGFONT in LPCHOOSEFONT */
-
-/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */
-
-/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file SHLOBJ.H                       */
-/*----------------------------------------------------------------------*/
-
-BOOL
-qxeSHGetPathFromIDList (LPCITEMIDLIST pidl, Extbyte * pszPath)
-{
-  if (XEUNICODE_P)
-    return SHGetPathFromIDListW (pidl, (LPWSTR) pszPath);
-  else
-    return SHGetPathFromIDListA (pidl, (LPSTR) pszPath);
-}
-
-/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */
-
-/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */
-
-/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */
-
-
-/*----------------------------------------------------------------------*/
-/*                      Processing file WINBASE.H                       */
-/*----------------------------------------------------------------------*/
-
-BOOL
-qxeGetBinaryType (const Extbyte * lpApplicationName, LPDWORD lpBinaryType)
-{
-  if (XEUNICODE_P)
-    return GetBinaryTypeW ((LPCWSTR) lpApplicationName, lpBinaryType);
-  else
-    return GetBinaryTypeA ((LPCSTR) lpApplicationName, lpBinaryType);
-}
-
-DWORD
-qxeGetShortPathName (const Extbyte * lpszLongPath, Extbyte * lpszShortPath, DWORD cchBuffer)
-{
-  if (XEUNICODE_P)
-    return GetShortPathNameW ((LPCWSTR) lpszLongPath, (LPWSTR) lpszShortPath, cchBuffer);
-  else
-    return GetShortPathNameA ((LPCSTR) lpszLongPath, (LPSTR) lpszShortPath, cchBuffer);
-}
-
-/* Error if GetLongPathName used: Win98/2K+ only */
-
-/* Skipping GetEnvironmentStrings because misnamed ANSI version of the function */
-
-BOOL
-qxeFreeEnvironmentStrings (Extbyte * arg1)
-{
-  if (XEUNICODE_P)
-    return FreeEnvironmentStringsW ((LPWSTR) arg1);
-  else
-    return FreeEnvironmentStringsA ((LPSTR) arg1);
-}
-
-DWORD
-qxeFormatMessage (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, Extbyte * lpBuffer, DWORD nSize, va_list * Arguments)
-{
-  if (XEUNICODE_P)
-    return FormatMessageW (dwFlags, lpSource, dwMessageId, dwLanguageId, (LPWSTR) lpBuffer, nSize, Arguments);
-  else
-    return FormatMessageA (dwFlags, lpSource, dwMessageId, dwLanguageId, (LPSTR) lpBuffer, nSize, Arguments);
-}
-
-HANDLE
-qxeCreateMailslot (const Extbyte * lpName, DWORD nMaxMessageSize, DWORD lReadTimeout, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
-  if (XEUNICODE_P)
-    return CreateMailslotW ((LPCWSTR) lpName, nMaxMessageSize, lReadTimeout, lpSecurityAttributes);
-  else
-    return CreateMailslotA ((LPCSTR) lpName, nMaxMessageSize, lReadTimeout, lpSecurityAttributes);
-}
-
-#if !defined (CYGWIN_HEADERS)
-
-/* Error if EncryptFile used: Win2K+ only */
-
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#if !defined (CYGWIN_HEADERS)
-
-/* Error if DecryptFile used: Win2K+ only */
-
-#endif /* !defined (CYGWIN_HEADERS) */
-
-/* Error if OpenRaw used: error "The procedure entry point OpenRawW could not be located in the dynamic link library ADVAPI32.dll." */
-
-/* Error if QueryRecoveryAgents used: split-sized LPRECOVERY_AGENT_INFORMATION */
-
-int
-qxelstrcmp (const Extbyte * lpString1, const Extbyte * lpString2)
-{
-  if (XEUNICODE_P)
-    return lstrcmpW ((LPCWSTR) lpString1, (LPCWSTR) lpString2);
-  else
-    return lstrcmpA ((LPCSTR) lpString1, (LPCSTR) lpString2);
-}
-
-int
-qxelstrcmpi (const Extbyte * lpString1, const Extbyte * lpString2)
-{
-  if (XEUNICODE_P)
-    return lstrcmpiW ((LPCWSTR) lpString1, (LPCWSTR) lpString2);
-  else
-    return lstrcmpiA ((LPCSTR) lpString1, (LPCSTR) lpString2);
-}
-
-Extbyte *
-qxelstrcpyn (Extbyte * lpString1, const Extbyte * lpString2, int iMaxLength)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) lstrcpynW ((LPWSTR) lpString1, (LPCWSTR) lpString2, iMaxLength);
-  else
-    return (Extbyte *) lstrcpynA ((LPSTR) lpString1, (LPCSTR) lpString2, iMaxLength);
-}
-
-Extbyte *
-qxelstrcpy (Extbyte * lpString1, const Extbyte * lpString2)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) lstrcpyW ((LPWSTR) lpString1, (LPCWSTR) lpString2);
-  else
-    return (Extbyte *) lstrcpyA ((LPSTR) lpString1, (LPCSTR) lpString2);
-}
-
-Extbyte *
-qxelstrcat (Extbyte * lpString1, const Extbyte * lpString2)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) lstrcatW ((LPWSTR) lpString1, (LPCWSTR) lpString2);
-  else
-    return (Extbyte *) lstrcatA ((LPSTR) lpString1, (LPCSTR) lpString2);
-}
-
-int
-qxelstrlen (const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return lstrlenW ((LPCWSTR) lpString);
-  else
-    return lstrlenA ((LPCSTR) lpString);
-}
-
-HANDLE
-qxeCreateMutex (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return CreateMutexW (lpMutexAttributes, bInitialOwner, (LPCWSTR) lpName);
-  else
-    return CreateMutexA (lpMutexAttributes, bInitialOwner, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeOpenMutex (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return OpenMutexW (dwDesiredAccess, bInheritHandle, (LPCWSTR) lpName);
-  else
-    return OpenMutexA (dwDesiredAccess, bInheritHandle, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeCreateEvent (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return CreateEventW (lpEventAttributes, bManualReset, bInitialState, (LPCWSTR) lpName);
-  else
-    return CreateEventA (lpEventAttributes, bManualReset, bInitialState, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeOpenEvent (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return OpenEventW (dwDesiredAccess, bInheritHandle, (LPCWSTR) lpName);
-  else
-    return OpenEventA (dwDesiredAccess, bInheritHandle, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeCreateSemaphore (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return CreateSemaphoreW (lpSemaphoreAttributes, lInitialCount, lMaximumCount, (LPCWSTR) lpName);
-  else
-    return CreateSemaphoreA (lpSemaphoreAttributes, lInitialCount, lMaximumCount, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeOpenSemaphore (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return OpenSemaphoreW (dwDesiredAccess, bInheritHandle, (LPCWSTR) lpName);
-  else
-    return OpenSemaphoreA (dwDesiredAccess, bInheritHandle, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeCreateWaitableTimer (LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, const Extbyte * lpTimerName)
-{
-  if (XEUNICODE_P)
-    return CreateWaitableTimerW (lpTimerAttributes, bManualReset, (LPCWSTR) lpTimerName);
-  else
-    return CreateWaitableTimerA (lpTimerAttributes, bManualReset, (LPCSTR) lpTimerName);
-}
-
-HANDLE
-qxeOpenWaitableTimer (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpTimerName)
-{
-  if (XEUNICODE_P)
-    return OpenWaitableTimerW (dwDesiredAccess, bInheritHandle, (LPCWSTR) lpTimerName);
-  else
-    return OpenWaitableTimerA (dwDesiredAccess, bInheritHandle, (LPCSTR) lpTimerName);
-}
-
-HANDLE
-qxeCreateFileMapping (HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return CreateFileMappingW (hFile, lpFileMappingAttributes, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow, (LPCWSTR) lpName);
-  else
-    return CreateFileMappingA (hFile, lpFileMappingAttributes, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow, (LPCSTR) lpName);
-}
-
-HANDLE
-qxeOpenFileMapping (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName)
-{
-  if (XEUNICODE_P)
-    return OpenFileMappingW (dwDesiredAccess, bInheritHandle, (LPCWSTR) lpName);
-  else
-    return OpenFileMappingA (dwDesiredAccess, bInheritHandle, (LPCSTR) lpName);
-}
-
-DWORD
-qxeGetLogicalDriveStrings (DWORD nBufferLength, Extbyte * lpBuffer)
-{
-  if (XEUNICODE_P)
-    return GetLogicalDriveStringsW (nBufferLength, (LPWSTR) lpBuffer);
-  else
-    return GetLogicalDriveStringsA (nBufferLength, (LPSTR) lpBuffer);
-}
-
-HMODULE
-qxeLoadLibrary (const Extbyte * lpLibFileName)
-{
-  if (XEUNICODE_P)
-    return LoadLibraryW ((LPCWSTR) lpLibFileName);
-  else
-    return LoadLibraryA ((LPCSTR) lpLibFileName);
-}
-
-HMODULE
-qxeLoadLibraryEx (const Extbyte * lpLibFileName, HANDLE hFile, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return LoadLibraryExW ((LPCWSTR) lpLibFileName, hFile, dwFlags);
-  else
-    return LoadLibraryExA ((LPCSTR) lpLibFileName, hFile, dwFlags);
-}
-
-DWORD
-qxeGetModuleFileName (HMODULE hModule, Extbyte * lpFilename, DWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetModuleFileNameW (hModule, (LPWSTR) lpFilename, nSize);
-  else
-    return GetModuleFileNameA (hModule, (LPSTR) lpFilename, nSize);
-}
-
-HMODULE
-qxeGetModuleHandle (const Extbyte * lpModuleName)
-{
-  if (XEUNICODE_P)
-    return GetModuleHandleW ((LPCWSTR) lpModuleName);
-  else
-    return GetModuleHandleA ((LPCSTR) lpModuleName);
-}
-
-BOOL
-qxeCreateProcess (const Extbyte * lpApplicationName, Extbyte * lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const Extbyte * lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
-{
-  if (XEUNICODE_P)
-    return CreateProcessW ((LPCWSTR) lpApplicationName, (LPWSTR) lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, (LPCWSTR) lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
-  else
-    return CreateProcessA ((LPCSTR) lpApplicationName, (LPSTR) lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, (LPCSTR) lpCurrentDirectory, (LPSTARTUPINFOA) lpStartupInfo, lpProcessInformation);
-}
-
-VOID
-qxeFatalAppExit (UINT uAction, const Extbyte * lpMessageText)
-{
-  if (XEUNICODE_P)
-    FatalAppExitW (uAction, (LPCWSTR) lpMessageText);
-  else
-    FatalAppExitA (uAction, (LPCSTR) lpMessageText);
-}
-
-VOID
-qxeGetStartupInfo (LPSTARTUPINFOW lpStartupInfo)
-{
-  if (XEUNICODE_P)
-    GetStartupInfoW (lpStartupInfo);
-  else
-    GetStartupInfoA ((LPSTARTUPINFOA) lpStartupInfo);
-}
-
-Extbyte *
-qxeGetCommandLine (void)
-{
-  if (XEUNICODE_P)
-    return (Extbyte *) GetCommandLineW ();
-  else
-    return (Extbyte *) GetCommandLineA ();
-}
-
-DWORD
-qxeGetEnvironmentVariable (const Extbyte * lpName, Extbyte * lpBuffer, DWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetEnvironmentVariableW ((LPCWSTR) lpName, (LPWSTR) lpBuffer, nSize);
-  else
-    return GetEnvironmentVariableA ((LPCSTR) lpName, (LPSTR) lpBuffer, nSize);
-}
-
-BOOL
-qxeSetEnvironmentVariable (const Extbyte * lpName, const Extbyte * lpValue)
-{
-  if (XEUNICODE_P)
-    return SetEnvironmentVariableW ((LPCWSTR) lpName, (LPCWSTR) lpValue);
-  else
-    return SetEnvironmentVariableA ((LPCSTR) lpName, (LPCSTR) lpValue);
-}
-
-DWORD
-qxeExpandEnvironmentStrings (const Extbyte * lpSrc, Extbyte * lpDst, DWORD nSize)
-{
-  if (XEUNICODE_P)
-    return ExpandEnvironmentStringsW ((LPCWSTR) lpSrc, (LPWSTR) lpDst, nSize);
-  else
-    return ExpandEnvironmentStringsA ((LPCSTR) lpSrc, (LPSTR) lpDst, nSize);
-}
-
-VOID
-qxeOutputDebugString (const Extbyte * lpOutputString)
-{
-  if (XEUNICODE_P)
-    OutputDebugStringW ((LPCWSTR) lpOutputString);
-  else
-    OutputDebugStringA ((LPCSTR) lpOutputString);
-}
-
-HRSRC
-qxeFindResource (HMODULE hModule, const Extbyte * lpName, const Extbyte * lpType)
-{
-  if (XEUNICODE_P)
-    return FindResourceW (hModule, (LPCWSTR) lpName, (LPCWSTR) lpType);
-  else
-    return FindResourceA (hModule, (LPCSTR) lpName, (LPCSTR) lpType);
-}
-
-HRSRC
-qxeFindResourceEx (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, WORD wLanguage)
-{
-  if (XEUNICODE_P)
-    return FindResourceExW (hModule, (LPCWSTR) lpType, (LPCWSTR) lpName, wLanguage);
-  else
-    return FindResourceExA (hModule, (LPCSTR) lpType, (LPCSTR) lpName, wLanguage);
-}
-
-/* Skipping EnumResourceTypes because different prototypes in VC6 and VC7 */
-
-/* Skipping EnumResourceNames because different prototypes in VC6 and VC7 */
-
-/* Skipping EnumResourceLanguages because different prototypes in VC6 and VC7 */
-
-HANDLE
-qxeBeginUpdateResource (const Extbyte * pFileName, BOOL bDeleteExistingResources)
-{
-  if (XEUNICODE_P)
-    return BeginUpdateResourceW ((LPCWSTR) pFileName, bDeleteExistingResources);
-  else
-    return BeginUpdateResourceA ((LPCSTR) pFileName, bDeleteExistingResources);
-}
-
-BOOL
-qxeUpdateResource (HANDLE hUpdate, const Extbyte * lpType, const Extbyte * lpName, WORD wLanguage, LPVOID lpData, DWORD cbData)
-{
-  if (XEUNICODE_P)
-    return UpdateResourceW (hUpdate, (LPCWSTR) lpType, (LPCWSTR) lpName, wLanguage, lpData, cbData);
-  else
-    return UpdateResourceA (hUpdate, (LPCSTR) lpType, (LPCSTR) lpName, wLanguage, lpData, cbData);
-}
-
-BOOL
-qxeEndUpdateResource (HANDLE hUpdate, BOOL fDiscard)
-{
-  if (XEUNICODE_P)
-    return EndUpdateResourceW (hUpdate, fDiscard);
-  else
-    return EndUpdateResourceA (hUpdate, fDiscard);
-}
-
-ATOM
-qxeGlobalAddAtom (const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return GlobalAddAtomW ((LPCWSTR) lpString);
-  else
-    return GlobalAddAtomA ((LPCSTR) lpString);
-}
-
-ATOM
-qxeGlobalFindAtom (const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return GlobalFindAtomW ((LPCWSTR) lpString);
-  else
-    return GlobalFindAtomA ((LPCSTR) lpString);
-}
-
-UINT
-qxeGlobalGetAtomName (ATOM nAtom, Extbyte * lpBuffer, int nSize)
-{
-  if (XEUNICODE_P)
-    return GlobalGetAtomNameW (nAtom, (LPWSTR) lpBuffer, nSize);
-  else
-    return GlobalGetAtomNameA (nAtom, (LPSTR) lpBuffer, nSize);
-}
-
-ATOM
-qxeAddAtom (const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return AddAtomW ((LPCWSTR) lpString);
-  else
-    return AddAtomA ((LPCSTR) lpString);
-}
-
-ATOM
-qxeFindAtom (const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return FindAtomW ((LPCWSTR) lpString);
-  else
-    return FindAtomA ((LPCSTR) lpString);
-}
-
-UINT
-qxeGetAtomName (ATOM nAtom, Extbyte * lpBuffer, int nSize)
-{
-  if (XEUNICODE_P)
-    return GetAtomNameW (nAtom, (LPWSTR) lpBuffer, nSize);
-  else
-    return GetAtomNameA (nAtom, (LPSTR) lpBuffer, nSize);
-}
-
-UINT
-qxeGetProfileInt (const Extbyte * lpAppName, const Extbyte * lpKeyName, INT nDefault)
-{
-  if (XEUNICODE_P)
-    return GetProfileIntW ((LPCWSTR) lpAppName, (LPCWSTR) lpKeyName, nDefault);
-  else
-    return GetProfileIntA ((LPCSTR) lpAppName, (LPCSTR) lpKeyName, nDefault);
-}
-
-DWORD
-qxeGetProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpDefault, Extbyte * lpReturnedString, DWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetProfileStringW ((LPCWSTR) lpAppName, (LPCWSTR) lpKeyName, (LPCWSTR) lpDefault, (LPWSTR) lpReturnedString, nSize);
-  else
-    return GetProfileStringA ((LPCSTR) lpAppName, (LPCSTR) lpKeyName, (LPCSTR) lpDefault, (LPSTR) lpReturnedString, nSize);
-}
-
-BOOL
-qxeWriteProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return WriteProfileStringW ((LPCWSTR) lpAppName, (LPCWSTR) lpKeyName, (LPCWSTR) lpString);
-  else
-    return WriteProfileStringA ((LPCSTR) lpAppName, (LPCSTR) lpKeyName, (LPCSTR) lpString);
-}
-
-DWORD
-qxeGetProfileSection (const Extbyte * lpAppName, Extbyte * lpReturnedString, DWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetProfileSectionW ((LPCWSTR) lpAppName, (LPWSTR) lpReturnedString, nSize);
-  else
-    return GetProfileSectionA ((LPCSTR) lpAppName, (LPSTR) lpReturnedString, nSize);
-}
-
-BOOL
-qxeWriteProfileSection (const Extbyte * lpAppName, const Extbyte * lpString)
-{
-  if (XEUNICODE_P)
-    return WriteProfileSectionW ((LPCWSTR) lpAppName, (LPCWSTR) lpString);
-  else
-    return WriteProfileSectionA ((LPCSTR) lpAppName, (LPCSTR) lpString);
-}
-
-UINT
-qxeGetPrivateProfileInt (const Extbyte * lpAppName, const Extbyte * lpKeyName, INT nDefault, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return GetPrivateProfileIntW ((LPCWSTR) lpAppName, (LPCWSTR) lpKeyName, nDefault, (LPCWSTR) lpFileName);
-  else
-    return GetPrivateProfileIntA ((LPCSTR) lpAppName, (LPCSTR) lpKeyName, nDefault, (LPCSTR) lpFileName);
-}
-
-DWORD
-qxeGetPrivateProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpDefault, Extbyte * lpReturnedString, DWORD nSize, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return GetPrivateProfileStringW ((LPCWSTR) lpAppName, (LPCWSTR) lpKeyName, (LPCWSTR) lpDefault, (LPWSTR) lpReturnedString, nSize, (LPCWSTR) lpFileName);
-  else
-    return GetPrivateProfileStringA ((LPCSTR) lpAppName, (LPCSTR) lpKeyName, (LPCSTR) lpDefault, (LPSTR) lpReturnedString, nSize, (LPCSTR) lpFileName);
-}
-
-BOOL
-qxeWritePrivateProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpString, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return WritePrivateProfileStringW ((LPCWSTR) lpAppName, (LPCWSTR) lpKeyName, (LPCWSTR) lpString, (LPCWSTR) lpFileName);
-  else
-    return WritePrivateProfileStringA ((LPCSTR) lpAppName, (LPCSTR) lpKeyName, (LPCSTR) lpString, (LPCSTR) lpFileName);
-}
-
-DWORD
-qxeGetPrivateProfileSection (const Extbyte * lpAppName, Extbyte * lpReturnedString, DWORD nSize, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return GetPrivateProfileSectionW ((LPCWSTR) lpAppName, (LPWSTR) lpReturnedString, nSize, (LPCWSTR) lpFileName);
-  else
-    return GetPrivateProfileSectionA ((LPCSTR) lpAppName, (LPSTR) lpReturnedString, nSize, (LPCSTR) lpFileName);
-}
-
-BOOL
-qxeWritePrivateProfileSection (const Extbyte * lpAppName, const Extbyte * lpString, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return WritePrivateProfileSectionW ((LPCWSTR) lpAppName, (LPCWSTR) lpString, (LPCWSTR) lpFileName);
-  else
-    return WritePrivateProfileSectionA ((LPCSTR) lpAppName, (LPCSTR) lpString, (LPCSTR) lpFileName);
-}
-
-DWORD
-qxeGetPrivateProfileSectionNames (Extbyte * lpszReturnBuffer, DWORD nSize, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return GetPrivateProfileSectionNamesW ((LPWSTR) lpszReturnBuffer, nSize, (LPCWSTR) lpFileName);
-  else
-    return GetPrivateProfileSectionNamesA ((LPSTR) lpszReturnBuffer, nSize, (LPCSTR) lpFileName);
-}
-
-BOOL
-qxeGetPrivateProfileStruct (const Extbyte * lpszSection, const Extbyte * lpszKey, LPVOID lpStruct, UINT uSizeStruct, const Extbyte * szFile)
-{
-  if (XEUNICODE_P)
-    return GetPrivateProfileStructW ((LPCWSTR) lpszSection, (LPCWSTR) lpszKey, lpStruct, uSizeStruct, (LPCWSTR) szFile);
-  else
-    return GetPrivateProfileStructA ((LPCSTR) lpszSection, (LPCSTR) lpszKey, lpStruct, uSizeStruct, (LPCSTR) szFile);
-}
-
-BOOL
-qxeWritePrivateProfileStruct (const Extbyte * lpszSection, const Extbyte * lpszKey, LPVOID lpStruct, UINT uSizeStruct, const Extbyte * szFile)
-{
-  if (XEUNICODE_P)
-    return WritePrivateProfileStructW ((LPCWSTR) lpszSection, (LPCWSTR) lpszKey, lpStruct, uSizeStruct, (LPCWSTR) szFile);
-  else
-    return WritePrivateProfileStructA ((LPCSTR) lpszSection, (LPCSTR) lpszKey, lpStruct, uSizeStruct, (LPCSTR) szFile);
-}
-
-UINT
-qxeGetDriveType (const Extbyte * lpRootPathName)
-{
-  if (XEUNICODE_P)
-    return GetDriveTypeW ((LPCWSTR) lpRootPathName);
-  else
-    return GetDriveTypeA ((LPCSTR) lpRootPathName);
-}
-
-UINT
-qxeGetSystemDirectory (Extbyte * lpBuffer, UINT uSize)
-{
-  if (XEUNICODE_P)
-    return GetSystemDirectoryW ((LPWSTR) lpBuffer, uSize);
-  else
-    return GetSystemDirectoryA ((LPSTR) lpBuffer, uSize);
-}
-
-DWORD
-qxeGetTempPath (DWORD nBufferLength, Extbyte * lpBuffer)
-{
-  if (XEUNICODE_P)
-    return GetTempPathW (nBufferLength, (LPWSTR) lpBuffer);
-  else
-    return GetTempPathA (nBufferLength, (LPSTR) lpBuffer);
-}
-
-UINT
-qxeGetTempFileName (const Extbyte * lpPathName, const Extbyte * lpPrefixString, UINT uUnique, Extbyte * lpTempFileName)
-{
-  if (XEUNICODE_P)
-    return GetTempFileNameW ((LPCWSTR) lpPathName, (LPCWSTR) lpPrefixString, uUnique, (LPWSTR) lpTempFileName);
-  else
-    return GetTempFileNameA ((LPCSTR) lpPathName, (LPCSTR) lpPrefixString, uUnique, (LPSTR) lpTempFileName);
-}
-
-UINT
-qxeGetWindowsDirectory (Extbyte * lpBuffer, UINT uSize)
-{
-  if (XEUNICODE_P)
-    return GetWindowsDirectoryW ((LPWSTR) lpBuffer, uSize);
-  else
-    return GetWindowsDirectoryA ((LPSTR) lpBuffer, uSize);
-}
-
-BOOL
-qxeSetCurrentDirectory (const Extbyte * lpPathName)
-{
-  if (XEUNICODE_P)
-    return SetCurrentDirectoryW ((LPCWSTR) lpPathName);
-  else
-    return SetCurrentDirectoryA ((LPCSTR) lpPathName);
-}
-
-DWORD
-qxeGetCurrentDirectory (DWORD nBufferLength, Extbyte * lpBuffer)
-{
-  if (XEUNICODE_P)
-    return GetCurrentDirectoryW (nBufferLength, (LPWSTR) lpBuffer);
-  else
-    return GetCurrentDirectoryA (nBufferLength, (LPSTR) lpBuffer);
-}
-
-BOOL
-qxeGetDiskFreeSpace (const Extbyte * lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters)
-{
-  if (XEUNICODE_P)
-    return GetDiskFreeSpaceW ((LPCWSTR) lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters);
-  else
-    return GetDiskFreeSpaceA ((LPCSTR) lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters);
-}
-
-BOOL
-qxeGetDiskFreeSpaceEx (const Extbyte * lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes)
-{
-  if (XEUNICODE_P)
-    return GetDiskFreeSpaceExW ((LPCWSTR) lpDirectoryName, lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes);
-  else
-    return GetDiskFreeSpaceExA ((LPCSTR) lpDirectoryName, lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes, lpTotalNumberOfFreeBytes);
-}
-
-BOOL
-qxeCreateDirectory (const Extbyte * lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
-  if (XEUNICODE_P)
-    return CreateDirectoryW ((LPCWSTR) lpPathName, lpSecurityAttributes);
-  else
-    return CreateDirectoryA ((LPCSTR) lpPathName, lpSecurityAttributes);
-}
-
-BOOL
-qxeCreateDirectoryEx (const Extbyte * lpTemplateDirectory, const Extbyte * lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
-  if (XEUNICODE_P)
-    return CreateDirectoryExW ((LPCWSTR) lpTemplateDirectory, (LPCWSTR) lpNewDirectory, lpSecurityAttributes);
-  else
-    return CreateDirectoryExA ((LPCSTR) lpTemplateDirectory, (LPCSTR) lpNewDirectory, lpSecurityAttributes);
-}
-
-BOOL
-qxeRemoveDirectory (const Extbyte * lpPathName)
-{
-  if (XEUNICODE_P)
-    return RemoveDirectoryW ((LPCWSTR) lpPathName);
-  else
-    return RemoveDirectoryA ((LPCSTR) lpPathName);
-}
-
-DWORD
-qxeGetFullPathName (const Extbyte * lpFileName, DWORD nBufferLength, Extbyte * lpBuffer, Extbyte * * lpFilePart)
-{
-  if (XEUNICODE_P)
-    return GetFullPathNameW ((LPCWSTR) lpFileName, nBufferLength, (LPWSTR) lpBuffer, (LPWSTR *) lpFilePart);
-  else
-    return GetFullPathNameA ((LPCSTR) lpFileName, nBufferLength, (LPSTR) lpBuffer, (LPSTR *) lpFilePart);
-}
-
-BOOL
-qxeDefineDosDevice (DWORD dwFlags, const Extbyte * lpDeviceName, const Extbyte * lpTargetPath)
-{
-  if (XEUNICODE_P)
-    return DefineDosDeviceW (dwFlags, (LPCWSTR) lpDeviceName, (LPCWSTR) lpTargetPath);
-  else
-    return DefineDosDeviceA (dwFlags, (LPCSTR) lpDeviceName, (LPCSTR) lpTargetPath);
-}
-
-DWORD
-qxeQueryDosDevice (const Extbyte * lpDeviceName, Extbyte * lpTargetPath, DWORD ucchMax)
-{
-  if (XEUNICODE_P)
-    return QueryDosDeviceW ((LPCWSTR) lpDeviceName, (LPWSTR) lpTargetPath, ucchMax);
-  else
-    return QueryDosDeviceA ((LPCSTR) lpDeviceName, (LPSTR) lpTargetPath, ucchMax);
-}
-
-HANDLE
-qxeCreateFile (const Extbyte * lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
-{
-  if (XEUNICODE_P)
-    return CreateFileW ((LPCWSTR) lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
-  else
-    return CreateFileA ((LPCSTR) lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
-}
-
-BOOL
-qxeSetFileAttributes (const Extbyte * lpFileName, DWORD dwFileAttributes)
-{
-  if (XEUNICODE_P)
-    return SetFileAttributesW ((LPCWSTR) lpFileName, dwFileAttributes);
-  else
-    return SetFileAttributesA ((LPCSTR) lpFileName, dwFileAttributes);
-}
-
-DWORD
-qxeGetFileAttributes (const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return GetFileAttributesW ((LPCWSTR) lpFileName);
-  else
-    return GetFileAttributesA ((LPCSTR) lpFileName);
-}
-
-BOOL
-qxeGetFileAttributesEx (const Extbyte * lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation)
-{
-  if (XEUNICODE_P)
-    return GetFileAttributesExW ((LPCWSTR) lpFileName, fInfoLevelId, lpFileInformation);
-  else
-    return GetFileAttributesExA ((LPCSTR) lpFileName, fInfoLevelId, lpFileInformation);
-}
-
-DWORD
-qxeGetCompressedFileSize (const Extbyte * lpFileName, LPDWORD lpFileSizeHigh)
-{
-  if (XEUNICODE_P)
-    return GetCompressedFileSizeW ((LPCWSTR) lpFileName, lpFileSizeHigh);
-  else
-    return GetCompressedFileSizeA ((LPCSTR) lpFileName, lpFileSizeHigh);
-}
-
-BOOL
-qxeDeleteFile (const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return DeleteFileW ((LPCWSTR) lpFileName);
-  else
-    return DeleteFileA ((LPCSTR) lpFileName);
-}
-
-/* Error if FindFirstFileEx used: split-sized LPWIN32_FIND_DATA; not used, NT 4.0+ only */
-
-/* Skipping FindFirstFile because split-sized LPWIN32_FIND_DATA */
-
-/* Skipping FindNextFile because split-sized LPWIN32_FIND_DATA */
-
-DWORD
-qxeSearchPath (const Extbyte * lpPath, const Extbyte * lpFileName, const Extbyte * lpExtension, DWORD nBufferLength, Extbyte * lpBuffer, Extbyte * * lpFilePart)
-{
-  if (XEUNICODE_P)
-    return SearchPathW ((LPCWSTR) lpPath, (LPCWSTR) lpFileName, (LPCWSTR) lpExtension, nBufferLength, (LPWSTR) lpBuffer, (LPWSTR *) lpFilePart);
-  else
-    return SearchPathA ((LPCSTR) lpPath, (LPCSTR) lpFileName, (LPCSTR) lpExtension, nBufferLength, (LPSTR) lpBuffer, (LPSTR *) lpFilePart);
-}
-
-BOOL
-qxeCopyFile (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, BOOL bFailIfExists)
-{
-  if (XEUNICODE_P)
-    return CopyFileW ((LPCWSTR) lpExistingFileName, (LPCWSTR) lpNewFileName, bFailIfExists);
-  else
-    return CopyFileA ((LPCSTR) lpExistingFileName, (LPCSTR) lpNewFileName, bFailIfExists);
-}
-
-/* NOTE: NT 4.0+ only */
-BOOL
-qxeCopyFileEx (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags)
-{
-  if (XEUNICODE_P)
-    return CopyFileExW ((LPCWSTR) lpExistingFileName, (LPCWSTR) lpNewFileName, lpProgressRoutine, lpData, pbCancel, dwCopyFlags);
-  else
-    return CopyFileExA ((LPCSTR) lpExistingFileName, (LPCSTR) lpNewFileName, lpProgressRoutine, lpData, pbCancel, dwCopyFlags);
-}
-
-BOOL
-qxeMoveFile (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName)
-{
-  if (XEUNICODE_P)
-    return MoveFileW ((LPCWSTR) lpExistingFileName, (LPCWSTR) lpNewFileName);
-  else
-    return MoveFileA ((LPCSTR) lpExistingFileName, (LPCSTR) lpNewFileName);
-}
-
-BOOL
-qxeMoveFileEx (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, DWORD dwFlags)
-{
-  if (XEUNICODE_P)
-    return MoveFileExW ((LPCWSTR) lpExistingFileName, (LPCWSTR) lpNewFileName, dwFlags);
-  else
-    return MoveFileExA ((LPCSTR) lpExistingFileName, (LPCSTR) lpNewFileName, dwFlags);
-}
-
-/* Error if MoveFileWithProgress used: NT 5.0+ only */
-
-/* Error if CreateHardLink used: NT 5.0+ only */
-
-HANDLE
-qxeCreateNamedPipe (const Extbyte * lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
-  if (XEUNICODE_P)
-    return CreateNamedPipeW ((LPCWSTR) lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
-  else
-    return CreateNamedPipeA ((LPCSTR) lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
-}
-
-BOOL
-qxeGetNamedPipeHandleState (HANDLE hNamedPipe, LPDWORD lpState, LPDWORD lpCurInstances, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout, Extbyte * lpUserName, DWORD nMaxUserNameSize)
-{
-  if (XEUNICODE_P)
-    return GetNamedPipeHandleStateW (hNamedPipe, lpState, lpCurInstances, lpMaxCollectionCount, lpCollectDataTimeout, (LPWSTR) lpUserName, nMaxUserNameSize);
-  else
-    return GetNamedPipeHandleStateA (hNamedPipe, lpState, lpCurInstances, lpMaxCollectionCount, lpCollectDataTimeout, (LPSTR) lpUserName, nMaxUserNameSize);
-}
-
-BOOL
-qxeCallNamedPipe (const Extbyte * lpNamedPipeName, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, DWORD nTimeOut)
-{
-  if (XEUNICODE_P)
-    return CallNamedPipeW ((LPCWSTR) lpNamedPipeName, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesRead, nTimeOut);
-  else
-    return CallNamedPipeA ((LPCSTR) lpNamedPipeName, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesRead, nTimeOut);
-}
-
-BOOL
-qxeWaitNamedPipe (const Extbyte * lpNamedPipeName, DWORD nTimeOut)
-{
-  if (XEUNICODE_P)
-    return WaitNamedPipeW ((LPCWSTR) lpNamedPipeName, nTimeOut);
-  else
-    return WaitNamedPipeA ((LPCSTR) lpNamedPipeName, nTimeOut);
-}
-
-BOOL
-qxeSetVolumeLabel (const Extbyte * lpRootPathName, const Extbyte * lpVolumeName)
-{
-  if (XEUNICODE_P)
-    return SetVolumeLabelW ((LPCWSTR) lpRootPathName, (LPCWSTR) lpVolumeName);
-  else
-    return SetVolumeLabelA ((LPCSTR) lpRootPathName, (LPCSTR) lpVolumeName);
-}
-
-BOOL
-qxeGetVolumeInformation (const Extbyte * lpRootPathName, Extbyte * lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, Extbyte * lpFileSystemNameBuffer, DWORD nFileSystemNameSize)
-{
-  if (XEUNICODE_P)
-    return GetVolumeInformationW ((LPCWSTR) lpRootPathName, (LPWSTR) lpVolumeNameBuffer, nVolumeNameSize, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, (LPWSTR) lpFileSystemNameBuffer, nFileSystemNameSize);
-  else
-    return GetVolumeInformationA ((LPCSTR) lpRootPathName, (LPSTR) lpVolumeNameBuffer, nVolumeNameSize, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, (LPSTR) lpFileSystemNameBuffer, nFileSystemNameSize);
-}
-
-BOOL
-qxeClearEventLog (HANDLE hEventLog, const Extbyte * lpBackupFileName)
-{
-  if (XEUNICODE_P)
-    return ClearEventLogW (hEventLog, (LPCWSTR) lpBackupFileName);
-  else
-    return ClearEventLogA (hEventLog, (LPCSTR) lpBackupFileName);
-}
-
-BOOL
-qxeBackupEventLog (HANDLE hEventLog, const Extbyte * lpBackupFileName)
-{
-  if (XEUNICODE_P)
-    return BackupEventLogW (hEventLog, (LPCWSTR) lpBackupFileName);
-  else
-    return BackupEventLogA (hEventLog, (LPCSTR) lpBackupFileName);
-}
-
-HANDLE
-qxeOpenEventLog (const Extbyte * lpUNCServerName, const Extbyte * lpSourceName)
-{
-  if (XEUNICODE_P)
-    return OpenEventLogW ((LPCWSTR) lpUNCServerName, (LPCWSTR) lpSourceName);
-  else
-    return OpenEventLogA ((LPCSTR) lpUNCServerName, (LPCSTR) lpSourceName);
-}
-
-HANDLE
-qxeRegisterEventSource (const Extbyte * lpUNCServerName, const Extbyte * lpSourceName)
-{
-  if (XEUNICODE_P)
-    return RegisterEventSourceW ((LPCWSTR) lpUNCServerName, (LPCWSTR) lpSourceName);
-  else
-    return RegisterEventSourceA ((LPCSTR) lpUNCServerName, (LPCSTR) lpSourceName);
-}
-
-HANDLE
-qxeOpenBackupEventLog (const Extbyte * lpUNCServerName, const Extbyte * lpFileName)
-{
-  if (XEUNICODE_P)
-    return OpenBackupEventLogW ((LPCWSTR) lpUNCServerName, (LPCWSTR) lpFileName);
-  else
-    return OpenBackupEventLogA ((LPCSTR) lpUNCServerName, (LPCSTR) lpFileName);
-}
-
-BOOL
-qxeReadEventLog (HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD      * pnBytesRead, DWORD      * pnMinNumberOfBytesNeeded)
-{
-  if (XEUNICODE_P)
-    return ReadEventLogW (hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
-  else
-    return ReadEventLogA (hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
-}
-
-BOOL
-qxeReportEvent (HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, const Extbyte *   * lpStrings, LPVOID lpRawData)
-{
-  if (XEUNICODE_P)
-    return ReportEventW (hEventLog, wType, wCategory, dwEventID, lpUserSid, wNumStrings, dwDataSize, (LPCWSTR   *) lpStrings, lpRawData);
-  else
-    return ReportEventA (hEventLog, wType, wCategory, dwEventID, lpUserSid, wNumStrings, dwDataSize, (LPCSTR   *) lpStrings, lpRawData);
-}
-
-BOOL
-qxeAccessCheckAndAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, Extbyte * ObjectTypeName, Extbyte * ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD DesiredAccess, PGENERIC_MAPPING GenericMapping, BOOL ObjectCreation, LPDWORD GrantedAccess, LPBOOL AccessStatus, LPBOOL pfGenerateOnClose)
-{
-  if (XEUNICODE_P)
-    return AccessCheckAndAuditAlarmW ((LPCWSTR) SubsystemName, HandleId, (LPWSTR) ObjectTypeName, (LPWSTR) ObjectName, SecurityDescriptor, DesiredAccess, GenericMapping, ObjectCreation, GrantedAccess, AccessStatus, pfGenerateOnClose);
-  else
-    return AccessCheckAndAuditAlarmA ((LPCSTR) SubsystemName, HandleId, (LPSTR) ObjectTypeName, (LPSTR) ObjectName, SecurityDescriptor, DesiredAccess, GenericMapping, ObjectCreation, GrantedAccess, AccessStatus, pfGenerateOnClose);
-}
-
-/* Error if AccessCheckByTypeAndAuditAlarm used: NT 5.0+ only */
-
-/* Error if AccessCheckByTypeResultListAndAuditAlarm used: NT 5.0+ only */
-
-BOOL
-qxeObjectOpenAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, Extbyte * ObjectTypeName, Extbyte * ObjectName, PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess, DWORD GrantedAccess, PPRIVILEGE_SET Privileges, BOOL ObjectCreation, BOOL AccessGranted, LPBOOL GenerateOnClose)
-{
-  if (XEUNICODE_P)
-    return ObjectOpenAuditAlarmW ((LPCWSTR) SubsystemName, HandleId, (LPWSTR) ObjectTypeName, (LPWSTR) ObjectName, pSecurityDescriptor, ClientToken, DesiredAccess, GrantedAccess, Privileges, ObjectCreation, AccessGranted, GenerateOnClose);
-  else
-    return ObjectOpenAuditAlarmA ((LPCSTR) SubsystemName, HandleId, (LPSTR) ObjectTypeName, (LPSTR) ObjectName, pSecurityDescriptor, ClientToken, DesiredAccess, GrantedAccess, Privileges, ObjectCreation, AccessGranted, GenerateOnClose);
-}
-
-BOOL
-qxeObjectPrivilegeAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, HANDLE ClientToken, DWORD DesiredAccess, PPRIVILEGE_SET Privileges, BOOL AccessGranted)
-{
-  if (XEUNICODE_P)
-    return ObjectPrivilegeAuditAlarmW ((LPCWSTR) SubsystemName, HandleId, ClientToken, DesiredAccess, Privileges, AccessGranted);
-  else
-    return ObjectPrivilegeAuditAlarmA ((LPCSTR) SubsystemName, HandleId, ClientToken, DesiredAccess, Privileges, AccessGranted);
-}
-
-BOOL
-qxeObjectCloseAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, BOOL GenerateOnClose)
-{
-  if (XEUNICODE_P)
-    return ObjectCloseAuditAlarmW ((LPCWSTR) SubsystemName, HandleId, GenerateOnClose);
-  else
-    return ObjectCloseAuditAlarmA ((LPCSTR) SubsystemName, HandleId, GenerateOnClose);
-}
-
-BOOL
-qxeObjectDeleteAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, BOOL GenerateOnClose)
-{
-  if (XEUNICODE_P)
-    return ObjectDeleteAuditAlarmW ((LPCWSTR) SubsystemName, HandleId, GenerateOnClose);
-  else
-    return ObjectDeleteAuditAlarmA ((LPCSTR) SubsystemName, HandleId, GenerateOnClose);
-}
-
-BOOL
-qxePrivilegedServiceAuditAlarm (const Extbyte * SubsystemName, const Extbyte * ServiceName, HANDLE ClientToken, PPRIVILEGE_SET Privileges, BOOL AccessGranted)
-{
-  if (XEUNICODE_P)
-    return PrivilegedServiceAuditAlarmW ((LPCWSTR) SubsystemName, (LPCWSTR) ServiceName, ClientToken, Privileges, AccessGranted);
-  else
-    return PrivilegedServiceAuditAlarmA ((LPCSTR) SubsystemName, (LPCSTR) ServiceName, ClientToken, Privileges, AccessGranted);
-}
-
-BOOL
-qxeSetFileSecurity (const Extbyte * lpFileName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
-{
-  if (XEUNICODE_P)
-    return SetFileSecurityW ((LPCWSTR) lpFileName, SecurityInformation, pSecurityDescriptor);
-  else
-    return SetFileSecurityA ((LPCSTR) lpFileName, SecurityInformation, pSecurityDescriptor);
-}
-
-BOOL
-qxeGetFileSecurity (const Extbyte * lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded)
-{
-  if (XEUNICODE_P)
-    return GetFileSecurityW ((LPCWSTR) lpFileName, RequestedInformation, pSecurityDescriptor, nLength, lpnLengthNeeded);
-  else
-    return GetFileSecurityA ((LPCSTR) lpFileName, RequestedInformation, pSecurityDescriptor, nLength, lpnLengthNeeded);
-}
-
-HANDLE
-qxeFindFirstChangeNotification (const Extbyte * lpPathName, BOOL bWatchSubtree, DWORD dwNotifyFilter)
-{
-  if (XEUNICODE_P)
-    return FindFirstChangeNotificationW ((LPCWSTR) lpPathName, bWatchSubtree, dwNotifyFilter);
-  else
-    return FindFirstChangeNotificationA ((LPCSTR) lpPathName, bWatchSubtree, dwNotifyFilter);
-}
-
-/* Error if ReadDirectoryChanges used: Unicode-only */
-
-BOOL
-qxeIsBadStringPtr (const Extbyte * lpsz, UINT ucchMax)
-{
-  if (XEUNICODE_P)
-    return IsBadStringPtrW ((LPCWSTR) lpsz, ucchMax);
-  else
-    return IsBadStringPtrA ((LPCSTR) lpsz, ucchMax);
-}
-
-BOOL
-qxeLookupAccountSid (const Extbyte * lpSystemName, PSID Sid, Extbyte * Name, LPDWORD cbName, Extbyte * ReferencedDomainName, LPDWORD cbReferencedDomainName, PSID_NAME_USE peUse)
-{
-  if (XEUNICODE_P)
-    return LookupAccountSidW ((LPCWSTR) lpSystemName, Sid, (LPWSTR) Name, cbName, (LPWSTR) ReferencedDomainName, cbReferencedDomainName, peUse);
-  else
-    return LookupAccountSidA ((LPCSTR) lpSystemName, Sid, (LPSTR) Name, cbName, (LPSTR) ReferencedDomainName, cbReferencedDomainName, peUse);
-}
-
-BOOL
-qxeLookupAccountName (const Extbyte * lpSystemName, const Extbyte * lpAccountName, PSID Sid, LPDWORD cbSid, Extbyte * ReferencedDomainName, LPDWORD cbReferencedDomainName, PSID_NAME_USE peUse)
-{
-  if (XEUNICODE_P)
-    return LookupAccountNameW ((LPCWSTR) lpSystemName, (LPCWSTR) lpAccountName, Sid, cbSid, (LPWSTR) ReferencedDomainName, cbReferencedDomainName, peUse);
-  else
-    return LookupAccountNameA ((LPCSTR) lpSystemName, (LPCSTR) lpAccountName, Sid, cbSid, (LPSTR) ReferencedDomainName, cbReferencedDomainName, peUse);
-}
-
-BOOL
-qxeLookupPrivilegeValue (const Extbyte * lpSystemName, const Extbyte * lpName, PLUID lpLuid)
-{
-  if (XEUNICODE_P)
-    return LookupPrivilegeValueW ((LPCWSTR) lpSystemName, (LPCWSTR) lpName, lpLuid);
-  else
-    return LookupPrivilegeValueA ((LPCSTR) lpSystemName, (LPCSTR) lpName, lpLuid);
-}
-
-BOOL
-qxeLookupPrivilegeName (const Extbyte * lpSystemName, PLUID lpLuid, Extbyte * lpName, LPDWORD cbName)
-{
-  if (XEUNICODE_P)
-    return LookupPrivilegeNameW ((LPCWSTR) lpSystemName, lpLuid, (LPWSTR) lpName, cbName);
-  else
-    return LookupPrivilegeNameA ((LPCSTR) lpSystemName, lpLuid, (LPSTR) lpName, cbName);
-}
-
-BOOL
-qxeLookupPrivilegeDisplayName (const Extbyte * lpSystemName, const Extbyte * lpName, Extbyte * lpDisplayName, LPDWORD cbDisplayName, LPDWORD lpLanguageId)
-{
-  if (XEUNICODE_P)
-    return LookupPrivilegeDisplayNameW ((LPCWSTR) lpSystemName, (LPCWSTR) lpName, (LPWSTR) lpDisplayName, cbDisplayName, lpLanguageId);
-  else
-    return LookupPrivilegeDisplayNameA ((LPCSTR) lpSystemName, (LPCSTR) lpName, (LPSTR) lpDisplayName, cbDisplayName, lpLanguageId);
-}
-
-BOOL
-qxeBuildCommDCB (const Extbyte * lpDef, LPDCB lpDCB)
-{
-  if (XEUNICODE_P)
-    return BuildCommDCBW ((LPCWSTR) lpDef, lpDCB);
-  else
-    return BuildCommDCBA ((LPCSTR) lpDef, lpDCB);
-}
-
-BOOL
-qxeBuildCommDCBAndTimeouts (const Extbyte * lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts)
-{
-  if (XEUNICODE_P)
-    return BuildCommDCBAndTimeoutsW ((LPCWSTR) lpDef, lpDCB, lpCommTimeouts);
-  else
-    return BuildCommDCBAndTimeoutsA ((LPCSTR) lpDef, lpDCB, lpCommTimeouts);
-}
-
-BOOL
-qxeCommConfigDialog (const Extbyte * lpszName, HWND hWnd, LPCOMMCONFIG lpCC)
-{
-  if (XEUNICODE_P)
-    return CommConfigDialogW ((LPCWSTR) lpszName, hWnd, lpCC);
-  else
-    return CommConfigDialogA ((LPCSTR) lpszName, hWnd, lpCC);
-}
-
-BOOL
-qxeGetDefaultCommConfig (const Extbyte * lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize)
-{
-  if (XEUNICODE_P)
-    return GetDefaultCommConfigW ((LPCWSTR) lpszName, lpCC, lpdwSize);
-  else
-    return GetDefaultCommConfigA ((LPCSTR) lpszName, lpCC, lpdwSize);
-}
-
-BOOL
-qxeSetDefaultCommConfig (const Extbyte * lpszName, LPCOMMCONFIG lpCC, DWORD dwSize)
-{
-  if (XEUNICODE_P)
-    return SetDefaultCommConfigW ((LPCWSTR) lpszName, lpCC, dwSize);
-  else
-    return SetDefaultCommConfigA ((LPCSTR) lpszName, lpCC, dwSize);
-}
-
-BOOL
-qxeGetComputerName (Extbyte * lpBuffer, LPDWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetComputerNameW ((LPWSTR) lpBuffer, nSize);
-  else
-    return GetComputerNameA ((LPSTR) lpBuffer, nSize);
-}
-
-BOOL
-qxeSetComputerName (const Extbyte * lpComputerName)
-{
-  if (XEUNICODE_P)
-    return SetComputerNameW ((LPCWSTR) lpComputerName);
-  else
-    return SetComputerNameA ((LPCSTR) lpComputerName);
-}
-
-BOOL
-qxeGetUserName (Extbyte * lpBuffer, LPDWORD nSize)
-{
-  if (XEUNICODE_P)
-    return GetUserNameW ((LPWSTR) lpBuffer, nSize);
-  else
-    return GetUserNameA ((LPSTR) lpBuffer, nSize);
-}
-
-BOOL
-qxeLogonUser (Extbyte * lpszUsername, Extbyte * lpszDomain, Extbyte * lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken)
-{
-  if (XEUNICODE_P)
-    return LogonUserW ((LPWSTR) lpszUsername, (LPWSTR) lpszDomain, (LPWSTR) lpszPassword, dwLogonType, dwLogonProvider, phToken);
-  else
-    return LogonUserA ((LPSTR) lpszUsername, (LPSTR) lpszDomain, (LPSTR) lpszPassword, dwLogonType, dwLogonProvider, phToken);
-}
-
-BOOL
-qxeCreateProcessAsUser (HANDLE hToken, const Extbyte * lpApplicationName, Extbyte * lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const Extbyte * lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
-{
-  if (XEUNICODE_P)
-    return CreateProcessAsUserW (hToken, (LPCWSTR) lpApplicationName, (LPWSTR) lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, (LPCWSTR) lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
-  else
-    return CreateProcessAsUserA (hToken, (LPCSTR) lpApplicationName, (LPSTR) lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, (LPCSTR) lpCurrentDirectory, (LPSTARTUPINFOA) lpStartupInfo, lpProcessInformation);
-}
-
-/* Error if GetCurrentHwProfile used: split-sized LPHW_PROFILE_INFO; NT 4.0+ only */
-
-/* Error if GetVersionEx used: split-sized LPOSVERSIONINFO */
-
-/* Error if CreateJobObject used: NT 5.0+ only */
-
-/* Error if OpenJobObject used: NT 5.0+ only */
-
-
-/*----------------------------------------------------------------------*/
-/*                       Processing file ACLAPI.h                       */
-/*----------------------------------------------------------------------*/
-
-DWORD
-qxeGetNamedSecurityInfo (IN  Extbyte * pObjectName, IN  SE_OBJECT_TYPE ObjectType, IN  SECURITY_INFORMATION SecurityInfo, OUT PSID                 * ppsidOowner, OUT PSID                 * ppsidGroup, OUT PACL                 * ppDacl, OUT PACL                 * ppSacl, OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor)
-{
-  if (XEUNICODE_P)
-    return GetNamedSecurityInfoW ((IN  LPWSTR) pObjectName, ObjectType, SecurityInfo, ppsidOowner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor);
-  else
-    return GetNamedSecurityInfoA ((IN  LPSTR) pObjectName, ObjectType, SecurityInfo, ppsidOowner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor);
-}
-
+qxemciGetErrorString (MCIERROR arg1, Extbyte * arg2, UINT arg3)
+{
+  if (XEUNICODE_P)
+    return mciGetErrorStringW (arg1, (LPWSTR) arg2, arg3);
+  else
+    return mciGetErrorStringA (arg1, (LPSTR) arg2, arg3);
+}
+
--- a/src/intl-auto-encap-win32.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/intl-auto-encap-win32.h	Wed Feb 24 01:58:04 2010 -0600
@@ -3,81 +3,154 @@
 */
 
 
+/* Processing file WINCON.H */
+
+#undef FillConsoleOutputCharacter
+#define FillConsoleOutputCharacter error_split_CHAR
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetConsoleTitle
+#define GetConsoleTitle error_use_qxeGetConsoleTitle_or_GetConsoleTitleA_and_GetConsoleTitleW
+#endif
+DWORD qxeGetConsoleTitle (Extbyte * arg1, DWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef PeekConsoleInput
+#define PeekConsoleInput error_use_qxePeekConsoleInput_or_PeekConsoleInputA_and_PeekConsoleInputW
+#endif
+BOOL qxePeekConsoleInput (HANDLE arg1, PINPUT_RECORD arg2, DWORD arg3, PDWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReadConsole
+#define ReadConsole error_use_qxeReadConsole_or_ReadConsoleA_and_ReadConsoleW
+#endif
+BOOL qxeReadConsole (HANDLE arg1, PVOID arg2, DWORD arg3, PDWORD arg4, PVOID arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReadConsoleInput
+#define ReadConsoleInput error_use_qxeReadConsoleInput_or_ReadConsoleInputA_and_ReadConsoleInputW
+#endif
+BOOL qxeReadConsoleInput (HANDLE arg1, PINPUT_RECORD arg2, DWORD arg3, PDWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReadConsoleOutputCharacter
+#define ReadConsoleOutputCharacter error_use_qxeReadConsoleOutputCharacter_or_ReadConsoleOutputCharacterA_and_ReadConsoleOutputCharacterW
+#endif
+BOOL qxeReadConsoleOutputCharacter (HANDLE arg1, Extbyte * arg2, DWORD arg3, COORD arg4, PDWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReadConsoleOutput
+#define ReadConsoleOutput error_use_qxeReadConsoleOutput_or_ReadConsoleOutputA_and_ReadConsoleOutputW
+#endif
+BOOL qxeReadConsoleOutput (HANDLE arg1, PCHAR_INFO arg2, COORD arg3, COORD arg4, PSMALL_RECT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ScrollConsoleScreenBuffer
+#define ScrollConsoleScreenBuffer error_use_qxeScrollConsoleScreenBuffer_or_ScrollConsoleScreenBufferA_and_ScrollConsoleScreenBufferW
+#endif
+BOOL qxeScrollConsoleScreenBuffer (HANDLE arg1, const SMALL_RECT* arg2, const SMALL_RECT* arg3, COORD arg4, const CHAR_INFO* arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetConsoleTitle
+#define SetConsoleTitle error_use_qxeSetConsoleTitle_or_SetConsoleTitleA_and_SetConsoleTitleW
+#endif
+BOOL qxeSetConsoleTitle (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WriteConsole
+#define WriteConsole error_use_qxeWriteConsole_or_WriteConsoleA_and_WriteConsoleW
+#endif
+BOOL qxeWriteConsole (HANDLE arg1, PCVOID arg2, DWORD arg3, PDWORD arg4, PVOID arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WriteConsoleInput
+#define WriteConsoleInput error_use_qxeWriteConsoleInput_or_WriteConsoleInputA_and_WriteConsoleInputW
+#endif
+BOOL qxeWriteConsoleInput (HANDLE arg1, const INPUT_RECORD* arg2, DWORD arg3, PDWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WriteConsoleOutput
+#define WriteConsoleOutput error_use_qxeWriteConsoleOutput_or_WriteConsoleOutputA_and_WriteConsoleOutputW
+#endif
+BOOL qxeWriteConsoleOutput (HANDLE arg1, const CHAR_INFO* arg2, COORD arg3, COORD arg4, PSMALL_RECT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WriteConsoleOutputCharacter
+#define WriteConsoleOutputCharacter error_use_qxeWriteConsoleOutputCharacter_or_WriteConsoleOutputCharacterA_and_WriteConsoleOutputCharacterW
+#endif
+BOOL qxeWriteConsoleOutputCharacter (HANDLE arg1, const Extbyte * arg2, DWORD arg3, COORD arg4, PDWORD arg5);
+
+
 /* Processing file SHELLAPI.H */
 
+#undef CommandLineToArgv
+#define CommandLineToArgv error_Unicode_only
+
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef DragQueryFile
 #define DragQueryFile error_use_qxeDragQueryFile_or_DragQueryFileA_and_DragQueryFileW
 #endif
-UINT  qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ShellExecute
-#define ShellExecute error_use_qxeShellExecute_or_ShellExecuteA_and_ShellExecuteW
-#endif
-HINSTANCE  qxeShellExecute (HWND hwnd, const Extbyte * lpOperation, const Extbyte * lpFile, const Extbyte * lpParameters, const Extbyte * lpDirectory, INT nShowCmd);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindExecutable
-#define FindExecutable error_use_qxeFindExecutable_or_FindExecutableA_and_FindExecutableW
-#endif
-HINSTANCE  qxeFindExecutable (const Extbyte * lpFile, const Extbyte * lpDirectory, Extbyte * lpResult);
-
-#undef CommandLineToArgv
-#define CommandLineToArgv error_Unicode_only
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ShellAbout
-#define ShellAbout error_use_qxeShellAbout_or_ShellAboutA_and_ShellAboutW
-#endif
-INT        qxeShellAbout (HWND hWnd, const Extbyte * szApp, const Extbyte * szOtherStuff, HICON hIcon);
+UINT qxeDragQueryFile (HDROP arg1, UINT arg2, Extbyte * arg3, UINT arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef ExtractAssociatedIcon
 #define ExtractAssociatedIcon error_use_qxeExtractAssociatedIcon_or_ExtractAssociatedIconA_and_ExtractAssociatedIconW
 #endif
-HICON      qxeExtractAssociatedIcon (HINSTANCE hInst, Extbyte * lpIconPath, LPWORD lpiIcon);
+HICON qxeExtractAssociatedIcon (HINSTANCE arg1, Extbyte * arg2, LPWORD arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef ExtractIcon
 #define ExtractIcon error_use_qxeExtractIcon_or_ExtractIconA_and_ExtractIconW
 #endif
-HICON      qxeExtractIcon (HINSTANCE hInst, const Extbyte * lpszExeFileName, UINT nIconIndex);
-
-#if !defined (CYGWIN_HEADERS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DoEnvironmentSubst
-#define DoEnvironmentSubst error_use_qxeDoEnvironmentSubst_or_DoEnvironmentSubstA_and_DoEnvironmentSubstW
-#endif
-DWORD    qxeDoEnvironmentSubst (Extbyte * szString, UINT cbString);
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#undef FindEnvironmentString
-#define FindEnvironmentString error_causes_link_error__NT_4_0__only
-
-/* Skipping ExtractIconEx because NT 4.0+ only, error in Cygwin prototype */
+HICON qxeExtractIcon (HINSTANCE arg1, const Extbyte * arg2, UINT arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ExtractIconEx
+#define ExtractIconEx error_use_qxeExtractIconEx_or_ExtractIconExA_and_ExtractIconExW
+#endif
+UINT qxeExtractIconEx (const Extbyte * arg1, int arg2, HICON* arg3, HICON* arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindExecutable
+#define FindExecutable error_use_qxeFindExecutable_or_FindExecutableA_and_FindExecutableW
+#endif
+HINSTANCE qxeFindExecutable (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3);
+
+#undef Shell_NotifyIcon
+#define Shell_NotifyIcon error_split_sized_NOTIFYICONDATA__NT_4_0__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ShellAbout
+#define ShellAbout error_use_qxeShellAbout_or_ShellAboutA_and_ShellAboutW
+#endif
+int qxeShellAbout (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, HICON arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ShellExecute
+#define ShellExecute error_use_qxeShellExecute_or_ShellExecuteA_and_ShellExecuteW
+#endif
+HINSTANCE qxeShellExecute (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4, const Extbyte * arg5, INT arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ShellExecuteEx
+#define ShellExecuteEx error_use_qxeShellExecuteEx_or_ShellExecuteExA_and_ShellExecuteExW
+#endif
+BOOL qxeShellExecuteEx (LPSHELLEXECUTEINFOW arg1);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef SHFileOperation
 #define SHFileOperation error_use_qxeSHFileOperation_or_SHFileOperationA_and_SHFileOperationW
 #endif
-int qxeSHFileOperation (LPSHFILEOPSTRUCTW lpFileOp);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ShellExecuteEx
-#define ShellExecuteEx error_use_qxeShellExecuteEx_or_ShellExecuteExA_and_ShellExecuteExW
-#endif
-BOOL qxeShellExecuteEx (LPSHELLEXECUTEINFOW lpExecInfo);
-
-#undef WinExecError
-#define WinExecError error_causes_link_error__NT_4_0__only
+int qxeSHFileOperation (LPSHFILEOPSTRUCTW arg1);
+
+/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */
 
 #if !defined (CYGWIN_HEADERS)
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef SHQueryRecycleBin
 #define SHQueryRecycleBin error_use_qxeSHQueryRecycleBin_or_SHQueryRecycleBinA_and_SHQueryRecycleBinW
 #endif
-HRESULT qxeSHQueryRecycleBin (const Extbyte * pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo);
+HRESULT qxeSHQueryRecycleBin (const Extbyte * arg1, LPSHQUERYRBINFO arg2);
 #endif /* !defined (CYGWIN_HEADERS) */
 
 #if !defined (CYGWIN_HEADERS)
@@ -85,56 +158,167 @@
 #undef SHEmptyRecycleBin
 #define SHEmptyRecycleBin error_use_qxeSHEmptyRecycleBin_or_SHEmptyRecycleBinA_and_SHEmptyRecycleBinW
 #endif
-HRESULT qxeSHEmptyRecycleBin (HWND hwnd, const Extbyte * pszRootPath, DWORD dwFlags);
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#undef Shell_NotifyIcon
-#define Shell_NotifyIcon error_split_sized_NOTIFYICONDATA__NT_4_0__only
-
-/* Skipping SHGetFileInfo because split-sized SHFILEINFO, NT 4.0+ only */
-
-#undef SHGetDiskFreeSpace
-#define SHGetDiskFreeSpace error_causes_link_error__NT_4_0__only
-
-#if !defined (CYGWIN_HEADERS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SHGetNewLinkInfo
-#define SHGetNewLinkInfo error_use_qxeSHGetNewLinkInfo_or_SHGetNewLinkInfoA_and_SHGetNewLinkInfoW
-#endif
-BOOL qxeSHGetNewLinkInfo (const Extbyte * pszLinkTo, const Extbyte * pszDir, Extbyte * pszName, BOOL * pfMustCopy, UINT uFlags);
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#if !defined (CYGWIN_HEADERS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SHInvokePrinterCommand
-#define SHInvokePrinterCommand error_use_qxeSHInvokePrinterCommand_or_SHInvokePrinterCommandA_and_SHInvokePrinterCommandW
-#endif
-BOOL qxeSHInvokePrinterCommand (HWND hwnd, UINT uAction, const Extbyte * lpBuf1, const Extbyte * lpBuf2, BOOL fModal);
+HRESULT qxeSHEmptyRecycleBin (HWND arg1, const Extbyte * arg2, DWORD arg3);
 #endif /* !defined (CYGWIN_HEADERS) */
 
 
 /* Processing file WINSPOOL.H */
 
 #if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef EnumPrinters
-#define EnumPrinters error_use_qxeEnumPrinters_or_EnumPrintersA_and_EnumPrintersW
-#endif
-BOOL qxeEnumPrinters (DWORD Flags, Extbyte * Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned);
+#undef AddForm
+#define AddForm error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddJob
+#define AddJob error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddMonitor
+#define AddMonitor error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddPort
+#define AddPort error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddPrinter
+#define AddPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddPrinterConnection
+#define AddPrinterConnection error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddPrinterDriver
+#define AddPrinterDriver error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddPrintProcessor
+#define AddPrintProcessor error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddPrintProvidor
+#define AddPrintProvidor error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AdvancedDocumentProperties
+#define AdvancedDocumentProperties error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef ConfigurePort
+#define ConfigurePort error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeleteForm
+#define DeleteForm error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeleteMonitor
+#define DeleteMonitor error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeletePort
+#define DeletePort error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeletePrinterConnection
+#define DeletePrinterConnection error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-/* Skipping OpenPrinter because split-sized DEVMODE pointer in split PRINTER_DEFAULTS */
+#undef DeletePrinterData
+#define DeletePrinterData error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeletePrinterDriver
+#define DeletePrinterDriver error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeletePrintProcessor
+#define DeletePrintProcessor error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef DeletePrintProvidor
+#define DeletePrintProvidor error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping DocumentProperties because split-sized DEVMODE, error in Cygwin prototype */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumForms
+#define EnumForms error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumJobs
+#define EnumJobs error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumMonitors
+#define EnumMonitors error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef ResetPrinter
-#define ResetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_DEFAULTS
+#undef EnumPorts
+#define EnumPorts error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumPrinterData
+#define EnumPrinterData error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumPrinterDrivers
+#define EnumPrinterDrivers error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef SetJob
-#define SetJob error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef EnumPrinters
+#define EnumPrinters error_use_qxeEnumPrinters_or_EnumPrintersA_and_EnumPrintersW
+#endif
+BOOL qxeEnumPrinters (DWORD arg1, Extbyte * arg2, DWORD arg3, PBYTE arg4, DWORD arg5, PDWORD arg6, PDWORD arg7);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumPrintProcessorDatatypes
+#define EnumPrintProcessorDatatypes error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumPrintProcessors
+#define EnumPrintProcessors error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef GetDefaultPrinter
+#define GetDefaultPrinter error_Function_needs_review_to_determine_how_to_handle_it
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef GetForm
+#define GetForm error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -143,38 +327,13 @@
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef EnumJobs
-#define EnumJobs error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef AddPrinter
-#define AddPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef SetPrinter
-#define SetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
 #undef GetPrinter
 #define GetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef AddPrinterDriver
-#define AddPrinterDriver error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef AddPrinterDriverEx
-#define AddPrinterDriverEx error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef EnumPrinterDrivers
-#define EnumPrinterDrivers error_not_used__complicated_interface_with_split_structures
+#undef GetPrinterData
+#define GetPrinterData error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -188,122 +347,12 @@
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef DeletePrinterDriver
-#define DeletePrinterDriver error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeletePrinterDriverEx
-#define DeletePrinterDriverEx error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef AddPerMachineConnection
-#define AddPerMachineConnection error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeletePerMachineConnection
-#define DeletePerMachineConnection error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef EnumPerMachineConnections
-#define EnumPerMachineConnections error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef AddPrintProcessor
-#define AddPrintProcessor error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef EnumPrintProcessors
-#define EnumPrintProcessors error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
 #undef GetPrintProcessorDirectory
 #define GetPrintProcessorDirectory error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef EnumPrintProcessorDatatypes
-#define EnumPrintProcessorDatatypes error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeletePrintProcessor
-#define DeletePrintProcessor error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef StartDocPrinter
-#define StartDocPrinter error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef AddJob
-#define AddJob error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-/* Skipping DocumentProperties because split-sized DEVMODE, error in Cygwin prototype */
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef AdvancedDocumentProperties
-#define AdvancedDocumentProperties error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef GetPrinterData
-#define GetPrinterData error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef GetPrinterDataEx
-#define GetPrinterDataEx error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef EnumPrinterData
-#define EnumPrinterData error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef EnumPrinterDataEx
-#define EnumPrinterDataEx error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef EnumPrinterKey
-#define EnumPrinterKey error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef SetPrinterData
-#define SetPrinterData error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef SetPrinterDataEx
-#define SetPrinterDataEx error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeletePrinterData
-#define DeletePrinterData error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeletePrinterDataEx
-#define DeletePrinterDataEx error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeletePrinterKey
-#define DeletePrinterKey error_not_used__complicated_interface_with_split_structures
+/* Skipping OpenPrinter because split-sized DEVMODE pointer in split PRINTER_DEFAULTS */
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -312,18 +361,8 @@
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef AddForm
-#define AddForm error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef DeleteForm
-#define DeleteForm error_not_used__complicated_interface_with_split_structures
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#undef GetForm
-#define GetForm error_not_used__complicated_interface_with_split_structures
+#undef ResetPrinter
+#define ResetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_DEFAULTS
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -332,232 +371,434 @@
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef EnumForms
-#define EnumForms error_not_used__complicated_interface_with_split_structures
+#undef SetJob
+#define SetJob error_split_sized_DEVMODE_pointer_in_split_JOB_INFO_2
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef SetPrinter
+#define SetPrinter error_split_sized_DEVMODE_pointer_in_split_PRINTER_INFO_2
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef SetPrinterData
+#define SetPrinterData error_not_used__complicated_interface_with_split_structures
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef EnumMonitors
-#define EnumMonitors error_not_used__complicated_interface_with_split_structures
+#undef StartDocPrinter
+#define StartDocPrinter error_not_used__complicated_interface_with_split_structures
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+
+/* Processing file WINNETWK.H */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetAddConnection
+#define WNetAddConnection error_use_qxeWNetAddConnection_or_WNetAddConnectionA_and_WNetAddConnectionW
+#endif
+DWORD  qxeWNetAddConnection (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef AddMonitor
-#define AddMonitor error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetAddConnection2
+#define WNetAddConnection2 error_use_qxeWNetAddConnection2_or_WNetAddConnection2A_and_WNetAddConnection2W
+#endif
+DWORD  qxeWNetAddConnection2 (LPNETRESOURCEW arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef DeleteMonitor
-#define DeleteMonitor error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetAddConnection3
+#define WNetAddConnection3 error_use_qxeWNetAddConnection3_or_WNetAddConnection3A_and_WNetAddConnection3W
+#endif
+DWORD  qxeWNetAddConnection3 (HWND arg1, LPNETRESOURCEW arg2, const Extbyte * arg3, const Extbyte * arg4, DWORD arg5);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetCancelConnection
+#define WNetCancelConnection error_use_qxeWNetCancelConnection_or_WNetCancelConnectionA_and_WNetCancelConnectionW
+#endif
+DWORD  qxeWNetCancelConnection (const Extbyte * arg1, BOOL arg2);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef EnumPorts
-#define EnumPorts error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetCancelConnection2
+#define WNetCancelConnection2 error_use_qxeWNetCancelConnection2_or_WNetCancelConnection2A_and_WNetCancelConnection2W
+#endif
+DWORD  qxeWNetCancelConnection2 (const Extbyte * arg1, DWORD arg2, BOOL arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef AddPort
-#define AddPort error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetGetConnection
+#define WNetGetConnection error_use_qxeWNetGetConnection_or_WNetGetConnectionA_and_WNetGetConnectionW
+#endif
+DWORD  qxeWNetGetConnection (const Extbyte * arg1, Extbyte * arg2, PDWORD arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef ConfigurePort
-#define ConfigurePort error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetUseConnection
+#define WNetUseConnection error_use_qxeWNetUseConnection_or_WNetUseConnectionA_and_WNetUseConnectionW
+#endif
+DWORD  qxeWNetUseConnection (HWND arg1, LPNETRESOURCEW arg2, const Extbyte * arg3, const Extbyte * arg4, DWORD arg5, Extbyte * arg6, PDWORD arg7, PDWORD arg8);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef WNetSetConnection
+#define WNetSetConnection error_Function_needs_review_to_determine_how_to_handle_it
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef DeletePort
-#define DeletePort error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetConnectionDialog1
+#define WNetConnectionDialog1 error_use_qxeWNetConnectionDialog1_or_WNetConnectionDialog1A_and_WNetConnectionDialog1W
+#endif
+DWORD  qxeWNetConnectionDialog1 (LPCONNECTDLGSTRUCTW arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetDisconnectDialog1
+#define WNetDisconnectDialog1 error_use_qxeWNetDisconnectDialog1_or_WNetDisconnectDialog1A_and_WNetDisconnectDialog1W
+#endif
+DWORD  qxeWNetDisconnectDialog1 (LPDISCDLGSTRUCTW arg1);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef XcvData
-#define XcvData error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetOpenEnum
+#define WNetOpenEnum error_use_qxeWNetOpenEnum_or_WNetOpenEnumA_and_WNetOpenEnumW
+#endif
+DWORD  qxeWNetOpenEnum (DWORD arg1, DWORD arg2, DWORD arg3, LPNETRESOURCEW arg4, LPHANDLE arg5);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef SetPort
-#define SetPort error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetEnumResource
+#define WNetEnumResource error_use_qxeWNetEnumResource_or_WNetEnumResourceA_and_WNetEnumResourceW
+#endif
+DWORD  qxeWNetEnumResource (HANDLE arg1, PDWORD arg2, PVOID arg3, PDWORD arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef AddPrinterConnection
-#define AddPrinterConnection error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetGetUniversalName
+#define WNetGetUniversalName error_use_qxeWNetGetUniversalName_or_WNetGetUniversalNameA_and_WNetGetUniversalNameW
+#endif
+DWORD  qxeWNetGetUniversalName (const Extbyte * arg1, DWORD arg2, PVOID arg3, PDWORD arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef DeletePrinterConnection
-#define DeletePrinterConnection error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetGetUser
+#define WNetGetUser error_use_qxeWNetGetUser_or_WNetGetUserA_and_WNetGetUserW
+#endif
+DWORD  qxeWNetGetUser (const Extbyte * arg1, Extbyte * arg2, PDWORD arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef AddPrintProvidor
-#define AddPrintProvidor error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetGetProviderName
+#define WNetGetProviderName error_use_qxeWNetGetProviderName_or_WNetGetProviderNameA_and_WNetGetProviderNameW
+#endif
+DWORD  qxeWNetGetProviderName (DWORD arg1, Extbyte * arg2, PDWORD arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetGetNetworkInformation
+#define WNetGetNetworkInformation error_use_qxeWNetGetNetworkInformation_or_WNetGetNetworkInformationA_and_WNetGetNetworkInformationW
+#endif
+DWORD  qxeWNetGetNetworkInformation (const Extbyte * arg1, LPNETINFOSTRUCT arg2);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef DeletePrintProvidor
-#define DeletePrintProvidor error_not_used__complicated_interface_with_split_structures
+#undef WNetGetResourceInformation
+#define WNetGetResourceInformation error_Function_needs_review_to_determine_how_to_handle_it
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef WNetGetResourceParent
+#define WNetGetResourceParent error_Function_needs_review_to_determine_how_to_handle_it
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef SetPrinterHTMLView
-#define SetPrinterHTMLView error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WNetGetLastError
+#define WNetGetLastError error_use_qxeWNetGetLastError_or_WNetGetLastErrorA_and_WNetGetLastErrorW
+#endif
+DWORD  qxeWNetGetLastError (PDWORD arg1, Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
-#undef GetPrinterHTMLView
-#define GetPrinterHTMLView error_not_used__complicated_interface_with_split_structures
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MultinetGetConnectionPerformance
+#define MultinetGetConnectionPerformance error_use_qxeMultinetGetConnectionPerformance_or_MultinetGetConnectionPerformanceA_and_MultinetGetConnectionPerformanceW
+#endif
+DWORD  qxeMultinetGetConnectionPerformance (LPNETRESOURCEW arg1, LPNETCONNECTINFOSTRUCT arg2);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 
 /* Processing file WINUSER.H */
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef wvsprintf
-#define wvsprintf error_use_qxewvsprintf_or_wvsprintfA_and_wvsprintfW
-#endif
-int qxewvsprintf (Extbyte * arg1, const Extbyte * arg2, va_list arglist);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadKeyboardLayout
-#define LoadKeyboardLayout error_use_qxeLoadKeyboardLayout_or_LoadKeyboardLayoutA_and_LoadKeyboardLayoutW
-#endif
-HKL qxeLoadKeyboardLayout (const Extbyte * pwszKLID, UINT Flags);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetKeyboardLayoutName
-#define GetKeyboardLayoutName error_use_qxeGetKeyboardLayoutName_or_GetKeyboardLayoutNameA_and_GetKeyboardLayoutNameW
-#endif
-BOOL qxeGetKeyboardLayoutName (Extbyte * pwszKLID);
+#undef AppendMenu
+#define AppendMenu error_use_qxeAppendMenu_or_AppendMenuA_and_AppendMenuW
+#endif
+BOOL qxeAppendMenu (HMENU arg1, UINT arg2, UINT_PTR arg3, const Extbyte * arg4);
+
+#undef BroadcastSystemMessage
+#define BroadcastSystemMessage error_win95_version_not_split__NT_4_0__only
+
+#undef BroadcastSystemMessageEx
+#define BroadcastSystemMessageEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#if !defined (CYGWIN_HEADERS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CallMsgFilter
+#define CallMsgFilter error_use_qxeCallMsgFilter_or_CallMsgFilterA_and_CallMsgFilterW
+#endif
+BOOL qxeCallMsgFilter (LPMSG arg1, INT arg2);
+#endif /* !defined (CYGWIN_HEADERS) */
+
+#undef CallWindowProc
+#define CallWindowProc error_two_versions__STRICT_and_non_STRICT
+
+#undef ChangeDisplaySettings
+#define ChangeDisplaySettings error_split_sized_LPDEVMODE
+
+#undef ChangeDisplaySettingsEx
+#define ChangeDisplaySettingsEx error_split_sized_LPDEVMODE__NT_5_0_Win98__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ChangeMenu
+#define ChangeMenu error_use_qxeChangeMenu_or_ChangeMenuA_and_ChangeMenuW
+#endif
+BOOL qxeChangeMenu (HMENU arg1, UINT arg2, const Extbyte * arg3, UINT arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharLower
+#define CharLower error_use_qxeCharLower_or_CharLowerA_and_CharLowerW
+#endif
+Extbyte * qxeCharLower (Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharLowerBuff
+#define CharLowerBuff error_use_qxeCharLowerBuff_or_CharLowerBuffA_and_CharLowerBuffW
+#endif
+DWORD qxeCharLowerBuff (Extbyte * arg1, DWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharNext
+#define CharNext error_use_qxeCharNext_or_CharNextA_and_CharNextW
+#endif
+Extbyte * qxeCharNext (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharPrev
+#define CharPrev error_use_qxeCharPrev_or_CharPrevA_and_CharPrevW
+#endif
+Extbyte * qxeCharPrev (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharToOem
+#define CharToOem error_use_qxeCharToOem_or_CharToOemA_and_CharToOemW
+#endif
+BOOL qxeCharToOem (const Extbyte * arg1, LPSTR arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharToOemBuff
+#define CharToOemBuff error_use_qxeCharToOemBuff_or_CharToOemBuffA_and_CharToOemBuffW
+#endif
+BOOL qxeCharToOemBuff (const Extbyte * arg1, LPSTR arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharUpper
+#define CharUpper error_use_qxeCharUpper_or_CharUpperA_and_CharUpperW
+#endif
+Extbyte * qxeCharUpper (Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CharUpperBuff
+#define CharUpperBuff error_use_qxeCharUpperBuff_or_CharUpperBuffA_and_CharUpperBuffW
+#endif
+DWORD qxeCharUpperBuff (Extbyte * arg1, DWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CopyAcceleratorTable
+#define CopyAcceleratorTable error_use_qxeCopyAcceleratorTable_or_CopyAcceleratorTableA_and_CopyAcceleratorTableW
+#endif
+int qxeCopyAcceleratorTable (HACCEL arg1, LPACCEL arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateAcceleratorTable
+#define CreateAcceleratorTable error_use_qxeCreateAcceleratorTable_or_CreateAcceleratorTableA_and_CreateAcceleratorTableW
+#endif
+HACCEL qxeCreateAcceleratorTable (LPACCEL arg1, int arg2);
 
 #undef CreateDesktop
 #define CreateDesktop error_split_sized_LPDEVMODE
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenDesktop
-#define OpenDesktop error_use_qxeOpenDesktop_or_OpenDesktopA_and_OpenDesktopW
-#endif
-HDESK qxeOpenDesktop (Extbyte * lpszDesktop, DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess);
+#undef CreateDialogIndirectParam
+#define CreateDialogIndirectParam error_use_qxeCreateDialogIndirectParam_or_CreateDialogIndirectParamA_and_CreateDialogIndirectParamW
+#endif
+HWND qxeCreateDialogIndirectParam (HINSTANCE arg1, LPCDLGTEMPLATE arg2, HWND arg3, DLGPROC arg4, LPARAM arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateDialogParam
+#define CreateDialogParam error_use_qxeCreateDialogParam_or_CreateDialogParamA_and_CreateDialogParamW
+#endif
+HWND qxeCreateDialogParam (HINSTANCE arg1, const Extbyte * arg2, HWND arg3, DLGPROC arg4, LPARAM arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateMDIWindow
+#define CreateMDIWindow error_use_qxeCreateMDIWindow_or_CreateMDIWindowA_and_CreateMDIWindowW
+#endif
+HWND qxeCreateMDIWindow (Extbyte * arg1, Extbyte * arg2, DWORD arg3, int arg4, int arg5, int arg6, int arg7, HWND arg8, HINSTANCE arg9, LPARAM arg10);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateWindowEx
+#define CreateWindowEx error_use_qxeCreateWindowEx_or_CreateWindowExA_and_CreateWindowExW
+#endif
+HWND qxeCreateWindowEx (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4, int arg5, int arg6, int arg7, int arg8, HWND arg9, HMENU arg10, HINSTANCE arg11, LPVOID arg12);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateWindowStation
+#define CreateWindowStation error_use_qxeCreateWindowStation_or_CreateWindowStationA_and_CreateWindowStationW
+#endif
+HWINSTA qxeCreateWindowStation (Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4);
+
+#undef DefDlgProc
+#define DefDlgProc error_return_value_is_conditionalized_on__MAC__messes_up_parser
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DefFrameProc
+#define DefFrameProc error_use_qxeDefFrameProc_or_DefFrameProcA_and_DefFrameProcW
+#endif
+LRESULT qxeDefFrameProc (HWND arg1, HWND arg2, UINT arg3, WPARAM arg4, LPARAM arg5);
+
+#undef DefMDIChildProc
+#define DefMDIChildProc error_return_value_is_conditionalized_on__MAC__messes_up_parser
+
+/* Skipping DefWindowProc because return value is conditionalized on _MAC, messes up parser */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DialogBoxIndirectParam
+#define DialogBoxIndirectParam error_use_qxeDialogBoxIndirectParam_or_DialogBoxIndirectParamA_and_DialogBoxIndirectParamW
+#endif
+int qxeDialogBoxIndirectParam (HINSTANCE arg1, LPCDLGTEMPLATE arg2, HWND arg3, DLGPROC arg4, LPARAM arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DialogBoxParam
+#define DialogBoxParam error_use_qxeDialogBoxParam_or_DialogBoxParamA_and_DialogBoxParamW
+#endif
+int qxeDialogBoxParam (HINSTANCE arg1, const Extbyte * arg2, HWND arg3, DLGPROC arg4, LPARAM arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DispatchMessage
+#define DispatchMessage error_use_qxeDispatchMessage_or_DispatchMessageA_and_DispatchMessageW
+#endif
+LONG qxeDispatchMessage (const MSG* arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DlgDirList
+#define DlgDirList error_use_qxeDlgDirList_or_DlgDirListA_and_DlgDirListW
+#endif
+int qxeDlgDirList (HWND arg1, Extbyte * arg2, int arg3, int arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DlgDirListComboBox
+#define DlgDirListComboBox error_use_qxeDlgDirListComboBox_or_DlgDirListComboBoxA_and_DlgDirListComboBoxW
+#endif
+int qxeDlgDirListComboBox (HWND arg1, Extbyte * arg2, int arg3, int arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DlgDirSelectComboBoxEx
+#define DlgDirSelectComboBoxEx error_use_qxeDlgDirSelectComboBoxEx_or_DlgDirSelectComboBoxExA_and_DlgDirSelectComboBoxExW
+#endif
+BOOL qxeDlgDirSelectComboBoxEx (HWND arg1, Extbyte * arg2, int arg3, int arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DlgDirSelectEx
+#define DlgDirSelectEx error_use_qxeDlgDirSelectEx_or_DlgDirSelectExA_and_DlgDirSelectExW
+#endif
+BOOL qxeDlgDirSelectEx (HWND arg1, Extbyte * arg2, int arg3, int arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DrawState
+#define DrawState error_use_qxeDrawState_or_DrawStateA_and_DrawStateW
+#endif
+BOOL qxeDrawState (HDC arg1, HBRUSH arg2, DRAWSTATEPROC arg3, LPARAM arg4, WPARAM arg5, int arg6, int arg7, int arg8, int arg9, UINT arg10);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DrawText
+#define DrawText error_use_qxeDrawText_or_DrawTextA_and_DrawTextW
+#endif
+int qxeDrawText (HDC arg1, const Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DrawTextEx
+#define DrawTextEx error_use_qxeDrawTextEx_or_DrawTextExA_and_DrawTextExW
+#endif
+int qxeDrawTextEx (HDC arg1, Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5, LPDRAWTEXTPARAMS arg6);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef EnumDesktops
 #define EnumDesktops error_use_qxeEnumDesktops_or_EnumDesktopsA_and_EnumDesktopsW
 #endif
-BOOL qxeEnumDesktops (HWINSTA hwinsta, DESKTOPENUMPROCW lpEnumFunc, LPARAM lParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateWindowStation
-#define CreateWindowStation error_use_qxeCreateWindowStation_or_CreateWindowStationA_and_CreateWindowStationW
-#endif
-HWINSTA qxeCreateWindowStation (Extbyte * lpwinsta, DWORD dwReserved, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenWindowStation
-#define OpenWindowStation error_use_qxeOpenWindowStation_or_OpenWindowStationA_and_OpenWindowStationW
-#endif
-HWINSTA qxeOpenWindowStation (Extbyte * lpszWinSta, BOOL fInherit, ACCESS_MASK dwDesiredAccess);
+BOOL qxeEnumDesktops (HWINSTA arg1, DESKTOPENUMPROCW arg2, LPARAM arg3);
+
+#undef EnumDisplaySettings
+#define EnumDisplaySettings error_split_sized_LPDEVMODE
+
+#undef EnumDisplaySettingsEx
+#define EnumDisplaySettingsEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef EnumDisplayDevices
+#define EnumDisplayDevices error_split_sized_PDISPLAY_DEVICE__NT_5_0__only__no_Win98
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef EnumProps
+#define EnumProps error_use_qxeEnumProps_or_EnumPropsA_and_EnumPropsW
+#endif
+int qxeEnumProps (HWND arg1, PROPENUMPROCW arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef EnumPropsEx
+#define EnumPropsEx error_use_qxeEnumPropsEx_or_EnumPropsExA_and_EnumPropsExW
+#endif
+int qxeEnumPropsEx (HWND arg1, PROPENUMPROCEXW arg2, LPARAM arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef EnumWindowStations
 #define EnumWindowStations error_use_qxeEnumWindowStations_or_EnumWindowStationsA_and_EnumWindowStationsW
 #endif
-BOOL qxeEnumWindowStations (WINSTAENUMPROCW lpEnumFunc, LPARAM lParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetUserObjectInformation
-#define GetUserObjectInformation error_use_qxeGetUserObjectInformation_or_GetUserObjectInformationA_and_GetUserObjectInformationW
-#endif
-BOOL qxeGetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength, LPDWORD lpnLengthNeeded);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetUserObjectInformation
-#define SetUserObjectInformation error_use_qxeSetUserObjectInformation_or_SetUserObjectInformationA_and_SetUserObjectInformationW
-#endif
-BOOL qxeSetUserObjectInformation (HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegisterWindowMessage
-#define RegisterWindowMessage error_use_qxeRegisterWindowMessage_or_RegisterWindowMessageA_and_RegisterWindowMessageW
-#endif
-UINT qxeRegisterWindowMessage (const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetMessage
-#define GetMessage error_use_qxeGetMessage_or_GetMessageA_and_GetMessageW
-#endif
-BOOL qxeGetMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DispatchMessage
-#define DispatchMessage error_use_qxeDispatchMessage_or_DispatchMessageA_and_DispatchMessageW
-#endif
-LONG qxeDispatchMessage (CONST MSG * lpMsg);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef PeekMessage
-#define PeekMessage error_use_qxePeekMessage_or_PeekMessageA_and_PeekMessageW
-#endif
-BOOL qxePeekMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
-
-/* Skipping SendMessage because split messages and structures */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SendMessageTimeout
-#define SendMessageTimeout error_use_qxeSendMessageTimeout_or_SendMessageTimeoutA_and_SendMessageTimeoutW
-#endif
-LRESULT qxeSendMessageTimeout (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, LPDWORD lpdwResult);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SendNotifyMessage
-#define SendNotifyMessage error_use_qxeSendNotifyMessage_or_SendNotifyMessageA_and_SendNotifyMessageW
-#endif
-BOOL qxeSendNotifyMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SendMessageCallback
-#define SendMessageCallback error_use_qxeSendMessageCallback_or_SendMessageCallbackA_and_SendMessageCallbackW
-#endif
-BOOL qxeSendMessageCallback (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpResultCallBack, DWORD dwData);
-
-#undef BroadcastSystemMessage
-#define BroadcastSystemMessage error_win95_version_not_split__NT_4_0__only
-
-#undef RegisterDeviceNotification
-#define RegisterDeviceNotification error_NT_5_0__only
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef PostMessage
-#define PostMessage error_use_qxePostMessage_or_PostMessageA_and_PostMessageW
-#endif
-BOOL qxePostMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef PostThreadMessage
-#define PostThreadMessage error_use_qxePostThreadMessage_or_PostThreadMessageA_and_PostThreadMessageW
-#endif
-BOOL qxePostThreadMessage (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam);
-
-/* Skipping DefWindowProc because return value is conditionalized on _MAC, messes up parser */
-
-#undef CallWindowProc
-#define CallWindowProc error_two_versions__STRICT_and_non_STRICT
-
-#undef CallWindowProc
-#define CallWindowProc error_two_versions__STRICT_and_non_STRICT
-
-/* Skipping RegisterClass because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS */
-
-/* Skipping UnregisterClass because need to intercept for reasons related to RegisterClass */
+BOOL qxeEnumWindowStations (WINSTAENUMPROCW arg1, LPARAM arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindWindowEx
+#define FindWindowEx error_use_qxeFindWindowEx_or_FindWindowExA_and_FindWindowExW
+#endif
+HWND qxeFindWindowEx (HWND arg1, HWND arg2, const Extbyte * arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindWindow
+#define FindWindow error_use_qxeFindWindow_or_FindWindowA_and_FindWindowW
+#endif
+HWND qxeFindWindow (const Extbyte * arg1, const Extbyte * arg2);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef GetClassInfo
 #define GetClassInfo error_use_qxeGetClassInfo_or_GetClassInfoA_and_GetClassInfoW
 #endif
-BOOL qxeGetClassInfo (HINSTANCE hInstance, const Extbyte * lpClassName, LPWNDCLASSW lpWndClass);
-
-/* Skipping RegisterClassEx because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only */
+BOOL qxeGetClassInfo (HINSTANCE arg1, const Extbyte * arg2, LPWNDCLASSW arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef GetClassInfoEx
@@ -566,236 +807,124 @@
 BOOL qxeGetClassInfoEx (HINSTANCE arg1, const Extbyte * arg2, LPWNDCLASSEXW arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateWindowEx
-#define CreateWindowEx error_use_qxeCreateWindowEx_or_CreateWindowExA_and_CreateWindowExW
-#endif
-HWND qxeCreateWindowEx (DWORD dwExStyle, const Extbyte * lpClassName, const Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateDialogParam
-#define CreateDialogParam error_use_qxeCreateDialogParam_or_CreateDialogParamA_and_CreateDialogParamW
-#endif
-HWND qxeCreateDialogParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateDialogIndirectParam
-#define CreateDialogIndirectParam error_use_qxeCreateDialogIndirectParam_or_CreateDialogIndirectParamA_and_CreateDialogIndirectParamW
-#endif
-HWND qxeCreateDialogIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DialogBoxParam
-#define DialogBoxParam error_use_qxeDialogBoxParam_or_DialogBoxParamA_and_DialogBoxParamW
-#endif
-int qxeDialogBoxParam (HINSTANCE hInstance, const Extbyte * lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DialogBoxIndirectParam
-#define DialogBoxIndirectParam error_use_qxeDialogBoxIndirectParam_or_DialogBoxIndirectParamA_and_DialogBoxIndirectParamW
-#endif
-int qxeDialogBoxIndirectParam (HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetDlgItemText
-#define SetDlgItemText error_use_qxeSetDlgItemText_or_SetDlgItemTextA_and_SetDlgItemTextW
-#endif
-BOOL qxeSetDlgItemText (HWND hDlg, int nIDDlgItem, const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetDlgItemText
-#define GetDlgItemText error_use_qxeGetDlgItemText_or_GetDlgItemTextA_and_GetDlgItemTextW
-#endif
-UINT qxeGetDlgItemText (HWND hDlg, int nIDDlgItem, Extbyte * lpString, int nMaxCount);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SendDlgItemMessage
-#define SendDlgItemMessage error_use_qxeSendDlgItemMessage_or_SendDlgItemMessageA_and_SendDlgItemMessageW
-#endif
-LONG qxeSendDlgItemMessage (HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
-
-#undef DefDlgProc
-#define DefDlgProc error_return_value_is_conditionalized_on__MAC__messes_up_parser
-
-#if !defined (CYGWIN_HEADERS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CallMsgFilter
-#define CallMsgFilter error_use_qxeCallMsgFilter_or_CallMsgFilterA_and_CallMsgFilterW
-#endif
-BOOL qxeCallMsgFilter (LPMSG lpMsg, int nCode);
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegisterClipboardFormat
-#define RegisterClipboardFormat error_use_qxeRegisterClipboardFormat_or_RegisterClipboardFormatA_and_RegisterClipboardFormatW
-#endif
-UINT qxeRegisterClipboardFormat (const Extbyte * lpszFormat);
+#undef GetClassLong
+#define GetClassLong error_use_qxeGetClassLong_or_GetClassLongA_and_GetClassLongW
+#endif
+DWORD qxeGetClassLong (HWND arg1, int arg2);
+
+#undef GetClassLongPtr
+#define GetClassLongPtr error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetClassName
+#define GetClassName error_use_qxeGetClassName_or_GetClassNameA_and_GetClassNameW
+#endif
+int qxeGetClassName (HWND arg1, Extbyte * arg2, int arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef GetClipboardFormatName
 #define GetClipboardFormatName error_use_qxeGetClipboardFormatName_or_GetClipboardFormatNameA_and_GetClipboardFormatNameW
 #endif
-int qxeGetClipboardFormatName (UINT format, Extbyte * lpszFormatName, int cchMaxCount);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharToOem
-#define CharToOem error_use_qxeCharToOem_or_CharToOemA_and_CharToOemW
-#endif
-BOOL qxeCharToOem (const Extbyte * lpszSrc, LPSTR lpszDst);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OemToChar
-#define OemToChar error_use_qxeOemToChar_or_OemToCharA_and_OemToCharW
-#endif
-BOOL qxeOemToChar (LPCSTR lpszSrc, Extbyte * lpszDst);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharToOemBuff
-#define CharToOemBuff error_use_qxeCharToOemBuff_or_CharToOemBuffA_and_CharToOemBuffW
-#endif
-BOOL qxeCharToOemBuff (const Extbyte * lpszSrc, LPSTR lpszDst, DWORD cchDstLength);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OemToCharBuff
-#define OemToCharBuff error_use_qxeOemToCharBuff_or_OemToCharBuffA_and_OemToCharBuffW
-#endif
-BOOL qxeOemToCharBuff (LPCSTR lpszSrc, Extbyte * lpszDst, DWORD cchDstLength);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharUpper
-#define CharUpper error_use_qxeCharUpper_or_CharUpperA_and_CharUpperW
-#endif
-Extbyte * qxeCharUpper (Extbyte * lpsz);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharUpperBuff
-#define CharUpperBuff error_use_qxeCharUpperBuff_or_CharUpperBuffA_and_CharUpperBuffW
-#endif
-DWORD qxeCharUpperBuff (Extbyte * lpsz, DWORD cchLength);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharLower
-#define CharLower error_use_qxeCharLower_or_CharLowerA_and_CharLowerW
-#endif
-Extbyte * qxeCharLower (Extbyte * lpsz);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharLowerBuff
-#define CharLowerBuff error_use_qxeCharLowerBuff_or_CharLowerBuffA_and_CharLowerBuffW
-#endif
-DWORD qxeCharLowerBuff (Extbyte * lpsz, DWORD cchLength);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharNext
-#define CharNext error_use_qxeCharNext_or_CharNextA_and_CharNextW
-#endif
-Extbyte * qxeCharNext (const Extbyte * lpsz);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CharPrev
-#define CharPrev error_use_qxeCharPrev_or_CharPrevA_and_CharPrevW
-#endif
-Extbyte * qxeCharPrev (const Extbyte * lpszStart, const Extbyte * lpszCurrent);
-
-#undef IsCharAlpha
-#define IsCharAlpha error_split_CHAR
-
-#undef IsCharAlphaNumeric
-#define IsCharAlphaNumeric error_split_CHAR
-
-#undef IsCharUpper
-#define IsCharUpper error_split_CHAR
-
-#undef IsCharLower
-#define IsCharLower error_split_CHAR
+int qxeGetClipboardFormatName (UINT arg1, Extbyte * arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetDlgItemText
+#define GetDlgItemText error_use_qxeGetDlgItemText_or_GetDlgItemTextA_and_GetDlgItemTextW
+#endif
+UINT qxeGetDlgItemText (HWND arg1, int arg2, Extbyte * arg3, int arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetKeyboardLayoutName
+#define GetKeyboardLayoutName error_use_qxeGetKeyboardLayoutName_or_GetKeyboardLayoutNameA_and_GetKeyboardLayoutNameW
+#endif
+BOOL qxeGetKeyboardLayoutName (Extbyte * arg1);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef GetKeyNameText
 #define GetKeyNameText error_use_qxeGetKeyNameText_or_GetKeyNameTextA_and_GetKeyNameTextW
 #endif
-int qxeGetKeyNameText (LONG lParam, Extbyte * lpString, int nSize);
-
-/* Skipping VkKeyScan because split CHAR */
-
-#undef VkKeyScanEx
-#define VkKeyScanEx error_split_CHAR__NT_4_0__only
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MapVirtualKey
-#define MapVirtualKey error_use_qxeMapVirtualKey_or_MapVirtualKeyA_and_MapVirtualKeyW
-#endif
-UINT qxeMapVirtualKey (UINT uCode, UINT uMapType);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MapVirtualKeyEx
-#define MapVirtualKeyEx error_use_qxeMapVirtualKeyEx_or_MapVirtualKeyExA_and_MapVirtualKeyExW
-#endif
-UINT qxeMapVirtualKeyEx (UINT uCode, UINT uMapType, HKL dwhkl);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadAccelerators
-#define LoadAccelerators error_use_qxeLoadAccelerators_or_LoadAcceleratorsA_and_LoadAcceleratorsW
-#endif
-HACCEL qxeLoadAccelerators (HINSTANCE hInstance, const Extbyte * lpTableName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateAcceleratorTable
-#define CreateAcceleratorTable error_use_qxeCreateAcceleratorTable_or_CreateAcceleratorTableA_and_CreateAcceleratorTableW
-#endif
-HACCEL qxeCreateAcceleratorTable (LPACCEL arg1, int arg2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CopyAcceleratorTable
-#define CopyAcceleratorTable error_use_qxeCopyAcceleratorTable_or_CopyAcceleratorTableA_and_CopyAcceleratorTableW
-#endif
-int qxeCopyAcceleratorTable (HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef TranslateAccelerator
-#define TranslateAccelerator error_use_qxeTranslateAccelerator_or_TranslateAcceleratorA_and_TranslateAcceleratorW
-#endif
-int qxeTranslateAccelerator (HWND hWnd, HACCEL hAccTable, LPMSG lpMsg);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadMenu
-#define LoadMenu error_use_qxeLoadMenu_or_LoadMenuA_and_LoadMenuW
-#endif
-HMENU qxeLoadMenu (HINSTANCE hInstance, const Extbyte * lpMenuName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadMenuIndirect
-#define LoadMenuIndirect error_use_qxeLoadMenuIndirect_or_LoadMenuIndirectA_and_LoadMenuIndirectW
-#endif
-HMENU qxeLoadMenuIndirect (CONST MENUTEMPLATEW * lpMenuTemplate);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ChangeMenu
-#define ChangeMenu error_use_qxeChangeMenu_or_ChangeMenuA_and_ChangeMenuW
-#endif
-BOOL qxeChangeMenu (HMENU hMenu, UINT cmd, const Extbyte * lpszNewItem, UINT cmdInsert, UINT flags);
+int qxeGetKeyNameText (LONG arg1, Extbyte * arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetMenuItemInfo
+#define GetMenuItemInfo error_use_qxeGetMenuItemInfo_or_GetMenuItemInfoA_and_GetMenuItemInfoW
+#endif
+BOOL qxeGetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPMENUITEMINFOW arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef GetMenuString
 #define GetMenuString error_use_qxeGetMenuString_or_GetMenuStringA_and_GetMenuStringW
 #endif
-int qxeGetMenuString (HMENU hMenu, UINT uIDItem, Extbyte * lpString, int nMaxCount, UINT uFlag);
+int qxeGetMenuString (HMENU arg1, UINT arg2, Extbyte * arg3, int arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetMessage
+#define GetMessage error_use_qxeGetMessage_or_GetMessageA_and_GetMessageW
+#endif
+BOOL qxeGetMessage (LPMSG arg1, HWND arg2, UINT arg3, UINT arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetProp
+#define GetProp error_use_qxeGetProp_or_GetPropA_and_GetPropW
+#endif
+HANDLE qxeGetProp (HWND arg1, const Extbyte * arg2);
+
+#undef GetRawInputDeviceInfo
+#define GetRawInputDeviceInfo error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTabbedTextExtent
+#define GetTabbedTextExtent error_use_qxeGetTabbedTextExtent_or_GetTabbedTextExtentA_and_GetTabbedTextExtentW
+#endif
+DWORD qxeGetTabbedTextExtent (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetWindowLong
+#define GetWindowLong error_use_qxeGetWindowLong_or_GetWindowLongA_and_GetWindowLongW
+#endif
+LONG qxeGetWindowLong (HWND arg1, int arg2);
+
+#undef GetWindowLongPtr
+#define GetWindowLongPtr error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetUserObjectInformation
+#define GetUserObjectInformation error_use_qxeGetUserObjectInformation_or_GetUserObjectInformationA_and_GetUserObjectInformationW
+#endif
+BOOL qxeGetUserObjectInformation (HANDLE arg1, int arg2, PVOID arg3, DWORD arg4, PDWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetWindowTextLength
+#define GetWindowTextLength error_use_qxeGetWindowTextLength_or_GetWindowTextLengthA_and_GetWindowTextLengthW
+#endif
+int qxeGetWindowTextLength (HWND arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetWindowText
+#define GetWindowText error_use_qxeGetWindowText_or_GetWindowTextA_and_GetWindowTextW
+#endif
+int qxeGetWindowText (HWND arg1, Extbyte * arg2, int arg3);
+
+#undef GetAltTabInfo
+#define GetAltTabInfo error_NT_5_0__only
+
+#undef GetMonitorInfo
+#define GetMonitorInfo error_NT_5_0_Win98__only
+
+#undef GetWindowModuleFileName
+#define GetWindowModuleFileName error_NT_5_0__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GrayString
+#define GrayString error_use_qxeGrayString_or_GrayStringA_and_GrayStringW
+#endif
+BOOL qxeGrayString (HDC arg1, HBRUSH arg2, GRAYSTRINGPROC arg3, LPARAM arg4, int arg5, int arg6, int arg7, int arg8, int arg9);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef InsertMenu
 #define InsertMenu error_use_qxeInsertMenu_or_InsertMenuA_and_InsertMenuW
 #endif
-BOOL qxeInsertMenu (HMENU hMenu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef AppendMenu
-#define AppendMenu error_use_qxeAppendMenu_or_AppendMenuA_and_AppendMenuW
-#endif
-BOOL qxeAppendMenu (HMENU hMenu, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ModifyMenu
-#define ModifyMenu error_use_qxeModifyMenu_or_ModifyMenuA_and_ModifyMenuW
-#endif
-BOOL qxeModifyMenu (HMENU hMnu, UINT uPosition, UINT uFlags, UINT uIDNewItem, const Extbyte * lpNewItem);
+BOOL qxeInsertMenu (HMENU arg1, UINT arg2, UINT arg3, UINT arg4, const Extbyte * arg5);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef InsertMenuItem
@@ -803,11 +932,224 @@
 #endif
 BOOL qxeInsertMenuItem (HMENU arg1, UINT arg2, BOOL arg3, LPCMENUITEMINFOW arg4);
 
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetMenuItemInfo
-#define GetMenuItemInfo error_use_qxeGetMenuItemInfo_or_GetMenuItemInfoA_and_GetMenuItemInfoW
-#endif
-BOOL qxeGetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPMENUITEMINFOW arg4);
+#undef IsCharAlphaNumeric
+#define IsCharAlphaNumeric error_split_CHAR
+
+#undef IsCharAlpha
+#define IsCharAlpha error_split_CHAR
+
+#undef IsCharLower
+#define IsCharLower error_split_CHAR
+
+#undef IsCharUpper
+#define IsCharUpper error_split_CHAR
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef IsDialogMessage
+#define IsDialogMessage error_use_qxeIsDialogMessage_or_IsDialogMessageA_and_IsDialogMessageW
+#endif
+BOOL qxeIsDialogMessage (HWND arg1, LPMSG arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadAccelerators
+#define LoadAccelerators error_use_qxeLoadAccelerators_or_LoadAcceleratorsA_and_LoadAcceleratorsW
+#endif
+HACCEL qxeLoadAccelerators (HINSTANCE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadBitmap
+#define LoadBitmap error_use_qxeLoadBitmap_or_LoadBitmapA_and_LoadBitmapW
+#endif
+HBITMAP qxeLoadBitmap (HINSTANCE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadCursorFromFile
+#define LoadCursorFromFile error_use_qxeLoadCursorFromFile_or_LoadCursorFromFileA_and_LoadCursorFromFileW
+#endif
+HCURSOR qxeLoadCursorFromFile (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadCursor
+#define LoadCursor error_use_qxeLoadCursor_or_LoadCursorA_and_LoadCursorW
+#endif
+HCURSOR qxeLoadCursor (HINSTANCE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadIcon
+#define LoadIcon error_use_qxeLoadIcon_or_LoadIconA_and_LoadIconW
+#endif
+HICON qxeLoadIcon (HINSTANCE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadImage
+#define LoadImage error_use_qxeLoadImage_or_LoadImageA_and_LoadImageW
+#endif
+HANDLE qxeLoadImage (HINSTANCE arg1, const Extbyte * arg2, UINT arg3, int arg4, int arg5, UINT arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadKeyboardLayout
+#define LoadKeyboardLayout error_use_qxeLoadKeyboardLayout_or_LoadKeyboardLayoutA_and_LoadKeyboardLayoutW
+#endif
+HKL qxeLoadKeyboardLayout (const Extbyte * arg1, UINT arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadMenuIndirect
+#define LoadMenuIndirect error_use_qxeLoadMenuIndirect_or_LoadMenuIndirectA_and_LoadMenuIndirectW
+#endif
+HMENU qxeLoadMenuIndirect (const MENUTEMPLATE* arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadMenu
+#define LoadMenu error_use_qxeLoadMenu_or_LoadMenuA_and_LoadMenuW
+#endif
+HMENU qxeLoadMenu (HINSTANCE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadString
+#define LoadString error_use_qxeLoadString_or_LoadStringA_and_LoadStringW
+#endif
+int qxeLoadString (HINSTANCE arg1, UINT arg2, Extbyte * arg3, int arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MapVirtualKeyEx
+#define MapVirtualKeyEx error_use_qxeMapVirtualKeyEx_or_MapVirtualKeyExA_and_MapVirtualKeyExW
+#endif
+UINT qxeMapVirtualKeyEx (UINT arg1, UINT arg2, HKL arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MapVirtualKey
+#define MapVirtualKey error_use_qxeMapVirtualKey_or_MapVirtualKeyA_and_MapVirtualKeyW
+#endif
+UINT qxeMapVirtualKey (UINT arg1, UINT arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MessageBox
+#define MessageBox error_use_qxeMessageBox_or_MessageBoxA_and_MessageBoxW
+#endif
+int qxeMessageBox (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, UINT arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MessageBoxEx
+#define MessageBoxEx error_use_qxeMessageBoxEx_or_MessageBoxExA_and_MessageBoxExW
+#endif
+int qxeMessageBoxEx (HWND arg1, const Extbyte * arg2, const Extbyte * arg3, UINT arg4, WORD arg5);
+
+#undef MessageBoxIndirect
+#define MessageBoxIndirect error_Cygwin_has_split_MSGBOXPARAMS__instead_of_LPMSGBOXPARAMS
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ModifyMenu
+#define ModifyMenu error_use_qxeModifyMenu_or_ModifyMenuA_and_ModifyMenuW
+#endif
+BOOL qxeModifyMenu (HMENU arg1, UINT arg2, UINT arg3, UINT arg4, const Extbyte * arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OemToCharBuff
+#define OemToCharBuff error_use_qxeOemToCharBuff_or_OemToCharBuffA_and_OemToCharBuffW
+#endif
+BOOL qxeOemToCharBuff (LPCSTR arg1, Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OemToChar
+#define OemToChar error_use_qxeOemToChar_or_OemToCharA_and_OemToCharW
+#endif
+BOOL qxeOemToChar (LPCSTR arg1, Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenDesktop
+#define OpenDesktop error_use_qxeOpenDesktop_or_OpenDesktopA_and_OpenDesktopW
+#endif
+HDESK qxeOpenDesktop (Extbyte * arg1, DWORD arg2, BOOL arg3, DWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenWindowStation
+#define OpenWindowStation error_use_qxeOpenWindowStation_or_OpenWindowStationA_and_OpenWindowStationW
+#endif
+HWINSTA qxeOpenWindowStation (Extbyte * arg1, BOOL arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef PeekMessage
+#define PeekMessage error_use_qxePeekMessage_or_PeekMessageA_and_PeekMessageW
+#endif
+BOOL qxePeekMessage (LPMSG arg1, HWND arg2, UINT arg3, UINT arg4, UINT arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef PostMessage
+#define PostMessage error_use_qxePostMessage_or_PostMessageA_and_PostMessageW
+#endif
+BOOL qxePostMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef PostThreadMessage
+#define PostThreadMessage error_use_qxePostThreadMessage_or_PostThreadMessageA_and_PostThreadMessageW
+#endif
+BOOL qxePostThreadMessage (DWORD arg1, UINT arg2, WPARAM arg3, LPARAM arg4);
+
+#undef RealGetWindowClass
+#define RealGetWindowClass error_NT_5_0__only
+
+/* Skipping RegisterClass because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASS */
+
+/* Skipping RegisterClassEx because need to intercept so we can provide our own window procedure and handle split notify messages; split-simple WNDCLASSEX; NT 4.0+ only */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegisterClipboardFormat
+#define RegisterClipboardFormat error_use_qxeRegisterClipboardFormat_or_RegisterClipboardFormatA_and_RegisterClipboardFormatW
+#endif
+UINT qxeRegisterClipboardFormat (const Extbyte * arg1);
+
+#undef RegisterDeviceNotification
+#define RegisterDeviceNotification error_NT_5_0__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegisterWindowMessage
+#define RegisterWindowMessage error_use_qxeRegisterWindowMessage_or_RegisterWindowMessageA_and_RegisterWindowMessageW
+#endif
+UINT qxeRegisterWindowMessage (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RemoveProp
+#define RemoveProp error_use_qxeRemoveProp_or_RemovePropA_and_RemovePropW
+#endif
+HANDLE qxeRemoveProp (HWND arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SendDlgItemMessage
+#define SendDlgItemMessage error_use_qxeSendDlgItemMessage_or_SendDlgItemMessageA_and_SendDlgItemMessageW
+#endif
+LONG qxeSendDlgItemMessage (HWND arg1, int arg2, UINT arg3, WPARAM arg4, LPARAM arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SendMessageCallback
+#define SendMessageCallback error_use_qxeSendMessageCallback_or_SendMessageCallbackA_and_SendMessageCallbackW
+#endif
+BOOL qxeSendMessageCallback (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4, SENDASYNCPROC arg5, DWORD arg6);
+
+#undef SendMessageTimeout
+#define SendMessageTimeout error_VS6_has_erroneous_seventh_parameter_DWORD_PTR_instead_of_PDWORD_PTR
+
+/* Skipping SendMessage because split messages and structures */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SendNotifyMessage
+#define SendNotifyMessage error_use_qxeSendNotifyMessage_or_SendNotifyMessageA_and_SendNotifyMessageW
+#endif
+BOOL qxeSendNotifyMessage (HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetClassLong
+#define SetClassLong error_use_qxeSetClassLong_or_SetClassLongA_and_SetClassLongW
+#endif
+DWORD qxeSetClassLong (HWND arg1, int arg2, LONG arg3);
+
+#undef SetClassLongPtr
+#define SetClassLongPtr error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetDlgItemText
+#define SetDlgItemText error_use_qxeSetDlgItemText_or_SetDlgItemTextA_and_SetDlgItemTextW
+#endif
+BOOL qxeSetDlgItemText (HWND arg1, int arg2, const Extbyte * arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef SetMenuItemInfo
@@ -816,151 +1158,25 @@
 BOOL qxeSetMenuItemInfo (HMENU arg1, UINT arg2, BOOL arg3, LPCMENUITEMINFOW arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DrawText
-#define DrawText error_use_qxeDrawText_or_DrawTextA_and_DrawTextW
-#endif
-int qxeDrawText (HDC hDC, const Extbyte * lpString, int nCount, LPRECT lpRect, UINT uFormat);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DrawTextEx
-#define DrawTextEx error_use_qxeDrawTextEx_or_DrawTextExA_and_DrawTextExW
-#endif
-int qxeDrawTextEx (HDC arg1, Extbyte * arg2, int arg3, LPRECT arg4, UINT arg5, LPDRAWTEXTPARAMS arg6);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GrayString
-#define GrayString error_use_qxeGrayString_or_GrayStringA_and_GrayStringW
-#endif
-BOOL qxeGrayString (HDC hDC, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc, LPARAM lpData, int nCount, int X, int Y, int nWidth, int nHeight);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DrawState
-#define DrawState error_use_qxeDrawState_or_DrawStateA_and_DrawStateW
-#endif
-BOOL qxeDrawState (HDC arg1, HBRUSH arg2, DRAWSTATEPROC arg3, LPARAM arg4, WPARAM arg5, int arg6, int arg7, int arg8, int arg9, UINT arg10);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef TabbedTextOut
-#define TabbedTextOut error_use_qxeTabbedTextOut_or_TabbedTextOutA_and_TabbedTextOutW
-#endif
-LONG qxeTabbedTextOut (HDC hDC, int X, int Y, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTabbedTextExtent
-#define GetTabbedTextExtent error_use_qxeGetTabbedTextExtent_or_GetTabbedTextExtentA_and_GetTabbedTextExtentW
-#endif
-DWORD qxeGetTabbedTextExtent (HDC hDC, const Extbyte * lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef SetProp
 #define SetProp error_use_qxeSetProp_or_SetPropA_and_SetPropW
 #endif
-BOOL qxeSetProp (HWND hWnd, const Extbyte * lpString, HANDLE hData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetProp
-#define GetProp error_use_qxeGetProp_or_GetPropA_and_GetPropW
-#endif
-HANDLE qxeGetProp (HWND hWnd, const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RemoveProp
-#define RemoveProp error_use_qxeRemoveProp_or_RemovePropA_and_RemovePropW
-#endif
-HANDLE qxeRemoveProp (HWND hWnd, const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef EnumPropsEx
-#define EnumPropsEx error_use_qxeEnumPropsEx_or_EnumPropsExA_and_EnumPropsExW
-#endif
-int qxeEnumPropsEx (HWND hWnd, PROPENUMPROCEXW lpEnumFunc, LPARAM lParam);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef EnumProps
-#define EnumProps error_use_qxeEnumProps_or_EnumPropsA_and_EnumPropsW
-#endif
-int qxeEnumProps (HWND hWnd, PROPENUMPROCW lpEnumFunc);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetWindowText
-#define SetWindowText error_use_qxeSetWindowText_or_SetWindowTextA_and_SetWindowTextW
-#endif
-BOOL qxeSetWindowText (HWND hWnd, const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetWindowText
-#define GetWindowText error_use_qxeGetWindowText_or_GetWindowTextA_and_GetWindowTextW
-#endif
-int qxeGetWindowText (HWND hWnd, Extbyte * lpString, int nMaxCount);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetWindowTextLength
-#define GetWindowTextLength error_use_qxeGetWindowTextLength_or_GetWindowTextLengthA_and_GetWindowTextLengthW
-#endif
-int qxeGetWindowTextLength (HWND hWnd);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MessageBox
-#define MessageBox error_use_qxeMessageBox_or_MessageBoxA_and_MessageBoxW
-#endif
-int qxeMessageBox (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MessageBoxEx
-#define MessageBoxEx error_use_qxeMessageBoxEx_or_MessageBoxExA_and_MessageBoxExW
-#endif
-int qxeMessageBoxEx (HWND hWnd, const Extbyte * lpText, const Extbyte * lpCaption, UINT uType, WORD wLanguageId);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MessageBoxIndirect
-#define MessageBoxIndirect error_use_qxeMessageBoxIndirect_or_MessageBoxIndirectA_and_MessageBoxIndirectW
-#endif
-int qxeMessageBoxIndirect (LPMSGBOXPARAMSW arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetWindowLong
-#define GetWindowLong error_use_qxeGetWindowLong_or_GetWindowLongA_and_GetWindowLongW
-#endif
-LONG qxeGetWindowLong (HWND hWnd, int nIndex);
+BOOL qxeSetProp (HWND arg1, const Extbyte * arg2, HANDLE arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetUserObjectInformation
+#define SetUserObjectInformation error_use_qxeSetUserObjectInformation_or_SetUserObjectInformationA_and_SetUserObjectInformationW
+#endif
+BOOL qxeSetUserObjectInformation (HANDLE arg1, int arg2, PVOID arg3, DWORD arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef SetWindowLong
 #define SetWindowLong error_use_qxeSetWindowLong_or_SetWindowLongA_and_SetWindowLongW
 #endif
-LONG qxeSetWindowLong (HWND hWnd, int nIndex, LONG dwNewLong);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetClassLong
-#define GetClassLong error_use_qxeGetClassLong_or_GetClassLongA_and_GetClassLongW
-#endif
-DWORD qxeGetClassLong (HWND hWnd, int nIndex);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetClassLong
-#define SetClassLong error_use_qxeSetClassLong_or_SetClassLongA_and_SetClassLongW
-#endif
-DWORD qxeSetClassLong (HWND hWnd, int nIndex, LONG dwNewLong);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindWindow
-#define FindWindow error_use_qxeFindWindow_or_FindWindowA_and_FindWindowW
-#endif
-HWND qxeFindWindow (const Extbyte * lpClassName, const Extbyte * lpWindowName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindWindowEx
-#define FindWindowEx error_use_qxeFindWindowEx_or_FindWindowExA_and_FindWindowExW
-#endif
-HWND qxeFindWindowEx (HWND arg1, HWND arg2, const Extbyte * arg3, const Extbyte * arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetClassName
-#define GetClassName error_use_qxeGetClassName_or_GetClassNameA_and_GetClassNameW
-#endif
-int qxeGetClassName (HWND hWnd, Extbyte * lpClassName, int nMaxCount);
-
-#undef SetWindowsHook
-#define SetWindowsHook error_obsolete__two_versions__STRICT_and_non_STRICT
+LONG qxeSetWindowLong (HWND arg1, int arg2, LONG arg3);
+
+#undef SetWindowLongPtr
+#define SetWindowLongPtr error_Function_needs_review_to_determine_how_to_handle_it
 
 #undef SetWindowsHook
 #define SetWindowsHook error_obsolete__two_versions__STRICT_and_non_STRICT
@@ -969,130 +1185,724 @@
 #undef SetWindowsHookEx
 #define SetWindowsHookEx error_use_qxeSetWindowsHookEx_or_SetWindowsHookExA_and_SetWindowsHookExW
 #endif
-HHOOK qxeSetWindowsHookEx (int idHook, HOOKPROC lpfn, HINSTANCE hmod, DWORD dwThreadId);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadBitmap
-#define LoadBitmap error_use_qxeLoadBitmap_or_LoadBitmapA_and_LoadBitmapW
-#endif
-HBITMAP qxeLoadBitmap (HINSTANCE hInstance, const Extbyte * lpBitmapName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadCursor
-#define LoadCursor error_use_qxeLoadCursor_or_LoadCursorA_and_LoadCursorW
-#endif
-HCURSOR qxeLoadCursor (HINSTANCE hInstance, const Extbyte * lpCursorName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadCursorFromFile
-#define LoadCursorFromFile error_use_qxeLoadCursorFromFile_or_LoadCursorFromFileA_and_LoadCursorFromFileW
-#endif
-HCURSOR qxeLoadCursorFromFile (const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadIcon
-#define LoadIcon error_use_qxeLoadIcon_or_LoadIconA_and_LoadIconW
-#endif
-HICON qxeLoadIcon (HINSTANCE hInstance, const Extbyte * lpIconName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadImage
-#define LoadImage error_use_qxeLoadImage_or_LoadImageA_and_LoadImageW
-#endif
-HANDLE qxeLoadImage (HINSTANCE arg1, const Extbyte * arg2, UINT arg3, int arg4, int arg5, UINT arg6);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadString
-#define LoadString error_use_qxeLoadString_or_LoadStringA_and_LoadStringW
-#endif
-int qxeLoadString (HINSTANCE hInstance, UINT uID, Extbyte * lpBuffer, int nBufferMax);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef IsDialogMessage
-#define IsDialogMessage error_use_qxeIsDialogMessage_or_IsDialogMessageA_and_IsDialogMessageW
-#endif
-BOOL qxeIsDialogMessage (HWND hDlg, LPMSG lpMsg);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DlgDirList
-#define DlgDirList error_use_qxeDlgDirList_or_DlgDirListA_and_DlgDirListW
-#endif
-int qxeDlgDirList (HWND hDlg, Extbyte * lpPathSpec, int nIDListBox, int nIDStaticPath, UINT uFileType);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DlgDirSelectEx
-#define DlgDirSelectEx error_use_qxeDlgDirSelectEx_or_DlgDirSelectExA_and_DlgDirSelectExW
-#endif
-BOOL qxeDlgDirSelectEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDListBox);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DlgDirListComboBox
-#define DlgDirListComboBox error_use_qxeDlgDirListComboBox_or_DlgDirListComboBoxA_and_DlgDirListComboBoxW
-#endif
-int qxeDlgDirListComboBox (HWND hDlg, Extbyte * lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT uFiletype);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DlgDirSelectComboBoxEx
-#define DlgDirSelectComboBoxEx error_use_qxeDlgDirSelectComboBoxEx_or_DlgDirSelectComboBoxExA_and_DlgDirSelectComboBoxExW
-#endif
-BOOL qxeDlgDirSelectComboBoxEx (HWND hDlg, Extbyte * lpString, int nCount, int nIDComboBox);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DefFrameProc
-#define DefFrameProc error_use_qxeDefFrameProc_or_DefFrameProcA_and_DefFrameProcW
-#endif
-LRESULT qxeDefFrameProc (HWND hWnd, HWND hWndMDIClient, UINT uMsg, WPARAM wParam, LPARAM lParam);
-
-#undef DefMDIChildProc
-#define DefMDIChildProc error_return_value_is_conditionalized_on__MAC__messes_up_parser
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateMDIWindow
-#define CreateMDIWindow error_use_qxeCreateMDIWindow_or_CreateMDIWindowA_and_CreateMDIWindowW
-#endif
-HWND qxeCreateMDIWindow (Extbyte * lpClassName, Extbyte * lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HINSTANCE hInstance, LPARAM lParam);
+HHOOK qxeSetWindowsHookEx (int arg1, HOOKPROC arg2, HINSTANCE arg3, DWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetWindowText
+#define SetWindowText error_use_qxeSetWindowText_or_SetWindowTextA_and_SetWindowTextW
+#endif
+BOOL qxeSetWindowText (HWND arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SystemParametersInfo
+#define SystemParametersInfo error_use_qxeSystemParametersInfo_or_SystemParametersInfoA_and_SystemParametersInfoW
+#endif
+BOOL qxeSystemParametersInfo (UINT arg1, UINT arg2, PVOID arg3, UINT arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef TabbedTextOut
+#define TabbedTextOut error_use_qxeTabbedTextOut_or_TabbedTextOutA_and_TabbedTextOutW
+#endif
+LONG qxeTabbedTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5, int arg6, LPINT arg7, int arg8);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef TranslateAccelerator
+#define TranslateAccelerator error_use_qxeTranslateAccelerator_or_TranslateAcceleratorA_and_TranslateAcceleratorW
+#endif
+int qxeTranslateAccelerator (HWND arg1, HACCEL arg2, LPMSG arg3);
+
+/* Skipping UnregisterClass because need to intercept for reasons related to RegisterClass */
+
+#undef VkKeyScanEx
+#define VkKeyScanEx error_split_CHAR__NT_4_0__only
+
+/* Skipping VkKeyScan because split CHAR */
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef WinHelp
 #define WinHelp error_use_qxeWinHelp_or_WinHelpA_and_WinHelpW
 #endif
-BOOL qxeWinHelp (HWND hWndMain, const Extbyte * lpszHelp, UINT uCommand, DWORD dwData);
-
-#undef ChangeDisplaySettings
-#define ChangeDisplaySettings error_split_sized_LPDEVMODE
-
-#undef ChangeDisplaySettingsEx
-#define ChangeDisplaySettingsEx error_split_sized_LPDEVMODE__NT_5_0_Win98__only
-
-#undef EnumDisplaySettings
-#define EnumDisplaySettings error_split_sized_LPDEVMODE
-
-#undef EnumDisplayDevices
-#define EnumDisplayDevices error_split_sized_PDISPLAY_DEVICE__NT_5_0__only__no_Win98
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SystemParametersInfo
-#define SystemParametersInfo error_use_qxeSystemParametersInfo_or_SystemParametersInfoA_and_SystemParametersInfoW
-#endif
-BOOL qxeSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);
-
-#undef GetMonitorInfo
-#define GetMonitorInfo error_NT_5_0_Win98__only
-
-#undef GetWindowModuleFileName
-#define GetWindowModuleFileName error_NT_5_0__only
-
-#undef RealGetWindowClass
-#define RealGetWindowClass error_NT_5_0__only
-
-#undef GetAltTabInfo
-#define GetAltTabInfo error_NT_5_0__only
-
-
-/* Processing file IME.H */
-
-#undef SendIMEMessageEx
-#define SendIMEMessageEx error_obsolete__no_docs_available
+BOOL qxeWinHelp (HWND arg1, const Extbyte * arg2, UINT arg3, DWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef wvsprintf
+#define wvsprintf error_use_qxewvsprintf_or_wvsprintfA_and_wvsprintfW
+#endif
+int qxewvsprintf (Extbyte * arg1, const Extbyte * arg2, va_list arglist);
+
+
+/* Processing file DDEML.H */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DdeCreateStringHandle
+#define DdeCreateStringHandle error_use_qxeDdeCreateStringHandle_or_DdeCreateStringHandleA_and_DdeCreateStringHandleW
+#endif
+HSZ qxeDdeCreateStringHandle (DWORD arg1, const Extbyte * arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DdeInitialize
+#define DdeInitialize error_use_qxeDdeInitialize_or_DdeInitializeA_and_DdeInitializeW
+#endif
+UINT qxeDdeInitialize (PDWORD arg1, PFNCALLBACK arg2, DWORD arg3, DWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DdeQueryString
+#define DdeQueryString error_use_qxeDdeQueryString_or_DdeQueryStringA_and_DdeQueryStringW
+#endif
+DWORD qxeDdeQueryString (DWORD arg1, HSZ arg2, Extbyte * arg3, DWORD arg4, int arg5);
+
+
+/* Processing file WINREG.H */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef AbortSystemShutdown
+#define AbortSystemShutdown error_use_qxeAbortSystemShutdown_or_AbortSystemShutdownA_and_AbortSystemShutdownW
+#endif
+BOOL qxeAbortSystemShutdown (Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef InitiateSystemShutdown
+#define InitiateSystemShutdown error_use_qxeInitiateSystemShutdown_or_InitiateSystemShutdownA_and_InitiateSystemShutdownW
+#endif
+BOOL qxeInitiateSystemShutdown (Extbyte * arg1, Extbyte * arg2, DWORD arg3, BOOL arg4, BOOL arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegConnectRegistry
+#define RegConnectRegistry error_use_qxeRegConnectRegistry_or_RegConnectRegistryA_and_RegConnectRegistryW
+#endif
+LONG qxeRegConnectRegistry (const Extbyte * arg1, HKEY arg2, PHKEY arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegCreateKeyEx
+#define RegCreateKeyEx error_use_qxeRegCreateKeyEx_or_RegCreateKeyExA_and_RegCreateKeyExW
+#endif
+LONG qxeRegCreateKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, Extbyte * arg4, DWORD arg5, REGSAM arg6, LPSECURITY_ATTRIBUTES arg7, PHKEY arg8, PDWORD arg9);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegCreateKey
+#define RegCreateKey error_use_qxeRegCreateKey_or_RegCreateKeyA_and_RegCreateKeyW
+#endif
+LONG qxeRegCreateKey (HKEY arg1, const Extbyte * arg2, PHKEY arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegDeleteKey
+#define RegDeleteKey error_use_qxeRegDeleteKey_or_RegDeleteKeyA_and_RegDeleteKeyW
+#endif
+LONG qxeRegDeleteKey (HKEY arg1, const Extbyte * arg2);
+
+#undef RegDeleteKeyEx
+#define RegDeleteKeyEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegDeleteValue
+#define RegDeleteValue error_use_qxeRegDeleteValue_or_RegDeleteValueA_and_RegDeleteValueW
+#endif
+LONG qxeRegDeleteValue (HKEY arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegEnumKey
+#define RegEnumKey error_use_qxeRegEnumKey_or_RegEnumKeyA_and_RegEnumKeyW
+#endif
+LONG qxeRegEnumKey (HKEY arg1, DWORD arg2, Extbyte * arg3, DWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegEnumKeyEx
+#define RegEnumKeyEx error_use_qxeRegEnumKeyEx_or_RegEnumKeyExA_and_RegEnumKeyExW
+#endif
+LONG qxeRegEnumKeyEx (HKEY arg1, DWORD arg2, Extbyte * arg3, PDWORD arg4, PDWORD arg5, Extbyte * arg6, PDWORD arg7, PFILETIME arg8);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegEnumValue
+#define RegEnumValue error_use_qxeRegEnumValue_or_RegEnumValueA_and_RegEnumValueW
+#endif
+LONG qxeRegEnumValue (HKEY arg1, DWORD arg2, Extbyte * arg3, PDWORD arg4, PDWORD arg5, PDWORD arg6, LPBYTE arg7, PDWORD arg8);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegLoadKey
+#define RegLoadKey error_use_qxeRegLoadKey_or_RegLoadKeyA_and_RegLoadKeyW
+#endif
+LONG qxeRegLoadKey (HKEY arg1, const Extbyte * arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegOpenKeyEx
+#define RegOpenKeyEx error_use_qxeRegOpenKeyEx_or_RegOpenKeyExA_and_RegOpenKeyExW
+#endif
+LONG qxeRegOpenKeyEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, REGSAM arg4, PHKEY arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegOpenKey
+#define RegOpenKey error_use_qxeRegOpenKey_or_RegOpenKeyA_and_RegOpenKeyW
+#endif
+LONG qxeRegOpenKey (HKEY arg1, const Extbyte * arg2, PHKEY arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegQueryInfoKey
+#define RegQueryInfoKey error_use_qxeRegQueryInfoKey_or_RegQueryInfoKeyA_and_RegQueryInfoKeyW
+#endif
+LONG qxeRegQueryInfoKey (HKEY arg1, Extbyte * arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5, PDWORD arg6, PDWORD arg7, PDWORD arg8, PDWORD arg9, PDWORD arg10, PDWORD arg11, PFILETIME arg12);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegQueryMultipleValues
+#define RegQueryMultipleValues error_use_qxeRegQueryMultipleValues_or_RegQueryMultipleValuesA_and_RegQueryMultipleValuesW
+#endif
+LONG qxeRegQueryMultipleValues (HKEY arg1, PVALENTW arg2, DWORD arg3, Extbyte * arg4, LPDWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegQueryValueEx
+#define RegQueryValueEx error_use_qxeRegQueryValueEx_or_RegQueryValueExA_and_RegQueryValueExW
+#endif
+LONG qxeRegQueryValueEx (HKEY arg1, const Extbyte * arg2, LPDWORD arg3, LPDWORD arg4, LPBYTE arg5, LPDWORD arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegQueryValue
+#define RegQueryValue error_use_qxeRegQueryValue_or_RegQueryValueA_and_RegQueryValueW
+#endif
+LONG qxeRegQueryValue (HKEY arg1, const Extbyte * arg2, Extbyte * arg3, PLONG arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegReplaceKey
+#define RegReplaceKey error_use_qxeRegReplaceKey_or_RegReplaceKeyA_and_RegReplaceKeyW
+#endif
+LONG qxeRegReplaceKey (HKEY arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegRestoreKey
+#define RegRestoreKey error_use_qxeRegRestoreKey_or_RegRestoreKeyA_and_RegRestoreKeyW
+#endif
+LONG qxeRegRestoreKey (HKEY arg1, const Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegSaveKey
+#define RegSaveKey error_use_qxeRegSaveKey_or_RegSaveKeyA_and_RegSaveKeyW
+#endif
+LONG qxeRegSaveKey (HKEY arg1, const Extbyte * arg2, LPSECURITY_ATTRIBUTES arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegSetValueEx
+#define RegSetValueEx error_use_qxeRegSetValueEx_or_RegSetValueExA_and_RegSetValueExW
+#endif
+LONG qxeRegSetValueEx (HKEY arg1, const Extbyte * arg2, DWORD arg3, DWORD arg4, const BYTE* arg5, DWORD arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegSetValue
+#define RegSetValue error_use_qxeRegSetValue_or_RegSetValueA_and_RegSetValueW
+#endif
+LONG qxeRegSetValue (HKEY arg1, const Extbyte * arg2, DWORD arg3, const Extbyte * arg4, DWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegUnLoadKey
+#define RegUnLoadKey error_use_qxeRegUnLoadKey_or_RegUnLoadKeyA_and_RegUnLoadKeyW
+#endif
+LONG qxeRegUnLoadKey (HKEY arg1, const Extbyte * arg2);
+
+
+/* Processing file WINNLS.H */
+
+#undef CompareString
+#define CompareString error_not_used__not_examined_yet
+
+#undef EnumCalendarInfo
+#define EnumCalendarInfo error_not_used__not_examined_yet
+
+#undef EnumDateFormats
+#define EnumDateFormats error_not_used__not_examined_yet
+
+#undef EnumSystemCodePages
+#define EnumSystemCodePages error_not_used__not_examined_yet
+
+#undef EnumSystemLocales
+#define EnumSystemLocales error_not_used__not_examined_yet
+
+#undef EnumTimeFormats
+#define EnumTimeFormats error_not_used__not_examined_yet
+
+#undef FoldString
+#define FoldString error_not_used__not_examined_yet
+
+#undef GetCalendarInfo
+#define GetCalendarInfo error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetCPInfoEx
+#define GetCPInfoEx error_not_used__not_examined_yet
+
+#undef GetCurrencyFormat
+#define GetCurrencyFormat error_not_used__not_examined_yet
+
+#undef GetDateFormat
+#define GetDateFormat error_not_used__not_examined_yet
+
+#undef GetGeoInfo
+#define GetGeoInfo error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetLocaleInfo
+#define GetLocaleInfo error_use_qxeGetLocaleInfo_or_GetLocaleInfoA_and_GetLocaleInfoW
+#endif
+int qxeGetLocaleInfo (LCID arg1, LCTYPE arg2, Extbyte * arg3, int arg4);
+
+#undef GetNumberFormat
+#define GetNumberFormat error_not_used__not_examined_yet
+
+#undef GetStringType
+#define GetStringType error_no_such_fun__A_and_W_versions_have_different_nos__of_args
+
+#undef GetStringTypeEx
+#define GetStringTypeEx error_not_used__not_examined_yet
+
+#undef GetTimeFormat
+#define GetTimeFormat error_not_used__not_examined_yet
+
+#undef LCMapString
+#define LCMapString error_not_used__not_examined_yet
+
+#undef SetCalendarInfo
+#define SetCalendarInfo error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetLocaleInfo
+#define SetLocaleInfo error_use_qxeSetLocaleInfo_or_SetLocaleInfoA_and_SetLocaleInfoW
+#endif
+BOOL qxeSetLocaleInfo (LCID arg1, LCTYPE arg2, const Extbyte * arg3);
+
+#undef EnumCalendarInfoEx
+#define EnumCalendarInfoEx error_not_used__not_examined_yet
+
+#undef EnumDateFormatsEx
+#define EnumDateFormatsEx error_not_used__not_examined_yet
+
+#undef EnumSystemLanguageGroups
+#define EnumSystemLanguageGroups error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef EnumLanguageGroupLocales
+#define EnumLanguageGroupLocales error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef EnumUILanguages
+#define EnumUILanguages error_Function_needs_review_to_determine_how_to_handle_it
+
+
+/* Processing file WINGDI.H */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef AddFontResource
+#define AddFontResource error_use_qxeAddFontResource_or_AddFontResourceA_and_AddFontResourceW
+#endif
+int qxeAddFontResource (const Extbyte * arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef AddFontResourceEx
+#define AddFontResourceEx error_NT_5_0__only
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CopyEnhMetaFile
+#define CopyEnhMetaFile error_use_qxeCopyEnhMetaFile_or_CopyEnhMetaFileA_and_CopyEnhMetaFileW
+#endif
+HENHMETAFILE qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CopyMetaFile
+#define CopyMetaFile error_use_qxeCopyMetaFile_or_CopyMetaFileA_and_CopyMetaFileW
+#endif
+HMETAFILE qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef CreateColorSpace
+#define CreateColorSpace error_split_sized_LPLOGCOLORSPACE__NT_4_0__only
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping CreateDC because split-sized DEVMODE */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateEnhMetaFile
+#define CreateEnhMetaFile error_use_qxeCreateEnhMetaFile_or_CreateEnhMetaFileA_and_CreateEnhMetaFileW
+#endif
+HDC qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, LPCRECT arg3, const Extbyte * arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateFont
+#define CreateFont error_use_qxeCreateFont_or_CreateFontA_and_CreateFontW
+#endif
+HFONT qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping CreateFontIndirect because split-sized LOGFONT */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping CreateIC because split-sized DEVMODE */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateMetaFile
+#define CreateMetaFile error_use_qxeCreateMetaFile_or_CreateMetaFileA_and_CreateMetaFileW
+#endif
+HDC qxeCreateMetaFile (const Extbyte * arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateScalableFontResource
+#define CreateScalableFontResource error_use_qxeCreateScalableFontResource_or_CreateScalableFontResourceA_and_CreateScalableFontResourceW
+#endif
+BOOL qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping DeviceCapabilities because split-sized DEVMODE */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumFontFamilies
+#define EnumFontFamilies error_split_complex_FONTENUMPROC
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef EnumFonts
+#define EnumFonts error_split_complex_FONTENUMPROC
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef EnumICMProfiles
+#define EnumICMProfiles error_use_qxeEnumICMProfiles_or_EnumICMProfilesA_and_EnumICMProfilesW
+#endif
+int qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ExtTextOut
+#define ExtTextOut error_use_qxeExtTextOut_or_ExtTextOutA_and_ExtTextOutW
+#endif
+BOOL qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, LPCRECT arg5, const Extbyte * arg6, UINT arg7, const INT* arg8);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCharABCWidths
+#define GetCharABCWidths error_use_qxeGetCharABCWidths_or_GetCharABCWidthsA_and_GetCharABCWidthsW
+#endif
+BOOL qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCharABCWidthsFloat
+#define GetCharABCWidthsFloat error_use_qxeGetCharABCWidthsFloat_or_GetCharABCWidthsFloatA_and_GetCharABCWidthsFloatW
+#endif
+BOOL qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCharacterPlacement
+#define GetCharacterPlacement error_use_qxeGetCharacterPlacement_or_GetCharacterPlacementA_and_GetCharacterPlacementW
+#endif
+DWORD qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCharWidth32
+#define GetCharWidth32 error_use_qxeGetCharWidth32_or_GetCharWidth32A_and_GetCharWidth32W
+#endif
+BOOL qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCharWidth
+#define GetCharWidth error_use_qxeGetCharWidth_or_GetCharWidthA_and_GetCharWidthW
+#endif
+BOOL qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCharWidthFloat
+#define GetCharWidthFloat error_use_qxeGetCharWidthFloat_or_GetCharWidthFloatA_and_GetCharWidthFloatW
+#endif
+BOOL qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetEnhMetaFile
+#define GetEnhMetaFile error_use_qxeGetEnhMetaFile_or_GetEnhMetaFileA_and_GetEnhMetaFileW
+#endif
+HENHMETAFILE qxeGetEnhMetaFile (const Extbyte * arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetEnhMetaFileDescription
+#define GetEnhMetaFileDescription error_use_qxeGetEnhMetaFileDescription_or_GetEnhMetaFileDescriptionA_and_GetEnhMetaFileDescriptionW
+#endif
+UINT qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetGlyphOutline
+#define GetGlyphOutline error_use_qxeGetGlyphOutline_or_GetGlyphOutlineA_and_GetGlyphOutlineW
+#endif
+DWORD qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, PVOID arg6, const MAT2* arg7);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetICMProfile
+#define GetICMProfile error_use_qxeGetICMProfile_or_GetICMProfileA_and_GetICMProfileW
+#endif
+BOOL qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetKerningPairs
+#define GetKerningPairs error_use_qxeGetKerningPairs_or_GetKerningPairsA_and_GetKerningPairsW
+#endif
+DWORD qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef GetLogColorSpace
+#define GetLogColorSpace error_split_sized_LPLOGCOLORSPACE__NT_4_0__only
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetMetaFile
+#define GetMetaFile error_use_qxeGetMetaFile_or_GetMetaFileA_and_GetMetaFileW
+#endif
+HMETAFILE qxeGetMetaFile (const Extbyte * arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping GetObject because split-sized LOGFONT */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef GetOutlineTextMetrics
+#define GetOutlineTextMetrics error_split_sized_LPOUTLINETEXTMETRIC
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTextExtentExPoint
+#define GetTextExtentExPoint error_use_qxeGetTextExtentExPoint_or_GetTextExtentExPointA_and_GetTextExtentExPointW
+#endif
+BOOL qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTextExtentPoint
+#define GetTextExtentPoint error_use_qxeGetTextExtentPoint_or_GetTextExtentPointA_and_GetTextExtentPointW
+#endif
+BOOL qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTextExtentPoint32
+#define GetTextExtentPoint32 error_use_qxeGetTextExtentPoint32_or_GetTextExtentPoint32A_and_GetTextExtentPoint32W
+#endif
+BOOL qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTextFace
+#define GetTextFace error_use_qxeGetTextFace_or_GetTextFaceA_and_GetTextFaceW
+#endif
+int qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef PolyTextOut
+#define PolyTextOut error_use_qxePolyTextOut_or_PolyTextOutA_and_PolyTextOutW
+#endif
+BOOL qxePolyTextOut (HDC arg1, const POLYTEXTW* arg2, int arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RemoveFontResource
+#define RemoveFontResource error_use_qxeRemoveFontResource_or_RemoveFontResourceA_and_RemoveFontResourceW
+#endif
+BOOL qxeRemoveFontResource (const Extbyte * arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef RemoveFontResourceEx
+#define RemoveFontResourceEx error_NT_5_0__only
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping ResetDC because split-sized DEVMODE */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetICMProfile
+#define SetICMProfile error_use_qxeSetICMProfile_or_SetICMProfileA_and_SetICMProfileW
+#endif
+BOOL qxeSetICMProfile (HDC arg1, Extbyte * arg2);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef StartDoc
+#define StartDoc error_use_qxeStartDoc_or_StartDocA_and_StartDocW
+#endif
+int qxeStartDoc (HDC arg1, const DOCINFOW* arg2);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef TextOut
+#define TextOut error_use_qxeTextOut_or_TextOutA_and_TextOutW
+#endif
+BOOL qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef wglUseFontBitmaps
+#define wglUseFontBitmaps error_causes_link_error
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef wglUseFontOutlines
+#define wglUseFontOutlines error_causes_link_error
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef GetGlyphIndices
+#define GetGlyphIndices error_NT_5_0__only
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+
+/* Processing file SHLOBJ.H */
+
+/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */
+
+/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SHGetPathFromIDList
+#define SHGetPathFromIDList error_use_qxeSHGetPathFromIDList_or_SHGetPathFromIDListA_and_SHGetPathFromIDListW
+#endif
+BOOL qxeSHGetPathFromIDList (LPCITEMIDLIST arg1, Extbyte * arg2);
+
+/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */
+
+#undef SHGetFolderPath
+#define SHGetFolderPath error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef SHGetIconOverlayIndex
+#define SHGetIconOverlayIndex error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef SHCreateDirectoryEx
+#define SHCreateDirectoryEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef SHGetFolderPathAndSubDir
+#define SHGetFolderPathAndSubDir error_Function_needs_review_to_determine_how_to_handle_it
+
+
+/* Processing file COMMDLG.H */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ChooseColor
+#define ChooseColor error_use_qxeChooseColor_or_ChooseColorA_and_ChooseColorW
+#endif
+BOOL qxeChooseColor (LPCHOOSECOLORW arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef ChooseFont
+#define ChooseFont error_split_sized_LPLOGFONT_in_LPCHOOSEFONT
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindText
+#define FindText error_use_qxeFindText_or_FindTextA_and_FindTextW
+#endif
+HWND qxeFindText (LPFINDREPLACEW arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetFileTitle
+#define GetFileTitle error_use_qxeGetFileTitle_or_GetFileTitleA_and_GetFileTitleW
+#endif
+short qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetOpenFileName
+#define GetOpenFileName error_use_qxeGetOpenFileName_or_GetOpenFileNameA_and_GetOpenFileNameW
+#endif
+BOOL qxeGetOpenFileName (LPOPENFILENAMEW arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetSaveFileName
+#define GetSaveFileName error_use_qxeGetSaveFileName_or_GetSaveFileNameA_and_GetSaveFileNameW
+#endif
+BOOL qxeGetSaveFileName (LPOPENFILENAMEW arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReplaceText
+#define ReplaceText error_use_qxeReplaceText_or_ReplaceTextA_and_ReplaceTextW
+#endif
+HWND qxeReplaceText (LPFINDREPLACEW arg1);
+#endif /* defined (HAVE_MS_WINDOWS) */
+
+#if defined (HAVE_MS_WINDOWS)
+#undef PrintDlgEx
+#define PrintDlgEx error_Function_needs_review_to_determine_how_to_handle_it
+#endif /* defined (HAVE_MS_WINDOWS) */
 
 
 /* Processing file IMM.H */
@@ -1102,7 +1912,7 @@
 #undef ImmInstallIME
 #define ImmInstallIME error_use_qxeImmInstallIME_or_ImmInstallIMEA_and_ImmInstallIMEW
 #endif
-HKL qxeImmInstallIME (const Extbyte * lpszIMEFileName, const Extbyte * lpszLayoutText);
+HKL qxeImmInstallIME (const Extbyte * arg1, const Extbyte * arg2);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1110,7 +1920,7 @@
 #undef ImmGetDescription
 #define ImmGetDescription error_use_qxeImmGetDescription_or_ImmGetDescriptionA_and_ImmGetDescriptionW
 #endif
-UINT qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT uBufLen);
+UINT qxeImmGetDescription (HKL arg1, Extbyte * arg2, UINT arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1118,7 +1928,7 @@
 #undef ImmGetIMEFileName
 #define ImmGetIMEFileName error_use_qxeImmGetIMEFileName_or_ImmGetIMEFileNameA_and_ImmGetIMEFileNameW
 #endif
-UINT qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT uBufLen);
+UINT qxeImmGetIMEFileName (HKL arg1, Extbyte * arg2, UINT arg3);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1126,7 +1936,7 @@
 #undef ImmGetCompositionString
 #define ImmGetCompositionString error_use_qxeImmGetCompositionString_or_ImmGetCompositionStringA_and_ImmGetCompositionStringW
 #endif
-LONG qxeImmGetCompositionString (HIMC arg1, DWORD arg2, LPVOID arg3, DWORD arg4);
+LONG qxeImmGetCompositionString (HIMC arg1, DWORD arg2, PVOID arg3, DWORD arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1138,7 +1948,7 @@
 #undef ImmGetCandidateListCount
 #define ImmGetCandidateListCount error_use_qxeImmGetCandidateListCount_or_ImmGetCandidateListCountA_and_ImmGetCandidateListCountW
 #endif
-DWORD qxeImmGetCandidateListCount (HIMC arg1, LPDWORD lpdwListCount);
+DWORD qxeImmGetCandidateListCount (HIMC arg1, PDWORD arg2);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1146,7 +1956,7 @@
 #undef ImmGetCandidateList
 #define ImmGetCandidateList error_use_qxeImmGetCandidateList_or_ImmGetCandidateListA_and_ImmGetCandidateListW
 #endif
-DWORD qxeImmGetCandidateList (HIMC arg1, DWORD deIndex, LPCANDIDATELIST arg3, DWORD dwBufLen);
+DWORD qxeImmGetCandidateList (HIMC arg1, DWORD arg2, PCANDIDATELIST arg3, DWORD arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1154,7 +1964,7 @@
 #undef ImmGetGuideLine
 #define ImmGetGuideLine error_use_qxeImmGetGuideLine_or_ImmGetGuideLineA_and_ImmGetGuideLineW
 #endif
-DWORD qxeImmGetGuideLine (HIMC arg1, DWORD dwIndex, Extbyte * arg3, DWORD dwBufLen);
+DWORD qxeImmGetGuideLine (HIMC arg1, DWORD arg2, Extbyte * arg3, DWORD arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1170,7 +1980,7 @@
 #undef ImmConfigureIME
 #define ImmConfigureIME error_use_qxeImmConfigureIME_or_ImmConfigureIMEA_and_ImmConfigureIMEW
 #endif
-BOOL qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, LPVOID arg4);
+BOOL qxeImmConfigureIME (HKL arg1, HWND arg2, DWORD arg3, PVOID arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1178,7 +1988,7 @@
 #undef ImmEscape
 #define ImmEscape error_use_qxeImmEscape_or_ImmEscapeA_and_ImmEscapeW
 #endif
-LRESULT qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, LPVOID arg4);
+LRESULT qxeImmEscape (HKL arg1, HIMC arg2, UINT arg3, PVOID arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1186,7 +1996,7 @@
 #undef ImmGetConversionList
 #define ImmGetConversionList error_use_qxeImmGetConversionList_or_ImmGetConversionListA_and_ImmGetConversionListW
 #endif
-DWORD qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, LPCANDIDATELIST arg4, DWORD dwBufLen, UINT uFlag);
+DWORD qxeImmGetConversionList (HKL arg1, HIMC arg2, const Extbyte * arg3, PCANDIDATELIST arg4, DWORD arg5, UINT arg6);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1202,7 +2012,7 @@
 #undef ImmRegisterWord
 #define ImmRegisterWord error_use_qxeImmRegisterWord_or_ImmRegisterWordA_and_ImmRegisterWordW
 #endif
-BOOL qxeImmRegisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszRegister);
+BOOL qxeImmRegisterWord (HKL arg1, const Extbyte * arg2, DWORD arg3, const Extbyte * arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1210,7 +2020,7 @@
 #undef ImmUnregisterWord
 #define ImmUnregisterWord error_use_qxeImmUnregisterWord_or_ImmUnregisterWordA_and_ImmUnregisterWordW
 #endif
-BOOL qxeImmUnregisterWord (HKL arg1, const Extbyte * lpszReading, DWORD arg3, const Extbyte * lpszUnregister);
+BOOL qxeImmUnregisterWord (HKL arg1, const Extbyte * arg2, DWORD arg3, const Extbyte * arg4);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1223,7 +2033,7 @@
 #undef ImmEnumRegisterWord
 #define ImmEnumRegisterWord error_use_qxeImmEnumRegisterWord_or_ImmEnumRegisterWordA_and_ImmEnumRegisterWordW
 #endif
-UINT qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * lpszReading, DWORD arg4, const Extbyte * lpszRegister, LPVOID arg6);
+UINT qxeImmEnumRegisterWord (HKL arg1, REGISTERWORDENUMPROCW arg2, const Extbyte * arg3, DWORD arg4, const Extbyte * arg5, PVOID arg6);
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 #if defined (HAVE_MS_WINDOWS)
@@ -1232,19 +2042,940 @@
 #endif /* defined (HAVE_MS_WINDOWS) */
 
 
+/* Processing file WINBASE.H */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef AccessCheckAndAuditAlarm
+#define AccessCheckAndAuditAlarm error_use_qxeAccessCheckAndAuditAlarm_or_AccessCheckAndAuditAlarmA_and_AccessCheckAndAuditAlarmW
+#endif
+BOOL qxeAccessCheckAndAuditAlarm (const Extbyte * arg1, LPVOID arg2, Extbyte * arg3, Extbyte * arg4, PSECURITY_DESCRIPTOR arg5, DWORD arg6, PGENERIC_MAPPING arg7, BOOL arg8, PDWORD arg9, PBOOL arg10, PBOOL arg11);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef AddAtom
+#define AddAtom error_use_qxeAddAtom_or_AddAtomA_and_AddAtomW
+#endif
+ATOM qxeAddAtom (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef BackupEventLog
+#define BackupEventLog error_use_qxeBackupEventLog_or_BackupEventLogA_and_BackupEventLogW
+#endif
+BOOL qxeBackupEventLog (HANDLE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef BeginUpdateResource
+#define BeginUpdateResource error_use_qxeBeginUpdateResource_or_BeginUpdateResourceA_and_BeginUpdateResourceW
+#endif
+HANDLE qxeBeginUpdateResource (const Extbyte * arg1, BOOL arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef BuildCommDCB
+#define BuildCommDCB error_use_qxeBuildCommDCB_or_BuildCommDCBA_and_BuildCommDCBW
+#endif
+BOOL qxeBuildCommDCB (const Extbyte * arg1, LPDCB arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef BuildCommDCBAndTimeouts
+#define BuildCommDCBAndTimeouts error_use_qxeBuildCommDCBAndTimeouts_or_BuildCommDCBAndTimeoutsA_and_BuildCommDCBAndTimeoutsW
+#endif
+BOOL qxeBuildCommDCBAndTimeouts (const Extbyte * arg1, LPDCB arg2, LPCOMMTIMEOUTS arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CallNamedPipe
+#define CallNamedPipe error_use_qxeCallNamedPipe_or_CallNamedPipeA_and_CallNamedPipeW
+#endif
+BOOL qxeCallNamedPipe (const Extbyte * arg1, PVOID arg2, DWORD arg3, PVOID arg4, DWORD arg5, PDWORD arg6, DWORD arg7);
+
+#undef CheckNameLegalDOS8Dot3
+#define CheckNameLegalDOS8Dot3 error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ClearEventLog
+#define ClearEventLog error_use_qxeClearEventLog_or_ClearEventLogA_and_ClearEventLogW
+#endif
+BOOL qxeClearEventLog (HANDLE arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CommConfigDialog
+#define CommConfigDialog error_use_qxeCommConfigDialog_or_CommConfigDialogA_and_CommConfigDialogW
+#endif
+BOOL qxeCommConfigDialog (const Extbyte * arg1, HWND arg2, LPCOMMCONFIG arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CopyFile
+#define CopyFile error_use_qxeCopyFile_or_CopyFileA_and_CopyFileW
+#endif
+BOOL qxeCopyFile (const Extbyte * arg1, const Extbyte * arg2, BOOL arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CopyFileEx
+#define CopyFileEx error_use_qxeCopyFileEx_or_CopyFileExA_and_CopyFileExW
+#endif
+BOOL qxeCopyFileEx (const Extbyte * arg1, const Extbyte * arg2, LPPROGRESS_ROUTINE arg3, LPVOID arg4, LPBOOL arg5, DWORD arg6);
+
+#undef CreateActCtx
+#define CreateActCtx error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateDirectory
+#define CreateDirectory error_use_qxeCreateDirectory_or_CreateDirectoryA_and_CreateDirectoryW
+#endif
+BOOL qxeCreateDirectory (const Extbyte * arg1, LPSECURITY_ATTRIBUTES arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateDirectoryEx
+#define CreateDirectoryEx error_use_qxeCreateDirectoryEx_or_CreateDirectoryExA_and_CreateDirectoryExW
+#endif
+BOOL qxeCreateDirectoryEx (const Extbyte * arg1, const Extbyte * arg2, LPSECURITY_ATTRIBUTES arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateEvent
+#define CreateEvent error_use_qxeCreateEvent_or_CreateEventA_and_CreateEventW
+#endif
+HANDLE qxeCreateEvent (LPSECURITY_ATTRIBUTES arg1, BOOL arg2, BOOL arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateFile
+#define CreateFile error_use_qxeCreateFile_or_CreateFileA_and_CreateFileW
+#endif
+HANDLE qxeCreateFile (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4, DWORD arg5, DWORD arg6, HANDLE arg7);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateFileMapping
+#define CreateFileMapping error_use_qxeCreateFileMapping_or_CreateFileMappingA_and_CreateFileMappingW
+#endif
+HANDLE qxeCreateFileMapping (HANDLE arg1, LPSECURITY_ATTRIBUTES arg2, DWORD arg3, DWORD arg4, DWORD arg5, const Extbyte * arg6);
+
+#undef CreateHardLink
+#define CreateHardLink error_NT_5_0__only
+
+#undef CreateJobObject
+#define CreateJobObject error_NT_5_0__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateMailslot
+#define CreateMailslot error_use_qxeCreateMailslot_or_CreateMailslotA_and_CreateMailslotW
+#endif
+HANDLE qxeCreateMailslot (const Extbyte * arg1, DWORD arg2, DWORD arg3, LPSECURITY_ATTRIBUTES arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateMutex
+#define CreateMutex error_use_qxeCreateMutex_or_CreateMutexA_and_CreateMutexW
+#endif
+HANDLE qxeCreateMutex (LPSECURITY_ATTRIBUTES arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateNamedPipe
+#define CreateNamedPipe error_use_qxeCreateNamedPipe_or_CreateNamedPipeA_and_CreateNamedPipeW
+#endif
+HANDLE qxeCreateNamedPipe (const Extbyte * arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, LPSECURITY_ATTRIBUTES arg8);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateProcess
+#define CreateProcess error_use_qxeCreateProcess_or_CreateProcessA_and_CreateProcessW
+#endif
+BOOL qxeCreateProcess (const Extbyte * arg1, Extbyte * arg2, LPSECURITY_ATTRIBUTES arg3, LPSECURITY_ATTRIBUTES arg4, BOOL arg5, DWORD arg6, PVOID arg7, const Extbyte * arg8, LPSTARTUPINFOW arg9, LPPROCESS_INFORMATION arg10);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateProcessAsUser
+#define CreateProcessAsUser error_use_qxeCreateProcessAsUser_or_CreateProcessAsUserA_and_CreateProcessAsUserW
+#endif
+BOOL qxeCreateProcessAsUser (HANDLE arg1, const Extbyte * arg2, Extbyte * arg3, LPSECURITY_ATTRIBUTES arg4, LPSECURITY_ATTRIBUTES arg5, BOOL arg6, DWORD arg7, PVOID arg8, const Extbyte * arg9, LPSTARTUPINFOW arg10, LPPROCESS_INFORMATION arg11);
+
+#undef CreateProcessWithLogon
+#define CreateProcessWithLogon error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateSemaphore
+#define CreateSemaphore error_use_qxeCreateSemaphore_or_CreateSemaphoreA_and_CreateSemaphoreW
+#endif
+HANDLE qxeCreateSemaphore (LPSECURITY_ATTRIBUTES arg1, LONG arg2, LONG arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef CreateWaitableTimer
+#define CreateWaitableTimer error_use_qxeCreateWaitableTimer_or_CreateWaitableTimerA_and_CreateWaitableTimerW
+#endif
+HANDLE qxeCreateWaitableTimer (LPSECURITY_ATTRIBUTES arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DefineDosDevice
+#define DefineDosDevice error_use_qxeDefineDosDevice_or_DefineDosDeviceA_and_DefineDosDeviceW
+#endif
+BOOL qxeDefineDosDevice (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef DeleteFile
+#define DeleteFile error_use_qxeDeleteFile_or_DeleteFileA_and_DeleteFileW
+#endif
+BOOL qxeDeleteFile (const Extbyte * arg1);
+
+#undef DeleteVolumeMountPoint
+#define DeleteVolumeMountPoint error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef DnsHostnameToComputerName
+#define DnsHostnameToComputerName error_Function_needs_review_to_determine_how_to_handle_it
+
+#if !defined (CYGWIN_HEADERS)
+#undef EncryptFile
+#define EncryptFile error_Win2K__only
+#endif /* !defined (CYGWIN_HEADERS) */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef EndUpdateResource
+#define EndUpdateResource error_use_qxeEndUpdateResource_or_EndUpdateResourceA_and_EndUpdateResourceW
+#endif
+BOOL qxeEndUpdateResource (HANDLE arg1, BOOL arg2);
+
+/* Skipping EnumResourceLanguages because different prototypes in VC6 and VC7 */
+
+/* Skipping EnumResourceNames because different prototypes in VC6 and VC7 */
+
+/* Skipping EnumResourceTypes because different prototypes in VC6 and VC7 */
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ExpandEnvironmentStrings
+#define ExpandEnvironmentStrings error_use_qxeExpandEnvironmentStrings_or_ExpandEnvironmentStringsA_and_ExpandEnvironmentStringsW
+#endif
+DWORD qxeExpandEnvironmentStrings (const Extbyte * arg1, Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FatalAppExit
+#define FatalAppExit error_use_qxeFatalAppExit_or_FatalAppExitA_and_FatalAppExitW
+#endif
+void qxeFatalAppExit (UINT arg1, const Extbyte * arg2);
+
+#undef FileEncryptionStatus
+#define FileEncryptionStatus error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef FindActCtxSectionString
+#define FindActCtxSectionString error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindAtom
+#define FindAtom error_use_qxeFindAtom_or_FindAtomA_and_FindAtomW
+#endif
+ATOM qxeFindAtom (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindFirstChangeNotification
+#define FindFirstChangeNotification error_use_qxeFindFirstChangeNotification_or_FindFirstChangeNotificationA_and_FindFirstChangeNotificationW
+#endif
+HANDLE qxeFindFirstChangeNotification (const Extbyte * arg1, BOOL arg2, DWORD arg3);
+
+/* Skipping FindFirstFile because split-sized LPWIN32_FIND_DATA */
+
+#undef FindFirstFileEx
+#define FindFirstFileEx error_split_sized_LPWIN32_FIND_DATA__not_used__NT_4_0__only
+
+#undef FindFirstVolume
+#define FindFirstVolume error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef FindFirstVolumeMountPoint
+#define FindFirstVolumeMountPoint error_Function_needs_review_to_determine_how_to_handle_it
+
+/* Skipping FindNextFile because split-sized LPWIN32_FIND_DATA */
+
+#undef FindNextVolume
+#define FindNextVolume error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef FindNextVolumeMountPoint
+#define FindNextVolumeMountPoint error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindResource
+#define FindResource error_use_qxeFindResource_or_FindResourceA_and_FindResourceW
+#endif
+HRSRC qxeFindResource (HINSTANCE arg1, const Extbyte * arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FindResourceEx
+#define FindResourceEx error_use_qxeFindResourceEx_or_FindResourceExA_and_FindResourceExW
+#endif
+HRSRC qxeFindResourceEx (HINSTANCE arg1, const Extbyte * arg2, const Extbyte * arg3, WORD arg4);
+
+#undef GetFirmwareEnvironmentVariable
+#define GetFirmwareEnvironmentVariable error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FormatMessage
+#define FormatMessage error_use_qxeFormatMessage_or_FormatMessageA_and_FormatMessageW
+#endif
+DWORD qxeFormatMessage (DWORD arg1, PCVOID arg2, DWORD arg3, DWORD arg4, Extbyte * arg5, DWORD arg6, va_list* arg7);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef FreeEnvironmentStrings
+#define FreeEnvironmentStrings error_use_qxeFreeEnvironmentStrings_or_FreeEnvironmentStringsA_and_FreeEnvironmentStringsW
+#endif
+BOOL qxeFreeEnvironmentStrings (Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetAtomName
+#define GetAtomName error_use_qxeGetAtomName_or_GetAtomNameA_and_GetAtomNameW
+#endif
+UINT qxeGetAtomName (ATOM arg1, Extbyte * arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetBinaryType
+#define GetBinaryType error_use_qxeGetBinaryType_or_GetBinaryTypeA_and_GetBinaryTypeW
+#endif
+BOOL qxeGetBinaryType (const Extbyte * arg1, PDWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCommandLine
+#define GetCommandLine error_use_qxeGetCommandLine_or_GetCommandLineA_and_GetCommandLineW
+#endif
+Extbyte * qxeGetCommandLine (void);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCompressedFileSize
+#define GetCompressedFileSize error_use_qxeGetCompressedFileSize_or_GetCompressedFileSizeA_and_GetCompressedFileSizeW
+#endif
+DWORD qxeGetCompressedFileSize (const Extbyte * arg1, PDWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetComputerName
+#define GetComputerName error_use_qxeGetComputerName_or_GetComputerNameA_and_GetComputerNameW
+#endif
+BOOL qxeGetComputerName (Extbyte * arg1, PDWORD arg2);
+
+#undef GetComputerNameEx
+#define GetComputerNameEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetCurrentDirectory
+#define GetCurrentDirectory error_use_qxeGetCurrentDirectory_or_GetCurrentDirectoryA_and_GetCurrentDirectoryW
+#endif
+DWORD qxeGetCurrentDirectory (DWORD arg1, Extbyte * arg2);
+
+#undef GetCurrentHwProfile
+#define GetCurrentHwProfile error_split_sized_LPHW_PROFILE_INFO__NT_4_0__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetDefaultCommConfig
+#define GetDefaultCommConfig error_use_qxeGetDefaultCommConfig_or_GetDefaultCommConfigA_and_GetDefaultCommConfigW
+#endif
+BOOL qxeGetDefaultCommConfig (const Extbyte * arg1, LPCOMMCONFIG arg2, PDWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetDiskFreeSpace
+#define GetDiskFreeSpace error_use_qxeGetDiskFreeSpace_or_GetDiskFreeSpaceA_and_GetDiskFreeSpaceW
+#endif
+BOOL qxeGetDiskFreeSpace (const Extbyte * arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetDiskFreeSpaceEx
+#define GetDiskFreeSpaceEx error_use_qxeGetDiskFreeSpaceEx_or_GetDiskFreeSpaceExA_and_GetDiskFreeSpaceExW
+#endif
+BOOL qxeGetDiskFreeSpaceEx (const Extbyte * arg1, PULARGE_INTEGER arg2, PULARGE_INTEGER arg3, PULARGE_INTEGER arg4);
+
+#undef GetDllDirectory
+#define GetDllDirectory error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetDriveType
+#define GetDriveType error_use_qxeGetDriveType_or_GetDriveTypeA_and_GetDriveTypeW
+#endif
+UINT qxeGetDriveType (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetEnvironmentVariable
+#define GetEnvironmentVariable error_use_qxeGetEnvironmentVariable_or_GetEnvironmentVariableA_and_GetEnvironmentVariableW
+#endif
+DWORD qxeGetEnvironmentVariable (const Extbyte * arg1, Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetFileAttributes
+#define GetFileAttributes error_use_qxeGetFileAttributes_or_GetFileAttributesA_and_GetFileAttributesW
+#endif
+DWORD qxeGetFileAttributes (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetFileAttributesEx
+#define GetFileAttributesEx error_use_qxeGetFileAttributesEx_or_GetFileAttributesExA_and_GetFileAttributesExW
+#endif
+BOOL qxeGetFileAttributesEx (const Extbyte * arg1, GET_FILEEX_INFO_LEVELS arg2, PVOID arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetFileSecurity
+#define GetFileSecurity error_use_qxeGetFileSecurity_or_GetFileSecurityA_and_GetFileSecurityW
+#endif
+BOOL qxeGetFileSecurity (const Extbyte * arg1, SECURITY_INFORMATION arg2, PSECURITY_DESCRIPTOR arg3, DWORD arg4, PDWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetFullPathName
+#define GetFullPathName error_use_qxeGetFullPathName_or_GetFullPathNameA_and_GetFullPathNameW
+#endif
+DWORD qxeGetFullPathName (const Extbyte * arg1, DWORD arg2, Extbyte * arg3, Extbyte ** arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetLogicalDriveStrings
+#define GetLogicalDriveStrings error_use_qxeGetLogicalDriveStrings_or_GetLogicalDriveStringsA_and_GetLogicalDriveStringsW
+#endif
+DWORD qxeGetLogicalDriveStrings (DWORD arg1, Extbyte * arg2);
+
+#undef GetLongPathName
+#define GetLongPathName error_Win98_2K__only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetModuleFileName
+#define GetModuleFileName error_use_qxeGetModuleFileName_or_GetModuleFileNameA_and_GetModuleFileNameW
+#endif
+DWORD qxeGetModuleFileName (HINSTANCE arg1, Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetModuleHandle
+#define GetModuleHandle error_use_qxeGetModuleHandle_or_GetModuleHandleA_and_GetModuleHandleW
+#endif
+HMODULE qxeGetModuleHandle (const Extbyte * arg1);
+
+#undef GetModuleHandleEx
+#define GetModuleHandleEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetNamedPipeHandleState
+#define GetNamedPipeHandleState error_use_qxeGetNamedPipeHandleState_or_GetNamedPipeHandleStateA_and_GetNamedPipeHandleStateW
+#endif
+BOOL qxeGetNamedPipeHandleState (HANDLE arg1, PDWORD arg2, PDWORD arg3, PDWORD arg4, PDWORD arg5, Extbyte * arg6, DWORD arg7);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetPrivateProfileInt
+#define GetPrivateProfileInt error_use_qxeGetPrivateProfileInt_or_GetPrivateProfileIntA_and_GetPrivateProfileIntW
+#endif
+UINT qxeGetPrivateProfileInt (const Extbyte * arg1, const Extbyte * arg2, INT arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetPrivateProfileSection
+#define GetPrivateProfileSection error_use_qxeGetPrivateProfileSection_or_GetPrivateProfileSectionA_and_GetPrivateProfileSectionW
+#endif
+DWORD qxeGetPrivateProfileSection (const Extbyte * arg1, Extbyte * arg2, DWORD arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetPrivateProfileSectionNames
+#define GetPrivateProfileSectionNames error_use_qxeGetPrivateProfileSectionNames_or_GetPrivateProfileSectionNamesA_and_GetPrivateProfileSectionNamesW
+#endif
+DWORD qxeGetPrivateProfileSectionNames (Extbyte * arg1, DWORD arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetPrivateProfileString
+#define GetPrivateProfileString error_use_qxeGetPrivateProfileString_or_GetPrivateProfileStringA_and_GetPrivateProfileStringW
+#endif
+DWORD qxeGetPrivateProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, Extbyte * arg4, DWORD arg5, const Extbyte * arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetPrivateProfileStruct
+#define GetPrivateProfileStruct error_use_qxeGetPrivateProfileStruct_or_GetPrivateProfileStructA_and_GetPrivateProfileStructW
+#endif
+BOOL qxeGetPrivateProfileStruct (const Extbyte * arg1, const Extbyte * arg2, LPVOID arg3, UINT arg4, const Extbyte * arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetProfileInt
+#define GetProfileInt error_use_qxeGetProfileInt_or_GetProfileIntA_and_GetProfileIntW
+#endif
+UINT qxeGetProfileInt (const Extbyte * arg1, const Extbyte * arg2, INT arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetProfileSection
+#define GetProfileSection error_use_qxeGetProfileSection_or_GetProfileSectionA_and_GetProfileSectionW
+#endif
+DWORD qxeGetProfileSection (const Extbyte * arg1, Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetProfileString
+#define GetProfileString error_use_qxeGetProfileString_or_GetProfileStringA_and_GetProfileStringW
+#endif
+DWORD qxeGetProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, Extbyte * arg4, DWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetShortPathName
+#define GetShortPathName error_use_qxeGetShortPathName_or_GetShortPathNameA_and_GetShortPathNameW
+#endif
+DWORD qxeGetShortPathName (const Extbyte * arg1, Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetStartupInfo
+#define GetStartupInfo error_use_qxeGetStartupInfo_or_GetStartupInfoA_and_GetStartupInfoW
+#endif
+VOID qxeGetStartupInfo (LPSTARTUPINFOW arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetSystemDirectory
+#define GetSystemDirectory error_use_qxeGetSystemDirectory_or_GetSystemDirectoryA_and_GetSystemDirectoryW
+#endif
+UINT qxeGetSystemDirectory (Extbyte * arg1, UINT arg2);
+
+#undef GetSystemWindowsDirectory
+#define GetSystemWindowsDirectory error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetSystemWow64Directory
+#define GetSystemWow64Directory error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTempFileName
+#define GetTempFileName error_use_qxeGetTempFileName_or_GetTempFileNameA_and_GetTempFileNameW
+#endif
+UINT qxeGetTempFileName (const Extbyte * arg1, const Extbyte * arg2, UINT arg3, Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetTempPath
+#define GetTempPath error_use_qxeGetTempPath_or_GetTempPathA_and_GetTempPathW
+#endif
+DWORD qxeGetTempPath (DWORD arg1, Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetUserName
+#define GetUserName error_use_qxeGetUserName_or_GetUserNameA_and_GetUserNameW
+#endif
+BOOL qxeGetUserName (Extbyte * arg1, PDWORD arg2);
+
+#undef GetVersionEx
+#define GetVersionEx error_split_sized_LPOSVERSIONINFO
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetVolumeInformation
+#define GetVolumeInformation error_use_qxeGetVolumeInformation_or_GetVolumeInformationA_and_GetVolumeInformationW
+#endif
+BOOL qxeGetVolumeInformation (const Extbyte * arg1, Extbyte * arg2, DWORD arg3, PDWORD arg4, PDWORD arg5, PDWORD arg6, Extbyte * arg7, DWORD arg8);
+
+#undef GetVolumeNameForVolumeMountPoint
+#define GetVolumeNameForVolumeMountPoint error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetVolumePathName
+#define GetVolumePathName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetVolumePathNamesForVolumeName
+#define GetVolumePathNamesForVolumeName error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetWindowsDirectory
+#define GetWindowsDirectory error_use_qxeGetWindowsDirectory_or_GetWindowsDirectoryA_and_GetWindowsDirectoryW
+#endif
+UINT qxeGetWindowsDirectory (Extbyte * arg1, UINT arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GlobalAddAtom
+#define GlobalAddAtom error_use_qxeGlobalAddAtom_or_GlobalAddAtomA_and_GlobalAddAtomW
+#endif
+ATOM qxeGlobalAddAtom (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GlobalFindAtom
+#define GlobalFindAtom error_use_qxeGlobalFindAtom_or_GlobalFindAtomA_and_GlobalFindAtomW
+#endif
+ATOM qxeGlobalFindAtom (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GlobalGetAtomName
+#define GlobalGetAtomName error_use_qxeGlobalGetAtomName_or_GlobalGetAtomNameA_and_GlobalGetAtomNameW
+#endif
+UINT qxeGlobalGetAtomName (ATOM arg1, Extbyte * arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef IsBadStringPtr
+#define IsBadStringPtr error_use_qxeIsBadStringPtr_or_IsBadStringPtrA_and_IsBadStringPtrW
+#endif
+BOOL qxeIsBadStringPtr (const Extbyte * arg1, UINT arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadLibraryEx
+#define LoadLibraryEx error_use_qxeLoadLibraryEx_or_LoadLibraryExA_and_LoadLibraryExW
+#endif
+HINSTANCE qxeLoadLibraryEx (const Extbyte * arg1, HANDLE arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LoadLibrary
+#define LoadLibrary error_use_qxeLoadLibrary_or_LoadLibraryA_and_LoadLibraryW
+#endif
+HINSTANCE qxeLoadLibrary (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LogonUser
+#define LogonUser error_use_qxeLogonUser_or_LogonUserA_and_LogonUserW
+#endif
+BOOL qxeLogonUser (Extbyte * arg1, Extbyte * arg2, Extbyte * arg3, DWORD arg4, DWORD arg5, PHANDLE arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LookupAccountName
+#define LookupAccountName error_use_qxeLookupAccountName_or_LookupAccountNameA_and_LookupAccountNameW
+#endif
+BOOL qxeLookupAccountName (const Extbyte * arg1, const Extbyte * arg2, PSID arg3, PDWORD arg4, Extbyte * arg5, PDWORD arg6, PSID_NAME_USE arg7);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LookupAccountSid
+#define LookupAccountSid error_use_qxeLookupAccountSid_or_LookupAccountSidA_and_LookupAccountSidW
+#endif
+BOOL qxeLookupAccountSid (const Extbyte * arg1, PSID arg2, Extbyte * arg3, PDWORD arg4, Extbyte * arg5, PDWORD arg6, PSID_NAME_USE arg7);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LookupPrivilegeDisplayName
+#define LookupPrivilegeDisplayName error_use_qxeLookupPrivilegeDisplayName_or_LookupPrivilegeDisplayNameA_and_LookupPrivilegeDisplayNameW
+#endif
+BOOL qxeLookupPrivilegeDisplayName (const Extbyte * arg1, const Extbyte * arg2, Extbyte * arg3, PDWORD arg4, PDWORD arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LookupPrivilegeName
+#define LookupPrivilegeName error_use_qxeLookupPrivilegeName_or_LookupPrivilegeNameA_and_LookupPrivilegeNameW
+#endif
+BOOL qxeLookupPrivilegeName (const Extbyte * arg1, PLUID arg2, Extbyte * arg3, PDWORD arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef LookupPrivilegeValue
+#define LookupPrivilegeValue error_use_qxeLookupPrivilegeValue_or_LookupPrivilegeValueA_and_LookupPrivilegeValueW
+#endif
+BOOL qxeLookupPrivilegeValue (const Extbyte * arg1, const Extbyte * arg2, PLUID arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef lstrcat
+#define lstrcat error_use_qxelstrcat_or_lstrcatA_and_lstrcatW
+#endif
+Extbyte * qxelstrcat (Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef lstrcmpi
+#define lstrcmpi error_use_qxelstrcmpi_or_lstrcmpiA_and_lstrcmpiW
+#endif
+int qxelstrcmpi (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef lstrcmp
+#define lstrcmp error_use_qxelstrcmp_or_lstrcmpA_and_lstrcmpW
+#endif
+int qxelstrcmp (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef lstrcpyn
+#define lstrcpyn error_use_qxelstrcpyn_or_lstrcpynA_and_lstrcpynW
+#endif
+Extbyte * qxelstrcpyn (Extbyte * arg1, const Extbyte * arg2, int arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef lstrcpy
+#define lstrcpy error_use_qxelstrcpy_or_lstrcpyA_and_lstrcpyW
+#endif
+Extbyte * qxelstrcpy (Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef lstrlen
+#define lstrlen error_use_qxelstrlen_or_lstrlenA_and_lstrlenW
+#endif
+int qxelstrlen (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MoveFileEx
+#define MoveFileEx error_use_qxeMoveFileEx_or_MoveFileExA_and_MoveFileExW
+#endif
+BOOL qxeMoveFileEx (const Extbyte * arg1, const Extbyte * arg2, DWORD arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef MoveFile
+#define MoveFile error_use_qxeMoveFile_or_MoveFileA_and_MoveFileW
+#endif
+BOOL qxeMoveFile (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ObjectCloseAuditAlarm
+#define ObjectCloseAuditAlarm error_use_qxeObjectCloseAuditAlarm_or_ObjectCloseAuditAlarmA_and_ObjectCloseAuditAlarmW
+#endif
+BOOL qxeObjectCloseAuditAlarm (const Extbyte * arg1, PVOID arg2, BOOL arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ObjectDeleteAuditAlarm
+#define ObjectDeleteAuditAlarm error_use_qxeObjectDeleteAuditAlarm_or_ObjectDeleteAuditAlarmA_and_ObjectDeleteAuditAlarmW
+#endif
+BOOL qxeObjectDeleteAuditAlarm (const Extbyte * arg1, PVOID arg2, BOOL arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ObjectOpenAuditAlarm
+#define ObjectOpenAuditAlarm error_use_qxeObjectOpenAuditAlarm_or_ObjectOpenAuditAlarmA_and_ObjectOpenAuditAlarmW
+#endif
+BOOL qxeObjectOpenAuditAlarm (const Extbyte * arg1, PVOID arg2, Extbyte * arg3, Extbyte * arg4, PSECURITY_DESCRIPTOR arg5, HANDLE arg6, DWORD arg7, DWORD arg8, PPRIVILEGE_SET arg9, BOOL arg10, BOOL arg11, PBOOL arg12);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ObjectPrivilegeAuditAlarm
+#define ObjectPrivilegeAuditAlarm error_use_qxeObjectPrivilegeAuditAlarm_or_ObjectPrivilegeAuditAlarmA_and_ObjectPrivilegeAuditAlarmW
+#endif
+BOOL qxeObjectPrivilegeAuditAlarm (const Extbyte * arg1, PVOID arg2, HANDLE arg3, DWORD arg4, PPRIVILEGE_SET arg5, BOOL arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenBackupEventLog
+#define OpenBackupEventLog error_use_qxeOpenBackupEventLog_or_OpenBackupEventLogA_and_OpenBackupEventLogW
+#endif
+HANDLE qxeOpenBackupEventLog (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenEventLog
+#define OpenEventLog error_use_qxeOpenEventLog_or_OpenEventLogA_and_OpenEventLogW
+#endif
+HANDLE qxeOpenEventLog (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenEvent
+#define OpenEvent error_use_qxeOpenEvent_or_OpenEventA_and_OpenEventW
+#endif
+HANDLE qxeOpenEvent (DWORD arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenFileMapping
+#define OpenFileMapping error_use_qxeOpenFileMapping_or_OpenFileMappingA_and_OpenFileMappingW
+#endif
+HANDLE qxeOpenFileMapping (DWORD arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenMutex
+#define OpenMutex error_use_qxeOpenMutex_or_OpenMutexA_and_OpenMutexW
+#endif
+HANDLE qxeOpenMutex (DWORD arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenSemaphore
+#define OpenSemaphore error_use_qxeOpenSemaphore_or_OpenSemaphoreA_and_OpenSemaphoreW
+#endif
+HANDLE qxeOpenSemaphore (DWORD arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OpenWaitableTimer
+#define OpenWaitableTimer error_use_qxeOpenWaitableTimer_or_OpenWaitableTimerA_and_OpenWaitableTimerW
+#endif
+HANDLE qxeOpenWaitableTimer (DWORD arg1, BOOL arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef OutputDebugString
+#define OutputDebugString error_use_qxeOutputDebugString_or_OutputDebugStringA_and_OutputDebugStringW
+#endif
+void qxeOutputDebugString (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef PrivilegedServiceAuditAlarm
+#define PrivilegedServiceAuditAlarm error_use_qxePrivilegedServiceAuditAlarm_or_PrivilegedServiceAuditAlarmA_and_PrivilegedServiceAuditAlarmW
+#endif
+BOOL qxePrivilegedServiceAuditAlarm (const Extbyte * arg1, const Extbyte * arg2, HANDLE arg3, PPRIVILEGE_SET arg4, BOOL arg5);
+
+#undef QueryActCtx
+#define QueryActCtx error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef QueryDosDevice
+#define QueryDosDevice error_use_qxeQueryDosDevice_or_QueryDosDeviceA_and_QueryDosDeviceW
+#endif
+DWORD qxeQueryDosDevice (const Extbyte * arg1, Extbyte * arg2, DWORD arg3);
+
+#undef ReadDirectoryChanges
+#define ReadDirectoryChanges error_Unicode_only
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReadEventLog
+#define ReadEventLog error_use_qxeReadEventLog_or_ReadEventLogA_and_ReadEventLogW
+#endif
+BOOL qxeReadEventLog (HANDLE arg1, DWORD arg2, DWORD arg3, PVOID arg4, DWORD arg5, DWORD * arg6, DWORD * arg7);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RegisterEventSource
+#define RegisterEventSource error_use_qxeRegisterEventSource_or_RegisterEventSourceA_and_RegisterEventSourceW
+#endif
+HANDLE qxeRegisterEventSource (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef RemoveDirectory
+#define RemoveDirectory error_use_qxeRemoveDirectory_or_RemoveDirectoryA_and_RemoveDirectoryW
+#endif
+BOOL qxeRemoveDirectory (const Extbyte * arg1);
+
+#undef ReplaceFile
+#define ReplaceFile error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef ReportEvent
+#define ReportEvent error_use_qxeReportEvent_or_ReportEventA_and_ReportEventW
+#endif
+BOOL qxeReportEvent (HANDLE arg1, WORD arg2, WORD arg3, DWORD arg4, PSID arg5, WORD arg6, DWORD arg7, const Extbyte ** arg8, PVOID arg9);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SearchPath
+#define SearchPath error_use_qxeSearchPath_or_SearchPathA_and_SearchPathW
+#endif
+DWORD qxeSearchPath (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, DWORD arg4, Extbyte * arg5, Extbyte ** arg6);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetComputerName
+#define SetComputerName error_use_qxeSetComputerName_or_SetComputerNameA_and_SetComputerNameW
+#endif
+BOOL qxeSetComputerName (const Extbyte * arg1);
+
+#undef SetComputerNameEx
+#define SetComputerNameEx error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetCurrentDirectory
+#define SetCurrentDirectory error_use_qxeSetCurrentDirectory_or_SetCurrentDirectoryA_and_SetCurrentDirectoryW
+#endif
+BOOL qxeSetCurrentDirectory (const Extbyte * arg1);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetDefaultCommConfig
+#define SetDefaultCommConfig error_use_qxeSetDefaultCommConfig_or_SetDefaultCommConfigA_and_SetDefaultCommConfigW
+#endif
+BOOL qxeSetDefaultCommConfig (const Extbyte * arg1, LPCOMMCONFIG arg2, DWORD arg3);
+
+#undef SetDllDirectory
+#define SetDllDirectory error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetEnvironmentVariable
+#define SetEnvironmentVariable error_use_qxeSetEnvironmentVariable_or_SetEnvironmentVariableA_and_SetEnvironmentVariableW
+#endif
+BOOL qxeSetEnvironmentVariable (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetFileAttributes
+#define SetFileAttributes error_use_qxeSetFileAttributes_or_SetFileAttributesA_and_SetFileAttributesW
+#endif
+BOOL qxeSetFileAttributes (const Extbyte * arg1, DWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetFileSecurity
+#define SetFileSecurity error_use_qxeSetFileSecurity_or_SetFileSecurityA_and_SetFileSecurityW
+#endif
+BOOL qxeSetFileSecurity (const Extbyte * arg1, SECURITY_INFORMATION arg2, PSECURITY_DESCRIPTOR arg3);
+
+#undef SetFileShortName
+#define SetFileShortName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef SetFirmwareEnvironmentVariable
+#define SetFirmwareEnvironmentVariable error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef SetVolumeLabel
+#define SetVolumeLabel error_use_qxeSetVolumeLabel_or_SetVolumeLabelA_and_SetVolumeLabelW
+#endif
+BOOL qxeSetVolumeLabel (const Extbyte * arg1, const Extbyte * arg2);
+
+#undef SetVolumeMountPoint
+#define SetVolumeMountPoint error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef UpdateResource
+#define UpdateResource error_use_qxeUpdateResource_or_UpdateResourceA_and_UpdateResourceW
+#endif
+BOOL qxeUpdateResource (HANDLE arg1, const Extbyte * arg2, const Extbyte * arg3, WORD arg4, PVOID arg5, DWORD arg6);
+
+#undef VerifyVersionInfo
+#define VerifyVersionInfo error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WaitNamedPipe
+#define WaitNamedPipe error_use_qxeWaitNamedPipe_or_WaitNamedPipeA_and_WaitNamedPipeW
+#endif
+BOOL qxeWaitNamedPipe (const Extbyte * arg1, DWORD arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WritePrivateProfileSection
+#define WritePrivateProfileSection error_use_qxeWritePrivateProfileSection_or_WritePrivateProfileSectionA_and_WritePrivateProfileSectionW
+#endif
+BOOL qxeWritePrivateProfileSection (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WritePrivateProfileString
+#define WritePrivateProfileString error_use_qxeWritePrivateProfileString_or_WritePrivateProfileStringA_and_WritePrivateProfileStringW
+#endif
+BOOL qxeWritePrivateProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WritePrivateProfileStruct
+#define WritePrivateProfileStruct error_use_qxeWritePrivateProfileStruct_or_WritePrivateProfileStructA_and_WritePrivateProfileStructW
+#endif
+BOOL qxeWritePrivateProfileStruct (const Extbyte * arg1, const Extbyte * arg2, LPVOID arg3, UINT arg4, const Extbyte * arg5);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WriteProfileSection
+#define WriteProfileSection error_use_qxeWriteProfileSection_or_WriteProfileSectionA_and_WriteProfileSectionW
+#endif
+BOOL qxeWriteProfileSection (const Extbyte * arg1, const Extbyte * arg2);
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef WriteProfileString
+#define WriteProfileString error_use_qxeWriteProfileString_or_WriteProfileStringA_and_WriteProfileStringW
+#endif
+BOOL qxeWriteProfileString (const Extbyte * arg1, const Extbyte * arg2, const Extbyte * arg3);
+
+
+/* Processing file ACLAPI.h */
+
+#undef BuildExplicitAccessWithName
+#define BuildExplicitAccessWithName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildSecurityDescriptor
+#define BuildSecurityDescriptor error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildTrusteeWithName
+#define BuildTrusteeWithName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildTrusteeWithObjectsAndName
+#define BuildTrusteeWithObjectsAndName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildTrusteeWithObjectsAndSid
+#define BuildTrusteeWithObjectsAndSid error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildTrusteeWithSid
+#define BuildTrusteeWithSid error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetAuditedPermissionsFromAcl
+#define GetAuditedPermissionsFromAcl error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetEffectiveRightsFromAcl
+#define GetEffectiveRightsFromAcl error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetExplicitEntriesFromAcl
+#define GetExplicitEntriesFromAcl error_Function_needs_review_to_determine_how_to_handle_it
+
+#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
+#undef GetNamedSecurityInfo
+#define GetNamedSecurityInfo error_use_qxeGetNamedSecurityInfo_or_GetNamedSecurityInfoA_and_GetNamedSecurityInfoW
+#endif
+DWORD qxeGetNamedSecurityInfo (Extbyte * arg1, SE_OBJECT_TYPE arg2, SECURITY_INFORMATION arg3, PSID* arg4, PSID* arg5, PACL* arg6, PACL* arg7, PSECURITY_DESCRIPTOR* arg8);
+
+#undef GetTrusteeForm
+#define GetTrusteeForm error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetTrusteeName
+#define GetTrusteeName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetTrusteeType
+#define GetTrusteeType error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef LookupSecurityDescriptorParts
+#define LookupSecurityDescriptorParts error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef SetEntriesInAcl
+#define SetEntriesInAcl error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef SetNamedSecurityInfo
+#define SetNamedSecurityInfo error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildImpersonateExplicitAccessWithName
+#define BuildImpersonateExplicitAccessWithName error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef BuildImpersonateTrustee
+#define BuildImpersonateTrustee error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetMultipleTrustee
+#define GetMultipleTrustee error_Function_needs_review_to_determine_how_to_handle_it
+
+#undef GetMultipleTrusteeOperation
+#define GetMultipleTrusteeOperation error_Function_needs_review_to_determine_how_to_handle_it
+
+
 /* Processing file MMSYSTEM.H */
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef sndPlaySound
 #define sndPlaySound error_use_qxesndPlaySound_or_sndPlaySoundA_and_sndPlaySoundW
 #endif
-BOOL qxesndPlaySound (const Extbyte * pszSound, UINT fuSound);
+BOOL qxesndPlaySound (const Extbyte * arg1, UINT arg2);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef PlaySound
 #define PlaySound error_use_qxePlaySound_or_PlaySoundA_and_PlaySoundW
 #endif
-BOOL qxePlaySound (const Extbyte * pszSound, HMODULE hmod, DWORD fdwSound);
+BOOL qxePlaySound (const Extbyte * arg1, HMODULE arg2, DWORD arg3);
 
 #undef waveOutGetDevCaps
 #define waveOutGetDevCaps error_split_sized_LPWAVEOUTCAPS
@@ -1253,7 +2984,7 @@
 #undef waveOutGetErrorText
 #define waveOutGetErrorText error_use_qxewaveOutGetErrorText_or_waveOutGetErrorTextA_and_waveOutGetErrorTextW
 #endif
-MMRESULT qxewaveOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText);
+MMRESULT qxewaveOutGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3);
 
 #undef waveInGetDevCaps
 #define waveInGetDevCaps error_split_sized_LPWAVEINCAPS
@@ -1262,7 +2993,7 @@
 #undef waveInGetErrorText
 #define waveInGetErrorText error_use_qxewaveInGetErrorText_or_waveInGetErrorTextA_and_waveInGetErrorTextW
 #endif
-MMRESULT qxewaveInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText);
+MMRESULT qxewaveInGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3);
 
 #undef midiOutGetDevCaps
 #define midiOutGetDevCaps error_split_sized_LPMIDIOUTCAPS
@@ -1271,7 +3002,7 @@
 #undef midiOutGetErrorText
 #define midiOutGetErrorText error_use_qxemidiOutGetErrorText_or_midiOutGetErrorTextA_and_midiOutGetErrorTextW
 #endif
-MMRESULT qxemidiOutGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText);
+MMRESULT qxemidiOutGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3);
 
 #undef midiInGetDevCaps
 #define midiInGetDevCaps error_split_sized_LPMIDIOUTCAPS
@@ -1280,7 +3011,7 @@
 #undef midiInGetErrorText
 #define midiInGetErrorText error_use_qxemidiInGetErrorText_or_midiInGetErrorTextA_and_midiInGetErrorTextW
 #endif
-MMRESULT qxemidiInGetErrorText (MMRESULT mmrError, Extbyte * pszText, UINT cchText);
+MMRESULT qxemidiInGetErrorText (MMRESULT arg1, Extbyte * arg2, UINT arg3);
 
 #undef auxGetDevCaps
 #define auxGetDevCaps error_split_sized_LPAUXCAPS
@@ -1304,43 +3035,43 @@
 #undef mmioStringToFOURCC
 #define mmioStringToFOURCC error_use_qxemmioStringToFOURCC_or_mmioStringToFOURCCA_and_mmioStringToFOURCCW
 #endif
-FOURCC qxemmioStringToFOURCC (const Extbyte * sz, UINT uFlags);
+FOURCC qxemmioStringToFOURCC (const Extbyte * arg1, UINT arg2);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef mmioInstallIOProc
 #define mmioInstallIOProc error_use_qxemmioInstallIOProc_or_mmioInstallIOProcA_and_mmioInstallIOProcW
 #endif
-LPMMIOPROC qxemmioInstallIOProc (FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
+LPMMIOPROC qxemmioInstallIOProc (FOURCC arg1, LPMMIOPROC arg2, DWORD arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef mmioOpen
 #define mmioOpen error_use_qxemmioOpen_or_mmioOpenA_and_mmioOpenW
 #endif
-HMMIO qxemmioOpen (Extbyte * pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
+HMMIO qxemmioOpen (Extbyte * arg1, LPMMIOINFO arg2, DWORD arg3);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef mmioRename
 #define mmioRename error_use_qxemmioRename_or_mmioRenameA_and_mmioRenameW
 #endif
-MMRESULT qxemmioRename (const Extbyte * pszFileName, const Extbyte * pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
+MMRESULT qxemmioRename (const Extbyte * arg1, const Extbyte * arg2, LPCMMIOINFO arg3, DWORD arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef mciSendCommand
 #define mciSendCommand error_use_qxemciSendCommand_or_mciSendCommandA_and_mciSendCommandW
 #endif
-MCIERROR qxemciSendCommand (MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
+MCIERROR qxemciSendCommand (MCIDEVICEID arg1, UINT arg2, DWORD arg3, DWORD arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef mciSendString
 #define mciSendString error_use_qxemciSendString_or_mciSendStringA_and_mciSendStringW
 #endif
-MCIERROR qxemciSendString (const Extbyte * lpstrCommand, Extbyte * lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
+MCIERROR qxemciSendString (const Extbyte * arg1, Extbyte * arg2, UINT arg3, HWND arg4);
 
 #ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
 #undef mciGetDeviceID
 #define mciGetDeviceID error_use_qxemciGetDeviceID_or_mciGetDeviceIDA_and_mciGetDeviceIDW
 #endif
-MCIDEVICEID qxemciGetDeviceID (const Extbyte * pszDevice);
+MCIDEVICEID qxemciGetDeviceID (const Extbyte * arg1);
 
 #if !defined (MINGW)
 #undef mciGetDeviceIDFromElementID
@@ -1351,1563 +3082,5 @@
 #undef mciGetErrorString
 #define mciGetErrorString error_use_qxemciGetErrorString_or_mciGetErrorStringA_and_mciGetErrorStringW
 #endif
-BOOL qxemciGetErrorString (MCIERROR mcierr, Extbyte * pszText, UINT cchText);
-
-
-/* Processing file WINCON.H */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef PeekConsoleInput
-#define PeekConsoleInput error_use_qxePeekConsoleInput_or_PeekConsoleInputA_and_PeekConsoleInputW
-#endif
-BOOL qxePeekConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReadConsoleInput
-#define ReadConsoleInput error_use_qxeReadConsoleInput_or_ReadConsoleInputA_and_ReadConsoleInputW
-#endif
-BOOL qxeReadConsoleInput (HANDLE hConsoleInput, PINPUT_RECORD lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsRead);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WriteConsoleInput
-#define WriteConsoleInput error_use_qxeWriteConsoleInput_or_WriteConsoleInputA_and_WriteConsoleInputW
-#endif
-BOOL qxeWriteConsoleInput (HANDLE hConsoleInput, CONST INPUT_RECORD * lpBuffer, DWORD nLength, LPDWORD lpNumberOfEventsWritten);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReadConsoleOutput
-#define ReadConsoleOutput error_use_qxeReadConsoleOutput_or_ReadConsoleOutputA_and_ReadConsoleOutputW
-#endif
-BOOL qxeReadConsoleOutput (HANDLE hConsoleOutput, PCHAR_INFO lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpReadRegion);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WriteConsoleOutput
-#define WriteConsoleOutput error_use_qxeWriteConsoleOutput_or_WriteConsoleOutputA_and_WriteConsoleOutputW
-#endif
-BOOL qxeWriteConsoleOutput (HANDLE hConsoleOutput, CONST CHAR_INFO * lpBuffer, COORD dwBufferSize, COORD dwBufferCoord, PSMALL_RECT lpWriteRegion);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReadConsoleOutputCharacter
-#define ReadConsoleOutputCharacter error_use_qxeReadConsoleOutputCharacter_or_ReadConsoleOutputCharacterA_and_ReadConsoleOutputCharacterW
-#endif
-BOOL qxeReadConsoleOutputCharacter (HANDLE hConsoleOutput, Extbyte * lpCharacter, DWORD nLength, COORD dwReadCoord, LPDWORD lpNumberOfCharsRead);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WriteConsoleOutputCharacter
-#define WriteConsoleOutputCharacter error_use_qxeWriteConsoleOutputCharacter_or_WriteConsoleOutputCharacterA_and_WriteConsoleOutputCharacterW
-#endif
-BOOL qxeWriteConsoleOutputCharacter (HANDLE hConsoleOutput, const Extbyte * lpCharacter, DWORD nLength, COORD dwWriteCoord, LPDWORD lpNumberOfCharsWritten);
-
-#undef FillConsoleOutputCharacter
-#define FillConsoleOutputCharacter error_split_CHAR
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ScrollConsoleScreenBuffer
-#define ScrollConsoleScreenBuffer error_use_qxeScrollConsoleScreenBuffer_or_ScrollConsoleScreenBufferA_and_ScrollConsoleScreenBufferW
-#endif
-BOOL qxeScrollConsoleScreenBuffer (HANDLE hConsoleOutput, CONST SMALL_RECT * lpScrollRectangle, CONST SMALL_RECT * lpClipRectangle, COORD dwDestinationOrigin, CONST CHAR_INFO * lpFill);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetConsoleTitle
-#define GetConsoleTitle error_use_qxeGetConsoleTitle_or_GetConsoleTitleA_and_GetConsoleTitleW
-#endif
-DWORD qxeGetConsoleTitle (Extbyte * lpConsoleTitle, DWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetConsoleTitle
-#define SetConsoleTitle error_use_qxeSetConsoleTitle_or_SetConsoleTitleA_and_SetConsoleTitleW
-#endif
-BOOL qxeSetConsoleTitle (const Extbyte * lpConsoleTitle);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReadConsole
-#define ReadConsole error_use_qxeReadConsole_or_ReadConsoleA_and_ReadConsoleW
-#endif
-BOOL qxeReadConsole (HANDLE hConsoleInput, LPVOID lpBuffer, DWORD nNumberOfCharsToRead, LPDWORD lpNumberOfCharsRead, LPVOID lpReserved);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WriteConsole
-#define WriteConsole error_use_qxeWriteConsole_or_WriteConsoleA_and_WriteConsoleW
-#endif
-BOOL qxeWriteConsole (HANDLE hConsoleOutput, CONST VOID * lpBuffer, DWORD nNumberOfCharsToWrite, LPDWORD lpNumberOfCharsWritten, LPVOID lpReserved);
-
-
-/* Processing file WINNETWK.H */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetAddConnection
-#define WNetAddConnection error_use_qxeWNetAddConnection_or_WNetAddConnectionA_and_WNetAddConnectionW
-#endif
-DWORD  qxeWNetAddConnection (const Extbyte * lpRemoteName, const Extbyte * lpPassword, const Extbyte * lpLocalName);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetAddConnection2
-#define WNetAddConnection2 error_use_qxeWNetAddConnection2_or_WNetAddConnection2A_and_WNetAddConnection2W
-#endif
-DWORD  qxeWNetAddConnection2 (LPNETRESOURCEW lpNetResource, const Extbyte * lpPassword, const Extbyte * lpUserName, DWORD dwFlags);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetAddConnection3
-#define WNetAddConnection3 error_use_qxeWNetAddConnection3_or_WNetAddConnection3A_and_WNetAddConnection3W
-#endif
-DWORD  qxeWNetAddConnection3 (HWND hwndOwner, LPNETRESOURCEW lpNetResource, const Extbyte * lpPassword, const Extbyte * lpUserName, DWORD dwFlags);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetCancelConnection
-#define WNetCancelConnection error_use_qxeWNetCancelConnection_or_WNetCancelConnectionA_and_WNetCancelConnectionW
-#endif
-DWORD  qxeWNetCancelConnection (const Extbyte * lpName, BOOL fForce);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetCancelConnection2
-#define WNetCancelConnection2 error_use_qxeWNetCancelConnection2_or_WNetCancelConnection2A_and_WNetCancelConnection2W
-#endif
-DWORD  qxeWNetCancelConnection2 (const Extbyte * lpName, DWORD dwFlags, BOOL fForce);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetGetConnection
-#define WNetGetConnection error_use_qxeWNetGetConnection_or_WNetGetConnectionA_and_WNetGetConnectionW
-#endif
-DWORD  qxeWNetGetConnection (const Extbyte * lpLocalName, Extbyte * lpRemoteName, LPDWORD lpnLength);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetUseConnection
-#define WNetUseConnection error_use_qxeWNetUseConnection_or_WNetUseConnectionA_and_WNetUseConnectionW
-#endif
-DWORD  qxeWNetUseConnection (HWND hwndOwner, LPNETRESOURCEW lpNetResource, const Extbyte * lpUserID, const Extbyte * lpPassword, DWORD dwFlags, Extbyte * lpAccessName, LPDWORD lpBufferSize, LPDWORD lpResult);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetConnectionDialog1
-#define WNetConnectionDialog1 error_use_qxeWNetConnectionDialog1_or_WNetConnectionDialog1A_and_WNetConnectionDialog1W
-#endif
-DWORD  qxeWNetConnectionDialog1 (LPCONNECTDLGSTRUCTW lpConnDlgStruct);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetDisconnectDialog1
-#define WNetDisconnectDialog1 error_use_qxeWNetDisconnectDialog1_or_WNetDisconnectDialog1A_and_WNetDisconnectDialog1W
-#endif
-DWORD  qxeWNetDisconnectDialog1 (LPDISCDLGSTRUCTW lpConnDlgStruct);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetOpenEnum
-#define WNetOpenEnum error_use_qxeWNetOpenEnum_or_WNetOpenEnumA_and_WNetOpenEnumW
-#endif
-DWORD  qxeWNetOpenEnum (DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetEnumResource
-#define WNetEnumResource error_use_qxeWNetEnumResource_or_WNetEnumResourceA_and_WNetEnumResourceW
-#endif
-DWORD  qxeWNetEnumResource (HANDLE hEnum, LPDWORD lpcCount, LPVOID lpBuffer, LPDWORD lpBufferSize);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetGetUniversalName
-#define WNetGetUniversalName error_use_qxeWNetGetUniversalName_or_WNetGetUniversalNameA_and_WNetGetUniversalNameW
-#endif
-DWORD  qxeWNetGetUniversalName (const Extbyte * lpLocalPath, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpBufferSize);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetGetUser
-#define WNetGetUser error_use_qxeWNetGetUser_or_WNetGetUserA_and_WNetGetUserW
-#endif
-DWORD  qxeWNetGetUser (const Extbyte * lpName, Extbyte * lpUserName, LPDWORD lpnLength);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetGetProviderName
-#define WNetGetProviderName error_use_qxeWNetGetProviderName_or_WNetGetProviderNameA_and_WNetGetProviderNameW
-#endif
-DWORD  qxeWNetGetProviderName (DWORD dwNetType, Extbyte * lpProviderName, LPDWORD lpBufferSize);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetGetNetworkInformation
-#define WNetGetNetworkInformation error_use_qxeWNetGetNetworkInformation_or_WNetGetNetworkInformationA_and_WNetGetNetworkInformationW
-#endif
-DWORD  qxeWNetGetNetworkInformation (const Extbyte * lpProvider, LPNETINFOSTRUCT lpNetInfoStruct);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WNetGetLastError
-#define WNetGetLastError error_use_qxeWNetGetLastError_or_WNetGetLastErrorA_and_WNetGetLastErrorW
-#endif
-DWORD  qxeWNetGetLastError (LPDWORD lpError, Extbyte * lpErrorBuf, DWORD nErrorBufSize, Extbyte * lpNameBuf, DWORD nNameBufSize);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-#if defined (HAVE_MS_WINDOWS)
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MultinetGetConnectionPerformance
-#define MultinetGetConnectionPerformance error_use_qxeMultinetGetConnectionPerformance_or_MultinetGetConnectionPerformanceA_and_MultinetGetConnectionPerformanceW
-#endif
-DWORD  qxeMultinetGetConnectionPerformance (LPNETRESOURCEW lpNetResource, LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct);
-#endif /* defined (HAVE_MS_WINDOWS) */
-
-
-/* Processing file DDEML.H */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DdeInitialize
-#define DdeInitialize error_use_qxeDdeInitialize_or_DdeInitializeA_and_DdeInitializeW
-#endif
-UINT qxeDdeInitialize (LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes);
-
-/* Skipping DdeCreateStringHandle because error in Cygwin prototype */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DdeQueryString
-#define DdeQueryString error_use_qxeDdeQueryString_or_DdeQueryStringA_and_DdeQueryStringW
-#endif
-DWORD qxeDdeQueryString (DWORD idInst, HSZ hsz, Extbyte * psz, DWORD cchMax, int iCodePage);
-
-
-/* Processing file WINGDI.H */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef AddFontResource
-#define AddFontResource error_use_qxeAddFontResource_or_AddFontResourceA_and_AddFontResourceW
-#endif
-int qxeAddFontResource (const Extbyte * arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CopyMetaFile
-#define CopyMetaFile error_use_qxeCopyMetaFile_or_CopyMetaFileA_and_CopyMetaFileW
-#endif
-HMETAFILE qxeCopyMetaFile (HMETAFILE arg1, const Extbyte * arg2);
-
-/* Skipping CreateDC because split-sized DEVMODE */
-
-/* Skipping CreateFontIndirect because split-sized LOGFONT */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateFont
-#define CreateFont error_use_qxeCreateFont_or_CreateFontA_and_CreateFontW
-#endif
-HFONT qxeCreateFont (int arg1, int arg2, int arg3, int arg4, int arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13, const Extbyte * arg14);
-
-/* Skipping CreateIC because split-sized DEVMODE */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateMetaFile
-#define CreateMetaFile error_use_qxeCreateMetaFile_or_CreateMetaFileA_and_CreateMetaFileW
-#endif
-HDC qxeCreateMetaFile (const Extbyte * arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateScalableFontResource
-#define CreateScalableFontResource error_use_qxeCreateScalableFontResource_or_CreateScalableFontResourceA_and_CreateScalableFontResourceW
-#endif
-BOOL qxeCreateScalableFontResource (DWORD arg1, const Extbyte * arg2, const Extbyte * arg3, const Extbyte * arg4);
-
-/* Skipping DeviceCapabilities because split-sized DEVMODE */
-
-/* Skipping EnumFontFamiliesEx because split-complex FONTENUMPROC; NT 4.0+ only */
-
-#undef EnumFontFamilies
-#define EnumFontFamilies error_split_complex_FONTENUMPROC
-
-#undef EnumFonts
-#define EnumFonts error_split_complex_FONTENUMPROC
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCharWidth
-#define GetCharWidth error_use_qxeGetCharWidth_or_GetCharWidthA_and_GetCharWidthW
-#endif
-BOOL qxeGetCharWidth (HDC arg1, UINT arg2, UINT arg3, LPINT arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCharWidth32
-#define GetCharWidth32 error_use_qxeGetCharWidth32_or_GetCharWidth32A_and_GetCharWidth32W
-#endif
-BOOL qxeGetCharWidth32 (HDC arg1, UINT arg2, UINT arg3, LPINT arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCharWidthFloat
-#define GetCharWidthFloat error_use_qxeGetCharWidthFloat_or_GetCharWidthFloatA_and_GetCharWidthFloatW
-#endif
-BOOL   qxeGetCharWidthFloat (HDC arg1, UINT arg2, UINT arg3, PFLOAT arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCharABCWidths
-#define GetCharABCWidths error_use_qxeGetCharABCWidths_or_GetCharABCWidthsA_and_GetCharABCWidthsW
-#endif
-BOOL   qxeGetCharABCWidths (HDC arg1, UINT arg2, UINT arg3, LPABC arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCharABCWidthsFloat
-#define GetCharABCWidthsFloat error_use_qxeGetCharABCWidthsFloat_or_GetCharABCWidthsFloatA_and_GetCharABCWidthsFloatW
-#endif
-BOOL   qxeGetCharABCWidthsFloat (HDC arg1, UINT arg2, UINT arg3, LPABCFLOAT arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetGlyphOutline
-#define GetGlyphOutline error_use_qxeGetGlyphOutline_or_GetGlyphOutlineA_and_GetGlyphOutlineW
-#endif
-DWORD qxeGetGlyphOutline (HDC arg1, UINT arg2, UINT arg3, LPGLYPHMETRICS arg4, DWORD arg5, LPVOID arg6, CONST MAT2 * arg7);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetMetaFile
-#define GetMetaFile error_use_qxeGetMetaFile_or_GetMetaFileA_and_GetMetaFileW
-#endif
-HMETAFILE qxeGetMetaFile (const Extbyte * arg1);
-
-#undef GetOutlineTextMetrics
-#define GetOutlineTextMetrics error_split_sized_LPOUTLINETEXTMETRIC
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTextExtentPoint
-#define GetTextExtentPoint error_use_qxeGetTextExtentPoint_or_GetTextExtentPointA_and_GetTextExtentPointW
-#endif
-BOOL   qxeGetTextExtentPoint (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTextExtentPoint32
-#define GetTextExtentPoint32 error_use_qxeGetTextExtentPoint32_or_GetTextExtentPoint32A_and_GetTextExtentPoint32W
-#endif
-BOOL   qxeGetTextExtentPoint32 (HDC arg1, const Extbyte * arg2, int arg3, LPSIZE arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTextExtentExPoint
-#define GetTextExtentExPoint error_use_qxeGetTextExtentExPoint_or_GetTextExtentExPointA_and_GetTextExtentExPointW
-#endif
-BOOL   qxeGetTextExtentExPoint (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPINT arg5, LPINT arg6, LPSIZE arg7);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCharacterPlacement
-#define GetCharacterPlacement error_use_qxeGetCharacterPlacement_or_GetCharacterPlacementA_and_GetCharacterPlacementW
-#endif
-DWORD qxeGetCharacterPlacement (HDC arg1, const Extbyte * arg2, int arg3, int arg4, LPGCP_RESULTSW arg5, DWORD arg6);
-
-#undef GetGlyphIndices
-#define GetGlyphIndices error_NT_5_0__only
-
-#undef AddFontResourceEx
-#define AddFontResourceEx error_NT_5_0__only
-
-#undef RemoveFontResourceEx
-#define RemoveFontResourceEx error_NT_5_0__only
-
-#undef CreateFontIndirectEx
-#define CreateFontIndirectEx error_split_sized_ENUMLOGFONTEXDV__NT_5_0__only
-
-/* Skipping ResetDC because split-sized DEVMODE */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RemoveFontResource
-#define RemoveFontResource error_use_qxeRemoveFontResource_or_RemoveFontResourceA_and_RemoveFontResourceW
-#endif
-BOOL qxeRemoveFontResource (const Extbyte * arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CopyEnhMetaFile
-#define CopyEnhMetaFile error_use_qxeCopyEnhMetaFile_or_CopyEnhMetaFileA_and_CopyEnhMetaFileW
-#endif
-HENHMETAFILE qxeCopyEnhMetaFile (HENHMETAFILE arg1, const Extbyte * arg2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateEnhMetaFile
-#define CreateEnhMetaFile error_use_qxeCreateEnhMetaFile_or_CreateEnhMetaFileA_and_CreateEnhMetaFileW
-#endif
-HDC qxeCreateEnhMetaFile (HDC arg1, const Extbyte * arg2, CONST RECT * arg3, const Extbyte * arg4);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetEnhMetaFile
-#define GetEnhMetaFile error_use_qxeGetEnhMetaFile_or_GetEnhMetaFileA_and_GetEnhMetaFileW
-#endif
-HENHMETAFILE qxeGetEnhMetaFile (const Extbyte * arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetEnhMetaFileDescription
-#define GetEnhMetaFileDescription error_use_qxeGetEnhMetaFileDescription_or_GetEnhMetaFileDescriptionA_and_GetEnhMetaFileDescriptionW
-#endif
-UINT qxeGetEnhMetaFileDescription (HENHMETAFILE arg1, UINT arg2, Extbyte * arg3);
-
-/* Skipping GetTextMetrics because split-sized LPTEXTMETRIC */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef StartDoc
-#define StartDoc error_use_qxeStartDoc_or_StartDocA_and_StartDocW
-#endif
-int qxeStartDoc (HDC arg1, CONST DOCINFOW * arg2);
-
-/* Skipping GetObject because split-sized LOGFONT */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef TextOut
-#define TextOut error_use_qxeTextOut_or_TextOutA_and_TextOutW
-#endif
-BOOL qxeTextOut (HDC arg1, int arg2, int arg3, const Extbyte * arg4, int arg5);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ExtTextOut
-#define ExtTextOut error_use_qxeExtTextOut_or_ExtTextOutA_and_ExtTextOutW
-#endif
-BOOL qxeExtTextOut (HDC arg1, int arg2, int arg3, UINT arg4, CONST RECT * arg5, const Extbyte * arg6, UINT arg7, CONST INT * arg8);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef PolyTextOut
-#define PolyTextOut error_use_qxePolyTextOut_or_PolyTextOutA_and_PolyTextOutW
-#endif
-BOOL qxePolyTextOut (HDC arg1, CONST POLYTEXTW * arg2, int arg3);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTextFace
-#define GetTextFace error_use_qxeGetTextFace_or_GetTextFaceA_and_GetTextFaceW
-#endif
-int qxeGetTextFace (HDC arg1, int arg2, Extbyte * arg3);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetKerningPairs
-#define GetKerningPairs error_use_qxeGetKerningPairs_or_GetKerningPairsA_and_GetKerningPairsW
-#endif
-DWORD qxeGetKerningPairs (HDC arg1, DWORD arg2, LPKERNINGPAIR arg3);
-
-#undef GetLogColorSpace
-#define GetLogColorSpace error_split_sized_LPLOGCOLORSPACE__NT_4_0__only
-
-#undef CreateColorSpace
-#define CreateColorSpace error_split_sized_LPLOGCOLORSPACE__NT_4_0__only
-
-/* Skipping GetICMProfile because NT 4.0+ only, error in Cygwin prototype */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetICMProfile
-#define SetICMProfile error_use_qxeSetICMProfile_or_SetICMProfileA_and_SetICMProfileW
-#endif
-BOOL qxeSetICMProfile (HDC arg1, Extbyte * arg2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef EnumICMProfiles
-#define EnumICMProfiles error_use_qxeEnumICMProfiles_or_EnumICMProfilesA_and_EnumICMProfilesW
-#endif
-int qxeEnumICMProfiles (HDC arg1, ICMENUMPROCW arg2, LPARAM arg3);
-
-/* Skipping UpdateICMRegKey because NT 4.0+ only, error in Cygwin prototype */
-
-#undef wglUseFontBitmaps
-#define wglUseFontBitmaps error_causes_link_error
-
-#undef wglUseFontOutlines
-#define wglUseFontOutlines error_causes_link_error
-
-
-/* Processing file WINNLS.H */
-
-#undef GetCPInfoEx
-#define GetCPInfoEx error_not_used__not_examined_yet
-
-#undef CompareString
-#define CompareString error_not_used__not_examined_yet
-
-#undef LCMapString
-#define LCMapString error_not_used__not_examined_yet
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetLocaleInfo
-#define GetLocaleInfo error_use_qxeGetLocaleInfo_or_GetLocaleInfoA_and_GetLocaleInfoW
-#endif
-int qxeGetLocaleInfo (LCID Locale, LCTYPE LCType, Extbyte * lpLCData, int cchData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetLocaleInfo
-#define SetLocaleInfo error_use_qxeSetLocaleInfo_or_SetLocaleInfoA_and_SetLocaleInfoW
-#endif
-BOOL qxeSetLocaleInfo (LCID Locale, LCTYPE LCType, const Extbyte * lpLCData);
-
-#undef GetTimeFormat
-#define GetTimeFormat error_not_used__not_examined_yet
-
-#undef GetDateFormat
-#define GetDateFormat error_not_used__not_examined_yet
-
-#undef GetNumberFormat
-#define GetNumberFormat error_not_used__not_examined_yet
-
-#undef GetCurrencyFormat
-#define GetCurrencyFormat error_not_used__not_examined_yet
-
-#undef EnumCalendarInfo
-#define EnumCalendarInfo error_not_used__not_examined_yet
-
-#undef EnumCalendarInfoEx
-#define EnumCalendarInfoEx error_not_used__not_examined_yet
-
-#undef EnumTimeFormats
-#define EnumTimeFormats error_not_used__not_examined_yet
-
-#undef EnumDateFormats
-#define EnumDateFormats error_not_used__not_examined_yet
-
-#undef EnumDateFormatsEx
-#define EnumDateFormatsEx error_not_used__not_examined_yet
-
-#undef GetStringTypeEx
-#define GetStringTypeEx error_not_used__not_examined_yet
-
-#undef GetStringType
-#define GetStringType error_no_such_fun__A_and_W_versions_have_different_nos__of_args
-
-#undef FoldString
-#define FoldString error_not_used__not_examined_yet
-
-#undef EnumSystemLocales
-#define EnumSystemLocales error_not_used__not_examined_yet
-
-#undef EnumSystemCodePages
-#define EnumSystemCodePages error_not_used__not_examined_yet
-
-
-/* Processing file WINREG.H */
-
-/* Skipping RegConnectRegistry because error in Cygwin prototype */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegCreateKey
-#define RegCreateKey error_use_qxeRegCreateKey_or_RegCreateKeyA_and_RegCreateKeyW
-#endif
-LONG
- qxeRegCreateKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegCreateKeyEx
-#define RegCreateKeyEx error_use_qxeRegCreateKeyEx_or_RegCreateKeyExA_and_RegCreateKeyExW
-#endif
-LONG
- qxeRegCreateKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD Reserved, Extbyte * lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegDeleteKey
-#define RegDeleteKey error_use_qxeRegDeleteKey_or_RegDeleteKeyA_and_RegDeleteKeyW
-#endif
-LONG
- qxeRegDeleteKey (HKEY hKey, const Extbyte * lpSubKey);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegDeleteValue
-#define RegDeleteValue error_use_qxeRegDeleteValue_or_RegDeleteValueA_and_RegDeleteValueW
-#endif
-LONG
- qxeRegDeleteValue (HKEY hKey, const Extbyte * lpValueName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegEnumKey
-#define RegEnumKey error_use_qxeRegEnumKey_or_RegEnumKeyA_and_RegEnumKeyW
-#endif
-LONG
- qxeRegEnumKey (HKEY hKey, DWORD dwIndex, Extbyte * lpName, DWORD cbName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegEnumKeyEx
-#define RegEnumKeyEx error_use_qxeRegEnumKeyEx_or_RegEnumKeyExA_and_RegEnumKeyExW
-#endif
-LONG
- qxeRegEnumKeyEx (HKEY hKey, DWORD dwIndex, Extbyte * lpName, LPDWORD lpcbName, LPDWORD lpReserved, Extbyte * lpClass, LPDWORD lpcbClass, PFILETIME lpftLastWriteTime);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegEnumValue
-#define RegEnumValue error_use_qxeRegEnumValue_or_RegEnumValueA_and_RegEnumValueW
-#endif
-LONG
- qxeRegEnumValue (HKEY hKey, DWORD dwIndex, Extbyte * lpValueName, LPDWORD lpcbValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegLoadKey
-#define RegLoadKey error_use_qxeRegLoadKey_or_RegLoadKeyA_and_RegLoadKeyW
-#endif
-LONG
- qxeRegLoadKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpFile);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegOpenKey
-#define RegOpenKey error_use_qxeRegOpenKey_or_RegOpenKeyA_and_RegOpenKeyW
-#endif
-LONG
- qxeRegOpenKey (HKEY hKey, const Extbyte * lpSubKey, PHKEY phkResult);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegOpenKeyEx
-#define RegOpenKeyEx error_use_qxeRegOpenKeyEx_or_RegOpenKeyExA_and_RegOpenKeyExW
-#endif
-LONG
- qxeRegOpenKeyEx (HKEY hKey, const Extbyte * lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegQueryInfoKey
-#define RegQueryInfoKey error_use_qxeRegQueryInfoKey_or_RegQueryInfoKeyA_and_RegQueryInfoKeyW
-#endif
-LONG
- qxeRegQueryInfoKey (HKEY hKey, Extbyte * lpClass, LPDWORD lpcbClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcbMaxSubKeyLen, LPDWORD lpcbMaxClassLen, LPDWORD lpcValues, LPDWORD lpcbMaxValueNameLen, LPDWORD lpcbMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegQueryValue
-#define RegQueryValue error_use_qxeRegQueryValue_or_RegQueryValueA_and_RegQueryValueW
-#endif
-LONG
- qxeRegQueryValue (HKEY hKey, const Extbyte * lpSubKey, Extbyte * lpValue, PLONG lpcbValue);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegQueryMultipleValues
-#define RegQueryMultipleValues error_use_qxeRegQueryMultipleValues_or_RegQueryMultipleValuesA_and_RegQueryMultipleValuesW
-#endif
-LONG
- qxeRegQueryMultipleValues (HKEY hKey, PVALENTW val_list, DWORD num_vals, Extbyte * lpValueBuf, LPDWORD ldwTotsize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegQueryValueEx
-#define RegQueryValueEx error_use_qxeRegQueryValueEx_or_RegQueryValueExA_and_RegQueryValueExW
-#endif
-LONG
- qxeRegQueryValueEx (HKEY hKey, const Extbyte * lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegReplaceKey
-#define RegReplaceKey error_use_qxeRegReplaceKey_or_RegReplaceKeyA_and_RegReplaceKeyW
-#endif
-LONG
- qxeRegReplaceKey (HKEY hKey, const Extbyte * lpSubKey, const Extbyte * lpNewFile, const Extbyte * lpOldFile);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegRestoreKey
-#define RegRestoreKey error_use_qxeRegRestoreKey_or_RegRestoreKeyA_and_RegRestoreKeyW
-#endif
-LONG
- qxeRegRestoreKey (HKEY hKey, const Extbyte * lpFile, DWORD dwFlags);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegSaveKey
-#define RegSaveKey error_use_qxeRegSaveKey_or_RegSaveKeyA_and_RegSaveKeyW
-#endif
-LONG
- qxeRegSaveKey (HKEY hKey, const Extbyte * lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegSetValue
-#define RegSetValue error_use_qxeRegSetValue_or_RegSetValueA_and_RegSetValueW
-#endif
-LONG
- qxeRegSetValue (HKEY hKey, const Extbyte * lpSubKey, DWORD dwType, const Extbyte * lpData, DWORD cbData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegSetValueEx
-#define RegSetValueEx error_use_qxeRegSetValueEx_or_RegSetValueExA_and_RegSetValueExW
-#endif
-LONG
- qxeRegSetValueEx (HKEY hKey, const Extbyte * lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE* lpData, DWORD cbData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegUnLoadKey
-#define RegUnLoadKey error_use_qxeRegUnLoadKey_or_RegUnLoadKeyA_and_RegUnLoadKeyW
-#endif
-LONG
- qxeRegUnLoadKey (HKEY hKey, const Extbyte * lpSubKey);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef InitiateSystemShutdown
-#define InitiateSystemShutdown error_use_qxeInitiateSystemShutdown_or_InitiateSystemShutdownA_and_InitiateSystemShutdownW
-#endif
-BOOL
- qxeInitiateSystemShutdown (Extbyte * lpMachineName, Extbyte * lpMessage, DWORD dwTimeout, BOOL bForceAppsClosed, BOOL bRebootAfterShutdown);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef AbortSystemShutdown
-#define AbortSystemShutdown error_use_qxeAbortSystemShutdown_or_AbortSystemShutdownA_and_AbortSystemShutdownW
-#endif
-BOOL
- qxeAbortSystemShutdown (Extbyte * lpMachineName);
-
-
-/* Processing file COMMDLG.H */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetOpenFileName
-#define GetOpenFileName error_use_qxeGetOpenFileName_or_GetOpenFileNameA_and_GetOpenFileNameW
-#endif
-BOOL   qxeGetOpenFileName (LPOPENFILENAMEW arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetSaveFileName
-#define GetSaveFileName error_use_qxeGetSaveFileName_or_GetSaveFileNameA_and_GetSaveFileNameW
-#endif
-BOOL   qxeGetSaveFileName (LPOPENFILENAMEW arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetFileTitle
-#define GetFileTitle error_use_qxeGetFileTitle_or_GetFileTitleA_and_GetFileTitleW
-#endif
-short  qxeGetFileTitle (const Extbyte * arg1, Extbyte * arg2, WORD arg3);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ChooseColor
-#define ChooseColor error_use_qxeChooseColor_or_ChooseColorA_and_ChooseColorW
-#endif
-BOOL   qxeChooseColor (LPCHOOSECOLORW arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindText
-#define FindText error_use_qxeFindText_or_FindTextA_and_FindTextW
-#endif
-HWND   qxeFindText (LPFINDREPLACEW arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReplaceText
-#define ReplaceText error_use_qxeReplaceText_or_ReplaceTextA_and_ReplaceTextW
-#endif
-HWND   qxeReplaceText (LPFINDREPLACEW arg1);
-
-#undef AfxReplaceText
-#define AfxReplaceText error_mac_only
-
-#undef ChooseFont
-#define ChooseFont error_split_sized_LPLOGFONT_in_LPCHOOSEFONT
-
-/* Skipping PrintDlg because LPPRINTDLG with split-sized DEVMODE handle */
-
-/* Skipping PageSetupDlg because LPPAGESETUPDLG with split-sized DEVMODE handle */
-
-
-/* Processing file SHLOBJ.H */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SHGetPathFromIDList
-#define SHGetPathFromIDList error_use_qxeSHGetPathFromIDList_or_SHGetPathFromIDListA_and_SHGetPathFromIDListW
-#endif
-BOOL qxeSHGetPathFromIDList (LPCITEMIDLIST pidl, Extbyte * pszPath);
-
-/* Skipping SHGetSpecialFolderPath because error in Cygwin prototype, missing from Cygwin libraries */
-
-/* Skipping SHBrowseForFolder because need to intercept callback for SendMessage */
-
-/* Skipping SHGetDataFromIDList because split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries */
-
-
-/* Processing file WINBASE.H */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetBinaryType
-#define GetBinaryType error_use_qxeGetBinaryType_or_GetBinaryTypeA_and_GetBinaryTypeW
-#endif
-BOOL qxeGetBinaryType (const Extbyte * lpApplicationName, LPDWORD lpBinaryType);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetShortPathName
-#define GetShortPathName error_use_qxeGetShortPathName_or_GetShortPathNameA_and_GetShortPathNameW
-#endif
-DWORD qxeGetShortPathName (const Extbyte * lpszLongPath, Extbyte * lpszShortPath, DWORD cchBuffer);
-
-#undef GetLongPathName
-#define GetLongPathName error_Win98_2K__only
-
-/* Skipping GetEnvironmentStrings because misnamed ANSI version of the function */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FreeEnvironmentStrings
-#define FreeEnvironmentStrings error_use_qxeFreeEnvironmentStrings_or_FreeEnvironmentStringsA_and_FreeEnvironmentStringsW
-#endif
-BOOL qxeFreeEnvironmentStrings (Extbyte * arg1);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FormatMessage
-#define FormatMessage error_use_qxeFormatMessage_or_FormatMessageA_and_FormatMessageW
-#endif
-DWORD qxeFormatMessage (DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, Extbyte * lpBuffer, DWORD nSize, va_list * Arguments);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateMailslot
-#define CreateMailslot error_use_qxeCreateMailslot_or_CreateMailslotA_and_CreateMailslotW
-#endif
-HANDLE qxeCreateMailslot (const Extbyte * lpName, DWORD nMaxMessageSize, DWORD lReadTimeout, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
-
-#if !defined (CYGWIN_HEADERS)
-#undef EncryptFile
-#define EncryptFile error_Win2K__only
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#if !defined (CYGWIN_HEADERS)
-#undef DecryptFile
-#define DecryptFile error_Win2K__only
-#endif /* !defined (CYGWIN_HEADERS) */
-
-#undef OpenRaw
-#define OpenRaw error_error__The_procedure_entry_point_OpenRawW_could_not_be_located_in_the_dynamic_link_library_ADVAPI32_dll__
-
-#undef QueryRecoveryAgents
-#define QueryRecoveryAgents error_split_sized_LPRECOVERY_AGENT_INFORMATION
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef lstrcmp
-#define lstrcmp error_use_qxelstrcmp_or_lstrcmpA_and_lstrcmpW
-#endif
-int qxelstrcmp (const Extbyte * lpString1, const Extbyte * lpString2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef lstrcmpi
-#define lstrcmpi error_use_qxelstrcmpi_or_lstrcmpiA_and_lstrcmpiW
-#endif
-int qxelstrcmpi (const Extbyte * lpString1, const Extbyte * lpString2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef lstrcpyn
-#define lstrcpyn error_use_qxelstrcpyn_or_lstrcpynA_and_lstrcpynW
-#endif
-Extbyte * qxelstrcpyn (Extbyte * lpString1, const Extbyte * lpString2, int iMaxLength);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef lstrcpy
-#define lstrcpy error_use_qxelstrcpy_or_lstrcpyA_and_lstrcpyW
-#endif
-Extbyte * qxelstrcpy (Extbyte * lpString1, const Extbyte * lpString2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef lstrcat
-#define lstrcat error_use_qxelstrcat_or_lstrcatA_and_lstrcatW
-#endif
-Extbyte * qxelstrcat (Extbyte * lpString1, const Extbyte * lpString2);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef lstrlen
-#define lstrlen error_use_qxelstrlen_or_lstrlenA_and_lstrlenW
-#endif
-int qxelstrlen (const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateMutex
-#define CreateMutex error_use_qxeCreateMutex_or_CreateMutexA_and_CreateMutexW
-#endif
-HANDLE qxeCreateMutex (LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenMutex
-#define OpenMutex error_use_qxeOpenMutex_or_OpenMutexA_and_OpenMutexW
-#endif
-HANDLE qxeOpenMutex (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateEvent
-#define CreateEvent error_use_qxeCreateEvent_or_CreateEventA_and_CreateEventW
-#endif
-HANDLE qxeCreateEvent (LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenEvent
-#define OpenEvent error_use_qxeOpenEvent_or_OpenEventA_and_OpenEventW
-#endif
-HANDLE qxeOpenEvent (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateSemaphore
-#define CreateSemaphore error_use_qxeCreateSemaphore_or_CreateSemaphoreA_and_CreateSemaphoreW
-#endif
-HANDLE qxeCreateSemaphore (LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenSemaphore
-#define OpenSemaphore error_use_qxeOpenSemaphore_or_OpenSemaphoreA_and_OpenSemaphoreW
-#endif
-HANDLE qxeOpenSemaphore (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateWaitableTimer
-#define CreateWaitableTimer error_use_qxeCreateWaitableTimer_or_CreateWaitableTimerA_and_CreateWaitableTimerW
-#endif
-HANDLE qxeCreateWaitableTimer (LPSECURITY_ATTRIBUTES lpTimerAttributes, BOOL bManualReset, const Extbyte * lpTimerName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenWaitableTimer
-#define OpenWaitableTimer error_use_qxeOpenWaitableTimer_or_OpenWaitableTimerA_and_OpenWaitableTimerW
-#endif
-HANDLE qxeOpenWaitableTimer (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpTimerName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateFileMapping
-#define CreateFileMapping error_use_qxeCreateFileMapping_or_CreateFileMappingA_and_CreateFileMappingW
-#endif
-HANDLE qxeCreateFileMapping (HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenFileMapping
-#define OpenFileMapping error_use_qxeOpenFileMapping_or_OpenFileMappingA_and_OpenFileMappingW
-#endif
-HANDLE qxeOpenFileMapping (DWORD dwDesiredAccess, BOOL bInheritHandle, const Extbyte * lpName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetLogicalDriveStrings
-#define GetLogicalDriveStrings error_use_qxeGetLogicalDriveStrings_or_GetLogicalDriveStringsA_and_GetLogicalDriveStringsW
-#endif
-DWORD qxeGetLogicalDriveStrings (DWORD nBufferLength, Extbyte * lpBuffer);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadLibrary
-#define LoadLibrary error_use_qxeLoadLibrary_or_LoadLibraryA_and_LoadLibraryW
-#endif
-HMODULE qxeLoadLibrary (const Extbyte * lpLibFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LoadLibraryEx
-#define LoadLibraryEx error_use_qxeLoadLibraryEx_or_LoadLibraryExA_and_LoadLibraryExW
-#endif
-HMODULE qxeLoadLibraryEx (const Extbyte * lpLibFileName, HANDLE hFile, DWORD dwFlags);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetModuleFileName
-#define GetModuleFileName error_use_qxeGetModuleFileName_or_GetModuleFileNameA_and_GetModuleFileNameW
-#endif
-DWORD qxeGetModuleFileName (HMODULE hModule, Extbyte * lpFilename, DWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetModuleHandle
-#define GetModuleHandle error_use_qxeGetModuleHandle_or_GetModuleHandleA_and_GetModuleHandleW
-#endif
-HMODULE qxeGetModuleHandle (const Extbyte * lpModuleName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateProcess
-#define CreateProcess error_use_qxeCreateProcess_or_CreateProcessA_and_CreateProcessW
-#endif
-BOOL qxeCreateProcess (const Extbyte * lpApplicationName, Extbyte * lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const Extbyte * lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FatalAppExit
-#define FatalAppExit error_use_qxeFatalAppExit_or_FatalAppExitA_and_FatalAppExitW
-#endif
-VOID qxeFatalAppExit (UINT uAction, const Extbyte * lpMessageText);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetStartupInfo
-#define GetStartupInfo error_use_qxeGetStartupInfo_or_GetStartupInfoA_and_GetStartupInfoW
-#endif
-VOID qxeGetStartupInfo (LPSTARTUPINFOW lpStartupInfo);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCommandLine
-#define GetCommandLine error_use_qxeGetCommandLine_or_GetCommandLineA_and_GetCommandLineW
-#endif
-Extbyte * qxeGetCommandLine (void);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetEnvironmentVariable
-#define GetEnvironmentVariable error_use_qxeGetEnvironmentVariable_or_GetEnvironmentVariableA_and_GetEnvironmentVariableW
-#endif
-DWORD qxeGetEnvironmentVariable (const Extbyte * lpName, Extbyte * lpBuffer, DWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetEnvironmentVariable
-#define SetEnvironmentVariable error_use_qxeSetEnvironmentVariable_or_SetEnvironmentVariableA_and_SetEnvironmentVariableW
-#endif
-BOOL qxeSetEnvironmentVariable (const Extbyte * lpName, const Extbyte * lpValue);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ExpandEnvironmentStrings
-#define ExpandEnvironmentStrings error_use_qxeExpandEnvironmentStrings_or_ExpandEnvironmentStringsA_and_ExpandEnvironmentStringsW
-#endif
-DWORD qxeExpandEnvironmentStrings (const Extbyte * lpSrc, Extbyte * lpDst, DWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OutputDebugString
-#define OutputDebugString error_use_qxeOutputDebugString_or_OutputDebugStringA_and_OutputDebugStringW
-#endif
-VOID qxeOutputDebugString (const Extbyte * lpOutputString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindResource
-#define FindResource error_use_qxeFindResource_or_FindResourceA_and_FindResourceW
-#endif
-HRSRC qxeFindResource (HMODULE hModule, const Extbyte * lpName, const Extbyte * lpType);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindResourceEx
-#define FindResourceEx error_use_qxeFindResourceEx_or_FindResourceExA_and_FindResourceExW
-#endif
-HRSRC qxeFindResourceEx (HMODULE hModule, const Extbyte * lpType, const Extbyte * lpName, WORD wLanguage);
-
-/* Skipping EnumResourceTypes because different prototypes in VC6 and VC7 */
-
-/* Skipping EnumResourceNames because different prototypes in VC6 and VC7 */
-
-/* Skipping EnumResourceLanguages because different prototypes in VC6 and VC7 */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef BeginUpdateResource
-#define BeginUpdateResource error_use_qxeBeginUpdateResource_or_BeginUpdateResourceA_and_BeginUpdateResourceW
-#endif
-HANDLE qxeBeginUpdateResource (const Extbyte * pFileName, BOOL bDeleteExistingResources);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef UpdateResource
-#define UpdateResource error_use_qxeUpdateResource_or_UpdateResourceA_and_UpdateResourceW
-#endif
-BOOL qxeUpdateResource (HANDLE hUpdate, const Extbyte * lpType, const Extbyte * lpName, WORD wLanguage, LPVOID lpData, DWORD cbData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef EndUpdateResource
-#define EndUpdateResource error_use_qxeEndUpdateResource_or_EndUpdateResourceA_and_EndUpdateResourceW
-#endif
-BOOL qxeEndUpdateResource (HANDLE hUpdate, BOOL fDiscard);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GlobalAddAtom
-#define GlobalAddAtom error_use_qxeGlobalAddAtom_or_GlobalAddAtomA_and_GlobalAddAtomW
-#endif
-ATOM qxeGlobalAddAtom (const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GlobalFindAtom
-#define GlobalFindAtom error_use_qxeGlobalFindAtom_or_GlobalFindAtomA_and_GlobalFindAtomW
-#endif
-ATOM qxeGlobalFindAtom (const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GlobalGetAtomName
-#define GlobalGetAtomName error_use_qxeGlobalGetAtomName_or_GlobalGetAtomNameA_and_GlobalGetAtomNameW
-#endif
-UINT qxeGlobalGetAtomName (ATOM nAtom, Extbyte * lpBuffer, int nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef AddAtom
-#define AddAtom error_use_qxeAddAtom_or_AddAtomA_and_AddAtomW
-#endif
-ATOM qxeAddAtom (const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindAtom
-#define FindAtom error_use_qxeFindAtom_or_FindAtomA_and_FindAtomW
-#endif
-ATOM qxeFindAtom (const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetAtomName
-#define GetAtomName error_use_qxeGetAtomName_or_GetAtomNameA_and_GetAtomNameW
-#endif
-UINT qxeGetAtomName (ATOM nAtom, Extbyte * lpBuffer, int nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetProfileInt
-#define GetProfileInt error_use_qxeGetProfileInt_or_GetProfileIntA_and_GetProfileIntW
-#endif
-UINT qxeGetProfileInt (const Extbyte * lpAppName, const Extbyte * lpKeyName, INT nDefault);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetProfileString
-#define GetProfileString error_use_qxeGetProfileString_or_GetProfileStringA_and_GetProfileStringW
-#endif
-DWORD qxeGetProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpDefault, Extbyte * lpReturnedString, DWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WriteProfileString
-#define WriteProfileString error_use_qxeWriteProfileString_or_WriteProfileStringA_and_WriteProfileStringW
-#endif
-BOOL qxeWriteProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetProfileSection
-#define GetProfileSection error_use_qxeGetProfileSection_or_GetProfileSectionA_and_GetProfileSectionW
-#endif
-DWORD qxeGetProfileSection (const Extbyte * lpAppName, Extbyte * lpReturnedString, DWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WriteProfileSection
-#define WriteProfileSection error_use_qxeWriteProfileSection_or_WriteProfileSectionA_and_WriteProfileSectionW
-#endif
-BOOL qxeWriteProfileSection (const Extbyte * lpAppName, const Extbyte * lpString);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetPrivateProfileInt
-#define GetPrivateProfileInt error_use_qxeGetPrivateProfileInt_or_GetPrivateProfileIntA_and_GetPrivateProfileIntW
-#endif
-UINT qxeGetPrivateProfileInt (const Extbyte * lpAppName, const Extbyte * lpKeyName, INT nDefault, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetPrivateProfileString
-#define GetPrivateProfileString error_use_qxeGetPrivateProfileString_or_GetPrivateProfileStringA_and_GetPrivateProfileStringW
-#endif
-DWORD qxeGetPrivateProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpDefault, Extbyte * lpReturnedString, DWORD nSize, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WritePrivateProfileString
-#define WritePrivateProfileString error_use_qxeWritePrivateProfileString_or_WritePrivateProfileStringA_and_WritePrivateProfileStringW
-#endif
-BOOL qxeWritePrivateProfileString (const Extbyte * lpAppName, const Extbyte * lpKeyName, const Extbyte * lpString, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetPrivateProfileSection
-#define GetPrivateProfileSection error_use_qxeGetPrivateProfileSection_or_GetPrivateProfileSectionA_and_GetPrivateProfileSectionW
-#endif
-DWORD qxeGetPrivateProfileSection (const Extbyte * lpAppName, Extbyte * lpReturnedString, DWORD nSize, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WritePrivateProfileSection
-#define WritePrivateProfileSection error_use_qxeWritePrivateProfileSection_or_WritePrivateProfileSectionA_and_WritePrivateProfileSectionW
-#endif
-BOOL qxeWritePrivateProfileSection (const Extbyte * lpAppName, const Extbyte * lpString, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetPrivateProfileSectionNames
-#define GetPrivateProfileSectionNames error_use_qxeGetPrivateProfileSectionNames_or_GetPrivateProfileSectionNamesA_and_GetPrivateProfileSectionNamesW
-#endif
-DWORD qxeGetPrivateProfileSectionNames (Extbyte * lpszReturnBuffer, DWORD nSize, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetPrivateProfileStruct
-#define GetPrivateProfileStruct error_use_qxeGetPrivateProfileStruct_or_GetPrivateProfileStructA_and_GetPrivateProfileStructW
-#endif
-BOOL qxeGetPrivateProfileStruct (const Extbyte * lpszSection, const Extbyte * lpszKey, LPVOID lpStruct, UINT uSizeStruct, const Extbyte * szFile);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WritePrivateProfileStruct
-#define WritePrivateProfileStruct error_use_qxeWritePrivateProfileStruct_or_WritePrivateProfileStructA_and_WritePrivateProfileStructW
-#endif
-BOOL qxeWritePrivateProfileStruct (const Extbyte * lpszSection, const Extbyte * lpszKey, LPVOID lpStruct, UINT uSizeStruct, const Extbyte * szFile);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetDriveType
-#define GetDriveType error_use_qxeGetDriveType_or_GetDriveTypeA_and_GetDriveTypeW
-#endif
-UINT qxeGetDriveType (const Extbyte * lpRootPathName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetSystemDirectory
-#define GetSystemDirectory error_use_qxeGetSystemDirectory_or_GetSystemDirectoryA_and_GetSystemDirectoryW
-#endif
-UINT qxeGetSystemDirectory (Extbyte * lpBuffer, UINT uSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTempPath
-#define GetTempPath error_use_qxeGetTempPath_or_GetTempPathA_and_GetTempPathW
-#endif
-DWORD qxeGetTempPath (DWORD nBufferLength, Extbyte * lpBuffer);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetTempFileName
-#define GetTempFileName error_use_qxeGetTempFileName_or_GetTempFileNameA_and_GetTempFileNameW
-#endif
-UINT qxeGetTempFileName (const Extbyte * lpPathName, const Extbyte * lpPrefixString, UINT uUnique, Extbyte * lpTempFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetWindowsDirectory
-#define GetWindowsDirectory error_use_qxeGetWindowsDirectory_or_GetWindowsDirectoryA_and_GetWindowsDirectoryW
-#endif
-UINT qxeGetWindowsDirectory (Extbyte * lpBuffer, UINT uSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetCurrentDirectory
-#define SetCurrentDirectory error_use_qxeSetCurrentDirectory_or_SetCurrentDirectoryA_and_SetCurrentDirectoryW
-#endif
-BOOL qxeSetCurrentDirectory (const Extbyte * lpPathName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCurrentDirectory
-#define GetCurrentDirectory error_use_qxeGetCurrentDirectory_or_GetCurrentDirectoryA_and_GetCurrentDirectoryW
-#endif
-DWORD qxeGetCurrentDirectory (DWORD nBufferLength, Extbyte * lpBuffer);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetDiskFreeSpace
-#define GetDiskFreeSpace error_use_qxeGetDiskFreeSpace_or_GetDiskFreeSpaceA_and_GetDiskFreeSpaceW
-#endif
-BOOL qxeGetDiskFreeSpace (const Extbyte * lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetDiskFreeSpaceEx
-#define GetDiskFreeSpaceEx error_use_qxeGetDiskFreeSpaceEx_or_GetDiskFreeSpaceExA_and_GetDiskFreeSpaceExW
-#endif
-BOOL qxeGetDiskFreeSpaceEx (const Extbyte * lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateDirectory
-#define CreateDirectory error_use_qxeCreateDirectory_or_CreateDirectoryA_and_CreateDirectoryW
-#endif
-BOOL qxeCreateDirectory (const Extbyte * lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateDirectoryEx
-#define CreateDirectoryEx error_use_qxeCreateDirectoryEx_or_CreateDirectoryExA_and_CreateDirectoryExW
-#endif
-BOOL qxeCreateDirectoryEx (const Extbyte * lpTemplateDirectory, const Extbyte * lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RemoveDirectory
-#define RemoveDirectory error_use_qxeRemoveDirectory_or_RemoveDirectoryA_and_RemoveDirectoryW
-#endif
-BOOL qxeRemoveDirectory (const Extbyte * lpPathName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetFullPathName
-#define GetFullPathName error_use_qxeGetFullPathName_or_GetFullPathNameA_and_GetFullPathNameW
-#endif
-DWORD qxeGetFullPathName (const Extbyte * lpFileName, DWORD nBufferLength, Extbyte * lpBuffer, Extbyte * * lpFilePart);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DefineDosDevice
-#define DefineDosDevice error_use_qxeDefineDosDevice_or_DefineDosDeviceA_and_DefineDosDeviceW
-#endif
-BOOL qxeDefineDosDevice (DWORD dwFlags, const Extbyte * lpDeviceName, const Extbyte * lpTargetPath);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef QueryDosDevice
-#define QueryDosDevice error_use_qxeQueryDosDevice_or_QueryDosDeviceA_and_QueryDosDeviceW
-#endif
-DWORD qxeQueryDosDevice (const Extbyte * lpDeviceName, Extbyte * lpTargetPath, DWORD ucchMax);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateFile
-#define CreateFile error_use_qxeCreateFile_or_CreateFileA_and_CreateFileW
-#endif
-HANDLE qxeCreateFile (const Extbyte * lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetFileAttributes
-#define SetFileAttributes error_use_qxeSetFileAttributes_or_SetFileAttributesA_and_SetFileAttributesW
-#endif
-BOOL qxeSetFileAttributes (const Extbyte * lpFileName, DWORD dwFileAttributes);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetFileAttributes
-#define GetFileAttributes error_use_qxeGetFileAttributes_or_GetFileAttributesA_and_GetFileAttributesW
-#endif
-DWORD qxeGetFileAttributes (const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetFileAttributesEx
-#define GetFileAttributesEx error_use_qxeGetFileAttributesEx_or_GetFileAttributesExA_and_GetFileAttributesExW
-#endif
-BOOL qxeGetFileAttributesEx (const Extbyte * lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetCompressedFileSize
-#define GetCompressedFileSize error_use_qxeGetCompressedFileSize_or_GetCompressedFileSizeA_and_GetCompressedFileSizeW
-#endif
-DWORD qxeGetCompressedFileSize (const Extbyte * lpFileName, LPDWORD lpFileSizeHigh);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef DeleteFile
-#define DeleteFile error_use_qxeDeleteFile_or_DeleteFileA_and_DeleteFileW
-#endif
-BOOL qxeDeleteFile (const Extbyte * lpFileName);
-
-#undef FindFirstFileEx
-#define FindFirstFileEx error_split_sized_LPWIN32_FIND_DATA__not_used__NT_4_0__only
-
-/* Skipping FindFirstFile because split-sized LPWIN32_FIND_DATA */
-
-/* Skipping FindNextFile because split-sized LPWIN32_FIND_DATA */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SearchPath
-#define SearchPath error_use_qxeSearchPath_or_SearchPathA_and_SearchPathW
-#endif
-DWORD qxeSearchPath (const Extbyte * lpPath, const Extbyte * lpFileName, const Extbyte * lpExtension, DWORD nBufferLength, Extbyte * lpBuffer, Extbyte * * lpFilePart);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CopyFile
-#define CopyFile error_use_qxeCopyFile_or_CopyFileA_and_CopyFileW
-#endif
-BOOL qxeCopyFile (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, BOOL bFailIfExists);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CopyFileEx
-#define CopyFileEx error_use_qxeCopyFileEx_or_CopyFileExA_and_CopyFileExW
-#endif
-BOOL qxeCopyFileEx (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MoveFile
-#define MoveFile error_use_qxeMoveFile_or_MoveFileA_and_MoveFileW
-#endif
-BOOL qxeMoveFile (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef MoveFileEx
-#define MoveFileEx error_use_qxeMoveFileEx_or_MoveFileExA_and_MoveFileExW
-#endif
-BOOL qxeMoveFileEx (const Extbyte * lpExistingFileName, const Extbyte * lpNewFileName, DWORD dwFlags);
-
-#undef MoveFileWithProgress
-#define MoveFileWithProgress error_NT_5_0__only
-
-#undef CreateHardLink
-#define CreateHardLink error_NT_5_0__only
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateNamedPipe
-#define CreateNamedPipe error_use_qxeCreateNamedPipe_or_CreateNamedPipeA_and_CreateNamedPipeW
-#endif
-HANDLE qxeCreateNamedPipe (const Extbyte * lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetNamedPipeHandleState
-#define GetNamedPipeHandleState error_use_qxeGetNamedPipeHandleState_or_GetNamedPipeHandleStateA_and_GetNamedPipeHandleStateW
-#endif
-BOOL qxeGetNamedPipeHandleState (HANDLE hNamedPipe, LPDWORD lpState, LPDWORD lpCurInstances, LPDWORD lpMaxCollectionCount, LPDWORD lpCollectDataTimeout, Extbyte * lpUserName, DWORD nMaxUserNameSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CallNamedPipe
-#define CallNamedPipe error_use_qxeCallNamedPipe_or_CallNamedPipeA_and_CallNamedPipeW
-#endif
-BOOL qxeCallNamedPipe (const Extbyte * lpNamedPipeName, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, DWORD nTimeOut);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef WaitNamedPipe
-#define WaitNamedPipe error_use_qxeWaitNamedPipe_or_WaitNamedPipeA_and_WaitNamedPipeW
-#endif
-BOOL qxeWaitNamedPipe (const Extbyte * lpNamedPipeName, DWORD nTimeOut);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetVolumeLabel
-#define SetVolumeLabel error_use_qxeSetVolumeLabel_or_SetVolumeLabelA_and_SetVolumeLabelW
-#endif
-BOOL qxeSetVolumeLabel (const Extbyte * lpRootPathName, const Extbyte * lpVolumeName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetVolumeInformation
-#define GetVolumeInformation error_use_qxeGetVolumeInformation_or_GetVolumeInformationA_and_GetVolumeInformationW
-#endif
-BOOL qxeGetVolumeInformation (const Extbyte * lpRootPathName, Extbyte * lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, Extbyte * lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ClearEventLog
-#define ClearEventLog error_use_qxeClearEventLog_or_ClearEventLogA_and_ClearEventLogW
-#endif
-BOOL qxeClearEventLog (HANDLE hEventLog, const Extbyte * lpBackupFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef BackupEventLog
-#define BackupEventLog error_use_qxeBackupEventLog_or_BackupEventLogA_and_BackupEventLogW
-#endif
-BOOL qxeBackupEventLog (HANDLE hEventLog, const Extbyte * lpBackupFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenEventLog
-#define OpenEventLog error_use_qxeOpenEventLog_or_OpenEventLogA_and_OpenEventLogW
-#endif
-HANDLE qxeOpenEventLog (const Extbyte * lpUNCServerName, const Extbyte * lpSourceName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef RegisterEventSource
-#define RegisterEventSource error_use_qxeRegisterEventSource_or_RegisterEventSourceA_and_RegisterEventSourceW
-#endif
-HANDLE qxeRegisterEventSource (const Extbyte * lpUNCServerName, const Extbyte * lpSourceName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef OpenBackupEventLog
-#define OpenBackupEventLog error_use_qxeOpenBackupEventLog_or_OpenBackupEventLogA_and_OpenBackupEventLogW
-#endif
-HANDLE qxeOpenBackupEventLog (const Extbyte * lpUNCServerName, const Extbyte * lpFileName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReadEventLog
-#define ReadEventLog error_use_qxeReadEventLog_or_ReadEventLogA_and_ReadEventLogW
-#endif
-BOOL qxeReadEventLog (HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD      * pnBytesRead, DWORD      * pnMinNumberOfBytesNeeded);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ReportEvent
-#define ReportEvent error_use_qxeReportEvent_or_ReportEventA_and_ReportEventW
-#endif
-BOOL qxeReportEvent (HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, const Extbyte *   * lpStrings, LPVOID lpRawData);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef AccessCheckAndAuditAlarm
-#define AccessCheckAndAuditAlarm error_use_qxeAccessCheckAndAuditAlarm_or_AccessCheckAndAuditAlarmA_and_AccessCheckAndAuditAlarmW
-#endif
-BOOL qxeAccessCheckAndAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, Extbyte * ObjectTypeName, Extbyte * ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD DesiredAccess, PGENERIC_MAPPING GenericMapping, BOOL ObjectCreation, LPDWORD GrantedAccess, LPBOOL AccessStatus, LPBOOL pfGenerateOnClose);
-
-#undef AccessCheckByTypeAndAuditAlarm
-#define AccessCheckByTypeAndAuditAlarm error_NT_5_0__only
-
-#undef AccessCheckByTypeResultListAndAuditAlarm
-#define AccessCheckByTypeResultListAndAuditAlarm error_NT_5_0__only
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ObjectOpenAuditAlarm
-#define ObjectOpenAuditAlarm error_use_qxeObjectOpenAuditAlarm_or_ObjectOpenAuditAlarmA_and_ObjectOpenAuditAlarmW
-#endif
-BOOL qxeObjectOpenAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, Extbyte * ObjectTypeName, Extbyte * ObjectName, PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess, DWORD GrantedAccess, PPRIVILEGE_SET Privileges, BOOL ObjectCreation, BOOL AccessGranted, LPBOOL GenerateOnClose);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ObjectPrivilegeAuditAlarm
-#define ObjectPrivilegeAuditAlarm error_use_qxeObjectPrivilegeAuditAlarm_or_ObjectPrivilegeAuditAlarmA_and_ObjectPrivilegeAuditAlarmW
-#endif
-BOOL qxeObjectPrivilegeAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, HANDLE ClientToken, DWORD DesiredAccess, PPRIVILEGE_SET Privileges, BOOL AccessGranted);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ObjectCloseAuditAlarm
-#define ObjectCloseAuditAlarm error_use_qxeObjectCloseAuditAlarm_or_ObjectCloseAuditAlarmA_and_ObjectCloseAuditAlarmW
-#endif
-BOOL qxeObjectCloseAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, BOOL GenerateOnClose);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef ObjectDeleteAuditAlarm
-#define ObjectDeleteAuditAlarm error_use_qxeObjectDeleteAuditAlarm_or_ObjectDeleteAuditAlarmA_and_ObjectDeleteAuditAlarmW
-#endif
-BOOL qxeObjectDeleteAuditAlarm (const Extbyte * SubsystemName, LPVOID HandleId, BOOL GenerateOnClose);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef PrivilegedServiceAuditAlarm
-#define PrivilegedServiceAuditAlarm error_use_qxePrivilegedServiceAuditAlarm_or_PrivilegedServiceAuditAlarmA_and_PrivilegedServiceAuditAlarmW
-#endif
-BOOL qxePrivilegedServiceAuditAlarm (const Extbyte * SubsystemName, const Extbyte * ServiceName, HANDLE ClientToken, PPRIVILEGE_SET Privileges, BOOL AccessGranted);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetFileSecurity
-#define SetFileSecurity error_use_qxeSetFileSecurity_or_SetFileSecurityA_and_SetFileSecurityW
-#endif
-BOOL qxeSetFileSecurity (const Extbyte * lpFileName, SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetFileSecurity
-#define GetFileSecurity error_use_qxeGetFileSecurity_or_GetFileSecurityA_and_GetFileSecurityW
-#endif
-BOOL qxeGetFileSecurity (const Extbyte * lpFileName, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD nLength, LPDWORD lpnLengthNeeded);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef FindFirstChangeNotification
-#define FindFirstChangeNotification error_use_qxeFindFirstChangeNotification_or_FindFirstChangeNotificationA_and_FindFirstChangeNotificationW
-#endif
-HANDLE qxeFindFirstChangeNotification (const Extbyte * lpPathName, BOOL bWatchSubtree, DWORD dwNotifyFilter);
-
-#undef ReadDirectoryChanges
-#define ReadDirectoryChanges error_Unicode_only
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef IsBadStringPtr
-#define IsBadStringPtr error_use_qxeIsBadStringPtr_or_IsBadStringPtrA_and_IsBadStringPtrW
-#endif
-BOOL qxeIsBadStringPtr (const Extbyte * lpsz, UINT ucchMax);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LookupAccountSid
-#define LookupAccountSid error_use_qxeLookupAccountSid_or_LookupAccountSidA_and_LookupAccountSidW
-#endif
-BOOL qxeLookupAccountSid (const Extbyte * lpSystemName, PSID Sid, Extbyte * Name, LPDWORD cbName, Extbyte * ReferencedDomainName, LPDWORD cbReferencedDomainName, PSID_NAME_USE peUse);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LookupAccountName
-#define LookupAccountName error_use_qxeLookupAccountName_or_LookupAccountNameA_and_LookupAccountNameW
-#endif
-BOOL qxeLookupAccountName (const Extbyte * lpSystemName, const Extbyte * lpAccountName, PSID Sid, LPDWORD cbSid, Extbyte * ReferencedDomainName, LPDWORD cbReferencedDomainName, PSID_NAME_USE peUse);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LookupPrivilegeValue
-#define LookupPrivilegeValue error_use_qxeLookupPrivilegeValue_or_LookupPrivilegeValueA_and_LookupPrivilegeValueW
-#endif
-BOOL qxeLookupPrivilegeValue (const Extbyte * lpSystemName, const Extbyte * lpName, PLUID lpLuid);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LookupPrivilegeName
-#define LookupPrivilegeName error_use_qxeLookupPrivilegeName_or_LookupPrivilegeNameA_and_LookupPrivilegeNameW
-#endif
-BOOL qxeLookupPrivilegeName (const Extbyte * lpSystemName, PLUID lpLuid, Extbyte * lpName, LPDWORD cbName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LookupPrivilegeDisplayName
-#define LookupPrivilegeDisplayName error_use_qxeLookupPrivilegeDisplayName_or_LookupPrivilegeDisplayNameA_and_LookupPrivilegeDisplayNameW
-#endif
-BOOL qxeLookupPrivilegeDisplayName (const Extbyte * lpSystemName, const Extbyte * lpName, Extbyte * lpDisplayName, LPDWORD cbDisplayName, LPDWORD lpLanguageId);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef BuildCommDCB
-#define BuildCommDCB error_use_qxeBuildCommDCB_or_BuildCommDCBA_and_BuildCommDCBW
-#endif
-BOOL qxeBuildCommDCB (const Extbyte * lpDef, LPDCB lpDCB);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef BuildCommDCBAndTimeouts
-#define BuildCommDCBAndTimeouts error_use_qxeBuildCommDCBAndTimeouts_or_BuildCommDCBAndTimeoutsA_and_BuildCommDCBAndTimeoutsW
-#endif
-BOOL qxeBuildCommDCBAndTimeouts (const Extbyte * lpDef, LPDCB lpDCB, LPCOMMTIMEOUTS lpCommTimeouts);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CommConfigDialog
-#define CommConfigDialog error_use_qxeCommConfigDialog_or_CommConfigDialogA_and_CommConfigDialogW
-#endif
-BOOL qxeCommConfigDialog (const Extbyte * lpszName, HWND hWnd, LPCOMMCONFIG lpCC);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetDefaultCommConfig
-#define GetDefaultCommConfig error_use_qxeGetDefaultCommConfig_or_GetDefaultCommConfigA_and_GetDefaultCommConfigW
-#endif
-BOOL qxeGetDefaultCommConfig (const Extbyte * lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetDefaultCommConfig
-#define SetDefaultCommConfig error_use_qxeSetDefaultCommConfig_or_SetDefaultCommConfigA_and_SetDefaultCommConfigW
-#endif
-BOOL qxeSetDefaultCommConfig (const Extbyte * lpszName, LPCOMMCONFIG lpCC, DWORD dwSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetComputerName
-#define GetComputerName error_use_qxeGetComputerName_or_GetComputerNameA_and_GetComputerNameW
-#endif
-BOOL qxeGetComputerName (Extbyte * lpBuffer, LPDWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef SetComputerName
-#define SetComputerName error_use_qxeSetComputerName_or_SetComputerNameA_and_SetComputerNameW
-#endif
-BOOL qxeSetComputerName (const Extbyte * lpComputerName);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetUserName
-#define GetUserName error_use_qxeGetUserName_or_GetUserNameA_and_GetUserNameW
-#endif
-BOOL qxeGetUserName (Extbyte * lpBuffer, LPDWORD nSize);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef LogonUser
-#define LogonUser error_use_qxeLogonUser_or_LogonUserA_and_LogonUserW
-#endif
-BOOL qxeLogonUser (Extbyte * lpszUsername, Extbyte * lpszDomain, Extbyte * lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef CreateProcessAsUser
-#define CreateProcessAsUser error_use_qxeCreateProcessAsUser_or_CreateProcessAsUserA_and_CreateProcessAsUserW
-#endif
-BOOL qxeCreateProcessAsUser (HANDLE hToken, const Extbyte * lpApplicationName, Extbyte * lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const Extbyte * lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation);
-
-#undef GetCurrentHwProfile
-#define GetCurrentHwProfile error_split_sized_LPHW_PROFILE_INFO__NT_4_0__only
-
-#undef GetVersionEx
-#define GetVersionEx error_split_sized_LPOSVERSIONINFO
-
-#undef CreateJobObject
-#define CreateJobObject error_NT_5_0__only
-
-#undef OpenJobObject
-#define OpenJobObject error_NT_5_0__only
-
-
-/* Processing file ACLAPI.h */
-
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
-#undef GetNamedSecurityInfo
-#define GetNamedSecurityInfo error_use_qxeGetNamedSecurityInfo_or_GetNamedSecurityInfoA_and_GetNamedSecurityInfoW
-#endif
-DWORD qxeGetNamedSecurityInfo (IN  Extbyte * pObjectName, IN  SE_OBJECT_TYPE ObjectType, IN  SECURITY_INFORMATION SecurityInfo, OUT PSID                 * ppsidOowner, OUT PSID                 * ppsidGroup, OUT PACL                 * ppDacl, OUT PACL                 * ppSacl, OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
-
+BOOL qxemciGetErrorString (MCIERROR arg1, Extbyte * arg2, UINT arg3);
+
--- a/src/intl-encap-win32.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/intl-encap-win32.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,5 @@
 /* Unicode-encapsulation of Win32 library functions.
-   Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2004, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -51,11 +51,16 @@
 yes indicates a function to be automatically Unicode-encapsulated.
    (All parameters either need no special processing or are LPTSTR or
    LPCTSTR.)
+override indidates a function where the prototype can be overridden
+   due to errors in Cygwin or Visual Studio.
 soon indicates a function that should be automatically Unicode-encapsulated,
    but we're not ready to process it yet.
 no indicates a function we don't support (it will be #defined to cause
    a compile error, with the text after the function included in the
    erroneous definition to indicate why we don't support it).
+review indicates a function that we still need to review to determine whether
+   or how to support it.  This has the same effect as `no', with a comment
+   indicating that the function needs review.
 skip indicates a function we support manually; only a comment about this
    will be generated.
 split indicates a function with a split structure (different versions
@@ -103,6 +108,25 @@
 file ACLAPI.h
 
 yes GetNamedSecurityInfo
+review BuildExplicitAccessWithName
+review BuildSecurityDescriptor
+review BuildTrusteeWithName
+review BuildTrusteeWithObjectsAndName
+review BuildTrusteeWithObjectsAndSid
+review BuildTrusteeWithSid
+review GetAuditedPermissionsFromAcl
+review GetEffectiveRightsFromAcl
+review GetExplicitEntriesFromAcl
+review GetTrusteeForm
+review GetTrusteeName
+review GetTrusteeType
+review LookupSecurityDescriptorParts
+review SetEntriesInAcl
+review SetNamedSecurityInfo
+review BuildImpersonateExplicitAccessWithName
+review BuildImpersonateTrustee
+review GetMultipleTrustee
+review GetMultipleTrusteeOperation
 
 file WINBASE.H
 
@@ -251,6 +275,34 @@
 no GetVersionEx split-sized LPOSVERSIONINFO
 no CreateJobObject NT 5.0+ only
 no OpenJobObject NT 5.0+ only
+review CheckNameLegalDOS8Dot3
+review CreateActCtx
+review CreateProcessWithLogon
+review DeleteVolumeMountPoint
+review DnsHostnameToComputerName
+review FileEncryptionStatus
+review FindActCtxSectionString
+review FindFirstVolume
+review FindFirstVolumeMountPoint
+review FindNextVolume
+review FindNextVolumeMountPoint
+review GetFirmwareEnvironmentVariable
+review GetComputerNameEx
+review GetDllDirectory
+review GetModuleHandleEx
+review GetSystemWindowsDirectory
+review GetSystemWow64Directory
+review GetVolumeNameForVolumeMountPoint
+review GetVolumePathName
+review GetVolumePathNamesForVolumeName
+review QueryActCtx
+review ReplaceFile
+review SetComputerNameEx
+review SetDllDirectory
+review SetFileShortName
+review SetFirmwareEnvironmentVariable
+review SetVolumeMountPoint
+review VerifyVersionInfo
 
 file WINUSER.H
 
@@ -262,7 +314,7 @@
 no CreateDesktop split-sized LPDEVMODE
 yes OpenDesktop
 split EnumDesktops DESKTOPENUMPROC // callback fun differs only in string pointer type
-yes CreateWindowStation
+override HWINSTA CreateWindowStationW(LPWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES); error arg 1, VS6 prototype, missing const
 yes OpenWindowStation
 split EnumWindowStations WINSTAENUMPROC // callback fun differs only in string pointer type
 yes GetUserObjectInformation
@@ -272,7 +324,7 @@
 yes DispatchMessage
 yes PeekMessage
 skip SendMessage split messages and structures
-yes SendMessageTimeout
+no SendMessageTimeout VS6 has erroneous seventh parameter DWORD_PTR instead of PDWORD_PTR
 yes SendNotifyMessage
 yes SendMessageCallback
 no BroadcastSystemMessage win95 version not split; NT 4.0+ only
@@ -355,7 +407,8 @@
 yes GetWindowTextLength
 yes MessageBox
 yes MessageBoxEx
-split MessageBoxIndirect LPMSGBOXPARAMS NT 4.0+ only
+// split MessageBoxIndirect LPMSGBOXPARAMS NT 4.0+ only
+no MessageBoxIndirect Cygwin has split MSGBOXPARAMS* instead of LPMSGBOXPARAMS
 yes GetWindowLong
 yes SetWindowLong
 yes GetClassLong
@@ -378,8 +431,7 @@
 yes DlgDirSelectComboBoxEx
 yes DefFrameProc
 no DefMDIChildProc return value is conditionalized on _MAC, messes up parser
-
-yes CreateMDIWindow
+override HWND CreateMDIWindowW(LPWSTR,LPWSTR,DWORD,int,int,int,int,HWND,HINSTANCE,LPARAM); error arg 1, VS6 prototype, missing const
 yes WinHelp
 no ChangeDisplaySettings split-sized LPDEVMODE
 no ChangeDisplaySettingsEx split-sized LPDEVMODE; NT 5.0/Win98+ only
@@ -390,9 +442,17 @@
 no GetWindowModuleFileName NT 5.0+ only
 no RealGetWindowClass NT 5.0+ only
 no GetAltTabInfo NT 5.0+ only
+review BroadcastSystemMessageEx
+review EnumDisplaySettingsEx
+review GetClassLongPtr
+review GetRawInputDeviceInfo
+review GetWindowLongPtr
+review SetClassLongPtr
+review SetWindowLongPtr
 
 file WINGDI.H
 
+begin-bracket defined (HAVE_MS_WINDOWS)
 // split-sized LOGCOLORSPACE
 // split-sized TEXTMETRIC
 // split-sized NEWTEXTMETRIC
@@ -458,7 +518,7 @@
 // split-simple function pointer ICMENUMPROC
 no GetLogColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
 no CreateColorSpace split-sized LPLOGCOLORSPACE; NT 4.0+ only
-skip GetICMProfile NT 4.0+ only, error in Cygwin prototype
+yes GetICMProfile NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10)
 yes SetICMProfile NT 4.0+ only
 split EnumICMProfiles ICMENUMPROC NT 4.0+ only
 skip UpdateICMRegKey NT 4.0+ only, error in Cygwin prototype
@@ -467,6 +527,7 @@
 // Unicode-only EMREXTCREATEFONTINDIRECTW
 no wglUseFontBitmaps causes link error
 no wglUseFontOutlines causes link error
+end-bracket
 
 file WINSPOOL.H
 
@@ -533,6 +594,7 @@
 no DeletePrintProvidor not used, complicated interface with split structures
 no SetPrinterHTMLView not used, complicated interface with split structures
 no GetPrinterHTMLView not used, complicated interface with split structures
+review GetDefaultPrinter
 end-bracket
 
 file SHELLAPI.H
@@ -542,14 +604,14 @@
 yes FindExecutable
 no CommandLineToArgv Unicode-only
 yes ShellAbout
-yes ExtractAssociatedIcon
+override HICON ExtractAssociatedIconW(HINSTANCE, LPWSTR, LPWORD); error arg2, Cygwin prototype, extra const
 yes ExtractIcon
 // split-simple DRAGINFO, used ??? (docs say "Not currently supported")
 begin-bracket !defined (CYGWIN_HEADERS)
 yes DoEnvironmentSubst NT 4.0+ only
 end-bracket
 no FindEnvironmentString causes link error; NT 4.0+ only
-skip ExtractIconEx NT 4.0+ only, error in Cygwin prototype
+yes ExtractIconEx NT 4.0+ only, former error in Cygwin prototype but no more (Cygwin 1.7, 1-30-10)
 // split-simple SHFILEOPSTRUCT, used in SHFileOperation
 // split-simple SHNAMEMAPPING, used in SHFileOperation
 split SHFileOperation LPSHFILEOPSTRUCT NT 4.0+ only
@@ -762,6 +824,7 @@
 
 file COMMDLG.H
 
+begin-bracket defined (HAVE_MS_WINDOWS)
 split GetOpenFileName LPOPENFILENAME
 split GetSaveFileName LPOPENFILENAME
 yes GetFileTitle
@@ -782,6 +845,8 @@
 // FINDMSGSTRING
 skip PrintDlg LPPRINTDLG with split-sized DEVMODE handle
 skip PageSetupDlg LPPAGESETUPDLG with split-sized DEVMODE handle
+review PrintDlgEx
+end-bracket
 
 file DDE.H
 
@@ -790,7 +855,7 @@
 file DDEML.H
 
 yes DdeInitialize
-skip DdeCreateStringHandle error in Cygwin prototype
+yes DdeCreateStringHandle former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10)
 yes DdeQueryString
 // #### split-sized (or split-simple??? not completely obvious) structure MONHSZSTRUCT, used when DDE event MF_HSZ_INFO is sent as part of the XTYP_MONITOR transaction sent to a DDE callback; not yet handled
 
@@ -871,9 +936,12 @@
 // split-simple function pointer PFNPROCESSPOLICIES
 yes WNetGetLastError
 split MultinetGetConnectionPerformance LPNETRESOURCE
+review WNetSetConnection
+review WNetGetResourceInformation
+review WNetGetResourceParent
 end-bracket
 
-file IME.H
+// file IME.H -- doesn't exist under Cygwin
 
 no SendIMEMessageEx obsolete, no docs available
 
@@ -918,6 +986,10 @@
 // split flag SHCNF_PRINTER; we intercept SHChangeNotify
 // split flag SHARD_PATH; we intercept SHAddToRecentDocs
 skip SHGetDataFromIDList split-sized WIN32_FIND_DATA or split-simple NETRESOURCE, missing from Cygwin libraries
+review SHGetFolderPath
+review SHGetIconOverlayIndex
+review SHCreateDirectoryEx
+review SHGetFolderPathAndSubDir
 
 file WINNLS.H
 
@@ -947,6 +1019,12 @@
 no FoldString not used, not examined yet
 no EnumSystemLocales not used, not examined yet
 no EnumSystemCodePages not used, not examined yet
+review GetCalendarInfo
+review GetGeoInfo
+review SetCalendarInfo
+review EnumSystemLanguageGroups
+review EnumLanguageGroupLocales
+review EnumUILanguages
 
 end-unicode-encapsulation-script
 
@@ -979,7 +1057,7 @@
 
 file WINREG.H
 
-skip RegConnectRegistry error in Cygwin prototype
+yes RegConnectRegistry former error in Cygwin prototype, but no more (Cygwin 1.7, 1-30-10)
 yes RegCreateKey
 yes RegCreateKeyEx
 yes RegDeleteKey
@@ -1001,7 +1079,8 @@
 yes RegSetValueEx
 yes RegUnLoadKey
 yes InitiateSystemShutdown
-yes AbortSystemShutdown
+override BOOL AbortSystemShutdownW(LPWSTR); error arg 1, Cygwin prototype, extra const
+review RegDeleteKeyEx
 
 file EXCPT.H
 
@@ -1164,60 +1243,13 @@
 /*           would be encapsulatable but for Cygwin problems            */
 /************************************************************************/
 
-LONG
-qxeRegConnectRegistry (const Extbyte * lpMachineName, HKEY hKey, PHKEY phkResult)
-{
-  /* Cygwin mistakenly omits const in first argument. */
-  if (XEUNICODE_P)
-    return RegConnectRegistryW ((LPWSTR) lpMachineName, hKey, phkResult);
-  else
-    return RegConnectRegistryA ((LPSTR) lpMachineName, hKey, phkResult);
-}
-
-HSZ
-qxeDdeCreateStringHandle (DWORD idInst, const Extbyte * psz, int iCodePage)
-{
-  /* Cygwin mistakenly omits const in second argument. */
-  if (XEUNICODE_P)
-    return DdeCreateStringHandleW (idInst, (LPWSTR) psz, iCodePage);
-  else
-    return DdeCreateStringHandleA (idInst, (LPSTR) psz, iCodePage);
-}
-
-/* NOTE: NT 4.0+ only */
-UINT
-qxeExtractIconEx (const Extbyte * lpszFile, int nIconIndex, HICON FAR * phiconLarge, HICON FAR * phiconSmall, UINT nIcons)
-{
-  /* Cygwin mistakenly declares the return type as HICON. */
-  if (XEUNICODE_P)
-    return (UINT) ExtractIconExW ((LPCWSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
-  else
-    return (UINT) ExtractIconExA ((LPCSTR) lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
-}
-
-/* NOTE: NT 4.0+ only */
-BOOL
-qxeGetICMProfile (HDC arg1, LPDWORD arg2, Extbyte * arg3)
-{
-#if 0 /* defined (CYGWIN_HEADERS) */ /* fixed at some point <= GCC 3.4.4 */
-  /* Cygwin mistakenly declares the second argument as DWORD. */
-  if (XEUNICODE_P)
-    return GetICMProfileW (arg1, (DWORD) arg2, (LPWSTR) arg3);
-  else
-    return GetICMProfileA (arg1, (DWORD) arg2, (LPSTR) arg3);
-#else
-  if (XEUNICODE_P)
-    return GetICMProfileW (arg1, arg2, (LPWSTR) arg3);
-  else
-    return GetICMProfileA (arg1, arg2, (LPSTR) arg3);
-#endif /* CYGWIN_HEADERS */
-}
+#ifdef HAVE_MS_WINDOWS
 
 /* NOTE: NT 4.0+ only */
 BOOL
 qxeUpdateICMRegKey (DWORD arg1, Extbyte * arg2, Extbyte * arg3, UINT arg4)
 {
-#if defined (CYGWIN_HEADERS)
+#ifdef CYGWIN_HEADERS
   /* Cygwin mistakenly declares the second argument as DWORD. */
   if (XEUNICODE_P)
     return UpdateICMRegKeyW (arg1, (DWORD) arg2, (LPWSTR) arg3, arg4);
@@ -1231,6 +1263,8 @@
 #endif /* CYGWIN_HEADERS */
 }
 
+#endif /* HAVE_MS_WINDOWS */
+
 #ifndef CYGWIN /* present in headers but missing in shell32.a */
 
 BOOL
--- a/src/intl-win32.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/intl-win32.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,5 @@
 /* Win32 internationalization functions.
-   Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2004, 2010 Ben Wing.
    Copyright (C) 2000 IKEYAMA Tomonori.
 
 This file is part of XEmacs.
@@ -85,7 +85,7 @@
 struct lang_to_string
 {
   int code;
-  char *string;
+  const Ascbyte *string;
 };
 
 struct lang_to_string lang_to_string_table[] =
@@ -650,7 +650,7 @@
 
   for (i = 0; i < table_size; i++)
     if (code == table[i].code)
-      return build_string (table[i].string);
+      return build_ascstring (table[i].string);
   return Qnil;
 }
 
@@ -668,7 +668,7 @@
 	  if (!table[i].string)
 	    break;
 	  if (sublang == table[i].code)
-	    return build_string (table[i].string);
+	    return build_ascstring (table[i].string);
 	}
       else if (!table[i].string && lang == table[i].code)
 	found_lang = 1;
@@ -677,11 +677,11 @@
   switch (sublang)
     {
     case SUBLANG_NEUTRAL:
-      return build_string ("NEUTRAL");
+      return build_ascstring ("NEUTRAL");
     case SUBLANG_DEFAULT:
-      return build_string ("DEFAULT");
+      return build_ascstring ("DEFAULT");
     case SUBLANG_SYS_DEFAULT:
-      return build_string ("SYS_DEFAULT");
+      return build_ascstring ("SYS_DEFAULT");
     }
 
   return Qnil;
@@ -1288,8 +1288,8 @@
 {
   int got_abbrev;
   int got_full;
-  char abbrev_name[32] = { 0 };
-  char full_name[256] = { 0 };
+  Extbyte abbrev_name[32] = { 0 };
+  Extbyte full_name[256] = { 0 };
 
   CHECK_INT (lcid);
 
@@ -1298,27 +1298,28 @@
 
   if (NILP (longform))
     {
-      got_abbrev = GetLocaleInfo (XINT (lcid),
-				  LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP,
-				  abbrev_name, sizeof (abbrev_name));
+      got_abbrev = qxeGetLocaleInfo (XINT (lcid),
+				     LOCALE_SABBREVLANGNAME |
+				     LOCALE_USE_CP_ACP,
+				     abbrev_name, sizeof (abbrev_name));
       if (got_abbrev)
-	return build_string (abbrev_name);
+	return build_tstr_string (abbrev_name);
     }
   else if (EQ (longform, Qt))
     {
-      got_full = GetLocaleInfo (XINT (lcid),
-				LOCALE_SLANGUAGE | LOCALE_USE_CP_ACP,
-				full_name, sizeof (full_name));
+      got_full = qxeGetLocaleInfo (XINT (lcid),
+				   LOCALE_SLANGUAGE | LOCALE_USE_CP_ACP,
+				   full_name, sizeof (full_name));
       if (got_full)
-	return build_string (full_name);
+	return build_tstr_string (full_name);
     }
   else if (NUMBERP (longform))
     {
-      got_full = GetLocaleInfo (XINT (lcid),
-				XINT (longform),
-				full_name, sizeof (full_name));
+      got_full = qxeGetLocaleInfo (XINT (lcid),
+				   XINT (longform),
+				   full_name, sizeof (full_name));
       if (got_full)
-	return make_unibyte_string (full_name, got_full);
+	return build_tstr_string (full_name);
     }
 
   return Qnil;
@@ -1600,10 +1601,10 @@
 wchar_t *
 wcsncpy (wchar_t *dst0, const wchar_t *src0, size_t count)
 {
-  if (dst0 == NULL || src0 == NULL) return NULL;
   wchar_t *dscan;
   const wchar_t *sscan;
 
+  if (dst0 == NULL || src0 == NULL) return NULL;
   dscan = dst0;
   sscan = src0;
   while (count > 0)
@@ -1703,7 +1704,7 @@
 #ifdef MULE
   return lcid_to_locale (lcid);
 #else
-  return Fcons (build_string ("NEUTRAL"), build_string ("DEFAULT"));
+  return Fcons (build_ascstring ("NEUTRAL"), build_ascstring ("DEFAULT"));
 #endif
 }
 
@@ -1866,7 +1867,7 @@
   struct mswindows_multibyte_to_unicode_coding_system *data =
     XCODING_SYSTEM_TYPE_DATA (cs, mswindows_multibyte_to_unicode);
 
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   if (data->locale_type == MULTIBYTE_SPECIFIED_CODE_PAGE)
     print_internal (make_int (data->cp), printcharfun, 1);
   else
@@ -1874,7 +1875,7 @@
       write_fmt_string_lisp (printcharfun, "%s, ", 1, mswindows_multibyte_to_unicode_getprop (cs, Qlocale));
       print_internal (mswindows_multibyte_to_unicode_getprop (cs, Qcode_page), printcharfun, 0);
     }
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
 }
 
 /* ----------------------------------------------------------------------- */
@@ -1940,7 +1941,7 @@
   TO_INTERNAL_FORMAT (DATA, (unidata, size), MALLOC, (intdata, size),
 		      Qmswindows_unicode);
 
-  xfree (unidata, Extbyte *);
+  xfree (unidata);
 
   if (size_out)
     *size_out = size;
@@ -2351,13 +2352,13 @@
 {
   Fmake_coding_system_internal
     (Qmswindows_unicode, Qunicode,
-     build_msg_string ("MS Windows Unicode"),
+     build_defer_string ("MS Windows Unicode"),
      nconc2 (list4 (Qdocumentation,
-		    build_msg_string (
+		    build_defer_string (
 "Converts to the Unicode encoding for Windows API calls.\n"
 "This encoding is equivalent to standard UTF16, little-endian."
 ),
-		    Qmnemonic, build_string ("MSW-U")),
+		    Qmnemonic, build_ascstring ("MSW-U")),
 	     list4 (Qunicode_type, Qutf_16,
 		    Qlittle_endian, Qt)));
 
@@ -2393,6 +2394,10 @@
   set_current_lcid (GetUserDefaultLCID ());
 #endif /* MULE */
 
+#ifdef HAVE_CYGWIN_CONV_PATH
+  Fprovide (intern ("cygwin-use-utf-8"));
+#endif
+
   if (initialized)
     /* If not initialized, we also call this, but early -- see the
        previous function. */
--- a/src/intl.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/intl.c	Wed Feb 24 01:58:04 2010 -0600
@@ -49,7 +49,7 @@
   loc = setlocale (LC_CTYPE, NULL);
   if (!loc)
     return Qnil;
-  return build_ext_string (loc, Qctext);
+  return build_extstring (loc, Qctext);
 }
 
 DEFUN ("set-current-locale", Fset_current_locale, 1, 1, 0, /*
@@ -75,7 +75,7 @@
   CHECK_STRING (locale);
   /* RedHat 6.2 contains a locale called "Francais" with the C-cedilla
      encoded in ISO2022! */
-  LISP_STRING_TO_EXTERNAL (locale, loc, Qctext);
+  loc = LISP_STRING_TO_EXTERNAL (locale, Qctext);
   loc = setlocale (LC_ALL, loc);
   if (!loc)
     return Qnil;
@@ -92,8 +92,8 @@
     }
 #endif
 
-  str = build_ext_string (loc, Qctext);
-  xfree (loc, Extbyte *);
+  str = build_extstring (loc, Qctext);
+  xfree (loc);
   return str;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/keymap-buttons.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,62 @@
+/* Include file for iterating over all buttons.
+   Copyright (C) 1985, 1991-1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF.  Split out of keymap.c. */
+
+/* To use this, define FROB to do something with the button number.  No
+   need to undefine, it happens automatically at the end of this file.  If
+   you want button 0 included, define INCLUDE_BUTTON_ZERO (also undefined
+   automatically). */
+
+#ifdef INCLUDE_BUTTON_ZERO
+FROB(0)
+#endif
+FROB(1)
+FROB(2)
+FROB(3)
+FROB(4)
+FROB(5)
+FROB(6)
+FROB(7)
+FROB(8)
+FROB(9)
+FROB(10)
+FROB(11)
+FROB(12)
+FROB(13)
+FROB(14)
+FROB(15)
+FROB(16)
+FROB(17)
+FROB(18)
+FROB(19)
+FROB(20)
+FROB(21)
+FROB(22)
+FROB(23)
+FROB(24)
+FROB(25)
+FROB(26)
+
+#undef FROB
+#undef INCLUDE_BUTTON_ZERO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/keymap-slots.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,62 @@
+/* Definitions of marked slots in keymaps.
+   Copyright (C) 1985, 1991-1995 Free Software Foundation, Inc.
+   Copyright (C) 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF.  Split out of keymap.c. */
+
+/* We define the Lisp_Objects in the keymap structure in a separate
+   file because there are numerous places we want to iterate over them,
+   such as when defining them in the structure, initializing them, or
+   marking them.
+
+   To use, define MARKED_SLOT before including this file.  No need to
+   undefine; that happens automatically.
+
+   MARKED_SLOT_NOCOMPARE is used to indicate a slot that should not be
+   compared in the equal() method or hashed in the hash() method --
+   basically, a slot used for caching, debugging, etc. instead of for
+   defining a property of the keymap.
+*/
+
+#ifndef MARKED_SLOT_NOCOMPARE
+#define MARKED_SLOT_NOCOMPARE MARKED_SLOT
+#endif
+
+  MARKED_SLOT (parents)		 /* Keymaps to be searched after this one.
+				    An ordered list */
+  MARKED_SLOT (prompt)           /* Qnil or a string to print in the minibuffer
+                                    when reading from this keymap */
+  MARKED_SLOT (table)		 /* The contents of this keymap */
+  MARKED_SLOT_NOCOMPARE (inverse_table)	 /* The inverse mapping of the above */
+  MARKED_SLOT (default_binding)  /* Use this if no other binding is found
+                                    (this overrides parent maps and the
+                                    normal global-map lookup). */
+  MARKED_SLOT_NOCOMPARE (sub_maps_cache) /* Cache of directly inferior
+					    keymaps; This holds an alist,
+					    of the key and the maps, or the
+					    modifier bit and the map.  If
+					    this is the symbol t, then the
+					    cache needs to be recomputed. */
+  MARKED_SLOT_NOCOMPARE (name)           /* Just for debugging convenience */
+
+#undef MARKED_SLOT
+#undef MARKED_SLOT_NOCOMPARE
--- a/src/keymap.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/keymap.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1991-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2001, 2002 Ben Wing.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
    Totally redesigned by jwz in 1991.
 
 This file is part of XEmacs.
@@ -149,21 +149,8 @@
 struct Lisp_Keymap
 {
   LISP_OBJECT_HEADER header;
-  Lisp_Object parents;		/* Keymaps to be searched after this one.
-				   An ordered list */
-  Lisp_Object prompt;           /* Qnil or a string to print in the minibuffer
-                                   when reading from this keymap */
-  Lisp_Object table;		/* The contents of this keymap */
-  Lisp_Object inverse_table;	/* The inverse mapping of the above */
-  Lisp_Object default_binding;  /* Use this if no other binding is found
-                                   (this overrides parent maps and the
-                                   normal global-map lookup). */
-  Lisp_Object sub_maps_cache;	/* Cache of directly inferior keymaps;
-				   This holds an alist, of the key and the
-				   maps, or the modifier bit and the map.
-				   If this is the symbol t, then the cache
-				   needs to be recomputed. */
-  Lisp_Object name;             /* Just for debugging convenience */
+#define MARKED_SLOT(x) Lisp_Object x;
+#include "keymap-slots.h"
 };
 
 #define MAKE_MODIFIER_HASH_KEY(modifier) make_int (modifier)
@@ -217,49 +204,20 @@
 static Lisp_Object keymap_submaps (Lisp_Object keymap);
 
 Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift;
-Lisp_Object Qbutton0;
-Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
-Lisp_Object Qbutton6, Qbutton7, Qbutton8, Qbutton9, Qbutton10;
-Lisp_Object Qbutton11, Qbutton12, Qbutton13, Qbutton14, Qbutton15;
-Lisp_Object Qbutton16, Qbutton17, Qbutton18, Qbutton19, Qbutton20;
-Lisp_Object Qbutton21, Qbutton22, Qbutton23, Qbutton24, Qbutton25;
-Lisp_Object Qbutton26;
-Lisp_Object Qbutton0up;
-Lisp_Object Qbutton1up, Qbutton2up, Qbutton3up, Qbutton4up, Qbutton5up;
-Lisp_Object Qbutton6up, Qbutton7up, Qbutton8up, Qbutton9up, Qbutton10up;
-Lisp_Object Qbutton11up, Qbutton12up, Qbutton13up, Qbutton14up, Qbutton15up;
-Lisp_Object Qbutton16up, Qbutton17up, Qbutton18up, Qbutton19up, Qbutton20up;
-Lisp_Object Qbutton21up, Qbutton22up, Qbutton23up, Qbutton24up, Qbutton25up;
-Lisp_Object Qbutton26up;
+
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num)				\
+Lisp_Object Qbutton##num;			\
+Lisp_Object Qbutton##num##up;
+#include "keymap-buttons.h"
 
 Lisp_Object Qmenu_selection;
+
 /* Emacs compatibility */
-Lisp_Object Qdown_mouse_1, Qmouse_1;
-Lisp_Object Qdown_mouse_2, Qmouse_2;
-Lisp_Object Qdown_mouse_3, Qmouse_3;
-Lisp_Object Qdown_mouse_4, Qmouse_4;
-Lisp_Object Qdown_mouse_5, Qmouse_5;
-Lisp_Object Qdown_mouse_6, Qmouse_6;
-Lisp_Object Qdown_mouse_7, Qmouse_7;
-Lisp_Object Qdown_mouse_8, Qmouse_8;  
-Lisp_Object Qdown_mouse_9, Qmouse_9;  
-Lisp_Object Qdown_mouse_10, Qmouse_10;
-Lisp_Object Qdown_mouse_11, Qmouse_11;
-Lisp_Object Qdown_mouse_12, Qmouse_12;
-Lisp_Object Qdown_mouse_13, Qmouse_13;
-Lisp_Object Qdown_mouse_14, Qmouse_14;
-Lisp_Object Qdown_mouse_15, Qmouse_15;
-Lisp_Object Qdown_mouse_16, Qmouse_16;
-Lisp_Object Qdown_mouse_17, Qmouse_17;
-Lisp_Object Qdown_mouse_18, Qmouse_18;
-Lisp_Object Qdown_mouse_19, Qmouse_19;
-Lisp_Object Qdown_mouse_20, Qmouse_20;
-Lisp_Object Qdown_mouse_21, Qmouse_21;
-Lisp_Object Qdown_mouse_22, Qmouse_22;
-Lisp_Object Qdown_mouse_23, Qmouse_23;
-Lisp_Object Qdown_mouse_24, Qmouse_24;
-Lisp_Object Qdown_mouse_25, Qmouse_25;
-Lisp_Object Qdown_mouse_26, Qmouse_26;
+#define FROB(num)				\
+Lisp_Object Qmouse_##num;			\
+Lisp_Object Qdown_mouse_##num;
+#include "keymap-buttons.h"
 
 /* Kludge kludge kludge */
 Lisp_Object QLFD, QTAB, QRET, QESC, QDEL, QSPC, QBS;
@@ -269,17 +227,54 @@
 /*                     The keymap Lisp object                           */
 /************************************************************************/
 
+/* Keymaps are equal if Faces are equal if all of their display attributes are equal.  We
+   don't compare names or doc-strings, because that would make equal
+   be eq.
+
+   This isn't concerned with "unspecified" attributes, that's what
+   #'face-differs-from-default-p is for. */
+static int
+keymap_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+	      int UNUSED (foldcase))
+{
+  Lisp_Keymap *k1 = XKEYMAP (obj1);
+  Lisp_Keymap *k2 = XKEYMAP (obj2);
+
+  depth++;
+
+  return
+    (
+#define MARKED_SLOT(x) \
+     internal_equal (k1->x, k2->x, depth) &&
+#define MARKED_SLOT_NOCOMPARE(x)
+#include "keymap-slots.h"
+     1
+     );
+}
+
+static Hashcode
+keymap_hash (Lisp_Object obj, int depth)
+{
+  Lisp_Keymap *k = XKEYMAP (obj);
+  Hashcode hash = 0xCAFEBABE; /* why not? */
+
+  depth++;
+
+#define MARKED_SLOT(x) \
+  hash = HASH2 (hash, internal_hash (k->x, depth));
+#define MARKED_SLOT_NOCOMPARE(x)
+#include "keymap-slots.h"
+
+  return hash;
+}
+
 static Lisp_Object
 mark_keymap (Lisp_Object obj)
 {
   Lisp_Keymap *keymap = XKEYMAP (obj);
-  mark_object (keymap->parents);
-  mark_object (keymap->prompt);
-  mark_object (keymap->inverse_table);
-  mark_object (keymap->sub_maps_cache);
-  mark_object (keymap->default_binding);
-  mark_object (keymap->name);
-  return keymap->table;
+#define MARKED_SLOT(x) mark_object (keymap->x);
+#include "keymap-slots.h"
+  return Qnil;
 }
 
 static void
@@ -289,8 +284,8 @@
   /* This function can GC */
   Lisp_Keymap *keymap = XKEYMAP (obj);
   if (print_readably)
-    printing_unreadable_object ("#<keymap 0x%x>", keymap->header.uid);
-  write_c_string (printcharfun, "#<keymap ");
+    printing_unreadable_lcrecord (obj, 0);
+  write_ascstring (printcharfun, "#<keymap ");
   if (!NILP (keymap->name))
     {
       write_fmt_string_lisp (printcharfun, "%S ", 1, keymap->name);
@@ -300,19 +295,14 @@
 }
 
 static const struct memory_description keymap_description[] = {
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, parents) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, prompt) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, table) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, inverse_table) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, default_binding) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, sub_maps_cache) },
-  { XD_LISP_OBJECT, offsetof (Lisp_Keymap, name) },
+#define MARKED_SLOT(x) { XD_LISP_OBJECT, offsetof (Lisp_Keymap, x) },
+#include "keymap-slots.h"
   { XD_END }
 };
 
-/* No need for keymap_equal #### Why not? */
 DEFINE_DUMPABLE_LISP_OBJECT ("keymap", keymap,
-			     mark_keymap, print_keymap, 0, 0, 0,
+			     mark_keymap, print_keymap, 0,
+			     keymap_equal, keymap_hash,
 			     keymap_description,
 			     Lisp_Keymap);
 
@@ -473,7 +463,7 @@
       Ibyte str [1 + MAX_ICHAR_LEN];
       Bytecount count = set_itext_ichar (str, XCHAR (keysym));
       str[count] = 0;
-      keysym = intern_int (str);
+      keysym = intern_istring (str);
     }
   return control_meta_superify (keysym, modifiers);
 }
@@ -495,15 +485,10 @@
 {
   Lisp_Keymap *k;
 
-  modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
-		 | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5 | XEMACS_MOD_BUTTON6
-                 | XEMACS_MOD_BUTTON7 | XEMACS_MOD_BUTTON8 | XEMACS_MOD_BUTTON9
-                 | XEMACS_MOD_BUTTON10 | XEMACS_MOD_BUTTON11 | XEMACS_MOD_BUTTON12
-                 | XEMACS_MOD_BUTTON13 | XEMACS_MOD_BUTTON14 | XEMACS_MOD_BUTTON15
-                 | XEMACS_MOD_BUTTON16 | XEMACS_MOD_BUTTON17 | XEMACS_MOD_BUTTON18
-                 | XEMACS_MOD_BUTTON19 | XEMACS_MOD_BUTTON20 | XEMACS_MOD_BUTTON21
-                 | XEMACS_MOD_BUTTON22 | XEMACS_MOD_BUTTON23 | XEMACS_MOD_BUTTON24
-                 | XEMACS_MOD_BUTTON25 | XEMACS_MOD_BUTTON26);
+  modifiers &= ~(
+#define FROB(num) XEMACS_MOD_BUTTON##num |
+#include "keymap-buttons.h"
+                 0);
   if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER
 		     | XEMACS_MOD_HYPER | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT))
       != 0)
@@ -683,15 +668,10 @@
   int modifiers = KEY_DATA_MODIFIERS (key);
   Lisp_Keymap *k = XKEYMAP (keymap);
 
-  modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
-		 | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5 | XEMACS_MOD_BUTTON6
-                 | XEMACS_MOD_BUTTON7 | XEMACS_MOD_BUTTON8 | XEMACS_MOD_BUTTON9
-                 | XEMACS_MOD_BUTTON10 | XEMACS_MOD_BUTTON11 | XEMACS_MOD_BUTTON12
-                 | XEMACS_MOD_BUTTON13 | XEMACS_MOD_BUTTON14 | XEMACS_MOD_BUTTON15
-                 | XEMACS_MOD_BUTTON16 | XEMACS_MOD_BUTTON17 | XEMACS_MOD_BUTTON18
-                 | XEMACS_MOD_BUTTON19 | XEMACS_MOD_BUTTON20 | XEMACS_MOD_BUTTON21
-                 | XEMACS_MOD_BUTTON22 | XEMACS_MOD_BUTTON23 | XEMACS_MOD_BUTTON24
-                 | XEMACS_MOD_BUTTON25 | XEMACS_MOD_BUTTON26);
+  modifiers &= ~(
+#define FROB(num) XEMACS_MOD_BUTTON##num |
+#include "keymap-buttons.h"
+                 0);
   assert ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META
 			 | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER
 			 | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0);
@@ -800,13 +780,8 @@
   Lisp_Object obj = ALLOC_LISP_OBJECT (keymap);
   Lisp_Keymap *keymap = XKEYMAP (obj);
 
-  keymap->parents         = Qnil;
-  keymap->prompt          = Qnil;
-  keymap->table           = Qnil;
-  keymap->inverse_table   = Qnil;
-  keymap->default_binding = Qnil;
-  keymap->sub_maps_cache  = Qnil; /* No possible submaps */
-  keymap->name            = Qnil;
+#define MARKED_SLOT(x) keymap->x = Qnil;
+#include "keymap-slots.h"
 
   if (size != 0) /* hack for copy-keymap */
     {
@@ -1403,110 +1378,12 @@
       else if (EQ (*keysym, QBS))
 	*keysym = QKbackspace;
       /* Emacs compatibility */
-      else if (EQ(*keysym, Qdown_mouse_1))
-        *keysym = Qbutton1;
-      else if (EQ(*keysym, Qdown_mouse_2))
-	*keysym = Qbutton2;
-      else if (EQ(*keysym, Qdown_mouse_3))
-	*keysym = Qbutton3;
-      else if (EQ(*keysym, Qdown_mouse_4))
-	*keysym = Qbutton4;
-      else if (EQ(*keysym, Qdown_mouse_5))
-	*keysym = Qbutton5;
-      else if (EQ(*keysym, Qdown_mouse_6))
-	*keysym = Qbutton6;
-      else if (EQ(*keysym, Qdown_mouse_7))
-	*keysym = Qbutton7;
-      else if (EQ(*keysym, Qdown_mouse_8))
-        *keysym = Qbutton8;
-      else if (EQ(*keysym, Qdown_mouse_9))
-        *keysym = Qbutton9;
-      else if (EQ(*keysym, Qdown_mouse_10))
-        *keysym = Qbutton10;
-      else if (EQ(*keysym, Qdown_mouse_11))
-        *keysym = Qbutton11;
-      else if (EQ(*keysym, Qdown_mouse_12))
-        *keysym = Qbutton12;
-      else if (EQ(*keysym, Qdown_mouse_13))
-        *keysym = Qbutton13;
-      else if (EQ(*keysym, Qdown_mouse_14))
-        *keysym = Qbutton14;
-      else if (EQ(*keysym, Qdown_mouse_15))
-        *keysym = Qbutton15;
-      else if (EQ(*keysym, Qdown_mouse_16))
-        *keysym = Qbutton16;
-      else if (EQ(*keysym, Qdown_mouse_17))
-        *keysym = Qbutton17;
-      else if (EQ(*keysym, Qdown_mouse_18))
-        *keysym = Qbutton18;
-      else if (EQ(*keysym, Qdown_mouse_19))
-        *keysym = Qbutton19;
-      else if (EQ(*keysym, Qdown_mouse_20))
-        *keysym = Qbutton20;
-      else if (EQ(*keysym, Qdown_mouse_21))
-        *keysym = Qbutton21;
-      else if (EQ(*keysym, Qdown_mouse_22))
-        *keysym = Qbutton22;
-      else if (EQ(*keysym, Qdown_mouse_23))
-        *keysym = Qbutton23;
-      else if (EQ(*keysym, Qdown_mouse_24))
-        *keysym = Qbutton24;
-      else if (EQ(*keysym, Qdown_mouse_25))
-        *keysym = Qbutton25;
-      else if (EQ(*keysym, Qdown_mouse_26))
-        *keysym = Qbutton26;
-      else if (EQ(*keysym, Qmouse_1))
-	*keysym = Qbutton1up;
-      else if (EQ(*keysym, Qmouse_2))
-	*keysym = Qbutton2up;
-      else if (EQ(*keysym, Qmouse_3))
-	*keysym = Qbutton3up;
-      else if (EQ(*keysym, Qmouse_4))
-	*keysym = Qbutton4up;
-      else if (EQ(*keysym, Qmouse_5))
-	*keysym = Qbutton5up;
-      else if (EQ(*keysym, Qmouse_6))
-	*keysym = Qbutton6up;
-      else if (EQ(*keysym, Qmouse_7))
-	*keysym = Qbutton7up;
-      else if (EQ(*keysym, Qmouse_8))
-        *keysym = Qbutton8up;
-      else if (EQ(*keysym, Qmouse_9))
-        *keysym = Qbutton9up;
-      else if (EQ(*keysym, Qmouse_10))
-        *keysym = Qbutton10up;
-      else if (EQ(*keysym, Qmouse_11))
-        *keysym = Qbutton11up;
-      else if (EQ(*keysym, Qmouse_12))
-        *keysym = Qbutton12up;
-      else if (EQ(*keysym, Qmouse_13))
-        *keysym = Qbutton13up;
-      else if (EQ(*keysym, Qmouse_14))
-        *keysym = Qbutton14up;
-      else if (EQ(*keysym, Qmouse_15))
-        *keysym = Qbutton15up;
-      else if (EQ(*keysym, Qmouse_16))
-        *keysym = Qbutton16up;
-      else if (EQ(*keysym, Qmouse_17))
-        *keysym = Qbutton17up;
-      else if (EQ(*keysym, Qmouse_18))
-        *keysym = Qbutton18up;
-      else if (EQ(*keysym, Qmouse_19))
-        *keysym = Qbutton19up;
-      else if (EQ(*keysym, Qmouse_20))
-        *keysym = Qbutton20up;
-      else if (EQ(*keysym, Qmouse_21))
-        *keysym = Qbutton21up;
-      else if (EQ(*keysym, Qmouse_22))
-        *keysym = Qbutton22up;
-      else if (EQ(*keysym, Qmouse_23))
-        *keysym = Qbutton23up;
-      else if (EQ(*keysym, Qmouse_24))
-        *keysym = Qbutton24up;
-      else if (EQ(*keysym, Qmouse_25))
-        *keysym = Qbutton25up;
-      else if (EQ(*keysym, Qmouse_26))
-        *keysym = Qbutton26up;
+#define FROB(num)				\
+      else if (EQ(*keysym, Qdown_mouse_##num))	\
+        *keysym = Qbutton##num;			\
+      else if (EQ(*keysym, Qmouse_##num))	\
+	*keysym = Qbutton##num##up;
+#include "keymap-buttons.h"
     }
 }
 
@@ -1549,89 +1426,20 @@
 	    int down = (XEVENT_TYPE (spec) == button_press_event);
 	    switch (XEVENT_BUTTON_BUTTON (spec))
 	      {
-	      case 1:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton1 : Qbutton1up)); 
-		break;
-	      case 2:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton2 : Qbutton2up)); 
-		break;
-	      case 3:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton3 : Qbutton3up)); 
-		break;
-	      case 4:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton4 : Qbutton4up)); 
-		break;
-	      case 5:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton5 : Qbutton5up)); 
-		break;
-	      case 6:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton6 : Qbutton6up)); 
-		break;
-	      case 7:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton7 : Qbutton7up)); 
+#define FROB(num)						\
+	      case num:						\
+		SET_KEY_DATA_KEYSYM (returned_value,		\
+		                     (down ? Qbutton##num :	\
+				      Qbutton##num##up));	\
 		break;
-              case 8:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton8 : Qbutton8up));
-                 break;
-              case 9:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton9 : Qbutton9up));
-                 break;
-              case 10:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton10 : Qbutton10up));
-                 break;
-              case 11:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton11 : Qbutton11up));
-                 break;
-              case 12:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton12 : Qbutton12up));
-                 break;
-              case 13:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton13 : Qbutton13up));
-                 break;
-              case 14:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton14 : Qbutton14up));
-                 break;
-              case 15:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton15 : Qbutton15up));
-                 break;
-              case 16:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton16 : Qbutton16up));
-                 break;
-              case 17:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton17 : Qbutton17up));
-                 break;
-              case 18:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton18 : Qbutton18up));
-                 break;
-              case 19:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton19 : Qbutton19up));
-                 break;
-              case 20:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton20 : Qbutton20up));
-                 break;
-              case 21:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton21 : Qbutton21up));
-                 break;
-              case 22:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton22 : Qbutton22up));
-                 break;
-              case 23:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton23 : Qbutton23up));
-                 break;
-              case 24:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton24 : Qbutton24up));
-                 break;
-              case 25:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton25 : Qbutton25up));
-                 break;
-              case 26:
-                 SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton26 : Qbutton26up));
-                 break;
+#include "keymap-buttons.h"
 	      default:
-		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton0 : Qbutton0up)); 
+		SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton0 :
+						      Qbutton0up)); 
 		break;
 	      }
-	    SET_KEY_DATA_MODIFIERS (returned_value, XEVENT_BUTTON_MODIFIERS (spec));
+	    SET_KEY_DATA_MODIFIERS (returned_value,
+				    XEVENT_BUTTON_MODIFIERS (spec));
 	    break;
 	  }
 	default:
@@ -1719,33 +1527,13 @@
 
   define_key_parser (list, &raw_key);
 
-  if (EQ (raw_key.keysym, Qbutton0) || EQ (raw_key.keysym, Qbutton0up) ||
-      EQ (raw_key.keysym, Qbutton1) || EQ (raw_key.keysym, Qbutton1up) ||
-      EQ (raw_key.keysym, Qbutton2) || EQ (raw_key.keysym, Qbutton2up) ||
-      EQ (raw_key.keysym, Qbutton3) || EQ (raw_key.keysym, Qbutton3up) ||
-      EQ (raw_key.keysym, Qbutton4) || EQ (raw_key.keysym, Qbutton4up) ||
-      EQ (raw_key.keysym, Qbutton5) || EQ (raw_key.keysym, Qbutton5up) ||
-      EQ (raw_key.keysym, Qbutton6) || EQ (raw_key.keysym, Qbutton6up) ||
-      EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up) ||
-      EQ (raw_key.keysym, Qbutton8) || EQ (raw_key.keysym, Qbutton8up) ||
-      EQ (raw_key.keysym, Qbutton9) || EQ (raw_key.keysym, Qbutton9up) ||
-      EQ (raw_key.keysym, Qbutton10) || EQ (raw_key.keysym, Qbutton10up) ||
-      EQ (raw_key.keysym, Qbutton11) || EQ (raw_key.keysym, Qbutton11up) ||
-      EQ (raw_key.keysym, Qbutton12) || EQ (raw_key.keysym, Qbutton12up) ||
-      EQ (raw_key.keysym, Qbutton13) || EQ (raw_key.keysym, Qbutton13up) ||
-      EQ (raw_key.keysym, Qbutton14) || EQ (raw_key.keysym, Qbutton14up) ||
-      EQ (raw_key.keysym, Qbutton15) || EQ (raw_key.keysym, Qbutton15up) ||
-      EQ (raw_key.keysym, Qbutton16) || EQ (raw_key.keysym, Qbutton16up) ||
-      EQ (raw_key.keysym, Qbutton17) || EQ (raw_key.keysym, Qbutton17up) ||
-      EQ (raw_key.keysym, Qbutton18) || EQ (raw_key.keysym, Qbutton18up) ||
-      EQ (raw_key.keysym, Qbutton19) || EQ (raw_key.keysym, Qbutton19up) ||
-      EQ (raw_key.keysym, Qbutton20) || EQ (raw_key.keysym, Qbutton20up) ||
-      EQ (raw_key.keysym, Qbutton21) || EQ (raw_key.keysym, Qbutton21up) ||
-      EQ (raw_key.keysym, Qbutton22) || EQ (raw_key.keysym, Qbutton22up) ||
-      EQ (raw_key.keysym, Qbutton23) || EQ (raw_key.keysym, Qbutton23up) ||
-      EQ (raw_key.keysym, Qbutton24) || EQ (raw_key.keysym, Qbutton24up) ||
-      EQ (raw_key.keysym, Qbutton25) || EQ (raw_key.keysym, Qbutton25up) ||
-      EQ (raw_key.keysym, Qbutton26) || EQ (raw_key.keysym, Qbutton26up))
+  if (
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num)				\
+      EQ (raw_key.keysym, Qbutton##num) ||	\
+      EQ (raw_key.keysym, Qbutton##num##up) ||
+#include "keymap-buttons.h"
+      0)
     invalid_operation ("Mouse-clicks can't appear in saved keyboard macros",
 		       Qunbound);
 
@@ -1957,17 +1745,17 @@
   if (EQ (keys, new_keys))
     signal_ferror_with_frob (Qinvalid_operation, mpc_binding,
 			     "can't bind %s: %s has a non-keymap binding",
-			     (char *) XSTRING_DATA (Fkey_description (keys)),
-			     (char *) XSTRING_DATA (Fsingle_key_description
-						    (Vmeta_prefix_char)));
+			     (CIbyte *) XSTRING_DATA (Fkey_description (keys)),
+			     (CIbyte *) XSTRING_DATA (Fsingle_key_description
+						      (Vmeta_prefix_char)));
   else
     signal_ferror_with_frob (Qinvalid_operation, mpc_binding,
 			     "can't bind %s: %s %s has a non-keymap binding",
-			     (char *) XSTRING_DATA (Fkey_description (keys)),
-			     (char *) XSTRING_DATA (Fkey_description
-						    (new_keys)),
-			     (char *) XSTRING_DATA (Fsingle_key_description
-						    (Vmeta_prefix_char)));
+			     (CIbyte *) XSTRING_DATA (Fkey_description (keys)),
+			     (CIbyte *) XSTRING_DATA (Fkey_description
+						      (new_keys)),
+			     (CIbyte *) XSTRING_DATA (Fsingle_key_description
+						      (Vmeta_prefix_char)));
 }
 
 DEFUN ("define-key", Fdefine_key, 3, 3, 0, /*
@@ -3231,7 +3019,7 @@
 {
   /* This function can GC */
   Lisp_Object fn;
-  fn = VOID_TO_LISP (function);
+  fn = GET_LISP_FROM_VOID (function);
   call2 (fn, make_key_description (key, 1), binding);
 }
 
@@ -3291,7 +3079,7 @@
   GCPRO2 (function, keymap);
   keymap = get_keymap (keymap, 1, 1);
   map_keymap (XKEYMAP (keymap)->table, !NILP (sort_first),
-	      map_keymap_mapper, LISP_TO_VOID (function));
+	      map_keymap_mapper, STORE_LISP_IN_VOID (function));
   UNGCPRO;
   return Qnil;
 }
@@ -3494,7 +3282,7 @@
 	    string = s2;
 	  else
 	    {
-	      /* if (NILP (sep)) Lisp_Object sep = build_string (" ") */;
+	      /* if (NILP (sep)) Lisp_Object sep = build_ascstring (" ") */;
 	      string = concat2 (string, concat2 (Vsingle_space_string, s2));
 	    }
 	}
@@ -3652,7 +3440,7 @@
     }
 
   *p = 0;
-  return build_string ((char *) buf);
+  return build_istring (buf);
 }
 
 
@@ -3948,7 +3736,7 @@
 	      Lisp_Key_Data *new_ = xnew_array (Lisp_Key_Data, size);
 	      memcpy ((void *)new_, (const void *)c->keys_so_far,
 		      c->keys_so_far_total_size * sizeof (Lisp_Key_Data));
-	      xfree (c->keys_so_far, Lisp_Key_Data);
+	      xfree (c->keys_so_far);
 	      c->keys_so_far = new_;
 	    }
 	  else
@@ -4024,7 +3812,7 @@
     result = Fnreverse (result);
 
   if (c.keys_so_far_malloced)
-    xfree (c.keys_so_far, Lisp_Key_Data *);
+    xfree (c.keys_so_far);
   return result;
 }
 
@@ -4147,7 +3935,7 @@
 
   Findent_to (make_int (16), make_int (3), buffer);
   if (keymapp)
-    buffer_insert_c_string (XBUFFER (buffer), "<< ");
+    buffer_insert_ascstring (XBUFFER (buffer), "<< ");
 
   if (SYMBOLP (definition))
     {
@@ -4155,19 +3943,19 @@
     }
   else if (STRINGP (definition) || VECTORP (definition))
     {
-      buffer_insert_c_string (XBUFFER (buffer), "Kbd Macro: ");
+      buffer_insert_ascstring (XBUFFER (buffer), "Kbd Macro: ");
       buffer_insert1 (XBUFFER (buffer), Fkey_description (definition));
     }
   else if (COMPILED_FUNCTIONP (definition))
-    buffer_insert_c_string (XBUFFER (buffer), "Anonymous Compiled Function");
+    buffer_insert_ascstring (XBUFFER (buffer), "Anonymous Compiled Function");
   else if (CONSP (definition) && EQ (XCAR (definition), Qlambda))
-    buffer_insert_c_string (XBUFFER (buffer), "Anonymous Lambda");
+    buffer_insert_ascstring (XBUFFER (buffer), "Anonymous Lambda");
   else if (KEYMAPP (definition))
     {
       Lisp_Object name = XKEYMAP (definition)->name;
       if (STRINGP (name) || (SYMBOLP (name) && !NILP (name)))
 	{
-	  buffer_insert_c_string (XBUFFER (buffer), "Prefix command ");
+	  buffer_insert_ascstring (XBUFFER (buffer), "Prefix command ");
 	  if (SYMBOLP (name)
 	      && EQ (find_symbol_value (name), definition))
 	    buffer_insert1 (XBUFFER (buffer), Fsymbol_name (name));
@@ -4177,14 +3965,14 @@
 	    }
 	}
       else
-	buffer_insert_c_string (XBUFFER (buffer), "Prefix Command");
+	buffer_insert_ascstring (XBUFFER (buffer), "Prefix Command");
     }
   else
-    buffer_insert_c_string (XBUFFER (buffer), "??");
+    buffer_insert_ascstring (XBUFFER (buffer), "??");
 
   if (keymapp)
-    buffer_insert_c_string (XBUFFER (buffer), " >>");
-  buffer_insert_c_string (XBUFFER (buffer), "\n");
+    buffer_insert_ascstring (XBUFFER (buffer), " >>");
+  buffer_insert_ascstring (XBUFFER (buffer), "\n");
   UNGCPRO;
 }
 
@@ -4249,60 +4037,12 @@
   /* If we're only supposed to display mouse bindings and this isn't one,
      then bug out. */
   if (closure->mice_only_p &&
-      (! (EQ (keysym, Qbutton0) ||
-	  EQ (keysym, Qbutton1) ||
-	  EQ (keysym, Qbutton2) ||
-	  EQ (keysym, Qbutton3) ||
-	  EQ (keysym, Qbutton4) ||
-	  EQ (keysym, Qbutton5) ||
-	  EQ (keysym, Qbutton6) ||
-	  EQ (keysym, Qbutton7) ||
-          EQ (keysym, Qbutton8) ||
-          EQ (keysym, Qbutton9) ||
-          EQ (keysym, Qbutton10) ||
-          EQ (keysym, Qbutton11) ||
-          EQ (keysym, Qbutton12) ||
-          EQ (keysym, Qbutton13) ||
-          EQ (keysym, Qbutton14) ||
-          EQ (keysym, Qbutton15) ||
-          EQ (keysym, Qbutton16) ||
-          EQ (keysym, Qbutton17) ||
-          EQ (keysym, Qbutton18) ||
-          EQ (keysym, Qbutton19) ||
-          EQ (keysym, Qbutton20) ||
-          EQ (keysym, Qbutton21) ||
-          EQ (keysym, Qbutton22) ||
-          EQ (keysym, Qbutton23) ||
-          EQ (keysym, Qbutton24) ||
-          EQ (keysym, Qbutton25) ||
-          EQ (keysym, Qbutton26) ||
-	  EQ (keysym, Qbutton0up) ||
-	  EQ (keysym, Qbutton1up) ||
-	  EQ (keysym, Qbutton2up) ||
-	  EQ (keysym, Qbutton3up) ||
-	  EQ (keysym, Qbutton4up) ||
-	  EQ (keysym, Qbutton5up) ||
-          EQ (keysym, Qbutton6up) ||
-          EQ (keysym, Qbutton7up) ||
-          EQ (keysym, Qbutton8up) ||
-          EQ (keysym, Qbutton9up) ||
-          EQ (keysym, Qbutton10up) ||
-          EQ (keysym, Qbutton11up) ||
-          EQ (keysym, Qbutton12up) ||
-          EQ (keysym, Qbutton13up) ||
-          EQ (keysym, Qbutton14up) ||
-          EQ (keysym, Qbutton15up) ||
-          EQ (keysym, Qbutton16up) ||
-          EQ (keysym, Qbutton17up) ||
-          EQ (keysym, Qbutton18up) ||
-          EQ (keysym, Qbutton19up) ||
-          EQ (keysym, Qbutton20up) ||
-          EQ (keysym, Qbutton21up) ||
-          EQ (keysym, Qbutton22up) ||
-          EQ (keysym, Qbutton23up) ||
-          EQ (keysym, Qbutton24up) ||
-          EQ (keysym, Qbutton25up) ||
-          EQ (keysym, Qbutton26up))))
+      (! (
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num) EQ (keysym, Qbutton##num) || \
+                  EQ (keysym, Qbutton##num##up) ||
+#include "keymap-buttons.h"
+	  0)))
     return;
 
   /* If this command in this map is shadowed by some other map, ignore it. */
@@ -4467,7 +4207,7 @@
   if (!NILP (list))
     {
       list = list_sort (list, Qnil, describe_map_sort_predicate);
-      buffer_insert_c_string (buf, "\n");
+      buffer_insert_ascstring (buf, "\n");
       while (!NILP (list))
 	{
           Lisp_Object elt = XCAR (XCAR (list));
@@ -4478,17 +4218,17 @@
 	    buffer_insert_lisp_string (buf, elt_prefix);
 
 	  if (modifiers & XEMACS_MOD_META)
-	    buffer_insert_c_string (buf, "M-");
+	    buffer_insert_ascstring (buf, "M-");
 	  if (modifiers & XEMACS_MOD_CONTROL)
-	    buffer_insert_c_string (buf, "C-");
+	    buffer_insert_ascstring (buf, "C-");
 	  if (modifiers & XEMACS_MOD_SUPER)
-	    buffer_insert_c_string (buf, "S-");
+	    buffer_insert_ascstring (buf, "S-");
 	  if (modifiers & XEMACS_MOD_HYPER)
-	    buffer_insert_c_string (buf, "H-");
+	    buffer_insert_ascstring (buf, "H-");
 	  if (modifiers & XEMACS_MOD_ALT)
-	    buffer_insert_c_string (buf, "Alt-");
+	    buffer_insert_ascstring (buf, "Alt-");
 	  if (modifiers & XEMACS_MOD_SHIFT)
-	    buffer_insert_c_string (buf, "Sh-");
+	    buffer_insert_ascstring (buf, "Sh-");
 	  if (SYMBOLP (keysym))
 	    {
 	      Lisp_Object code = Fget (keysym, Qcharacter_of_keysym, Qnil);
@@ -4497,19 +4237,19 @@
 	      /* Calling Fsingle_key_description() would cons more */
 #if 0                           /* This is bogus */
 	      if (EQ (keysym, QKlinefeed))
-		buffer_insert_c_string (buf, "LFD");
+		buffer_insert_ascstring (buf, "LFD");
 	      else if (EQ (keysym, QKtab))
-		buffer_insert_c_string (buf, "TAB");
+		buffer_insert_ascstring (buf, "TAB");
 	      else if (EQ (keysym, QKreturn))
-		buffer_insert_c_string (buf, "RET");
+		buffer_insert_ascstring (buf, "RET");
 	      else if (EQ (keysym, QKescape))
-		buffer_insert_c_string (buf, "ESC");
+		buffer_insert_ascstring (buf, "ESC");
 	      else if (EQ (keysym, QKdelete))
-		buffer_insert_c_string (buf, "DEL");
+		buffer_insert_ascstring (buf, "DEL");
 	      else if (EQ (keysym, QKspace))
-		buffer_insert_c_string (buf, "SPC");
+		buffer_insert_ascstring (buf, "SPC");
 	      else if (EQ (keysym, QKbackspace))
-		buffer_insert_c_string (buf, "BS");
+		buffer_insert_ascstring (buf, "BS");
 	      else
 #endif
                 if (c >= printable_min)
@@ -4519,7 +4259,7 @@
 	  else if (CHARP (keysym))
 	    buffer_insert_emacs_char (buf, XCHAR (keysym));
 	  else
-	    buffer_insert_c_string (buf, "---bad keysym---");
+	    buffer_insert_ascstring (buf, "---bad keysym---");
 
 	  if (elided)
 	    elided = 0;
@@ -4535,9 +4275,9 @@
 	      if (k != 0)
 		{
 		  if (k == 1)
-		    buffer_insert_c_string (buf, ", ");
+		    buffer_insert_ascstring (buf, ", ");
 		  else
-		    buffer_insert_c_string (buf, " .. ");
+		    buffer_insert_ascstring (buf, " .. ");
 		  elided = 1;
 		  continue;
 		}
@@ -4606,112 +4346,15 @@
   DEFSYMBOL (Qhyper);
   DEFSYMBOL (Qalt);
   DEFSYMBOL (Qshift);
-  DEFSYMBOL (Qbutton0);
-  DEFSYMBOL (Qbutton1);
-  DEFSYMBOL (Qbutton2);
-  DEFSYMBOL (Qbutton3);
-  DEFSYMBOL (Qbutton4);
-  DEFSYMBOL (Qbutton5);
-  DEFSYMBOL (Qbutton6);
-  DEFSYMBOL (Qbutton7);
-  DEFSYMBOL (Qbutton8);
-  DEFSYMBOL (Qbutton9);
-  DEFSYMBOL (Qbutton10);
-  DEFSYMBOL (Qbutton11);
-  DEFSYMBOL (Qbutton12);
-  DEFSYMBOL (Qbutton13);
-  DEFSYMBOL (Qbutton14);
-  DEFSYMBOL (Qbutton15);
-  DEFSYMBOL (Qbutton16);
-  DEFSYMBOL (Qbutton17);
-  DEFSYMBOL (Qbutton18);
-  DEFSYMBOL (Qbutton19);
-  DEFSYMBOL (Qbutton20);
-  DEFSYMBOL (Qbutton21);
-  DEFSYMBOL (Qbutton22);
-  DEFSYMBOL (Qbutton23);
-  DEFSYMBOL (Qbutton24);
-  DEFSYMBOL (Qbutton25);
-  DEFSYMBOL (Qbutton26);
-  DEFSYMBOL (Qbutton0up);
-  DEFSYMBOL (Qbutton1up);
-  DEFSYMBOL (Qbutton2up);
-  DEFSYMBOL (Qbutton3up);
-  DEFSYMBOL (Qbutton4up);
-  DEFSYMBOL (Qbutton5up);
-  DEFSYMBOL (Qbutton6up);
-  DEFSYMBOL (Qbutton7up);
-  DEFSYMBOL (Qbutton8up);
-  DEFSYMBOL (Qbutton9up);
-  DEFSYMBOL (Qbutton10up);
-  DEFSYMBOL (Qbutton11up);
-  DEFSYMBOL (Qbutton12up);
-  DEFSYMBOL (Qbutton13up);
-  DEFSYMBOL (Qbutton14up);
-  DEFSYMBOL (Qbutton15up);
-  DEFSYMBOL (Qbutton16up);
-  DEFSYMBOL (Qbutton17up);
-  DEFSYMBOL (Qbutton18up);
-  DEFSYMBOL (Qbutton19up);
-  DEFSYMBOL (Qbutton20up);
-  DEFSYMBOL (Qbutton21up);
-  DEFSYMBOL (Qbutton22up);
-  DEFSYMBOL (Qbutton23up);
-  DEFSYMBOL (Qbutton24up);
-  DEFSYMBOL (Qbutton25up);
-  DEFSYMBOL (Qbutton26up);
-  DEFSYMBOL (Qmouse_1);
-  DEFSYMBOL (Qmouse_2);
-  DEFSYMBOL (Qmouse_3);
-  DEFSYMBOL (Qmouse_4);
-  DEFSYMBOL (Qmouse_5);
-  DEFSYMBOL (Qmouse_6);
-  DEFSYMBOL (Qmouse_7);
-  DEFSYMBOL (Qmouse_8);
-  DEFSYMBOL (Qmouse_9);
-  DEFSYMBOL (Qmouse_10);
-  DEFSYMBOL (Qmouse_11);
-  DEFSYMBOL (Qmouse_12);
-  DEFSYMBOL (Qmouse_13);
-  DEFSYMBOL (Qmouse_14);
-  DEFSYMBOL (Qmouse_15);
-  DEFSYMBOL (Qmouse_16);
-  DEFSYMBOL (Qmouse_17);
-  DEFSYMBOL (Qmouse_18);
-  DEFSYMBOL (Qmouse_19);
-  DEFSYMBOL (Qmouse_20);
-  DEFSYMBOL (Qmouse_21);
-  DEFSYMBOL (Qmouse_22);
-  DEFSYMBOL (Qmouse_23);
-  DEFSYMBOL (Qmouse_24);
-  DEFSYMBOL (Qmouse_25);
-  DEFSYMBOL (Qmouse_26);
-  DEFSYMBOL (Qdown_mouse_1);
-  DEFSYMBOL (Qdown_mouse_2);
-  DEFSYMBOL (Qdown_mouse_3);
-  DEFSYMBOL (Qdown_mouse_4);
-  DEFSYMBOL (Qdown_mouse_5);
-  DEFSYMBOL (Qdown_mouse_6);
-  DEFSYMBOL (Qdown_mouse_7);
-  DEFSYMBOL (Qdown_mouse_8);
-  DEFSYMBOL (Qdown_mouse_9);
-  DEFSYMBOL (Qdown_mouse_10);
-  DEFSYMBOL (Qdown_mouse_11);
-  DEFSYMBOL (Qdown_mouse_12);
-  DEFSYMBOL (Qdown_mouse_13);
-  DEFSYMBOL (Qdown_mouse_14);
-  DEFSYMBOL (Qdown_mouse_15);
-  DEFSYMBOL (Qdown_mouse_16);
-  DEFSYMBOL (Qdown_mouse_17);
-  DEFSYMBOL (Qdown_mouse_18);
-  DEFSYMBOL (Qdown_mouse_19);
-  DEFSYMBOL (Qdown_mouse_20);
-  DEFSYMBOL (Qdown_mouse_21);
-  DEFSYMBOL (Qdown_mouse_22);
-  DEFSYMBOL (Qdown_mouse_23);
-  DEFSYMBOL (Qdown_mouse_24);
-  DEFSYMBOL (Qdown_mouse_25);
-  DEFSYMBOL (Qdown_mouse_26);
+#define INCLUDE_BUTTON_ZERO
+#define FROB(num)				\
+  DEFSYMBOL (Qbutton##num);			\
+  DEFSYMBOL (Qbutton##num##up);
+#include "keymap-buttons.h"
+#define FROB(num)				\
+  DEFSYMBOL (Qmouse_##num);			\
+  DEFSYMBOL (Qdown_mouse_##num);
+#include "keymap-buttons.h"
   DEFSYMBOL (Qmenu_selection);
   DEFSYMBOL (QLFD);
   DEFSYMBOL (QTAB);
--- a/src/keymap.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/keymap.h	Wed Feb 24 01:58:04 2010 -0600
@@ -39,12 +39,10 @@
 EXFUN (Fwhere_is_internal, 5);
 
 extern Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qshift, Qsuper;
-extern Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
-extern Lisp_Object Qbutton6, Qbutton7, Qbutton8, Qbutton9, Qbutton10;
-extern Lisp_Object Qbutton11, Qbutton12, Qbutton13, Qbutton14, Qbutton15;
-extern Lisp_Object Qbutton16, Qbutton17, Qbutton18, Qbutton19, Qbutton20;
-extern Lisp_Object Qbutton21, Qbutton22, Qbutton23, Qbutton24, Qbutton25;
-extern Lisp_Object Qbutton26;
+
+#define FROB(num)				\
+extern Lisp_Object Qbutton##num;
+#include "keymap-buttons.h"
 extern Lisp_Object Vmeta_prefix_char;
 
 Lisp_Object get_keymap (Lisp_Object object, int errorp, int autoload);
--- a/src/lisp-disunion.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/lisp-disunion.h	Wed Feb 24 01:58:04 2010 -0600
@@ -114,15 +114,17 @@
 
 /* WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-   You can only VOID_TO_LISP something that had previously been
-   LISP_TO_VOID'd.  You cannot go the other way, i.e. create a bogus
-   Lisp_Object.  If you want to stuff a void * into a Lisp_Object, use
-   make_opaque_ptr(). */
+   You can only GET_LISP_FROM_VOID something that had previously been
+   STORE_LISP_IN_VOID'd.  If you want to go the other way, use
+   STORE_VOID_IN_LISP and GET_VOID_FROM_LISP, or use make_opaque_ptr(). */
 
-/* Convert between a (void *) and a Lisp_Object, as when the
-   Lisp_Object is passed to a toolkit callback function */
-#define VOID_TO_LISP(varg) ((Lisp_Object) (varg))
-#define LISP_TO_VOID(larg) ((void *) (larg))
+/* Convert a Lisp object to a void * pointer, as when it needs to be passed
+   to a toolkit callback function */
+#define STORE_LISP_IN_VOID(larg) ((void *) (larg))
+
+/* Convert a void * pointer back into a Lisp object, assuming that the
+   pointer was generated by STORE_LISP_IN_VOID. */
+#define GET_LISP_FROM_VOID(varg) ((Lisp_Object) (varg))
 
 /* Convert a Lisp_Object into something that can't be used as an
    lvalue.  Useful for type-checking. */
--- a/src/lisp-union.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/lisp-union.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Fundamental definitions for XEmacs Lisp interpreter -- union objects.
    Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994
    Free Software Foundation, Inc.
-   Copyright (C) 2002, 2005 Ben Wing.
+   Copyright (C) 2002, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -142,16 +142,19 @@
 
 /* WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-   You can only VOID_TO_LISP something that had previously been
-   LISP_TO_VOID'd.  You cannot go the other way, i.e. create a bogus
-   Lisp_Object.  If you want to stuff a void * into a Lisp_Object, use
-   make_opaque_ptr(). */
+   You can only GET_LISP_FROM_VOID something that had previously been
+   STORE_LISP_IN_VOID'd.  If you want to go the other way, use
+   STORE_VOID_IN_LISP and GET_VOID_FROM_LISP, or use make_opaque_ptr(). */
 
-/* Convert between a (void *) and a Lisp_Object, as when the
-   Lisp_Object is passed to a toolkit callback function */
+/* Convert a Lisp object to a void * pointer, as when it needs to be passed
+   to a toolkit callback function */
+#define STORE_LISP_IN_VOID(larg) ((void *) ((larg).v))
+
+/* Convert a void * pointer back into a Lisp object, assuming that the
+   pointer was generated by STORE_LISP_IN_VOID. */
 DECLARE_INLINE_HEADER (
 Lisp_Object
-VOID_TO_LISP (const void *arg)
+GET_LISP_FROM_VOID (const void *arg)
 )
 {
   Lisp_Object larg;
@@ -159,8 +162,6 @@
   return larg;
 }
 
-#define LISP_TO_VOID(larg) ((void *) ((larg).v))
-
 /* Convert a Lisp_Object into something that can't be used as an
    lvalue.  Useful for type-checking. */
 #if (__GNUC__ > 1)
--- a/src/lisp.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/lisp.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Fundamental definitions for XEmacs Lisp interpreter.
    Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1993-1996 Richard Mlynarik.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2000-2005, 2009, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -22,6 +22,9 @@
 
 /* Synched up with: FSF 19.30. */
 
+#ifndef INCLUDED_lisp_h_
+#define INCLUDED_lisp_h_
+
 /* Authorship:
 
    Based on code from pre-release FSF 19, c. 1991.
@@ -50,13 +53,6 @@
      Compiler-specific definitions modernized and moved to compiler.h.
 */
 
-#ifndef INCLUDED_lisp_h_
-#define INCLUDED_lisp_h_
-
-/************************************************************************/
-/*			  general definitions				*/
-/************************************************************************/
-
 /* Conventions in comments:
 
    "Mule-izing" is the process of going through a file and eliminating
@@ -91,7 +87,9 @@
 
    */
 
-/* -------------------------- include files --------------------- */
+/************************************************************************/
+/*                            include files                             */
+/************************************************************************/
 
 /* We include the following generally useful header files so that you
    don't have to worry about prototypes when using the standard C
@@ -99,73 +97,252 @@
    large so they shouldn't cause that much of a slowdown. */
 
 #include <stdlib.h>
+/* Evil, but ...  -Wshadow is genuinely useful but also leads to spurious
+   warnings when you have a local var named `index'.  Avoid this by
+   hacking around it. */
+#define index old_index
 #include <string.h>		/* primarily for memcpy, etc. */
+#undef index
 #include <stdio.h>		/* NULL, etc. */
 #include <ctype.h>
 #include <stdarg.h>
 #include <stddef.h>		/* offsetof */
 #include <sys/types.h>
 #include <limits.h>
-
-/* -------------------------- error-checking ------------------------ */
-
-/* The large categories established by configure can be subdivided into
-   smaller subcategories, for problems in specific modules.  You can't
-   control this using configure, but you can manually stick in a define as
-   necessary. */
+#ifdef __cplusplus
+#include <limits>		/* necessary for max()/min() under G++ 4 */
+#endif
+
+
+/************************************************************************/
+/*                            error checking                            */
+/************************************************************************/
+
+/* ------------------------- large categories ------------------------- */
+
+/* How these work:
+
+   The most common classes will be `text' and `type', followed by `structure'.
+   `text' is for problems related to bad textual format.  `type' is for
+   problems related to wrongly typed arguments, structure fields, etc.
+   `structure' is for bad data inside of a structure.  Sometimes these are
+   used "incorrectly", e.g. `type' is often used for structure-checking.
+   Consider `text':
+
+   `text_checking_assert() will assert() only when ERROR_CHECK_TEXT is defined;
+   otherwise it's a no-op.  text_checking_assert_at_line() is similar, but
+   allows you to override the file name and line number normally supplied in
+   the message.  This is especially useful in inline header functions, and
+   so there's a special inline_text_checking_assert() for this; this works
+   like text_checking_assert() but supplies the file and line of the calling
+   function.  In order for this to work, you need to declare your inline
+   function with INLINE_TEXT_CHECK_ARGS at the end of its argument list,
+   and give its function name a _1 extension or similar.  Then create a
+   macro that calls your inline function and includes INLINE_TEXT_CHECK_CALL
+   at the end of the parameter list.  This will arrange to pass in and receive
+   the file and line (__FILE__, __LINE__) at place where the call occurs in
+   the calling function; but nothing will get passed in when ERROR_CHECK_TEXT
+   is not defined.
+
+   Currently the full bevy of *foo_checking_assert* macros are defined only
+   for `text' and `types'; for others, only the basic foo_checking_assert()
+   macro is defined.  Writing out all the variations for all possible error
+   categories would produce too much clutter.  If any of these become
+   needed, they can always be defined. */
+
+   /* #### I suggest revamping these and making proper use of the
+      category/subcategory system.  Here is one proposal:
+
+	Major category 	Minor categories
+	--------------------------------
+	Allocation
+			Malloc
+			Dynarr
+
+	Display
+			Extents
+			Glyphs
+			Redisplay
+
+	Execution
+			Byte-Code
+			Catch
+			Garbage Collection
+			Trapping-Problems
+
+	Lisp Objects
+			Buffers
+			Char Tables
+			Events
+			Lstreams
+			Hash Tables
+			Range Tables
+
+	Types
+			Lrecord Types
+			Subtypes
+
+	Text
+			Byte Positions
+			Conversion
+			Eistrings
+			Itext
+			Lisp Strings
+
+    --ben
+*/
+
+
+#define INLINE_ERROR_CHECK_ARGS , const char *__file__, int __line__
+#define INLINE_ERROR_CHECK_CALL , __FILE__, __LINE__
+#define DISABLED_INLINE_ERROR_CHECK_ARGS
+#define DISABLED_INLINE_ERROR_CHECK_CALL
+
+/* For assertions in inline header functions which will report the file and
+   line of the calling function */
+#define inline_assert(assertion) assert_at_line (assertion, __file__, __line__)
+/* The following should not use disabled_assert_at_line() because when the
+   inline assert is disabled, params __file__ and __line__ do not exist. */
+#define disabled_inline_assert(assertion) disabled_assert (assertion)
+
+/* ------- the specific categories -------- */
+
+#if defined (ERROR_CHECK_BYTE_CODE) || defined (ERROR_CHECK_DISPLAY) || defined (ERROR_CHECK_EXTENTS) || defined (ERROR_CHECK_GC) || defined (ERROR_CHECK_GLYPHS) || defined (ERROR_CHECK_MALLOC) || defined (ERROR_CHECK_STRUCTURES) || defined (ERROR_CHECK_TEXT) || defined (ERROR_CHECK_TYPES)
+#define ERROR_CHECK_ANY
+#endif
+
+/* KEEP THESE SORTED! */
+
+#ifdef ERROR_CHECK_BYTE_CODE
+#define byte_code_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_BYTE_CODE */
+#define byte_code_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_BYTE_CODE */
+
+#ifdef ERROR_CHECK_DISPLAY
+#define display_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_DISPLAY */
+#define display_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_DISPLAY */
+
+#ifdef ERROR_CHECK_EXTENTS
+#define extent_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_EXTENTS */
+#define extent_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_EXTENTS */
+
+#ifdef ERROR_CHECK_GC
+#define gc_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_GC */
+#define gc_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_GC */
+
+#ifdef ERROR_CHECK_GLYPHS
+#define glyph_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_GLYPHS */
+#define glyph_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_GLYPHS */
+
+#ifdef ERROR_CHECK_MALLOC
+#define malloc_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_MALLOC */
+#define malloc_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_MALLOC */
 
 #ifdef ERROR_CHECK_STRUCTURES
-/* Check for problems with the catch list and specbind stack */
-#define ERROR_CHECK_CATCH
-/* Check for insufficient use of call_trapping_problems(), particularly
-   due to glyph-related changes causing eval or QUIT within redisplay */
-#define ERROR_CHECK_TRAPPING_PROBLEMS
-#endif
+#define structure_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_STRUCTURES */
+#define structure_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_STRUCTURES */
+
+#ifdef ERROR_CHECK_TEXT
+#define text_checking_assert(assertion) assert (assertion)
+#define text_checking_assert_at_line(assertion, file, line) \
+  assert_at_line (assertion, file, line)
+#define inline_text_checking_assert(assertion) inline_assert (assertion)
+#define INLINE_TEXT_CHECK_ARGS INLINE_ERROR_CHECK_ARGS
+#define INLINE_TEXT_CHECK_CALL INLINE_ERROR_CHECK_CALL
+#define text_checking_assert_with_message(assertion, msg) \
+  assert_with_message (assertion, msg)
+#else /* not ERROR_CHECK_TEXT */
+#define text_checking_assert(assertion) disabled_assert (assertion)
+#define text_checking_assert_at_line(assertion, file, line) \
+  disabled_assert_at_line (assertion, file, line)
+#define inline_text_checking_assert(assertion) \
+  disabled_inline_assert (assertion)
+#define INLINE_TEXT_CHECK_ARGS DISABLED_INLINE_ERROR_CHECK_ARGS
+#define INLINE_TEXT_CHECK_CALL DISABLED_INLINE_ERROR_CHECK_CALL
+#define text_checking_assert_with_message(assertion, msg) \
+  disabled_assert_with_message (assertion, msg)
+#endif /* ERROR_CHECK_TEXT */
 
 #ifdef ERROR_CHECK_TYPES
 #define type_checking_assert(assertion) assert (assertion)
 #define type_checking_assert_at_line(assertion, file, line) \
   assert_at_line (assertion, file, line)
+#define inline_type_checking_assert(assertion) inline_assert (assertion)
+#define INLINE_TYPE_CHECK_ARGS INLINE_ERROR_CHECK_ARGS
+#define INLINE_TYPE_CHECK_CALL INLINE_ERROR_CHECK_CALL
 #define type_checking_assert_with_message(assertion, msg) \
   assert_with_message (assertion, msg)
-#else
-#define type_checking_assert(assertion)
-#define type_checking_assert_at_line(assertion, file, line)
-#define type_checking_assert_with_message(assertion, msg)
-#endif
-#ifdef ERROR_CHECK_GC
-#define gc_checking_assert(assertion) assert (assertion)
-#define gc_checking_assert_at_line(assertion, file, line) \
-  assert_at_line (assertion, file, line)
-#define gc_checking_assert_with_message(assertion, msg) \
-  assert_with_message (assertion, msg)
-#else
-#define gc_checking_assert(assertion)
-#define gc_checking_assert_at_line(assertion, file, line)
-#define gc_checking_assert_with_message(assertion, msg)
-#endif
-#ifdef ERROR_CHECK_TEXT
-#define text_checking_assert(assertion) assert (assertion)
-#define text_checking_assert_at_line(assertion, file, line) \
-  assert_at_line (assertion, file, line)
-#define text_checking_assert_with_message(assertion, msg) \
-  assert_with_message (assertion, msg)
-#else
-#define text_checking_assert(assertion)
-#define text_checking_assert_at_line(assertion, file, line)
-#define text_checking_assert_with_message(assertion, msg)
-#endif
+#else /* not ERROR_CHECK_TYPES */
+#define type_checking_assert(assertion) disabled_assert (assertion)
+#define type_checking_assert_at_line(assertion, file, line) \
+  disabled_assert_at_line (assertion, file, line)
+#define inline_type_checking_assert(assertion) \
+  disabled_inline_assert (assertion)
+#define INLINE_TYPE_CHECK_ARGS DISABLED_INLINE_ERROR_CHECK_ARGS
+#define INLINE_TYPE_CHECK_CALL DISABLED_INLINE_ERROR_CHECK_CALL
+#define type_checking_assert_with_message(assertion, msg) \
+  disabled_assert_with_message (assertion, msg)
+#endif /* ERROR_CHECK_TYPES */
+
+/* ------------------------- small categories ------------------------- */
+
+/* The large categories established by configure can be subdivided into
+   smaller subcategories, for problems in specific modules.  You can't
+   control this using configure, but you can manually stick in a define as
+   necessary.
+
+   The idea is to go ahead and create a new type of error-checking and
+   have it turned on if the larger category it is a part of is also
+   turned on.  For example, ERROR_CHECK_DYNARR is considered a subcategory
+   of ERROR_CHECK_STRUCTURES.
+
+   We also define foo_checking_assert() macros for convenience, but
+   generally don't define the many variations of this macro as for the
+   major types above, because it produces too much clutter.  If any of
+   these become needed, they can always be defined. */
+
+#ifdef ERROR_CHECK_STRUCTURES
+/* Check for problems with the catch list and specbind stack */
+#define ERROR_CHECK_CATCH
+/* Check for incoherent Dynarr structures, attempts to access Dynarr
+   positions out of range, reentrant use of Dynarrs through Dynarr locking,
+   etc. */
+#define ERROR_CHECK_DYNARR
+/* Check for insufficient use of call_trapping_problems(), particularly
+   due to glyph-related changes causing eval or QUIT within redisplay */
+#define ERROR_CHECK_TRAPPING_PROBLEMS
+#endif /* ERROR_CHECK_STRUCTURES */
+
+#ifdef ERROR_CHECK_CATCH
+#define catch_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_CATCH */
+#define catch_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_CATCH */
+
+#ifdef ERROR_CHECK_DYNARR
+#define dynarr_checking_assert(assertion) assert (assertion)
+#else /* not ERROR_CHECK_DYNARR */
+#define dynarr_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_DYNARR */
+
 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS
 #define trapping_problems_checking_assert(assertion) assert (assertion)
-#define trapping_problems_checking_assert_at_line(assertion, file, line) \
-  assert_at_line (assertion, file, line)
-#define trapping_problems_checking_assert_with_message(assertion, msg) \
-  assert_with_message (assertion, msg)
-#else
-#define trapping_problems_checking_assert(assertion)
-#define trapping_problems_checking_assert_at_line(assertion, file, line)
-#define trapping_problems_checking_assert_with_message(assertion, msg)
-#endif
+#else /* not ERROR_CHECK_TRAPPING_PROBLEMS */
+#define trapping_problems_checking_assert(assertion) disabled_assert (assertion)
+#endif /* ERROR_CHECK_TRAPPING_PROBLEMS */
 
 /************************************************************************/
 /**                     Definitions of basic types                     **/
@@ -315,7 +492,8 @@
    c) [Ascbyte] pure ASCII text
    d) [Binbyte] binary data that is not meant to be interpreted as text
    e) [Rawbyte] general data in memory, where we don't care about whether
-                it's text or binary
+                it's text or binary; often used when computing memory-
+                based/byte-based offsets of pointers
    f) [Boolbyte] a zero or a one
    g) [Bitbyte] a byte used for bit fields
    h) [Chbyte] null-semantics `char *'; used when casting an argument to
@@ -1051,7 +1229,18 @@
 /* Highly dubious kludge */
 /*   (thanks, Jamie, I feel better now -- ben) */
 MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *);
-#define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()"))
+#define ABORT() assert_failed (__FILE__, __LINE__, "ABORT()")
+#define abort_with_message(msg) assert_failed (__FILE__, __LINE__, msg)
+
+/* This used to be ((void) (0)) but that triggers lots of unused variable
+   warnings.  It's pointless to force all that code to be rewritten, with
+   added ifdefs.  Any reasonable compiler will eliminate an expression with
+   no effects.  We keep this abstracted out like this in case we want to
+   change it in the future. */
+#define disabled_assert(x) ((void) (x))
+#define disabled_assert_with_message(x, msg) ((void) msg, disabled_assert (x))
+#define disabled_assert_at_line(x, file, line) \
+  ((void) file, (void) line, disabled_assert (x))
 
 #ifdef USE_ASSERTIONS
 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x))
@@ -1059,18 +1248,14 @@
   ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg))
 # define assert_at_line(x, file, line) \
   ((x) ? (void) 0 : assert_failed (file, line, #x))
-#elif defined (DEBUG_XEMACS)
-# define assert(x) ((x) ? (void) 0 : (void) ABORT ())
-# define assert_with_message(x, msg) assert (x)
-# define assert_at_line(x, file, line) assert (x)
 #else
 /* This used to be ((void) (0)) but that triggers lots of unused variable
    warnings.  It's pointless to force all that code to be rewritten, with
    added ifdefs.  Any reasonable compiler will eliminate an expression with
    no effects. */
-# define assert(x) ((void) (x))
-# define assert_with_message(x, msg) assert (x)
-# define assert_at_line(x, file, line) assert (x)
+# define assert(x) disabled_assert (x)
+# define assert_with_message(x, msg) disabled_assert_with_message (x, msg)
+# define assert_at_line(x, file, line) disabled_assert_at_line (x, file, line)
 #endif
 
 /************************************************************************/
@@ -1090,16 +1275,15 @@
 
 MODULE_API void xfree_1 (void *);
 #ifdef ERROR_CHECK_MALLOC
-/* This used to use a temporary variable, which both avoided the multiple
-   evaluation and obviated the need for the TYPE argument.  But that triggered
+/* This used to use a temporary variable.  But that triggered
    complaints under strict aliasing. #### There should be a better way. */
-#define xfree(lvalue, type) do						\
+#define xfree(lvalue) do						\
 {									\
   xfree_1 (lvalue);							\
   VOIDP_CAST (lvalue) = (void *) DEADBEEF_CONSTANT;                     \
 } while (0)
 #else
-#define xfree(lvalue,type) xfree_1 (lvalue)
+#define xfree(lvalue) xfree_1 (lvalue)
 #endif /* ERROR_CHECK_MALLOC */
 
 /* ------------------------ stack allocation -------------------------- */
@@ -1383,6 +1567,18 @@
   MUNGE_ME_KEY_TRANSLATION
 };
 
+/* The various stages of font instantiation; initial means "find a font for
+   CHARSET that matches the charset's registries" and final means "find a
+   font for CHARSET that matches iso10646-1, since we haven't found a font
+   that matches its registry."
+*/
+enum font_specifier_matchspec_stages
+{
+  STAGE_INITIAL,
+  STAGE_FINAL,
+  NUM_MATCHSPEC_STAGES,
+};
+
 /* ------------------------------- */
 /*                misc             */
 /* ------------------------------- */
@@ -1484,67 +1680,219 @@
 
 END_C_DECLS
 
-/************************************************************************/
-/**		     Definitions of basic Lisp objects		       **/
+#include "lrecord.h"
+
+/* Turn any void * pointer into a Lisp object.  This is the counterpart of
+   STORE_LISP_IN_VOID, which works in the opposite direction.  Note that
+   you CANNOT use STORE_LISP_IN_VOID to undo the effects of STORE_VOID_IN_LISP!
+   Instead, you GET_VOID_FROM_LISP:
+
+   STORE_VOID_IN_LISP <--> GET_VOID_FROM_LISP         vs.
+   STORE_LISP_IN_VOID <--> GET_LISP_FROM_VOID
+
+   STORE_VOID_IN_LISP has a restriction on the void * pointers it can
+   handle -- the pointer must be an even address (lowest bit set to 0).
+   Generally this is not a problem as nowadays virtually all allocation is
+   at least 4-byte aligned, if not 8-byte.
+
+   However, if this proves problematic, you can use make_opaque_ptr(), which
+   is guaranteed to handle any kind of void * pointer but which does
+   Lisp allocation.
+   */
+
+DECLARE_INLINE_HEADER (
+Lisp_Object
+STORE_VOID_IN_LISP (void *ptr)
+)
+{
+  EMACS_UINT p = (EMACS_UINT) ptr;
+
+  type_checking_assert ((p & 1) == 0);
+  return make_int (p >> 1);
+}
+
+DECLARE_INLINE_HEADER (
+void *
+GET_VOID_FROM_LISP (Lisp_Object obj)
+)
+{
+  EMACS_UINT p = XUINT (obj);
+  return (void *) (p << 1);
+}
+
 /************************************************************************/
-
-#include "lrecord.h"
+/**    Definitions of dynamic arrays (Dynarrs) and other allocators    **/
+/************************************************************************/
 
 BEGIN_C_DECLS
 
-/* ------------------------ dynamic arrays ------------------- */
+/************* Dynarr declaration *************/
 
 #ifdef NEW_GC
-#ifdef ERROR_CHECK_STRUCTURES
-#define Dynarr_declare(type)				\
-  struct lrecord_header header;				\
-  type *base;						\
-  const struct lrecord_implementation *lisp_imp;	\
-  int locked;						\
-  int elsize;						\
-  int cur;						\
-  int largest;						\
-  int max
+#define DECLARE_DYNARR_LISP_IMP()			\
+  const struct lrecord_implementation *lisp_imp;
+#else
+#define DECLARE_DYNARR_LISP_IMP()
+#endif
+
+#ifdef ERROR_CHECK_DYNARR
+#define DECLARE_DYNARR_LOCKED()				\
+  int locked;
 #else
-#define Dynarr_declare(type)				\
-  struct lrecord_header header;				\
-  type *base;						\
-  const struct lrecord_implementation *lisp_imp;	\
-  int elsize;						\
-  int cur;						\
-  int largest;						\
-  int max
-#endif /* ERROR_CHECK_STRUCTURES */
-#else /* not NEW_GC */
-#ifdef ERROR_CHECK_STRUCTURES
-#define Dynarr_declare(type)				\
-  struct lrecord_header header;				\
-  type *base;						\
-  int locked;						\
-  int elsize;						\
-  int cur;						\
-  int largest;						\
-  int max
-#else
-#define Dynarr_declare(type)				\
-  struct lrecord_header header;				\
-  type *base;						\
-  int elsize;						\
-  int cur;						\
-  int largest;						\
-  int max
-#endif /* ERROR_CHECK_STRUCTURES */
-#endif /* not NEW_GC */
+#define DECLARE_DYNARR_LOCKED()
+#endif
+
+#define Dynarr_declare(type)			\
+  struct lrecord_header header;			\
+  type *base;					\
+  DECLARE_DYNARR_LISP_IMP ()			\
+  DECLARE_DYNARR_LOCKED ()			\
+  int elsize;					\
+  int len_;					\
+  int largest_;					\
+  int max_
 
 typedef struct dynarr
 {
   Dynarr_declare (void);
 } Dynarr;
 
+#define XD_DYNARR_DESC(base_type, sub_desc)				\
+  { XD_BLOCK_PTR, offsetof (base_type, base),				\
+    XD_INDIRECT(1, 0), {sub_desc} },					\
+  { XD_INT,        offsetof (base_type, len_) },			\
+  { XD_INT_RESET,  offsetof (base_type, largest_), XD_INDIRECT(1, 0) },	\
+  { XD_INT_RESET,  offsetof (base_type, max_), XD_INDIRECT(1, 0) }
+
+#ifdef NEW_GC
+#define XD_LISP_DYNARR_DESC(base_type, sub_desc)			\
+  { XD_LISP_OBJECT_BLOCK_PTR, offsetof (base_type, base),		\
+    XD_INDIRECT(1, 0), {sub_desc} },					\
+  { XD_INT,        offsetof (base_type, len_) },			\
+  { XD_INT_RESET,  offsetof (base_type, largest_), XD_INDIRECT(1, 0) },	\
+  { XD_INT_RESET,  offsetof (base_type, max_), XD_INDIRECT(1, 0) }
+#endif /* NEW_GC */
+
+/************* Dynarr verification *************/
+
+#ifdef ERROR_CHECK_DYNARR
+DECLARE_INLINE_HEADER (
+int
+Dynarr_verify_pos_at (void *d, int pos, const Ascbyte *file, int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  /* We use `largest', not `len', because the redisplay code often
+     accesses stuff between len and largest. */
+  assert_at_line (pos >= 0 && pos < dy->largest_, file, line);
+  return pos;
+}
+
+DECLARE_INLINE_HEADER (
+int
+Dynarr_verify_pos_atp (void *d, int pos, const Ascbyte *file, int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  /* We use `largest', not `len', because the redisplay code often
+     accesses stuff between len and largest. */
+  /* [[ Code will often do something like ...
+
+     val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0),
+	                                     Dynarr_length (dyn));
+
+     which works fine when the Dynarr_length is non-zero, but when zero,
+     the result of Dynarr_atp() not only points past the end of the
+     allocated array, but the array may not have ever been allocated and
+     hence the return value is NULL.  But the length of 0 causes the
+     pointer to never get checked.  These can occur throughout the code
+     so we put in a special check. --ben ]]
+
+     Update: The common idiom `Dynarr_atp (dyn, 0)' has been changed to
+     `Dynarr_begin (dyn)'.  Possibly this special check at POS 0 can be
+     done only for Dynarr_begin() not for general Dynarr_atp(). --ben */
+  if (pos == 0 && dy->len_ == 0)
+    return pos;
+  /* #### It's vaguely possible that some code could legitimately want to
+     retrieve a pointer to the position just past the end of dynarr memory.
+     This could happen with Dynarr_atp() but not Dynarr_at().  If so, it
+     will trigger this assert().  In such cases, it should be obvious that
+     the code wants to do this; rather than relaxing the assert, we should
+     probably create a new macro Dynarr_atp_allow_end() which is like
+     Dynarr_atp() but which allows for pointing at invalid addresses -- we
+     really want to check for cases of accessing just past the end of
+     memory, which is a likely off-by-one problem to occur and will usually
+     not trigger a protection fault (instead, you'll just get random
+     behavior, possibly overwriting other memory, which is bad). --ben */
+  assert_at_line (pos >= 0 && pos < dy->largest_, file, line);
+  return pos;
+}
+
+DECLARE_INLINE_HEADER (
+int
+Dynarr_verify_pos_atp_allow_end (void *d, int pos, const Ascbyte *file,
+				 int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  /* We use `largest', not `len', because the redisplay code often
+     accesses stuff between len and largest.
+     We also allow referencing the very end, past the end of allocated
+     legitimately space.  See comments in Dynarr_verify_pos_atp.()*/
+  assert_at_line (pos >= 0 && pos <= dy->largest_, file, line);
+  return pos;
+}
+
+#else
+#define Dynarr_verify_pos_at(d, pos, file, line) (pos)
+#define Dynarr_verify_pos_atp(d, pos, file, line) (pos)
+#define Dynarr_verify_pos_atp_allow_end(d, pos, file, line) (pos)
+#endif /* ERROR_CHECK_DYNARR */
+
+#ifdef ERROR_CHECK_DYNARR
+DECLARE_INLINE_HEADER (
+Dynarr *
+Dynarr_verify_1 (void *d, const Ascbyte *file, int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  assert_at_line (dy->len_ >= 0 && dy->len_ <= dy->largest_ &&
+		  dy->largest_ <= dy->max_, file, line);
+  return dy;
+}
+
+DECLARE_INLINE_HEADER (
+Dynarr *
+Dynarr_verify_mod_1 (void *d, const Ascbyte *file, int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  assert_at_line (!dy->locked, file, line);
+  return Dynarr_verify_1 (d, file, line);
+}
+
+#define Dynarr_verify(d) Dynarr_verify_1 (d, __FILE__, __LINE__)
+#define Dynarr_verify_mod(d) Dynarr_verify_mod_1 (d, __FILE__, __LINE__)
+#define Dynarr_lock(d)				\
+do {						\
+  Dynarr *dy = Dynarr_verify_mod (d);		\
+  dy->locked = 1;				\
+} while (0)
+#define Dynarr_unlock(d)			\
+do {						\
+  Dynarr *dy = Dynarr_verify (d);		\
+  dy->locked = 0;				\
+} while (0)
+#else
+#define Dynarr_verify(d) ((Dynarr *) d)
+#define Dynarr_verify_mod(d) ((Dynarr *) d)
+#define Dynarr_lock(d) DO_NOTHING
+#define Dynarr_unlock(d) DO_NOTHING
+#endif /* ERROR_CHECK_DYNARR */
+
+/************* Dynarr creation *************/
+
 MODULE_API void *Dynarr_newf (Bytecount elsize);
-MODULE_API void Dynarr_resize (void *dy, Elemcount size);
-MODULE_API void Dynarr_insert_many (void *d, const void *el, int len, int start);
-MODULE_API void Dynarr_delete_many (void *d, int start, int len);
 MODULE_API void Dynarr_free (void *d);
 
 #ifdef NEW_GC
@@ -1561,51 +1909,117 @@
 #define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
 #define Dynarr_new2(dynarr_type, type) \
   ((dynarr_type *) Dynarr_newf (sizeof (type)))
+
+/************* Dynarr access *************/
+
+#ifdef ERROR_CHECK_DYNARR
+#define Dynarr_at(d, pos) \
+  ((d)->base[Dynarr_verify_pos_at (d, pos, __FILE__, __LINE__)])
+#define Dynarr_atp_allow_end(d, pos) \
+  (&((d)->base[Dynarr_verify_pos_atp_allow_end (d, pos, __FILE__, __LINE__)]))
+#define Dynarr_atp(d, pos) \
+  (&((d)->base[Dynarr_verify_pos_atp (d, pos, __FILE__, __LINE__)]))
+#else
 #define Dynarr_at(d, pos) ((d)->base[pos])
 #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
+#define Dynarr_atp_allow_end(d, pos) Dynarr_atp (d, pos)
+#endif
+
+/* Old #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos)) */
 #define Dynarr_begin(d) Dynarr_atp (d, 0)
-#define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d) - 1)
-#define Dynarr_sizeof(d) ((d)->cur * (d)->elsize)
-
-#ifdef ERROR_CHECK_STRUCTURES
-DECLARE_INLINE_HEADER (
-Dynarr *
-Dynarr_verify_1 (void *d, const Ascbyte *file, int line)
-)
-{
-  Dynarr *dy = (Dynarr *) d;
-  assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest &&
-		  dy->largest <= dy->max, file, line);
-  return dy;
-}
-
-DECLARE_INLINE_HEADER (
-Dynarr *
-Dynarr_verify_mod_1 (void *d, const Ascbyte *file, int line)
-)
-{
-  Dynarr *dy = (Dynarr *) d;
-  assert_at_line (!dy->locked, file, line);
-  assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest &&
-		  dy->largest <= dy->max, file, line);
-  return dy;
-}
-
-#define Dynarr_verify(d) Dynarr_verify_1 (d, __FILE__, __LINE__)
-#define Dynarr_verify_mod(d) Dynarr_verify_mod_1 (d, __FILE__, __LINE__)
-#define Dynarr_lock(d) (Dynarr_verify_mod (d)->locked = 1)
-#define Dynarr_unlock(d) ((d)->locked = 0)
-#else
-#define Dynarr_verify(d) (d)
-#define Dynarr_verify_mod(d) (d)
-#define Dynarr_lock(d)
-#define Dynarr_unlock(d)
-#endif /* ERROR_CHECK_STRUCTURES */
-
-#define Dynarr_length(d) (Dynarr_verify (d)->cur)
-#define Dynarr_largest(d) (Dynarr_verify (d)->largest)
-#define Dynarr_reset(d) (Dynarr_verify_mod (d)->cur = 0)
-#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur)
+#define Dynarr_lastp(d) Dynarr_atp (d, Dynarr_length (d) - 1)
+#define Dynarr_past_lastp(d) Dynarr_atp_allow_end (d, Dynarr_length (d))
+
+
+/************* Dynarr length/size retrieval and setting *************/
+
+/* Retrieve the length of a Dynarr.  The `+ 0' is to ensure that this cannot
+   be used as an lvalue. */
+#define Dynarr_length(d) (Dynarr_verify (d)->len_ + 0)
+/* Retrieve the largest ever length seen of a Dynarr.  The `+ 0' is to
+   ensure that this cannot be used as an lvalue. */
+#define Dynarr_largest(d) (Dynarr_verify (d)->largest_ + 0)
+/* Retrieve the number of elements that fit in the currently allocated
+   space.  The `+ 0' is to ensure that this cannot be used as an lvalue. */
+#define Dynarr_max(d) (Dynarr_verify (d)->max_ + 0)
+/* Retrieve the advertised memory usage of a Dynarr, i.e. the number of
+   bytes occupied by the elements in the Dynarr, not counting any overhead. */
+#define Dynarr_sizeof(d) (Dynarr_length (d) * (d)->elsize)
+/* Actually set the length of a Dynarr.  This is a low-level routine that
+   should not be directly used; use Dynarr_set_length() instead if you need
+   to, but be very careful when doing so! */
+#define Dynarr_set_length_1(d, n)					\
+do {									\
+  Elemcount _dsl1_n = (n);						\
+  dynarr_checking_assert (_dsl1_n >= 0 && _dsl1_n <= Dynarr_max (d));	\
+  (void) Dynarr_verify_mod (d);						\
+  (d)->len_ = _dsl1_n;							\
+  /* Use the raw field references here otherwise we get a crash because	\
+     we've set the length but not yet fixed up the largest value. */	\
+  if ((d)->len_ > (d)->largest_)					\
+    (d)->largest_ = (d)->len_;						\
+  (void) Dynarr_verify_mod (d);						\
+} while (0)
+
+/* The following two defines will get you into real trouble if you aren't
+   careful.  But they can save a lot of execution time when used wisely. */
+#define Dynarr_set_length(d, n)						\
+do {									\
+  Elemcount _dsl_n = (n);						\
+  dynarr_checking_assert (_dsl_n >= 0 && _dsl_n <= Dynarr_largest (d)); \
+  Dynarr_set_length_1 (d, _dsl_n);					\
+} while (0)
+#define Dynarr_increment(d) \
+  Dynarr_set_length (d, Dynarr_length (d) + 1)
+
+/* Reset the Dynarr's length to 0. */
+#define Dynarr_reset(d) Dynarr_set_length (d, 0)
+
+MODULE_API void Dynarr_resize (void *dy, Elemcount size);
+
+#define Dynarr_resize_if(d, numels)			\
+do {							\
+  Elemcount _dri_numels = (numels);			\
+  if (Dynarr_length (d) + _dri_numels > Dynarr_max (d))	\
+    Dynarr_resize (d, Dynarr_length (d) + _dri_numels);	\
+} while (0)
+
+#ifdef MEMORY_USAGE_STATS
+struct overhead_stats;
+Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
+#endif
+
+/************* Adding/deleting elements to/from a Dynarr *************/
+
+#ifdef NEW_GC
+#define Dynarr_add(d, el)						\
+do {									\
+  const struct lrecord_implementation *imp = (d)->lisp_imp;		\
+  (void) Dynarr_verify_mod (d);						\
+  Dynarr_resize_if (d, 1);						\
+  ((d)->base)[Dynarr_length (d)] = (el);				\
+  if (imp)								\
+    set_lheader_implementation						\
+     ((struct lrecord_header *)&(((d)->base)[Dynarr_length (d)]), imp);	\
+  Dynarr_set_length_1 (d, Dynarr_length (d) + 1);			\
+  (void) Dynarr_verify_mod (d);						\
+} while (0)
+#else /* not NEW_GC */
+#define Dynarr_add(d, el)				\
+do {							\
+  (void) Dynarr_verify_mod (d);				\
+  Dynarr_resize_if (d, 1);				\
+  ((d)->base)[Dynarr_length (d)] = (el);		\
+  Dynarr_set_length_1 (d, Dynarr_length (d) + 1);	\
+  (void) Dynarr_verify_mod (d);				\
+} while (0)
+#endif /* not NEW_GC */
+
+
+MODULE_API void Dynarr_insert_many (void *d, const void *el, int len,
+				    int start);
+MODULE_API void Dynarr_delete_many (void *d, int start, int len);
+
 #define Dynarr_insert_many_at_start(d, el, len)	\
   Dynarr_insert_many (d, el, len, 0)
 #define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1)
@@ -1621,39 +2035,30 @@
   Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc);			\
 } while (0)
 
-#ifdef NEW_GC
-#define Dynarr_add(d, el)					\
-do {								\
-  const struct lrecord_implementation *imp = (d)->lisp_imp;	\
-  if (Dynarr_verify_mod (d)->cur >= (d)->max)			\
-    Dynarr_resize ((d), (d)->cur+1);				\
-  ((d)->base)[(d)->cur] = (el);					\
-								\
-  if (imp)							\
-    set_lheader_implementation					\
-     ((struct lrecord_header *)&(((d)->base)[(d)->cur]), imp);	\
-								\
-  (d)->cur++;							\
-  if ((d)->cur > (d)->largest)					\
-    (d)->largest = (d)->cur;					\
-} while (0)
-#else /* not NEW_GC */
-#define Dynarr_add(d, el) (						     \
-  Dynarr_verify_mod (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : \
-      (void) 0,								     \
-  ((d)->base)[(d)->cur++] = (el),					     \
-  (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0)
-#endif /* not NEW_GC */
-    
-
-/* The following defines will get you into real trouble if you aren't
-   careful.  But they can save a lot of execution time when used wisely. */
-#define Dynarr_increment(d) (Dynarr_verify_mod (d)->cur++)
-#define Dynarr_set_size(d, n) (Dynarr_verify_mod (d)->cur = n)
+/* Add LEN contiguous elements to a Dynarr */
+
+DECLARE_INLINE_HEADER (
+void
+Dynarr_add_many (void *d, const void *el, int len)
+)
+{
+  /* This duplicates Dynarr_insert_many to some extent; but since it is
+     called so often, it seemed useful to remove the unnecessary stuff
+     from that function and to make it inline */
+  Dynarr *dy = Dynarr_verify_mod (d);
+  Dynarr_resize_if (dy, len);
+  /* Some functions call us with a value of 0 to mean "reserve space but
+     don't write into it" */
+  if (el)
+    memcpy ((char *) dy->base + Dynarr_sizeof (dy), el, len*dy->elsize);
+  Dynarr_set_length_1 (dy, Dynarr_length (dy) + len);
+  (void) Dynarr_verify_mod (dy);
+}
 
 #define Dynarr_pop(d)					\
-  (assert ((d)->cur > 0), Dynarr_verify_mod (d)->cur--,	\
-   Dynarr_at (d, (d)->cur))
+  (dynarr_checking_assert (Dynarr_length (d) > 0),	\
+   Dynarr_verify_mod (d)->len_--,			\
+   Dynarr_at (d, Dynarr_length (d)))
 #define Dynarr_delete(d, i) Dynarr_delete_many (d, i, 1)
 #define Dynarr_delete_by_pointer(d, p) \
   Dynarr_delete_many (d, (p) - ((d)->base), 1)
@@ -1669,17 +2074,7 @@
     }						\
 } while (0)
 
-#ifdef MEMORY_USAGE_STATS
-struct overhead_stats;
-Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
-#endif
-
-void *stack_like_malloc (Bytecount size);
-void stack_like_free (void *val);
-
-/* ------------------------------- */
-/*         Dynarr typedefs         */
-/* ------------------------------- */
+/************* Dynarr typedefs *************/
 
 /* Dynarr typedefs -- basic types first */
 
@@ -1720,6 +2115,15 @@
   Dynarr_declare (unsigned long);
 } unsigned_long_dynarr;
 
+typedef const Ascbyte *const_Ascbyte_ptr;
+typedef struct
+{
+  Dynarr_declare (const Ascbyte *);
+} const_Ascbyte_ptr_dynarr;
+
+extern const struct sized_memory_description const_Ascbyte_ptr_description;
+extern const struct sized_memory_description const_Ascbyte_ptr_dynarr_description;
+
 typedef struct
 {
   Dynarr_declare (int);
@@ -1795,6 +2199,17 @@
   Dynarr_declare (Lisp_Object *);
 } Lisp_Object_ptr_dynarr;
 
+
+/************* Stack-like malloc/free: Another allocator *************/
+
+void *stack_like_malloc (Bytecount size);
+void stack_like_free (void *val);
+
+
+/************************************************************************/
+/**              Definitions of other basic Lisp objects               **/
+/************************************************************************/
+
 /*------------------------------ unbound -------------------------------*/
 
 /* Qunbound is a special Lisp_Object (actually of type
@@ -2642,6 +3057,31 @@
   Elemcount size;						\
   unsigned long bits[BIT_VECTOR_LONG_STORAGE(numbits)];		\
 }
+/*---------------------- array, sequence -----------------------------*/
+
+#define ARRAYP(x) (VECTORP (x) || STRINGP (x) || BIT_VECTORP (x))
+
+#define CHECK_ARRAY(x) do {			\
+  if (!ARRAYP (x))				\
+    dead_wrong_type_argument (Qarrayp, x);	\
+} while (0)
+
+#define CONCHECK_ARRAY(x) do {			\
+  if (!ARRAYP (x))				\
+    x = wrong_type_argument (Qarrayp, x);	\
+} while (0)
+
+#define SEQUENCEP(x) (LISTP (x) || ARRAYP (x))
+
+#define CHECK_SEQUENCE(x) do {			\
+  if (!SEQUENCEP (x))				\
+    dead_wrong_type_argument (Qsequencep, x);	\
+} while (0)
+
+#define CONCHECK_SEQUENCE(x) do {		\
+  if (!SEQUENCEP (x))				\
+    x = wrong_type_argument (Qsequencep, x);	\
+} while (0)
 
 /*------------------------------ symbol --------------------------------*/
 
@@ -3481,7 +3921,7 @@
 #define HASH8(a,b,c,d,e,f,g,h)   (GOOD_HASH * HASH7 (a,b,c,d,e,f,g)   + (h))
 #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i))
 
-#define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj))
+#define LISP_HASH(obj) ((unsigned long) STORE_LISP_IN_VOID (obj))
 Hashcode memory_hash (const void *xv, Bytecount size);
 Hashcode internal_hash (Lisp_Object obj, int depth);
 Hashcode internal_array_hash (Lisp_Object *arr, int size, int depth);
@@ -3510,22 +3950,100 @@
    format it and store it in the `string-translatable' property of the
    returned string.  See Fgettext().
 
-   CGETTEXT() is the same as GETTEXT() but works with char * strings
-   instead of Ibyte * strings.
-
-   build_msg_string() is a shorthand for build_string (GETTEXT (x)).
-   build_msg_intstring() is a shorthand for build_intstring (GETTEXT (x)).
+   The variations IGETTEXT, CIGETTEXT and ASCGETTEXT operate on
+   Ibyte *, CIbyte *, and Ascbyte * strings, respectively.  The
+   ASCGETTEXT version has an assert check to verify that its string
+   really is pure-ASCII.  Plain GETTEXT is defined as ASCGETTEXT, and
+   so works the same way. (There are no versions that work for Extbyte *.
+   Translate to internal format before working on it.)
+
+   There are similar functions for building a Lisp string from a C
+   string and translating in the process.  They again come in three
+   variants: build_msg_istring(), build_msg_cistring(), and
+   build_msg_ascstring().  Again, build_msg_ascstring() asserts that
+   its text is pure-ASCII, and build_msg_string() is the same as
+   build_msg_ascstring().
    */
 
-#define GETTEXT(x) (x)
-#define CGETTEXT(x) (x)
-#define LISP_GETTEXT(x) (x)
-
-/* DEFER_GETTEXT is used to identify strings which are translated when
-   they are referenced instead of when they are defined.
-   These include Qerror_messages and initialized arrays of strings.
+/* Return value NOT Ascbyte, because the result in general will have been
+   translated into a foreign language. */
+DECLARE_INLINE_HEADER (const CIbyte *ASCGETTEXT (const Ascbyte *s))
+{
+  ASSERT_ASCTEXT_ASCII (s);
+  return s;
+}
+
+DECLARE_INLINE_HEADER (const Ibyte *IGETTEXT (const Ibyte *s))
+{
+  return s;
+}
+
+DECLARE_INLINE_HEADER (const CIbyte *CIGETTEXT (const CIbyte *s))
+{
+  return s;
+}
+
+DECLARE_INLINE_HEADER (Lisp_Object LISP_GETTEXT (Lisp_Object s))
+{
+  return s;
+}
+
+#define GETTEXT ASCGETTEXT
+
+MODULE_API Lisp_Object build_msg_istring (const Ibyte *);
+MODULE_API Lisp_Object build_msg_cistring (const CIbyte *);
+MODULE_API Lisp_Object build_msg_ascstring (const Ascbyte *);
+#define build_msg_string build_msg_ascstring
+
+
+/* DEFER_GETTEXT() and variants are used to identify strings which are not
+   meant to be translated immediately, but instead at some later time.
+   This is used in strings that are stored somewhere at dump or
+   initialization time, at a time when the current language environment is
+   not set.  It is the duty of the user of the string to call GETTEXT or
+   some variant at the appropriate time.  DEFER_GETTTEXT() serves only as a
+   marker that the string is translatable, and will as a result be snarfed
+   during message snarfing (see above).
+
+   build_defer_string() and variants are the deferred equivalents of
+   build_msg_string() and variants.  Similarly to DEFER_GETTEXT(), they
+   don't actually do any translation, but serve as place markers for
+   message snarfing.  However, they may do something more than just build
+   a Lisp string -- in particular, they may store a string property
+   indicating that the string is translatable (see discussion above about
+   this property).
 */
-#define DEFER_GETTEXT(x) (x)
+
+DECLARE_INLINE_HEADER (const Ascbyte *DEFER_ASCGETTEXT (const Ascbyte *s))
+{
+  ASSERT_ASCTEXT_ASCII (s);
+  return s;
+}
+
+DECLARE_INLINE_HEADER (const Ibyte *DEFER_IGETTEXT (const Ibyte *s))
+{
+  return s;
+}
+
+DECLARE_INLINE_HEADER (const CIbyte *DEFER_CIGETTEXT (const CIbyte *s))
+{
+  return s;
+}
+
+#define DEFER_GETTEXT DEFER_ASCGETTEXT
+
+MODULE_API Lisp_Object build_defer_istring (const Ibyte *);
+MODULE_API Lisp_Object build_defer_cistring (const CIbyte *);
+MODULE_API Lisp_Object build_defer_ascstring (const Ascbyte *);
+
+#define build_defer_string build_defer_ascstring
+
+
+void write_msg_istring (Lisp_Object stream, const Ibyte *str);
+void write_msg_cistring (Lisp_Object stream, const CIbyte *str);
+void write_msg_ascstring (Lisp_Object stream, const Ascbyte *str);
+
+#define write_msg_string write_msg_ascstring
 
 
 /************************************************************************/
@@ -3817,28 +4335,34 @@
 
 /* Help debug crashes gc-marking a staticpro'ed object. */
 
-MODULE_API void staticpro_1 (Lisp_Object *, Ascbyte *);
-MODULE_API void staticpro_nodump_1 (Lisp_Object *, Ascbyte *);
-/* g++ 4.3 complains about the conversion of const char to char.
-   These end up in a dynarray, so we would need to define a whole new class
-   of dynarray just to handle the const char stuff.
-   ####Check to see how hard this might be. */
-#define staticpro(ptr) staticpro_1 (ptr, (Ascbyte *) #ptr)
-#define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, (Ascbyte *) #ptr)
+MODULE_API void staticpro_1 (Lisp_Object *, const Ascbyte *);
+MODULE_API void staticpro_nodump_1 (Lisp_Object *, const Ascbyte *);
+#define staticpro(ptr) staticpro_1 (ptr, #ptr)
+#define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, #ptr)
 
 #ifdef HAVE_SHLIB
-MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, Ascbyte *);
-#define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, (Ascbyte *) #ptr)
+MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, const Ascbyte *);
+#define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, #ptr)
 #endif
 
 #else
 
 /* Call staticpro (&var) to protect static variable `var'. */
 MODULE_API void staticpro (Lisp_Object *);
+/* staticpro_1 (varptr, name) is used when we're not directly calling
+   staticpro() on the address of a Lisp variable, but on a pointer we
+   got from elsewhere.  In that case, NAME is a string describing the
+   actual variable in question.  NAME is used only for debugging purposes,
+   and hence when not DEBUG_XEMACS, staticpro_1() just calls staticpro().
+   With DEBUG_XEMACS, however, it's the reverse -- staticpro() calls
+   staticpro_1(), using the ANSI "stringize" operator to construct a string
+   out of the variable name. */
+#define staticpro_1(ptr, name) staticpro (ptr)
 
 /* Call staticpro_nodump (&var) to protect static variable `var'. */
 /* var will not be saved at dump time */
 MODULE_API void staticpro_nodump (Lisp_Object *);
+#define staticpro_nodump_1(ptr, name) staticpro_nodump (ptr)
 
 #ifdef HAVE_SHLIB
 /* Call unstaticpro_nodump (&var) to stop protecting static variable `var'. */
@@ -3851,7 +4375,7 @@
 extern Lisp_Object_dynarr *mcpros;
 #ifdef DEBUG_XEMACS
 /* Help debug crashes gc-marking a mcpro'ed object. */
-MODULE_API void mcpro_1 (Lisp_Object, char *);
+MODULE_API void mcpro_1 (Lisp_Object, const Ascbyte *);
 #define mcpro(ptr) mcpro_1 (ptr, #ptr)
 #else /* not DEBUG_XEMACS */
 /* Call mcpro (&var) to protect mc variable `var'. */
@@ -3874,11 +4398,7 @@
 /************************************************************************/
 /*		             Other numeric types      	                */
 /************************************************************************/
-#ifdef WITH_NUMBER_TYPES
 #include "number.h"
-#else
-#define make_integer(x) make_int(x)
-#endif
 
 
 /************************************************************************/
@@ -3908,9 +4428,11 @@
 /* Defined in alloc.c */
 MODULE_API EXFUN (Fcons, 2);
 MODULE_API EXFUN (Flist, MANY);
+EXFUN (Fbit_vector, MANY);
 EXFUN (Fmake_byte_code, MANY);
 MODULE_API EXFUN (Fmake_list, 2);
 MODULE_API EXFUN (Fmake_string, 2);
+EXFUN (Fstring, MANY);
 MODULE_API EXFUN (Fmake_symbol, 1);
 MODULE_API EXFUN (Fmake_vector, 2);
 MODULE_API EXFUN (Fvector, MANY);
@@ -3949,13 +4471,12 @@
 int c_readonly (Lisp_Object);
 int lisp_readonly (Lisp_Object);
 MODULE_API void copy_lisp_object (Lisp_Object dst, Lisp_Object src);
-MODULE_API Lisp_Object build_intstring (const Ibyte *);
-MODULE_API Lisp_Object build_string (const CIbyte *);
-MODULE_API Lisp_Object build_ext_string (const Extbyte *, Lisp_Object);
-MODULE_API Lisp_Object build_msg_intstring (const Ibyte *);
-MODULE_API Lisp_Object build_msg_string (const CIbyte *);
+MODULE_API Lisp_Object build_istring (const Ibyte *);
+MODULE_API Lisp_Object build_cistring (const CIbyte *);
+MODULE_API Lisp_Object build_ascstring (const Ascbyte *);
+MODULE_API Lisp_Object build_extstring (const Extbyte *, Lisp_Object);
 MODULE_API Lisp_Object make_string (const Ibyte *, Bytecount);
-MODULE_API Lisp_Object make_ext_string (const Extbyte *, EMACS_INT, Lisp_Object);
+MODULE_API Lisp_Object make_extstring (const Extbyte *, EMACS_INT, Lisp_Object);
 void init_string_ascii_begin (Lisp_Object string);
 Lisp_Object make_uninit_string (Bytecount);
 MODULE_API Lisp_Object make_float (double);
@@ -4063,7 +4584,9 @@
 EXFUN (Fbyte_code, 3);
 
 DECLARE_DOESNT_RETURN (invalid_byte_code
-		       (const CIbyte *reason, Lisp_Object frob));
+		       (const Ascbyte *reason, Lisp_Object frob));
+
+extern Lisp_Object Qbyte_code, Qinvalid_byte_code;
 
 /* Defined in callint.c */
 EXFUN (Fcall_interactively, 3);
@@ -4071,6 +4594,7 @@
 
 /* Defined in casefiddle.c */
 EXFUN (Fdowncase, 2);
+EXFUN (Fcanoncase, 2);
 EXFUN (Fupcase, 2);
 EXFUN (Fupcase_initials, 2);
 EXFUN (Fupcase_initials_region, 3);
@@ -4144,6 +4668,26 @@
 Lisp_Object word_to_lisp (unsigned int);
 unsigned int lisp_to_word (Lisp_Object);
 
+extern Lisp_Object Qarrayp, Qbitp, Qchar_or_string_p, Qcharacterp,
+    Qerror_conditions, Qerror_message, Qinteger_char_or_marker_p,
+    Qinteger_or_char_p, Qinteger_or_marker_p, Qlambda, Qlistp, Qnatnump,
+    Qnonnegativep, Qnumber_char_or_marker_p, Qnumberp, Qquote, Qtrue_list_p;
+extern MODULE_API Lisp_Object Qintegerp;
+
+extern Lisp_Object Qarith_error, Qbeginning_of_buffer, Qbuffer_read_only,
+    Qcircular_list, Qcircular_property_list, Qconversion_error,
+    Qcyclic_variable_indirection, Qdomain_error, Qediting_error,
+    Qend_of_buffer, Qend_of_file, Qerror, Qfile_error, Qinternal_error,
+    Qinvalid_change, Qinvalid_constant, Qinvalid_function, Qinvalid_operation,
+    Qinvalid_read_syntax, Qinvalid_state, Qio_error, Qlist_formation_error,
+    Qmalformed_list, Qmalformed_property_list, Qno_catch, Qout_of_memory,
+    Qoverflow_error, Qprinting_unreadable_object, Qquit, Qrange_error,
+    Qsetting_constant, Qsingularity_error, Qstack_overflow,
+    Qstructure_formation_error, Qtext_conversion_error, Qunderflow_error,
+    Qvoid_function, Qvoid_variable, Qwrong_number_of_arguments,
+    Qwrong_type_argument;
+extern MODULE_API Lisp_Object Qinvalid_argument, Qsyntax_error;
+
 /* Defined in dired.c */
 Lisp_Object make_directory_hash_table (const Ibyte *);
 Lisp_Object wasteful_word_to_lisp (unsigned int);
@@ -4251,7 +4795,7 @@
 extern Fixnum emacs_priority;
 extern int suppress_early_error_handler_backtrace;
 void debug_break (void);
-int debug_can_access_memory (void *ptr, Bytecount len);
+int debug_can_access_memory (const void *ptr, Bytecount len);
 DECLARE_DOESNT_RETURN (really_abort (void));
 void zero_out_command_line_status_vars (void);
 
@@ -4299,38 +4843,38 @@
 					     const CIbyte *, ...)
      PRINTF_ARGS (4, 5);
 
-Lisp_Object build_error_data (const CIbyte *reason, Lisp_Object frob);
-DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, const CIbyte *,
+Lisp_Object build_error_data (const Ascbyte *reason, Lisp_Object frob);
+DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, const Ascbyte *,
 				     Lisp_Object));
-void maybe_signal_error (Lisp_Object, const CIbyte *, Lisp_Object,
+void maybe_signal_error (Lisp_Object, const Ascbyte *, Lisp_Object,
 			 Lisp_Object, Error_Behavior);
-Lisp_Object signal_continuable_error (Lisp_Object, const CIbyte *,
+Lisp_Object signal_continuable_error (Lisp_Object, const Ascbyte *,
 				      Lisp_Object);
-Lisp_Object maybe_signal_continuable_error (Lisp_Object, const CIbyte *,
+Lisp_Object maybe_signal_continuable_error (Lisp_Object, const Ascbyte *,
 					    Lisp_Object,
 					    Lisp_Object, Error_Behavior);
 DECLARE_DOESNT_RETURN (signal_ferror_with_frob (Lisp_Object, Lisp_Object,
-						const CIbyte *, ...))
+						const Ascbyte *, ...))
        PRINTF_ARGS(3, 4);
 void maybe_signal_ferror_with_frob (Lisp_Object, Lisp_Object, Lisp_Object,
 				    Error_Behavior,
-				    const CIbyte *, ...) PRINTF_ARGS (5, 6);
+				    const Ascbyte *, ...) PRINTF_ARGS (5, 6);
 Lisp_Object signal_continuable_ferror_with_frob (Lisp_Object, Lisp_Object,
-						 const CIbyte *,
+						 const Ascbyte *,
 						 ...) PRINTF_ARGS (3, 4);
 Lisp_Object maybe_signal_continuable_ferror_with_frob (Lisp_Object,
 						       Lisp_Object,
 						       Lisp_Object,
 						       Error_Behavior,
-						       const CIbyte *, ...)
+						       const Ascbyte *, ...)
      PRINTF_ARGS (5, 6);
-DECLARE_DOESNT_RETURN (signal_error_2 (Lisp_Object, const CIbyte *,
+DECLARE_DOESNT_RETURN (signal_error_2 (Lisp_Object, const Ascbyte *,
 				       Lisp_Object, Lisp_Object));
-void maybe_signal_error_2 (Lisp_Object, const CIbyte *, Lisp_Object,
+void maybe_signal_error_2 (Lisp_Object, const Ascbyte *, Lisp_Object,
 			   Lisp_Object, Lisp_Object, Error_Behavior);
-Lisp_Object signal_continuable_error_2 (Lisp_Object, const CIbyte *,
+Lisp_Object signal_continuable_error_2 (Lisp_Object, const Ascbyte *,
 					Lisp_Object, Lisp_Object);
-Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object, const CIbyte *,
+Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object, const Ascbyte *,
 					      Lisp_Object, Lisp_Object,
 					      Lisp_Object,
 					      Error_Behavior);
@@ -4343,61 +4887,58 @@
 MODULE_API DECLARE_DOESNT_RETURN (signal_circular_property_list_error
 				  (Lisp_Object));
 
-DECLARE_DOESNT_RETURN (syntax_error (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (syntax_error (const Ascbyte *reason,
 				     Lisp_Object frob));
-DECLARE_DOESNT_RETURN (syntax_error_2 (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (syntax_error_2 (const Ascbyte *reason,
 				       Lisp_Object frob1,
 				       Lisp_Object frob2));
-void maybe_syntax_error (const CIbyte *, Lisp_Object, Lisp_Object,
+void maybe_syntax_error (const Ascbyte *, Lisp_Object, Lisp_Object,
 			 Error_Behavior);
-DECLARE_DOESNT_RETURN (sferror (const CIbyte *reason, Lisp_Object frob));
-DECLARE_DOESNT_RETURN (sferror_2 (const CIbyte *reason, Lisp_Object frob1,
+DECLARE_DOESNT_RETURN (sferror (const Ascbyte *reason, Lisp_Object frob));
+DECLARE_DOESNT_RETURN (sferror_2 (const Ascbyte *reason, Lisp_Object frob1,
 				  Lisp_Object frob2));
-void maybe_sferror (const CIbyte *, Lisp_Object, Lisp_Object,
+void maybe_sferror (const Ascbyte *, Lisp_Object, Lisp_Object,
 		    Error_Behavior);
-MODULE_API DECLARE_DOESNT_RETURN (invalid_argument (const CIbyte *reason,
+MODULE_API DECLARE_DOESNT_RETURN (invalid_argument (const Ascbyte *reason,
 						    Lisp_Object frob));
-MODULE_API DECLARE_DOESNT_RETURN (invalid_argument_2 (const CIbyte *reason,
+MODULE_API DECLARE_DOESNT_RETURN (invalid_argument_2 (const Ascbyte *reason,
 						      Lisp_Object frob1,
 						      Lisp_Object frob2));
-void maybe_invalid_argument (const CIbyte *, Lisp_Object, Lisp_Object,
+void maybe_invalid_argument (const Ascbyte *, Lisp_Object, Lisp_Object,
 			     Error_Behavior);
-MODULE_API DECLARE_DOESNT_RETURN (invalid_operation (const CIbyte *reason,
+MODULE_API DECLARE_DOESNT_RETURN (invalid_operation (const Ascbyte *reason,
 						     Lisp_Object frob));
-MODULE_API DECLARE_DOESNT_RETURN (invalid_operation_2 (const CIbyte *reason,
+MODULE_API DECLARE_DOESNT_RETURN (invalid_operation_2 (const Ascbyte *reason,
 						       Lisp_Object frob1,
 						       Lisp_Object frob2));
-MODULE_API void maybe_invalid_operation (const CIbyte *, Lisp_Object,
+MODULE_API void maybe_invalid_operation (const Ascbyte *, Lisp_Object,
 					 Lisp_Object, Error_Behavior);
-DECLARE_DOESNT_RETURN (invalid_state (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (invalid_state (const Ascbyte *reason,
 					 Lisp_Object frob));
-DECLARE_DOESNT_RETURN (invalid_state_2 (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (invalid_state_2 (const Ascbyte *reason,
 					   Lisp_Object frob1,
 					   Lisp_Object frob2));
-void maybe_invalid_state (const CIbyte *, Lisp_Object, Lisp_Object,
+void maybe_invalid_state (const Ascbyte *, Lisp_Object, Lisp_Object,
 			  Error_Behavior);
-DECLARE_DOESNT_RETURN (invalid_change (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (invalid_change (const Ascbyte *reason,
 					 Lisp_Object frob));
-DECLARE_DOESNT_RETURN (invalid_change_2 (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (invalid_change_2 (const Ascbyte *reason,
 					   Lisp_Object frob1,
 					   Lisp_Object frob2));
-void maybe_invalid_change (const CIbyte *, Lisp_Object, Lisp_Object,
+void maybe_invalid_change (const Ascbyte *, Lisp_Object, Lisp_Object,
 			   Error_Behavior);
-MODULE_API DECLARE_DOESNT_RETURN (invalid_constant (const CIbyte *reason,
+MODULE_API DECLARE_DOESNT_RETURN (invalid_constant (const Ascbyte *reason,
 						    Lisp_Object frob));
-DECLARE_DOESNT_RETURN (invalid_constant_2 (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (invalid_constant_2 (const Ascbyte *reason,
 					   Lisp_Object frob1,
 					   Lisp_Object frob2));
-void maybe_invalid_constant (const CIbyte *, Lisp_Object, Lisp_Object,
+void maybe_invalid_constant (const Ascbyte *, Lisp_Object, Lisp_Object,
 			     Error_Behavior);
-DECLARE_DOESNT_RETURN (wtaerror (const CIbyte *reason, Lisp_Object frob));
-MODULE_API DECLARE_DOESNT_RETURN (out_of_memory (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (wtaerror (const Ascbyte *reason, Lisp_Object frob));
+MODULE_API DECLARE_DOESNT_RETURN (out_of_memory (const Ascbyte *reason,
 						 Lisp_Object frob));
-DECLARE_DOESNT_RETURN (stack_overflow (const CIbyte *reason,
+DECLARE_DOESNT_RETURN (stack_overflow (const Ascbyte *reason,
 				       Lisp_Object frob));
-MODULE_API DECLARE_DOESNT_RETURN (printing_unreadable_object (const CIbyte *,
-							      ...))
-       PRINTF_ARGS (1, 2);
 
 Lisp_Object signal_void_function_error (Lisp_Object);
 Lisp_Object signal_invalid_function_error (Lisp_Object);
@@ -4570,10 +5111,11 @@
 void do_autoload (Lisp_Object, Lisp_Object); /* GCPROs both arguments */
 Lisp_Object un_autoload (Lisp_Object);
 void warn_when_safe_lispobj (Lisp_Object, Lisp_Object, Lisp_Object);
-MODULE_API void warn_when_safe (Lisp_Object, Lisp_Object, const CIbyte *,
+MODULE_API void warn_when_safe (Lisp_Object, Lisp_Object, const Ascbyte *,
 				...) PRINTF_ARGS (3, 4);
 extern int backtrace_with_internal_sections;
 
+extern Lisp_Object Vdebug_on_error;
 extern Lisp_Object Vstack_trace_on_error;
 
 /* Defined in event-stream.c */
@@ -4688,13 +5230,9 @@
 void record_auto_save (void);
 void force_auto_save_soon (void);
 DECLARE_DOESNT_RETURN (report_error_with_errno (Lisp_Object errtype,
-						const CIbyte *string,
+						const Ascbyte *reason,
 						Lisp_Object data));
-DECLARE_DOESNT_RETURN (report_file_type_error (Lisp_Object errtype,
-					       Lisp_Object oserrmess,
-					       const CIbyte *string,
-					       Lisp_Object data));
-DECLARE_DOESNT_RETURN (report_file_error (const CIbyte *, Lisp_Object));
+DECLARE_DOESNT_RETURN (report_file_error (const Ascbyte *, Lisp_Object));
 Lisp_Object lisp_strerror (int);
 Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object);
 int internal_delete_file (Lisp_Object);
@@ -4732,11 +5270,13 @@
 EXFUN (Felt, 2);
 MODULE_API EXFUN (Fequal, 2);
 MODULE_API EXFUN (Fget, 3);
+MODULE_API EXFUN (Feqlsign, MANY);
+MODULE_API EXFUN (Fequalp, 2);
 EXFUN (Flast, 2);
 EXFUN (Flax_plist_get, 3);
 EXFUN (Flax_plist_remprop, 2);
 MODULE_API EXFUN (Flength, 1);
-EXFUN (Fmapcar, 2);
+EXFUN (FmapcarX, MANY);
 EXFUN (Fmember, 2);
 EXFUN (Fmemq, 2);
 EXFUN (Fnconc, MANY);
@@ -4777,7 +5317,7 @@
 Lisp_Object remassq_no_quit (Lisp_Object, Lisp_Object);
 Lisp_Object remrassq_no_quit (Lisp_Object, Lisp_Object);
 
-int plists_differ (Lisp_Object, Lisp_Object, int, int, int);
+int plists_differ (Lisp_Object, Lisp_Object, int, int, int, int);
 Lisp_Object internal_plist_get (Lisp_Object, Lisp_Object);
 void internal_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object);
 int internal_remprop (Lisp_Object *, Lisp_Object);
@@ -4795,13 +5335,15 @@
 				      int depth);
 int internal_equal (Lisp_Object, Lisp_Object, int);
 int internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth);
-Lisp_Object concat2 (Lisp_Object, Lisp_Object);
-Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object);
-Lisp_Object vconcat2 (Lisp_Object, Lisp_Object);
-Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object);
-Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
+Lisp_Object MODULE_API concat2 (Lisp_Object, Lisp_Object);
+Lisp_Object MODULE_API concat3 (Lisp_Object, Lisp_Object, Lisp_Object);
+Lisp_Object MODULE_API vconcat2 (Lisp_Object, Lisp_Object);
+Lisp_Object MODULE_API vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object);
+Lisp_Object MODULE_API nconc2 (Lisp_Object, Lisp_Object);
+int internal_equal_0 (Lisp_Object, Lisp_Object, int, int);
 Lisp_Object bytecode_nconc2 (Lisp_Object *);
-void check_losing_bytecode (const char *, Lisp_Object);
+int bytecode_arithcompare (Lisp_Object obj1, Lisp_Object obj2);
+void check_losing_bytecode (const Ascbyte *, Lisp_Object);
 
 Lisp_Object add_suffix_to_symbol (Lisp_Object symbol,
 				  const Ascbyte *ascii_string);
@@ -4958,9 +5500,11 @@
 /* NOTE: Do not call this with the data of a Lisp_String.  Use princ.
  * Note: stream should be defaulted before calling
  *  (eg Qnil means stdout, not Vstandard_output, etc) */
-MODULE_API void write_c_string (Lisp_Object stream, const CIbyte *str);
+MODULE_API void write_istring (Lisp_Object stream, const Ibyte *str);
 /* Same goes for this function. */
-MODULE_API void write_string (Lisp_Object stream, const Ibyte *str);
+MODULE_API void write_cistring (Lisp_Object stream, const CIbyte *str);
+/* Same goes for this function. */
+MODULE_API void write_ascstring (Lisp_Object stream, const Ascbyte *str);
 /* Same goes for this function. */
 void write_string_1 (Lisp_Object stream, const Ibyte *str, Bytecount size);
 void write_eistring (Lisp_Object stream, const Eistring *ei);
@@ -4999,6 +5543,7 @@
 void ulong_to_bit_string (char *, unsigned long);
 extern int print_escape_newlines;
 extern MODULE_API int print_readably;
+extern int in_debug_print;
 Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object,
 						 Lisp_Object (*) (Lisp_Object),
 						 Lisp_Object, Lisp_Object);
@@ -5007,6 +5552,11 @@
 			      int UNUSED (escapeflag));
 void external_object_printer (Lisp_Object obj, Lisp_Object printcharfun,
 			      int UNUSED (escapeflag));
+MODULE_API DECLARE_DOESNT_RETURN (printing_unreadable_object (const CIbyte *,
+							      ...))
+       PRINTF_ARGS (1, 2);
+DECLARE_DOESNT_RETURN (printing_unreadable_lcrecord (Lisp_Object obj,
+						     const Ibyte *name));
 
 /* Defined in rangetab.c */
 EXFUN (Fclear_range_table, 1);
@@ -5035,6 +5585,7 @@
 EXFUN (Fskip_chars_backward, 3);
 EXFUN (Fskip_chars_forward, 3);
 EXFUN (Fstring_match, 4);
+EXFUN (Fregexp_quote, 1);
 
 struct re_pattern_buffer;
 struct re_registers;
@@ -5095,7 +5646,7 @@
 EXFUN (Fsymbol_value, 1);
 
 unsigned int hash_string (const Ibyte *, Bytecount);
-Lisp_Object intern_int (const Ibyte *str);
+Lisp_Object intern_istring (const Ibyte *str);
 MODULE_API Lisp_Object intern (const CIbyte *str);
 Lisp_Object intern_converting_underscores_to_dashes (const CIbyte *str);
 Lisp_Object oblookup (Lisp_Object, const Ibyte *, Bytecount);
@@ -5246,6 +5797,7 @@
 extern Lisp_Object Vcharset_latin_iso8859_4;
 extern Lisp_Object Vcharset_thai_tis620;
 extern Lisp_Object Vcharset_greek_iso8859_7;
+extern Lisp_Object Vcharset_arabic_iso8859_6;
 extern Lisp_Object Vcharset_hebrew_iso8859_8;
 extern Lisp_Object Vcharset_katakana_jisx0201;
 extern Lisp_Object Vcharset_latin_jisx0201;
@@ -5458,7 +6010,7 @@
 int qxestrcasecmp_ascii (const Ibyte *s1, const Ascbyte *s2);
 int qxestrcasecmp_i18n (const Ibyte *s1, const Ibyte *s2);
 int ascii_strcasecmp (const Ascbyte *s1, const Ascbyte *s2);
-int lisp_strcasecmp (Lisp_Object s1, Lisp_Object s2);
+int lisp_strcasecmp_ascii (Lisp_Object s1, Lisp_Object s2);
 int lisp_strcasecmp_i18n (Lisp_Object s1, Lisp_Object s2);
 int qxestrncasecmp (const Ibyte *s1, const Ibyte *s2, Bytecount len);
 int qxestrncasecmp_ascii (const Ibyte *s1, const Ascbyte *s2,
@@ -5603,62 +6155,31 @@
 
 */
 
-extern Lisp_Object Qactivate_menubar_hook, Qand_optional, Qand_rest;
-extern Lisp_Object Qarith_error, Qarrayp, Qautoload, Qbackground;
-extern Lisp_Object Qbackground_pixmap, Qbeginning_of_buffer, Qbitp, Qblinking;
-extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only;
-extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory_designator_p;
-extern Lisp_Object Qcategory_table_value_p, Qcdr, Qchar_or_string_p;
-extern Lisp_Object Qcharacterp, Qcircular_list, Qcircular_property_list;
-extern Lisp_Object Qcolor_pixmap_image_instance_p, Qcommandp;
-extern Lisp_Object Qcompletion_ignore_case, Qconsole_live_p, Qconst_specifier;
-extern Lisp_Object Qconversion_error, Qcurrent_menubar;
-extern Lisp_Object Qcyclic_variable_indirection, Qdefun, Qdevice_live_p, Qdim;
-extern Lisp_Object Qdirection, Qdisabled, Qdisabled_command_hook;
-extern Lisp_Object Qdisplay_table, Qdll_error, Qdomain_error, Qediting_error;
-extern Lisp_Object Qend_of_buffer, Qend_of_file, Qend_open, Qerror;
-extern Lisp_Object Qerror_conditions, Qerror_lacks_explanatory_string;
-extern Lisp_Object Qerror_message, Qevent_live_p, Qexit, Qextent_live_p;
-extern Lisp_Object Qexternal_debugging_output, Qfeaturep, Qfile_error;
-extern Lisp_Object Qfile_name_sans_extension, Qfinal;
-extern Lisp_Object Qforeground, Qformat, Qframe_live_p, Qgraphic;
-extern Lisp_Object Qgui_error, Qicon_glyph_p, Qidentity, Qinhibit_quit;
-extern Lisp_Object Qinhibit_read_only, Qinteger_char_or_marker_p;
-extern Lisp_Object Qinteger_or_char_p, Qinteger_or_marker_p;
-extern Lisp_Object Qinteractive, Qinternal_error;
-extern Lisp_Object Qinvalid_byte_code, Qinvalid_change, Qinvalid_constant;
-extern Lisp_Object Qinvalid_function, Qinvalid_operation;
-extern Lisp_Object Qinvalid_read_syntax, Qinvalid_state, Qio_error, Qlambda;
-extern Lisp_Object Qlayout, Qlist_formation_error, Qlistp, Qload;
-extern Lisp_Object Qlong_name, Qmacro, Qmakunbound, Qmalformed_list;
-extern Lisp_Object Qmalformed_property_list, Qmark, Qmodule;
-extern Lisp_Object Qmono_pixmap_image_instance_p, Qmouse_leave_buffer_hook;
-extern Lisp_Object Qnative_layout, Qnatnump, Qnetwork_error, Qno_catch;
-extern Lisp_Object Qnonnegativep, Qnothing_image_instance_p;
-extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp, Qout_of_memory;
-extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_p;
-extern Lisp_Object Qpointer_image_instance_p, Qprint_length;
-extern Lisp_Object Qprint_string_length, Qprinting_unreadable_object;
-extern Lisp_Object Qprogn, Qquit, Qquote, Qrange_error;
-extern Lisp_Object Qread_char, Qread_from_minibuffer;
-extern Lisp_Object Qreally_early_error_handler, Qregion_beginning;
-extern Lisp_Object Qregion_end, Qregistries, Qreverse_direction_charset;
-extern Lisp_Object Qrun_hooks, Qsans_modifiers, Qsave_buffers_kill_emacs;
-extern Lisp_Object Qself_insert_command, Qself_insert_defer_undo, Qsequencep;
-extern Lisp_Object Qset, Qsetting_constant, Qshort_name, Qsingularity_error;
-extern Lisp_Object Qsound_error, Qstack_overflow, Qstandard_input;
-extern Lisp_Object Qstandard_output, Qstart_open, Qstring_lessp;
-extern Lisp_Object Qstructure_formation_error, Qsubwindow;
-extern Lisp_Object Qsubwindow_image_instance_p;
-extern Lisp_Object Qtext_conversion_error, Qtext_image_instance_p, Qtop_level;
-extern Lisp_Object Qtrue_list_p, Qunderflow_error, Qunderline;
-extern Lisp_Object Quser_files_and_directories, Qvalues;
-extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvoid_function;
-extern Lisp_Object Qvoid_variable, Qwindow_live_p, Qwrong_number_of_arguments;
-extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p;
-
-extern MODULE_API Lisp_Object Qintegerp, Qinvalid_argument, Qprocess_error;
-extern MODULE_API Lisp_Object Qsyntax_error, Qt, Qunbound;
+extern Lisp_Object Qactivate_menubar_hook, Qand_optional, Qand_rest, Qautoload,
+  Qbackground, Qbackground_pixmap, Qblinking, Qbuffer_glyph_p, Qbuffer_live_p,
+  Qcall_interactively, Qcategory_designator_p,
+  Qcategory_table_value_p, Qcdr, Qcolor_pixmap_image_instance_p, Qcommandp,
+  Qcompletion_ignore_case, Qconsole_live_p, Qconst_specifier, Qcurrent_menubar,
+  Qdefun, Qdevice_live_p, Qdim, Qdirection, Qdisabled, Qdisabled_command_hook,
+  Qdisplay_table, Qdll_error, Qend_open, Qerror_lacks_explanatory_string,
+  Qevent_live_p, Qexit, Qextent_live_p, Qexternal_debugging_output, Qfeaturep,
+  Qfile_error, Qfile_name_sans_extension, Qfinal, Qforeground, Qformat,
+  Qframe_live_p, Qgraphic, Qgui_error, Qicon_glyph_p, Qidentity, Qinhibit_quit,
+  Qinhibit_read_only, Qinteractive, Qlayout, Qload, Qlong_name, Qmacro,
+  Qmakunbound, Qmark, Qmodule, Qmono_pixmap_image_instance_p,
+  Qmouse_leave_buffer_hook, Qnative_layout, Qnetwork_error,
+  Qnothing_image_instance_p, Qpoint, Qpointer_glyph_p,
+  Qpointer_image_instance_p, Qprint_length, Qprint_string_length, Qprogn,
+  Qread_char, Qread_from_minibuffer, Qreally_early_error_handler,
+  Qregion_beginning, Qregion_end, Qregistries, Qreverse_direction_charset,
+  Qrun_hooks, Qsans_modifiers, Qsave_buffers_kill_emacs, Qself_insert_command,
+  Qself_insert_defer_undo, Qsequencep, Qset, Qshort_name, Qsound_error,
+  Qstandard_input, Qstandard_output, Qstart_open, Qstring_lessp, Qsubwindow,
+  Qsubwindow_image_instance_p, Qtext_image_instance_p, Qtop_level, Qunderline,
+  Quser_files_and_directories, Qvalues, Qvariable_documentation,
+  Qvariable_domain, Qwindow_live_p, Qyes_or_no_p;
+
+extern MODULE_API Lisp_Object Qprocess_error, Qt, Qunbound;
 
 #define SYMBOL(fou) extern Lisp_Object fou
 #define SYMBOL_MODULE_API(fou) extern MODULE_API Lisp_Object fou
@@ -5684,7 +6205,7 @@
 extern Lisp_Object Vcommand_line_args, Vconfigure_info_directory;
 extern Lisp_Object Vconfigure_site_directory, Vconfigure_site_module_directory;
 extern Lisp_Object Vconsole_list, Vcontrolling_terminal;
-extern Lisp_Object Vcurrent_compiled_function_annotation, Vcurrent_load_list;
+extern Lisp_Object Vcurrent_load_list;
 extern Lisp_Object Vcurrent_mouse_event, Vcurrent_prefix_arg, Vdata_directory;
 extern Lisp_Object Vdirectory_sep_char, Vdisabled_command_hook;
 extern Lisp_Object Vdoc_directory, Vinternal_doc_file_name;
--- a/src/lread.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/lread.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Lisp parsing and input streams.
    Copyright (C) 1985-1989, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Tinker Systems.
-   Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -148,10 +148,6 @@
 /* A resizing-buffer stream used to temporarily hold data while reading */
 static Lisp_Object Vread_buffer_stream;
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-Lisp_Object Vcurrent_compiled_function_annotation;
-#endif
-
 static int load_byte_code_version;
 
 /* An array describing all known built-in structure types */
@@ -360,23 +356,23 @@
     len -= 3;
 
   {
-      EXTERNAL_LIST_LOOP_2 (acons, Vload_suppress_alist)
+    EXTERNAL_LIST_LOOP_2 (cons, Vload_suppress_alist)
       {
-	  if (CONSP (acons) && STRINGP (XCAR (acons)))
+	if (CONSP (cons) && STRINGP (XCAR (cons)))
 	  {
-	      Lisp_Object name = XCAR (acons);
-	      if (XSTRING_LENGTH (name) == len &&
-		  !memcmp (XSTRING_DATA (name), nonreloc, len))
+	    Lisp_Object name = XCAR (cons);
+	    if (XSTRING_LENGTH (name) == len &&
+		!memcmp (XSTRING_DATA (name), nonreloc, len))
 	      {
-		  struct gcpro gcpro1;
-		  Lisp_Object val;
-
-		  GCPRO1 (reloc);
-		  val = IGNORE_MULTIPLE_VALUES (Feval (XCDR (acons)));
-		  UNGCPRO;
-
-		  if (!NILP (val))
-		      return 1;
+		struct gcpro gcpro1;
+		Lisp_Object val;
+
+		GCPRO1 (reloc);
+		val = IGNORE_MULTIPLE_VALUES (Feval (XCDR (cons)));
+		UNGCPRO;
+
+		if (!NILP (val))
+		  return 1;
 	      }
 	  }
       }
@@ -593,7 +589,7 @@
 
       fd = locate_file (Vload_path, file,
                         ((!NILP (nosuffix)) ? Qnil :
-			 build_string (load_ignore_elc_files ? ".el:" :
+			 build_ascstring (load_ignore_elc_files ? ".el:" :
 				       ".elc:.el:")),
                         &found,
                         -1);
@@ -1097,7 +1093,7 @@
 	    {
 	      /* We succeeded; return this descriptor and filename.  */
 	      if (closure->storeptr)
-		*closure->storeptr = build_intstring (fn);
+		*closure->storeptr = build_istring (fn);
 
 	      return 1;
 	    }
@@ -1181,7 +1177,7 @@
 locate_file_construct_suffixed_files_mapper (Ibyte *fn, void *arg)
 {
   Lisp_Object *tail = (Lisp_Object *) arg;
-  *tail = Fcons (build_intstring (fn), *tail);
+  *tail = Fcons (build_istring (fn), *tail);
   return 0;
 }
 
@@ -1271,7 +1267,7 @@
 
   /* Is it really necessary to gcpro path and str?  It shouldn't be
      unless some caller has fucked up.  There are known instances that
-     call us with build_string("foo:bar") as SUFFIXES, though. */
+     call us with build_ascstring("foo:bar") as SUFFIXES, though. */
   GCPRO4 (path, str, suffixes, suffixtab);
 
   /* if this filename has directory components, it's too complicated
@@ -1451,9 +1447,6 @@
 
   internal_bind_lisp_object (&Vcurrent_load_list, Qnil);
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-#endif
   GCPRO2 (val, sourcename);
 
   LOADHIST_ATTACH (sourcename);
@@ -1619,9 +1612,6 @@
 
   Vread_objects = Qnil;
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-#endif
   if (EQ (stream, Qread_char))
     {
       Lisp_Object val = call1 (Qread_from_minibuffer,
@@ -1648,9 +1638,6 @@
   Lisp_Object lispstream = Qnil;
   struct gcpro gcpro1;
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-#endif
   GCPRO1 (lispstream);
   CHECK_STRING (string);
   get_string_range_byte (string, start, end, &startval, &endval,
@@ -1872,7 +1859,7 @@
                 else if (c >= 'a' && c <= 'f')  i = (i << 4) + (c - 'a') + 10;
                 else if (c >= 'A' && c <= 'F')  i = (i << 4) + (c - 'A') + 10;
 
-                args[0] = build_string ("?\\x%x");
+                args[0] = build_ascstring ("?\\x%x");
                 args[1] = make_int (i);
                 syntax_error ("Overlong hex character escape",
                               Fformat (2, args));
@@ -2129,7 +2116,7 @@
       Dynarr_add (dyn, bit);
     }
 
-  val = make_bit_vector_from_byte_vector (Dynarr_atp (dyn, 0),
+  val = make_bit_vector_from_byte_vector (Dynarr_begin (dyn),
 					  Dynarr_length (dyn));
   Dynarr_free (dyn);
 
@@ -2154,8 +2141,7 @@
   st.instantiate = instantiate;
   Dynarr_add (the_structure_type_dynarr, st);
 
-  return Dynarr_atp (the_structure_type_dynarr,
-		     Dynarr_length (the_structure_type_dynarr) - 1);
+  return Dynarr_lastp (the_structure_type_dynarr);
 }
 
 void
@@ -2395,34 +2381,36 @@
   Ichar c;
   Ichar permit_unicode = 0; 
 
-  do {
-    c = reader_nextchar(readcharfun);
-    switch (c) {
-      /* #r:engine"my sexy raw string" -- raw string w/ flags*/
-      /* case ':': */
-      /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */
-    case 'u':
-    case 'U':
-      permit_unicode = c; 
-      continue;
-
-      /* #r"my raw string" -- raw string */
-    case '\"':
-      return read_string(readcharfun, '\"', 1, permit_unicode);
-      /* invalid syntax */
-    default:
-      {
-	if (permit_unicode)
+  do
+    {
+      c = reader_nextchar (readcharfun);
+      switch (c)
+	{
+	  /* #r:engine"my sexy raw string" -- raw string w/ flags*/
+	  /* case ':': */
+	  /* #ru"Hi there\u20AC \U000020AC" -- raw string, honouring Unicode. */
+	case 'u':
+	case 'U':
+	  permit_unicode = c; 
+	  continue;
+
+	  /* #r"my raw string" -- raw string */
+	case '\"':
+	  return read_string (readcharfun, '\"', 1, permit_unicode);
+	  /* invalid syntax */
+	default:
 	  {
-	    unreadchar(readcharfun, permit_unicode);
+	    if (permit_unicode)
+	      {
+		unreadchar (readcharfun, permit_unicode);
+	      }
+	    unreadchar (readcharfun, c);
+	    return Fsignal (Qinvalid_read_syntax,
+			    list1 (build_msg_string
+				   ("unrecognized raw string syntax")));
 	  }
-	unreadchar(readcharfun, c);
-	return Fsignal(Qinvalid_read_syntax,
-		       list1(build_string
-			     ("unrecognized raw string syntax")));
-      }
-    }
-  } while (1);
+	}
+    } while (1);
 }
 
 /* Read the next Lisp object from the stream READCHARFUN and return it.
@@ -2581,7 +2569,7 @@
 		  if (CONSP (tmp) && UNBOUNDP (XCAR (tmp)))
 		    free_cons (tmp);
 		  return Fsignal (Qinvalid_read_syntax,
-				   list1 (build_string ("#")));
+				   list1 (build_ascstring ("#")));
 		}
 	      GCPRO1 (tmp);
 	      /* Read the intervals and their properties.  */
@@ -2739,13 +2727,13 @@
 					   make_int (n)));
 		}
 	      return Fsignal (Qinvalid_read_syntax,
-			      list1 (build_string ("#")));
+			      list1 (build_ascstring ("#")));
 	    }
 	  default:
 	    {
 	      unreadchar (readcharfun, c);
 	      return Fsignal (Qinvalid_read_syntax,
-			      list1 (build_string ("#")));
+			      list1 (build_ascstring ("#")));
 	    }
 	  }
       }
@@ -3010,16 +2998,6 @@
 	}
     }
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  if (s->length == 1 && s->allow_dotted_lists && EQ (XCAR (s->head), Qfset))
-    {
-      if (CONSP (elt) && EQ (XCAR (elt), Qquote) && CONSP (XCDR (elt)))
-	Vcurrent_compiled_function_annotation = XCAR (XCDR (elt));
-      else
-	Vcurrent_compiled_function_annotation = elt;
-    }
-#endif
-
   elt = Fcons (elt, Qnil);
   if (!NILP (s->tail))
     XCDR (s->tail) = elt;
@@ -3055,10 +3033,6 @@
 {
   struct read_list_state s;
   struct gcpro gcpro1, gcpro2;
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Lisp_Object old_compiled_function_annotation =
-    Vcurrent_compiled_function_annotation;
-#endif
 
   s.head = Qnil;
   s.tail = Qnil;
@@ -3068,9 +3042,6 @@
   GCPRO2 (s.head, s.tail);
 
   sequence_reader (readcharfun, terminator, &s, read_list_conser);
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = old_compiled_function_annotation;
-#endif
 
   if ((purify_flag || load_force_doc_strings) && check_for_doc_references)
     {
@@ -3121,7 +3092,7 @@
 		       because that would make the directory absolute
 		       now.  */
 		    XCAR (XCAR (holding_cons)) =
-		      concat2 (build_string ("../lisp/"),
+		      concat2 (build_ascstring ("../lisp/"),
 			       Ffile_name_nondirectory
 			       (Vload_file_name_internal));
 		}
@@ -3215,7 +3186,7 @@
 		make_byte_code_args[iii] = Qzero;
 	      else
 		XCAR (make_byte_code_args[iii]) =
-		  concat2 (build_string ("../lisp/"),
+		  concat2 (build_ascstring ("../lisp/"),
 			   Ffile_name_nondirectory
 			   (Vload_file_name_internal));
 	    }
@@ -3256,7 +3227,7 @@
   /* kludge: locate-file does not work for a null load-path, even if
      the file name is absolute. */
 
-  Vload_path = Fcons (build_string (""), Qnil);
+  Vload_path = Fcons (build_ascstring (""), Qnil);
 
   /* This used to get initialized in init_lread because all streams
      got closed when dumping occurs.  This is no longer true --
@@ -3406,7 +3377,7 @@
 complex dependencies.  Ignoring all elc files with `load-ignore-elc-files'
 would also be safe, but much slower.
 */ );
-  load_ignore_out_of_date_elc_files = 0;
+  load_ignore_out_of_date_elc_files = 1;
 
   DEFVAR_BOOL ("load-always-display-messages",
 	       &load_always_display_messages /*
@@ -3478,11 +3449,6 @@
   Vload_file_name_internal = Qnil;
   staticpro (&Vload_file_name_internal);
 
-#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
-  Vcurrent_compiled_function_annotation = Qnil;
-  staticpro (&Vcurrent_compiled_function_annotation);
-#endif
-
   /* So that early-early stuff will work */
   Ffset (Qload,	Qload_internal);
 
--- a/src/lrecord.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/lrecord.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* The "lrecord" structure (header of a compound lisp object).
    Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
-   Copyright (C) 1996, 2001, 2002, 2004, 2005, 2009 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2004, 2005, 2009, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -59,12 +59,37 @@
    just looking for a way of encapsulating data (which possibly
    could contain Lisp_Objects in it), you may well be able to use
    the opaque type.
+*/
 
-   The "public API's" meant for use by regular Lisp objects are macros
-   in capital letters, involving the word "LISP_OBJECT".  Underlyingly,
-   the functions and structures use "lrecord" or "lcrecord", but most
-   code shouldn't have to worry about this.
-*/
+#ifdef NEW_GC
+/*
+  There are some limitations under New-GC that lead to the creation of a
+  large number of new internal object types.  I'm not completely sure what
+  all of them are, but they are at least partially related to limitations
+  on finalizers.  Something else must be going on as well, because
+  non-dumpable, non-finalizable objects like devices and frames also have
+  their window-system-specific substructures converted into Lisp objects.
+  It must have something to do with the fact that these substructures
+  contain pointers to Lisp objects, but it's not completely clear why --
+  object descriptions exist to indicate the size of these structures and
+  the Lisp object pointers within them.
+
+ At least one definite issue is that under New-GC dumpable objects cannot
+ contain any finalizers (see pdump_register_object()).  This means that any
+ substructures in dumpable objects that are allocated separately and
+ normally freed in a finalizer need instead to be made into actual Lisp
+ objects.  If those structures are Dynarrs, they need to be made into
+ Dynarr Lisp objects (e.g. face-cachel-dynarr or glyph-cachel-dynarr),
+ which are created using Dynarr_lisp_new() or Dynarr_new_new2().
+ Furthermore, the objects contained in the Dynarr also need to be Lisp
+ objects (e.g. face-cachel or glyph-cachel).
+
+ --ben
+ */
+
+#endif
+
+
 
 #ifdef NEW_GC
 #define ALLOC_LISP_OBJECT(type) alloc_lrecord (&lrecord_##type)
@@ -294,6 +319,7 @@
   lrecord_type_undefined, /* only used for debugging */
 #endif /* not NEW_GC */
 #ifdef NEW_GC
+  /* See comment up top explaining why these extra object types must exist. */
   lrecord_type_string_indirect_data,
   lrecord_type_string_direct_data,
   lrecord_type_hash_table_entry,
@@ -370,7 +396,8 @@
   void (*finalizer) (void *header);
 
   /* This can be NULL, meaning compare objects with EQ(). */
-  int (*equal) (Lisp_Object obj1, Lisp_Object obj2, int depth);
+  int (*equal) (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		int foldcase);
 
   /* `hash' generates hash values for use with hash tables that have
      `equal' as their test function.  This can be NULL, meaning use
@@ -485,7 +512,7 @@
       const struct lrecord_implementation *MCACF_implementation		\
 	= LHEADER_IMPLEMENTATION (MCACF_lheader);			\
       if (MCACF_implementation && MCACF_implementation->disksaver)	\
-	MCACF_implementation->disksaver (ptr);				\
+	MCACF_implementation->disksaver (MCACF_obj);			\
     }									\
 } while (0)
 
@@ -710,7 +737,7 @@
      ...
    };
 
-   lisp_object_description is declared in alloc.c, like this:
+   lisp_object_description is declared in gc.c, like this:
 
    static const struct memory_description lisp_object_description_1[] = {
      { XD_LISP_OBJECT, 0 },
@@ -1131,19 +1158,6 @@
 #define XD_INDIRECT_VAL(code) ((-1 - (code)) & 255)
 #define XD_INDIRECT_DELTA(code) ((-1 - (code)) >> 8)
 
-#define XD_DYNARR_DESC(base_type, sub_desc)				      \
-  { XD_BLOCK_PTR, offsetof (base_type, base), XD_INDIRECT(1, 0), {sub_desc} },\
-  { XD_INT,        offsetof (base_type, cur) },				      \
-  { XD_INT_RESET,  offsetof (base_type, max), XD_INDIRECT(1, 0) }	      \
-
-#ifdef NEW_GC
-#define XD_LISP_DYNARR_DESC(base_type, sub_desc)			\
-  { XD_LISP_OBJECT_BLOCK_PTR, offsetof (base_type, base),		\
-    XD_INDIRECT(1, 0), {sub_desc} },					\
-  { XD_INT,        offsetof (base_type, cur) },				\
-  { XD_INT_RESET,  offsetof (base_type, max), XD_INDIRECT(1, 0) }
-#endif /* not NEW_GC */
-
 /* DEFINE_*_LISP_OBJECT is for objects with constant size. (Either
    DEFINE_DUMPABLE_LISP_OBJECT for objects that can be saved in a dumped
    executable, or DEFINE_NODUMP_LISP_OBJECT for objects that cannot be
--- a/src/lstream.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/lstream.c	Wed Feb 24 01:58:04 2010 -0600
@@ -852,17 +852,17 @@
      is called more than once on the same object */
   if (lstr->out_buffer)
     {
-      xfree (lstr->out_buffer, unsigned char *);
+      xfree (lstr->out_buffer);
       lstr->out_buffer = 0;
     }
   if (lstr->in_buffer)
     {
-      xfree (lstr->in_buffer, unsigned char *);
+      xfree (lstr->in_buffer);
       lstr->in_buffer = 0;
     }
   if (lstr->unget_buffer)
     {
-      xfree (lstr->unget_buffer, unsigned char *);
+      xfree (lstr->unget_buffer);
       lstr->unget_buffer = 0;
     }
 
@@ -1550,7 +1550,7 @@
   struct resizing_buffer_stream *str = RESIZING_BUFFER_STREAM_DATA (stream);
   if (str->buf)
     {
-      xfree (str->buf, unsigned char *);
+      xfree (str->buf);
       str->buf = 0;
     }
   return 0;
--- a/src/make-src-depend	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/make-src-depend	Wed Feb 24 01:58:04 2010 -0600
@@ -142,8 +142,8 @@
 
 PrintPatternDeps ('-msw\\.',   "HAVE_MS_WINDOWS");
 PrintPatternDeps ('-xlike',   "HAVE_XLIKE");
-# X-specific files: *-x.c *-x-impl.h xgccache.c balloon_help.c x*.h Emacs*.[ch]
-PrintPatternDeps ('-x\\.|xgccache|balloon_help|^Emacs',     "HAVE_X_WINDOWS");
+# X-specific files: *-x.c *-x-impl.h balloon_help.c x*.h Emacs*.[ch]
+PrintPatternDeps ('-x\\.|balloon_help|^Emacs',     "HAVE_X_WINDOWS");
 PrintPatternDeps ('-tty\\.',   "HAVE_TTY");
 # GTK-specific files: *-gtk.[ch] *-gtk-*.[ch] gtk-*.[ch] emacs-marshals.c emacs-widget-accessors.c glade.c ui-byhand.c
 PrintPatternDeps ('gtk|emacs-marshals|emacs-widget-accessors|glade|ui-byhand',   "HAVE_GTK");
--- a/src/marker.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/marker.c	Wed Feb 24 01:58:04 2010 -0600
@@ -62,9 +62,9 @@
   if (print_readably)
     printing_unreadable_object ("#<marker 0x%lx>", (long) marker);
 
-  write_c_string (printcharfun, GETTEXT ("#<marker "));
+  write_ascstring (printcharfun, GETTEXT ("#<marker "));
   if (!marker->buffer)
-    write_c_string (printcharfun, GETTEXT ("in no buffer"));
+    write_ascstring (printcharfun, GETTEXT ("in no buffer"));
   else
     {
       write_fmt_string (printcharfun, "at %ld in ",
@@ -72,12 +72,13 @@
       print_internal (marker->buffer->name, printcharfun, 0);
     }
   if (marker->insertion_type)
-    write_c_string (printcharfun, " insertion-type=t");
+    write_ascstring (printcharfun, " insertion-type=t");
   write_fmt_string (printcharfun, " 0x%lx>", (long) marker);
 }
 
 static int
-marker_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+marker_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int UNUSED (foldcase))
 {
   Lisp_Marker *marker1 = XMARKER (obj1);
   Lisp_Marker *marker2 = XMARKER (obj2);
--- a/src/menubar-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/menubar-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -260,9 +260,7 @@
   /* Set the string straight from the object. */
   if (STRINGP (keys) && XSTRING_LENGTH (keys))
     {
-      C_STRING_TO_EXTERNAL_MALLOC(XSTRING_DATA (keys),
-				  l->label.accel_string,
-				  Qctext);
+      l->label.accel_string = ITEXT_TO_EXTERNAL_MALLOC (XSTRING_DATA (keys), Qctext);
     }
   else
     {
@@ -322,7 +320,7 @@
       Lisp_Object menu_desc = Qnil;
       GtkWidget *old_submenu = GTK_MENU_ITEM (menu_item)->submenu;
 
-      menu_desc = VOID_TO_LISP (gtk_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
+      menu_desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG));
 
       /* GCPRO all of our very own */
       gcpro_popup_callbacks (id, menu_desc);
@@ -387,7 +385,7 @@
       return;
     }
 
-  desc = VOID_TO_LISP (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_DESCR_TAG));
+  desc = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_DESCR_TAG));
 
 #ifdef TEAR_OFF_MENUS
   /* Lets stick in a detacher just for giggles */
@@ -406,7 +404,7 @@
       Lisp_Object hook_fn;
       struct gcpro gcpro1, gcpro2;
 
-      hook_fn = VOID_TO_LISP (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
+      hook_fn = GET_LISP_FROM_VOID (gtk_object_get_data (GTK_OBJECT (item), XEMACS_MENU_FILTER_TAG));
 
       GCPRO2 (desc, hook_fn);
 
@@ -648,7 +646,7 @@
 #if 0
 	      if ( SYMBOLP (val)
 		   || CHARP (val))
-		wv->accel = LISP_TO_VOID (val);
+		wv->accel = STORE_LISP_IN_VOID (val);
 	      else
 		invalid_argument ("bad keyboard accelerator", val);
 #endif
@@ -661,8 +659,8 @@
 	    invalid_argument ("unknown menu cascade keyword", cascade);
 	}
 
-      gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, LISP_TO_VOID (desc));
-      gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, LISP_TO_VOID (hook_fn));
+      gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_DESCR_TAG, STORE_LISP_IN_VOID (desc));
+      gtk_object_set_data (GTK_OBJECT (menu_item), XEMACS_MENU_FILTER_TAG, STORE_LISP_IN_VOID (hook_fn));
 
       if ((!NILP (config_tag)
 	   && NILP (Fmemq (config_tag, Vmenubar_configuration)))
@@ -743,7 +741,7 @@
 
   channel = wrap_frame (gtk_widget_to_frame (GTK_WIDGET (item)));
 
-  callback = VOID_TO_LISP (user_data);
+  callback = GET_LISP_FROM_VOID (user_data);
 
   get_gui_callback (callback, &function, &data);
 
@@ -1009,11 +1007,11 @@
 
       gtk_signal_connect (GTK_OBJECT (widget), "activate-item",
 			  GTK_SIGNAL_FUNC (__generic_button_callback),
-			  LISP_TO_VOID (callback));
+			  STORE_LISP_IN_VOID (callback));
 
       gtk_signal_connect (GTK_OBJECT (widget), "activate",
 			  GTK_SIGNAL_FUNC (__generic_button_callback),
-			  LISP_TO_VOID (callback));
+			  STORE_LISP_IN_VOID (callback));
 
       /* Now that all the information about the menu item is know, set the
 	 remaining properties.
--- a/src/menubar-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/menubar-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -97,7 +97,7 @@
 /* #### */
 #define REPLACE_ME_WITH_GLOBAL_VARIABLE_WHICH_CONTROLS_RIGHT_FLUSH 0
 
-#define EMPTY_ITEM_ID ((UINT)LISP_TO_VOID (Qunbound))
+#define EMPTY_ITEM_ID ((UINT)STORE_LISP_IN_VOID (Qunbound))
 #define EMPTY_ITEM_NAME "(empty)" /* WARNING: uses of this need XETEXT */
 
 /* Current menu (bar or popup) descriptor. gcpro'ed */
@@ -138,7 +138,7 @@
     right = gui_item_display_flush_right (gui_item);
 
   if (!NILP (right))
-    return concat3 (left, build_string ("\t"), right);
+    return concat3 (left, build_ascstring ("\t"), right);
   else
     return left;
 }
@@ -241,12 +241,9 @@
 	item_info.fType = MFT_SEPARATOR;
       else
 	{
-	  Extbyte *itemext;
-
 	  item_info.fType = MFT_STRING;
 	  item_info.fState = MFS_DISABLED;
-	  LISP_STRING_TO_TSTR (item, itemext);
-	  item_info.dwTypeData = (XELPTSTR) itemext;
+	  item_info.dwTypeData = (XELPTSTR) LISP_STRING_TO_TSTR (item);
 	}
     }
   else if (CONSP (item))
@@ -257,7 +254,6 @@
       Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item);
       struct gcpro gcpro1, gcpro2, gcpro3;
       Ichar accel;
-      Extbyte *itemext;
 
       GCPRO3 (gui_item, path, *accel_list);
 
@@ -281,9 +277,8 @@
       submenu = create_empty_popup_menu ();
 
       item_info.fMask |= MIIM_SUBMENU;
-      LISP_STRING_TO_TSTR (displayable_menu_item (gui_item, bar_p, &accel),
-			   itemext);
-      item_info.dwTypeData = (XELPTSTR) itemext;
+      item_info.dwTypeData = (XELPTSTR)
+	LISP_STRING_TO_TSTR (displayable_menu_item (gui_item, bar_p, &accel));
       item_info.hSubMenu = submenu;
 
       if (accel && bar_p)
@@ -315,7 +310,6 @@
       Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item);
       struct gcpro gcpro1, gcpro2;
       Ichar accel;
-      Extbyte *itemext;
 
       GCPRO2 (gui_item, *accel_list);
 
@@ -348,9 +342,8 @@
 
       item_info.wID = (UINT) XINT (id);
       item_info.fType |= MFT_STRING;
-      LISP_STRING_TO_TSTR (displayable_menu_item (gui_item, bar_p, &accel),
-			   itemext);
-      item_info.dwTypeData = (XELPTSTR) itemext;
+      item_info.dwTypeData = (XELPTSTR)
+	LISP_STRING_TO_TSTR (displayable_menu_item (gui_item, bar_p, &accel));
 
       if (accel && bar_p)
 	*accel_list = Fcons (make_char (accel), *accel_list);
@@ -449,12 +442,9 @@
 	 two separators in X... In Windows this looks ugly, anyways.) */
       if (!bar_p && !deep_p && popup_menu_titles && !NILP (pgui_item->name))
 	{
-	  Extbyte *nameext;
-
-	  LISP_STRING_TO_TSTR (displayable_menu_item (gui_item, bar_p, NULL),
-			       nameext);
 	  qxeInsertMenu (menu, 0, MF_BYPOSITION | MF_STRING | MF_DISABLED,
-			 0, nameext);
+			 0, LISP_STRING_TO_TSTR (displayable_menu_item
+						 (gui_item, bar_p, NULL)));
 	  qxeInsertMenu (menu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
 	  SetMenuDefaultItem (menu, 0, MF_BYPOSITION);
 	}
--- a/src/menubar-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/menubar-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -122,13 +122,13 @@
 	}
       else
 	{
-	  LISP_STRING_TO_EXTERNAL_MALLOC (desc, wv->name, Qlwlib_encoding);
+	  wv->name = LISP_STRING_TO_EXTERNAL_MALLOC (desc, Qlwlib_encoding);
 	  wv->enabled = 1;
 	  /* dverna Dec. 98: command_builder_operate_menu_accelerator will
 	     manipulate the accel as a Lisp_Object if the widget has a name.
 	     Since simple labels have a name, but no accel, we *must* set it
 	     to nil */
-	  wv->accel = LISP_TO_VOID (Qnil);
+	  wv->accel = STORE_LISP_IN_VOID (Qnil);
 	}
     }
   else if (VECTORP (desc))
@@ -162,7 +162,7 @@
 	  wv->name = add_accel_and_to_external (XCAR (desc));
 
 	  accel = gui_name_accelerator (XCAR (desc));
-	  wv->accel = LISP_TO_VOID (accel);
+	  wv->accel = STORE_LISP_IN_VOID (accel);
 
 	  desc = Fcdr (desc);
 
@@ -186,7 +186,7 @@
 		{
 		  if ( SYMBOLP (val)
 		       || CHARP (val))
-		    wv->accel = LISP_TO_VOID (val);
+		    wv->accel = STORE_LISP_IN_VOID (val);
 		  else
 		    invalid_argument ("bad keyboard accelerator", val);
 		}
@@ -231,7 +231,7 @@
 		  /* This is automatically GC protected through
 		     the call to lw_map_widget_values(); no need
 		     to worry. */
-		  incr_wv->call_data = LISP_TO_VOID (incremental_data);
+		  incr_wv->call_data = STORE_LISP_IN_VOID (incremental_data);
 		  goto menu_item_done;
 		}
 #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */
@@ -261,7 +261,7 @@
 	      /* Add a fake entry so the menus show up */
 	      wv->contents = dummy = xmalloc_widget_value ();
 	      dummy->name = xstrdup ("(inactive)");
-	      dummy->accel = LISP_TO_VOID (Qnil);
+	      dummy->accel = STORE_LISP_IN_VOID (Qnil);
 	      dummy->enabled = 0;
 	      dummy->selected = 0;
 	      dummy->value = NULL;
@@ -471,7 +471,7 @@
       widget_value *wv;
 
       assert (hack_wv->type == INCREMENTAL_TYPE);
-      submenu_desc = VOID_TO_LISP (hack_wv->call_data);
+      submenu_desc = GET_LISP_FROM_VOID (hack_wv->call_data);
 
       wv = (protected_menu_item_descriptor_to_widget_value
 	    (submenu_desc, SUBMENU_TYPE, 1, 0));
@@ -481,12 +481,12 @@
 	  wv = xmalloc_widget_value ();
 	  wv->type = CASCADE_TYPE;
 	  wv->next = NULL;
-	  wv->accel = LISP_TO_VOID (Qnil);
+	  wv->accel = STORE_LISP_IN_VOID (Qnil);
 	  wv->contents = xmalloc_widget_value ();
 	  wv->contents->type = TEXT_TYPE;
 	  wv->contents->name = xstrdup ("No menu");
 	  wv->contents->next = NULL;
-	  wv->contents->accel = LISP_TO_VOID (Qnil);
+	  wv->contents->accel = STORE_LISP_IN_VOID (Qnil);
 	}
       assert (wv && wv->type == CASCADE_TYPE && wv->contents);
       replace_widget_value_tree (hack_wv, wv->contents);
@@ -999,7 +999,7 @@
 	i++;
 	write_fmt_string (Qexternal_debugging_output, "OPERATE (%d): ",i);
 	print_internal (t, Qexternal_debugging_output, 1);
-	write_c_string (Qexternal_debugging_output, "\n");
+	write_ascstring (Qexternal_debugging_output, "\n");
 	t = XEVENT_NEXT (t);
       }
   }
@@ -1032,7 +1032,7 @@
   while (entries)
     {
       Lisp_Object accel;
-      accel = VOID_TO_LISP (entries->accel);
+      accel = GET_LISP_FROM_VOID (entries->accel);
       if (entries->name && !NILP (accel))
 	{
 	  if (event_matches_key_specifier_p (evee, accel))
@@ -1265,7 +1265,7 @@
       while (val)
 	{
 	  Lisp_Object accel;
-	  accel = VOID_TO_LISP (val->accel);
+	  accel = GET_LISP_FROM_VOID (val->accel);
 	  if (val->name && !NILP (accel))
 	    {
 	      Fsetcar (last, accel);
--- a/src/menubar.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/menubar.c	Wed Feb 24 01:58:04 2010 -0600
@@ -456,8 +456,8 @@
    * and this works fine.
    */
 
-  Vblank_menubar = list1 (list2 (build_msg_string ("No active menubar"),
-				 vector3 (build_string (""), Qnil, Qnil)));
+  Vblank_menubar = list1 (list2 (build_defer_string ("No active menubar"),
+				 vector3 (build_ascstring (""), Qnil, Qnil)));
   staticpro (&Vblank_menubar);
 
   DEFVAR_BOOL ("popup-menu-titles", &popup_menu_titles /*
--- a/src/minibuf.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/minibuf.c	Wed Feb 24 01:58:04 2010 -0600
@@ -218,8 +218,8 @@
     {
       while (l)
         {
-          Ichar c1 = DOWNCASE (0, itext_ichar (s1));
-          Ichar c2 = DOWNCASE (0, itext_ichar (s2));
+          Ichar c1 = CANONCASE (0, itext_ichar (s1));
+          Ichar c2 = CANONCASE (0, itext_ichar (s2));
 
           if (c1 == c2)
             {
@@ -990,11 +990,9 @@
      at runtime instead of at load time. */
 #endif
   Vminibuffer_zero
-    = Fget_buffer_create
-      (build_string (DEFER_GETTEXT (" *Minibuf-0*")));
+    = Fget_buffer_create (build_ascstring (" *Minibuf-0*"));
   Vecho_area_buffer
-    = Fget_buffer_create
-      (build_string (DEFER_GETTEXT (" *Echo Area*")));
+    = Fget_buffer_create (build_ascstring (" *Echo Area*"));
 }
 
 void
--- a/src/mule-ccl.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/mule-ccl.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2366,7 +2366,7 @@
   XVECTOR_DATA (status)[8] = make_int (ccl.ic);
   UNGCPRO;
 
-  val = make_string (Dynarr_atp (outbuf, 0), produced);
+  val = make_string (Dynarr_begin (outbuf), produced);
   Dynarr_free (outbuf);
   QUIT;
   if (ccl.status == CCL_STAT_SUSPEND_BY_DST)
--- a/src/mule-charset.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/mule-charset.c	Wed Feb 24 01:58:04 2010 -0600
@@ -47,6 +47,7 @@
 Lisp_Object Vcharset_latin_iso8859_4;
 Lisp_Object Vcharset_thai_tis620;
 Lisp_Object Vcharset_greek_iso8859_7;
+Lisp_Object Vcharset_arabic_iso8859_6;
 Lisp_Object Vcharset_hebrew_iso8859_8;
 Lisp_Object Vcharset_katakana_jisx0201;
 Lisp_Object Vcharset_latin_jisx0201;
@@ -93,6 +94,7 @@
   Qlatin_iso8859_4,
   Qthai_tis620,
   Qgreek_iso8859_7,
+  Qarabic_iso8859_6,
   Qhebrew_iso8859_8,
   Qkatakana_jisx0201,
   Qlatin_jisx0201,
@@ -139,10 +141,8 @@
   Lisp_Charset *cs = XCHARSET (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<charset %s 0x%x>",
-				XSTRING_DATA (XSYMBOL (CHARSET_NAME (cs))->
-					     name),
-				cs->header.uid);
+    printing_unreadable_lcrecord
+      (obj, XSTRING_DATA (XSYMBOL (XCHARSET_NAME (obj))->name));
 
   write_fmt_string_lisp (printcharfun, "#<charset %s %S %S %S", 4,
 			 CHARSET_NAME (cs), CHARSET_SHORT_NAME (cs),
@@ -624,10 +624,10 @@
       Ibyte tempname[80];
 
       qxesprintf (tempname, "___temporary___%d__", id);
-      name = intern_int (tempname);
+      name = Fmake_symbol (build_istring (tempname)); /* Uninterned. */
     }
   if (NILP (doc_string))
-    doc_string = build_string ("");
+    doc_string = build_ascstring ("");
   if (NILP (registries))
     registries = make_vector(0, Qnil);
   if (NILP (short_name))
@@ -1102,6 +1102,7 @@
   DEFSYMBOL (Qlatin_iso8859_4);
   DEFSYMBOL (Qthai_tis620);
   DEFSYMBOL (Qgreek_iso8859_7);
+  DEFSYMBOL (Qarabic_iso8859_6);
   DEFSYMBOL (Qhebrew_iso8859_8);
   DEFSYMBOL (Qkatakana_jisx0201);
   DEFSYMBOL (Qlatin_jisx0201);
@@ -1158,176 +1159,185 @@
     make_charset (LEADING_BYTE_ASCII, Qascii, 1,
 		  CHARSET_TYPE_94, 1, 0, 'B',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("ASCII"),
-		  build_msg_string ("ASCII"),
-		  build_msg_string ("ASCII (ISO646 IRV)"),
-		  vector1(build_string("iso8859-1")), 0, 0);
+		  build_ascstring ("ASCII"),
+		  build_defer_string ("ASCII"),
+		  build_defer_string ("ASCII (ISO646 IRV)"),
+		  vector1(build_ascstring("iso8859-1")), 0, 0);
   staticpro (&Vcharset_control_1);
   Vcharset_control_1 =
     make_charset (LEADING_BYTE_CONTROL_1, Qcontrol_1, 2,
 		  CHARSET_TYPE_94, 1, 1, 0,
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("C1"),
-		  build_msg_string ("Control characters"),
-		  build_msg_string ("Control characters 128-191"),
-		  vector1(build_string("iso8859-1")), 0, 0);
+		  build_ascstring ("C1"),
+		  build_defer_string ("Control characters"),
+		  build_defer_string ("Control characters 128-191"),
+		  vector1(build_ascstring("iso8859-1")), 0, 0);
   staticpro (&Vcharset_latin_iso8859_1);
   Vcharset_latin_iso8859_1 =
     make_charset (LEADING_BYTE_LATIN_ISO8859_1, Qlatin_iso8859_1, 2,
 		  CHARSET_TYPE_96, 1, 1, 'A',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-1"),
-		  build_msg_string ("ISO8859-1 (Latin-1)"),
-		  build_msg_string ("ISO8859-1 (Latin-1)"),
-		  vector1(build_string("iso8859-1")), 0, 0);
+		  build_ascstring ("Latin-1"),
+		  build_defer_string ("ISO8859-1 (Latin-1)"),
+		  build_defer_string ("ISO8859-1 (Latin-1)"),
+		  vector1(build_ascstring("iso8859-1")), 0, 0);
   staticpro (&Vcharset_latin_iso8859_2);
   Vcharset_latin_iso8859_2 =
     make_charset (LEADING_BYTE_LATIN_ISO8859_2, Qlatin_iso8859_2, 2,
 		  CHARSET_TYPE_96, 1, 1, 'B',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-2"),
-		  build_msg_string ("ISO8859-2 (Latin-2)"),
-		  build_msg_string ("ISO8859-2 (Latin-2)"),
-		  vector1(build_string("iso8859-2")), 0, 0);
+		  build_ascstring ("Latin-2"),
+		  build_defer_string ("ISO8859-2 (Latin-2)"),
+		  build_defer_string ("ISO8859-2 (Latin-2)"),
+		  vector1(build_ascstring("iso8859-2")), 0, 0);
   staticpro (&Vcharset_latin_iso8859_3);
   Vcharset_latin_iso8859_3 =
     make_charset (LEADING_BYTE_LATIN_ISO8859_3, Qlatin_iso8859_3, 2,
 		  CHARSET_TYPE_96, 1, 1, 'C',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-3"),
-		  build_msg_string ("ISO8859-3 (Latin-3)"),
-		  build_msg_string ("ISO8859-3 (Latin-3)"),
-		  vector1(build_string("iso8859-3")), 0, 0);
+		  build_ascstring ("Latin-3"),
+		  build_defer_string ("ISO8859-3 (Latin-3)"),
+		  build_defer_string ("ISO8859-3 (Latin-3)"),
+		  vector1(build_ascstring("iso8859-3")), 0, 0);
   staticpro (&Vcharset_latin_iso8859_4);
   Vcharset_latin_iso8859_4 =
     make_charset (LEADING_BYTE_LATIN_ISO8859_4, Qlatin_iso8859_4, 2,
 		  CHARSET_TYPE_96, 1, 1, 'D',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-4"),
-		  build_msg_string ("ISO8859-4 (Latin-4)"),
-		  build_msg_string ("ISO8859-4 (Latin-4)"),
-		  vector1(build_string("iso8859-4")), 0, 0);
+		  build_ascstring ("Latin-4"),
+		  build_defer_string ("ISO8859-4 (Latin-4)"),
+		  build_defer_string ("ISO8859-4 (Latin-4)"),
+		  vector1(build_ascstring("iso8859-4")), 0, 0);
   staticpro (&Vcharset_thai_tis620);
   Vcharset_thai_tis620 =
     make_charset (LEADING_BYTE_THAI_TIS620, Qthai_tis620, 2,
 		  CHARSET_TYPE_96, 1, 1, 'T',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("TIS620"),
-		  build_msg_string ("TIS620 (Thai)"),
-		  build_msg_string ("TIS620.2529 (Thai)"),
-		  vector1(build_string("tis620.2529-1")), 0, 0);
+		  build_ascstring ("TIS620"),
+		  build_defer_string ("TIS620 (Thai)"),
+		  build_defer_string ("TIS620.2529 (Thai)"),
+		  vector1(build_ascstring("tis620.2529-1")), 0, 0);
   staticpro (&Vcharset_greek_iso8859_7);
   Vcharset_greek_iso8859_7 =
     make_charset (LEADING_BYTE_GREEK_ISO8859_7, Qgreek_iso8859_7, 2,
 		  CHARSET_TYPE_96, 1, 1, 'F',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("ISO8859-7"),
-		  build_msg_string ("ISO8859-7 (Greek)"),
-		  build_msg_string ("ISO8859-7 (Greek)"),
-		  vector1(build_string("iso8859-7")), 0, 0);
+		  build_ascstring ("ISO8859-7"),
+		  build_defer_string ("ISO8859-7 (Greek)"),
+		  build_defer_string ("ISO8859-7 (Greek)"),
+		  vector1(build_ascstring("iso8859-7")), 0, 0);
+  staticpro (&Vcharset_arabic_iso8859_6);
+  Vcharset_arabic_iso8859_6 =
+    make_charset (LEADING_BYTE_ARABIC_ISO8859_6, Qarabic_iso8859_6, 2,
+		  CHARSET_TYPE_96, 1, 1, 'G',
+		  CHARSET_RIGHT_TO_LEFT,
+		  build_ascstring ("ISO8859-6"),
+		  build_defer_string ("ISO8859-6 (Arabic)"),
+		  build_defer_string ("ISO8859-6 (Arabic)"),
+		  vector1(build_ascstring ("iso8859-6")), 0, 0);
   staticpro (&Vcharset_hebrew_iso8859_8);
   Vcharset_hebrew_iso8859_8 =
     make_charset (LEADING_BYTE_HEBREW_ISO8859_8, Qhebrew_iso8859_8, 2,
 		  CHARSET_TYPE_96, 1, 1, 'H',
 		  CHARSET_RIGHT_TO_LEFT,
-		  build_string ("ISO8859-8"),
-		  build_msg_string ("ISO8859-8 (Hebrew)"),
-		  build_msg_string ("ISO8859-8 (Hebrew)"),
-		  vector1(build_string ("iso8859-8")), 0, 0);
+		  build_ascstring ("ISO8859-8"),
+		  build_defer_string ("ISO8859-8 (Hebrew)"),
+		  build_defer_string ("ISO8859-8 (Hebrew)"),
+		  vector1(build_ascstring ("iso8859-8")), 0, 0);
   staticpro (&Vcharset_katakana_jisx0201);
   Vcharset_katakana_jisx0201 =
     make_charset (LEADING_BYTE_KATAKANA_JISX0201, Qkatakana_jisx0201, 2,
 		  CHARSET_TYPE_94, 1, 1, 'I',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("JISX0201 Kana"),
-		  build_msg_string ("JISX0201.1976 (Japanese Kana)"),
-		  build_msg_string ("JISX0201.1976 Japanese Kana"),
-		  vector1(build_string ("jisx0201.1976-0")), 0, 0);
+		  build_ascstring ("JISX0201 Kana"),
+		  build_defer_string ("JISX0201.1976 (Japanese Kana)"),
+		  build_defer_string ("JISX0201.1976 Japanese Kana"),
+		  vector1(build_ascstring ("jisx0201.1976-0")), 0, 0);
   staticpro (&Vcharset_latin_jisx0201);
   Vcharset_latin_jisx0201 =
     make_charset (LEADING_BYTE_LATIN_JISX0201, Qlatin_jisx0201, 2,
 		  CHARSET_TYPE_94, 1, 0, 'J',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("JISX0201 Roman"),
-		  build_msg_string ("JISX0201.1976 (Japanese Roman)"),
-		  build_msg_string ("JISX0201.1976 Japanese Roman"),
-		  vector1(build_string ("jisx0201.1976-0")), 0, 0);
+		  build_ascstring ("JISX0201 Roman"),
+		  build_defer_string ("JISX0201.1976 (Japanese Roman)"),
+		  build_defer_string ("JISX0201.1976 Japanese Roman"),
+		  vector1(build_ascstring ("jisx0201.1976-0")), 0, 0);
   staticpro (&Vcharset_cyrillic_iso8859_5);
   Vcharset_cyrillic_iso8859_5 =
     make_charset (LEADING_BYTE_CYRILLIC_ISO8859_5, Qcyrillic_iso8859_5, 2,
 		  CHARSET_TYPE_96, 1, 1, 'L',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("ISO8859-5"),
-		  build_msg_string ("ISO8859-5 (Cyrillic)"),
-		  build_msg_string ("ISO8859-5 (Cyrillic)"),
-		  vector1(build_string ("iso8859-5")), 0, 0);
+		  build_ascstring ("ISO8859-5"),
+		  build_defer_string ("ISO8859-5 (Cyrillic)"),
+		  build_defer_string ("ISO8859-5 (Cyrillic)"),
+		  vector1(build_ascstring ("iso8859-5")), 0, 0);
   staticpro (&Vcharset_latin_iso8859_9);
   Vcharset_latin_iso8859_9 =
     make_charset (LEADING_BYTE_LATIN_ISO8859_9, Qlatin_iso8859_9, 2,
 		  CHARSET_TYPE_96, 1, 1, 'M',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-5"),
-		  build_msg_string ("ISO8859-9 (Latin-5)"),
-		  build_msg_string ("ISO8859-9 (Latin-5)"),
-		  vector1(build_string ("iso8859-9")), 0, 0);
+		  build_ascstring ("Latin-5"),
+		  build_defer_string ("ISO8859-9 (Latin-5)"),
+		  build_defer_string ("ISO8859-9 (Latin-5)"),
+		  vector1(build_ascstring ("iso8859-9")), 0, 0);
   staticpro (&Vcharset_latin_iso8859_15);
   Vcharset_latin_iso8859_15 =
     make_charset (LEADING_BYTE_LATIN_ISO8859_15, Qlatin_iso8859_15, 2,
 		  CHARSET_TYPE_96, 1, 1, 'b',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Latin-9"),
-		  build_msg_string ("ISO8859-15 (Latin-9)"),
-		  build_msg_string ("ISO8859-15 (Latin-9)"),
-		  vector1(build_string ("iso8859-15")), 0, 0);
+		  build_ascstring ("Latin-9"),
+		  build_defer_string ("ISO8859-15 (Latin-9)"),
+		  build_defer_string ("ISO8859-15 (Latin-9)"),
+		  vector1(build_ascstring ("iso8859-15")), 0, 0);
   staticpro (&Vcharset_japanese_jisx0208_1978);
   Vcharset_japanese_jisx0208_1978 =
     make_charset (LEADING_BYTE_JAPANESE_JISX0208_1978, Qjapanese_jisx0208_1978, 3,
 		  CHARSET_TYPE_94X94, 2, 0, '@',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("JISX0208.1978"),
-		  build_msg_string ("JISX0208.1978 (Japanese)"),
-		  build_msg_string
+		  build_ascstring ("JISX0208.1978"),
+		  build_defer_string ("JISX0208.1978 (Japanese)"),
+		  build_defer_string
 		  ("JISX0208.1978 Japanese Kanji (so called \"old JIS\")"),
-		  vector2(build_string("jisx0208.1978-0"),
-			  build_string("jisc6226.1978-0")), 0, 0);
+		  vector2(build_ascstring("jisx0208.1978-0"),
+			  build_ascstring("jisc6226.1978-0")), 0, 0);
   staticpro (&Vcharset_chinese_gb2312);
   Vcharset_chinese_gb2312 =
     make_charset (LEADING_BYTE_CHINESE_GB2312, Qchinese_gb2312, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'A',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("GB2312"),
-		  build_msg_string ("GB2312)"),
-		  build_msg_string ("GB2312 Chinese simplified"),
-		  vector2(build_string("gb2312.1980-0"), 
-			  build_string("gb2312.80&gb8565.88-0")), 0, 0);
+		  build_ascstring ("GB2312"),
+		  build_defer_string ("GB2312)"),
+		  build_defer_string ("GB2312 Chinese simplified"),
+		  vector2(build_ascstring("gb2312.1980-0"), 
+			  build_ascstring("gb2312.80&gb8565.88-0")), 0, 0);
   staticpro (&Vcharset_japanese_jisx0208);
   Vcharset_japanese_jisx0208 =
     make_charset (LEADING_BYTE_JAPANESE_JISX0208, Qjapanese_jisx0208, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'B',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("JISX0208"),
-		  build_msg_string ("JISX0208.1983/1990 (Japanese)"),
-		  build_msg_string ("JISX0208.1983/1990 Japanese Kanji"),
-		  vector2(build_string("jisx0208.1983-0"),
-			  build_string("jisx0208.1990-0")), 0, 0);
+		  build_ascstring ("JISX0208"),
+		  build_defer_string ("JISX0208.1983/1990 (Japanese)"),
+		  build_defer_string ("JISX0208.1983/1990 Japanese Kanji"),
+		  vector2(build_ascstring("jisx0208.1983-0"),
+			  build_ascstring("jisx0208.1990-0")), 0, 0);
   staticpro (&Vcharset_korean_ksc5601);
   Vcharset_korean_ksc5601 =
     make_charset (LEADING_BYTE_KOREAN_KSC5601, Qkorean_ksc5601, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'C',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("KSC5601"),
-		  build_msg_string ("KSC5601 (Korean"),
-		  build_msg_string ("KSC5601 Korean Hangul and Hanja"),
-		  vector1(build_string("ksc5601.1987-0")), 0, 0);
+		  build_ascstring ("KSC5601"),
+		  build_defer_string ("KSC5601 (Korean"),
+		  build_defer_string ("KSC5601 Korean Hangul and Hanja"),
+		  vector1(build_ascstring("ksc5601.1987-0")), 0, 0);
   staticpro (&Vcharset_japanese_jisx0212);
   Vcharset_japanese_jisx0212 =
     make_charset (LEADING_BYTE_JAPANESE_JISX0212, Qjapanese_jisx0212, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'D',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("JISX0212"),
-		  build_msg_string ("JISX0212 (Japanese)"),
-		  build_msg_string ("JISX0212 Japanese Supplement"),
-		  vector1(build_string("jisx0212.1990-0")), 0, 0);
+		  build_ascstring ("JISX0212"),
+		  build_defer_string ("JISX0212 (Japanese)"),
+		  build_defer_string ("JISX0212 Japanese Supplement"),
+		  vector1(build_ascstring("jisx0212.1990-0")), 0, 0);
 
 #define CHINESE_CNS_PLANE(n) "cns11643.1992-" n
   staticpro (&Vcharset_chinese_cns11643_1);
@@ -1335,41 +1345,41 @@
     make_charset (LEADING_BYTE_CHINESE_CNS11643_1, Qchinese_cns11643_1, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'G',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("CNS11643-1"),
-		  build_msg_string ("CNS11643-1 (Chinese traditional)"),
-		  build_msg_string
+		  build_ascstring ("CNS11643-1"),
+		  build_defer_string ("CNS11643-1 (Chinese traditional)"),
+		  build_defer_string
 		  ("CNS 11643 Plane 1 Chinese traditional"),
-		  vector1(build_string (CHINESE_CNS_PLANE("1"))), 0, 0);
+		  vector1(build_ascstring (CHINESE_CNS_PLANE("1"))), 0, 0);
   staticpro (&Vcharset_chinese_cns11643_2);
   Vcharset_chinese_cns11643_2 =
     make_charset (LEADING_BYTE_CHINESE_CNS11643_2, Qchinese_cns11643_2, 3,
 		  CHARSET_TYPE_94X94, 2, 0, 'H',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("CNS11643-2"),
-		  build_msg_string ("CNS11643-2 (Chinese traditional)"),
-		  build_msg_string
+		  build_ascstring ("CNS11643-2"),
+		  build_defer_string ("CNS11643-2 (Chinese traditional)"),
+		  build_defer_string
 		  ("CNS 11643 Plane 2 Chinese traditional"),
-		  vector1(build_string (CHINESE_CNS_PLANE("2"))), 0, 0);
+		  vector1(build_ascstring (CHINESE_CNS_PLANE("2"))), 0, 0);
   staticpro (&Vcharset_chinese_big5_1);
   Vcharset_chinese_big5_1 =
     make_charset (LEADING_BYTE_CHINESE_BIG5_1, Qchinese_big5_1, 3,
 		  CHARSET_TYPE_94X94, 2, 0, '0',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Big5"),
-		  build_msg_string ("Big5 (Level-1)"),
-		  build_msg_string
+		  build_ascstring ("Big5"),
+		  build_defer_string ("Big5 (Level-1)"),
+		  build_defer_string
 		  ("Big5 Level-1 Chinese traditional"),
-		  vector1(build_string ("big5.eten-0")), 0, 0);
+		  vector1(build_ascstring ("big5.eten-0")), 0, 0);
   staticpro (&Vcharset_chinese_big5_2);
   Vcharset_chinese_big5_2 =
     make_charset (LEADING_BYTE_CHINESE_BIG5_2, Qchinese_big5_2, 3,
 		  CHARSET_TYPE_94X94, 2, 0, '1',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Big5"),
-		  build_msg_string ("Big5 (Level-2)"),
-		  build_msg_string
+		  build_ascstring ("Big5"),
+		  build_defer_string ("Big5 (Level-2)"),
+		  build_defer_string
 		  ("Big5 Level-2 Chinese traditional"),
-		  vector1(build_string ("big5.eten-0")), 0, 0);
+		  vector1(build_ascstring ("big5.eten-0")), 0, 0);
 
 
 #ifdef ENABLE_COMPOSITE_CHARS
@@ -1381,10 +1391,10 @@
     make_charset (LEADING_BYTE_COMPOSITE, Qcomposite, 3,
 		  CHARSET_TYPE_96X96, 2, 0, 0,
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Composite"),
-		  build_msg_string ("Composite characters"),
-		  build_msg_string ("Composite characters"),
-		  vector1(build_string ("")), 0, 0);
+		  build_ascstring ("Composite"),
+		  build_defer_string ("Composite characters"),
+		  build_defer_string ("Composite characters"),
+		  vector1(build_ascstring ("")), 0, 0);
 #else
   /* We create a hack so that we have a way of storing ESC 0 and ESC 1
      sequences as "characters", so that they will be output correctly. */
@@ -1393,9 +1403,9 @@
     make_charset (LEADING_BYTE_COMPOSITE_REPLACEMENT, Qcomposite, 2,
 		  CHARSET_TYPE_96, 1, 1, '|',
 		  CHARSET_LEFT_TO_RIGHT,
-		  build_string ("Composite hack"),
-		  build_msg_string ("Composite characters hack"),
-		  build_msg_string ("Composite characters hack"),
-		  vector1(build_string ("")), 0, 0);
+		  build_ascstring ("Composite hack"),
+		  build_defer_string ("Composite characters hack"),
+		  build_defer_string ("Composite characters hack"),
+		  vector1(build_ascstring ("")), 0, 0);
 #endif /* ENABLE_COMPOSITE_CHARS */
 }
--- a/src/mule-coding.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/mule-coding.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1889,7 +1889,7 @@
 		  {
 		    Ibyte comstr[MAX_ICHAR_LEN];
 		    Bytecount len;
-		    Ichar emch = lookup_composite_char (Dynarr_atp (dst, 0),
+		    Ichar emch = lookup_composite_char (Dynarr_begin (dst),
 							 Dynarr_length (dst));
 		    dst = real_dst;
 		    len = set_itext_ichar (comstr, emch);
@@ -2928,16 +2928,16 @@
 {
   int i;
   
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
   for (i = 0; i < 4; i++)
     {
       Lisp_Object charset = coding_system_charset (cs, i);
       if (i > 0)
-	write_c_string (printcharfun, ", ");
+	write_ascstring (printcharfun, ", ");
       write_fmt_string (printcharfun, "g%d=", i);
       print_internal (CHARSETP (charset) ? XCHARSET_NAME (charset) : charset, printcharfun, 0);
       if (XCODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (cs, i))
-	write_c_string (printcharfun, "(force)");
+	write_ascstring (printcharfun, "(force)");
     }
 
 #define FROB(prop)					        \
@@ -2969,7 +2969,7 @@
       {
 	write_fmt_string_lisp (printcharfun, ", output-charset-conversion=%s", 1, val);
       }
-    write_c_string (printcharfun, ")");
+    write_ascstring (printcharfun, ")");
   }
 }
 
@@ -3247,7 +3247,7 @@
 {
   struct iso2022_detector *data = DETECTION_STATE_DATA (st, iso2022);
   if (data->iso)
-    xfree (data->iso, struct iso2022_coding_stream *);
+    xfree (data->iso);
 }
 
 
@@ -3740,7 +3740,7 @@
           XCODING_SYSTEM_FIXED_WIDTH_QUERY_SKIP_CHARS(codesys)), 
          XCODING_SYSTEM_FIXED_WIDTH_QUERY_SKIP_CHARS(codesys), 
          (flags & QUERY_METHOD_IGNORE_INVALID_SEQUENCES ?
-          build_string("") :
+          build_ascstring("") :
           XCODING_SYSTEM_FIXED_WIDTH_INVALID_SEQUENCES_SKIP_CHARS (codesys)),
          fastmap, (int)(sizeof (fastmap)));
 
@@ -3801,17 +3801,12 @@
 
               if (flags & QUERY_METHOD_ERRORP)
                 {
-                  DECLARE_EISTRING (error_details);
-
-                  eicpy_ascii (error_details, "Cannot encode ");
-                  eicat_lstr (error_details,
-                              make_string_from_buffer (buf, fail_range_start, 
-                                                       pos - fail_range_start));
-                  eicat_ascii (error_details, " using coding system");
-
-                  signal_error (Qtext_conversion_error, 
-                                (const CIbyte *)(eidata (error_details)),
-                                XCODING_SYSTEM_NAME (codesys));
+                  signal_error_2
+		    (Qtext_conversion_error,
+		     "Cannot encode using coding system",
+		     make_string_from_buffer (buf, fail_range_start,
+					      pos - fail_range_start),
+		     XCODING_SYSTEM_NAME (codesys));
                 }
 
               if (NILP (result))
--- a/src/mule-wnnfns.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/mule-wnnfns.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-/* -*- coding: iso-2022-jp -*-
+/* -*- coding: utf-8 -*-
    Copyright (C) 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
@@ -35,13 +35,13 @@
  *		login-name: STRING
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		jserver $B$H@\B3$7!"%5!<%P!<FbIt$K@5JQ49!?5UJQ49#2$D$N4D6-$r(B
- *		$B:n$k!#%(%i!<$N;~$O(B nil $B$rJV$9!#(B
+ *		jserver と接続し、サーバー内部に正変換/逆変換2つの環境を
+ *		作る。エラーの時は nil を返す。
  *
  *	   (wnn-server-close)
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		jserver $B$H$N@\B3$r@Z$k!#<-=q!"IQEY$O%;!<%V$5$l$J$$!#(B
+ *		jserver との接続を切る。辞書、頻度はセーブされない。
  *
  *	   (wnn-server-dict-add dict-file-name hindo-file-name priority
  *		dict-file-mode hindo-file-mode pw1 pw2)
@@ -53,79 +53,79 @@
  *		pw1: STRING or NIL
  *		pw2: STRING or NIL
  *		DESCRIPTION:
- *		$B<-=q%U%!%$%kL>!"IQEY%U%!%$%kL>!"M%@hEY!"<-=q%U%!%$%k%b!<%I(B
- *		$BIQEY%U%!%$%k%b!<%I$G;XDj$7$?<-=q$r%P%C%U%!$KDI2C$9$k!#(B
- *		pw1, pw2 $B$O<-=q%U%!%$%k!"IQEY%U%!%$%k$N%Q%9%o!<%I!#(B
+ *		辞書ファイル名、頻度ファイル名、優先度、辞書ファイルモード
+ *		頻度ファイルモードで指定した辞書をバッファに追加する。
+ *		pw1, pw2 は辞書ファイル、頻度ファイルのパスワード。
  *
  *	   (wnn-server-dict-delete dic-no)
  *		dic-no: INTEGER
- *		RETURNS: $B%(%i!<$N;~(B nil
- *		DESCRIPTION: dic-no $B$N<-=qHV9f$N<-=q$r!"%P%C%U%!$+$i(B
- *		$B:o=|$9$k!#(B
+ *		RETURNS: エラーの時 nil
+ *		DESCRIPTION: dic-no の辞書番号の辞書を、バッファから
+ *		削除する。
  *
  *	   (wnn-server-dict-list)
  *		RETURNS: ((dic-no1 file-name1 comment1 word-no1 nice1)
  *			  (dic-no2 file-name2 comment2 word-no2 nice2)...)
- *		DESCRIPTION: $B%P%C%U%!>e$N<-=q$N%j%9%H$rF@$k!#(B
+ *		DESCRIPTION: バッファ上の辞書のリストを得る。
  *
  *	   (wnn-server-dict-comment dic-no comment)
- *		RETURNS: $B%(%i!<$N;~(B nil
- *		DESCRIPTION: dic-no $B$N<-=q$K%3%a%s%H$r$D$1$k!#(B
+ *		RETURNS: エラーの時 nil
+ *		DESCRIPTION: dic-no の辞書にコメントをつける。
  *
  *	   (wnn-server-set-rev rev)
  *		rev: BOOLEAN
- *		rev $B$,(B nil $B$N;~$O@5JQ49!"$=$l0J30$N;~$O5UJQ49(B
+ *		rev が nil の時は正変換、それ以外の時は逆変換
  *
  *	   (wnn-server-henkan-begin henkan-string)
  *		henkan-string: STRING
  *		RETURNS: bunsetu-suu
  *		DESCRIPTION:
- *		$B2>L>4A;zJQ49$r$7!"Bh0l8uJd$NJ8@a?t$rJV$9!#(B
+ *		仮名漢字変換をし、第一候補の文節数を返す。
  *
  *	   (wnn-server-zenkouho bunsetu-no dai)
  *		bunsetu-no: INTEGER
  *		dai: BOOLEAN
  *		RETURNS: offset
  *		DESCRIPTION:
- *		$BJ8@aHV9f$G;XDj$5$l$?J8@a$NA48uJd$r$H$j$@$7(B
- *		$B!"8=:_$N%*%U%;%C%H$rJV$9!#(B
+ *		文節番号で指定された文節の全候補をとりだし
+ *		、現在のオフセットを返す。
  *
  *	   (wnn-server-get-zenkouho offset)
  *		bunsetu-no: INTEGER
  *		dai: BOOLEAN
  *		RETURNS: list of zenkouho
  *		DESCRIPTION:
- *		$B%*%U%;%C%H$G;XDj$5$l$?8uJd$rF@$k!#(B
+ *		オフセットで指定された候補を得る。
  *
  *	   (wnn-server-zenkouho-bun)
  *		RETURNS: INTEGER
  *		DESCRIPTION:
- *		$BA48uJd$rI=<($7$F$$$kJ8@aHV9f$rF@$k!#(B
+ *		全候補を表示している文節番号を得る。
  *
  *	   (wnn-server-zenkouho-suu)
  *		RETURNS: INTEGER
  *		DESCRIPTION:
- *		$BA48uJd$rI=<($7$F$$$kJ8@a$NA48uJd?t$rF@$k!#(B
+ *		全候補を表示している文節の全候補数を得る。
  *
  *	   (wnn-server-dai-top bun-no)
  *		bun-no: INTEGER
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$BJ8@a$,BgJ8@a$N@hF,$J$i(B t
+ *		文節が大文節の先頭なら t
  *
  *	   (wnn-server-dai-end bun-no)
  *		bun-no: INTEGER
  *		RETURNS: INTEGER
  *		DESCRIPTION:
- *		$B<!$NBgJ8@a$NJ8@aHV9f$rF@$k!#(B
+ *		次の大文節の文節番号を得る。
  *
  *	   (wnn-server-henkan-kakutei kouho-no dai)
  *		kouho-no: INTEGER
  *		dai: BOOLEAN
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$B8uJdHV9f$G<($5$l$?8uJd$rA*Br$9$k!#(B
- *		(wnn-server-zenkouho) $B$r8F$s$F$+$i$G$J$$$H$$$1$J$$!#(B
+ *		候補番号で示された候補を選択する。
+ *		(wnn-server-zenkouho) を呼んてからでないといけない。
  *
  *	   (wnn-server-bunsetu-henkou bunsetu-no bunsetu-length dai)
  *		bunsetu-no: INTEGER
@@ -133,19 +133,19 @@
  *		dai: BOOLEAN
  *		RETURNS:
  *		DESCRIPTION:
- *		$BJ8@a$ND9$5$rJQ99$9$k!#(B
+ *		文節の長さを変更する。
  *
  *         (wnn-bunsetu-kouho-inspect bunsetu-no)
  *              bunsetu-no: INTEGER
  *              RETURNS: (kanji yomi jisho-no serial-no hinsi hindo
  *		ima hyoka daihyoka kangovect)
  *		DESCRIPTION:
- *		$BJ8@a$N?'!9$J>pJs$rJQ49%P%C%U%!$+$i$H$j=P$9!#(B
+ *		文節の色々な情報を変換バッファからとり出す。
  *
  *	   (wnn-server-henkan-quit)
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$B2?$b$7$J$$!#(B
+ *		何もしない。
  *
  *	   (wnn-server-bunsetu-kanji bun-no)
  *		RETURNS: (bunsetu-kanji length)
@@ -163,7 +163,7 @@
  *              bunsetu-no: INTEGER
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$BIQEY>pJs$r99?7$9$k!#(B
+ *		頻度情報を更新する。
  *
  *	   (wnn-server-word-add dic-no tango yomi comment hinsi)
  *		dic-no: INTEGER
@@ -173,28 +173,28 @@
  *		hinsi: INTEGER
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$B<-=q$KC18l$rEPO?$9$k!#(B
+ *		辞書に単語を登録する。
  *
  *	   (wnn-server-word-delete dic-no entry)
  *		dic-no: INTEGER
  *		entry: INTEGER
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$r:o=|$9$k!#(B
+ *		辞書からエントリ番号で示される単語を削除する。
  *
  *	   (wnn-server-word-use dic-no entry)
  *		dic-no: INTEGER
  *		entry: INTEGER
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NM-8z!?L58z$r%H%0%k$9$k!#(B
+ *		辞書からエントリ番号で示される単語の有効/無効をトグルする。
   *
  *	   (wnn-server-word-info dic-no entry)
  *		dic-no: INTEGER
  *		entry: INTEGER
  *		RETURNS: (yomi kanji comment hindo hinsi)
  *		DESCRIPTION:
- *		$B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$N>pJs$rF@$k!#(B
+ *		辞書からエントリ番号で示される単語の情報を得る。
  *
  *	   (wnn-server-word-hindo-set dic-no entry hindo)
  *		dic-no: INTEGER
@@ -202,61 +202,61 @@
  *		hindo: INTEGER
  *		RETURNS: BOOLEAN
  *		DESCRIPTION:
- *		$B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NIQEY$r@_Dj$9$k!#(B
+ *		辞書からエントリ番号で示される単語の頻度を設定する。
  *
  *	   (wnn-server-word-search yomi)
  *		yomi: STRING
  *		RETURNS: a LIST of dict-joho
  *		DESCRIPTION:
- *		$BA4$F$N<-=q$+$iC18l8!:w$r9T$J$&!#(B
+ *		全ての辞書から単語検索を行なう。
  *
  *         (wnn-server-dict-save)
  *              RETURNS: BOOLEAN
  *              DESCRIPTION:
- *		$BA4$F$N<-=q$HIQEY%U%!%$%k$r%;!<%V$9$k!#(B
+ *		全ての辞書と頻度ファイルをセーブする。
  *
  *	   (wnn-server-get-param)
  *		RETURNS: (n nsho p1 p2 p3 ... p15)
- *		DESCRIPTION: $BJQ49%Q%i%a!<%?$rF@$k!#(B
+ *		DESCRIPTION: 変換パラメータを得る。
  *
  *	   (wnn-server-set-param n sho p1 ... p15)
- *		RETURNS: $B%(%i!<$N;~(B nil
- *		DESCRIPTION: $BJQ49%Q%i%a!<%?$r@_Dj$9$k!#(B
+ *		RETURNS: エラーの時 nil
+ *		DESCRIPTION: 変換パラメータを設定する。
  *
  *	   (wnn-server-get-msg error-no)
- *		RETURNS: $B%(%i!<%a225;!<%8(B
- *		DESCRIPTION: $B%(%i!<HV9f$+$i%a%C%;!<%8$rF@$k!#(B
+ *		RETURNS: エラーメ臆技ージ
+ *		DESCRIPTION: エラー番号からメッセージを得る。
  *
  *	   (wnn-server-fuzokugo-set fname)
- *		RETURNS: $B%(%i!<$N;~(B nil
- *		DESCRIPTION: $B%P%C%U%!$KImB08l%U%!%$%k$rFI$_9~$`!#(B
+ *		RETURNS: エラーの時 nil
+ *		DESCRIPTION: バッファに附属語ファイルを読み込む。
  *
  *	   (wnn-server-fuzokugo-get)
- *		RETURNS: $B%U%!%$%kL>(B
- *		DESCRIPTION: $B%P%C%U%!$NImB08l%U%!%$%kL>$rF@$k!#(B
+ *		RETURNS: ファイル名
+ *		DESCRIPTION: バッファの附属語ファイル名を得る。
  *
  *	   (wnn-server-isconnect)
- *		RETURNS: $B%3%M%/%H$7$F$l$P(B t, $B$7$F$J$1$l$P(B nil
- *		DESCRIPTION: $B%5!<%P$H7Q$C$F$$$k$+D4$Y$k!#(B
+ *		RETURNS: コネクトしてれば t, してなければ nil
+ *		DESCRIPTION: サーバと継っているか調べる。
  *
  *	   (wnn-server-hinsi-dicts hinsi-no)
  *		RETURNS: (dic-no1 dic-no2 ...)
- *		DESCRIPTION: hinsi-no $B$NIJ;l$,EPO?$G$-$k<-=q$N%j%9%H$rF@$k!#(B
- *		hinsi-no = -1 $B$N$H$-$K$O!"EPO?2DG=$JA4<-=q$rF@$k!#(B
+ *		DESCRIPTION: hinsi-no の品詞が登録できる辞書のリストを得る。
+ *		hinsi-no = -1 のときには、登録可能な全辞書を得る。
  *
  *	   (wnn-server-hinsi-list dic-no name)
  *		RETURNS: (name1 name2 ... )
- *		DESCRIPTION: dic-no $B$N<-=q$G!"IJ;l%N!<%I$KB0$9$k(B
- *		$BIJ;l%N!<%I!JL>!K$N%j%9%H$rF@$k!#(B
- *		$BIJ;lL>$rM?$($?;~$O!"#0$rJV$9!#(B
+ *		DESCRIPTION: dic-no の辞書で、品詞ノードに属する
+ *		品詞ノード(名)のリストを得る。
+ *		品詞名を与えた時は、0を返す。
  *
  *	   (wnn-server-hinsi-name hinsi-no)
  *		RETURNS: hinsi-name
- *		DESCRIPTION: $BIJ;lHV9f$+$iL>A0$r<h$k!#(B
+ *		DESCRIPTION: 品詞番号から名前を取る。
  *
  *	   (wnn-server-hinsi-number hinsi-name)
  *		RETURNS: hinsi-no
- *		DESCRIPTION: $BIJ;lL>$rIJ;lHV9f$KJQ49$9$k!#(B
+ *		DESCRIPTION: 品詞名を品詞番号に変換する。
  *
  *         (wnn-server-version)
  *              RETURNS: version ID(int)
@@ -275,7 +275,7 @@
 #include "wnn/jllib.h"
 #include "wnn/cplib.h"
 
-/* UCHAR $B$,Fs=EDj5A$5$l$k$N$G(B */
+/* UCHAR が二重定義されるので */
 #define _UCHAR_T
 
 #define EGG_TIMEOUT 5
--- a/src/nas.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/nas.c	Wed Feb 24 01:58:04 2010 -0600
@@ -187,7 +187,7 @@
     {
       EMACS_SIGNAL (SIGPIPE, old_sigpipe);
       start_interrupts ();
-      return "error in NAS";
+      return (Extbyte *) "error in NAS";
     }
 #endif
 
@@ -205,7 +205,7 @@
       EMACS_SIGNAL (SIGPIPE, old_sigpipe);
 #endif
       if (err_message == NULL)
-	return "Can't connect to audio server";
+	return (Extbyte *) "Can't connect to audio server";
       else
 	return err_message;
     }
--- a/src/nt.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/nt.c	Wed Feb 24 01:58:04 2010 -0600
@@ -158,9 +158,9 @@
       && qxeLookupAccountSid (NULL, sidinfo.User.Sid, name, &length,
 			      domain, &dlength, &user_type))
     {
-      TSTR_TO_C_STRING_MALLOC (name, the_passwd.pw_name);
+      the_passwd.pw_name = (CIbyte *) TSTR_TO_ITEXT_MALLOC (name);
       /* Determine a reasonable uid value. */
-      if (qxestrcasecmp ("administrator", the_passwd.pw_name) == 0)
+      if (qxestrcasecmp ((Ibyte *) the_passwd.pw_name, "administrator") == 0)
 	{
 	  the_passwd.pw_uid = 0;
 	  the_passwd.pw_gid = 0;
@@ -202,8 +202,9 @@
        are running under Windows 95), fallback to this. */
   else if (qxeGetUserName (name, &length))
     {
-      TSTR_TO_C_STRING_MALLOC (name, the_passwd.pw_name);
-      if (qxestrcasecmp ("administrator", the_passwd.pw_name) == 0)
+      the_passwd.pw_name = (CIbyte *) TSTR_TO_ITEXT_MALLOC (name);
+      if (qxestrcasecmp_ascii ((Ibyte *) the_passwd.pw_name,
+			       "administrator") == 0)
 	the_passwd.pw_uid = 0;
       else
 	the_passwd.pw_uid = 123;
@@ -223,7 +224,7 @@
   DWORD length = UNLEN + 1;
   Extbyte name[MAX_XETCHAR_SIZE * (UNLEN + 1)];
   if (qxeGetUserName (name, &length))
-    TSTR_TO_C_STRING_MALLOC (name, the_passwd.pw_name);
+    the_passwd.pw_name = (CIbyte *) TSTR_TO_ITEXT_MALLOC (name);
   else
     the_passwd.pw_name = "unknown";
 #endif
@@ -238,7 +239,7 @@
 #endif
 
   /* Set dir from environment variables. */
-  the_passwd.pw_dir = (char *) qxestrdup (get_home_directory ());
+  the_passwd.pw_dir = (CIbyte *) qxestrdup (get_home_directory ());
   /* We used to set pw_shell here, but the order is wrong (SHELL gets
      initted in process.c, called later in the init process) and pw_shell
      is not used anywhere. */
@@ -301,7 +302,7 @@
     {
       Ibyte *fileint;
 
-      TSTR_TO_C_STRING_MALLOC (find_data.cFileName, fileint);
+      fileint = TSTR_TO_ITEXT_MALLOC (find_data.cFileName);
       FindClose (dir_handle);
       return fileint;
     }
@@ -338,16 +339,16 @@
 	      *p++ = '\\';
 	      eicat_ch (o, '\\');
 	    }
-	  xfree (component, Ibyte *);
+	  xfree (component);
 	}
       else
 	{
-	  xfree (full, Ibyte *);
+	  xfree (full);
 	  return 0;
 	}
     }
 
-  xfree (full, Ibyte *);
+  xfree (full);
   return eicpyout_malloc (o, 0);
 }
 
@@ -377,7 +378,7 @@
   DWORD cbData;
   Extbyte *keyext;
 
-  C_STRING_TO_TSTR (key, keyext);
+  keyext = ITEXT_TO_TSTR (key);
   
   /* Check both the current user and the local machine to see if 
      we have any resources.  */
@@ -395,7 +396,7 @@
 	return (lpvalue);
 
       if (lpvalue)
-	xfree (lpvalue, LPBYTE);
+	xfree (lpvalue);
 	
       RegCloseKey (hrootkey);
     } 
@@ -413,7 +414,7 @@
 	return (lpvalue);
 	
       if (lpvalue)
-	xfree (lpvalue, LPBYTE);
+	xfree (lpvalue);
 	
       RegCloseKey (hrootkey);
     } 
@@ -488,18 +489,18 @@
 		cch = qxeExpandEnvironmentStrings ((Extbyte *) lpval, buf, 0);
 		buf = alloca_extbytes (cch * XETCHAR_SIZE);
 		qxeExpandEnvironmentStrings ((Extbyte *) lpval, buf, cch);
-		TSTR_TO_C_STRING (buf, envval);
+		envval = TSTR_TO_ITEXT (buf);
 		eputenv (env_vars[i], (CIbyte *) envval);
 	      }
 	    else if (dwType == REG_SZ)
 	      {
 		Ibyte *envval;
 
-		TSTR_TO_C_STRING (lpval, envval);
+		envval = TSTR_TO_ITEXT (lpval);
 		eputenv (env_vars[i], (CIbyte *) envval);
 	      }
 
-	    xfree (lpval, LPBYTE);
+	    xfree (lpval);
 	  }
       }
   }
@@ -635,7 +636,7 @@
       rootext = alloca_extbytes (nchars * XETCHAR_SIZE);
       if (!qxeGetCurrentDirectory (nchars, rootext))
 	return NULL;
-      TSTR_TO_C_STRING (rootext, default_root);
+      default_root = TSTR_TO_ITEXT (rootext);
       parse_root (default_root, &root_dir);
       *root_dir = 0;
       root_dir = default_root;
@@ -705,15 +706,15 @@
 	}
       else
 	{
-	  xfree (info->name, Ibyte *);
-	  xfree (info->type, Ibyte *);
+	  xfree (info->name);
+	  xfree (info->type);
 	}
 
-      TSTR_TO_C_STRING_MALLOC (name, info->name);
+      info->name = TSTR_TO_ITEXT_MALLOC (name);
       info->serialnum = serialnum;
       info->maxcomp = maxcomp;
       info->flags = flags;
-      TSTR_TO_C_STRING_MALLOC (type, info->type);
+      info->type = TSTR_TO_ITEXT_MALLOC (type);
       info->timestamp = GetTickCount ();
     }
 
@@ -828,7 +829,7 @@
     return NULL;
 
   if (dir_pathname)
-    xfree (dir_pathname, Ibyte *);
+    xfree (dir_pathname);
   dir_pathname = qxestrdup (filename);
 
   return dirp;
@@ -850,7 +851,7 @@
       retval = close_unc_volume (wnet_enum_handle);
       wnet_enum_handle = INVALID_HANDLE_VALUE;
     }
-  xfree (dirp, DIR *);
+  xfree (dirp);
 
   return retval;
 }
@@ -885,13 +886,13 @@
 
       if (dir_find_handle == INVALID_HANDLE_VALUE)
 	return NULL;
-      TSTR_TO_C_STRING (dir_find_data.cFileName, val);
+      val = TSTR_TO_ITEXT (dir_find_data.cFileName);
     }
   else
     {
       if (!qxeFindNextFile (dir_find_handle, &dir_find_data))
 	return NULL;
-      TSTR_TO_C_STRING (dir_find_data.cFileName, val);
+      val = TSTR_TO_ITEXT (dir_find_data.cFileName);
     }
   
   /* XEmacs never uses this value, so don't bother making it match
@@ -925,7 +926,7 @@
 	    resolved = mswindows_read_link (eidata (linkname));
 	    if (resolved)
 	      {
-		xfree (resolved, Ibyte *);
+		xfree (resolved);
 		len -= 4;
 		val[len] = '\0';
 	      }
@@ -934,13 +935,13 @@
 
     eicpy_rawz (found, val);
     if (need_to_free)
-      xfree (val, Ibyte *);
+      xfree (val);
 
     if (!NILP (Vmswindows_downcase_file_names))
       eilwr (found);
 
     namlen = min (eilen (found), sizeof (dir_static.d_name) - 1);
-    strncpy (dir_static.d_name, (char *) eidata (found), namlen);
+    qxestrncpy ((Ibyte *) dir_static.d_name, eidata (found), namlen);
     dir_static.d_name[namlen] = '\0';
     dir_static.d_namlen = (unsigned short) namlen;
   }
@@ -954,13 +955,15 @@
   NETRESOURCEW nr; 
   HANDLE henum;
   int result;
+  Extbyte *extpath;
 
   nr.dwScope = RESOURCE_GLOBALNET; 
   nr.dwType = RESOURCETYPE_DISK; 
   nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; 
   nr.dwUsage = RESOURCEUSAGE_CONTAINER; 
   nr.lpLocalName = NULL;
-  PATHNAME_CONVERT_OUT (path, nr.lpRemoteName);
+  PATHNAME_CONVERT_OUT (path, extpath);
+  nr.lpRemoteName = (XELPTSTR) extpath;
   nr.lpComment = NULL; 
   nr.lpProvider = NULL;   
 
@@ -998,7 +1001,7 @@
     return NULL;
 
   /* WNetEnumResource returns \\resource\share...skip forward to "share". */
-  TSTR_TO_C_STRING (((LPNETRESOURCEW) buf)->lpRemoteName, ptr);
+  ptr = TSTR_TO_ITEXT (((LPNETRESOURCEW) buf)->lpRemoteName);
   INC_IBYTEPTR (ptr);
   INC_IBYTEPTR (ptr);
   while (*ptr && !IS_DIRECTORY_SEP (itext_ichar (ptr)))
@@ -1564,7 +1567,7 @@
 	qxestrcat (name, (Ibyte *) "\\");
       /* File has already been resolved and we don't want to do it again
 	 in case of lstat() */
-      C_STRING_TO_TSTR (name, nameext);
+      nameext = ITEXT_TO_TSTR (name);
       if (qxeGetDriveType (nameext) < 2)
 	{
 	  SetErrorMode (errm);
@@ -1605,7 +1608,7 @@
 	}
       else
 	{
-	  C_STRING_TO_TSTR (name, nameext);
+	  nameext = ITEXT_TO_TSTR (name);
 	  fh = qxeFindFirstFile (nameext, &wfd);
 	  if (fh == INVALID_HANDLE_VALUE)
 	    {
@@ -1630,7 +1633,7 @@
       if (!NILP (Vmswindows_get_true_file_attributes))
 	/* File has already been resolved and we don't want to do it again
 	   in case of lstat() */
-	C_STRING_TO_TSTR (name, nameext);
+	nameext = ITEXT_TO_TSTR (name);
       if (!NILP (Vmswindows_get_true_file_attributes)
 	  /* No access rights required to get info.  */
 	  && (fh = qxeCreateFile (nameext, 0, 0, NULL, OPEN_EXISTING, 0, NULL))
@@ -1690,7 +1693,7 @@
 	      Ibyte *resolved = mswindows_read_link (name);
 	      if (resolved)
 		{
-		  xfree (resolved, Ibyte *);
+		  xfree (resolved);
 		  buf->st_mode = S_IFLNK;
 		}
 	    }
@@ -1841,8 +1844,8 @@
   else
     cwdext = _getdcwd (drivelet, NULL, 0);
   if (cwdext == NULL) return NULL;
-  TSTR_TO_C_STRING_MALLOC (cwdext, cwd);
-  xfree (cwdext, Extbyte *);
+  cwd = TSTR_TO_ITEXT_MALLOC (cwdext);
+  xfree (cwdext);
   return cwd;
 }
 
@@ -2002,7 +2005,7 @@
       if (exe_header->e_magic != DOSMAGIC)
 	goto unwind;
 
-      if ((char *) exe_header->e_lfanew > (char *) executable.size)
+      if ((Rawbyte *) exe_header->e_lfanew > (Rawbyte *) executable.size)
 	{
 	  /* Some dos headers (pkunzip) have bogus e_lfanew fields.  */
 	  *is_dos_app = TRUE;
@@ -2019,10 +2022,10 @@
       if (dos_header->e_magic != IMAGE_DOS_SIGNATURE)
 	goto unwind;
 	  
-      nt_header = (PIMAGE_NT_HEADERS) ((char *) dos_header +
+      nt_header = (PIMAGE_NT_HEADERS) ((Rawbyte *) dos_header +
 				       dos_header->e_lfanew);
 	  
-      if ((char *) nt_header > (char *) dos_header + executable.size) 
+      if ((Rawbyte *) nt_header > (Rawbyte *) dos_header + executable.size) 
 	{
 	  /* Some dos headers (pkunzip) have bogus e_lfanew fields.  */
 	  *is_dos_app = TRUE;
@@ -2052,7 +2055,7 @@
 		(Extbyte *) RVA_TO_PTR (imports->Name, section, executable);
 	      Ibyte *dllname;
 
-	      EXTERNAL_TO_C_STRING (dllname_ext, dllname, Qbinary);
+	      dllname = EXTERNAL_TO_ITEXT (dllname_ext, Qbinary);
 
 	      /* The exact name of the cygwin dll has changed with
 		 various releases, but hopefully this will be reasonably
@@ -2091,7 +2094,7 @@
 */
        (filename))
 {
-  Extbyte shortname[PATH_MAX_EXTERNAL];
+  Extbyte shortname[PATH_MAX_TCHAR];
   Extbyte *fileext;
   Ibyte *shortint;
 
@@ -2106,10 +2109,10 @@
 			   sizeof (shortname) / XETCHAR_SIZE) == 0)
     return Qnil;
 
-  TSTR_TO_C_STRING (shortname, shortint);
+  shortint = TSTR_TO_ITEXT (shortname);
   MSWINDOWS_NORMALIZE_FILENAME (shortint);
 
-  return build_intstring (shortint);
+  return build_istring (shortint);
 }
 
 
@@ -2132,9 +2135,9 @@
     return Qnil;
 
   canon = mswindows_canonicalize_filename (longname);
-  ret = build_intstring (canon);
-  xfree (canon, Ibyte *);
-  xfree (longname, Ibyte *);
+  ret = build_istring (canon);
+  xfree (canon);
+  xfree (longname);
   return ret;
 }
 
--- a/src/ntplay.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/ntplay.c	Wed Feb 24 01:58:04 2010 -0600
@@ -41,7 +41,7 @@
   Lisp_Object fname = Ffile_name_nondirectory (path);
   Extbyte *fnameext;
 
-  LISP_STRING_TO_TSTR (fname, fnameext);
+  fnameext = LISP_STRING_TO_TSTR (fname);
 
   if (qxeSearchPath (NULL, fnameext, NULL, 0, NULL, NULL) == 0)
     {
@@ -66,7 +66,7 @@
       if (retry_read (ofd, data, size) != size)
 	{
 	  retry_close (ofd);
-	  xfree (data, Binbyte *);
+	  xfree (data);
 	  return;
 	}
       retry_close (ofd);
@@ -88,7 +88,7 @@
   if (sound_data)
     {
       qxePlaySound (NULL, NULL, flags);
-      xfree (sound_data, Binbyte *);
+      xfree (sound_data);
       sound_data = 0;
     }
 
--- a/src/number-gmp.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/number-gmp.c	Wed Feb 24 01:58:04 2010 -0600
@@ -15,8 +15,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
@@ -76,18 +76,20 @@
 	 point, format identifier, and exponent */
       /* GMP's idea of the exponent is 1 greater than scientific notation's */
       expt--;
-      const int point = (len == neg + 2) ? 0 : 1;
-      const int exponent = (expt < 0)
-	? (int)(log ((double) (-expt)) / log ((double) base)) + 3
-	: (int)(log ((double) expt) / log ((double) base)) + 2;
-      const int space = point + exponent;
-      XREALLOC_ARRAY (str, CIbyte, len + space);
-      if (point > 0)
-	{
-	  memmove (&str[neg + 2], &str[neg + 1], len - neg);
-	  str[neg + 1] = '.';
-	}
-      sprintf (&str[len + point - 1], "E%ld", expt);
+      {
+	const int point = (len == neg + 2) ? 0 : 1;
+	const int exponent = (expt < 0)
+	  ? (int)(log ((double) (-expt)) / log ((double) base)) + 3
+	  : (int)(log ((double) expt) / log ((double) base)) + 2;
+	const int space = point + exponent;
+	XREALLOC_ARRAY (str, CIbyte, len + space);
+	if (point > 0)
+	  {
+	    memmove (&str[neg + 2], &str[neg + 1], len - neg);
+	    str[neg + 1] = '.';
+	  }
+	sprintf (&str[len + point - 1], "E%ld", expt);
+      }
     }
   return str;
 }
@@ -101,7 +103,7 @@
 
 static void gmp_free (void *ptr, size_t UNUSED (size))
 {
-  xfree (ptr, void *);
+  xfree (ptr);
 }
 
 void
--- a/src/number-gmp.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/number-gmp.h	Wed Feb 24 01:58:04 2010 -0600
@@ -15,8 +15,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
--- a/src/number-mp.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/number-mp.c	Wed Feb 24 01:58:04 2010 -0600
@@ -15,8 +15,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
@@ -87,7 +87,7 @@
   for (; i < bufsize - 1; i++)
     retval[i] = buffer[--index];
   retval[bufsize - 1] = '\0';
-  xfree (buffer, char *);
+  xfree (buffer);
   return retval;
 }
 
@@ -221,7 +221,7 @@
 
   mbase = MP_ITOM ((short) base);
   MP_MOVE (bignum_zero, b);
-  
+
   for (digit = char_to_number (*s); digit >= 0 && digit < base;
        digit = char_to_number (*++s))
     {
--- a/src/number-mp.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/number-mp.h	Wed Feb 24 01:58:04 2010 -0600
@@ -15,8 +15,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
--- a/src/number.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/number.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,6 @@
 /* Numeric types for XEmacs.
    Copyright (C) 2004 Jerry James.
+   Copyright (C) 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -15,8 +16,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
@@ -32,7 +33,7 @@
 
 Lisp_Object Qrationalp, Qfloatingp, Qrealp;
 Lisp_Object Vdefault_float_precision;
-Fixnum Vmost_negative_fixnum, Vmost_positive_fixnum;
+
 static Lisp_Object Qunsupported_type;
 static Lisp_Object Vbigfloat_max_prec;
 static int number_initialized;
@@ -53,13 +54,30 @@
 bignum_print (Lisp_Object obj, Lisp_Object printcharfun,
 	      int UNUSED (escapeflag))
 {
-  CIbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10);
-  write_c_string (printcharfun, bstr);
-  xfree (bstr, CIbyte *);
+  Ascbyte *bstr = bignum_to_string (XBIGNUM_DATA (obj), 10);
+  write_ascstring (printcharfun, bstr);
+  xfree (bstr);
 }
 
+#ifdef NEW_GC
+static void
+bignum_finalize (void *header)
+{
+  struct Lisp_Bignum *num = (struct Lisp_Bignum *) header;
+  /* #### WARNING: It would be better to put some sort of check to make
+     sure this doesn't happen more than once, just in case ---
+     e.g. checking if it's zero before finalizing and then setting it to
+     zero after finalizing. */
+  bignum_fini (num->data);
+}
+#define BIGNUM_FINALIZE bignum_finalize
+#else
+#define BIGNUM_FINALIZE 0
+#endif
+
 static int
-bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+bignum_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int UNUSED (foldcase))
 {
   return bignum_eql (XBIGNUM_DATA (obj1), XBIGNUM_DATA (obj2));
 }
@@ -82,7 +100,7 @@
 bignum_convfree (const void * UNUSED (object), void *data,
 		 Bytecount UNUSED (size))
 {
-  xfree (data, void *);
+  xfree (data);
 }
 
 static void *
@@ -107,8 +125,9 @@
 };
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("bignum", bignum, 0, bignum_print,
-					0, bignum_equal, bignum_hash,
-					bignum_description, Lisp_Bignum);
+					BIGNUM_FINALIZE, bignum_equal,
+					bignum_hash, bignum_description,
+					Lisp_Bignum);
 
 #endif /* HAVE_BIGNUM */
 
@@ -123,38 +142,6 @@
 }
 
 
-/********************************* Integers *********************************/
-DEFUN ("integerp", Fintegerp, 1, 1, 0, /*
-Return t if OBJECT is an integer, nil otherwise.
-*/
-       (object))
-{
-  return INTEGERP (object) ? Qt : Qnil;
-}
-
-DEFUN ("evenp", Fevenp, 1, 1, 0, /*
-Return t if INTEGER is even, nil otherwise.
-*/
-       (integer))
-{
-  CONCHECK_INTEGER (integer);
-  return (BIGNUMP (integer)
-	  ? bignum_evenp (XBIGNUM_DATA (integer))
-	  : XTYPE (integer) == Lisp_Type_Int_Even) ? Qt : Qnil;
-}
-
-DEFUN ("oddp", Foddp, 1, 1, 0, /*
-Return t if INTEGER is odd, nil otherwise.
-*/
-       (integer))
-{
-  CONCHECK_INTEGER (integer);
-  return (BIGNUMP (integer)
-	  ? bignum_oddp (XBIGNUM_DATA (integer))
-	  : XTYPE (integer) == Lisp_Type_Int_Odd) ? Qt : Qnil;
-}
-
-
 /********************************** Ratios **********************************/
 #ifdef HAVE_RATIO
 static void
@@ -162,12 +149,29 @@
 	     int UNUSED (escapeflag))
 {
   CIbyte *rstr = ratio_to_string (XRATIO_DATA (obj), 10);
-  write_c_string (printcharfun, rstr);
-  xfree (rstr, CIbyte *);
+  write_ascstring (printcharfun, rstr);
+  xfree (rstr);
 }
 
+#ifdef NEW_GC
+static void
+ratio_finalize (void *header)
+{
+  struct Lisp_Ratio *num = (struct Lisp_Ratio *) header;
+  /* #### WARNING: It would be better to put some sort of check to make
+     sure this doesn't happen more than once, just in case ---
+     e.g. checking if it's zero before finalizing and then setting it to
+     zero after finalizing. */
+  ratio_fini (num->data);
+}
+#define RATIO_FINALIZE ratio_finalize
+#else
+#define RATIO_FINALIZE 0
+#endif
+
 static int
-ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+ratio_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	     int UNUSED (foldcase))
 {
   return ratio_eql (XRATIO_DATA (obj1), XRATIO_DATA (obj2));
 }
@@ -184,7 +188,7 @@
 };
 
 DEFINE_NODUMP_FROB_BLOCK_LISP_OBJECT ("ratio", ratio, 0, ratio_print,
-				      0, ratio_equal, ratio_hash,
+				      RATIO_FINALIZE, ratio_equal, ratio_hash,
 				      ratio_description, Lisp_Ratio);
 
 #endif /* HAVE_RATIO */
@@ -217,12 +221,13 @@
 {
   CONCHECK_RATIONAL (rational);
 #ifdef HAVE_RATIO
-  return RATIOP (rational)
-    ? make_bignum_bg (XRATIO_NUMERATOR (rational))
-    : rational;
-#else
+  if (RATIOP (rational))
+    {
+      return
+	Fcanonicalize_number (make_bignum_bg (XRATIO_NUMERATOR (rational)));
+    }
+#endif
   return rational;
-#endif
 }
 
 DEFUN ("denominator", Fdenominator, 1, 1, 0, /*
@@ -233,12 +238,13 @@
 {
   CONCHECK_RATIONAL (rational);
 #ifdef HAVE_RATIO
-  return RATIOP (rational)
-    ? make_bignum_bg (XRATIO_DENOMINATOR (rational))
-    : make_int (1);
-#else
-  return rational;
+  if (RATIOP (rational))
+    {
+      return Fcanonicalize_number (make_bignum_bg
+				   (XRATIO_DENOMINATOR (rational)));
+    }
 #endif
+  return make_int (1);
 }
 
 
@@ -248,13 +254,30 @@
 bigfloat_print (Lisp_Object obj, Lisp_Object printcharfun,
 		int UNUSED (escapeflag))
 {
-  CIbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10);
-  write_c_string (printcharfun, fstr);
-  xfree (fstr, CIbyte *);
+  Ascbyte *fstr = bigfloat_to_string (XBIGFLOAT_DATA (obj), 10);
+  write_ascstring (printcharfun, fstr);
+  xfree (fstr);
 }
 
+#ifdef NEW_GC
+static void
+bigfloat_finalize (void *header)
+{
+  struct Lisp_Bigfloat *num = (struct Lisp_Bigfloat *) header;
+  /* #### WARNING: It would be better to put some sort of check to make
+     sure this doesn't happen more than once, just in case ---
+     e.g. checking if it's zero before finalizing and then setting it to
+     zero after finalizing. */
+  bigfloat_fini (num->bf);
+}
+#define BIGFLOAT_FINALIZE bigfloat_finalize
+#else
+#define BIGFLOAT_FINALIZE 0
+#endif
+
 static int
-bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+bigfloat_equal (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+		int UNUSED (foldcase))
 {
   return bigfloat_eql (XBIGFLOAT_DATA (obj1), XBIGFLOAT_DATA (obj2));
 }
@@ -271,7 +294,7 @@
 };
 
 DEFINE_DUMPABLE_FROB_BLOCK_LISP_OBJECT ("bigfloat", bigfloat, 0,
-					bigfloat_print, 0,
+					bigfloat_print, BIGFLOAT_FINALIZE,
 					bigfloat_equal, bigfloat_hash,
 					bigfloat_description, Lisp_Bigfloat);
 
@@ -345,7 +368,7 @@
 #ifdef HAVE_BIGFLOAT
   if (INTP (*val))
     prec = XINT (*val);
-  else 
+  else
     {
       if (!bignum_fits_ulong_p (XBIGNUM_DATA (*val)))
 	args_out_of_range_3 (*val, Qzero, Vbigfloat_max_prec);
@@ -405,7 +428,7 @@
   if (RATIOP (number) &&
       bignum_fits_long_p (XRATIO_DENOMINATOR (number)) &&
       bignum_to_long (XRATIO_DENOMINATOR (number)) == 1L)
-    number = make_bignum_bg (XRATIO_NUMERATOR (number));
+    number = Fcanonicalize_number (make_bignum_bg (XRATIO_NUMERATOR (number)));
 #endif
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (number) && bignum_fits_emacs_int_p (XBIGNUM_DATA (number)))
@@ -655,7 +678,7 @@
 				      0UL);
       return type2;
     }
-  
+
   if (type2 < type1)
     {
       *arg2 = internal_coerce_number (*arg2, type1,
@@ -762,9 +785,6 @@
 
   /* Functions */
   DEFSUBR (Fbignump);
-  DEFSUBR (Fintegerp);
-  DEFSUBR (Fevenp);
-  DEFSUBR (Foddp);
   DEFSUBR (Fratiop);
   DEFSUBR (Frationalp);
   DEFSUBR (Fnumerator);
@@ -800,26 +820,13 @@
 */);
 
 #ifdef HAVE_BIGFLOAT
-#ifdef HAVE_BIGNUM
-  Vbigfloat_max_prec = make_bignum (0L);
-  bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX);
-#else
+  /* Don't create a bignum here.  Otherwise, we lose with NEW_GC + pdump.
+     See reinit_vars_of_number(). */
   Vbigfloat_max_prec = make_int (EMACS_INT_MAX);
-#endif
 #else
   Vbigfloat_max_prec = make_int (0);
 #endif /* HAVE_BIGFLOAT */
 
-  DEFVAR_CONST_INT ("most-negative-fixnum", &Vmost_negative_fixnum /*
-The fixnum closest in value to negative infinity.
-*/);
-  Vmost_negative_fixnum = EMACS_INT_MIN;
-
-  DEFVAR_CONST_INT ("most-positive-fixnum", &Vmost_positive_fixnum /*
-The fixnum closest in value to positive infinity.
-*/);
-  Vmost_positive_fixnum = EMACS_INT_MAX;
-
   Fprovide (intern ("number-types"));
 #ifdef HAVE_BIGNUM
   Fprovide (intern ("bignum"));
@@ -833,6 +840,15 @@
 }
 
 void
+reinit_vars_of_number (void)
+{
+#if defined(HAVE_BIGFLOAT) && defined(HAVE_BIGNUM)
+  Vbigfloat_max_prec = make_bignum (0L);
+  bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX);
+#endif
+}
+
+void
 init_number (void)
 {
   if (!number_initialized)
@@ -860,5 +876,9 @@
       bigfloat_init (scratch_bigfloat);
       bigfloat_init (scratch_bigfloat2);
 #endif
+
+#ifndef PDUMP
+      reinit_vars_of_number ();
+#endif
     }
 }
--- a/src/number.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/number.h	Wed Feb 24 01:58:04 2010 -0600
@@ -15,8 +15,8 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
@@ -130,8 +130,7 @@
 
 
 /********************************* Integers *********************************/
-extern Lisp_Object Qintegerp;
-
+/* Qintegerp in lisp.h */
 #define INTEGERP(x) (INTP(x) || BIGNUMP(x))
 #define CHECK_INTEGER(x) do {			\
  if (!INTEGERP (x))				\
@@ -285,7 +284,7 @@
 EXFUN (Fbigfloatp, 1);
 
 /********************************* Floating *********************************/
-extern Lisp_Object Qfloatingp, Qbigfloat;
+extern Lisp_Object Qfloatingp;
 extern Lisp_Object Qread_default_float_format, Vread_default_float_format;
 
 #define FLOATINGP(x) (FLOATP (x) || BIGFLOATP (x))
@@ -319,8 +318,7 @@
 
 
 /********************************* Numbers **********************************/
-extern Lisp_Object Qnumberp;
-
+/* Qnumberp in lisp.h */
 #define NUMBERP(x) REALP (x)
 #define CHECK_NUMBER(x) do {			\
   if (!NUMBERP (x))				\
@@ -338,4 +336,35 @@
 extern enum number_type get_number_type (Lisp_Object);
 extern enum number_type promote_args (Lisp_Object *, Lisp_Object *);
 
+#ifdef WITH_NUMBER_TYPES
+DECLARE_INLINE_HEADER (
+int
+non_fixnum_number_p (Lisp_Object object))
+{
+  if (LRECORDP (object))
+    {
+      switch (XRECORD_LHEADER (object)->type)
+        {
+        case lrecord_type_float:
+#ifdef HAVE_BIGNUM
+        case lrecord_type_bignum:
+#endif
+#ifdef HAVE_RATIO
+        case lrecord_type_ratio:
+#endif
+#ifdef HAVE_BIGFLOAT
+        case lrecord_type_bigfloat:
+#endif
+          return 1;
+        }
+    }
+  return 0;
+}
+#define NON_FIXNUM_NUMBER_P(X) non_fixnum_number_p (X)
+
+#else
+#define NON_FIXNUM_NUMBER_P FLOATP
+#endif
+
+
 #endif /* INCLUDED_number_h_ */
--- a/src/objects-gtk-impl.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-gtk-impl.h	Wed Feb 24 01:58:04 2010 -0600
@@ -43,6 +43,7 @@
 
 #define GTK_COLOR_INSTANCE_DATA(c) ((struct gtk_color_instance_data *) (c)->data)
 #define COLOR_INSTANCE_GTK_COLOR(c) (GTK_COLOR_INSTANCE_DATA (c)->color)
+#define XCOLOR_INSTANCE_GTK_COLOR(c) COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (c))
 #define COLOR_INSTANCE_GTK_DEALLOC(c) (GTK_COLOR_INSTANCE_DATA (c)->dealloc_on_gc)
 
 /*****************************************************************************
@@ -57,6 +58,7 @@
 
 #define GTK_FONT_INSTANCE_DATA(f) ((struct gtk_font_instance_data *) (f)->data)
 #define FONT_INSTANCE_GTK_FONT(f) (GTK_FONT_INSTANCE_DATA (f)->font)
+#define XFONT_INSTANCE_GTK_FONT(c) FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (c))
 
 #endif /* HAVE_GTK */
 #endif /* _XEMACS_OBJECTS_GTK_IMPL_H_ */
--- a/src/objects-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -39,7 +39,7 @@
 #include "objects-gtk-impl.h"
 
 /* sigh */
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 
 /* XListFonts doesn't allocate memory unconditionally based on this. (For
    XFree86 in 2005, at least. */
@@ -168,7 +168,7 @@
 	    }
 	    gdk_color_free (COLOR_INSTANCE_GTK_COLOR (c));
 	}
-      xfree (c->data, void *);
+      xfree (c->data);
       c->data = 0;
     }
 }
@@ -208,7 +208,7 @@
   GdkColor c;
   const char *extname;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, color, C_STRING_ALLOCA, extname, Qctext);
+  extname = LISP_STRING_TO_EXTERNAL (color, Qctext);
 
   if (gdk_color_parse (extname, &c) != TRUE)
       return(0);
@@ -237,7 +237,7 @@
   XFontStruct *xf;
   const char *extname;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, extname, Qctext);
+  extname = LISP_STRING_TO_EXTERNAL (f->name, Qctext);
 
   gf = gdk_font_load (extname);
 
@@ -340,7 +340,7 @@
 	{
 	    gdk_font_unref (FONT_INSTANCE_GTK_FONT (f));
 	}
-      xfree (f->data, void *);
+      xfree (f->data);
       f->data = 0;
     }
 }
@@ -383,7 +383,7 @@
 {
   const char *patternext;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, pattern, C_STRING_ALLOCA, patternext, Qbinary);
+  patternext = LISP_STRING_TO_EXTERNAL (pattern, Qbinary);
 
   return (__gtk_font_list_internal (patternext));
 }
@@ -472,7 +472,7 @@
 	      if (!expandp)
 		{
 		  /* They want the wildcarded version */
-		  font_name = build_string ((char*) names->data);
+		  font_name = build_cistring ((char*) names->data);
 		}
 	      else
 		{
@@ -483,7 +483,7 @@
 		  x_font_names = XListFonts (dpy, (char*) names->data, 1, &nnames);
 		  if (x_font_names)
 		    {
-		      font_name = build_string (x_font_names[0]);
+		      font_name = build_cistring (x_font_names[0]);
 		      XFreeFontNames (x_font_names);
 		    }
 		}
@@ -503,7 +503,7 @@
 
   names = XListFonts (GDK_DISPLAY (), pattern, MAX_FONT_COUNT, &count);
   while (count--)
-    result = Fcons (build_ext_string (names [count], Qbinary), result);
+    result = Fcons (build_extstring (names [count], Qbinary), result);
   if (names)
     XFreeFontNames (names);
 
--- a/src/objects-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Tinker Systems.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005, 2010 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1997 Jonathan Harris.
 
@@ -27,8 +27,9 @@
 
 /* Authorship:
 
-   Jamie Zawinski, Chuck Thompson, Ben Wing
-   Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
+   This file created by Jonathan Harris, November 1997 for 21.0; based
+   heavily on objects-x.c (see authorship there).  Much further work
+   by Ben Wing.
  */
 
 /* This function Mule-ized by Ben Wing, 3-24-02. */
@@ -1016,11 +1017,11 @@
 
   for (i = 0; i < countof (mswindows_X_color_map); i++)
     if (pcolor == (mswindows_X_color_map[i].colorref))
-      return  build_string (mswindows_X_color_map[i].name);
+      return  build_ascstring (mswindows_X_color_map[i].name);
 
   sprintf (buf, "#%02X%02X%02X",
 	   GetRValue (color), GetGValue (color), GetBValue (color));
-  return build_string (buf);
+  return build_ascstring (buf);
 }
 
 /*
@@ -1109,7 +1110,7 @@
    * weights unspecified. This means that we have to weed out duplicates of
    * those fonts that do get enumerated with different weights.
    */
-  TSTR_TO_C_STRING (lpelfe->elfLogFont.lfFaceName, facename);
+  facename = TSTR_TO_ITEXT (lpelfe->elfLogFont.lfFaceName);
   if (itext_ichar (facename) == '@')
     /* This is a font for writing vertically. We ignore it. */
     return 1;
@@ -1141,7 +1142,7 @@
     return 1;
 
   /* Add the font name to the list if not already there */
-  fontname_lispstr = build_intstring (fontname);
+  fontname_lispstr = build_istring (fontname);
   if (NILP (Fassoc (fontname_lispstr, font_enum->list)))
     font_enum->list =
       Fcons (Fcons (fontname_lispstr,
@@ -1376,7 +1377,7 @@
 {
   if (c->data)
     {
-      xfree (c->data, void *);
+      xfree (c->data);
       c->data = 0;
     }
 }
@@ -1489,7 +1490,7 @@
     {
       Extbyte *extfontname;
 
-      C_STRING_TO_TSTR (fontname, extfontname);
+      extfontname = ITEXT_TO_TSTR (fontname);
       if (logfont)
 	{
           qxetcsncpy ((Extbyte *) logfont->lfFaceName, extfontname,
@@ -1797,7 +1798,7 @@
 			    ERROR_ME_DEBUG_WARN, &logfont, fontname, weight,
 			    points, effects, charset))
 	signal_error (Qinternal_error, "Bad value in device font list?",
-		      build_intstring (truername));
+		      build_istring (truername));
     }
   else if (!parse_font_spec (namestr, hdc, name_for_errors,
 			     errb, &logfont, fontname, weight, points,
@@ -1817,7 +1818,7 @@
   qxesprintf (truename, "%s:%s:%s:%s:%s", fontname, weight,
 	      points, effects, charset);
   
-  *truename_ret = build_intstring (truename);
+  *truename_ret = build_istring (truename);
   return hfont;
 }
 
@@ -1837,6 +1838,8 @@
 
   hfont = create_hfont_from_font_spec (namestr, hdc, name, device_font_list,
 				       errb, &truename);
+  if (!hfont)
+    return 0;
   f->truename = truename;
   f->data = xnew_and_zero (struct mswindows_font_instance_data);
   FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f, 0, 0) = hfont;
@@ -1902,7 +1905,7 @@
 	    DeleteObject (FONT_INSTANCE_MSWINDOWS_HFONT_I (f, i));
 	}
 
-      xfree (f->data, void *);
+      xfree (f->data);
       f->data = 0;
    }
 }
@@ -1946,7 +1949,7 @@
       if (match_font (XSTRING_DATA (XCAR (XCAR (fonttail))),
 		      XSTRING_DATA (pattern),
 		      fontname))
-	result = Fcons (build_intstring (fontname), result);
+	result = Fcons (build_istring (fontname), result);
     }
 
   return Fnreverse (result);
@@ -2014,6 +2017,8 @@
 
 /*
 
+#### The following comment is old and probably not applicable any longer.
+
 1. handle standard mapping and inheritance vectors properly in Face-frob-property.
 2. finish impl of mswindows-charset-registry.
 3. see if everything works under fixup, now that i copied the stuff over.
@@ -2052,7 +2057,7 @@
      spec.  See if the FONTSIGNATURE data is already cached.  If not, get
      it and cache it. */
   if (!STRINGP (reloc) || the_nonreloc != XSTRING_DATA (reloc))
-    reloc = build_intstring (the_nonreloc);
+    reloc = build_istring (the_nonreloc);
   GCPRO1 (reloc);
   fontsig = Fgethash (reloc, Vfont_signature_data, Qunbound);
 
@@ -2065,6 +2070,7 @@
     {
       HDC hdc = CreateCompatibleDC (NULL);
       Lisp_Object font_list = Qnil, truename; 
+      HFONT hfont;
 
       if (DEVICE_TYPE_P (d, mswindows))
 	{
@@ -2079,10 +2085,10 @@
 	  assert(0);
 	}
 
-      HFONT hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
-						 font_list,
-						 ERROR_ME_DEBUG_WARN,
-						 &truename);
+      hfont = create_hfont_from_font_spec (the_nonreloc, hdc, Qnil,
+					   font_list,
+					   ERROR_ME_DEBUG_WARN,
+					   &truename);
 
       if (!hfont || !(hfont = (HFONT) SelectObject (hdc, hfont)))
 	{
@@ -2091,7 +2097,7 @@
 	  UNGCPRO;
 	  return 0;
 	}
-    
+      
       if (GetTextCharsetInfo (hdc, &fs, 0) == DEFAULT_CHARSET)
 	{
 	  SelectObject (hdc, hfont);
@@ -2182,7 +2188,7 @@
 				     Bytecount offset, Bytecount length,
 				     enum font_specifier_matchspec_stages stage)
 {
-  return stage ?
+  return stage == STAGE_FINAL ?
      mswindows_font_spec_matches_charset_stage_2 (d, charset, nonreloc,
 						  reloc, offset, length)
     : mswindows_font_spec_matches_charset_stage_1 (d, charset, nonreloc,
@@ -2204,7 +2210,7 @@
      that charset; otherwise, it will list fonts with all charsets. */
   fontlist = mswindows_font_list (font, device, Qnil);
 
-  if (!stage)
+  if (stage == STAGE_INITIAL)
     {
       LIST_LOOP (fonttail, fontlist)
 	{
@@ -2240,7 +2246,7 @@
   int i;
 
   for (i = 0; i < countof (mswindows_X_color_map); i++)
-    result = Fcons (build_string (mswindows_X_color_map[i].name), result);
+    result = Fcons (build_ascstring (mswindows_X_color_map[i].name), result);
 
   return Fnreverse (result);
 }
--- a/src/objects-tty.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-tty.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* TTY-specific Lisp objects.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2001, 2002 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -225,7 +225,7 @@
 {
 #ifndef NEW_GC
   if (c->data)
-    xfree (c->data, void *);
+    xfree (c->data);
 #endif /* not NEW_GC */
 }
 
@@ -272,7 +272,7 @@
       if (*str != '/')
 	return 0;
       str++;
-      charset = Ffind_charset (intern_int (str));
+      charset = Ffind_charset (intern_istring (str));
       if (NILP (charset))
 	return 0;
 #else
@@ -320,7 +320,7 @@
 {
 #ifndef NEW_GC
   if (f->data)
-    xfree (f->data, void *);
+    xfree (f->data);
 #endif /* not NEW_GC */
 }
 
@@ -328,7 +328,7 @@
 tty_font_list (Lisp_Object UNUSED (pattern), Lisp_Object UNUSED (device),
 		Lisp_Object UNUSED (maxnumber))
 {
-  return list1 (build_string ("normal"));
+  return list1 (build_ascstring ("normal"));
 }
 
 #ifdef MULE
@@ -341,7 +341,7 @@
 {
   const Ibyte *the_nonreloc = nonreloc;
 
-  if (stage)
+  if (stage == STAGE_FINAL)
     return 0;
 
   if (!the_nonreloc)
@@ -370,13 +370,13 @@
 {
   Ibyte *fontname = XSTRING_DATA (font);
 
-  if (stage)
+  if (stage == STAGE_FINAL)
     return Qnil;
 
   if (strchr ((const char *) fontname, '/'))
     {
       if (tty_font_spec_matches_charset (XDEVICE (device), charset, 0,
-					 font, 0, -1, initial))
+					 font, 0, -1, STAGE_INITIAL))
 	return font;
       return Qnil;
     }
@@ -384,7 +384,7 @@
   if (NILP (charset))
     return font;
 
-  return concat3 (font, build_string ("/"),
+  return concat3 (font, build_ascstring ("/"),
 		  Fsymbol_name (XCHARSET_NAME (charset)));
 }
 
--- a/src/objects-x-impl.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-x-impl.h	Wed Feb 24 01:58:04 2010 -0600
@@ -29,7 +29,7 @@
 
 #include "objects-impl.h"
 #include "objects-x.h"
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 /* for resource name definitions, etc */
 #include "../lwlib/lwlib-fonts.h"
 #endif
@@ -45,7 +45,7 @@
   XColor color;
   /* Yes, it looks crazy to have both the XColor and the XftColor, but
      pragmatically both are used. */
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftColor xftColor;
 #endif
   char dealloc_on_gc;
@@ -53,7 +53,8 @@
 
 #define X_COLOR_INSTANCE_DATA(c) ((struct x_color_instance_data *) (c)->data)
 #define COLOR_INSTANCE_X_COLOR(c) (X_COLOR_INSTANCE_DATA (c)->color)
-#ifdef USE_XFT
+#define XCOLOR_INSTANCE_X_COLOR(c) COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (c))
+#ifdef HAVE_XFT
 #define COLOR_INSTANCE_X_XFTCOLOR(c) (X_COLOR_INSTANCE_DATA (c)->xftColor)
 #endif
 #define COLOR_INSTANCE_X_DEALLOC(c) (X_COLOR_INSTANCE_DATA (c)->dealloc_on_gc)
@@ -69,7 +70,7 @@
      pragmatically both are used (lwlib delegates labels to the widget sets,
      which internally use XFontStructs). */
   XFontStruct * font;
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftFont *xftFont;
 #endif
 
@@ -77,7 +78,8 @@
 
 #define X_FONT_INSTANCE_DATA(f) ((struct x_font_instance_data *) (f)->data)
 #define FONT_INSTANCE_X_FONT(f) (X_FONT_INSTANCE_DATA (f)->font)
-#ifdef USE_XFT
+#define XFONT_INSTANCE_X_FONT(c) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (c))
+#ifdef HAVE_XFT
 #define FONT_INSTANCE_X_XFTFONT(f) (X_FONT_INSTANCE_DATA (f)->xftFont)
 #endif
 
--- a/src/objects-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -39,7 +39,7 @@
 #include "objects-x-impl.h"
 #include "elhash.h"
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 #include "font-mgr.h"
 #endif
 
@@ -67,7 +67,7 @@
   {
     const Extbyte *extname;
 
-    LISP_STRING_TO_EXTERNAL (name, extname, Qx_color_name_encoding);
+    extname = LISP_STRING_TO_EXTERNAL (name, Qx_color_name_encoding);
     result = XParseColor (dpy, cmap, extname, color);
   }
   if (!result)
@@ -92,7 +92,7 @@
 			     Lisp_Object device, Error_Behavior errb)
 {
   XColor color;
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftColor xftColor;
 #endif
   int result;
@@ -111,7 +111,7 @@
     COLOR_INSTANCE_X_DEALLOC (c) = 1;
   COLOR_INSTANCE_X_COLOR (c) = color;
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   xftColor.pixel = color.pixel;
   xftColor.color.red = color.red;
   xftColor.color.green = color.green;
@@ -148,7 +148,7 @@
 			   &COLOR_INSTANCE_X_COLOR (c).pixel, 1, 0);
 	    }
 	}
-      xfree (c->data, void *);
+      xfree (c->data);
       c->data = 0;
     }
 }
@@ -194,7 +194,7 @@
   Colormap cmap = DEVICE_X_COLORMAP (d);
   const Extbyte *extname;
 
-  LISP_STRING_TO_EXTERNAL (color, extname, Qx_color_name_encoding);
+  extname = LISP_STRING_TO_EXTERNAL (color, Qx_color_name_encoding);
 
   return XParseColor (dpy, cmap, extname, &c);
 }
@@ -218,13 +218,13 @@
   Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device));
   Extbyte *extname;
   XFontStruct *fs = NULL;	/* _F_ont _S_truct */
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   XftFont *rf = NULL;		/* _R_ender _F_ont (X Render extension) */
 #else
 #define rf (0)
 #endif
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   DEBUG_XFT1 (2, "attempting to initialize font spec %s\n",
 	      XSTRING_DATA(f->name));
   /* #### serialize (optimize) these later... */
@@ -232,10 +232,10 @@
      The problem is that the fontconfig/Xft functions work much too hard
      to ensure that something is returned; but that something need not be
      at all close to what we asked for. */
-  LISP_STRING_TO_EXTERNAL (f->name, extname, Qfc_font_name_encoding);
+  extname = LISP_STRING_TO_EXTERNAL (f->name, Qfc_font_name_encoding);
   rf = xft_open_font_by_name (dpy, extname);
 #endif
-  LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
+  extname = LISP_STRING_TO_EXTERNAL (f->name, Qx_font_name_encoding);
   /* With XFree86 4.0's fonts, XListFonts returns an entry for
      -isas-fangsong ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0 but
      an XLoadQueryFont on the corresponding XLFD returns NULL.
@@ -272,7 +272,7 @@
      fear that the finalize method may get fucked. */
   f->data = xnew (struct x_font_instance_data);
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   FONT_INSTANCE_X_XFTFONT (f) = rf;
   if (rf)
     /* Have an Xft font, initialize font info from it. */
@@ -379,7 +379,7 @@
 			    !fs->all_chars_exist));
     }
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   if (debug_xft > 0)
     {
       int n = 3, d = 5;
@@ -411,7 +411,7 @@
       write_fmt_string (printcharfun, " font id: 0x%lx,",
 			(unsigned long) FONT_INSTANCE_X_FONT (f)->fid);
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* #### What should we do here?  For now, print the address. */
   if (FONT_INSTANCE_X_XFTFONT (f))
     write_fmt_string (printcharfun, " xft font: 0x%lx",
@@ -423,7 +423,7 @@
 x_finalize_font_instance (Lisp_Font_Instance *f)
 {
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   DEBUG_XFT1 (0, "finalizing %s\n", (STRINGP (f->name)
 				   ? (char *) XSTRING_DATA (f->name)
 				   : "(unnamed font)"));
@@ -437,12 +437,12 @@
 
 	  if (FONT_INSTANCE_X_FONT (f))
 	    XFreeFont (dpy, FONT_INSTANCE_X_FONT (f));
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 	  if (FONT_INSTANCE_X_XFTFONT (f))
 	    XftFontClose (dpy, FONT_INSTANCE_X_XFTFONT (f));
 #endif
 	}
-      xfree (f->data, void *);
+      xfree (f->data);
       f->data = 0;
     }
 }
@@ -733,7 +733,7 @@
 
   if (truename)
     {
-      Lisp_Object result = build_ext_string (truename, Qx_font_name_encoding);
+      Lisp_Object result = build_extstring (truename, Qx_font_name_encoding);
       XFree (truename);
       return result;
     }
@@ -752,7 +752,7 @@
      and otherwise only return when we return something desperate that
      doesn't get stored for future use. */
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   /* First, try an Xft font. */
   if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f))
     {
@@ -767,7 +767,7 @@
       if (res)
 	{
 	  FONT_INSTANCE_TRUENAME (f) = 
-	    build_ext_string ((Extbyte *) res, Qfc_font_name_encoding); 
+	    build_extstring ((Extbyte *) res, Qfc_font_name_encoding); 
 	  free (res);
 	  return FONT_INSTANCE_TRUENAME (f);
 	}
@@ -779,13 +779,13 @@
 	  /* used to return Qnil here */
 	}
     }
-#endif	/* USE_XFT */
+#endif	/* HAVE_XFT */
 
   /* OK, fall back to core font. */
   if (NILP (FONT_INSTANCE_TRUENAME (f))
       && FONT_INSTANCE_X_FONT (f))
     {
-      nameext = NEW_LISP_STRING_TO_EXTERNAL (f->name, Qx_font_name_encoding);
+      nameext = LISP_STRING_TO_EXTERNAL (f->name, Qx_font_name_encoding);
       FONT_INSTANCE_TRUENAME (f) =
 	x_font_truename (dpy, nameext, FONT_INSTANCE_X_FONT (f));
     }
@@ -834,7 +834,7 @@
 			    ALLOCA, (name_str, name_len),
 			    Qx_atom_name_encoding);
 
-      name = (name_str ? intern_int (name_str) : Qnil);
+      name = (name_str ? intern_istring (name_str) : Qnil);
       if (name_str &&
 	  (atom == XA_FONT ||
 	   atom == DEVICE_XATOM_FOUNDRY (d) ||
@@ -860,7 +860,7 @@
 	{
 	  Extbyte *val_str = XGetAtomName (dpy, props [i].card32);
 
-	  value = (val_str ? build_ext_string (val_str, Qx_atom_name_encoding)
+	  value = (val_str ? build_extstring (val_str, Qx_atom_name_encoding)
 		   : Qnil);
 	}
       else
@@ -880,7 +880,7 @@
   Lisp_Object result = Qnil;
   const Extbyte *patternext;
 
-  LISP_STRING_TO_EXTERNAL (pattern, patternext, Qx_font_name_encoding);
+  patternext = LISP_STRING_TO_EXTERNAL (pattern, Qx_font_name_encoding);
 
   if (!NILP(maxnumber) && INTP(maxnumber))
     {
@@ -890,7 +890,7 @@
   names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
 		      patternext, max_number, &count);
   while (count--)
-    result = Fcons (build_ext_string (names[count], Qx_font_name_encoding),
+    result = Fcons (build_extstring (names[count], Qx_font_name_encoding),
 		    result);
   if (names)
     XFreeFontNames (names);
@@ -961,7 +961,7 @@
 */ );
   x_handle_non_fully_specified_fonts = 0;
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
   Fprovide (intern ("xft-fonts"));
 #endif
 }
--- a/src/objects-x.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-x.h	Wed Feb 24 01:58:04 2010 -0600
@@ -32,7 +32,7 @@
 
 #ifdef HAVE_X_WINDOWS
 
-#ifdef USE_XFT
+#ifdef HAVE_XFT
 EXFUN (Ffc_font_real_pattern, 2);
 #endif
 
--- a/src/objects-xlike-inc.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects-xlike-inc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
-/* Shared object code between X and GTK -- include file.
+/* Common code between X and GTK -- fonts and colors.
    Copyright (C) 1991-5, 1997 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1996, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1996, 2001, 2002, 2003, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -22,10 +22,18 @@
 
 /* Synched up with: Not in FSF. */
 
+/* Before including this file, you need to define either THIS_IS_X or
+   THIS_IS_GTK. */
+
+/* See comment at top of console-xlike-inc.h for an explanation of
+   how this file works. */
+
 /* Pango is ready for prime-time now, as far as I understand it. The GTK
    people should be using that. Oh well. (Aidan Kehoe, Sat Nov 4 12:41:12
    CET 2006) */
 
+#include "console-xlike-inc.h"
+
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
 
 #ifdef DEBUG_XEMACS
@@ -78,19 +86,11 @@
 }
 
 static int
-#ifdef THIS_IS_GTK
-gtk_font_spec_matches_charset (struct device * USED_IF_XFT (d),
-			       Lisp_Object charset,
-			       const Ibyte *nonreloc, Lisp_Object reloc,
-			       Bytecount offset, Bytecount length,
-			       enum font_specifier_matchspec_stages stage)
-#else
-x_font_spec_matches_charset (struct device * USED_IF_XFT (d),
-			     Lisp_Object charset,
-			     const Ibyte *nonreloc, Lisp_Object reloc,
-			     Bytecount offset, Bytecount length,
-			     enum font_specifier_matchspec_stages stage)
-#endif
+XFUN (font_spec_matches_charset) (struct device * USED_IF_XFT (d),
+				  Lisp_Object charset,
+				  const Ibyte *nonreloc, Lisp_Object reloc,
+				  Bytecount offset, Bytecount length,
+				  enum font_specifier_matchspec_stages stage)
 {
   Lisp_Object registries = Qnil;
   long i, registries_len;
@@ -106,7 +106,7 @@
   the_nonreloc += offset;
 
 #ifdef USE_XFT
-  if (stage)
+  if (stage == STAGE_FINAL)
     {
       Display *dpy = DEVICE_X_DISPLAY (d);
       Extbyte *extname;
@@ -116,7 +116,7 @@
       if (!NILP(reloc))
 	{
 	  the_nonreloc = XSTRING_DATA (reloc);
-	  LISP_STRING_TO_EXTERNAL (reloc, extname, Qx_font_name_encoding);
+	  extname = LISP_STRING_TO_EXTERNAL (reloc, Qx_font_name_encoding);
 	  rf = xft_open_font_by_name (dpy, extname);
 	  return 0;	 /* #### maybe this will compile and run ;) */
 			 /* Jesus, Stephen, what the fuck? */
@@ -146,11 +146,11 @@
       return 1;
     }
 
-  if (final == stage)
+  if (STAGE_FINAL == stage)
     {
       registries = Qunicode_registries;
     }
-  else if (initial == stage)
+  else if (STAGE_INITIAL == stage)
     {
       registries = XCHARSET_REGISTRIES (charset);
       if (NILP(registries))
@@ -198,12 +198,7 @@
   int count = 0, i;
   DECLARE_EISTRING(ei_single_result);
 
-  names = XListFonts (
-#ifdef THIS_IS_GTK
-		      GDK_DISPLAY (),
-#else
-		      DEVICE_X_DISPLAY (XDEVICE (device)),
-#endif
+  names = XListFonts (GET_XLIKE_DISPLAY (XDEVICE (device)),
 		      xlfd, MAX_FONT_COUNT, &count);
 
   for (i = 0; i < count; ++i)
@@ -327,10 +322,10 @@
 struct charset_reporter {
   Lisp_Object *charset;
   /* This is a debug facility, require ASCII. */
-  Extbyte *language;		/* ASCII, please */
+  const Ascbyte *language;	/* ASCII, please */
   /* Technically this is FcChar8, but fsckin' GCC 4 bitches.
      RFC 3066 is a combination of ISO 639 and ISO 3166. */
-  Extbyte *rfc3066;		/* ASCII, please */
+  const Ascbyte *rfc3066;	/* ASCII, please */
 };
 
 static struct charset_reporter charset_table[] =
@@ -394,7 +389,7 @@
 
   /* #### with Xft need to handle second stage here -- sjt
      Hm.  Or maybe not.  That would be cool. :-) */
-  if (stage)
+  if (stage == STAGE_FINAL)
     return Qnil;
 
   /* Fontconfig converts all FreeType names to UTF-8 before passing them
@@ -424,13 +419,13 @@
       FcPattern *fontxft;	/* long-lived, freed at end of this block */
       FcResult fcresult;
       FcConfig *fcc;
-      FcChar8 *lang = (FcChar8 *) "en";	/* #### fix this bogus hack! */
+      const Ascbyte *lang = "en";
       FcCharSet *fccs = NULL;
       DECLARE_EISTRING (eistr_shortname); /* user-friendly nickname */
       DECLARE_EISTRING (eistr_longname);  /* omit FC_LANG and FC_CHARSET */
       DECLARE_EISTRING (eistr_fullname);  /* everything */
 
-      LISP_STRING_TO_EXTERNAL (font, patternext, Qfc_font_name_encoding);
+      patternext = LISP_STRING_TO_EXTERNAL (font, Qfc_font_name_encoding);
       fcc = FcConfigGetCurrent ();
 
       /* parse the name, do the substitutions, and match the font */
@@ -445,6 +440,7 @@
 	FcDefaultSubstitute (p);
 	PRINT_XFT_PATTERN (3, "FcDefaultSubstitute'ed name is %s\n", p);
 	/* #### check fcresult of following match? */
+	fcresult = FcResultMatch;
 	fontxft = FcFontMatch (fcc, p, &fcresult);
 	switch (fcresult)
 	  {
@@ -540,28 +536,29 @@
 	  {
 	    DECLARE_DEBUG_FONTNAME (name);
 	    CHECKING_LANG (0, eidata(name), cr->language);
-	    lang = (FcChar8 *) cr->rfc3066;
+	    lang = cr->rfc3066;
 	  }
 	else if (cr->charset)
 	  {
 	    /* what the hey, build 'em on the fly */
 	    /* #### in the case of error this could return NULL! */
 	    fccs = mule_to_fc_charset (charset);
-	    lang = (FcChar8 *) XSTRING_DATA (XSYMBOL
-					     (XCHARSET_NAME (charset))-> name);
+	    /* #### Bad idea here */
+	    lang = (const Ascbyte *) XSTRING_DATA (XSYMBOL (XCHARSET_NAME
+							    (charset))->name);
 	  }
 	else
 	  {
 	    /* OK, we fell off the end of the table */
 	    warn_when_safe_lispobj (intern ("xft"), intern ("alert"),
-				    list2 (build_string ("unchecked charset"),
+				    list2 (build_ascstring ("unchecked charset"),
 					   charset));
 	    /* default to "en"
 	       #### THIS IS WRONG, WRONG, WRONG!!
 	       It is why we never fall through to XLFD-checking. */
 	  }
 
-	ASSERT_ASCTEXT_ASCII((Extbyte *) lang);
+	ASSERT_ASCTEXT_ASCII (lang);
 
       if (fccs)
 	{
@@ -620,7 +617,8 @@
 			       FcTypeOfValueToString (v));
 		  result = Qnil;
 		}
-	      else if (FcLangSetHasLang (v.u.l, lang) != FcLangDifferentLang)
+	      else if (FcLangSetHasLang (v.u.l, (FcChar8 *) lang)
+		       != FcLangDifferentLang)
 		{
 		  DECLARE_DEBUG_FONTNAME (name);
 		  DEBUG_XFT2 (0, "Xft font %s supports %s\n",
@@ -663,14 +661,9 @@
 /* find a font spec that matches font spec FONT and also matches
    (the registry of) CHARSET. */
 static Lisp_Object
-#ifdef THIS_IS_GTK
-gtk_find_charset_font (Lisp_Object device, Lisp_Object font,
-		       Lisp_Object charset,
-		       enum font_specifier_matchspec_stages stage)
-#else
-x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset,
-		     enum font_specifier_matchspec_stages stage)
-#endif
+XFUN (find_charset_font) (Lisp_Object device, Lisp_Object font,
+			  Lisp_Object charset,
+			  enum font_specifier_matchspec_stages stage)
 {
   Lisp_Object result = Qnil, registries = Qnil;
   int j, hyphen_count, registries_len = 0;
@@ -690,7 +683,7 @@
 
   switch (stage) 
     {
-    case initial:
+    case STAGE_INITIAL:
       {
 	if (!(NILP(XCHARSET_REGISTRIES(charset))) 
 	    && VECTORP(XCHARSET_REGISTRIES(charset)))
@@ -700,7 +693,7 @@
 	  }
 	break;
       }
-    case final:
+    case STAGE_FINAL:
       {
 	registries_len = 1;
 	registries = Qunicode_registries;
@@ -819,7 +812,7 @@
 	  Lisp_Object new_registries = make_vector(registries_len + 1, Qnil);
 
 	  XVECTOR_DATA(new_registries)[0]
-	    = build_string(FALLBACK_ASCII_REGISTRY);
+	    = build_ascstring(FALLBACK_ASCII_REGISTRY);
 
 	  memcpy(XVECTOR_DATA(new_registries) + 1,
 		 XVECTOR_DATA(registries),
--- a/src/objects.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Generic Objects and Functions.
    Copyright (C) 1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2002, 2004 Ben Wing.
+   Copyright (C) 1995, 1996, 2002, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -43,7 +43,8 @@
    If we leave in the Qunbound value, we will probably get crashes. */
 Lisp_Object Vthe_null_color_instance, Vthe_null_font_instance;
 
-/* Authors: Ben Wing, Chuck Thompson */
+/* Author: Ben Wing; some earlier code from Chuck Thompson, Jamie
+   Zawinski. */
 
 DOESNT_RETURN
 finalose (void *ptr)
@@ -102,8 +103,7 @@
 {
   Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
   if (print_readably)
-    printing_unreadable_object ("#<color-instance 0x%x>",
-	   c->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
   write_fmt_string_lisp (printcharfun, "#<color-instance %s", 1, c->name);
   write_fmt_string_lisp (printcharfun, " on %s", 1, c->device);
   if (!NILP (c->device)) /* Vthe_null_color_instance */
@@ -122,7 +122,8 @@
 }
 
 static int
-color_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+color_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		      int UNUSED (foldcase))
 {
   Lisp_Color_Instance *c1 = XCOLOR_INSTANCE (obj1);
   Lisp_Color_Instance *c2 = XCOLOR_INSTANCE (obj2);
@@ -317,7 +318,7 @@
 {
   Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
   if (print_readably)
-    printing_unreadable_object ("#<font-instance 0x%x>", f->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
   write_fmt_string_lisp (printcharfun, "#<font-instance %S", 1, f->name);
   write_fmt_string_lisp (printcharfun, " on %s", 1, f->device);
   if (!NILP (f->device))
@@ -345,7 +346,8 @@
    this means the `equal' could cause XListFonts to be run the first time.
  */
 static int
-font_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+font_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth,
+		     int UNUSED (foldcase))
 {
   /* #### should this be moved into a device method? */
   return internal_equal (font_instance_truename_internal
@@ -842,6 +844,32 @@
 
 #endif /* MULE */
 
+/* It's a little non-obvious what's going on here.  Specifically:
+
+   MATCHSPEC is a somewhat bogus way in the specifier mechanism of passing
+   in additional information needed to instantiate some object.  For fonts,
+   it's a cons of (CHARSET . SECOND-STAGE-P).  SECOND-STAGE-P, if set,
+   means "try harder to find an appropriate font" and is a very bogus way
+   of dealing with the fact that it may not be possible to may a charset
+   directly onto a font; it's used esp. under Windows.  @@#### We need to
+   change this so that MATCHSPEC is just a character.
+
+   When redisplay is building up its structure, and needs font info, it
+   calls functions in faces.c such as ensure_face_cachel_complete() (map
+   fonts needed for a string of text) or
+   ensure_face_cachel_contains_charset() (map fonts needed for a charset
+   derived from a single character).  The former function calls the latter;
+   the latter calls face_property_matching_instance(); this constructs the
+   MATCHSPEC and calls specifier_instance_no_quit() twice (first stage and
+   second stage, updating MATCHSPEC appropriately).  That function, in
+   turn, looks up the appropriate specifier method to do the instantiation,
+   which, lo and behold, is this function here (because we set it in
+   initialization using `SPECIFIER_HAS_METHOD (font, instantiate);').  We
+   in turn call the device method `find_charset_font', which maps to
+   mswindows_find_charset_font(), x_find_charset_font(), or similar, in
+   objects-msw.c or the like.
+
+   --ben */
 
 static Lisp_Object
 font_instantiate (Lisp_Object UNUSED (specifier),
@@ -856,19 +884,20 @@
   Lisp_Object instance;
   Lisp_Object charset = Qnil;
 #ifdef MULE
-  enum font_specifier_matchspec_stages stage = initial;
+  enum font_specifier_matchspec_stages stage = STAGE_INITIAL;
 
   if (!UNBOUNDP (matchspec))
     {
       charset = Fget_charset (XCAR (matchspec));
 
-#define FROB(new_stage) if (EQ(Q##new_stage, XCDR(matchspec)))	\
-	    {							\
-	      stage = new_stage;				\
+#define FROB(new_stage, enumstage)			\
+          if (EQ(Q##new_stage, XCDR(matchspec)))	\
+	    {						\
+	      stage = enumstage;			\
 	    }
 
-	  FROB(initial)
-	  else FROB(final)
+	  FROB (initial, STAGE_INITIAL)
+	  else FROB (final, STAGE_FINAL)
 	  else assert(0);
 
 #undef FROB
@@ -896,7 +925,8 @@
     {
 #ifdef MULE
       /* #### rename these caches. */
-      Lisp_Object cache = stage ? d->charset_font_cache_stage_2 :
+      Lisp_Object cache = stage == STAGE_FINAL ?
+	d->charset_font_cache_stage_2 :
 	d->charset_font_cache_stage_1;
 #else
       Lisp_Object cache = d->font_instance_cache;
@@ -958,13 +988,13 @@
 
       match_inst = face_property_matching_instance
 	(Fget_face (XVECTOR_DATA (instantiator)[0]), Qfont,
-	 charset, domain, ERROR_ME, no_fallback, depth, initial);
+	 charset, domain, ERROR_ME, no_fallback, depth, STAGE_INITIAL);
 
       if (UNBOUNDP(match_inst))
 	{
 	  match_inst = face_property_matching_instance
 	    (Fget_face (XVECTOR_DATA (instantiator)[0]), Qfont,
-	     charset, domain, ERROR_ME, no_fallback, depth, final);
+	     charset, domain, ERROR_ME, no_fallback, depth, STAGE_FINAL);
 	}
 
       return match_inst;
--- a/src/objects.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/objects.h	Wed Feb 24 01:58:04 2010 -0600
@@ -76,8 +76,4 @@
 void set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face,
 				   Lisp_Object property);
 
-/* Defined in search.c, used in mule-charset.c; slightly ugly to declare it
-   here, but oh well.  */
-EXFUN (Fregexp_quote, 1);
-
 #endif /* INCLUDED_objects_h_ */
--- a/src/opaque.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/opaque.c	Wed Feb 24 01:58:04 2010 -0600
@@ -92,7 +92,8 @@
 /* This will not work correctly for opaques with subobjects! */
 
 static int
-equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+equal_opaque (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+	      int UNUSED (foldcase))
 {
   Bytecount size;
   return ((size = XOPAQUE_SIZE (obj1)) == XOPAQUE_SIZE (obj2) &&
@@ -136,7 +137,8 @@
 }
 
 static int
-equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth))
+equal_opaque_ptr (Lisp_Object obj1, Lisp_Object obj2, int UNUSED (depth),
+		  int UNUSED (foldcase))
 {
   return (XOPAQUE_PTR (obj1)->ptr == XOPAQUE_PTR (obj2)->ptr);
 }
--- a/src/print.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/print.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Lisp object printing and output streams.
    Copyright (C) 1985, 1986, 1988, 1992-1995 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -114,6 +114,9 @@
 /* Force immediate output of all printed data.  Used for debugging. */
 int print_unbuffered;
 
+/* Non-zero if in debug-printing */
+int in_debug_print;
+
 FILE *termscript;	/* Stdio stream being used for copy of all output.  */
 
 static void write_string_to_alternate_debugging_output (const Ibyte *str,
@@ -127,13 +130,15 @@
   int print_depth;
   int print_readably;
   int print_unbuffered;
+  int in_debug_print;
   int gc_currently_forbidden;
   Lisp_Object Vprint_length;
   Lisp_Object Vprint_level;
   Lisp_Object Vinhibit_quit;
 };
 
-static Lisp_Object debug_prin1_bindings;
+static int begin_inhibit_non_essential_conversion_operations (void);
+
 
 
 int stdout_needs_newline;
@@ -358,10 +363,12 @@
 void
 debug_out (const CIbyte *fmt, ...)
 {
+  int depth =  begin_inhibit_non_essential_conversion_operations ();
   va_list args;
   va_start (args, fmt);
   write_string_to_external_output_va (fmt, args, EXT_PRINT_ALL);
   va_end (args);
+  unbind_to (depth);
 }
 
 DOESNT_RETURN
@@ -651,17 +658,47 @@
 }
 
 void
-write_string (Lisp_Object stream, const Ibyte *str)
+write_istring (Lisp_Object stream, const Ibyte *str)
 {
   /* This function can GC */
   write_string_1 (stream, str, qxestrlen (str));
 }
 
 void
-write_c_string (Lisp_Object stream, const CIbyte *str)
+write_cistring (Lisp_Object stream, const CIbyte *str)
+{
+  /* This function can GC */
+  write_istring (stream, (const Ibyte *) str);
+}
+
+void
+write_ascstring (Lisp_Object stream, const Ascbyte *str)
 {
   /* This function can GC */
-  write_string_1 (stream, (const Ibyte *) str, strlen (str));
+  ASSERT_ASCTEXT_ASCII (str);
+  write_istring (stream, (const Ibyte *) str);
+}
+
+void
+write_msg_istring (Lisp_Object stream, const Ibyte *str)
+{
+  /* This function can GC */
+  write_istring (stream, IGETTEXT (str));
+}
+
+void
+write_msg_cistring (Lisp_Object stream, const CIbyte *str)
+{
+  /* This function can GC */
+  write_msg_istring (stream, (const Ibyte *) str);
+}
+
+void
+write_msg_ascstring (Lisp_Object stream, const Ascbyte *str)
+{
+  /* This function can GC */
+  ASSERT_ASCTEXT_ASCII (str);
+  write_msg_istring (stream, (const Ibyte *) str);
 }
 
 void
@@ -844,7 +881,7 @@
        (stream))
 {
   /* This function can GC */
-  write_c_string (canonicalize_printcharfun (stream), "\n");
+  write_ascstring (canonicalize_printcharfun (stream), "\n");
   return Qt;
 }
 
@@ -941,9 +978,9 @@
 
   GCPRO2 (object, stream);
   stream = print_prepare (stream, &frame);
-  write_c_string (stream, "\n");
+  write_ascstring (stream, "\n");
   print_internal (object, stream, 1);
-  write_c_string (stream, "\n");
+  write_ascstring (stream, "\n");
   print_finish (stream, frame);
   UNGCPRO;
   return object;
@@ -1019,7 +1056,7 @@
       }
     while (!NILP (tail))
       {
-	write_c_string (stream, first ? ": " : ", ");
+	write_ascstring (stream, first ? ": " : ", ");
 	/* Most errors have an explanatory string as their first argument,
 	   and it looks better not to put the quotes around it. */
 	print_internal (Fcar (tail), stream,
@@ -1039,7 +1076,7 @@
  error_throw:
   if (NILP (method))
     {
-      write_c_string (stream, GETTEXT ("Peculiar error "));
+      write_ascstring (stream, GETTEXT ("Peculiar error "));
       print_internal (error_object, stream, 1);
       return;
     }
@@ -1323,17 +1360,17 @@
       if (max < len) last = max;
     }
 
-  write_c_string (printcharfun, start);
+  write_cistring (printcharfun, start);
   for (i = 0; i < last; i++)
     {
       Lisp_Object elt = XVECTOR_DATA (obj)[i];
-      if (i != 0) write_c_string (printcharfun, " ");
+      if (i != 0) write_ascstring (printcharfun, " ");
       print_internal (elt, printcharfun, escapeflag);
     }
   UNGCPRO;
   if (last != len)
-    write_c_string (printcharfun, " ...");
-  write_c_string (printcharfun, end);
+    write_ascstring (printcharfun, " ...");
+  write_cistring (printcharfun, end);
 }
 
 void
@@ -1354,14 +1391,14 @@
     {
       obj = XCAR (XCDR (obj));
       GCPRO2 (obj, printcharfun);
-      write_c_string (printcharfun, "\'");
+      write_ascstring (printcharfun, "\'");
       UNGCPRO;
       print_internal (obj, printcharfun, escapeflag);
       return;
     }
 
   GCPRO2 (obj, printcharfun);
-  write_c_string (printcharfun, "(");
+  write_ascstring (printcharfun, "(");
 
   {
     int len;
@@ -1374,20 +1411,20 @@
 	 obj = XCDR (obj), len++)
       {
 	if (len > 0)
-	  write_c_string (printcharfun, " ");
+	  write_ascstring (printcharfun, " ");
 	if (EQ (obj, tortoise) && len > 0)
 	  {
 	    if (print_readably)
 	      printing_unreadable_object ("circular list");
 	    else
-	      write_c_string (printcharfun, "... <circular list>");
+	      write_ascstring (printcharfun, "... <circular list>");
 	    break;
 	  }
 	if (len & 1)
 	  tortoise = XCDR (tortoise);
 	if (len > max)
 	  {
-	    write_c_string (printcharfun, "...");
+	    write_ascstring (printcharfun, "...");
 	    break;
 	  }
 	print_internal (XCAR (obj), printcharfun, escapeflag);
@@ -1395,12 +1432,12 @@
   }
   if (!LISTP (obj))
     {
-      write_c_string (printcharfun, " . ");
+      write_ascstring (printcharfun, " . ");
       print_internal (obj, printcharfun, escapeflag);
     }
   UNGCPRO;
 
-  write_c_string (printcharfun, ")");
+  write_ascstring (printcharfun, ")");
   return;
 }
 
@@ -1438,13 +1475,13 @@
       /* This deals with GC-relocation and Mule. */
       output_string (printcharfun, 0, obj, 0, bcmax);
       if (max < size)
-	write_c_string (printcharfun, " ...");
+	write_ascstring (printcharfun, " ...");
     }
   else
     {
       Bytecount i, last = 0;
 
-      write_c_string (printcharfun, "\"");
+      write_ascstring (printcharfun, "\"");
       for (i = 0; i < bcmax; i++)
 	{
 	  Ibyte ch = string_byte (obj, i);
@@ -1458,17 +1495,17 @@
 		}
 	      if (ch == '\n')
 		{
-		  write_c_string (printcharfun, "\\n");
+		  write_ascstring (printcharfun, "\\n");
 		}
 	      else
 		{
 		  Ibyte temp[2];
-		  write_c_string (printcharfun, "\\");
+		  write_ascstring (printcharfun, "\\");
 		  /* This is correct for Mule because the
 		     character is either \ or " */
 		  temp[0] = string_byte (obj, i);
 		  temp[1] = '\0';
-		  write_string (printcharfun, temp);
+		  write_istring (printcharfun, temp);
 		}
 	      last = i + 1;
 	    }
@@ -1479,27 +1516,70 @@
 			 bcmax - last);
 	}
       if (max < size)
-	write_c_string (printcharfun, " ...");
-      write_c_string (printcharfun, "\"");
+	write_ascstring (printcharfun, " ...");
+      write_ascstring (printcharfun, "\"");
     }
   UNGCPRO;
 }
 
+DOESNT_RETURN
+printing_unreadable_object (const Ascbyte *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  va_start (args, fmt);
+  obj = emacs_vsprintf_string (GETTEXT (fmt), args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  signal_error (Qprinting_unreadable_object, 0, obj);
+}
+
+DOESNT_RETURN
+printing_unreadable_lcrecord (Lisp_Object obj, const Ibyte *name)
+{
+  LISP_OBJECT_HEADER *header = (LISP_OBJECT_HEADER *) XPNTR (obj);
+
+#ifndef NEW_GC
+  /* This must be a real lcrecord */
+  assert (!LHEADER_IMPLEMENTATION (&header->lheader)->basic_p);
+#endif
+
+  if (name)
+    printing_unreadable_object
+      ("#<%s %s 0x%x>",
+#ifdef NEW_GC
+       LHEADER_IMPLEMENTATION (header)->name,
+#else /* not NEW_GC */
+       LHEADER_IMPLEMENTATION (&header->lheader)->name,
+#endif /* not NEW_GC */
+       name,
+       header->uid);
+  else
+    printing_unreadable_object
+      ("#<%s 0x%x>",
+#ifdef NEW_GC
+       LHEADER_IMPLEMENTATION (header)->name,
+#else /* not NEW_GC */
+       LHEADER_IMPLEMENTATION (&header->lheader)->name,
+#endif /* not NEW_GC */
+       header->uid);
+}
+
 void
 external_object_printer (Lisp_Object obj, Lisp_Object printcharfun,
 			 int UNUSED (escapeflag))
 {
   LISP_OBJECT_HEADER *header = (LISP_OBJECT_HEADER *) XPNTR (obj);
 
+#ifndef NEW_GC
+  /* This must be a real lcrecord */
+  assert (!LHEADER_IMPLEMENTATION (&header->lheader)->basic_p);
+#endif
+
   if (print_readably)
-    printing_unreadable_object
-      ("#<%s 0x%x>",
-#ifdef NEW_GC
-       LHEADER_IMPLEMENTATION (header)->name,
-#else /* not NEW_GC */
-       LHEADER_IMPLEMENTATION (&header->lheader)->name,
-#endif /* not NEW_GC */
-       header->uid);
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string (printcharfun, "#<%s 0x%x>",
 #ifdef NEW_GC
@@ -1520,6 +1600,9 @@
        XRECORD_LHEADER_IMPLEMENTATION (obj)->name,
        (unsigned long) XPNTR (obj));
 
+  /* Internal objects shouldn't normally escape to the Lisp level;
+     that's why we say "XEmacs bug?".  This can happen, however, when
+     printing backtraces. */
   write_fmt_string (printcharfun,
 		    "#<INTERNAL OBJECT (XEmacs bug?) (%s) 0x%lx>",
 		    XRECORD_LHEADER_IMPLEMENTATION (obj)->name,
@@ -1530,25 +1613,31 @@
 {
   BADNESS_INTEGER_OBJECT,
   BADNESS_POINTER_OBJECT,
+  BADNESS_POINTER_OBJECT_WITH_DATA,
   BADNESS_NO_TYPE
 };
 
 static void
 printing_major_badness (Lisp_Object printcharfun,
 			const Ascbyte *badness_string, int type, void *val,
-			enum printing_badness badness)
+			void *val2, enum printing_badness badness)
 {
   Ibyte buf[666];
 
   switch (badness)
     {
     case BADNESS_INTEGER_OBJECT:
-      qxesprintf (buf, "%s %d object %ld", badness_string, type,
+      qxesprintf (buf, "%s type %d object %ld", badness_string, type,
 		  (EMACS_INT) val);
       break;
 
     case BADNESS_POINTER_OBJECT:
-      qxesprintf (buf, "%s %d object %p", badness_string, type, val);
+      qxesprintf (buf, "%s type %d object %p", badness_string, type, val);
+      break;
+
+    case BADNESS_POINTER_OBJECT_WITH_DATA:
+      qxesprintf (buf, "%s type %d object %p data %p", badness_string, type,
+		  val, val2);
       break;
 
     case BADNESS_NO_TYPE:
@@ -1564,12 +1653,14 @@
       ABORT ();
 #else  /* not ERROR_CHECK_TYPES */
       if (print_readably)
-	signal_ferror (Qinternal_error, "printing %s", buf);
+	signal_ferror (Qinternal_error, "SERIOUS XEMACS BUG: printing %s; "
+		       "save your buffers immediately and please report "
+		       "this bug", buf);
 #endif /* not ERROR_CHECK_TYPES */
     }
   write_fmt_string (printcharfun,
-		    "#<EMACS BUG: %s Save your buffers immediately and "
-		    "please report this bug>", buf);
+		    "#<SERIOUS XEMACS BUG: %s Save your buffers immediately "
+		    "and please report this bug>", buf);
 }
 
 void
@@ -1589,6 +1680,13 @@
   /* Just to be safe ... */
   GCPRO2 (obj, printcharfun);
 
+  /* WARNING WARNING WARNING!!!  Don't put anything here that might
+     dereference memory.  Instead, put it down inside of
+     the case Lisp_Type_Record, after the appropriate checks to make sure
+     we're not dereferencing bad memory.  The idea is that, ideally,
+     calling debug_print() should *NEVER* make the program crash, even when
+     something very bad has happened. --ben */
+
 #ifdef I18N3
   /* #### Both input and output streams should have a flag associated
      with them indicating whether output to that stream, or strings
@@ -1601,23 +1699,6 @@
      output. */
 #endif
 
-  /* Detect circularities and truncate them.
-     No need to offer any alternative--this is better than an error.  */
-  if (CONSP (obj) || VECTORP (obj) || COMPILED_FUNCTIONP (obj))
-    {
-      int i;
-      for (i = 0; i < print_depth; i++)
-	if (EQ (obj, being_printed[i]))
-	  {
-	    char buf[DECIMAL_PRINT_SIZE (long) + 1];
-	    *buf = '#';
-	    long_to_string (buf + 1, i);
-	    write_c_string (printcharfun, buf);
-	    UNGCPRO;
-	    return;
-	  }
-    }
-
   being_printed[print_depth] = obj;
 
   /* Avoid calling internal_bind_int, which conses, when called from
@@ -1627,7 +1708,8 @@
       specdepth = internal_bind_int (&print_depth, print_depth + 1);
 
       if (print_depth > PRINT_CIRCLE)
-	signal_error (Qstack_overflow, "Apparently circular structure being printed", Qunbound);
+	signal_error (Qstack_overflow,
+		      "Apparently circular structure being printed", Qunbound);
     }
 
   switch (XTYPE (obj))
@@ -1635,9 +1717,9 @@
     case Lisp_Type_Int_Even:
     case Lisp_Type_Int_Odd:
       {
-	char buf[DECIMAL_PRINT_SIZE (EMACS_INT)];
+	Ascbyte buf[DECIMAL_PRINT_SIZE (EMACS_INT)];
 	long_to_string (buf, XINT (obj));
-	write_c_string (printcharfun, buf);
+	write_ascstring (printcharfun, buf);
 	break;
       }
 
@@ -1710,69 +1792,100 @@
       {
 	struct lrecord_header *lheader = XRECORD_LHEADER (obj);
 
-	/* Try to check for various sorts of bogus pointers if we're in a
-	   situation where it may be likely -- i.e. called from
-	   debug_print() or we're already crashing.  In such cases,
-	   (further) crashing is counterproductive. */
+	/* Try to check for various sorts of bogus pointers or bad memory
+	   if we're in a situation where it may be likely -- i.e. called
+	   from debug_print() or we're already crashing.  In such cases,
+	   (further) crashing is counterproductive.
+
+	   We don't normally do these because they may be expensive or
+	   weird (e.g. under Unix we typically have to set a SIGSEGV
+	   handler and try to trigger a seg fault). */
 
+	if (!lheader)
+	  {
+	    /* i.e. EQ Qnull_pointer */
+	    printing_major_badness (printcharfun, "NULL POINTER LRECORD", 0,
+				    0, 0, BADNESS_NO_TYPE);
+	    break;
+	  }
+
+	/* First check to see if the lrecord header itself is garbage. */
 	if (inhibit_non_essential_conversion_operations &&
 	    !debug_can_access_memory (lheader, sizeof (*lheader)))
+	  {
+	    printing_major_badness (printcharfun,
+				    "BAD MEMORY in LRECORD HEADER", 0,
+				    lheader, 0, BADNESS_NO_TYPE);
+	      break;
+	  }
+
+	/* Check to see if the lrecord type is garbage. */
+#ifndef NEW_GC
+	if (lheader->type == lrecord_type_free)
+	  {
+	    printing_major_badness (printcharfun, "FREED LRECORD", 0,
+				    lheader, 0, BADNESS_NO_TYPE);
+	    break;
+	  }
+	if (lheader->type == lrecord_type_undefined)
+	  {
+	    printing_major_badness (printcharfun, "LRECORD_TYPE_UNDEFINED", 0,
+				    lheader, 0, BADNESS_NO_TYPE);
+	    break;
+	  }
+#endif /* not NEW_GC */
+	if ((int) (lheader->type) >= lrecord_type_count)
+	  {
+	    printing_major_badness (printcharfun, "ILLEGAL LRECORD TYPE",
+				    (int) (lheader->type),
+				    lheader, 0, BADNESS_POINTER_OBJECT);
+	    break;
+	  }
+
+	/* Check to see if the lrecord implementation is missing or garbage. */
+	{
+	  const struct lrecord_implementation *imp =
+	    LHEADER_IMPLEMENTATION (lheader);
+
+	  if (!imp)
 	    {
-	      write_fmt_string (printcharfun, "#<EMACS BUG: BAD MEMORY %p>",
-				lheader);
+	      printing_major_badness
+		(printcharfun, "NO IMPLEMENTATION FOR LRECORD TYPE",
+		 (int) (lheader->type),
+		 lheader, 0, BADNESS_POINTER_OBJECT);
 	      break;
 	    }
 
-	if (CONSP (obj) || VECTORP (obj))
-	  {
-	    /* If deeper than spec'd depth, print placeholder.  */
-	    if (INTP (Vprint_level)
-		&& print_depth > XINT (Vprint_level))
-	      {
-		write_c_string (printcharfun, "...");
-		break;
-	      }
-	  }
+	  if (inhibit_non_essential_conversion_operations)
+	    {
+	      if (!debug_can_access_memory (imp, sizeof (*imp)))
+		{
+		  printing_major_badness
+		    (printcharfun, "BAD MEMORY IN LRECORD IMPLEMENTATION",
+		     (int) (lheader->type),
+		     lheader, 0, BADNESS_POINTER_OBJECT);
+		}
+	    }
+	}
 
-#ifndef NEW_GC
-	if (lheader->type == lrecord_type_free)
-	  {
-	    printing_major_badness (printcharfun, "freed lrecord", 0,
-				    lheader, BADNESS_NO_TYPE);
-	    break;
-	  }
-	else if (lheader->type == lrecord_type_undefined)
-	  {
-	    printing_major_badness (printcharfun, "lrecord_type_undefined", 0,
-				    lheader, BADNESS_NO_TYPE);
-	    break;
-	  }
-#endif /* not NEW_GC */
-	else if ((int) (lheader->type) >= lrecord_type_count)
-	  {
-	    printing_major_badness (printcharfun, "illegal lrecord type",
-				    (int) (lheader->type),
-				    lheader, BADNESS_POINTER_OBJECT);
-	    break;
-	  }
-
-	/* Further checks for bad memory in critical situations.  We don't
-	   normally do these because they may be expensive or weird
-	   (e.g. under Unix we typically have to set a SIGSEGV handler and
-	   try to trigger a seg fault). */
+	/* Check to see if any of the memory of the lrecord is inaccessible.
+	   Note that we already checked above to see if the first part of
+	   the lrecord (the header) is inaccessible, which will catch most
+	   cases of a totally bad pointer.  */
 
 	if (inhibit_non_essential_conversion_operations)
 	  {
 	    if (!debug_can_access_memory
 		(lheader, detagged_lisp_object_size (lheader)))
 	      {
-		write_fmt_string (printcharfun,
-				  "#<EMACS BUG: type %s BAD MEMORY %p>",
-				  LHEADER_IMPLEMENTATION (lheader)->name,
-				  lheader);
+		printing_major_badness (printcharfun,
+					"BAD MEMORY IN LRECORD",
+					(int) (lheader->type),
+					lheader, 0, BADNESS_POINTER_OBJECT);
 		break;
 	      }
 
+	    /* For strings, also check the data of the string itself. */
 	    if (STRINGP (obj))
 	      {
 #ifdef NEW_GC
@@ -1789,16 +1902,45 @@
 		Lisp_String *l = (Lisp_String *) lheader;
 		if (!debug_can_access_memory (l->data_, l->size_))
 		  {
-		    write_fmt_string
-		      (printcharfun,
-		       "#<EMACS BUG: %p (BAD STRING DATA %p)>",
-		       lheader, l->data_);
+		    printing_major_badness (printcharfun,
+		       "BAD STRING DATA", (int) (lheader->type),
+					    lheader, l->data_,
+					    BADNESS_POINTER_OBJECT_WITH_DATA);
 		    break;
 		  }
 #endif /* not NEW_GC */
 	      }
 	  }
 
+	/* Detect circularities and truncate them.
+	   No need to offer any alternative--this is better than an error.  */
+	if (CONSP (obj) || VECTORP (obj) || COMPILED_FUNCTIONP (obj))
+	  {
+	    int i;
+	    for (i = 0; i < print_depth - 1; i++)
+	      if (EQ (obj, being_printed[i]))
+		{
+		  Ascbyte buf[DECIMAL_PRINT_SIZE (long) + 1];
+		  *buf = '#';
+		  long_to_string (buf + 1, i);
+		  write_ascstring (printcharfun, buf);
+		  break;
+		}
+	    if (i < print_depth - 1) /* Did we print something? */
+	      break;
+	  }
+
+	if (CONSP (obj) || VECTORP (obj))
+	  {
+	    /* If deeper than spec'd depth, print placeholder.  */
+	    if (INTP (Vprint_level)
+		&& print_depth > XINT (Vprint_level))
+	      {
+		write_ascstring (printcharfun, "...");
+		break;
+	      }
+	  }
+
 	/* Either use a custom-written printer, or use
 	   internal_object_printer or external_object_printer, depending on
 	   whether the object is internal (not visible at Lisp level) or
@@ -1812,8 +1954,9 @@
     default:
       {
 	/* We're in trouble if this happens! */
-	printing_major_badness (printcharfun, "illegal data type", XTYPE (obj),
-				LISP_TO_VOID (obj), BADNESS_INTEGER_OBJECT);
+	printing_major_badness (printcharfun, "ILLEGAL LISP OBJECT TAG TYPE",
+				XTYPE (obj), STORE_LISP_IN_VOID (obj), 0,
+				BADNESS_INTEGER_OBJECT);
 	break;
       }
     }
@@ -1827,10 +1970,10 @@
 print_float (Lisp_Object obj, Lisp_Object printcharfun,
 	     int UNUSED (escapeflag))
 {
-  char pigbuf[350];	/* see comments in float_to_string */
+  Ascbyte pigbuf[350];	/* see comments in float_to_string */
 
   float_to_string (pigbuf, XFLOAT_DATA (obj));
-  write_c_string (printcharfun, pigbuf);
+  write_ascstring (printcharfun, pigbuf);
 }
 
 void
@@ -1866,9 +2009,9 @@
 	  Lisp_Object tem = Fassq (obj, Vprint_gensym_alist);
 	  if (CONSP (tem))
 	    {
-	      write_c_string (printcharfun, "#");
+	      write_ascstring (printcharfun, "#");
 	      print_internal (XCDR (tem), printcharfun, escapeflag);
-	      write_c_string (printcharfun, "#");
+	      write_ascstring (printcharfun, "#");
 	      UNGCPRO;
 	      return;
 	    }
@@ -1886,12 +2029,12 @@
 		tem = make_int (1);
 	      Vprint_gensym_alist = Fcons (Fcons (obj, tem), Vprint_gensym_alist);
 
-	      write_c_string (printcharfun, "#");
+	      write_ascstring (printcharfun, "#");
 	      print_internal (tem, printcharfun, escapeflag);
-	      write_c_string (printcharfun, "=");
+	      write_ascstring (printcharfun, "=");
 	    }
 	}
-      write_c_string (printcharfun, "#:");
+      write_ascstring (printcharfun, "#:");
     }
 
   /* Does it look like an integer or a float? */
@@ -1926,7 +2069,7 @@
          from FSF.  --hniksic */
       confusing = isfloat_string ((char *) data);
     if (confusing)
-      write_c_string (printcharfun, "\\");
+      write_ascstring (printcharfun, "\\");
   }
 
   {
@@ -1951,7 +2094,7 @@
 	  case '[': case ']' : case '?' :
 	    if (i > last)
 	      output_string (printcharfun, 0, name, last, i - last);
-	    write_c_string (printcharfun, "\\");
+	    write_ascstring (printcharfun, "\\");
 	    last = i;
 	  }
       }
@@ -2010,8 +2153,8 @@
   if (alternate_do_pointer + extlen >= alternate_do_size)
     {
       alternate_do_size =
-	max(alternate_do_size * 2, alternate_do_pointer + extlen + 1);
-      XREALLOC_ARRAY (alternate_do_string, char, alternate_do_size);
+	max (alternate_do_size * 2, alternate_do_pointer + extlen + 1);
+      XREALLOC_ARRAY (alternate_do_string, CIbyte, alternate_do_size);
     }
   memcpy (alternate_do_string + alternate_do_pointer, extptr, extlen);
   alternate_do_pointer += extlen;
@@ -2128,23 +2271,44 @@
   return Qnil;
 }
 
+static Lisp_Object
+restore_inhibit_non_essential_conversion_operations (Lisp_Object obj)
+{
+  inhibit_non_essential_conversion_operations = XINT (obj);
+  return Qnil;
+}
+
+/* Bind the value of inhibit_non_essential_conversion_operations to 1
+   in a way that involves no consing. */
+static int
+begin_inhibit_non_essential_conversion_operations (void)
+{
+  int depth =
+    record_unwind_protect
+    (restore_inhibit_non_essential_conversion_operations,
+     make_int (inhibit_non_essential_conversion_operations));
+  inhibit_non_essential_conversion_operations = 1;
+  return depth;
+}
+
 static int debug_print_length   = 50;
 static int debug_print_level    = 15;
 static int debug_print_readably = -1;
 
 /* Restore values temporarily bound by debug_prin1.  We use this approach to
-   avoid consing in debug_prin1.  That is verboten, since debug_prin1 can be
+   avoid consing in debug_prin1.  That is verboten, since debug_print can be
    called by cons debugging code. */
 static Lisp_Object
-debug_prin1_exit (Lisp_Object UNUSED (ignored))
+debug_print_exit (Lisp_Object val)
 {
-  struct debug_bindings *bindings = 
-    (struct debug_bindings *) XOPAQUE (debug_prin1_bindings)->data;
+  struct debug_bindings *bindings =
+    (struct debug_bindings *) GET_VOID_FROM_LISP (val);
   inhibit_non_essential_conversion_operations =
     bindings->inhibit_non_essential_conversion_operations;
   print_depth = bindings->print_depth;
   print_readably = bindings->print_readably;
   print_unbuffered = bindings->print_unbuffered;
+  in_debug_print = bindings->in_debug_print;
   gc_currently_forbidden = bindings->gc_currently_forbidden;
   Vprint_length = bindings->Vprint_length;
   Vprint_level = bindings->Vprint_level;
@@ -2152,6 +2316,47 @@
   return Qnil;
 }
 
+/* Save values and bind them to new values suitable for debug output.  We
+   try very hard to avoid any Lisp allocation (i.e. consing) during the
+   operation of debug printing, since we might be calling it from inside GC
+   or other sensitive places.  This means we have to be a bit careful with
+   record_unwind_protect to not create any temporary Lisp objects. */
+
+static int
+debug_print_enter (struct debug_bindings *bindings)
+{
+  /* by doing this, we trick various things that are non-essential
+     but might cause crashes into not getting executed. */
+  int specdepth;
+
+  bindings->inhibit_non_essential_conversion_operations =
+    inhibit_non_essential_conversion_operations;
+  bindings->print_depth = print_depth;
+  bindings->print_readably = print_readably;
+  bindings->print_unbuffered = print_unbuffered;
+  bindings->in_debug_print = in_debug_print;
+  bindings->gc_currently_forbidden = gc_currently_forbidden;
+  bindings->Vprint_length = Vprint_length;
+  bindings->Vprint_level = Vprint_level;
+  bindings->Vinhibit_quit = Vinhibit_quit;
+  specdepth = record_unwind_protect (debug_print_exit,
+				     STORE_VOID_IN_LISP (bindings));
+
+  inhibit_non_essential_conversion_operations = 1;
+  print_depth = 0;
+  print_readably = debug_print_readably != -1 ? debug_print_readably : 0;
+  print_unbuffered++;
+  in_debug_print = 1;
+  gc_currently_forbidden = 1;
+  if (debug_print_length > 0)
+    Vprint_length = make_int (debug_print_length);
+  if (debug_print_level > 0)
+    Vprint_level = make_int (debug_print_level);
+  Vinhibit_quit = Qt;
+
+  return specdepth;
+}
+
 /* Print an object, `prin1'-style, to various possible debugging outputs.
    Make sure it's completely unbuffered so that, in the event of a crash
    somewhere, we see as much as possible that happened before it.
@@ -2159,34 +2364,9 @@
 static void
 debug_prin1 (Lisp_Object debug_print_obj, int flags)
 {
-  /* This function can GC */
-
-  /* by doing this, we trick various things that are non-essential
-     but might cause crashes into not getting executed. */
-  int specdepth;
-  struct debug_bindings *bindings = 
-    (struct debug_bindings *) XOPAQUE (debug_prin1_bindings)->data;
-
-  bindings->inhibit_non_essential_conversion_operations =
-    inhibit_non_essential_conversion_operations;
-  bindings->print_depth = print_depth;
-  bindings->print_readably = print_readably;
-  bindings->print_unbuffered = print_unbuffered;
-  bindings->gc_currently_forbidden = gc_currently_forbidden;
-  bindings->Vprint_length = Vprint_length;
-  bindings->Vprint_level = Vprint_level;
-  bindings->Vinhibit_quit = Vinhibit_quit;
-  specdepth = record_unwind_protect (debug_prin1_exit, Qnil);
-
-  inhibit_non_essential_conversion_operations = 1;
-  print_depth = 0;
-  print_readably = debug_print_readably != -1 ? debug_print_readably : 0;
-  print_unbuffered++;
-  if (debug_print_length > 0)
-    Vprint_length = make_int (debug_print_length);
-  if (debug_print_level > 0)
-    Vprint_level = make_int (debug_print_level);
-  Vinhibit_quit = Qt;
+  /* This function cannot GC, since GC is forbidden */
+  struct debug_bindings bindings;
+  int specdepth = debug_print_enter (&bindings);
 
   if ((flags & EXT_PRINT_STDOUT) || (flags & EXT_PRINT_STDERR))
     print_internal (debug_print_obj, Qexternal_debugging_output, 1);
@@ -2206,7 +2386,6 @@
 void
 debug_p4 (Lisp_Object obj)
 {
-  inhibit_non_essential_conversion_operations = 1;
   if (STRINGP (obj))
     debug_out ("\"%s\"", XSTRING_DATA (obj));
   else if (CONSP (obj))
@@ -2280,42 +2459,41 @@
 				((struct old_lcrecord_header *) header)->uid));
 #endif /* not NEW_GC */
     }
-
-  inhibit_non_essential_conversion_operations = 0;
 }
 
-static void
+static int
 ext_print_begin (int dest)
 {
+  int depth = begin_inhibit_non_essential_conversion_operations ();
   if (dest & EXT_PRINT_ALTERNATE)
     alternate_do_pointer = 0;
   if (dest & (EXT_PRINT_STDERR | EXT_PRINT_STDOUT))
     stdout_clear_before_next_output = 1;
+  return depth;
 }
 
 static void
-ext_print_end (int dest)
+ext_print_end (int dest, int depth)
 {
   if (dest & (EXT_PRINT_MSWINDOWS | EXT_PRINT_STDERR | EXT_PRINT_STDOUT))
     external_out (dest & (EXT_PRINT_MSWINDOWS | EXT_PRINT_STDERR |
 			  EXT_PRINT_STDOUT), "\n");
+  unbind_to (depth);
 }
 
 static void
 external_debug_print (Lisp_Object object, int dest)
 {
-  ext_print_begin (dest);
+  int depth = ext_print_begin (dest);
   debug_prin1 (object, dest);
-  ext_print_end (dest);
+  ext_print_end (dest, depth);
 }
 
 void
 debug_p3 (Lisp_Object obj)
 {
   debug_p4 (obj);
-  inhibit_non_essential_conversion_operations = 1;
   debug_out ("\n");
-  inhibit_non_essential_conversion_operations = 0;
 }
 
 void
@@ -2347,22 +2525,9 @@
 void
 debug_backtrace (void)
 {
-  /* This function can GC */
-
-  /* by doing this, we trick various things that are non-essential
-     but might cause crashes into not getting executed. */
-  int specdepth = 
-    internal_bind_int (&inhibit_non_essential_conversion_operations, 1);
-
-  internal_bind_int (&print_depth, 0);
-  internal_bind_int (&print_readably, 0);
-  internal_bind_int (&print_unbuffered, print_unbuffered + 1);
-  if (debug_print_length > 0)
-    internal_bind_lisp_object (&Vprint_length, make_int (debug_print_length));
-  if (debug_print_level > 0)
-    internal_bind_lisp_object (&Vprint_level, make_int (debug_print_level));
-  /* #### Do we need this?  It was in the old code. */
-  internal_bind_lisp_object (&Vinhibit_quit, Vinhibit_quit);
+  /* This function cannot GC, since GC is forbidden */
+  struct debug_bindings bindings;
+  int specdepth = debug_print_enter (&bindings);
 
   Fbacktrace (Qexternal_debugging_output, Qt);
   stderr_out ("\n");
@@ -2383,6 +2548,7 @@
 {
   int first = 1;
   struct backtrace *bt = backtrace_list;
+
   debug_out ("   [");
   while (length > 0 && bt)
     {
@@ -2562,10 +2728,9 @@
 */ );
   Vprint_message_label = Qprint;
 
-  debug_prin1_bindings =
-    make_opaque (OPAQUE_UNINIT, sizeof (struct debug_bindings));
-  staticpro (&debug_prin1_bindings);
-
+  /* The exact size doesn't matter since we realloc when necessary.
+     Use CIbyte instead of Ibyte so that debuggers show the associated
+     string automatically. */
   alternate_do_size = 5000;
-  alternate_do_string = xnew_array(char, 5000);
+  alternate_do_string = xnew_array (CIbyte, 5000);
 }
--- a/src/process-nt.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/process-nt.c	Wed Feb 24 01:58:04 2010 -0600
@@ -692,11 +692,10 @@
  */
 
 static DOESNT_RETURN
-mswindows_report_winsock_error (const char *string, Lisp_Object data,
+mswindows_report_winsock_error (const Ascbyte *reason, Lisp_Object data,
 				int errnum)
 {
-  report_file_type_error (Qnetwork_error, mswindows_lisp_error (errnum),
-			  string, data);
+  signal_error_2 (Qnetwork_error, reason, mswindows_lisp_error (errnum), data);
 }
 
 static void
@@ -860,7 +859,7 @@
 	 args_or_ret);
 
     /* #### What about path names, which may be links? */
-    LISP_STRING_TO_TSTR (args_or_ret, command_line);
+    command_line = LISP_STRING_TO_TSTR (args_or_ret);
 
     UNGCPRO; /* args_or_ret */
   }
@@ -1236,7 +1235,7 @@
     Extbyte *hostext;
     unsigned long inaddr;
 
-    LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding);
+    hostext = LISP_STRING_TO_EXTERNAL (host, Qmswindows_host_name_encoding);
     inaddr = inet_addr (hostext);
     if (inaddr != INADDR_NONE)
       {
@@ -1254,7 +1253,7 @@
   {
     Extbyte *hostext;
 
-    LISP_STRING_TO_EXTERNAL (host, hostext, Qmswindows_host_name_encoding);
+    hostext = LISP_STRING_TO_EXTERNAL (host, Qmswindows_host_name_encoding);
 
     hasync = WSAAsyncGetHostByName (hwnd, XM_SOCKREPLY, hostext,
 				    buf, sizeof (buf));
@@ -1312,7 +1311,8 @@
     return host;
 
   if (address.sin_family == AF_INET)
-    return build_string (inet_ntoa (address.sin_addr));
+    return build_extstring (inet_ntoa (address.sin_addr),
+			     Qunix_host_name_encoding);
   else
     return host;
 }
@@ -1347,8 +1347,8 @@
       Extbyte *servext;
 
       CHECK_STRING (service);
-      LISP_STRING_TO_EXTERNAL (service, servext,
-			       Qmswindows_service_name_encoding);
+      servext = LISP_STRING_TO_EXTERNAL (service,
+					 Qmswindows_service_name_encoding);
 
       svc_info = getservbyname (servext, "tcp");
       if (svc_info == 0)
--- a/src/process-unix.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/process-unix.c	Wed Feb 24 01:58:04 2010 -0600
@@ -126,7 +126,7 @@
 close_process_descs_mapfun (const void *UNUSED (key), void *contents,
 			    void *UNUSED (arg))
 {
-  Lisp_Object proc = VOID_TO_LISP (contents);
+  Lisp_Object proc = GET_LISP_FROM_VOID (contents);
   USID vaffan, culo;
 
   event_stream_delete_io_streams (XPROCESS (proc)->pipe_instream,
@@ -222,8 +222,8 @@
      grovelling code in allocate_pty_the_old_fashioned_way(). */
   int master_fd = -1;
   const Extbyte *slave_name = NULL;
-  const CIbyte *clone = NULL;
-  static const CIbyte * const clones[] =
+  const Ascbyte *clone = NULL;
+  static const Ascbyte * const clones[] =
     /* Different pty master clone devices */
     {
       "/dev/ptmx",      /* Various systems */
@@ -307,7 +307,7 @@
   {
     Ibyte *slaveint;
 
-    EXTERNAL_TO_C_STRING (slave_name, slaveint, Qfile_name);
+    slaveint = EXTERNAL_TO_ITEXT (slave_name, Qfile_name);
     qxestrncpy (pty_name, slaveint, sizeof (pty_name));
   }
 
@@ -334,9 +334,7 @@
     struct group *tty_group = getgrnam ("tty");
     if (tty_group != NULL)
       {
-	Extbyte *ptyout;
-
-	C_STRING_TO_EXTERNAL (pty_name, ptyout, Qfile_name);
+	Extbyte *ptyout = ITEXT_TO_EXTERNAL (pty_name, Qfile_name);
 	chown (ptyout, (uid_t) -1, tty_group->gr_gid);
       }
   }
@@ -458,7 +456,7 @@
       h_errno = 0;
 #endif
 
-      LISP_STRING_TO_EXTERNAL (host, hostext, Qunix_host_name_encoding);
+      hostext = LISP_STRING_TO_EXTERNAL (host, Qunix_host_name_encoding);
 
       /* Some systems can't handle SIGIO/SIGALARM in gethostbyname. */
       slow_down_interrupts ();
@@ -482,7 +480,7 @@
       Extbyte *hostext;
 
       /* Attempt to interpret host as numeric inet address */
-      LISP_STRING_TO_EXTERNAL (host, hostext, Qunix_host_name_encoding);
+      hostext = LISP_STRING_TO_EXTERNAL (host, Qunix_host_name_encoding);
       numeric_addr = inet_addr (hostext);
       if (NUMERIC_ADDR_ERROR)
 	{
@@ -524,10 +522,9 @@
 	  Extbyte *tailportext;
 
 	  CHECK_STRING (tail_port);
-	  TO_EXTERNAL_FORMAT (LISP_STRING, tail_port, C_STRING_ALLOCA,
-			      tailportext, Qnative);
-
-	  svc_info = getservbyname (tailportext, proto);
+	  svc_info = getservbyname (LISP_STRING_TO_EXTERNAL
+				    (tail_port, Qunix_service_name_encoding),
+				    proto);
 	  if ((svc_info != 0) && (svc_info->s_port == port))
 	    break;
 	  else
@@ -1300,7 +1297,7 @@
   if (separate_err)
     retry_close (forkerr);
 
-  p->tty_name = pty_flag ? build_intstring (pty_name) : Qnil;
+  p->tty_name = pty_flag ? build_istring (pty_name) : Qnil;
 
   /* Notice that SIGCHLD was not blocked. (This is not possible on
      some systems.) No biggie if SIGCHLD occurs right around the
@@ -1816,16 +1813,14 @@
 #endif
   hints.ai_socktype = SOCK_STREAM;
   hints.ai_protocol = 0;
-  LISP_STRING_TO_EXTERNAL (host, ext_host, Qnative);
+  ext_host = LISP_STRING_TO_EXTERNAL (host, Qunix_host_name_encoding);
   retval = getaddrinfo (ext_host, NULL, &hints, &res);
   if (retval != 0)
     {
-      CIbyte *gai_err;
-
-      EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_err,
-			    Qstrerror_encoding);
-      maybe_signal_error (Qio_error, gai_err, host,
-			  Qprocess, ERROR_ME_DEBUG_WARN);
+      maybe_signal_error_2 (Qio_error, "Canonicalizing host name",
+			    build_extstring (gai_strerror (retval),
+					     Qstrerror_encoding),
+			    host, Qprocess, ERROR_ME_DEBUG_WARN);
       canonname = host;
     }
   else
@@ -1833,7 +1828,8 @@
       int gni = getnameinfo (res->ai_addr, res->ai_addrlen,
 			     addrbuf, sizeof(addrbuf),
 			     NULL, 0, NI_NUMERICHOST);
-      canonname = gni ? host : build_ext_string (addrbuf, Qnative);
+      canonname = gni ? host : build_extstring (addrbuf,
+						 Qunix_host_name_encoding);
 
       freeaddrinfo (res);
     }
@@ -1846,7 +1842,8 @@
     return host;
 
   if (address.sin_family == AF_INET)
-    return build_string (inet_ntoa (address.sin_addr));
+    return build_extstring (inet_ntoa (address.sin_addr),
+			     Qunix_host_name_encoding);
   else
     /* #### any clue what to do here? */
     return host;
@@ -1899,8 +1896,8 @@
     else
       {
 	CHECK_STRING (service);
-	LISP_STRING_TO_EXTERNAL (service, portstring,
-				 Qunix_service_name_encoding);
+	portstring = LISP_STRING_TO_EXTERNAL (service,
+					      Qunix_service_name_encoding);
 	port = 0;
       }
 
@@ -1912,15 +1909,14 @@
     else /* EQ (protocol, Qudp) */
       hints.ai_socktype = SOCK_DGRAM;
     hints.ai_protocol = 0;
-    LISP_STRING_TO_EXTERNAL (host, ext_host, Qunix_host_name_encoding);
+    ext_host = LISP_STRING_TO_EXTERNAL (host, Qunix_host_name_encoding);
     retval = getaddrinfo (ext_host, portstring, &hints, &res);
     if (retval != 0)
       {
-	CIbyte *gai_err;
-
-	EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_err,
-			      Qstrerror_encoding);
-	signal_error (Qio_error, gai_err, list2 (host, service));
+	signal_error_2 (Qio_error, "Converting host name to IP address",
+			build_extstring (gai_strerror (retval),
+					 Qstrerror_encoding),
+			list2 (host, service));
       }
 
     /* address loop */
@@ -1939,8 +1935,8 @@
 	Extbyte *servext;
 
 	CHECK_STRING (service);
-	LISP_STRING_TO_EXTERNAL (service, servext,
-				 Qunix_service_name_encoding);
+	servext = LISP_STRING_TO_EXTERNAL (service,
+					   Qunix_service_name_encoding);
 
 	if (EQ (protocol, Qtcp))
 	  svc_info = getservbyname (servext, "tcp");
--- a/src/process.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/process.c	Wed Feb 24 01:58:04 2010 -0600
@@ -2,7 +2,7 @@
    Copyright (C) 1985, 1986, 1987, 1988, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2001, 2002, 2004, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2001, 2002, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -145,12 +145,12 @@
 }
 
 static void
-print_process (Lisp_Object object, Lisp_Object printcharfun, int escapeflag)
+print_process (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
-  Lisp_Process *process = XPROCESS (object);
+  Lisp_Process *process = XPROCESS (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<process %s>", XSTRING_DATA (process->name));
+    printing_unreadable_lcrecord (obj, XSTRING_DATA (process->name));
 
   if (!escapeflag)
     {
@@ -158,16 +158,16 @@
     }
   else
     {
-      int netp = network_connection_p (object);
-      write_c_string (printcharfun,
+      int netp = network_connection_p (obj);
+      write_ascstring (printcharfun,
 		      netp ? GETTEXT ("#<network connection ") :
 		      GETTEXT ("#<process "));
       print_internal (process->name, printcharfun, 1);
-      write_c_string (printcharfun, (netp ? " " : " pid "));
+      write_ascstring (printcharfun, (netp ? " " : " pid "));
       print_internal (process->pid, printcharfun, 1);
       write_fmt_string_lisp (printcharfun, " state:%S", 1, process->status_symbol);
       MAYBE_PROCMETH (print_process_data, (process, printcharfun));
-      write_c_string (printcharfun, ">");
+      write_ascstring (printcharfun, ">");
     }
 }
 
@@ -188,7 +188,7 @@
   if (p->process_data)
     {
       MAYBE_PROCMETH (finalize_process_data, (p));
-      xfree (p->process_data, void *);
+      xfree (p->process_data);
     }
 }
 
@@ -227,7 +227,7 @@
   if (gethash ((const void*)usid, usid_to_process, &vval))
     {
       Lisp_Object process;
-      process = VOID_TO_LISP (vval);
+      process = GET_LISP_FROM_VOID (vval);
       return XPROCESS (process);
     }
   else
@@ -449,15 +449,15 @@
 /************************************************************************/
 
 DOESNT_RETURN
-report_process_error (const char *string, Lisp_Object data)
+report_process_error (const Ascbyte *reason, Lisp_Object data)
 {
-  report_error_with_errno (Qprocess_error, string, data);
+  report_error_with_errno (Qprocess_error, reason, data);
 }
 
 DOESNT_RETURN
-report_network_error (const char *string, Lisp_Object data)
+report_network_error (const Ascbyte *reason, Lisp_Object data)
 {
-  report_error_with_errno (Qnetwork_error, string, data);
+  report_error_with_errno (Qnetwork_error, reason, data);
 }
 
 Lisp_Object
@@ -475,12 +475,12 @@
   name1 = name;
   for (i = 1; ; i++)
     {
-      char suffix[10];
+      Ascbyte suffix[10];
       Lisp_Object tem = Fget_process (name1);
       if (NILP (tem))
         break;
       sprintf (suffix, "<%d>", i);
-      name1 = concat2 (name, build_string (suffix));
+      name1 = concat2 (name, build_ascstring (suffix));
     }
   name = name1;
   p->name = name;
@@ -554,14 +554,14 @@
     {
       Lisp_Object process = Qnil;
       process = wrap_process (p);
-      puthash ((const void*) in_usid, LISP_TO_VOID (process), usid_to_process);
+      puthash ((const void*) in_usid, STORE_LISP_IN_VOID (process), usid_to_process);
     }
 
   if (err_usid != USID_DONTHASH)
     {
       Lisp_Object process = Qnil;
       process = wrap_process (p);
-      puthash ((const void*) err_usid, LISP_TO_VOID (process),
+      puthash ((const void*) err_usid, STORE_LISP_IN_VOID (process),
 	       usid_to_process);
     }
 
@@ -740,7 +740,7 @@
 
       tem = Qnil;
       NGCPRO1 (tem);
-      locate_file (list1 (build_string ("")), program, Vlisp_EXEC_SUFFIXES,
+      locate_file (list1 (build_ascstring ("")), program, Vlisp_EXEC_SUFFIXES,
 		   &tem, X_OK);
       if (NILP (tem))
 	signal_error (Qprocess_error, "Searching for program", program);
@@ -1564,11 +1564,11 @@
 
   if (EQ (symbol, Qsignal) || EQ (symbol, Qstop))
     {
-      string = build_string (signal_name (code));
+      string = build_cistring (signal_name (code));
       if (coredump)
 	string2 = build_msg_string (" (core dumped)\n");
       else
-	string2 = build_string ("\n");
+	string2 = build_ascstring ("\n");
       set_string_char (string, 0,
 		       DOWNCASE (0, string_ichar (string, 0)));
       return concat2 (string, string2);
@@ -1581,7 +1581,7 @@
       if (coredump)
 	string2 = build_msg_string (" (core dumped)\n");
       else
-	string2 = build_string ("\n");
+	string2 = build_ascstring ("\n");
       return concat2 (build_msg_string ("exited abnormally with code "),
 		      concat2 (string, string2));
     }
@@ -1690,9 +1690,9 @@
 	      int spec = process_setup_for_insertion (process, 0);
 
 	      NGCPRO1 (process);
-	      buffer_insert_c_string (current_buffer, "\nProcess ");
+	      buffer_insert_ascstring (current_buffer, "\nProcess ");
 	      Finsert (1, &p->name);
-	      buffer_insert_c_string (current_buffer, " ");
+	      buffer_insert_ascstring (current_buffer, " ");
 	      Finsert (1, &msg);
 	      Fset_marker (p->mark, make_int (BUF_PT (current_buffer)),
 			   p->buffer);
@@ -2302,14 +2302,14 @@
 	  )
 	{
 	  XCAR (scan) = concat3 (make_string (var, varlen),
-				 build_string ("="),
+				 build_ascstring ("="),
 				 make_string (value, valuelen));
 	  return;
 	}
     }
 
   Vprocess_environment = Fcons (concat3 (make_string (var, varlen),
-					 build_string ("="),
+					 build_ascstring ("="),
 					 make_string (value, valuelen)),
 				Vprocess_environment);
 }
@@ -2342,7 +2342,7 @@
 */
        (var, interactivep))
 {
-  Ibyte *value;
+  Ibyte *value = NULL;
   Bytecount valuelen;
   Lisp_Object v = Qnil;
   struct gcpro gcpro1;
@@ -2428,12 +2428,13 @@
     _wgetenv (L""); /* force initialization of _wenviron */
     for (envp = (Extbyte **) _wenviron; envp && *envp; envp++)
       Vprocess_environment =
-	Fcons (build_ext_string (*envp, Qmswindows_unicode),
+	Fcons (build_extstring (*envp, Qmswindows_unicode),
 	       Vprocess_environment);
 #else
     for (envp = environ; envp && *envp; envp++)
       Vprocess_environment =
-	Fcons (build_ext_string (*envp, Qnative), Vprocess_environment);
+	Fcons (build_extstring (*envp, Qenvironment_variable_encoding),
+	       Vprocess_environment);
 #endif
     /* This gets set back to 0 in disksave_object_finalization() */
     env_initted = 1;
@@ -2472,12 +2473,12 @@
       {
 	Ibyte *faux_var = alloca_ibytes (7 + qxestrlen (shell));
 	qxesprintf (faux_var, "SHELL=%s", shell);
-	Vprocess_environment = Fcons (build_intstring (faux_var),
+	Vprocess_environment = Fcons (build_istring (faux_var),
 				      Vprocess_environment);
       }
 #endif /* 0 */
 
-    Vshell_file_name = build_intstring (shell);
+    Vshell_file_name = build_istring (shell);
   }
 }
 
@@ -2598,7 +2599,7 @@
 the operations needing this are lower level than what ELisp programs
 typically do, and in any case no equivalent exists under native MS Windows.
 */ );
-  Vnull_device = build_string (NULL_DEVICE);
+  Vnull_device = build_ascstring (NULL_DEVICE);
 
   DEFVAR_LISP ("process-connection-type", &Vprocess_connection_type /*
 Control type of device used to communicate with subprocesses.
@@ -2678,6 +2679,6 @@
 when Emacs starts.
 */ );
 
-  Vlisp_EXEC_SUFFIXES = build_string (EXEC_SUFFIXES);
+  Vlisp_EXEC_SUFFIXES = build_ascstring (EXEC_SUFFIXES);
   staticpro (&Vlisp_EXEC_SUFFIXES);
 }
--- a/src/process.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/process.h	Wed Feb 24 01:58:04 2010 -0600
@@ -55,8 +55,8 @@
 EXFUN (Fprocess_id, 1);
 
 MODULE_API
-DECLARE_DOESNT_RETURN (report_process_error (const char *, Lisp_Object));
-DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object));
+DECLARE_DOESNT_RETURN (report_process_error (const Ascbyte *, Lisp_Object));
+DECLARE_DOESNT_RETURN (report_network_error (const Ascbyte *, Lisp_Object));
 extern Lisp_Object Vlisp_EXEC_SUFFIXES;
 
 MODULE_API Ibyte *egetenv (const CIbyte *var);
--- a/src/profile.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/profile.c	Wed Feb 24 01:58:04 2010 -0600
@@ -315,13 +315,13 @@
 	long count;
 	const void *vval;
 
-	if (gethash (LISP_TO_VOID (fun), big_profile_table, &vval))
+	if (gethash (STORE_LISP_IN_VOID (fun), big_profile_table, &vval))
 	  count = (long) vval;
 	else
 	  count = 0;
 	count++;
 	vval = (const void *) count;
-	puthash (LISP_TO_VOID (fun), (void *) vval, big_profile_table);
+	puthash (STORE_LISP_IN_VOID (fun), (void *) vval, big_profile_table);
       }
 
       profiling_lock = 0;
@@ -463,7 +463,7 @@
     = (struct get_profiling_info_closure *) void_closure;
   EMACS_INT val;
 
-  key = VOID_TO_LISP (void_key);
+  key = GET_LISP_FROM_VOID (void_key);
   val = (EMACS_INT) void_val;
 
   Fputhash (key, make_int (val), closure->timing);
@@ -524,7 +524,7 @@
       /* OK, OK ...  the total-timing table is not going to have an entry
 	 for profile overhead, and it looks strange for it to come out 0,
 	 so make sure it looks reasonable. */
-      if (!gethash (LISP_TO_VOID (QSprofile_overhead), big_profile_table,
+      if (!gethash (STORE_LISP_IN_VOID (QSprofile_overhead), big_profile_table,
 		    &overhead))
 	overhead = 0;
       Fputhash (QSprofile_overhead, make_int ((EMACS_INT) overhead),
@@ -557,7 +557,7 @@
       ("Function timing count is not an integer in given entry",
        key, val);
 
-  puthash (LISP_TO_VOID (key), (void *) XINT (val), big_profile_table);
+  puthash (STORE_LISP_IN_VOID (key), (void *) XINT (val), big_profile_table);
 
   return 0;
 }
@@ -609,9 +609,9 @@
 			     void *UNUSED (void_closure))
 {
 #ifdef USE_KKCC
-  kkcc_gc_stack_push_lisp_object (VOID_TO_LISP (void_key), 0, -1);
+  kkcc_gc_stack_push_lisp_object (GET_LISP_FROM_VOID (void_key), 0, -1);
 #else /* NOT USE_KKCC */
-  mark_object (VOID_TO_LISP (void_key));
+  mark_object (GET_LISP_FROM_VOID (void_key));
 #endif /* NOT USE_KKCC */
   return 0;
 }
@@ -683,28 +683,28 @@
   profiling_lock = 0;
 
 #ifdef DEBUG_XEMACS
-  QSin_temp_spot_1 = build_msg_string ("(in temp spot 1)");
+  QSin_temp_spot_1 = build_defer_string ("(in temp spot 1)");
   staticpro (&QSin_temp_spot_1);
 
-  QSin_temp_spot_2 = build_msg_string ("(in temp spot 2)");
+  QSin_temp_spot_2 = build_defer_string ("(in temp spot 2)");
   staticpro (&QSin_temp_spot_2);
 
-  QSin_temp_spot_3 = build_msg_string ("(in temp spot 3)");
+  QSin_temp_spot_3 = build_defer_string ("(in temp spot 3)");
   staticpro (&QSin_temp_spot_3);
 
-  QSin_temp_spot_4 = build_msg_string ("(in temp spot 4)");
+  QSin_temp_spot_4 = build_defer_string ("(in temp spot 4)");
   staticpro (&QSin_temp_spot_4);
 
-  QSin_temp_spot_5 = build_msg_string ("(in temp spot 5)");
+  QSin_temp_spot_5 = build_defer_string ("(in temp spot 5)");
   staticpro (&QSin_temp_spot_5);
 #endif /* DEBUG_XEMACS */
 
-  QSunknown = build_msg_string ("(unknown)");
+  QSunknown = build_defer_string ("(unknown)");
   staticpro (&QSunknown);
   QSprocessing_events_at_top_level =
-    build_msg_string ("(processing events at top level)");
+    build_defer_string ("(processing events at top level)");
   staticpro (&QSprocessing_events_at_top_level);
-  QSprofile_overhead = build_msg_string ("(profile overhead)");
+  QSprofile_overhead = build_defer_string ("(profile overhead)");
   staticpro (&QSprofile_overhead);
 
   DEFSYMBOL (Qtiming);
--- a/src/rangetab.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/rangetab.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* XEmacs routines to deal with range tables.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 2002, 2004, 2005 Ben Wing.
+   Copyright (C) 1995, 2002, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -107,13 +107,13 @@
     write_fmt_string_lisp (printcharfun, "#s(range-table type %s data (",
 			   1, range_table_type_to_symbol (rt->type));
   else
-    write_c_string (printcharfun, "#<range-table ");
+    write_ascstring (printcharfun, "#<range-table ");
   for (i = 0; i < Dynarr_length (rt->entries); i++)
     {
       struct range_table_entry *rte = Dynarr_atp (rt->entries, i);
       int so, ec;
       if (i > 0)
-	write_c_string (printcharfun, " ");
+	write_ascstring (printcharfun, " ");
       switch (rt->type)
 	{
 	case RANGE_START_CLOSED_END_OPEN: so = 0, ec = 0; break;
@@ -131,13 +131,13 @@
       print_internal (rte->val, printcharfun, 1);
     }
   if (print_readably)
-    write_c_string (printcharfun, "))");
+    write_ascstring (printcharfun, "))");
   else
     write_fmt_string (printcharfun, " 0x%x>", rt->header.uid);
 }
 
 static int
-range_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+range_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   Lisp_Range_Table *rt1 = XRANGE_TABLE (obj1);
   Lisp_Range_Table *rt2 = XRANGE_TABLE (obj2);
@@ -153,7 +153,7 @@
 
       if (rte1->first != rte2->first
 	  || rte1->last != rte2->last
-	  || !internal_equal (rte1->val, rte2->val, depth + 1))
+	  || !internal_equal_0 (rte1->val, rte2->val, depth + 1, foldcase))
 	return 0;
     }
 
@@ -356,7 +356,7 @@
   rtnew->entries = Dynarr_new (range_table_entry);
   rtnew->type = rt->type;
 
-  Dynarr_add_many (rtnew->entries, Dynarr_atp (rt->entries, 0),
+  Dynarr_add_many (rtnew->entries, Dynarr_begin (rt->entries),
 		   Dynarr_length (rt->entries));
   return obj;
 }
@@ -375,7 +375,37 @@
   CHECK_INT_COERCE_CHAR (pos);
 
   return get_range_table (XINT (pos), Dynarr_length (rt->entries),
-			  Dynarr_atp (rt->entries, 0), default_);
+			  Dynarr_begin (rt->entries), default_);
+}
+
+static void
+external_to_internal_adjust_ends (enum range_table_type type,
+				  EMACS_INT *first, EMACS_INT *last)
+{
+  /* Fix up the numbers in accordance with the open/closedness to make
+     them behave like default open/closed. */
+  switch (type)
+    {
+    case RANGE_START_CLOSED_END_OPEN: break;
+    case RANGE_START_CLOSED_END_CLOSED: (*last)++; break;
+    case RANGE_START_OPEN_END_OPEN: (*first)++; break;
+    case RANGE_START_OPEN_END_CLOSED: (*first)++, (*last)++; break;
+    }
+}
+
+static void
+internal_to_external_adjust_ends (enum range_table_type type,
+				  EMACS_INT *first, EMACS_INT *last)
+{
+  /* Reverse the changes made in external_to_internal_adjust_ends().
+   */
+  switch (type)
+    {
+    case RANGE_START_CLOSED_END_OPEN: break;
+    case RANGE_START_CLOSED_END_CLOSED: (*last)--; break;
+    case RANGE_START_OPEN_END_OPEN: (*first)--; break;
+    case RANGE_START_OPEN_END_CLOSED: (*first)--, (*last)--; break;
+    }
 }
 
 void
@@ -386,17 +416,7 @@
   int insert_me_here = -1;
   Lisp_Range_Table *rt = XRANGE_TABLE (table);
 
-  /* Fix up the numbers in accordance with the open/closedness to make
-     them behave like default open/closed. */
-
-  switch (rt->type)
-    {
-    case RANGE_START_CLOSED_END_OPEN: break;
-    case RANGE_START_CLOSED_END_CLOSED: last++; break;
-    case RANGE_START_OPEN_END_OPEN: first++; break;
-    case RANGE_START_OPEN_END_CLOSED: first++, last++; break;
-    }
-
+  external_to_internal_adjust_ends (rt->type, &first, &last);
   if (first == last)
     return;
   if (first > last)
@@ -607,13 +627,7 @@
 	 table. */
       {
 	EMACS_INT premier = first, dernier = last;
-	switch (rt->type)
-	  {
-	  case RANGE_START_CLOSED_END_OPEN: break;
-	  case RANGE_START_CLOSED_END_CLOSED: dernier--; break;
-	  case RANGE_START_OPEN_END_OPEN: premier--; break;
-	  case RANGE_START_OPEN_END_CLOSED: premier--, dernier--; break;
-	  }
+	internal_to_external_adjust_ends (rt->type, &premier, &dernier);
 	args[1] = make_int (premier);
 	args[2] = make_int (dernier);
       }
@@ -754,6 +768,7 @@
 struct unified_range_table
 {
   int nentries;
+  enum range_table_type type;
   struct range_table_entry first;
 };
 
@@ -795,7 +810,8 @@
   * ((unsigned char *) dest + 3) = total_needed & 0xFF;
   un = (struct unified_range_table *) new_dest;
   un->nentries = Dynarr_length (rted);
-  memcpy (&un->first, Dynarr_atp (rted, 0),
+  un->type = XRANGE_TABLE (rangetab)->type;
+  memcpy (&un->first, Dynarr_begin (rted),
 	  sizeof (struct range_table_entry) * Dynarr_length (rted));
 }
 
@@ -875,6 +891,8 @@
   *min = tab->first;
   *max = tab->last;
   *val = tab->val;
+
+  internal_to_external_adjust_ends (un->type, min, max);
 }
 
 
--- a/src/realpath.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/realpath.c	Wed Feb 24 01:58:04 2010 -0600
@@ -140,17 +140,13 @@
 #endif /* REALPATH_CORRECTS_CASE */
 #else /* defined (WIN32_ANY) */
 # ifdef CYGWIN
-  Ibyte *tmp;
   int n = qxe_readlink (name, buf, (size_t) size);
   if (n >= 0 || errno != EINVAL)
     return n;
 
   /* The file may exist, but isn't a symlink. Try to find the
      right name. */
-  tmp =
-    alloca_ibytes (cygwin_posix_to_win32_path_list_buf_size ((char *) name));
-  cygwin_posix_to_win32_path_list ((char *) name, (char *) tmp);
-  name = tmp;
+  LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (name, name);
 # else
   if (mswindows_shortcuts_are_symlinks)
     {
@@ -166,7 +162,7 @@
 	      return -1;
 	    }
 	  memcpy (buf, tmp, len);
-	  xfree (tmp, Ibyte *);
+	  xfree (tmp);
 	  return len;
 	}
     }
@@ -222,7 +218,7 @@
 	Extbyte *nameext;
 	HANDLE dir_handle;
 
-	C_STRING_TO_TSTR (name, nameext);
+	nameext = ITEXT_TO_TSTR (name);
 	dir_handle = qxeFindFirstFile (nameext, &find_data);
 	if (dir_handle == INVALID_HANDLE_VALUE)
 	  {
@@ -468,6 +464,6 @@
 vars_of_realpath (void)
 {
   QSin_qxe_realpath =
-    build_msg_string ("(in qxe_realpath)");
+    build_defer_string ("(in qxe_realpath)");
   staticpro (&QSin_qxe_realpath);
 }
--- a/src/redisplay-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -23,1684 +23,50 @@
 
 /* Synched up with:  Not in FSF. */
 
-/* Author: Chuck Thompson */
-/* Gtk flavor by William Perry */
-
-/* Lots of work done by Ben Wing for Mule */
-
-#include <config.h>
-#include "lisp.h"
-
-#include "buffer.h"
-#include "debug.h"
-#include "device-impl.h"
-#include "faces.h"
-#include "file-coding.h"
-#include "frame-impl.h"
-#include "gutter.h"
-#include "redisplay.h"
-#include "sysdep.h"
-#include "window.h"
-
-#include "console-gtk-impl.h"
-#include "gccache-gtk.h"
-#include "glyphs-gtk.h"
-#include "objects-gtk-impl.h"
-
-#include "sysproc.h" /* for select() */
-
-#ifdef MULE
-#include "mule-ccl.h"
-#endif
-
-#define CONST const
-
-#define EOL_CURSOR_WIDTH	5
-
-static void gtk_output_pixmap (struct window *w,
-			       Lisp_Object image_instance,
-			       struct display_box *db,
-			       struct display_glyph_area *dga,
-			       face_index findex,
-			       int cursor_start,
-			       int cursor_width,
-			       int cursor_height,
-			       int bgpixmap);
-static void gtk_output_vertical_divider (struct window *w, int clear);
-static void gtk_output_blank (struct window *w, struct display_line *dl,
-			      struct rune *rb, int start_pixpos,
-			      int cursor_start, int cursor_width);
-static void gtk_output_horizontal_line (struct window *w,
-					struct display_line *dl,
-					struct rune *rb);
-static void gtk_clear_region (Lisp_Object locale, struct device* d, struct frame* f,
-			      face_index findex, int x, int y,
-			      int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
-			      Lisp_Object background_pixmap);
-static void gtk_output_eol_cursor (struct window *w, struct display_line *dl,
-				   int xpos, face_index findex);
-static void gtk_clear_frame (struct frame *f);
-static void gtk_clear_frame_windows (Lisp_Object window);
-static void gtk_bevel_modeline (struct window *w, struct display_line *dl);
-
-#if 0
-static void __describe_gc (GdkGC *);
-#endif
-
-struct textual_run
-{
-  Lisp_Object charset;
-  unsigned char *ptr;
-  int len;
-  int dimension;
-};
-
-/* Separate out the text in DYN into a series of textual runs of a
-   particular charset.  Also convert the characters as necessary into
-   the format needed by XDrawImageString(), XDrawImageString16(), et
-   al.  (This means converting to one or two byte format, possibly
-   tweaking the high bits, and possibly running a CCL program.) You
-   must pre-allocate the space used and pass it in. (This is done so
-   you can ALLOCA () the space.)  You need to allocate (2 * len) bytes
-   of TEXT_STORAGE and (len * sizeof (struct textual_run)) bytes of
-   RUN_STORAGE, where LEN is the length of the dynarr.
-
-   Returns the number of runs actually used. */
-
-static int
-separate_textual_runs (unsigned char *text_storage,
-		       struct textual_run *run_storage,
-		       CONST Ichar *str, Charcount len)
-{
-  Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a
-					  possible valid charset when
-					  MULE is not defined */
-  int runs_so_far = 0;
-  int i;
-#ifdef MULE
-  struct ccl_program char_converter;
-  int need_ccl_conversion = 0;
-#endif
-
-  for (i = 0; i < len; i++)
-    {
-      Ichar ch = str[i];
-      Lisp_Object charset;
-      int byte1, byte2;
-      int dimension;
-      int graphic;
-
-      BREAKUP_ICHAR (ch, charset, byte1, byte2);
-      dimension = XCHARSET_DIMENSION (charset);
-      graphic   = XCHARSET_GRAPHIC   (charset);
-
-      if (!EQ (charset, prev_charset))
-	{
-	  run_storage[runs_so_far].ptr       = text_storage;
-	  run_storage[runs_so_far].charset   = charset;
-	  run_storage[runs_so_far].dimension = dimension;
-
-	  if (runs_so_far)
-	    {
-	      run_storage[runs_so_far - 1].len =
-		text_storage - run_storage[runs_so_far - 1].ptr;
-	      if (run_storage[runs_so_far - 1].dimension == 2)
-		run_storage[runs_so_far - 1].len >>= 1;
-	    }
-	  runs_so_far++;
-	  prev_charset = charset;
-#ifdef MULE
-	  {
-	    Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset);
-	    need_ccl_conversion = !NILP (ccl_prog);
-	    if (need_ccl_conversion)
-	      setup_ccl_program (&char_converter, ccl_prog);
-	  }
-#endif
-	}
-
-      if (graphic == 0)
-	{
-	  byte1 &= 0x7F;
-	  byte2 &= 0x7F;
-	}
-      else if (graphic == 1)
-	{
-	  byte1 |= 0x80;
-	  byte2 |= 0x80;
-	}
-#ifdef MULE
-      if (need_ccl_conversion)
-	{
-	  char_converter.reg[0] = XCHARSET_ID (charset);
-	  char_converter.reg[1] = byte1;
-	  char_converter.reg[2] = byte2;
-	  ccl_driver (&char_converter, 0, 0, 0, 0, CCL_MODE_ENCODING);
-	  byte1 = char_converter.reg[1];
-	  byte2 = char_converter.reg[2];
-	}
-#endif
-      *text_storage++ = (unsigned char) byte1;
-      if (dimension == 2)
-	*text_storage++ = (unsigned char) byte2;
-    }
-
-  if (runs_so_far)
-    {
-      run_storage[runs_so_far - 1].len =
-	text_storage - run_storage[runs_so_far - 1].ptr;
-      if (run_storage[runs_so_far - 1].dimension == 2)
-	run_storage[runs_so_far - 1].len >>= 1;
-    }
-
-  return runs_so_far;
-}
-
-/****************************************************************************/
-/*                                                                          */
-/*                          Gtk output routines                             */
-/*                                                                          */
-/****************************************************************************/
-
-static int
-gtk_text_width_single_run (struct face_cachel *cachel, struct textual_run *run)
-{
-  Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
-  struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst);
-
-  if (!fi->proportional_p)
-  {
-    return fi->width * run->len;
-  }
-  else
-    {
-      if (run->dimension == 2)
-	{
-	  stderr_out ("Measuring wide characters\n");
-	  return gdk_text_width_wc (FONT_INSTANCE_GTK_FONT (fi),
-				    (GdkWChar *) run->ptr, run->len);
-	}
-      else
-	{
-	  return gdk_text_width (FONT_INSTANCE_GTK_FONT (fi),
-				 (char *) run->ptr, run->len);
-	}
-    }
-}
-
-/*
-   gtk_text_width
-
-   Given a string and a face, return the string's length in pixels when
-   displayed in the font associated with the face.
-   */
-
-static int
-gtk_text_width (struct frame *UNUSED (f), struct face_cachel *cachel,
-		CONST Ichar *str, Charcount len)
-{
-  /* !!#### */
-  int width_so_far = 0;
-  unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
-  struct textual_run *runs = alloca_array (struct textual_run, len);
-  int nruns;
-  int i;
-
-  nruns = separate_textual_runs (text_storage, runs, str, len);
-
-  for (i = 0; i < nruns; i++)
-    width_so_far += gtk_text_width_single_run (cachel, runs + i);
-
-  return width_so_far;
-}
-
-/*****************************************************************************
- gtk_divider_height
-
- Return the height of the horizontal divider.  This is a function because
- divider_height is a device method.
-
- #### If we add etched horizontal divider lines this will have to get
- smarter.
- ****************************************************************************/
-static int
-gtk_divider_height (void)
-{
-  return 2;
-}
-
-/*****************************************************************************
- gtk_eol_cursor_width
-
- Return the width of the end-of-line cursor.  This is a function
- because eol_cursor_width is a device method.
- ****************************************************************************/
-static int
-gtk_eol_cursor_width (void)
-{
-  return EOL_CURSOR_WIDTH;
-}
-
-/*****************************************************************************
- gtk_output_display_block
-
- Given a display line, a block number for that start line, output all
- runes between start and end in the specified display block.
- ****************************************************************************/
-static void
-gtk_output_display_block (struct window *w, struct display_line *dl, int block,
-			  int start, int end, int start_pixpos, int cursor_start,
-			  int cursor_width, int cursor_height)
-{
-  struct frame *f = XFRAME (w->frame);
-  Ichar_dynarr *buf;
-  Lisp_Object window;
-
-  struct display_block *db = Dynarr_atp (dl->display_blocks, block);
-  rune_dynarr *rba = db->runes;
-  struct rune *rb;
-
-  int elt = start;
-  face_index findex;
-  int xpos, width;
-  Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
-				     MULE is not defined */
-
-  window = wrap_window (w);
-  rb = Dynarr_atp (rba, start);
-
-  if (!rb)
-    {
-      /* Nothing to do so don't do anything. */
-      return;
-    }
-  else
-    {
-      findex = rb->findex;
-      xpos = rb->xpos;
-      width = 0;
-      if (rb->type == RUNE_CHAR)
-	charset = ichar_charset (rb->object.chr.ch);
-    }
-
-  if (end < 0)
-    end = Dynarr_length (rba);
-  buf = Dynarr_new (Ichar);
-
-  while (elt < end)
-    {
-      rb = Dynarr_atp (rba, elt);
-
-      if (rb->findex == findex && rb->type == RUNE_CHAR
-	  && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
-	  && EQ (charset, ichar_charset (rb->object.chr.ch)))
-	{
-	  Dynarr_add (buf, rb->object.chr.ch);
-	  width += rb->width;
-	  elt++;
-	}
-      else
-	{
-	  if (Dynarr_length (buf))
-	    {
-	      gtk_output_string (w, dl, buf, xpos, 0, start_pixpos, width,
-				 findex, 0, cursor_start, cursor_width,
-				 cursor_height);
-	      xpos = rb->xpos;
-	      width = 0;
-	    }
-	  Dynarr_reset (buf);
-	  width = 0;
-
-	  if (rb->type == RUNE_CHAR)
-	    {
-	      findex = rb->findex;
-	      xpos = rb->xpos;
-	      charset = ichar_charset (rb->object.chr.ch);
-
-	      if (rb->cursor_type == CURSOR_ON)
-		{
-		  if (rb->object.chr.ch == '\n')
-		    {
-		      gtk_output_eol_cursor (w, dl, xpos, findex);
-		    }
-		  else
-		    {
-		      Dynarr_add (buf, rb->object.chr.ch);
-		      gtk_output_string (w, dl, buf, xpos, 0, start_pixpos,
-					 rb->width, findex, 1,
-					 cursor_start, cursor_width,
-					 cursor_height);
-		      Dynarr_reset (buf);
-		    }
-
-		  xpos += rb->width;
-		  elt++;
-		}
-	      else if (rb->object.chr.ch == '\n')
-		{
-		  /* Clear in case a cursor was formerly here. */
-		  int height = dl->ascent + dl->descent - dl->clip;
-
-		  redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
-					  rb->width, height);
-		  elt++;
-		}
-	    }
-	  else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
-	    {
-	      if (rb->type == RUNE_BLANK)
-		gtk_output_blank (w, dl, rb, start_pixpos, cursor_start,
-				  cursor_width);
-	      else
-		{
-		  /* #### Our flagging of when we need to redraw the
-                     modeline shadows sucks.  Since RUNE_HLINE is only used
-                     by the modeline at the moment it is a good bet
-                     that if it gets redrawn then we should also
-                     redraw the shadows.  This won't be true forever.
-                     We borrow the shadow_thickness_changed flag for
-                     now. */
-		  w->shadow_thickness_changed = 1;
-		  gtk_output_horizontal_line (w, dl, rb);
-		}
-
-	      elt++;
-	      if (elt < end)
-		{
-		  rb = Dynarr_atp (rba, elt);
-
-		  findex = rb->findex;
-		  xpos = rb->xpos;
-		}
-	    }
-	  else if (rb->type == RUNE_DGLYPH)
-	    {
-	      Lisp_Object instance;
-	      struct display_box dbox;
-	      struct display_glyph_area dga;
-	      redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset,
-						 rb->object.dglyph.yoffset ,start_pixpos,
-                                                 rb->width, &dbox, &dga);
-
-	      window = wrap_window (w);
-	      instance = glyph_image_instance (rb->object.dglyph.glyph,
-					       window, ERROR_ME_DEBUG_WARN, 1);
-	      findex = rb->findex;
-
-	      if (IMAGE_INSTANCEP (instance))
-		switch (XIMAGE_INSTANCE_TYPE (instance))
-		  {
-		  case IMAGE_TEXT:
-		    {
-		      /* #### This is way losing.  See the comment in
-			 add_glyph_rune(). */
-		      Lisp_Object string =
-			XIMAGE_INSTANCE_TEXT_STRING (instance);
-		      convert_ibyte_string_into_ichar_dynarr
-			(XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
-
-		      gtk_output_string (w, dl, buf, xpos,
-					 rb->object.dglyph.xoffset,
-					 start_pixpos, -1, findex,
-					 (rb->cursor_type == CURSOR_ON),
-					 cursor_start, cursor_width,
-					 cursor_height);
-		      Dynarr_reset (buf);
-		    }
-		    break;
-
-		  case IMAGE_MONO_PIXMAP:
-		  case IMAGE_COLOR_PIXMAP:
-		    redisplay_output_pixmap (w, instance, &dbox, &dga,
-					     findex,cursor_start,
-					     cursor_width, cursor_height, 0);
-		    break;
-
-		  case IMAGE_POINTER:
-		    ABORT ();
-
-		  case IMAGE_WIDGET:
-		      if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
-			      Qlayout))
-			{
-			  redisplay_output_layout (window, instance, &dbox,
-						   &dga, findex,
-						   cursor_start, cursor_width,
-						   cursor_height);
-			  break;
-			}
-
-		  case IMAGE_SUBWINDOW:
-		    redisplay_output_subwindow (w, instance, &dbox, &dga,
-						findex, cursor_start,
-						cursor_width, cursor_height);
-		    break;
-
-		  case IMAGE_NOTHING:
-		    /* nothing is as nothing does */
-		    break;
-
-		  default:
-		    ABORT ();
-		  }
-
-	      xpos += rb->width;
-	      elt++;
-	    }
-	  else
-	    ABORT ();
-	}
-    }
-
-  if (Dynarr_length (buf))
-    gtk_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex,
-		       0, cursor_start, cursor_width, cursor_height);
-
-  /* #### This is really conditionalized well for optimized
-     performance. */
-  if (dl->modeline
-      && !EQ (Qzero, w->modeline_shadow_thickness)
-      && (f->clear
-	  || f->windows_structure_changed
-	  || w->shadow_thickness_changed))
-    gtk_bevel_modeline (w, dl);
-
-  Dynarr_free (buf);
-}
-
-/*****************************************************************************
- gtk_bevel_modeline
-
- Draw a 3d border around the modeline on window W.
- ****************************************************************************/
-static void
-gtk_bevel_modeline (struct window *w, struct display_line *dl)
-{
-  struct frame *f = XFRAME (w->frame);
-  int shadow_thickness = MODELINE_SHADOW_THICKNESS (w);
-  int x,y, width, height;
-
-  x = WINDOW_MODELINE_LEFT (w);
-  width = WINDOW_MODELINE_RIGHT (w) - x;
-  y = dl->ypos - dl->ascent - shadow_thickness;
-  height = dl->ascent + dl->descent + 2 * shadow_thickness;
-
-  gtk_output_shadows (f, x, y, width, height, shadow_thickness);
-}
-
-/*****************************************************************************
- gtk_get_gc
-
- Given a number of parameters return a GC with those properties.
- ****************************************************************************/
-GdkGC *
-gtk_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
-	    Lisp_Object bg_pmap, Lisp_Object lwidth)
-{
-  GdkGCValues gcv;
-  unsigned long mask;
-
-  memset (&gcv, ~0, sizeof (gcv));
-  gcv.graphics_exposures = FALSE;
-  /* Make absolutely sure that we don't pick up a clipping region in
-     the GC returned by this function. */
-  gcv.clip_mask = 0;
-  gcv.clip_x_origin = 0;
-  gcv.clip_y_origin = 0;
-  gcv.fill = GDK_SOLID;
-  mask = GDK_GC_EXPOSURES | GDK_GC_CLIP_MASK | GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN;
-  mask |= GDK_GC_FILL;
-
-  if (!NILP (font))
-    {
-      gcv.font = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font));
-      mask |= GDK_GC_FONT;
-    }
-
-  /* evil kludge! */
-  if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !INTP (fg))
-    {
-      /* #### I fixed once case where this was getting it.  It was a
-         bad macro expansion (compiler bug). */
-      fprintf (stderr, "Help! gtk_get_gc got a bogus fg value! fg = ");
-      debug_print (fg);
-      fg = Qnil;
-    }
-
-  if (!NILP (fg))
-    {
-      if (COLOR_INSTANCEP (fg))
-	gcv.foreground = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (fg));
-      else
-	gcv.foreground.pixel = XINT (fg);
-      mask |= GDK_GC_FOREGROUND;
-    }
-
-  if (!NILP (bg))
-    {
-      if (COLOR_INSTANCEP (bg))
-	gcv.background = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (bg));
-      else
-	gcv.background.pixel = XINT (fg);
-      mask |= GDK_GC_BACKGROUND;
-    }
-
-  if (IMAGE_INSTANCEP (bg_pmap)
-      && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
-    {
-      if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0)
-	{
-	  gcv.fill = GDK_OPAQUE_STIPPLED;
-	  gcv.stipple = XIMAGE_INSTANCE_GTK_PIXMAP (bg_pmap);
-	  mask |= (GDK_GC_STIPPLE | GDK_GC_FILL);
-	}
-      else
-	{
-	  gcv.fill = GDK_TILED;
-	  gcv.tile = XIMAGE_INSTANCE_GTK_PIXMAP (bg_pmap);
-	  mask |= (GDK_GC_TILE | GDK_GC_FILL);
-	}
-    }
-
-  if (!NILP (lwidth))
-    {
-      gcv.line_width = XINT (lwidth);
-      mask |= GDK_GC_LINE_WIDTH;
-    }
-
-  return gc_cache_lookup (DEVICE_GTK_GC_CACHE (d), &gcv, (GdkGCValuesMask) mask);
-}
+#define THIS_IS_GTK
+#include "redisplay-xlike-inc.c"
 
 /*****************************************************************************
- gtk_output_string
-
- Given a string and a starting position, output that string in the
- given face.  If cursor is true, draw a cursor around the string.
- Correctly handles multiple charsets in the string.
-
- The meaning of the parameters is something like this:
-
- W		Window that the text is to be displayed in.
- DL		Display line that this text is on.  The values in the
- 		structure are used to determine the vertical position and
-		clipping range of the text.
- BUF		Dynamic array of Ichars specifying what is actually to be
-		drawn.
- XPOS		X position in pixels where the text should start being drawn.
- XOFFSET	Number of pixels to be chopped off the left side of the
- 		text.  The effect is as if the text were shifted to the
-		left this many pixels and clipped at XPOS.
- CLIP_START	Clip everything left of this X position.
- WIDTH		Clip everything right of XPOS + WIDTH.
- FINDEX		Index for the face cache element describing how to display
- 		the text.
- CURSOR		#### I don't understand this.  There's something
- 		strange and overcomplexified with this variable.
-		Chuck, explain please?
- CURSOR_START	Starting X position of cursor.
- CURSOR_WIDTH	Width of cursor in pixels.
- CURSOR_HEIGHT	Height of cursor in pixels.
-
- Starting Y position of cursor is the top of the text line.
- The cursor is drawn sometimes whether or not CURSOR is set. ???
+ Draw a shadow around the given area using the standard theme engine routines.
  ****************************************************************************/
-static
-void gdk_draw_text_image (GdkDrawable *drawable,
-			  GdkFont     *font,
-			  GdkGC       *gc,
-			  gint         x,
-			  gint         y,
-			  const gchar *text,
-			  gint         text_length);
-
-void
-gtk_output_string (struct window *w, struct display_line *dl,
-		   Ichar_dynarr *buf, int xpos, int xoffset, int clip_start,
-		   int width, face_index findex, int cursor,
-		   int cursor_start, int cursor_width, int cursor_height)
-{
-  /* !!#### Needs review */
-  /* General variables */
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object device;
-  Lisp_Object window;
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-
-  int clip_end;
-
-  /* Cursor-related variables */
-  int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-  int cursor_clip;
-  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
-							 WINDOW_BUFFER (w));
-  struct face_cachel *cursor_cachel = 0;
-
-  /* Text-related variables */
-  Lisp_Object bg_pmap;
-  GdkGC *bgc, *gc;
-  int height;
-  int len = Dynarr_length (buf);
-  unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
-  struct textual_run *runs = alloca_array (struct textual_run, len);
-  int nruns;
-  int i;
-  struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
-
-  device = wrap_device (d);
-  window = wrap_window (w);
-
-  if (width < 0)
-    width = gtk_text_width (f, cachel, Dynarr_atp (buf, 0), Dynarr_length (buf));
-  height = dl->ascent + dl->descent - dl->clip;
-
-  /* Regularize the variables passed in. */
-
-  if (clip_start < xpos)
-    clip_start = xpos;
-  clip_end = xpos + width;
-  if (clip_start >= clip_end)
-    /* It's all clipped out. */
-    return;
-
-  xpos -= xoffset;
-
-  nruns = separate_textual_runs (text_storage, runs, Dynarr_atp (buf, 0),
-				 Dynarr_length (buf));
-
-  cursor_clip = (cursor_start >= clip_start &&
-		 cursor_start < clip_end);
-
-  /* This cursor code is really a mess. */
-  if (!NILP (w->text_cursor_visible_p)
-      && (cursor
-	  || cursor_clip
-	  || (cursor_width
-	      && (cursor_start + cursor_width >= clip_start)
-	      && !NILP (bar_cursor_value))))
-    {
-      /* These have to be in separate statements in order to avoid a
-         compiler bug. */
-      face_index sucks = get_builtin_face_cache_index (w, Vtext_cursor_face);
-      cursor_cachel = WINDOW_FACE_CACHEL (w, sucks);
-
-      /* We have to reset this since any call to WINDOW_FACE_CACHEL
-         may cause the cache to resize and any pointers to it to
-         become invalid. */
-      cachel = WINDOW_FACE_CACHEL (w, findex);
-    }
-
-  bg_pmap = cachel->background_pixmap;
-  if (!IMAGE_INSTANCEP (bg_pmap)
-      || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
-    bg_pmap = Qnil;
-
-  if ((cursor && focus && NILP (bar_cursor_value)
-       && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
-    bgc = 0;
-  else
-    bgc = gtk_get_gc (d, Qnil, cachel->foreground, cachel->background,
-		      bg_pmap, Qnil);
-
-  if (bgc)
-    gdk_draw_rectangle (GDK_DRAWABLE (x_win), bgc, TRUE, clip_start,
-			dl->ypos - dl->ascent, clip_end - clip_start,
-			height);
-
-  for (i = 0; i < nruns; i++)
-    {
-      Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
-      struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
-      GdkFont *gdk_font = FONT_INSTANCE_GTK_FONT (fi);
-      int this_width;
-      int need_clipping;
-
-      if (EQ (font, Vthe_null_font_instance))
-	continue;
-
-      this_width = gtk_text_width_single_run (cachel, runs + i);
-      need_clipping = (dl->clip || clip_start > xpos ||
-		       clip_end < xpos + this_width);
-
-      /* XDrawImageString only clears the area equal to the height of
-	 the given font.  It is possible that a font is being displayed
-	 on a line taller than it is, so this would cause us to fail to
-	 clear some areas. */
-      if ((int) fi->height < (int) (height + dl->clip))
-	{
-	  int clear_start = max (xpos, clip_start);
-	  int clear_end = min (xpos + this_width, clip_end);
-
-	  if (cursor)
-	    {
-	      int ypos1_line, ypos1_string, ypos2_line, ypos2_string;
-
-	      ypos1_string = dl->ypos - fi->ascent;
-	      ypos2_string = dl->ypos + fi->descent;
-	      ypos1_line = dl->ypos - dl->ascent;
-	      ypos2_line = dl->ypos + dl->descent - dl->clip;
-
-	      /* Make sure we don't clear below the real bottom of the
-		 line. */
-	      if (ypos1_string > ypos2_line)
-		ypos1_string = ypos2_line;
-	      if (ypos2_string > ypos2_line)
-		ypos2_string = ypos2_line;
-
-	      if (ypos1_line < ypos1_string)
-		{
-		  redisplay_clear_region (window, findex, clear_start, ypos1_line,
-				    clear_end - clear_start,
-				    ypos1_string - ypos1_line);
-		}
-
-	      if (ypos2_line > ypos2_string)
-		{
-		  redisplay_clear_region (window, findex, clear_start, ypos2_string,
-					  clear_end - clear_start,
-					  ypos2_line - ypos2_string);
-		}
-	    }
-	  else
-	    {
-	      redisplay_clear_region (window, findex, clear_start,
-				      dl->ypos - dl->ascent, clear_end - clear_start,
-				      height);
-	    }
-	}
-
-      if (cursor && cursor_cachel && focus && NILP (bar_cursor_value))
-      {
-	gc = gtk_get_gc (d, font, cursor_cachel->foreground,
-			 cursor_cachel->background, Qnil, Qnil);
-      }
-      else
-      {
-	gc = gtk_get_gc (d, font, cachel->foreground, cachel->background,
-			 Qnil, Qnil);
-      }
-
-      if (need_clipping)
-	{
-	  GdkRectangle clip_box;
-
-	  clip_box.x = 0;
-	  clip_box.y = 0;
-	  clip_box.width = clip_end - clip_start;
-	  clip_box.height = height;
-
-	  gdk_gc_set_clip_rectangle (gc, &clip_box);
-	  gdk_gc_set_clip_origin (gc, clip_start, dl->ypos - dl->ascent);
-	}
-
-      /* The X specific called different functions (XDraw*String
-         vs. XDraw*String16), but apparently gdk_draw_text takes care
-         of that for us.
-
-	 BUT, gdk_draw_text also does too much, by dividing the length
-	 by 2.  So we fake them out my multiplying the length by the
-	 dimension of the text.  This will do the right thing for
-	 single-dimension runs as well of course.
-      */
-      (bgc ? gdk_draw_text : gdk_draw_text_image) (GDK_DRAWABLE (x_win), gdk_font, gc, xpos,
-						   dl->ypos, (char *) runs[i].ptr,
-						   runs[i].len * runs[i].dimension);
-
-      /* We draw underlines in the same color as the text. */
-      if (cachel->underline)
-	{
-	  int upos, uthick;
-
-	  /* Cannot get at font properties in Gtk, so we resort to
-             guessing */
-	  upos = dl->descent / 2;
-	  uthick = 1;
-
-	  if ((dl->ypos + upos) < (dl->ypos + dl->descent - dl->clip))
-	    {
-	      if (dl->ypos + upos + uthick > dl->ypos + dl->descent - dl->clip)
-		uthick = dl->descent - dl->clip - upos;
-
-	      if (uthick == 1)
-		{
-		  gdk_draw_line (GDK_DRAWABLE (x_win), gc, xpos, dl->ypos + upos,
-			     xpos + this_width, dl->ypos + upos);
-		}
-	      else if (uthick > 1)
-		{
-		    gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, xpos,
-					dl->ypos + upos, this_width, uthick);
-		}
-	    }
-	}
-
-      if (cachel->strikethru) {
-	gint ascent,descent,upos, uthick;
-	GdkFont *gfont = FONT_INSTANCE_GTK_FONT (XFONT_INSTANCE (font));
-
-	/* Cannot get at font properties in Gtk, so we resort to
-           guessing */
-
-	ascent = gfont->ascent;
-	descent = gfont->descent;
-	uthick = 1;
-
-	upos = ascent - ((ascent + descent) / 2) + 1;
-
-	/* Generally, upos will be positive (above the baseline),so subtract */
-	if (dl->ypos - upos < dl->ypos + dl->descent - dl->clip)
-	  {
-	    if (dl->ypos - upos + uthick > dl->ypos + dl->descent - dl->clip)
-	      uthick = dl->descent - dl->clip + upos;
-
-	    if (uthick == 1)
-	      {
-		  gdk_draw_line (GDK_DRAWABLE (x_win), gc, xpos, dl->ypos - upos,
-				 xpos + this_width, dl->ypos - upos);
-	      }
-	    else if (uthick > 1)
-	      {
-		  gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, xpos, dl->ypos + upos,
-				      this_width, uthick);
-	      }
-	  }
-      }
-
-      /* Restore the GC */
-      if (need_clipping)
-	{
-	    gdk_gc_set_clip_rectangle (gc, NULL);
-	    gdk_gc_set_clip_origin (gc, 0, 0);
-	}
-
-      /* If we are actually superimposing the cursor then redraw with just
-	 the appropriate section highlighted. */
-      if (cursor_clip && !cursor && focus && cursor_cachel)
-	{
-	  GdkGC *cgc;
-	  GdkRectangle clip_box;
-
-	  cgc = gtk_get_gc (d, font, cursor_cachel->foreground,
-			    cursor_cachel->background, Qnil, Qnil);
-
-	  clip_box.x = 0;
-	  clip_box.y = 0;
-	  clip_box.width = cursor_width;
-	  clip_box.height = height;
-
-	  gdk_gc_set_clip_rectangle (cgc, &clip_box);
-	  gdk_gc_set_clip_origin (cgc, cursor_start, dl->ypos - dl->ascent);
-
-	  /* The X specific called different functions (XDraw*String
-	     vs. XDraw*String16), but apparently gdk_draw_text takes care
-	     of that for us.
-
-	     BUT, gdk_draw_text also does too much, by dividing the
-	     length by 2.  So we fake them out my multiplying the
-	     length by the dimension of the text.  This will do the
-	     right thing for single-dimension runs as well of course.
-	  */
-	  gdk_draw_text_image (GDK_DRAWABLE (x_win), gdk_font, cgc, xpos,
-			       dl->ypos, (char *) runs[i].ptr,
-			       runs[i].len * runs[i].dimension);
-
-	  gdk_gc_set_clip_rectangle (cgc, NULL);
-	  gdk_gc_set_clip_origin (cgc, 0, 0);
-	}
-
-      xpos += this_width;
-    }
-
-  /* Draw the non-focus box or bar-cursor as needed. */
-  /* Can't this logic be simplified? */
-  if (cursor_cachel
-      && ((cursor && !focus && NILP (bar_cursor_value))
-	  || (cursor_width
-	      && (cursor_start + cursor_width >= clip_start)
-	      && !NILP (bar_cursor_value))))
-    {
-      int tmp_height, tmp_y;
-      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-      int need_clipping = (cursor_start < clip_start
-			   || clip_end < cursor_start + cursor_width);
-
-      /* #### This value is correct (as far as I know) because
-	 all of the times we need to draw this cursor, we will
-	 be called with exactly one character, so we know we
-	 can always use runs[0].
-
-	 This is bogus as all hell, however.  The cursor handling in
-	 this function is way bogus and desperately needs to be
-	 cleaned up. (In particular, the drawing of the cursor should
-	 really really be separated out of this function.  This may be
-	 a bit tricky now because this function itself does way too
-	 much stuff, a lot of which needs to be moved into
-	 redisplay.c) This is the only way to be able to easily add
-	 new cursor types or (e.g.) make the bar cursor be able to
-	 span two characters instead of overlaying just one. */
-      int bogusly_obtained_ascent_value =
-	XFONT_INSTANCE (FACE_CACHEL_FONT (cachel, runs[0].charset))->ascent;
-
-      if (!NILP (bar_cursor_value))
-	{
-	  gc = gtk_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
-			   make_int (bar_width));
-	}
-      else
-	{
-	  gc = gtk_get_gc (d, Qnil, cursor_cachel->background,
-			   Qnil, Qnil, Qnil);
-	}
-
-      tmp_y = dl->ypos - bogusly_obtained_ascent_value;
-      tmp_height = cursor_height;
-      if (tmp_y + tmp_height > (int) (dl->ypos - dl->ascent + height))
-	{
-	  tmp_y = dl->ypos - dl->ascent + height - tmp_height;
-	  if (tmp_y < (int) (dl->ypos - dl->ascent))
-	    tmp_y = dl->ypos - dl->ascent;
-	  tmp_height = dl->ypos - dl->ascent + height - tmp_y;
-	}
-
-      if (need_clipping)
-	{
-	  GdkRectangle clip_box;
-	  clip_box.x = 0;
-	  clip_box.y = 0;
-	  clip_box.width = clip_end - clip_start;
-	  clip_box.height = tmp_height;
-
-	  gdk_gc_set_clip_rectangle (gc, &clip_box);
-	  gdk_gc_set_clip_origin (gc, clip_start, tmp_y);
-	}
-
-      if (!focus && NILP (bar_cursor_value))
-	{
-	    gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE,
-				cursor_start, tmp_y,
-				cursor_width - 1, tmp_height - 1);
-	}
-      else if (focus && !NILP (bar_cursor_value))
-	{
-	    gdk_draw_line (GDK_DRAWABLE (x_win), gc,
-			   cursor_start + bar_width - 1, tmp_y,
-			   cursor_start + bar_width - 1, tmp_y + tmp_height - 1);
-	}
-
-      /* Restore the GC */
-      if (need_clipping)
-	{
-	    gdk_gc_set_clip_rectangle (gc, NULL);
-	    gdk_gc_set_clip_origin (gc, 0, 0);
-	}
-    }
-}
 
 static void
-our_draw_bitmap (GdkDrawable *drawable,
-		 GdkGC       *gc,
-		 GdkPixmap   *src,
-		 gint         xsrc,
-		 gint         ysrc,
-		 gint         xdest,
-		 gint         ydest,
-		 gint         width,
-		 gint         height);
-
-static void
-gtk_output_gdk_pixmap (struct frame *f, struct Lisp_Image_Instance *p, int x,
-		       int y, int xoffset, int yoffset,
-		       int width, int height, 
-		       GdkColor *fg, GdkColor *bg, GdkGC *override_gc)
-{
-  struct device *d = XDEVICE (f->device);
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-
-  GdkGC *gc;
-  GdkGCValues gcv;
-  unsigned long pixmap_mask;
-
-  if (!override_gc)
-    {
-      memset (&gcv, ~0, sizeof (gcv));
-      gcv.graphics_exposures = FALSE;
-      gcv.foreground = *fg;
-      gcv.background = *bg;
-      pixmap_mask = GDK_GC_FOREGROUND | GDK_GC_BACKGROUND | GDK_GC_EXPOSURES;
-
-      if (IMAGE_INSTANCE_GTK_MASK (p))
-	{
-	  gcv.function = GDK_COPY;
-	  gcv.clip_mask = IMAGE_INSTANCE_GTK_MASK (p);
-	  gcv.clip_x_origin = x - xoffset;
-	  gcv.clip_y_origin = y - yoffset;
-	  pixmap_mask |= (GDK_GC_FUNCTION | GDK_GC_CLIP_MASK | GDK_GC_CLIP_X_ORIGIN |
-			  GDK_GC_CLIP_Y_ORIGIN);
-	  /* Can't set a clip rectangle below because we already have a mask.
-	     We could conceivably create a new clipmask by zeroing out
-	     everything outside the clip region.  Is it worth it?
-	     Is it possible to get an equivalent effect by changing the
-	     args to XCopyArea below rather than messing with a clip box?
-	     - dkindred@cs.cmu.edu
-	     Yes. We don't clip at all now - andy@xemacs.org
-          */
-	}
-
-      gc = gc_cache_lookup (DEVICE_GTK_GC_CACHE (d), &gcv, pixmap_mask);
-    }
-  else
-    {
-      gc = override_gc;
-      /* override_gc might have a mask already--we don't want to nuke it.
-	 Maybe we can insist that override_gc have no mask, or use
-	 one of the suggestions above. */
-    }
-
-  if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0)
-    {
-      gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
-		       IMAGE_INSTANCE_GTK_PIXMAP (p),
-		       xoffset, yoffset, x, y, width, height);
-    }
-  else
-    {
-      our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
-		       IMAGE_INSTANCE_GTK_PIXMAP (p),
-		       xoffset, yoffset, x, y, width, height);
-    }
-}
-
-static void
-gtk_output_pixmap (struct window *w,
-		   Lisp_Object image_instance,
-		   struct display_box *db,
-		   struct display_glyph_area *dga,
-		   face_index findex,
-		   int cursor_start,
-		   int cursor_width,
-		   int cursor_height,
-		   int UNUSED (bg_pixmap))
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object window;
-
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-
-  window = wrap_window (w);
-
-  /* Output the pixmap. */
-  {
-    Lisp_Object tmp_pixel;
-    GdkColor *tmp_bcolor, *tmp_fcolor;
-
-    tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
-    tmp_fcolor = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-    tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
-    tmp_bcolor = COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-
-    gtk_output_gdk_pixmap (f, p, db->xpos, db->ypos,
-			   dga->xoffset, dga->yoffset,
-			   dga->width, dga->height,
-			   tmp_fcolor, tmp_bcolor, NULL);
-  }
-
-  /* Draw a cursor over top of the pixmap. */
-  if (cursor_width && cursor_height && (cursor_start >= db->xpos)
-      && !NILP (w->text_cursor_visible_p)
-      && (cursor_start < (db->xpos + dga->width)))
-    {
-      GdkGC *gc;
-      int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-      struct face_cachel *cursor_cachel =
-	WINDOW_FACE_CACHEL (w,
-			    get_builtin_face_cache_index
-			    (w, Vtext_cursor_face));
-
-      gc = gtk_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
-
-      if (cursor_width > db->xpos + dga->width - cursor_start)
-	cursor_width = db->xpos + dga->width - cursor_start;
-
-      gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, focus ? TRUE : FALSE,
-			  cursor_start, db->ypos, cursor_width,
-			  cursor_height);
-    }
-}
-
-/*****************************************************************************
- gtk_output_vertical_divider
-
- Draw a vertical divider down the right side of the given window.
- ****************************************************************************/
-static void
-gtk_output_vertical_divider (struct window *w, int UNUSED(clear))
+XLIKE_bevel_area (struct window *w, face_index UNUSED (findex),
+		  int x, int y, int width, int height,
+		  int shadow_thickness, int UNUSED (edges),
+		  enum edge_style style)
 {
   struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
   GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  GdkGC *background_gc;
-  Lisp_Object tmp_pixel;
-  GdkGCValues gcv;
-  unsigned long mask;
-  int x, y1, y2, width, shadow_thickness, spacing, line_width;
-  face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face);
-  
-  width = window_divider_width (w);
-  shadow_thickness = XINT (w->vertical_divider_shadow_thickness);
-  spacing = XINT (w->vertical_divider_spacing);
-  line_width = XINT (w->vertical_divider_line_width);
-  x = WINDOW_RIGHT (w) - width;
-  y1 = WINDOW_TOP (w);
-  y2 = WINDOW_BOTTOM (w);
-  
-  memset (&gcv, ~0, sizeof (gcv));
-  
-  tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
-  
-  gcv.background = * COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-  gcv.foreground = gcv.background;
-  gcv.graphics_exposures = FALSE;
-  mask = GDK_GC_FOREGROUND | GDK_GC_BACKGROUND | GDK_GC_EXPOSURES;
-
-  background_gc = gc_cache_lookup (DEVICE_GTK_GC_CACHE (d), &gcv, mask);
-
-  /* Clear the divider area first.  This needs to be done when a
-     window split occurs. */
-  /* if (clear) */
-  gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE,
-		      x, y1, width, y2 - y1);
-
-#if 0
-  /* Draw the divider line. */
-  gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE,
-		      x + spacing + shadow_thickness, y1,
-		      line_width, y2 - y1);
-#endif
-  
-  /* Draw the shadows around the divider line */
-  gtk_output_shadows (f, x + spacing, y1, 
-		      width - 2 * spacing, y2 - y1,
-		      shadow_thickness);
-}
-
-/*****************************************************************************
- gtk_output_blank
-
- Output a blank by clearing the area it covers in the foreground color
- of its face.
- ****************************************************************************/
-static void
-gtk_output_blank (struct window *w, struct display_line *dl, struct rune *rb,
-		  int start_pixpos, int cursor_start, int cursor_width)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  GdkGC *gc;
-  struct face_cachel *cursor_cachel =
-    WINDOW_FACE_CACHEL (w,
-			get_builtin_face_cache_index
-			(w, Vtext_cursor_face));
-  Lisp_Object bg_pmap;
-  Lisp_Object buffer = WINDOW_BUFFER (w);
-  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
-							 buffer);
-
-  int x = rb->xpos;
-  int y = dl->ypos - dl->ascent;
-  int width = rb->width;
-  int height = dl->ascent + dl->descent - dl->clip;
-
-  if (start_pixpos > x)
-    {
-      if (start_pixpos >= (x + width))
-	return;
-      else
-	{
-	  width -= (start_pixpos - x);
-	  x = start_pixpos;
-	}
-    }
-
-  bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
-  if (!IMAGE_INSTANCEP (bg_pmap)
-      || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
-    bg_pmap = Qnil;
-
-  if (NILP (bg_pmap))
-    gc = gtk_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
-		     Qnil, Qnil, Qnil);
-  else
-    gc = gtk_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
-		     WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), bg_pmap,
-		     Qnil);
-
-  gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, y, width, height);
-
-  /* If this rune is marked as having the cursor, then it is actually
-     representing a tab. */
-  if (!NILP (w->text_cursor_visible_p)
-      && (rb->cursor_type == CURSOR_ON
-	  || (cursor_width
-	      && (cursor_start + cursor_width > x)
-	      && cursor_start < (x + width))))
-    {
-      int cursor_height, cursor_y;
-      int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-      struct Lisp_Font_Instance *fi;
+  GtkStyle *gstyle = FRAME_GTK_TEXT_WIDGET (f)->style;
+  GtkShadowType stype;
 
-      fi = XFONT_INSTANCE (FACE_CACHEL_FONT
-			   (WINDOW_FACE_CACHEL (w, rb->findex),
-			    Vcharset_ascii));
-
-      gc = gtk_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
-
-      cursor_y = dl->ypos - fi->ascent;
-      cursor_height = fi->height;
-      if (cursor_y + cursor_height > y + height)
-	cursor_height = y + height - cursor_y;
-
-      if (focus)
-	{
-	  if (NILP (bar_cursor_value))
-	    {
-		gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE,
-				    cursor_start, cursor_y,
-				    fi->width, cursor_height);
-	    }
-	  else
-	    {
-	      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-
-	      gc = gtk_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
-			       make_int (bar_width));
-	      gdk_draw_line (GDK_DRAWABLE (x_win), gc, cursor_start + bar_width - 1,
-			     cursor_y, cursor_start + bar_width - 1,
-			     cursor_y + cursor_height - 1);
-	    }
-	}
-      else if (NILP (bar_cursor_value))
-	{
-	    gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE,
-				cursor_start, cursor_y,
-				fi->width - 1, cursor_height - 1);
-	}
-    }
-}
-
-/*****************************************************************************
- gtk_output_horizontal_line
-
- Output a horizontal line in the foreground of its face.
- ****************************************************************************/
-static void
-gtk_output_horizontal_line (struct window *w,
-			    struct display_line *dl,
-			    struct rune *rb)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
-
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  GdkGC *gc;
-
-  int x = rb->xpos;
-  int width = rb->width;
-  int height = dl->ascent + dl->descent - dl->clip;
-
-  int ypos1, ypos2, ypos3, ypos4;
-
-  ypos1 = dl->ypos - dl->ascent;
-  ypos2 = ypos1 + rb->object.hline.yoffset;
-  ypos3 = ypos2 + rb->object.hline.thickness;
-  ypos4 = dl->ypos + dl->descent - dl->clip;
-
-  /* First clear the area not covered by the line. */
-  if (height - rb->object.hline.thickness > 0)
-    {
-      gc = gtk_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
-		     Qnil, Qnil, Qnil);
-
-      if (ypos2 - ypos1 > 0)
-	  gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, ypos1, width, ypos2 - ypos1);
-      if (ypos4 - ypos3 > 0)
-	  gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, ypos1, width, ypos2 - ypos1);
-    }
-
-  gtk_paint_hline (style, x_win, GTK_STATE_NORMAL, NULL, FRAME_GTK_TEXT_WIDGET (f),
-		   "hline", x, x + width, ypos2);
-#if 0
-  /* Now draw the line. */
-  gc = gtk_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
-		   Qnil, Qnil, Qnil);
-
-  if (ypos2 < ypos1)
-    ypos2 = ypos1;
-  if (ypos3 > ypos4)
-    ypos3 = ypos4;
-
-  if (ypos3 - ypos2 > 0)
-      gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, ypos2, width, ypos3 - ypos2);
-#endif
-}
-
-/*****************************************************************************
- gtk_output_shadows
-
- Draw a shadow around the given area using the standard theme engine routines.
- ****************************************************************************/
-void
-gtk_output_shadows (struct frame *f, int x, int y, int width, int height,
-		    int shadow_thickness)
-{
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
-  GtkShadowType stype = GTK_SHADOW_OUT;
-
-  if (shadow_thickness < 0)
-  {
-      stype = GTK_SHADOW_IN;
-  }
-  else if (shadow_thickness == 0)
-  {
-      stype = GTK_SHADOW_NONE;
-  }
+  if (shadow_thickness == 0)
+    stype = GTK_SHADOW_NONE;
+  else
+    switch (style)
+      {
+      case EDGE_BEVEL_IN: style = GTK_SHADOW_IN; break;
+      case EDGE_BEVEL_OUT: style = GTK_SHADOW_OUT; break;
+      case EDGE_ETCHED_IN: style = GTK_SHADOW_ETCHED_IN; break;
+      case EDGE_ETCHED_OUT: style = GTK_SHADOW_ETCHED_OUT; break;
+      default: ABORT (); style = GTK_SHADOW_OUT;
+      }
 
   /* Do we want to have some magic constants to set
      GTK_SHADOW_ETCHED_IN or GTK_SHADOW_ETCHED_OUT? */
 
-  gtk_paint_shadow (style, x_win, GTK_STATE_NORMAL, stype, NULL,
+  gtk_paint_shadow (gstyle, x_win, GTK_STATE_NORMAL, stype, NULL,
 		    FRAME_GTK_TEXT_WIDGET (f), "modeline",
 		    x, y, width, height);
 }
 
-/*****************************************************************************
- gtk_clear_to_window_end
-
- Clear the area between ypos1 and ypos2.  Each margin area and the
- text area is handled separately since they may each have their own
- background color.
- ****************************************************************************/
-static void
-gtk_clear_to_window_end (struct window *w, int ypos1, int ypos2)
-{
-  int height = ypos2 - ypos1;
-
-  if (height)
-    {
-      struct frame *f = XFRAME (w->frame);
-      Lisp_Object window;
-      int bflag = (window_needs_vertical_divider (w) ? 0 : 1);
-      layout_bounds bounds;
-
-      bounds = calculate_display_line_boundaries (w, bflag);
-      window = wrap_window (w);
-
-      if (window_is_leftmost (w))
-	redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
-				ypos1, FRAME_BORDER_WIDTH (f), height);
-
-      if (bounds.left_in - bounds.left_out > 0)
-	redisplay_clear_region (window,
-				get_builtin_face_cache_index (w, Vleft_margin_face),
-				bounds.left_out, ypos1,
-				bounds.left_in - bounds.left_out, height);
-
-      if (bounds.right_in - bounds.left_in > 0)
-	redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
-				bounds.right_in - bounds.left_in, height);
-
-      if (bounds.right_out - bounds.right_in > 0)
-	redisplay_clear_region (window,
-				get_builtin_face_cache_index (w, Vright_margin_face),
-				bounds.right_in, ypos1,
-				bounds.right_out - bounds.right_in, height);
-
-      if (window_is_rightmost (w))
-	redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
-				ypos1, FRAME_BORDER_WIDTH (f), height);
-    }
-}
-
-/****************************************************************************
- gtk_clear_region
-
- Clear the area in the box defined by the given parameters using the
- given face.
- ****************************************************************************/
-static void
-gtk_clear_region (Lisp_Object UNUSED (locale), struct device* d,
-		  struct frame* f, face_index UNUSED (findex), int x, int y,
-		  int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
-		  Lisp_Object background_pixmap)
-{
-  GdkWindow *x_win;
-  GdkGC *gc = NULL;
-
-  x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-
-  if (!UNBOUNDP (background_pixmap))
-    {
-      gc = gtk_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
-    }
-
-  if (gc)
-    {
-      gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc,TRUE,
-			  x, y, width, height);
-    }
-  else
-    {
-      gdk_window_clear_area (x_win, x, y, width, height);
-    }
-}
-
-/*****************************************************************************
- gtk_output_eol_cursor
-
- Draw a cursor at the end of a line.  The end-of-line cursor is
- narrower than the normal cursor.
- ****************************************************************************/
-static void
-gtk_output_eol_cursor (struct window *w, struct display_line *dl, int xpos,
-		       face_index findex)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object window;
-
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  GdkGC *gc;
-  face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
-  struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, elt);
-
-  int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
-							 WINDOW_BUFFER (w));
-
-  int x = xpos;
-  int y = dl->ypos - dl->ascent;
-  int width = EOL_CURSOR_WIDTH;
-  int height = dl->ascent + dl->descent - dl->clip;
-  int cursor_height, cursor_y;
-  int defheight, defascent;
-
-  window = wrap_window (w);
-  redisplay_clear_region (window, findex, x, y, width, height);
-
-  if (NILP (w->text_cursor_visible_p))
-    return;
-
-  gc = gtk_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
-
-  default_face_font_info (window, &defascent, 0, &defheight, 0, 0);
-
-  /* make sure the cursor is entirely contained between y and y+height */
-  cursor_height = min (defheight, height);
-  cursor_y = max (y, min (y + height - cursor_height,
-			  dl->ypos - defascent));
-
-  if (focus)
-    {
-      if (NILP (bar_cursor_value))
-	{
-	    gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, TRUE, x, cursor_y, width, cursor_height);
-	}
-      else
-	{
-	  int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-
-	  gc = gtk_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
-			   make_int (bar_width));
-	  gdk_draw_line (GDK_DRAWABLE (x_win), gc, x + bar_width - 1, cursor_y,
-			 x + bar_width - 1, cursor_y + cursor_height - 1);
-	}
-    }
-  else if (NILP (bar_cursor_value))
-    {
-	gdk_draw_rectangle (GDK_DRAWABLE (x_win), gc, FALSE, x, cursor_y, width - 1,
-			    cursor_height - 1);
-    }
-}
-
-static void
-gtk_clear_frame_window (Lisp_Object window)
-{
-  struct window *w = XWINDOW (window);
-
-  if (!NILP (w->vchild))
-    {
-      gtk_clear_frame_windows (w->vchild);
-      return;
-    }
-
-  if (!NILP (w->hchild))
-    {
-      gtk_clear_frame_windows (w->hchild);
-      return;
-    }
-
-  gtk_clear_to_window_end (w, WINDOW_TEXT_TOP (w), WINDOW_TEXT_BOTTOM (w));
-}
-
-static void
-gtk_clear_frame_windows (Lisp_Object window)
-{
-  for (; !NILP (window); window = XWINDOW (window)->next)
-    gtk_clear_frame_window (window);
-}
-
-static void
-gtk_clear_frame (struct frame *f)
-{
-  GdkWindow *x_win = GET_GTK_WIDGET_WINDOW (FRAME_GTK_TEXT_WIDGET (f));
-  int x, y, width, height;
-  Lisp_Object frame;
-
-  x = FRAME_LEFT_BORDER_START (f);
-  width = (FRAME_PIXWIDTH (f) - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) -
-	   FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) -
-	   2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) -
-	   2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f));
-  /* #### This adjustment by 1 should be being done in the macros.
-     There is some small differences between when the menubar is on
-     and off that we still need to deal with. */
-  y = FRAME_TOP_BORDER_START (f) - 1;
-  height = (FRAME_PIXHEIGHT (f) - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) -
-	    FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -
-	    2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) -
-	    2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + 1;
-
-  gdk_window_clear_area (x_win, x, y, width, height);
-
-  frame = wrap_frame (f);
-
-  if (!UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vdefault_face, frame))
-      || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vleft_margin_face, frame))
-      || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vright_margin_face, frame)))
-    {
-      gtk_clear_frame_windows (f->root_window);
-    }
-}
-
-static int
-gtk_flash (struct device *d)
-{
-  GdkGCValues gcv;
-  GdkGC *gc;
-  GdkColor tmp_fcolor, tmp_bcolor;
-  Lisp_Object tmp_pixel, frame;
-  struct frame *f = device_selected_frame (d);
-  struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
-
-  frame = wrap_frame (f);
-
-  tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
-  tmp_fcolor = * (COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (tmp_pixel)));
-  tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame);
-  tmp_bcolor = * (COLOR_INSTANCE_GTK_COLOR (XCOLOR_INSTANCE (tmp_pixel)));
-
-  memset (&gcv, ~0, sizeof (gcv)); /* initialize all slots to ~0 */
-  gcv.foreground.pixel  = (tmp_fcolor.pixel ^ tmp_bcolor.pixel);
-  gcv.function = GDK_XOR;
-  gcv.graphics_exposures = FALSE;
-  gc = gc_cache_lookup (DEVICE_GTK_GC_CACHE (XDEVICE (f->device)), &gcv,
-			GDK_GC_FOREGROUND | GDK_GC_FUNCTION | GDK_GC_EXPOSURES);
-
-  gdk_draw_rectangle (GDK_DRAWABLE (GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (f))),
-		      gc, TRUE, w->pixel_left, w->pixel_top,
-		      w->pixel_width, w->pixel_height);
-
-  gdk_flush ();
-
-#ifdef HAVE_SELECT
-  {
-    int usecs = 100000;
-    struct timeval tv;
-    tv.tv_sec  = usecs / 1000000L;
-    tv.tv_usec = usecs % 1000000L;
-    /* I'm sure someone is going to complain about this... */
-    select (0, 0, 0, 0, &tv);
-  }
-#else
-#ifdef HAVE_POLL
-  poll (0, 0, 100);
-#else
-  bite me
-#endif
-#endif
-
-  gdk_draw_rectangle (GDK_DRAWABLE (GET_GTK_WIDGET_WINDOW (FRAME_GTK_SHELL_WIDGET (f))),
-		      gc, TRUE, w->pixel_left, w->pixel_top,
-		      w->pixel_width, w->pixel_height);
-
-  gdk_flush ();
-
-  return 1;
-}
-
-static void
-gtk_bevel_area (struct window *w, face_index UNUSED (findex),
-		int x, int y, int width, int height,
-		int shadow_thickness, int UNUSED (edges),
-		enum edge_style UNUSED (style))
-{
-  struct frame *f = XFRAME (w->frame);
-
-  gtk_output_shadows (f, x, y, width, height, shadow_thickness);
-}
-
 
 
 /* Make audible bell.  */
 static void
-gtk_ring_bell (struct device *UNUSED (d), int volume, int UNUSED (pitch),
-	       int UNUSED (duration))
+XLIKE_ring_bell (struct device *UNUSED (d), int volume, int UNUSED (pitch),
+		 int UNUSED (duration))
 {
   /* Gdk does not allow us to control the duration / pitch / volume */
   if (volume > 0)
@@ -1710,44 +76,21 @@
 }
 
 
-/************************************************************************/
-/*                            initialization                            */
-/************************************************************************/
-
-void
-console_type_create_redisplay_gtk (void)
-{
-  /* redisplay methods */
-  CONSOLE_HAS_METHOD (gtk, text_width);
-  CONSOLE_HAS_METHOD (gtk, output_display_block);
-  CONSOLE_HAS_METHOD (gtk, divider_height);
-  CONSOLE_HAS_METHOD (gtk, eol_cursor_width);
-  CONSOLE_HAS_METHOD (gtk, output_vertical_divider);
-  CONSOLE_HAS_METHOD (gtk, clear_to_window_end);
-  CONSOLE_HAS_METHOD (gtk, clear_region);
-  CONSOLE_HAS_METHOD (gtk, clear_frame);
-  CONSOLE_HAS_METHOD (gtk, flash);
-  CONSOLE_HAS_METHOD (gtk, ring_bell);
-  CONSOLE_HAS_METHOD (gtk, bevel_area);
-  CONSOLE_HAS_METHOD (gtk, output_string);
-  CONSOLE_HAS_METHOD (gtk, output_pixmap);
-}
-
 /* This makes me feel incredibly dirty... but there is no other way to
    get this done right other than calling clear_area before every
    single $#!%@ing piece of text, which I do NOT want to do. */
 #define USE_X_SPECIFIC_DRAW_ROUTINES 1
 
-#include <gdk/gdkx.h>
+#include "sysgdkx.h"
 
-static
-void gdk_draw_text_image (GdkDrawable *drawable,
-			  GdkFont     *font,
-			  GdkGC       *gc,
-			  gint         x,
-			  gint         y,
-			  const gchar *text,
-			  gint         text_length)
+static void
+gdk_draw_text_image (GdkDrawable *drawable,
+		     GdkFont     *font,
+		     GdkGC       *gc,
+		     gint         x,
+		     gint         y,
+		     const gchar *text,
+		     gint         text_length)
 {
 #if !USE_X_SPECIFIC_DRAW_ROUTINES
   int width = gdk_text_measure (font, text, text_length);
--- a/src/redisplay-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -469,9 +469,10 @@
 #if 0	/* #### FIXME? */
   /* We can't work out the width before we've set the font in the DC */
   if (width < 0)
-    width = mswindows_text_width (cachel, Dynarr_atp (buf, 0), Dynarr_length (buf));
+    width = mswindows_text_width (w, cachel, Dynarr_begin (buf),
+				  Dynarr_length (buf));
 #else
-  assert(width>=0);
+  assert (width >= 0);
 #endif
 
   /* Regularize the variables passed in. */
@@ -517,7 +518,7 @@
       cachel = WINDOW_FACE_CACHEL (w, findex);
     }
 
-  nruns = separate_textual_runs (&runs, Dynarr_atp (buf, 0),
+  nruns = separate_textual_runs (&runs, Dynarr_begin (buf),
 				 Dynarr_length (buf));
 
   for (i = 0; i < nruns; i++)
@@ -1181,9 +1182,10 @@
  displayed in the font associated with the face.
  ****************************************************************************/
 static int
-mswindows_text_width (struct frame *f, struct face_cachel *cachel,
+mswindows_text_width (struct window *w, struct face_cachel *cachel,
 		      const Ichar *str, Charcount len)
 {
+  struct frame *f = WINDOW_XFRAME (w);
   HDC hdc = get_frame_dc (f, 0);
   int width_so_far = 0;
   textual_run *runs;
--- a/src/redisplay-output.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay-output.c	Wed Feb 24 01:58:04 2010 -0600
@@ -83,7 +83,7 @@
 	 redisplay performance so avoiding all excess overhead is a
 	 good thing.  Is all of this true? */
       memcpy (cra->base, dra->base, sizeof (struct rune) * max_move);
-      Dynarr_set_size (cra, max_move);
+      Dynarr_set_length (cra, max_move);
     }
   else
     Dynarr_reset (cra);
@@ -422,7 +422,10 @@
       else if (start_pos <= bounds.right_out)
 	*next_start = bounds.right_out;
       else
-	ABORT ();
+	{
+	  ABORT ();
+	  *next_start = 0;
+	}
     }
 
   for (block = 0; block < Dynarr_length (dba); block++)
@@ -513,8 +516,8 @@
   block_end =
     (!Dynarr_length (ddb->runes)
      ? 0
-     : (Dynarr_atp (ddb->runes, Dynarr_length (ddb->runes) - 1)->xpos +
-	Dynarr_atp (ddb->runes, Dynarr_length (ddb->runes) - 1)->width));
+     : (Dynarr_lastp (ddb->runes)->xpos +
+	Dynarr_lastp (ddb->runes)->width));
 #endif
 
   /* If the new block type is not text and the cursor status is
@@ -690,7 +693,8 @@
       cdba = NULL;
     }
 
-  ddl = Dynarr_atp (ddla, line);      /* assert line < Dynarr_length (ddla) */
+  /* The following will assert line < Dynarr_length (ddla) */
+  ddl = Dynarr_atp (ddla, line);
   ddba = ddl->display_blocks;
 
   if (force_start >= 0 && force_start >= ddl->bounds.left_out)
@@ -714,7 +718,7 @@
 	 block, if present, must always be the first display block. */
       assert (Dynarr_length (ddba) != 0);
 
-      db = Dynarr_atp (ddba, 0);
+      db = Dynarr_begin (ddba);
       assert (db->type == TEXT);
 
       get_cursor_size_and_location (w, db, ddl->cursor_elt, &cursor_start,
@@ -1025,7 +1029,7 @@
       w->last_point_y[CURRENT_DISP] = y;
       Fset_marker (w->last_point[CURRENT_DISP], Qzero, w->buffer);
 
-      rb = Dynarr_atp (db->runes, 0);
+      rb = Dynarr_begin (db->runes);
       rb->cursor_type = CURSOR_ON;
       dl->cursor_elt = 0;
 
@@ -2192,7 +2196,7 @@
 
   if (ddla_len)
     {
-      if (ddla_len == 1 && Dynarr_atp (ddla, 0)->modeline)
+      if (ddla_len == 1 && Dynarr_begin (ddla)->modeline)
 	{
 	  ypos1 = WINDOW_TEXT_TOP (w);
 #ifdef HAVE_SCROLLBARS
@@ -2394,9 +2398,9 @@
 	  cdl = ddl = 0;
 
 	  if (cdla_len)
-	    cdl = Dynarr_atp (cdla, 0);
+	    cdl = Dynarr_begin (cdla);
 	  if (ddla_len)
-	    ddl = Dynarr_atp (ddla, 0);
+	    ddl = Dynarr_begin (ddla);
 
 	  if (!cdl || !ddl)
 	    need_to_clear_bottom = 1;
@@ -2460,7 +2464,7 @@
   /* If the number of display lines has shrunk, adjust. */
   if (cdla_len > ddla_len)
     {
-      Dynarr_length (cdla) = ddla_len;
+      Dynarr_set_length (cdla, ddla_len);
     }
 
   /* Output a vertical divider between windows, if necessary. */
--- a/src/redisplay-tty.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay-tty.c	Wed Feb 24 01:58:04 2010 -0600
@@ -106,10 +106,10 @@
  column, so we use ichar_string_displayed_columns().
  ****************************************************************************/
 static int
-tty_text_width (struct frame *f, struct face_cachel *UNUSED (cachel),
+tty_text_width (struct window *w, struct face_cachel *UNUSED (cachel),
 		const Ichar *str, Charcount len)
 {
-  struct console *c = XCONSOLE(FRAME_CONSOLE (f));
+  struct console *c = WINDOW_XCONSOLE (w);
 
   if (CONSOLE_TTY_MULTIPLE_WIDTH (c))
     {
@@ -575,12 +575,12 @@
   else
     Dynarr_reset (tty_output_ichar_dynarr_dynarr);
 
-  convert_ichar_string_into_ibyte_dynarr (Dynarr_atp (buf, 0),
+  convert_ichar_string_into_ibyte_dynarr (Dynarr_begin (buf),
 					    Dynarr_length (buf),
 					    tty_output_ichar_dynarr_dynarr);
 
   tty_output_ibyte_string (w, dl,
-			     Dynarr_atp (tty_output_ichar_dynarr_dynarr, 0),
+			     Dynarr_begin (tty_output_ichar_dynarr_dynarr),
 			     Dynarr_length (tty_output_ichar_dynarr_dynarr),
 			     xpos, findex, cursor);
 }
@@ -641,7 +641,7 @@
     {
       substitute_in_dynamic_color_string (Vtty_dynamic_color_fg,
 					  Fsymbol_name (sym));
-      escseq = Dynarr_atp (sidcs_dynarr, 0);
+      escseq = Dynarr_begin (sidcs_dynarr);
       escseqlen = Dynarr_length (sidcs_dynarr);
     }
 #endif
@@ -671,7 +671,7 @@
     {
       substitute_in_dynamic_color_string (Vtty_dynamic_color_bg,
 					  Fsymbol_name (sym));
-      escseq = Dynarr_atp (sidcs_dynarr, 0);
+      escseq = Dynarr_begin (sidcs_dynarr);
       escseqlen = Dynarr_length (sidcs_dynarr);
     }
 #endif
@@ -1412,7 +1412,7 @@
       char *sequence = tgetstr (keys[i].cap, address);
       if (sequence)
 	Fdefine_key (function_key_map,
-		     build_ext_string (sequence, Qbinary),
+		     build_extstring (sequence, Qbinary),
 		     vector1 (intern (keys[i].name)));
     }
 
@@ -1426,11 +1426,11 @@
     const char *k0      = tgetstr ("k0", address);
 
     if (k_semi)
-      Fdefine_key (function_key_map, build_ext_string (k_semi, Qbinary),
+      Fdefine_key (function_key_map, build_extstring (k_semi, Qbinary),
 		   vector1 (intern ("f10")));
 
     if (k0)
-      Fdefine_key (function_key_map, build_ext_string (k0, Qbinary),
+      Fdefine_key (function_key_map, build_extstring (k0, Qbinary),
 		   vector1 (intern (k_semi ? "f0" : "f10")));
   }
 
@@ -1454,7 +1454,7 @@
 	    {
 	      sprintf (fkey, "f%d", i);
 	      Fdefine_key (function_key_map,
-			   build_ext_string (sequence, Qbinary),
+			   build_extstring (sequence, Qbinary),
 			   vector1 (intern (fkey)));
 	    }
 	}
@@ -1470,7 +1470,7 @@
 	char *sequence = tgetstr (cap2, address);		\
 	if (sequence)						\
 	  Fdefine_key (function_key_map,			\
-		       build_ext_string (sequence, Qbinary),	\
+		       build_extstring (sequence, Qbinary),	\
 		       vector1 (intern (keyname)));		\
       }								\
   } while (0)
--- a/src/redisplay-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -27,485 +27,17 @@
 
 /* Lots of work done by Ben Wing for Mule */
 
-#include <config.h>
-#include "lisp.h"
-
-#include "buffer.h"
-#include "debug.h"
-#include "device-impl.h"
-#include "faces.h"
-#include "file-coding.h"
-#include "frame-impl.h"
-#include "gutter.h"
-#include "redisplay.h"
-#include "sysdep.h"
-#include "window.h"
-
-#include "mule-ccl.h"
-#include "charset.h"
-
-#include "console-x-impl.h"
-#include "glyphs-x.h"
-#include "objects-x-impl.h"
-#include "xgccache.h"
-
-#include "EmacsFrame.h"
-#include "EmacsFrameP.h"
-
-#include "sysproc.h" /* for select() */
-
-#include <X11/bitmaps/gray>
 
 /* Number of pixels below each line. */
 int x_interline_space; /* #### this needs to be implemented, but per-font */
 
-#define EOL_CURSOR_WIDTH	5
-
-static void x_output_vertical_divider (struct window *w, int clear);
-static void x_output_blank (struct window *w, struct display_line *dl,
-			    struct rune *rb, int start_pixpos,
-			    int cursor_start, int cursor_width);
-static void x_output_hline (struct window *w, struct display_line *dl,
-			    struct rune *rb);
-static void x_output_eol_cursor (struct window *w, struct display_line *dl,
-				 int xpos, face_index findex);
-static void x_clear_frame (struct frame *f);
-static void x_clear_frame_windows (Lisp_Object window);
-
-#ifdef USE_XFT
-#define MINL(x,y) ((((unsigned long) (x)) < ((unsigned long) (y))) \
-		   ? ((unsigned long) (x)) : ((unsigned long) (y)))
-#endif /* USE_XFT */
-
-
-     /* Note: We do not use the Xmb*() functions and XFontSets, nor the
-	Motif XFontLists and CompoundStrings.
-	Those functions are generally losing for a number of reasons.
-	Most important, they only support one locale (e.g. you could
-	display Japanese and ASCII text, but not mixed Japanese/Chinese
-	text).  You could maybe call setlocale() frequently to try to deal
-	with this, but that would generally fail because an XFontSet is
-	tied to one locale and won't have the other character sets in it.
-
-	fontconfig (the font database for Xft) has some specifier-like
-	properties, but it's not sufficient (witness the existence of
-	Pango).  Pango might do the trick, but it's not a cross-platform
-	solution; it would need significant advantages to be worth the
-	effort.
-     */
-
-/* #### Break me out into a separate header */
-struct textual_run
-{
-  Lisp_Object charset;
-  unsigned char *ptr;
-  int len;
-  int dimension;
-};
-
-/* Separate out the text in DYN into a series of textual runs of a
-   particular charset.  Also convert the characters as necessary into
-   the format needed by XDrawImageString(), XDrawImageString16(), et
-   al.  This means converting to one or two byte format, possibly
-   tweaking the high bits, and possibly running a CCL program. You
-   must pre-allocate the space used and pass it in. (This is done so
-   you can ALLOCA () the space.)  (sizeof(bufchar) * len) bytes must be
-   allocated for TEXT_STORAGE and (len * sizeof (struct textual_run))
-   bytes of RUN_STORAGE, where LEN is the length of the dynarr.
-
-   bufchar might not be fixed width (in the case of UTF-8).
-
-   Returns the number of runs actually used. */
-
-/* Notes on Xft implementation
-
-   - With Unicode, we're no longer going to have repertoires reified as
-   charsets.  (Not that we ever really did, what with corporate variants,
-   and so on.)  So we really should be querying the face for the desired
-   font, rather than the character for the charset, and that's what would
-   determine the separation into runs.
-   - The widechar versions of fontconfig (and therefore Xft) functions
-   seem to be just bigendian Unicode.  So there's actually no need to use
-   the 8-bit versions in computing runs and runes, it would seem.
-*/
-
-#if !defined(USE_XFT) && !defined(MULE)
-static int
-separate_textual_runs_nomule (unsigned char *text_storage,
-			      struct textual_run *run_storage,
-			      const Ichar *str, Charcount len,
-			      struct face_cachel *UNUSED(cachel))
-{
-  if (!len)
-    return 0;
-
-  run_storage[0].ptr = text_storage;
-  run_storage[0].len = len;
-  run_storage[0].dimension = 1;
-  run_storage[0].charset = Qnil;
-
-  while (len--)
-    *text_storage++ = *str++;
-  return 1;
-}
-#endif
-
-#if defined(USE_XFT) && !defined(MULE)
-/*
-  Note that in this configuration the "Croatian hack" of using an 8-bit,
-  non-Latin-1 font to get localized display without Mule simply isn't
-  available.  That's by design -- Unicode does not aid or abet that kind
-  of punning.
-  This means that the cast to XftChar16 gives the correct "conversion" to
-  UCS-2.
-  #### Is there an alignment issue with text_storage?
-*/
-static int
-separate_textual_runs_xft_nomule (unsigned char *text_storage,
-				  struct textual_run *run_storage,
-				  const Ichar *str, Charcount len,
-				  struct face_cachel *UNUSED(cachel))
-{
-  int i;
-  if (!len)
-    return 0;
-
-  run_storage[0].ptr = text_storage;
-  run_storage[0].len = len;
-  run_storage[0].dimension = 2;
-  run_storage[0].charset = Qnil;
-
-  for (i = 0; i < len; i++)
-    {
-      *(XftChar16 *)text_storage = str[i];
-      text_storage += sizeof(XftChar16);
-    }
-  return 1;
-}
-#endif
-
-#if defined(USE_XFT) && defined(MULE)
-static int
-separate_textual_runs_xft_mule (unsigned char *text_storage,
-				struct textual_run *run_storage,
-				const Ichar *str, Charcount len,
-				struct face_cachel *UNUSED(cachel))
-{
-  Lisp_Object prev_charset = Qunbound;
-  int runs_so_far = 0, i;
-
-  run_storage[0].ptr = text_storage;
-  run_storage[0].len = len;
-  run_storage[0].dimension = 2;
-  run_storage[0].charset = Qnil;
-
-  for (i = 0; i < len; i++)
-    {
-      Ichar ch = str[i];
-      Lisp_Object charset = ichar_charset(ch);
-      int ucs = ichar_to_unicode(ch);
-
-      /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
-	 REPLACMENT CHARACTER. */
-      /* That means we can't handle characters outside of the BMP for now */
-      ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
-
-      if (!EQ (charset, prev_charset))
-	{
-	  if (runs_so_far)
-	    run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
-	  run_storage[runs_so_far].ptr = text_storage;
-	  run_storage[runs_so_far].dimension = 2;
-	  run_storage[runs_so_far].charset = charset;
-	  prev_charset = charset;
-	  runs_so_far++;
-	}
-
-      *(XftChar16 *)text_storage = ucs;
-      text_storage += sizeof(XftChar16);
-    }
-
-  if (runs_so_far)
-    run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
-  return runs_so_far;
-}
-#endif
-
-#if !defined(USE_XFT) && defined(MULE)
-/*
-  This is the most complex function of this group, due to the various
-  indexing schemes used by different fonts.  For our purposes, they
-  fall into three classes.  Some fonts are indexed compatibly with ISO
-  2022; those fonts just use the Mule internal representation directly
-  (typically the high bit must be reset; this is determined by the `graphic'
-  flag).  Some fonts are indexed by Unicode, specifically by UCS-2.  These
-  are all translated using `ichar_to_unicode'.  Finally some fonts have
-  irregular indexes, and must be translated ad hoc.  In XEmacs ad hoc
-  translations are accomplished with CCL programs. */
-static int
-separate_textual_runs_mule (unsigned char *text_storage,
-			    struct textual_run *run_storage,
-			    const Ichar *str, Charcount len,
-			    struct face_cachel *cachel)
-{
-  Lisp_Object prev_charset = Qunbound;
-  int runs_so_far = 0, i;
-  Ibyte charset_leading_byte = LEADING_BYTE_ASCII;
-  int dimension = 1, graphic = 0, need_ccl_conversion = 0;
-  Lisp_Object ccl_prog;
-  struct ccl_program char_converter;
-
-  int translate_to_ucs_2 = 0;
-
-  for (i = 0; i < len; i++)
-    {
-      Ichar ch = str[i];
-      Lisp_Object charset;
-      int byte1, byte2;		/* BREAKUP_ICHAR dereferences the addresses
-				   of its arguments as pointer to int. */
-      BREAKUP_ICHAR (ch, charset, byte1, byte2);
-
-      if (!EQ (charset, prev_charset))
-	{
-	  /* At this point, dimension' and `prev_charset' refer to just-
-	     completed run.  `runs_so_far' and `text_storage' refer to the
-	     run about to start. */
-	  if (runs_so_far)
-	    {
-	      /* Update metadata for previous run. */
-	      run_storage[runs_so_far - 1].len =
-		text_storage - run_storage[runs_so_far - 1].ptr;
-	      if (2 == dimension) run_storage[runs_so_far - 1].len >>= 1;
-	    }
+#define THIS_IS_X
+#include "redisplay-xlike-inc.c"
 
-	  /* Compute metadata for current run.
-	     First, classify font.
-	     If the font is indexed by UCS-2, set `translate_to_ucs_2'.
-	     Else if the charset has a CCL program, set `need_ccl_conversion'.
-	     Else if the font is indexed by an ISO 2022 "graphic register",
-	         set `graphic'.
-	     These flags are almost mutually exclusive, but we're sloppy
-	     about resetting "shadowed" flags.  So the flags must be checked
-	     in the proper order in computing byte1 and byte2, below. */
-	  charset_leading_byte = XCHARSET_LEADING_BYTE(charset);
-	  translate_to_ucs_2 =
-	    bit_vector_bit (FACE_CACHEL_FONT_FINAL_STAGE (cachel),
-			    charset_leading_byte - MIN_LEADING_BYTE);
-	  if (translate_to_ucs_2)
-	    {
-	      dimension = 2;
-	    }
-	  else
-	    {
-	      dimension = XCHARSET_DIMENSION (charset);
-
-	      /* Check for CCL charset.
-		 If setup_ccl_program fails, we'll get a garbaged display.
-		 This should never happen, and even if it does, it should
-		 be harmless (unless the X server has buggy handling of
-		 characters undefined in the font).  It may be marginally
-		 more useful to users and debuggers than substituting a
-		 fixed replacement character. */
-	      ccl_prog = XCHARSET_CCL_PROGRAM (charset);
-	      if ((!NILP (ccl_prog))
-		  && (setup_ccl_program (&char_converter, ccl_prog) >= 0))
-		{
-		  need_ccl_conversion = 1;
-		}
-	      else 
-		{
-		  /* The charset must have an ISO 2022-compatible font index.
-		     There are 2 "registers" (what such fonts use as index).
-		     GL (graphic == 0) has the high bit of each octet reset,
-		     GR (graphic == 1) has it set. */
-		  graphic   = XCHARSET_GRAPHIC (charset);
-		  need_ccl_conversion = 0;
-		}
-	    }
-
-	  /* Initialize metadata for current run. */
-	  run_storage[runs_so_far].ptr       = text_storage;
-	  run_storage[runs_so_far].charset   = charset;
-	  run_storage[runs_so_far].dimension = dimension;
-
-	  /* Update loop variables. */
-	  prev_charset = charset;
-	  runs_so_far++;
-	} 
-
-      /* Must check flags in this order.  See comment above. */
-      if (translate_to_ucs_2)
-	{
-	  int ucs = ichar_to_unicode(ch);
-	  /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
-	     REPLACMENT CHARACTER. */
-	  ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
-
-	  byte1 = ucs >> 8;
-	  byte2 = ucs;
-	}
-      else if (need_ccl_conversion)
-	{
-	  char_converter.reg[0] = charset_leading_byte;
-	  char_converter.reg[1] = byte1;
-	  char_converter.reg[2] = byte2;
-	  ccl_driver (&char_converter, 0, 0, 0, 0, CCL_MODE_ENCODING);
-	  byte1 = char_converter.reg[1];
-	  byte2 = char_converter.reg[2];
-	}
-      else if (graphic == 0)
-	{
-	  byte1 &= 0x7F;
-	  byte2 &= 0x7F;
-	}
-      else
-	{
-	  byte1 |= 0x80;
-	  byte2 |= 0x80;
-	}
-
-      *text_storage++ = (unsigned char)byte1;
-
-      if (2 == dimension) *text_storage++ = (unsigned char)byte2;
-    }
-
-  if (runs_so_far)
-    {
-      run_storage[runs_so_far - 1].len =
-	text_storage - run_storage[runs_so_far - 1].ptr;
-      /* Dimension retains the relevant value for the run before it. */
-      if (2 == dimension)
-	run_storage[runs_so_far - 1].len >>= 1;
-    }
-
-  return runs_so_far;
-}
-#endif
-
-static int
-separate_textual_runs (unsigned char *text_storage,
-		       struct textual_run *run_storage,
-		       const Ichar *str, Charcount len,
-		       struct face_cachel *cachel)
-{
-#if defined(USE_XFT) && defined(MULE)
-  return separate_textual_runs_xft_mule(text_storage, run_storage, str, len, cachel);
-#endif
-#if defined(USE_XFT) && !defined(MULE)
-  return separate_textual_runs_xft_nomule(text_storage, run_storage, str, len, cachel);
-#endif
-#if !defined(USE_XFT) && defined(MULE)
-  return separate_textual_runs_mule(text_storage, run_storage, str, len, cachel);
-#endif
-#if !defined(USE_XFT) && !defined(MULE)
-  return separate_textual_runs_nomule(text_storage, run_storage, str, len, cachel);
-#endif
-}
-
-/****************************************************************************/
-/*                                                                          */
-/*                           X output routines                              */
-/*                                                                          */
-/****************************************************************************/
-
-static int
-x_text_width_single_run (struct frame * USED_IF_XFT (f),
-			 struct face_cachel *cachel, struct textual_run *run)
-{
-  Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
-  Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst);
-  if (!fi->proportional_p)
-    return fi->width * run->len;
-#ifdef USE_XFT
-  else if (FONT_INSTANCE_X_XFTFONT(fi))
-    {
-      static XGlyphInfo glyphinfo;
-      struct device *d = XDEVICE (f->device);
-      Display *dpy = DEVICE_X_DISPLAY (d);
-
-      if (run->dimension == 2) {
-	XftTextExtents16 (dpy,
-			  FONT_INSTANCE_X_XFTFONT(fi),
-			  (XftChar16 *) run->ptr, run->len, &glyphinfo);
-      } else {
-	XftTextExtents8 (dpy,
-			 FONT_INSTANCE_X_XFTFONT(fi),
-			 run->ptr, run->len, &glyphinfo);
-      }
-    
-      return glyphinfo.xOff;
-    }
-#endif
-  else if (FONT_INSTANCE_X_FONT (fi))
-    {
-      if (run->dimension == 2)
-	return XTextWidth16 (FONT_INSTANCE_X_FONT (fi),
-			     (XChar2b *) run->ptr, run->len);
-      else
-	return XTextWidth (FONT_INSTANCE_X_FONT (fi),
-			   (char *) run->ptr, run->len);
-    }
-  else
-    abort();
-  return 0;			/* shut up GCC */
-}
-
-/*
-   x_text_width
-
-   Given a string and a merged face, return the string's length in pixels
-   when displayed in the fonts associated with the face.
-   */
-
-/* #### Break me out into a separate header */
-int x_text_width (struct frame *f, struct face_cachel *cachel,
-		  const Ichar *str, Charcount len);
-int
-x_text_width (struct frame *f, struct face_cachel *cachel,
-	      const Ichar *str, Charcount len)
-{
-  /* !!#### Needs review */
-  int width_so_far = 0;
-  unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
-  struct textual_run *runs = alloca_array (struct textual_run, len);
-  int nruns;
-  int i;
-
-  nruns = separate_textual_runs (text_storage, runs, str, len, 
-				 cachel);
-
-  for (i = 0; i < nruns; i++)
-    width_so_far += x_text_width_single_run (f, cachel, runs + i);
-
-  return width_so_far;
-}
-
-/*****************************************************************************
- x_divider_height
-
- Return the height of the horizontal divider.  This is a function because
- divider_height is a device method.
-
- #### If we add etched horizontal divider lines this will have to get
- smarter.
- ****************************************************************************/
-static int
-x_divider_height (void)
-{
-  return 1;
-}
-
-/*****************************************************************************
- x_eol_cursor_width
-
- Return the width of the end-of-line cursor.  This is a function
- because eol_cursor_width is a device method.
- ****************************************************************************/
-static int
-x_eol_cursor_width (void)
-{
-  return EOL_CURSOR_WIDTH;
-}
+static void x_output_shadows (struct frame *f, int x, int y, int width,
+			      int height, GC top_shadow_gc,
+			      GC bottom_shadow_gc, GC background_gc,
+			      int shadow_thickness, int edges);
 
 /*****************************************************************************
  x_window_output_begin
@@ -513,7 +45,7 @@
  Perform any necessary initialization prior to an update.
  ****************************************************************************/
 static void
-x_window_output_begin (struct window *UNUSED (w))
+XLIKE_window_output_begin (struct window *UNUSED (w))
 {
 }
 
@@ -523,233 +55,21 @@
  Perform any necessary flushing of queues when an update has completed.
  ****************************************************************************/
 static void
-x_window_output_end (struct window *w)
+XLIKE_window_output_end (struct window *w)
 {
   if (!(check_if_pending_expose_event (WINDOW_XDEVICE (w))))
     XFlush (DEVICE_X_DISPLAY (WINDOW_XDEVICE (w)));
 }
 
 /*****************************************************************************
- x_output_display_block
-
- Given a display line, a block number for that start line, output all
- runes between start and end in the specified display block.
- ****************************************************************************/
-static void
-x_output_display_block (struct window *w, struct display_line *dl, int block,
-			int start, int end, int start_pixpos, int cursor_start,
-			int cursor_width, int cursor_height)
-{
-#ifndef USE_XFT
-  struct frame *f = XFRAME (w->frame);
-#endif
-  Ichar_dynarr *buf;
-  Lisp_Object window;
-
-  struct display_block *db = Dynarr_atp (dl->display_blocks, block);
-  rune_dynarr *rba = db->runes;
-  struct rune *rb;
-
-  int elt = start;
-  face_index findex;
-  int xpos, width = 0;
-  Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
-				     MULE is not defined */
-
-  window = wrap_window (w);
-  rb = Dynarr_atp (rba, start);
-
-  if (!rb)
-    /* Nothing to do so don't do anything. */
-    return;
-
-  findex = rb->findex;
-  xpos = rb->xpos;
-  if (rb->type == RUNE_CHAR)
-    charset = ichar_charset (rb->object.chr.ch);
-
-  if (end < 0)
-    end = Dynarr_length (rba);
-  buf = Dynarr_new (Ichar);
-
-  while (elt < end)
-    {
-      rb = Dynarr_atp (rba, elt);
-
-      if (rb->findex == findex && rb->type == RUNE_CHAR
-	  && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
-	  && EQ (charset, ichar_charset (rb->object.chr.ch)))
-	{
-	  Dynarr_add (buf, rb->object.chr.ch);
-	  width += rb->width;
-	  elt++;
-	}
-      else
-	{
-	  if (Dynarr_length (buf))
-	    {
-	      x_output_string (w, dl, buf, xpos, 0, start_pixpos, width,
-			       findex, 0, cursor_start, cursor_width,
-			       cursor_height);
-	      xpos = rb->xpos;
-	      width = 0;
-	    }
-	  Dynarr_reset (buf);
-	  width = 0;
-
-	  if (rb->type == RUNE_CHAR)
-	    {
-	      findex = rb->findex;
-	      xpos = rb->xpos;
-	      charset = ichar_charset (rb->object.chr.ch);
-
-	      if (rb->cursor_type == CURSOR_ON)
-		{
-		  if (rb->object.chr.ch == '\n')
-		    {
-		      x_output_eol_cursor (w, dl, xpos, findex);
-		    }
-		  else
-		    {
-		      Dynarr_add (buf, rb->object.chr.ch);
-		      x_output_string (w, dl, buf, xpos, 0, start_pixpos,
-				       rb->width, findex, 1,
-				       cursor_start, cursor_width,
-				       cursor_height);
-		      Dynarr_reset (buf);
-		    }
-
-		  xpos += rb->width;
-		  elt++;
-		}
-	      else if (rb->object.chr.ch == '\n')
-		{
-		  /* Clear in case a cursor was formerly here. */
-		  redisplay_clear_region (window, findex, xpos,
-					  DISPLAY_LINE_YPOS (dl),
-					  rb->width,
-					  DISPLAY_LINE_HEIGHT (dl));
-		  elt++;
-		}
-	    }
-	  else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
-	    {
-	      if (rb->type == RUNE_BLANK)
-		x_output_blank (w, dl, rb, start_pixpos, cursor_start,
-				cursor_width);
-	      else
-		{
-		  /* #### Our flagging of when we need to redraw the
-                     modeline shadows sucks.  Since RUNE_HLINE is only used
-                     by the modeline at the moment it is a good bet
-                     that if it gets redrawn then we should also
-                     redraw the shadows.  This won't be true forever.
-                     We borrow the shadow_thickness_changed flag for
-                     now. */
-		  w->shadow_thickness_changed = 1;
-		  x_output_hline (w, dl, rb);
-		}
-
-	      elt++;
-	      if (elt < end)
-		{
-		  rb = Dynarr_atp (rba, elt);
-
-		  findex = rb->findex;
-		  xpos = rb->xpos;
-		}
-	    }
-	  else if (rb->type == RUNE_DGLYPH)
-	    {
-	      Lisp_Object instance;
-	      struct display_box dbox;
-	      struct display_glyph_area dga;
-
-	      redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset,
-						 rb->object.dglyph.yoffset, start_pixpos,
-                                                 rb->width, &dbox, &dga);
-
-	      window = wrap_window (w);
-	      instance = glyph_image_instance (rb->object.dglyph.glyph,
-					       window, ERROR_ME_DEBUG_WARN, 1);
-	      findex = rb->findex;
-
-	      if (IMAGE_INSTANCEP (instance))
-		{
-		  switch (XIMAGE_INSTANCE_TYPE (instance))
-		    {
-		    case IMAGE_MONO_PIXMAP:
-		    case IMAGE_COLOR_PIXMAP:
-		      redisplay_output_pixmap (w, instance, &dbox, &dga, findex,
-					       cursor_start, cursor_width,
-					       cursor_height, 0);
-		      break;
-
-		    case IMAGE_WIDGET:
-		      if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
-			      Qlayout))
-			{
-			  redisplay_output_layout (window, instance, &dbox, &dga, findex,
-						   cursor_start, cursor_width,
-						   cursor_height);
-			  break;
-			}
-		    case IMAGE_SUBWINDOW:
-		      redisplay_output_subwindow (w, instance, &dbox, &dga, findex,
-						  cursor_start, cursor_width,
-						  cursor_height);
-		      break;
-
-		    case IMAGE_NOTHING:
-		      /* nothing is as nothing does */
-		      break;
-
-		    case IMAGE_TEXT:
-		    case IMAGE_POINTER:
-		    default:
-		      ABORT ();
-		    }
-		  IMAGE_INSTANCE_OPTIMIZE_OUTPUT
-		    (XIMAGE_INSTANCE (instance)) = 0;
-		}
-
-	      xpos += rb->width;
-	      elt++;
-	    }
-	  else
-	    ABORT ();
-	}
-    }
-
-  if (Dynarr_length (buf))
-    x_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex,
-		     0, cursor_start, cursor_width, cursor_height);
-
-  if (dl->modeline
-      && !EQ (Qzero, w->modeline_shadow_thickness)
-#ifndef USE_XFT
-      /* This optimization doesn't work right with some Xft fonts, which
-	 leave antialiasing turds at the boundary.  I don't know if this
-	 is an Xft bug or not, but I think it is.   See x_output_string. */
-      && (f->clear
-	  || f->windows_structure_changed
-	  || w->shadow_thickness_changed)
-#endif
-      )
-    bevel_modeline (w, dl);
-
-  Dynarr_free (buf);
-}
-
-/*****************************************************************************
  x_bevel_area
 
  Draw shadows for the given area in the given face.
  ****************************************************************************/
 static void
-x_bevel_area (struct window *w, face_index findex,
-	      int x, int y, int width, int height,
-	      int shadow_thickness, int edges, enum edge_style style)
+XLIKE_bevel_area (struct window *w, face_index findex,
+		  int x, int y, int width, int height,
+		  int shadow_thickness, int edges, enum edge_style style)
 {
   struct frame *f = XFRAME (w->frame);
   struct device *d = XDEVICE (f->device);
@@ -867,1078 +187,12 @@
 }
 
 /*****************************************************************************
- x_get_gc
-
- Given a number of parameters return a GC with those properties.
- ****************************************************************************/
-static GC
-x_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, Lisp_Object bg,
-	  Lisp_Object bg_pmap, Lisp_Object lwidth)
-{
-  XGCValues gcv;
-  unsigned long mask;
-
-  memset (&gcv, ~0, sizeof (XGCValues));
-  gcv.graphics_exposures = False;
-  /* Make absolutely sure that we don't pick up a clipping region in
-     the GC returned by this function. */
-  gcv.clip_mask = None;
-  gcv.clip_x_origin = 0;
-  gcv.clip_y_origin = 0;
-  gcv.fill_style = FillSolid;
-  mask = GCGraphicsExposures | GCClipMask | GCClipXOrigin | GCClipYOrigin;
-  mask |= GCFillStyle;
-
-  if (!NILP (font)
-#ifdef USE_XFT
-      /* Only set the font if it's a core font */
-      /* the renderfont will be set elsewhere (not part of gc) */
-      && !FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))
-#endif
-      )
-    {
-      gcv.font = FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font))->fid;
-      mask |= GCFont;
-    }
-
-  /* evil kludge! */
-  if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !INTP (fg))
-    {
-      /* #### I fixed one case where this was getting hit.  It was a
-         bad macro expansion (compiler bug). */
-      stderr_out ("Help! x_get_gc got a bogus fg value! fg = ");
-      debug_print (fg);
-      fg = Qnil;
-    }
-
-  if (!NILP (fg))
-    {
-      if (COLOR_INSTANCEP (fg))
-	gcv.foreground = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (fg)).pixel;
-      else
-	gcv.foreground = XINT (fg);
-      mask |= GCForeground;
-    }
-
-  if (!NILP (bg))
-    {
-      if (COLOR_INSTANCEP (bg))
-	gcv.background = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (bg)).pixel;
-      else
-	gcv.background = XINT (bg);
-      mask |= GCBackground;
-    }
-
-  /* This special case comes from a request to draw text with a face which has
-     the dim property. We'll use a stippled foreground GC. */
-  if (EQ (bg_pmap, Qdim))
-    {
-      assert (DEVICE_X_GRAY_PIXMAP (d) != None);
-
-      gcv.fill_style = FillStippled;
-      gcv.stipple = DEVICE_X_GRAY_PIXMAP (d);
-      mask |= (GCFillStyle | GCStipple);
-    }
-  else  if (IMAGE_INSTANCEP (bg_pmap)
-	    && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
-    {
-      if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0)
-	{
-	  gcv.fill_style = FillOpaqueStippled;
-	  gcv.stipple = XIMAGE_INSTANCE_X_PIXMAP (bg_pmap);
-	  mask |= (GCStipple | GCFillStyle);
-	}
-      else
-	{
-	  gcv.fill_style = FillTiled;
-	  gcv.tile = XIMAGE_INSTANCE_X_PIXMAP (bg_pmap);
-	  mask |= (GCTile | GCFillStyle);
-	}
-    }
-
-  if (!NILP (lwidth))
-    {
-      gcv.line_width = XINT (lwidth);
-      mask |= GCLineWidth;
-    }
-
-#if 0
-  debug_out ("\nx_get_gc: calling gc_cache_lookup\n");
-#endif
-  return gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask);
-}
-
-/*****************************************************************************
- x_output_string
-
- Given a string and a starting position, output that string in the
- given face.  If cursor is true, draw a cursor around the string.
- Correctly handles multiple charsets in the string.
-
- The meaning of the parameters is something like this:
-
- W		Window that the text is to be displayed in.
- DL		Display line that this text is on.  The values in the
- 		structure are used to determine the vertical position and
-		clipping range of the text.
- BUF		Dynamic array of Ichars specifying what is actually to be
-		drawn.
- XPOS		X position in pixels where the text should start being drawn.
- XOFFSET	Number of pixels to be chopped off the left side of the
- 		text.  The effect is as if the text were shifted to the
-		left this many pixels and clipped at XPOS.
- CLIP_START	Clip everything left of this X position.
- WIDTH		Clip everything right of XPOS + WIDTH.
- FINDEX		Index for the face cache element describing how to display
- 		the text.
- CURSOR		#### I don't understand this.  There's something
- 		strange and overcomplexified with this variable.
-		Chuck, explain please?
- CURSOR_START	Starting X position of cursor.
- CURSOR_WIDTH	Width of cursor in pixels.
- CURSOR_HEIGHT	Height of cursor in pixels.
-
- Starting Y position of cursor is the top of the text line.
- The cursor is drawn sometimes whether or not CURSOR is set. ???
- ****************************************************************************/
-void
-x_output_string (struct window *w, struct display_line *dl,
-		 Ichar_dynarr *buf, int xpos, int xoffset, int clip_start,
-		 int width, face_index findex, int cursor,
-		 int cursor_start, int cursor_width, int cursor_height)
-{
-  /* General variables */
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object window = wrap_window (w);
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-
-  int clip_end;
-
-  /* Cursor-related variables */
-  int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-  int cursor_clip;
-  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
-							 WINDOW_BUFFER (w));
-  struct face_cachel *cursor_cachel = 0;
-
-  /* Text-related variables */
-  Lisp_Object bg_pmap;
-  GC bgc, gc;
-  int height = DISPLAY_LINE_HEIGHT (dl);
-  int ypos = DISPLAY_LINE_YPOS (dl);
-  int len = Dynarr_length (buf);
-  unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
-  struct textual_run *runs = alloca_array (struct textual_run, len);
-  int nruns;
-  int i;
-  struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
-
-  int use_x_font = 1;		/* #### bogus!!
-				   The logic of this function needs review! */
-#ifdef USE_XFT
-  Colormap cmap = DEVICE_X_COLORMAP (d);
-  Visual *visual = DEVICE_X_VISUAL (d);
-  static XftColor fg, bg;
-  XftDraw *xftDraw;
-
-  /* Lazily initialize frame's xftDraw member. */
-  if (!FRAME_X_XFTDRAW (f)) {
-    FRAME_X_XFTDRAW (f) = XftDrawCreate (dpy, x_win, visual, cmap);
-  }
-  xftDraw = FRAME_X_XFTDRAW (f);
-
-  /* #### This will probably cause asserts when passed a Lisp integer for a
-     color.  See ca. line 759 this file.
-     #### Maybe xft_convert_color should take an XColor, not a pixel. */
-#define XFT_FROB_LISP_COLOR(color, dim) \
-  xft_convert_color (dpy, cmap, visual, \
-		     COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)).pixel, \
-		     (dim))
-#endif
-
-  if (width < 0)
-    width = x_text_width (f, cachel, Dynarr_atp (buf, 0), Dynarr_length (buf));
-
-  /* Regularize the variables passed in. */
-
-  if (clip_start < xpos)
-    clip_start = xpos;
-  clip_end = xpos + width;
-  if (clip_start >= clip_end)
-    /* It's all clipped out. */
-    return;
-
-  xpos -= xoffset;
-
-  /* make sure the area we are about to display is subwindow free. */
-  redisplay_unmap_subwindows_maybe (f, clip_start, ypos,
-				    clip_end - clip_start, height);
-
-  cursor_clip = (cursor_start >= clip_start &&
-		 cursor_start < clip_end);
-
-  /* This cursor code is really a mess. */
-  if (!NILP (w->text_cursor_visible_p)
-      && (cursor
-	  || cursor_clip
-	  || (cursor_width
-	      && (cursor_start + cursor_width >= clip_start)
-	      && !NILP (bar_cursor_value))))
-    {
-      /* These have to be in separate statements in order to avoid a
-         compiler bug. */
-      face_index sucks = get_builtin_face_cache_index (w, Vtext_cursor_face);
-      cursor_cachel = WINDOW_FACE_CACHEL (w, sucks);
-
-      /* We have to reset this since any call to WINDOW_FACE_CACHEL
-         may cause the cache to resize and any pointers to it to
-         become invalid. */
-      cachel = WINDOW_FACE_CACHEL (w, findex);
-    }
-
-#ifdef HAVE_XIM
-  if (cursor && focus && (cursor_start == clip_start) && cursor_height)
-    XIM_SetSpotLocation (f, xpos - 2, dl->ypos + dl->descent - 2);
-#endif /* HAVE_XIM */
-
-  bg_pmap = cachel->background_pixmap;
-  if (!IMAGE_INSTANCEP (bg_pmap)
-      || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
-    bg_pmap = Qnil;
-
-  if ((cursor && focus && NILP (bar_cursor_value)
-       && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
-    bgc = 0;
-  else
-    {
-      bgc = x_get_gc (d, Qnil, cachel->foreground, cachel->background,
-		      bg_pmap, Qnil);
-    }
-
-  if (bgc)
-    {
-      XFillRectangle (dpy, x_win, bgc, clip_start,
-		      ypos, clip_end - clip_start,
-		      height);
-    }
-
-  nruns = separate_textual_runs (text_storage, runs, Dynarr_atp (buf, 0),
-				 Dynarr_length (buf), cachel);
-
-  for (i = 0; i < nruns; i++)
-    {
-      Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
-      Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
-      int this_width;
-      int need_clipping;
-
-      if (EQ (font, Vthe_null_font_instance))
-	continue;
-
-      this_width = x_text_width_single_run (f, cachel, runs + i);
-      need_clipping = (dl->clip || clip_start > xpos ||
-		       clip_end < xpos + this_width);
-
-      /* XDrawImageString only clears the area equal to the height of
-	 the given font.  It is possible that a font is being displayed
-	 on a line taller than it is, so this would cause us to fail to
-	 clear some areas. */
-      if ((int) fi->height < (int) (height + dl->clip + dl->top_clip))
-	{
-	  int clear_start = max (xpos, clip_start);
-	  int clear_end = min (xpos + this_width, clip_end);
-
-	  if (cursor)
-	    {
-	      int ypos1_line, ypos1_string, ypos2_line, ypos2_string;
-
-	      ypos1_string = dl->ypos - fi->ascent;
-	      ypos2_string = dl->ypos + fi->descent;
-	      ypos1_line = ypos;
-	      ypos2_line = ypos1_line + height;
-
-	      /* Make sure we don't clear below the real bottom of the
-		 line. */
-	      if (ypos1_string > ypos2_line)
-		ypos1_string = ypos2_line;
-	      if (ypos2_string > ypos2_line)
-		ypos2_string = ypos2_line;
-
-	      if (ypos1_line < ypos1_string)
-		{
-		  redisplay_clear_region (window, findex, clear_start, ypos1_line,
-				  clear_end - clear_start,
-				  ypos1_string - ypos1_line);
-		}
-
-	      if (ypos2_line > ypos2_string)
-		{
-		  redisplay_clear_region (window, findex, clear_start, ypos2_string,
-				  clear_end - clear_start,
-				  ypos2_line - ypos2_string);
-		}
-	    }
-	  else
-	    {
-	      redisplay_clear_region (window, findex, clear_start,
-			      ypos, clear_end - clear_start,
-			      height);
-	    }
-	}
-
-      if (cursor && cursor_cachel && focus && NILP (bar_cursor_value))
-	{
-#ifdef USE_XFT
-	  fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
-	  bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
-#endif
-	  gc = x_get_gc (d, font, cursor_cachel->foreground,
-			 cursor_cachel->background, Qnil, Qnil);
-	}
-      else if (cachel->dim)
-	{
-	  /* Ensure the gray bitmap exists */
-	  if (DEVICE_X_GRAY_PIXMAP (d) == None)
-	    DEVICE_X_GRAY_PIXMAP (d) =
-	      XCreateBitmapFromData (dpy, x_win, (char *)gray_bits,
-				     gray_width, gray_height);
-
-	  /* Request a GC with the gray stipple pixmap to draw dimmed text */
-#ifdef USE_XFT
-	  fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1);
-	  bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
-#endif
-	  gc = x_get_gc (d, font, cachel->foreground, cachel->background,
-			 Qdim, Qnil);
-	}
-      else
-	{
-#ifdef USE_XFT
-	  fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0);
-	  bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
-#endif
-	  gc = x_get_gc (d, font, cachel->foreground, cachel->background,
-			 Qnil, Qnil);
-	}
-#ifdef USE_XFT
-      {
-	XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
-
-	if (rf)
-	  {
-	    use_x_font = 0;
-	    if (need_clipping)
-	      {
-		Region clip_reg = XCreateRegion();
-		XRectangle clip_box = { clip_start, ypos,
-					clip_end - clip_start, height };
-
-		XUnionRectWithRegion (&clip_box, clip_reg, clip_reg); 
-		XftDrawSetClip(xftDraw, clip_reg);
-		XDestroyRegion(clip_reg);
-	      }
-
-	    if (!bgc)
-	      {
-		/* #### Neither rect_height nor XftTextExtents as computed
-		   below handles the vertical space taken up by antialiasing,
-		   which for some fonts (eg, Bitstream Vera Sans Mono-16 on
-		   my Mac PowerBook G4) leaves behind orphaned dots on
-		   insertion or deletion earlier in the line, especially in
-		   the case of the underscore character.
-		   Interestingly, insertion or deletion of a single character
-		   immediately after a refresh does not leave any droppings,
-		   but any further insertions or deletions do.
-		   While adding a pixel to rect_height (mostly) takes care of
-		   this, it trashes aggressively laid-out elements like the
-		   modeline (overwriting part of the bevel).
-		   OK, unconditionally redraw the bevel, and increment
-		   rect_height by 1.  See x_output_display_block. -- sjt */
-		struct textual_run *run = &runs[i];
-		int rect_width = x_text_width_single_run (f, cachel, run);
-#ifndef USE_XFTTEXTENTS_TO_AVOID_FONT_DROPPINGS
-		int rect_height = FONT_INSTANCE_ASCENT(fi)
-				  + FONT_INSTANCE_DESCENT(fi) + 1;
-#else
-		int rect_height = FONT_INSTANCE_ASCENT(fi)
-				  + FONT_INSTANCE_DESCENT(fi);
-		XGlyphInfo gi;
-		if (run->dimension == 2) {
-		  XftTextExtents16 (dpy,
-				    FONT_INSTANCE_X_XFTFONT(fi),
-				    (XftChar16 *) run->ptr, run->len, &gi);
-		} else {
-		  XftTextExtents8 (dpy,
-				   FONT_INSTANCE_X_XFTFONT(fi),
-				   run->ptr, run->len, &gi);
-		}
-		rect_height = rect_height > gi.height
-			      ? rect_height : gi.height;
-#endif
-
-		XftDrawRect (xftDraw, &bg,
-			     xpos, ypos, rect_width, rect_height);
-	      }
-	
-	    if (runs[i].dimension == 1)
-	      XftDrawString8 (xftDraw, &fg, rf, xpos, dl->ypos,
-			      runs[i].ptr, runs[i].len);
-	    else
-	      XftDrawString16 (xftDraw, &fg, rf, xpos, dl->ypos,
-			       (XftChar16 *) runs[i].ptr, runs[i].len);
-	  }
-      }
-#endif
-      {
-	if (use_x_font)
-	  {
-	    if (need_clipping)
-	      {
-		XRectangle clip_box[1];
-
-		clip_box[0].x = 0;
-		clip_box[0].y = 0;
-		clip_box[0].width = clip_end - clip_start;
-		clip_box[0].height = height;
-
-		XSetClipRectangles (dpy, gc, clip_start, ypos,
-				    clip_box, 1, YXBanded);
-	      }
-
-	    if (runs[i].dimension == 1)
-	      (bgc ? XDrawString : XDrawImageString)
-		(dpy, x_win, gc, xpos, dl->ypos,
-		 (char *) runs[i].ptr, runs[i].len);
-	    else
-	      (bgc ? XDrawString16 : XDrawImageString16)
-		(dpy, x_win, gc, xpos, dl->ypos,
-		 (XChar2b *) runs[i].ptr, runs[i].len);
-	  }
-      }
-
-      /* We draw underlines in the same color as the text. */
-      if (cachel->underline)
-	{
-	  int upos, uthick;
-	  unsigned long upos_ext, uthick_ext;
-	  XFontStruct *fs =
-	    use_x_font ? FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)) : 0;
-	  /* #### the logic of the next two may be suboptimal: we may want
-	     to use the POSITION and/or THICKNESS information with Xft */
-	  if (fs && XGetFontProperty (fs, XA_UNDERLINE_POSITION, &upos_ext))
-	    upos = (int) upos_ext;
-	  else
-	    upos = dl->descent / 2;
-	  if (fs && XGetFontProperty (fs, XA_UNDERLINE_THICKNESS, &uthick_ext))
-	    uthick = (int) uthick_ext;
-	  else
-	    uthick = 1;
-	  if (dl->ypos + upos < dl->ypos + dl->descent - dl->clip)
-	    {
-	      if (dl->ypos + upos + uthick > dl->ypos + dl->descent - dl->clip)
-		uthick = dl->descent - dl->clip - upos;
-
-	      if (uthick == 1)
-		{
-		  XDrawLine (dpy, x_win, gc, xpos, dl->ypos + upos,
-			     xpos + this_width, dl->ypos + upos);
-		}
-	      else if (uthick > 1)
-		{
-		  XFillRectangle (dpy, x_win, gc, xpos,
-				  dl->ypos + upos, this_width, uthick);
-		}
-	    }
-	}
-
-      if (cachel->strikethru)
-	{
-	  int ascent, descent, upos, uthick;
-	  unsigned long ascent_ext, descent_ext, uthick_ext;
-	  XFontStruct *fs = FONT_INSTANCE_X_FONT (fi);
-	  
-	  if (!use_x_font)
-	    {
-	      ascent = dl->ascent;
-	      descent = dl->descent;
-	      uthick = 1;
-	    }
-	  else
-	    {
-	      if (!XGetFontProperty (fs, XA_STRIKEOUT_ASCENT, &ascent_ext))
-		ascent = fs->ascent;
-	      else
-		ascent = (int) ascent_ext;
-	      if (!XGetFontProperty (fs, XA_STRIKEOUT_DESCENT, &descent_ext))
-		descent = fs->descent;
-	      else
-		descent = (int) descent_ext;
-	      if (!XGetFontProperty (fs, XA_UNDERLINE_THICKNESS, &uthick_ext))
-		uthick = 1;
-	      else
-		uthick = (int) uthick_ext;
-	    }
-
-	  upos = ascent - ((ascent + descent) / 2) + 1;
-
-	  /* Generally, upos will be positive (above the baseline),so
-             subtract */
-	  if (dl->ypos - upos < dl->ypos + dl->descent - dl->clip)
-	    {
-	      if (dl->ypos - upos + uthick > dl->ypos + dl->descent - dl->clip)
-		uthick = dl->descent - dl->clip + upos;
-
-	      if (uthick == 1)
-		XDrawLine (dpy, x_win, gc, xpos, dl->ypos - upos,
-			   xpos + this_width, dl->ypos - upos);
-	      else if (uthick > 1)
-		XFillRectangle (dpy, x_win, gc, xpos, dl->ypos + upos,
-				this_width, uthick);
-	    }
-	}
-
-      /* Restore the GC */
-      if (need_clipping)
-	{
-#ifdef USE_XFT
-	  if (!use_x_font)
-	    {
-	      XftDrawSetClip(xftDraw, 0);
-	    }
-	  else
-	    {
-#endif
-	      XSetClipMask (dpy, gc, None);
-	      XSetClipOrigin (dpy, gc, 0, 0);
-#ifdef USE_XFT
-	    }
-#endif
-	}
-
-      /* If we are actually superimposing the cursor then redraw with just
-	 the appropriate section highlighted. */
-      if (cursor_clip && !cursor && focus && cursor_cachel)
-	{
-#ifdef USE_XFT
-	  if (!use_x_font)	/* Xft */
-	    {
-	      XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
-	  
-	      { /* set up clipping */
-		Region clip_reg = XCreateRegion();
-		XRectangle clip_box = { cursor_start, ypos,
-					cursor_width, height };
-	    
-		XUnionRectWithRegion (&clip_box, clip_reg, clip_reg); 
-		XftDrawSetClip(xftDraw, clip_reg);
-		XDestroyRegion(clip_reg);
-	      }
-	      { /* draw background rectangle & draw text */
-		int rect_height = FONT_INSTANCE_ASCENT(fi)
-				  + FONT_INSTANCE_DESCENT(fi);
-		int rect_width = x_text_width_single_run(f, cachel, &runs[i]);
-		XftColor xft_color;
-
-		xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
-		XftDrawRect (xftDraw, &xft_color,
-			     xpos, ypos, rect_width, rect_height);
-
-		xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
-		if (runs[i].dimension == 1)
-		  XftDrawString8 (xftDraw, &xft_color, rf, xpos, dl->ypos,
-				  runs[i].ptr, runs[i].len);
-		else
-		  XftDrawString16 (xftDraw, &xft_color, rf, xpos, dl->ypos,
-				   (XftChar16 *) runs[i].ptr, runs[i].len);
-	      }
-
-	      XftDrawSetClip(xftDraw, 0);
-	    }
-	  else			/* core font, not Xft */
-	    {
-#endif
-	      GC cgc;
-	      XRectangle clip_box[1];
-	
-	      cgc = x_get_gc (d, font, cursor_cachel->foreground,
-			      cursor_cachel->background, Qnil, Qnil);
-
-	      clip_box[0].x = 0;
-	      clip_box[0].y = 0;
-	      clip_box[0].width = cursor_width;
-	      clip_box[0].height = height;
-	
-	      XSetClipRectangles (dpy, cgc, cursor_start, ypos,
-				  clip_box, 1, YXBanded);
-	      if (runs[i].dimension == 1)
-		XDrawImageString (dpy, x_win, cgc, xpos, dl->ypos,
-				  (char *) runs[i].ptr, runs[i].len);
-	      else
-		XDrawImageString16 (dpy, x_win, cgc, xpos, dl->ypos,
-				    (XChar2b *) runs[i].ptr, runs[i].len);
-	
-	      XSetClipMask (dpy, cgc, None);
-	      XSetClipOrigin (dpy, cgc, 0, 0);
-#ifdef USE_XFT
-	    }
-#endif
-	}
-
-      xpos += this_width;
-    }
-
-  /* Draw the non-focus box or bar-cursor as needed. */
-  /* Can't this logic be simplified? */
-  if (cursor_cachel
-      && ((cursor && !focus && NILP (bar_cursor_value))
-	  || (cursor_width
-	      && (cursor_start + cursor_width >= clip_start)
-	      && !NILP (bar_cursor_value))))
-    {
-      int tmp_height, tmp_y;
-      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-      int need_clipping = (cursor_start < clip_start
-			   || clip_end < cursor_start + cursor_width);
-
-      /* #### This value is correct (as far as I know) because
-	 all of the times we need to draw this cursor, we will
-	 be called with exactly one character, so we know we
-	 can always use runs[0].
-
-	 This is bogus as all hell, however.  The cursor handling in
-	 this function is way bogus and desperately needs to be
-	 cleaned up.  (In particular, the drawing of the cursor should
-	 really really be separated out of this function.  This may be
-	 a bit tricky now because this function itself does way too
-	 much stuff, a lot of which needs to be moved into
-	 redisplay.c.)  This is the only way to be able to easily add
-	 new cursor types or (e.g.) make the bar cursor be able to
-	 span two characters instead of overlaying just one. */
-      int bogusly_obtained_ascent_value =
-	XFONT_INSTANCE (FACE_CACHEL_FONT (cachel, runs[0].charset))->ascent;
-
-      if (!NILP (bar_cursor_value))
-	{
-	  gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
-			 make_int (bar_width));
-	}
-      else
-	{
-	  gc = x_get_gc (d, Qnil, cursor_cachel->background,
-			 Qnil, Qnil, Qnil);
-	}
-
-      tmp_y = dl->ypos - bogusly_obtained_ascent_value;
-      tmp_height = cursor_height;
-      if (tmp_y + tmp_height > (int) (ypos + height))
-	{
-	  tmp_y = ypos + height - tmp_height;
-	  if (tmp_y < (int) ypos)
-	    tmp_y = ypos;
-	  tmp_height = ypos + height - tmp_y;
-	}
-
-      if (need_clipping)
-	{
-	  XRectangle clip_box[1];
-	  clip_box[0].x = 0;
-	  clip_box[0].y = 0;
-	  clip_box[0].width = clip_end - clip_start;
-	  clip_box[0].height = tmp_height;
-	  XSetClipRectangles (dpy, gc, clip_start, tmp_y,
-			      /* #### why not Unsorted? */
-			      clip_box, 1, YXBanded);
-	}
-
-      if (!focus && NILP (bar_cursor_value))
-	{
-	  XDrawRectangle (dpy, x_win, gc, cursor_start, tmp_y,
-			  cursor_width - 1, tmp_height - 1);
-	}
-      else if (focus && !NILP (bar_cursor_value))
-	{
-	  XDrawLine (dpy, x_win, gc, cursor_start + bar_width - 1, tmp_y,
-		     cursor_start + bar_width - 1, tmp_y + tmp_height - 1);
-	}
-
-      /* Restore the GC */
-      if (need_clipping)
-	{
-	  XSetClipMask (dpy, gc, None);
-	  XSetClipOrigin (dpy, gc, 0, 0);
-	}
-    }
-
-#ifdef USE_XFT
-#undef XFT_FROB_LISP_COLOR
-#endif
-
-}
-
-void
-x_output_x_pixmap (struct frame *f, Lisp_Image_Instance *p, int x,
-		   int y, int xoffset, int yoffset,
-		   int width, int height, unsigned long fg, unsigned long bg,
-		   GC override_gc)
-{
-  struct device *d = XDEVICE (f->device);
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-
-  GC gc;
-  XGCValues gcv;
-  unsigned long pixmap_mask;
-
-  if (!override_gc)
-    {
-      memset (&gcv, ~0, sizeof (XGCValues));
-      gcv.graphics_exposures = False;
-      gcv.foreground = fg;
-      gcv.background = bg;
-      pixmap_mask = GCForeground | GCBackground | GCGraphicsExposures;
-
-      if (IMAGE_INSTANCE_X_MASK (p))
-	{
-	  gcv.function = GXcopy;
-	  gcv.clip_mask = IMAGE_INSTANCE_X_MASK (p);
-	  gcv.clip_x_origin = x - xoffset;
-	  gcv.clip_y_origin = y - yoffset;
-	  pixmap_mask |= (GCFunction | GCClipMask | GCClipXOrigin |
-			  GCClipYOrigin);
-	  /* Can't set a clip rectangle because we already have a mask.
-	     Is it possible to get an equivalent effect by changing the
-	     args to XCopyArea below rather than messing with a clip box?
-	     - dkindred@cs.cmu.edu
-	     Yes. We don't clip at all now - andy@xemacs.org
-	  */
-	}
-
-      gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, pixmap_mask);
-    }
-  else
-    {
-      gc = override_gc;
-      /* override_gc might have a mask already--we don't want to nuke it.
-	 Maybe we can insist that override_gc have no mask, or use
-	 one of the suggestions above. */
-    }
-
-  /* depth of 0 means it's a bitmap, not a pixmap, and we should use
-     XCopyPlane (1 = current foreground color, 0 = background) instead
-     of XCopyArea, which means that the bits in the pixmap are actual
-     pixel values, instead of symbolic of fg/bg. */
-  if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0)
-    {
-      XCopyArea (dpy,
-		 IMAGE_INSTANCE_X_PIXMAP_SLICE
-		 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset,
-		 yoffset, width,
-		 height, x, y);
-    }
-  else
-    {
-      XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE
-		  (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc,
-		  xoffset, yoffset, width, height, x, y, 1L);
-    }
-}
-
-static void
-x_output_pixmap (struct window *w, Lisp_Object image_instance,
-		 struct display_box *db, struct display_glyph_area *dga,
-		 face_index findex, int cursor_start, int cursor_width,
-		 int cursor_height, int UNUSED (bg_pixmap))
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
-
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-
-  /* Output the pixmap. */
-  {
-    Lisp_Object tmp_pixel;
-    XColor tmp_bcolor, tmp_fcolor;
-
-    tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
-    tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-    tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
-    tmp_bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-
-    x_output_x_pixmap (f, p, db->xpos, db->ypos,
-		       dga->xoffset, dga->yoffset,
-		       dga->width, dga->height,
-		       tmp_fcolor.pixel, tmp_bcolor.pixel, 0);
-  }
-
-  /* Draw a cursor over top of the pixmap. */
-  if (cursor_width && cursor_height && (cursor_start >= db->xpos)
-      && !NILP (w->text_cursor_visible_p)
-      && (cursor_start < db->xpos + dga->width))
-    {
-      GC gc;
-      int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-      struct face_cachel *cursor_cachel =
-	WINDOW_FACE_CACHEL (w,
-			    get_builtin_face_cache_index
-			    (w, Vtext_cursor_face));
-
-      gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
-
-      if (cursor_width > db->xpos + dga->width - cursor_start)
-	cursor_width = db->xpos + dga->width - cursor_start;
-
-      if (focus)
-	{
-	  XFillRectangle (dpy, x_win, gc, cursor_start, db->ypos, cursor_width,
-			  cursor_height);
-	}
-      else
-	{
-	  XDrawRectangle (dpy, x_win, gc, cursor_start, db->ypos, cursor_width,
-			  cursor_height);
-	}
-    }
-}
-
-/*****************************************************************************
- x_output_vertical_divider
-
- Draw a vertical divider down the right side of the given window.
- ****************************************************************************/
-static void
-x_output_vertical_divider (struct window *w, int clear)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-  Lisp_Object tmp_pixel;
-  XColor tmp_color;
-  XGCValues gcv;
-  GC background_gc;
-  enum edge_style style;
-
-  unsigned long mask;
-  int x, y1, y2, width, shadow_thickness, spacing, line_width;
-  face_index div_face =
-    get_builtin_face_cache_index (w, Vvertical_divider_face);
-
-  width = window_divider_width (w);
-  shadow_thickness = XINT (w->vertical_divider_shadow_thickness);
-  spacing = XINT (w->vertical_divider_spacing);
-  line_width = XINT (w->vertical_divider_line_width);
-  x = WINDOW_RIGHT (w) - width;
-  y1 = WINDOW_TOP (w);
-  y2 = WINDOW_BOTTOM (w);
-
-  memset (&gcv, ~0, sizeof (XGCValues));
-
-  tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
-  tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-
-  /* First, get the GC's. */
-  gcv.background = tmp_color.pixel;
-  gcv.foreground = tmp_color.pixel;
-  gcv.graphics_exposures = False;
-  mask = GCForeground | GCBackground | GCGraphicsExposures;
-  background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask);
-
-  /* Clear the divider area first.  This needs to be done when a
-     window split occurs. */
-  if (clear)
-    XClearArea (dpy, x_win, x, y1, width, y2 - y1, False);
-
-  /* Draw the divider line. */
-  XFillRectangle (dpy, x_win, background_gc,
-		  x + spacing + shadow_thickness, y1,
-		  line_width, y2 - y1);
-
-  if (shadow_thickness < 0)
-    {
-      shadow_thickness = -shadow_thickness;
-      style = EDGE_BEVEL_IN;
-    }
-  else
-    {
-      style = EDGE_BEVEL_OUT;
-    }
-
-  /* Draw the shadows around the divider line */
-  x_bevel_area (w, div_face, x + spacing, y1,
-		width - 2 * spacing, y2 - y1,
-		shadow_thickness, EDGE_ALL, style);
-}
-
-/*****************************************************************************
- x_output_blank
-
- Output a blank by clearing the area it covers in the foreground color
- of its face.
- ****************************************************************************/
-static void
-x_output_blank (struct window *w, struct display_line *dl, struct rune *rb,
-		int start_pixpos, int cursor_start, int cursor_width)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-  GC gc;
-  struct face_cachel *cursor_cachel =
-    WINDOW_FACE_CACHEL (w,
-			get_builtin_face_cache_index
-			(w, Vtext_cursor_face));
-  Lisp_Object bg_pmap;
-  Lisp_Object buffer = WINDOW_BUFFER (w);
-  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
-							 buffer);
-
-  int x = rb->xpos;
-  int y = DISPLAY_LINE_YPOS (dl);
-  int width = rb->width;
-  int height = DISPLAY_LINE_HEIGHT (dl);
-
-  /* Unmap all subwindows in the area we are going to blank. */
-  redisplay_unmap_subwindows_maybe (f, x, y, width, height);
-
-  if (start_pixpos > x)
-    {
-      if (start_pixpos >= (x + width))
-	return;
-      else
-	{
-	  width -= (start_pixpos - x);
-	  x = start_pixpos;
-	}
-    }
-
-  bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
-  if (!IMAGE_INSTANCEP (bg_pmap)
-      || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
-    bg_pmap = Qnil;
-
-  if (NILP (bg_pmap))
-    gc = x_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
-		   Qnil, Qnil, Qnil);
-  else
-    gc = x_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
-		   WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), bg_pmap,
-		   Qnil);
-
-  XFillRectangle (dpy, x_win, gc, x, y, width, height);
-
-  /* If this rune is marked as having the cursor, then it is actually
-     representing a tab. */
-  if (!NILP (w->text_cursor_visible_p)
-      && (rb->cursor_type == CURSOR_ON
-	  || (cursor_width
-	      && (cursor_start + cursor_width > x)
-	      && cursor_start < (x + width))))
-    {
-      int cursor_height, cursor_y;
-      int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-      Lisp_Font_Instance *fi;
-
-      fi = XFONT_INSTANCE (FACE_CACHEL_FONT
-			   (WINDOW_FACE_CACHEL (w, rb->findex),
-			    Vcharset_ascii));
-
-      gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
-
-      cursor_y = dl->ypos - fi->ascent;
-      cursor_height = fi->height;
-      if (cursor_y + cursor_height > y + height)
-	cursor_height = y + height - cursor_y;
-
-      if (focus)
-	{
-	  if (NILP (bar_cursor_value))
-	    {
-	      XFillRectangle (dpy, x_win, gc, cursor_start, cursor_y,
-			      fi->width, cursor_height);
-	    }
-	  else
-	    {
-	      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-
-	      gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
-			     make_int (bar_width));
-	      XDrawLine (dpy, x_win, gc, cursor_start + bar_width - 1,
-			 cursor_y, cursor_start + bar_width - 1,
-			 cursor_y + cursor_height - 1);
-	    }
-	}
-      else if (NILP (bar_cursor_value))
-	{
-	  XDrawRectangle (dpy, x_win, gc, cursor_start, cursor_y,
-			  fi->width - 1, cursor_height - 1);
-	}
-    }
-}
-
-/*****************************************************************************
- x_output_hline
-
- Output a horizontal line in the foreground of its face.
- ****************************************************************************/
-static void
-x_output_hline (struct window *w, struct display_line *dl, struct rune *rb)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-  GC gc;
-
-  int x = rb->xpos;
-  int width = rb->width;
-  int height = DISPLAY_LINE_HEIGHT (dl);
-  int ypos1, ypos2, ypos3, ypos4;
-
-  ypos1 = DISPLAY_LINE_YPOS (dl);
-  ypos2 = ypos1 + rb->object.hline.yoffset;
-  ypos3 = ypos2 + rb->object.hline.thickness;
-  ypos4 = dl->ypos + dl->descent - dl->clip;
-
-  /* First clear the area not covered by the line. */
-  if (height - rb->object.hline.thickness > 0)
-    {
-      gc = x_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
-		     Qnil, Qnil, Qnil);
-
-      if (ypos2 - ypos1 > 0)
-	XFillRectangle (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
-      if (ypos4 - ypos3 > 0)
-	XFillRectangle (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
-    }
-
-  /* Now draw the line. */
-  gc = x_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
-		 Qnil, Qnil, Qnil);
-
-  if (ypos2 < ypos1)
-    ypos2 = ypos1;
-  if (ypos3 > ypos4)
-    ypos3 = ypos4;
-
-  if (ypos3 - ypos2 > 0)
-    XFillRectangle (dpy, x_win, gc, x, ypos2, width, ypos3 - ypos2);
-}
-
-/*****************************************************************************
  x_output_shadows
 
  Draw a shadow around the given area using the given GC's.  It is the
  callers responsibility to set the GC's appropriately.
  ****************************************************************************/
-void
+static void
 x_output_shadows (struct frame *f, int x, int y, int width, int height,
 		  GC top_shadow_gc, GC bottom_shadow_gc,
 		  GC UNUSED (background_gc), int shadow_thickness, int edges)
@@ -2084,266 +338,11 @@
     }
 }
 
-/****************************************************************************
- x_clear_region
-
- Clear the area in the box defined by the given parameters using the
- given face.
- ****************************************************************************/
-static void
-x_clear_region (Lisp_Object UNUSED (locale), struct device* d,
-		struct frame* f, face_index UNUSED (findex),
-		int x, int y,
-		int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
-		Lisp_Object background_pixmap)
-{
-  Display *dpy;
-  Window x_win;
-  GC gc = NULL;
-
-  dpy = DEVICE_X_DISPLAY (d);
-  x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-
-    if (!UNBOUNDP (background_pixmap))
-    {
-      gc = x_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
-    }
-
-  if (gc)
-    XFillRectangle (dpy, x_win, gc, x, y, width, height);
-  else
-    XClearArea (dpy, x_win, x, y, width, height, False);
-}
-
-/*****************************************************************************
- x_output_eol_cursor
-
- Draw a cursor at the end of a line.  The end-of-line cursor is
- narrower than the normal cursor.
- ****************************************************************************/
-static void
-x_output_eol_cursor (struct window *w, struct display_line *dl, int xpos,
-		     face_index findex)
-{
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object window;
-
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-  GC gc;
-  face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
-  struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, elt);
-
-  int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
-  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
-							 WINDOW_BUFFER (w));
-
-  int x = xpos;
-  int y = DISPLAY_LINE_YPOS (dl);
-  int width = EOL_CURSOR_WIDTH;
-  int height = DISPLAY_LINE_HEIGHT (dl);
-  int cursor_height, cursor_y;
-  int defheight, defascent;
-
-  window = wrap_window (w);
-  redisplay_clear_region (window, findex, x, y, width, height);
-
-  if (NILP (w->text_cursor_visible_p))
-    return;
-
-  gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
-
-  default_face_font_info (window, &defascent, 0, &defheight, 0, 0);
-
-  /* make sure the cursor is entirely contained between y and y+height */
-  cursor_height = min (defheight, height);
-  cursor_y = max (y, min (y + height - cursor_height,
-			  dl->ypos - defascent));
-
-  if (focus)
-    {
-#ifdef HAVE_XIM
-      XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2);
-#endif /* HAVE_XIM */
-
-      if (NILP (bar_cursor_value))
-	{
-	  XFillRectangle (dpy, x_win, gc, x, cursor_y, width, cursor_height);
-	}
-      else
-	{
-	  int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
-
-	  gc = x_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
-			 make_int (bar_width));
-	  XDrawLine (dpy, x_win, gc, x + bar_width - 1, cursor_y,
-		     x + bar_width - 1, cursor_y + cursor_height - 1);
-	}
-    }
-  else if (NILP (bar_cursor_value))
-    {
-      XDrawRectangle (dpy, x_win, gc, x, cursor_y, width - 1,
-		      cursor_height - 1);
-    }
-}
-
-static void
-x_clear_frame_window (Lisp_Object window)
-{
-  struct window *w = XWINDOW (window);
-
-  if (!NILP (w->vchild))
-    {
-      x_clear_frame_windows (w->vchild);
-      return;
-    }
-
-  if (!NILP (w->hchild))
-    {
-      x_clear_frame_windows (w->hchild);
-      return;
-    }
-
-  redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w),
-				 WINDOW_TEXT_BOTTOM (w));
-}
-
-static void
-x_clear_frame_windows (Lisp_Object window)
-{
-  for (; !NILP (window); window = XWINDOW (window)->next)
-    x_clear_frame_window (window);
-}
-
-static void
-x_clear_frame (struct frame *f)
-{
-  struct device *d = XDEVICE (f->device);
-  Display *dpy = DEVICE_X_DISPLAY (d);
-  Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-  int x, y, width, height;
-  Lisp_Object frame;
-
-  x = FRAME_LEFT_BORDER_START (f);
-  width = (FRAME_PIXWIDTH (f) - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) -
-	   FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) -
-	   2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) -
-	   2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f));
-  /* #### This adjustment by 1 should be being done in the macros.
-     There is some small differences between when the menubar is on
-     and off that we still need to deal with. */
-  y = FRAME_TOP_BORDER_START (f) - 1;
-  height = (FRAME_PIXHEIGHT (f) - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) -
-	    FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -
-	    2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) -
-	    2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + 1;
-
-  XClearArea (dpy, x_win, x, y, width, height, False);
-
-  frame = wrap_frame (f);
-
-  if (!UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vdefault_face, frame))
-      || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vleft_margin_face, frame))
-      || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vright_margin_face, frame)))
-    {
-      x_clear_frame_windows (f->root_window);
-    }
-
-  if (!(check_if_pending_expose_event (d)))
-    XFlush (DEVICE_X_DISPLAY (d));
-}
-
-/* briefly swap the foreground and background colors.
- */
-
-static int
-x_flash (struct device *d)
-{
-  Display *dpy;
-  Window win;
-  XGCValues gcv;
-  GC gc;
-  XColor tmp_fcolor, tmp_bcolor;
-  Lisp_Object tmp_pixel, frame;
-  struct frame *f = device_selected_frame (d);
-  struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
-  Widget shell = FRAME_X_SHELL_WIDGET (f);
-  int flash_height;
-
-  frame = wrap_frame (f);
-
-  tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
-  tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-  tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame);
-  tmp_bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
-
-  dpy = XtDisplay (shell);
-  win = XtWindow (FRAME_X_TEXT_WIDGET (f));
-  memset (&gcv, ~0, sizeof (XGCValues)); /* initialize all slots to ~0 */
-  gcv.foreground = (tmp_fcolor.pixel ^ tmp_bcolor.pixel);
-  gcv.function = GXxor;
-  gcv.graphics_exposures = False;
-  gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv,
-			(GCForeground | GCFunction | GCGraphicsExposures));
-  default_face_height_and_width (frame, &flash_height, 0);
-
-  /* If window is tall, flash top and bottom line.  */
-  if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
-    {
-      XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
-		      w->pixel_width, flash_height);
-      XFillRectangle (dpy, win, gc, w->pixel_left,
-		      w->pixel_top + w->pixel_height - flash_height,
-		      w->pixel_width, flash_height);
-    }
-  else
-    /* If it is short, flash it all.  */
-    XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
-		    w->pixel_width, w->pixel_height);
-
-  XSync (dpy, False);
-
-#ifdef HAVE_SELECT
-  {
-    int usecs = 100000;
-    struct timeval tv;
-    tv.tv_sec  = usecs / 1000000L;
-    tv.tv_usec = usecs % 1000000L;
-    /* I'm sure someone is going to complain about this... */
-    select (0, 0, 0, 0, &tv);
-  }
-#else
-#ifdef HAVE_POLL
-  poll (0, 0, 100);
-#else /* !HAVE_POLL */
-  bite me
-#endif /* HAVE_POLL */
-#endif /* HAVE_SELECT */
-
-  /* If window is tall, flash top and bottom line.  */
-  if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
-    {
-      XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
-		      w->pixel_width, flash_height);
-      XFillRectangle (dpy, win, gc, w->pixel_left,
-		      w->pixel_top + w->pixel_height - flash_height,
-		      w->pixel_width, flash_height);
-    }
-  else
-    /* If it is short, flash it all.  */
-    XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
-		    w->pixel_width, w->pixel_height);
-
-  XSync (dpy, False);
-
-  return 1;
-}
 
 /* Make audible bell.  */
 
 static void
-x_ring_bell (struct device *d, int volume, int pitch, int duration)
+XLIKE_ring_bell (struct device *d, int volume, int pitch, int duration)
 {
   Display *display = DEVICE_X_DISPLAY (d);
 
@@ -2376,28 +375,3 @@
       XSync (display, 0);
     }
 }
-
-
-/************************************************************************/
-/*                            initialization                            */
-/************************************************************************/
-
-void
-console_type_create_redisplay_x (void)
-{
-  /* redisplay methods */
-  CONSOLE_HAS_METHOD (x, text_width);
-  CONSOLE_HAS_METHOD (x, output_display_block);
-  CONSOLE_HAS_METHOD (x, divider_height);
-  CONSOLE_HAS_METHOD (x, eol_cursor_width);
-  CONSOLE_HAS_METHOD (x, output_vertical_divider);
-  CONSOLE_HAS_METHOD (x, clear_region);
-  CONSOLE_HAS_METHOD (x, clear_frame);
-  CONSOLE_HAS_METHOD (x, window_output_begin);
-  CONSOLE_HAS_METHOD (x, window_output_end);
-  CONSOLE_HAS_METHOD (x, flash);
-  CONSOLE_HAS_METHOD (x, ring_bell);
-  CONSOLE_HAS_METHOD (x, bevel_area);
-  CONSOLE_HAS_METHOD (x, output_string);
-  CONSOLE_HAS_METHOD (x, output_pixmap);
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/redisplay-xlike-inc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,2271 @@
+/* Common code between X and GTK -- redisplay-related.
+   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1994 Lucid, Inc.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with:  Not in FSF. */
+
+/* Author: Chuck Thompson */
+/* Gtk flavor by William Perry */
+/* X and GTK code merged by Ben Wing, 1-10 */
+
+/* Lots of work done by Ben Wing for Mule */
+
+/* Before including this file, you need to define either THIS_IS_X or
+   THIS_IS_GTK.  See comments in console-xlike-inc.h. */
+
+#include <config.h>
+#include "lisp.h"
+
+#include "buffer.h"
+#include "debug.h"
+#include "device-impl.h"
+#include "faces.h"
+#include "file-coding.h"
+#include "frame-impl.h"
+#include "gutter.h"
+#include "redisplay.h"
+#include "sysdep.h"
+#include "window.h"
+
+#ifdef MULE
+#include "mule-ccl.h"
+#endif
+#include "charset.h"
+
+#define NEED_GCCACHE_H
+#define NEED_GLYPHS_H
+#define NEED_OBJECTS_IMPL_H
+#include "console-xlike-inc.h"
+
+#include "sysproc.h" /* for select() */
+
+#ifdef THIS_IS_X
+#include "EmacsFrame.h"
+#include "EmacsFrameP.h"
+
+#include <X11/bitmaps/gray>
+#endif /* THIS_IS_X */
+
+#define EOL_CURSOR_WIDTH	5
+
+/* Device methods */
+
+#define XLIKE_text_width XFUN (text_width)
+#define XLIKE_output_display_block XFUN (output_display_block)
+#define XLIKE_divider_height XFUN (divider_height)
+#define XLIKE_eol_cursor_width XFUN (eol_cursor_width)
+#define XLIKE_output_vertical_divider XFUN (output_vertical_divider)
+#define XLIKE_clear_region XFUN (clear_region)
+#define XLIKE_clear_frame XFUN (clear_frame)
+#define XLIKE_flash XFUN (flash)
+#define XLIKE_ring_bell XFUN (ring_bell)
+#define XLIKE_bevel_area XFUN (bevel_area)
+#define XLIKE_output_string XFUN (output_string)
+#define XLIKE_output_pixmap XFUN (output_pixmap)
+#define XLIKE_output_xlike_pixmap XFUN (output_xlike_pixmap)
+#define XLIKE_window_output_begin XFUN (window_output_begin)
+#define XLIKE_window_output_end XFUN (window_output_end)
+
+/* Miscellaneous split functions */
+
+#define console_type_create_redisplay_XLIKE XLIKE_PASTE (console_type_create_redisplay, XLIKE_NAME)
+#define XLIKE_get_gc XFUN (get_gc)
+#define XLIKE_output_blank XFUN (output_blank)
+#define XLIKE_text_width_single_run XFUN (text_width_single_run)
+
+static void XLIKE_output_blank (struct window *w, struct display_line *dl,
+				struct rune *rb, int start_pixpos,
+				int cursor_start, int cursor_width);
+static void XLIKE_output_horizontal_line (struct window *w,
+					  struct display_line *dl,
+					  struct rune *rb);
+static void XLIKE_output_eol_cursor (struct window *w,
+				     struct display_line *dl,
+				     int xpos, face_index findex);
+static void XLIKE_clear_frame_windows (Lisp_Object window);
+static void XLIKE_bevel_area (struct window *w, face_index findex,
+			      int x, int y, int width, int height,
+			      int shadow_thickness, int edges,
+			      enum edge_style style);
+static void XLIKE_ring_bell (struct device *d, int volume, int pitch,
+			     int duration);
+
+#ifdef THIS_IS_X
+static void XLIKE_window_output_begin (struct window *UNUSED (w));
+static void XLIKE_window_output_end (struct window *w);
+#endif /* THIS_IS_X */
+
+
+/****************************************************************************/
+/*                                                                          */
+/*                           Separate textual runs                          */
+/*                                                                          */
+/****************************************************************************/
+
+
+     /* Note: We do not use the Xmb*() functions and XFontSets, nor the
+	Motif XFontLists and CompoundStrings.
+	Those functions are generally losing for a number of reasons.
+	Most important, they only support one locale (e.g. you could
+	display Japanese and ASCII text, but not mixed Japanese/Chinese
+	text).  You could maybe call setlocale() frequently to try to deal
+	with this, but that would generally fail because an XFontSet is
+	tied to one locale and won't have the other character sets in it.
+
+	fontconfig (the font database for Xft) has some specifier-like
+	properties, but it's not sufficient (witness the existence of
+	Pango).  Pango might do the trick, but it's not a cross-platform
+	solution; it would need significant advantages to be worth the
+	effort.
+     */
+
+struct textual_run
+{
+  Lisp_Object charset;
+  unsigned char *ptr;
+  int len;
+  int dimension;
+};
+
+/* Separate out the text in STR (an array of Ichars, not a string
+   representation) of length LEN into a series of runs, stored in
+   RUN_STORAGE.  RUN_STORAGE is guaranteed to hold enough space for all
+   runs that could be generated from this text.  Each run points to the a
+   stretch of text given simply by the position codes TEXT_STORAGE into a
+   series of textual runs of a particular charset.  Also convert the
+   characters as necessary into the format needed by XDrawImageString(),
+   XDrawImageString16(), et al.  This means converting to one or two byte
+   format, possibly tweaking the high bits, and possibly running a CCL
+   program.  You must pre-allocate the space used and pass it in. (This is
+   done so you can ALLOCA () the space.) (2 * len) bytes must be allocated
+   for TEXT_STORAGE and (len * sizeof (struct textual_run)) bytes of
+   RUN_STORAGE, where LEN is the length of the dynarr.
+
+   bufchar might not be fixed width (in the case of UTF-8).
+
+   Returns the number of runs actually used. */
+
+/* Notes on Xft implementation
+
+   - With Unicode, we're no longer going to have repertoires reified as
+   charsets.  (Not that we ever really did, what with corporate variants,
+   and so on.)  So we really should be querying the face for the desired
+   font, rather than the character for the charset, and that's what would
+   determine the separation into runs.
+   - The widechar versions of fontconfig (and therefore Xft) functions
+   seem to be just bigendian Unicode.  So there's actually no need to use
+   the 8-bit versions in computing runs and runes, it would seem.
+*/
+
+#if !defined(USE_XFT) && !defined(MULE)
+static int
+separate_textual_runs_nomule (unsigned char *text_storage,
+			      struct textual_run *run_storage,
+			      const Ichar *str, Charcount len,
+			      struct face_cachel *UNUSED(cachel))
+{
+  if (!len)
+    return 0;
+
+  run_storage[0].ptr = text_storage;
+  run_storage[0].len = len;
+  run_storage[0].dimension = 1;
+  run_storage[0].charset = Qnil;
+
+  while (len--)
+    *text_storage++ = *str++;
+  return 1;
+}
+#endif
+
+#if defined(USE_XFT) && !defined(MULE)
+/*
+  Note that in this configuration the "Croatian hack" of using an 8-bit,
+  non-Latin-1 font to get localized display without Mule simply isn't
+  available.  That's by design -- Unicode does not aid or abet that kind
+  of punning.
+  This means that the cast to XftChar16 gives the correct "conversion" to
+  UCS-2.
+  #### Is there an alignment issue with text_storage?
+*/
+static int
+separate_textual_runs_xft_nomule (unsigned char *text_storage,
+				  struct textual_run *run_storage,
+				  const Ichar *str, Charcount len,
+				  struct face_cachel *UNUSED(cachel))
+{
+  int i;
+  if (!len)
+    return 0;
+
+  run_storage[0].ptr = text_storage;
+  run_storage[0].len = len;
+  run_storage[0].dimension = 2;
+  run_storage[0].charset = Qnil;
+
+  for (i = 0; i < len; i++)
+    {
+      *(XftChar16 *)text_storage = str[i];
+      text_storage += sizeof(XftChar16);
+    }
+  return 1;
+}
+#endif
+
+#if defined(USE_XFT) && defined(MULE)
+static int
+separate_textual_runs_xft_mule (unsigned char *text_storage,
+				struct textual_run *run_storage,
+				const Ichar *str, Charcount len,
+				struct face_cachel *UNUSED(cachel))
+{
+  Lisp_Object prev_charset = Qunbound;
+  int runs_so_far = 0, i;
+
+  run_storage[0].ptr = text_storage;
+  run_storage[0].len = len;
+  run_storage[0].dimension = 2;
+  run_storage[0].charset = Qnil;
+
+  for (i = 0; i < len; i++)
+    {
+      Ichar ch = str[i];
+      Lisp_Object charset = ichar_charset(ch);
+      int ucs = ichar_to_unicode(ch);
+
+      /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
+	 REPLACMENT CHARACTER. */
+      /* That means we can't handle characters outside of the BMP for now */
+      ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
+
+      if (!EQ (charset, prev_charset))
+	{
+	  if (runs_so_far)
+	    run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
+	  run_storage[runs_so_far].ptr = text_storage;
+	  run_storage[runs_so_far].dimension = 2;
+	  run_storage[runs_so_far].charset = charset;
+	  prev_charset = charset;
+	  runs_so_far++;
+	}
+
+      *(XftChar16 *)text_storage = ucs;
+      text_storage += sizeof(XftChar16);
+    }
+
+  if (runs_so_far)
+    run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
+  return runs_so_far;
+}
+#endif
+
+#if !defined(USE_XFT) && defined(MULE)
+/*
+  This is the most complex function of this group, due to the various
+  indexing schemes used by different fonts.  For our purposes, they
+  fall into three classes.  Some fonts are indexed compatibly with ISO
+  2022; those fonts just use the Mule internal representation directly
+  (typically the high bit must be reset; this is determined by the `graphic'
+  flag).  Some fonts are indexed by Unicode, specifically by UCS-2.  These
+  are all translated using `ichar_to_unicode'.  Finally some fonts have
+  irregular indexes, and must be translated ad hoc.  In XEmacs ad hoc
+  translations are accomplished with CCL programs. */
+static int
+separate_textual_runs_mule (unsigned char *text_storage,
+			    struct textual_run *run_storage,
+			    const Ichar *str, Charcount len,
+			    struct face_cachel *cachel)
+{
+  Lisp_Object prev_charset = Qunbound;
+  int runs_so_far = 0, i;
+  Ibyte charset_leading_byte = LEADING_BYTE_ASCII;
+  int dimension = 1, graphic = 0, need_ccl_conversion = 0;
+  Lisp_Object ccl_prog;
+  struct ccl_program char_converter;
+
+  int translate_to_ucs_2 = 0;
+
+  for (i = 0; i < len; i++)
+    {
+      Ichar ch = str[i];
+      Lisp_Object charset;
+      int byte1, byte2;		/* BREAKUP_ICHAR dereferences the addresses
+				   of its arguments as pointer to int. */
+      BREAKUP_ICHAR (ch, charset, byte1, byte2);
+
+      if (!EQ (charset, prev_charset))
+	{
+	  /* At this point, dimension' and `prev_charset' refer to just-
+	     completed run.  `runs_so_far' and `text_storage' refer to the
+	     run about to start. */
+	  if (runs_so_far)
+	    {
+	      /* Update metadata for previous run. */
+	      run_storage[runs_so_far - 1].len =
+		text_storage - run_storage[runs_so_far - 1].ptr;
+	      if (2 == dimension) run_storage[runs_so_far - 1].len >>= 1;
+	    }
+
+	  /* Compute metadata for current run.
+	     First, classify font.
+	     If the font is indexed by UCS-2, set `translate_to_ucs_2'.
+	     Else if the charset has a CCL program, set `need_ccl_conversion'.
+	     Else if the font is indexed by an ISO 2022 "graphic register",
+	         set `graphic'.
+	     These flags are almost mutually exclusive, but we're sloppy
+	     about resetting "shadowed" flags.  So the flags must be checked
+	     in the proper order in computing byte1 and byte2, below. */
+	  charset_leading_byte = XCHARSET_LEADING_BYTE(charset);
+	  translate_to_ucs_2 =
+	    bit_vector_bit (FACE_CACHEL_FONT_FINAL_STAGE (cachel),
+			    charset_leading_byte - MIN_LEADING_BYTE);
+	  if (translate_to_ucs_2)
+	    {
+	      dimension = 2;
+	    }
+	  else
+	    {
+	      dimension = XCHARSET_DIMENSION (charset);
+
+	      /* Check for CCL charset.
+		 If setup_ccl_program fails, we'll get a garbaged display.
+		 This should never happen, and even if it does, it should
+		 be harmless (unless the X server has buggy handling of
+		 characters undefined in the font).  It may be marginally
+		 more useful to users and debuggers than substituting a
+		 fixed replacement character. */
+	      ccl_prog = XCHARSET_CCL_PROGRAM (charset);
+	      if ((!NILP (ccl_prog))
+		  && (setup_ccl_program (&char_converter, ccl_prog) >= 0))
+		{
+		  need_ccl_conversion = 1;
+		}
+	      else 
+		{
+		  /* The charset must have an ISO 2022-compatible font index.
+		     There are 2 "registers" (what such fonts use as index).
+		     GL (graphic == 0) has the high bit of each octet reset,
+		     GR (graphic == 1) has it set. */
+		  graphic   = XCHARSET_GRAPHIC (charset);
+		  need_ccl_conversion = 0;
+		}
+	    }
+
+	  /* Initialize metadata for current run. */
+	  run_storage[runs_so_far].ptr       = text_storage;
+	  run_storage[runs_so_far].charset   = charset;
+	  run_storage[runs_so_far].dimension = dimension;
+
+	  /* Update loop variables. */
+	  prev_charset = charset;
+	  runs_so_far++;
+	} 
+
+      /* Must check flags in this order.  See comment above. */
+      if (translate_to_ucs_2)
+	{
+	  int ucs = ichar_to_unicode(ch);
+	  /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
+	     REPLACMENT CHARACTER. */
+	  ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
+
+	  byte1 = ucs >> 8;
+	  byte2 = ucs;
+	}
+      else if (need_ccl_conversion)
+	{
+	  char_converter.reg[0] = charset_leading_byte;
+	  char_converter.reg[1] = byte1;
+	  char_converter.reg[2] = byte2;
+	  ccl_driver (&char_converter, 0, 0, 0, 0, CCL_MODE_ENCODING);
+	  byte1 = char_converter.reg[1];
+	  byte2 = char_converter.reg[2];
+	}
+      else if (graphic == 0)
+	{
+	  byte1 &= 0x7F;
+	  byte2 &= 0x7F;
+	}
+      else
+	{
+	  byte1 |= 0x80;
+	  byte2 |= 0x80;
+	}
+
+      *text_storage++ = (unsigned char)byte1;
+
+      if (2 == dimension) *text_storage++ = (unsigned char)byte2;
+    }
+
+  if (runs_so_far)
+    {
+      run_storage[runs_so_far - 1].len =
+	text_storage - run_storage[runs_so_far - 1].ptr;
+      /* Dimension retains the relevant value for the run before it. */
+      if (2 == dimension)
+	run_storage[runs_so_far - 1].len >>= 1;
+    }
+
+  return runs_so_far;
+}
+#endif
+
+static int
+separate_textual_runs (unsigned char *text_storage,
+		       struct textual_run *run_storage,
+		       const Ichar *str, Charcount len,
+		       struct face_cachel *cachel)
+{
+#if defined(USE_XFT) && defined(MULE)
+  return separate_textual_runs_xft_mule (text_storage, run_storage,
+					 str, len, cachel);
+#endif
+#if defined(USE_XFT) && !defined(MULE)
+  return separate_textual_runs_xft_nomule (text_storage, run_storage,
+					   str, len, cachel);
+#endif
+#if !defined(USE_XFT) && defined(MULE)
+  return separate_textual_runs_mule (text_storage, run_storage,
+				     str, len, cachel);
+#endif
+#if !defined(USE_XFT) && !defined(MULE)
+  return separate_textual_runs_nomule (text_storage, run_storage,
+				       str, len, cachel);
+#endif
+}
+
+/****************************************************************************/
+/*                                                                          */
+/*                           Xlike output routines                          */
+/*                                                                          */
+/****************************************************************************/
+
+static int
+XLIKE_text_width_single_run (struct frame * USED_IF_XFT (f),
+			     struct face_cachel *cachel,
+			     struct textual_run *run)
+{
+  Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
+  Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst);
+
+  if (!fi->proportional_p)
+    return fi->width * run->len;
+#ifdef USE_XFT
+  else if (FONT_INSTANCE_X_XFTFONT (fi))
+    {
+      static XGlyphInfo glyphinfo;
+      struct device *d = XDEVICE (f->device);
+      Display *dpy = DEVICE_X_DISPLAY (d);
+
+      if (run->dimension == 2)
+	{
+	  XftTextExtents16 (dpy,
+			    FONT_INSTANCE_X_XFTFONT (fi),
+			    (XftChar16 *) run->ptr, run->len, &glyphinfo);
+	}
+      else
+	{
+	  XftTextExtents8 (dpy,
+			   FONT_INSTANCE_X_XFTFONT (fi),
+			   run->ptr, run->len, &glyphinfo);
+	}
+    
+      return glyphinfo.xOff;
+    }
+#endif
+  else if (FONT_INSTANCE_XLIKE_FONT (fi))
+    {
+      if (run->dimension == 2)
+	{	
+	  /* stderr_out ("Measuring wide characters\n"); */
+	  return XLIKE_TEXT_WIDTH_WIDE (FONT_INSTANCE_XLIKE_FONT (fi),
+					run->ptr, run->len);
+	}
+      else
+	{
+	  return XLIKE_TEXT_WIDTH (FONT_INSTANCE_XLIKE_FONT (fi),
+				   run->ptr, run->len);
+	}
+    }
+  else
+    abort();
+  return 0;			/* shut up GCC */
+}
+
+
+/*
+   XLIKE_text_width
+
+   Given a string and a merged face, return the string's length in pixels
+   when displayed in the fonts associated with the face.
+   */
+
+static int
+XLIKE_text_width (struct window *w, struct face_cachel *cachel,
+		  const Ichar *str, Charcount len)
+{
+  /* !!#### Needs review */
+  int width_so_far = 0;
+  unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
+  struct textual_run *runs = alloca_array (struct textual_run, len);
+  struct frame *f = WINDOW_XFRAME (w);
+  int nruns;
+  int i;
+
+  nruns = separate_textual_runs (text_storage, runs, str, len, 
+				 cachel);
+
+  for (i = 0; i < nruns; i++)
+    width_so_far += XLIKE_text_width_single_run (f, cachel, runs + i);
+
+  return width_so_far;
+}
+
+/*****************************************************************************
+ XLIKE_divider_height
+
+ Return the height of the horizontal divider.  This is a function because
+ divider_height is a device method.
+
+ #### If we add etched horizontal divider lines this will have to get
+ smarter.
+ ****************************************************************************/
+static int
+XLIKE_divider_height (void)
+{
+#ifdef THIS_IS_X
+  return 1;
+#else /* THIS_IS_GTK */
+  return 2;
+#endif /* THIS_IS_GTK */
+}
+
+/*****************************************************************************
+ XLIKE_eol_cursor_width
+
+ Return the width of the end-of-line cursor.  This is a function
+ because eol_cursor_width is a device method.
+ ****************************************************************************/
+static int
+XLIKE_eol_cursor_width (void)
+{
+  return EOL_CURSOR_WIDTH;
+}
+
+/*****************************************************************************
+ XLIKE_output_display_block
+
+ Given a display line, a block number for that start line, output all
+ runes between start and end in the specified display block.
+ ****************************************************************************/
+static void
+XLIKE_output_display_block (struct window *w, struct display_line *dl,
+			    int block, int start, int end, int start_pixpos,
+			    int cursor_start, int cursor_width,
+			    int cursor_height)
+{
+#ifndef USE_XFT
+  struct frame *f = XFRAME (w->frame);
+#endif
+  Ichar_dynarr *buf;
+  Lisp_Object window;
+
+  struct display_block *db = Dynarr_atp (dl->display_blocks, block);
+  rune_dynarr *rba = db->runes;
+  struct rune *rb;
+
+  int elt = start;
+  face_index findex;
+  int xpos, width = 0;
+  Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
+				     MULE is not defined */
+
+  window = wrap_window (w);
+  rb = Dynarr_atp (rba, start);
+
+  if (!rb)
+    /* Nothing to do so don't do anything. */
+    return;
+
+  findex = rb->findex;
+  xpos = rb->xpos;
+  if (rb->type == RUNE_CHAR)
+    charset = ichar_charset (rb->object.chr.ch);
+
+  if (end < 0)
+    end = Dynarr_length (rba);
+  buf = Dynarr_new (Ichar);
+
+  while (elt < end)
+    {
+      rb = Dynarr_atp (rba, elt);
+
+      if (rb->findex == findex && rb->type == RUNE_CHAR
+	  && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
+	  && EQ (charset, ichar_charset (rb->object.chr.ch)))
+	{
+	  Dynarr_add (buf, rb->object.chr.ch);
+	  width += rb->width;
+	  elt++;
+	}
+      else
+	{
+	  if (Dynarr_length (buf))
+	    {
+	      XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos, width,
+				   findex, 0, cursor_start, cursor_width,
+				   cursor_height);
+	      xpos = rb->xpos;
+	      width = 0;
+	    }
+	  Dynarr_reset (buf);
+	  width = 0;
+
+	  if (rb->type == RUNE_CHAR)
+	    {
+	      findex = rb->findex;
+	      xpos = rb->xpos;
+	      charset = ichar_charset (rb->object.chr.ch);
+
+	      if (rb->cursor_type == CURSOR_ON)
+		{
+		  if (rb->object.chr.ch == '\n')
+		    {
+		      XLIKE_output_eol_cursor (w, dl, xpos, findex);
+		    }
+		  else
+		    {
+		      Dynarr_add (buf, rb->object.chr.ch);
+		      XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos,
+					   rb->width, findex, 1,
+					   cursor_start, cursor_width,
+					   cursor_height);
+		      Dynarr_reset (buf);
+		    }
+
+		  xpos += rb->width;
+		  elt++;
+		}
+	      else if (rb->object.chr.ch == '\n')
+		{
+		  /* Clear in case a cursor was formerly here. */
+		  redisplay_clear_region (window, findex, xpos,
+					  XLIKE_DISPLAY_LINE_YPOS (dl),
+					  rb->width,
+					  XLIKE_DISPLAY_LINE_HEIGHT (dl));
+		  elt++;
+		}
+	    }
+	  else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
+	    {
+	      if (rb->type == RUNE_BLANK)
+		XLIKE_output_blank (w, dl, rb, start_pixpos, cursor_start,
+				    cursor_width);
+	      else
+		{
+		  /* #### Our flagging of when we need to redraw the
+                     modeline shadows sucks.  Since RUNE_HLINE is only used
+                     by the modeline at the moment it is a good bet
+                     that if it gets redrawn then we should also
+                     redraw the shadows.  This won't be true forever.
+                     We borrow the shadow_thickness_changed flag for
+                     now. */
+		  w->shadow_thickness_changed = 1;
+		  XLIKE_output_horizontal_line (w, dl, rb);
+		}
+
+	      elt++;
+	      if (elt < end)
+		{
+		  rb = Dynarr_atp (rba, elt);
+
+		  findex = rb->findex;
+		  xpos = rb->xpos;
+		}
+	    }
+	  else if (rb->type == RUNE_DGLYPH)
+	    {
+	      Lisp_Object instance;
+	      struct display_box dbox;
+	      struct display_glyph_area dga;
+
+	      redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset,
+						 rb->object.dglyph.yoffset, start_pixpos,
+                                                 rb->width, &dbox, &dga);
+
+	      window = wrap_window (w);
+	      instance = glyph_image_instance (rb->object.dglyph.glyph,
+					       window, ERROR_ME_DEBUG_WARN, 1);
+	      findex = rb->findex;
+
+	      if (IMAGE_INSTANCEP (instance))
+		{
+		  switch (XIMAGE_INSTANCE_TYPE (instance))
+		    {
+		    case IMAGE_TEXT:
+#ifdef THIS_IS_GTK
+		      {
+			/* !!#### Examine for Mule-izing */
+			/* #### This is way losing.  See the comment in
+			   add_glyph_rune(). */
+			Lisp_Object string =
+			  XIMAGE_INSTANCE_TEXT_STRING (instance);
+			convert_ibyte_string_into_ichar_dynarr
+			  (XSTRING_DATA (string), XSTRING_LENGTH (string),
+			   buf);
+
+			gtk_output_string (w, dl, buf, xpos,
+					   rb->object.dglyph.xoffset,
+					   start_pixpos, -1, findex,
+					   (rb->cursor_type == CURSOR_ON),
+					   cursor_start, cursor_width,
+					   cursor_height);
+			Dynarr_reset (buf);
+		      }
+		      break;
+#else
+		      ABORT ();
+#endif /* THIS_IS_GTK */
+		    case IMAGE_MONO_PIXMAP:
+		    case IMAGE_COLOR_PIXMAP:
+		      redisplay_output_pixmap (w, instance, &dbox, &dga,
+					       findex, cursor_start,
+					       cursor_width,
+					       cursor_height, 0);
+		      break;
+
+		    case IMAGE_WIDGET:
+		      if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
+			      Qlayout))
+			{
+			  redisplay_output_layout (window, instance, &dbox,
+						   &dga, findex,
+						   cursor_start, cursor_width,
+						   cursor_height);
+			  break;
+			}
+
+		    case IMAGE_SUBWINDOW:
+		      redisplay_output_subwindow (w, instance, &dbox, &dga,
+						  findex, cursor_start,
+						  cursor_width, cursor_height);
+		      break;
+
+		    case IMAGE_NOTHING:
+		      /* nothing is as nothing does */
+		      break;
+
+		    case IMAGE_POINTER:
+		    default:
+		      ABORT ();
+		    }
+		  IMAGE_INSTANCE_OPTIMIZE_OUTPUT
+		    (XIMAGE_INSTANCE (instance)) = 0;
+		}
+
+	      xpos += rb->width;
+	      elt++;
+	    }
+	  else
+	    ABORT ();
+	}
+    }
+
+  if (Dynarr_length (buf))
+    XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex,
+			 0, cursor_start, cursor_width, cursor_height);
+
+  if (dl->modeline
+      && !EQ (Qzero, w->modeline_shadow_thickness)
+#ifndef USE_XFT
+      /* This optimization doesn't work right with some Xft fonts, which
+	 leave antialiasing turds at the boundary.  I don't know if this
+	 is an Xft bug or not, but I think it is.   See x_output_string. */
+      && (f->clear
+	  || f->windows_structure_changed
+	  || w->shadow_thickness_changed)
+#endif
+      )
+    bevel_modeline (w, dl);
+
+  Dynarr_free (buf);
+}
+
+/* Called as gtk_get_gc from gtk-glue.c */
+
+XLIKE_GC XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, 
+		       Lisp_Object bg, Lisp_Object bg_pmap,
+		       Lisp_Object lwidth);
+
+/*****************************************************************************
+ XLIKE_get_gc
+
+ Given a number of parameters return a GC with those properties.
+ ****************************************************************************/
+XLIKE_GC
+XLIKE_get_gc (struct device *d, Lisp_Object font, Lisp_Object fg, 
+	      Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth)
+{
+  XLIKE_GCVALUES gcv;
+  unsigned long mask;
+
+  memset (&gcv, ~0, sizeof (gcv));
+  gcv.graphics_exposures = XLIKE_FALSE;
+  /* Make absolutely sure that we don't pick up a clipping region in
+     the GC returned by this function. */
+  gcv.clip_mask = XLIKE_NONE;
+  gcv.clip_x_origin = 0;
+  gcv.clip_y_origin = 0;
+  XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID);
+  mask = XLIKE_GC_EXPOSURES | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN;
+  mask |= XLIKE_GC_FILL;
+
+  if (!NILP (font)
+#ifdef USE_XFT
+      /* Only set the font if it's a core font */
+      /* the renderfont will be set elsewhere (not part of gc) */
+      && !FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))
+#endif
+      )
+    {
+      gcv.font =
+	XLIKE_FONT_NUM (FONT_INSTANCE_XLIKE_FONT (XFONT_INSTANCE (font)));
+      mask |= XLIKE_GC_FONT;
+    }
+
+  /* evil kludge! */
+  if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !INTP (fg))
+    {
+      /* #### I fixed one case where this was getting hit.  It was a
+         bad macro expansion (compiler bug). */
+      stderr_out ("Help! x_get_gc got a bogus fg value! fg = ");
+      debug_print (fg);
+      fg = Qnil;
+    }
+
+  if (!NILP (fg))
+    {
+      if (COLOR_INSTANCEP (fg))
+	XLIKE_SET_GC_COLOR (gcv.foreground, XCOLOR_INSTANCE_XLIKE_COLOR (fg));
+      else
+	XLIKE_SET_GC_PIXEL (gcv.foreground, XINT (fg));
+      mask |= XLIKE_GC_FOREGROUND;
+    }
+
+  if (!NILP (bg))
+    {
+      if (COLOR_INSTANCEP (bg))
+	XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (bg));
+      else
+	XLIKE_SET_GC_PIXEL (gcv.background, XINT (bg));
+      mask |= XLIKE_GC_BACKGROUND;
+    }
+
+  /* This special case comes from a request to draw text with a face which has
+     the dim property. We'll use a stippled foreground GC. */
+  if (EQ (bg_pmap, Qdim))
+    {
+      assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE);
+
+      XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_STIPPLED);
+      gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d);
+      mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE);
+    }
+  else if (IMAGE_INSTANCEP (bg_pmap)
+	   && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
+    {
+      if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0)
+	{
+	  XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED);
+	  gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap);
+	  mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL);
+	}
+      else
+	{
+	  XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED);
+	  gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap);
+	  mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL);
+	}
+    }
+
+  if (!NILP (lwidth))
+    {
+      gcv.line_width = XINT (lwidth);
+      mask |= XLIKE_GC_LINE_WIDTH;
+    }
+
+#if 0
+  debug_out ("\nx_get_gc: calling gc_cache_lookup\n");
+#endif
+  return gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, mask);
+}
+
+/*****************************************************************************
+ XLIKE_output_string
+
+ Given a string and a starting position, output that string in the
+ given face.  If cursor is true, draw a cursor around the string.
+ Correctly handles multiple charsets in the string.
+
+ The meaning of the parameters is something like this:
+
+ W		Window that the text is to be displayed in.
+ DL		Display line that this text is on.  The values in the
+ 		structure are used to determine the vertical position and
+		clipping range of the text.
+ BUF		Dynamic array of Ichars specifying what is actually to be
+		drawn.
+ XPOS		X position in pixels where the text should start being drawn.
+ XOFFSET	Number of pixels to be chopped off the left side of the
+ 		text.  The effect is as if the text were shifted to the
+		left this many pixels and clipped at XPOS.
+ CLIP_START	Clip everything left of this X position.
+ WIDTH		Clip everything right of XPOS + WIDTH.
+ FINDEX		Index for the face cache element describing how to display
+ 		the text.
+ CURSOR		#### I don't understand this.  There's something
+ 		strange and overcomplexified with this variable.
+		Chuck, explain please?
+ CURSOR_START	Starting X position of cursor.
+ CURSOR_WIDTH	Width of cursor in pixels.
+ CURSOR_HEIGHT	Height of cursor in pixels.
+
+ Starting Y position of cursor is the top of the text line.
+ The cursor is drawn sometimes whether or not CURSOR is set. ???
+ ****************************************************************************/
+#ifdef THIS_IS_GTK
+static
+void gdk_draw_text_image (GdkDrawable *drawable,
+			  GdkFont     *font,
+			  GdkGC       *gc,
+			  gint         x,
+			  gint         y,
+			  const gchar *text,
+			  gint         text_length);
+
+#endif /* THIS_IS_GTK */
+void
+XLIKE_output_string (struct window *w, struct display_line *dl,
+		     Ichar_dynarr *buf, int xpos, int xoffset, int clip_start,
+		     int width, face_index findex, int cursor,
+		     int cursor_start, int cursor_width, int cursor_height)
+{
+  /* General variables */
+  struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  Lisp_Object window = wrap_window (w);
+
+  int clip_end;
+
+  /* Cursor-related variables */
+  int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
+  int cursor_clip;
+  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
+							 WINDOW_BUFFER (w));
+  struct face_cachel *cursor_cachel = 0;
+
+  /* Text-related variables */
+  Lisp_Object bg_pmap;
+  XLIKE_GC bgc, gc;
+  int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
+  int ypos = XLIKE_DISPLAY_LINE_YPOS (dl);
+  int len = Dynarr_length (buf);
+  unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
+  struct textual_run *runs = alloca_array (struct textual_run, len);
+  int nruns;
+  int i;
+  struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
+
+#ifdef THIS_IS_X
+  int use_x_font = 1;		/* #### bogus!!
+				   The logic of this function needs review! */
+#endif
+#ifdef USE_XFT
+  Colormap cmap = DEVICE_X_COLORMAP (d);
+  Visual *visual = DEVICE_X_VISUAL (d);
+  static XftColor fg, bg;
+  XftDraw *xftDraw;
+
+  /* Lazily initialize frame's xftDraw member. */
+  if (!FRAME_X_XFTDRAW (f)) {
+    FRAME_X_XFTDRAW (f) = XftDrawCreate (dpy, x_win, visual, cmap);
+  }
+  xftDraw = FRAME_X_XFTDRAW (f);
+
+  /* #### This will probably cause asserts when passed a Lisp integer for a
+     color.  See ca. line 759 this file.
+     #### Maybe xft_convert_color should take an XColor, not a pixel. */
+#define XFT_FROB_LISP_COLOR(color, dim)					\
+  xft_convert_color (dpy, cmap, visual,					\
+		     XCOLOR_INSTANCE_X_COLOR (color).pixel, (dim))
+#endif /* USE_XFT */
+
+  if (width < 0)
+    width = XLIKE_text_width (w, cachel, Dynarr_begin (buf),
+			      Dynarr_length (buf));
+
+  /* Regularize the variables passed in. */
+
+  if (clip_start < xpos)
+    clip_start = xpos;
+  clip_end = xpos + width;
+  if (clip_start >= clip_end)
+    /* It's all clipped out. */
+    return;
+
+  xpos -= xoffset;
+
+  /* make sure the area we are about to display is subwindow free. */
+  redisplay_unmap_subwindows_maybe (f, clip_start, ypos,
+				    clip_end - clip_start, height);
+
+  cursor_clip = (cursor_start >= clip_start &&
+		 cursor_start < clip_end);
+
+  /* This cursor code is really a mess. */
+  if (!NILP (w->text_cursor_visible_p)
+      && (cursor
+	  || cursor_clip
+	  || (cursor_width
+	      && (cursor_start + cursor_width >= clip_start)
+	      && !NILP (bar_cursor_value))))
+    {
+      /* These have to be in separate statements in order to avoid a
+         compiler bug. */
+      face_index sucks = get_builtin_face_cache_index (w, Vtext_cursor_face);
+      cursor_cachel = WINDOW_FACE_CACHEL (w, sucks);
+
+      /* We have to reset this since any call to WINDOW_FACE_CACHEL
+         may cause the cache to resize and any pointers to it to
+         become invalid. */
+      cachel = WINDOW_FACE_CACHEL (w, findex);
+    }
+
+#ifdef HAVE_XIM
+  if (cursor && focus && (cursor_start == clip_start) && cursor_height)
+    XIM_SetSpotLocation (f, xpos - 2, dl->ypos + dl->descent - 2);
+#endif /* HAVE_XIM */
+
+  bg_pmap = cachel->background_pixmap;
+  if (!IMAGE_INSTANCEP (bg_pmap)
+      || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
+    bg_pmap = Qnil;
+
+  if ((cursor && focus && NILP (bar_cursor_value)
+       && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
+    bgc = 0;
+  else
+    bgc = XLIKE_get_gc (d, Qnil, cachel->foreground, cachel->background,
+			bg_pmap, Qnil);
+
+  if (bgc)
+    {
+      XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
+			    ypos, clip_end - clip_start,
+			    height);
+    }
+
+  nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
+				 Dynarr_length (buf), cachel);
+
+  for (i = 0; i < nruns; i++)
+    {
+      Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
+      Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
+      int this_width;
+      int need_clipping;
+
+      if (EQ (font, Vthe_null_font_instance))
+	continue;
+
+      this_width = XLIKE_text_width_single_run (f, cachel, runs + i);
+      need_clipping = (dl->clip || clip_start > xpos ||
+		       clip_end < xpos + this_width);
+
+      /* XDrawImageString only clears the area equal to the height of
+	 the given font.  It is possible that a font is being displayed
+	 on a line taller than it is, so this would cause us to fail to
+	 clear some areas. */
+      if ((int) fi->height < (int) (height + dl->clip +
+				    XLIKE_DISPLAY_LINE_TOP_CLIP (dl)))
+	{
+	  int clear_start = max (xpos, clip_start);
+	  int clear_end = min (xpos + this_width, clip_end);
+
+	  if (cursor)
+	    {
+	      int ypos1_line, ypos1_string, ypos2_line, ypos2_string;
+
+	      ypos1_string = dl->ypos - fi->ascent;
+	      ypos2_string = dl->ypos + fi->descent;
+	      ypos1_line = ypos;
+	      ypos2_line = ypos1_line + height;
+
+	      /* Make sure we don't clear below the real bottom of the
+		 line. */
+	      if (ypos1_string > ypos2_line)
+		ypos1_string = ypos2_line;
+	      if (ypos2_string > ypos2_line)
+		ypos2_string = ypos2_line;
+
+	      if (ypos1_line < ypos1_string)
+		{
+		  redisplay_clear_region (window, findex, clear_start, ypos1_line,
+				  clear_end - clear_start,
+				  ypos1_string - ypos1_line);
+		}
+
+	      if (ypos2_line > ypos2_string)
+		{
+		  redisplay_clear_region (window, findex, clear_start, ypos2_string,
+				  clear_end - clear_start,
+				  ypos2_line - ypos2_string);
+		}
+	    }
+	  else
+	    {
+	      redisplay_clear_region (window, findex, clear_start,
+			      ypos, clear_end - clear_start,
+			      height);
+	    }
+	}
+
+      if (cursor && cursor_cachel && focus && NILP (bar_cursor_value))
+	{
+#ifdef USE_XFT
+	  fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
+	  bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
+#endif
+	  gc = XLIKE_get_gc (d, font, cursor_cachel->foreground,
+			     cursor_cachel->background, Qnil, Qnil);
+	}
+      else if (cachel->dim)
+	{
+	  /* Ensure the gray bitmap exists */
+	  if (DEVICE_XLIKE_GRAY_PIXMAP (d) == XLIKE_NONE)
+	    DEVICE_XLIKE_GRAY_PIXMAP (d) =
+#ifdef THIS_IS_X
+	      XCreateBitmapFromData (dpy, x_win, (char *)gray_bits,
+				     gray_width, gray_height)
+#else
+	      /* #### FIXME! Implement me! */
+	      XLIKE_NONE
+#endif
+	      ;
+
+	  /* Request a GC with the gray stipple pixmap to draw dimmed text */
+#ifdef USE_XFT
+	  fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1);
+	  bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
+#endif
+	  gc = XLIKE_get_gc (d, font, cachel->foreground, cachel->background,
+			     Qdim, Qnil);
+	}
+      else
+	{
+#ifdef USE_XFT
+	  fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0);
+	  bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
+#endif
+	  gc = XLIKE_get_gc (d, font, cachel->foreground, cachel->background,
+			     Qnil, Qnil);
+	}
+#ifdef USE_XFT
+      {
+	XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
+
+	if (rf)
+	  {
+	    use_x_font = 0;
+	    if (need_clipping)
+	      {
+		Region clip_reg = XCreateRegion();
+		XRectangle clip_box = { clip_start, ypos,
+					clip_end - clip_start, height };
+
+		XUnionRectWithRegion (&clip_box, clip_reg, clip_reg); 
+		XftDrawSetClip(xftDraw, clip_reg);
+		XDestroyRegion(clip_reg);
+	      }
+
+	    if (!bgc)
+	      {
+		/* #### Neither rect_height nor XftTextExtents as computed
+		   below handles the vertical space taken up by antialiasing,
+		   which for some fonts (eg, Bitstream Vera Sans Mono-16 on
+		   my Mac PowerBook G4) leaves behind orphaned dots on
+		   insertion or deletion earlier in the line, especially in
+		   the case of the underscore character.
+		   Interestingly, insertion or deletion of a single character
+		   immediately after a refresh does not leave any droppings,
+		   but any further insertions or deletions do.
+		   While adding a pixel to rect_height (mostly) takes care of
+		   this, it trashes aggressively laid-out elements like the
+		   modeline (overwriting part of the bevel).
+		   OK, unconditionally redraw the bevel, and increment
+		   rect_height by 1.  See x_output_display_block. -- sjt */
+		struct textual_run *run = &runs[i];
+		int rect_width = x_text_width_single_run (f, cachel, run);
+#ifndef USE_XFTTEXTENTS_TO_AVOID_FONT_DROPPINGS
+		int rect_height = FONT_INSTANCE_ASCENT(fi)
+				  + FONT_INSTANCE_DESCENT(fi) + 1;
+#else
+		int rect_height = FONT_INSTANCE_ASCENT(fi)
+				  + FONT_INSTANCE_DESCENT(fi);
+		XGlyphInfo gi;
+		if (run->dimension == 2) {
+		  XftTextExtents16 (dpy,
+				    FONT_INSTANCE_X_XFTFONT(fi),
+				    (XftChar16 *) run->ptr, run->len, &gi);
+		} else {
+		  XftTextExtents8 (dpy,
+				   FONT_INSTANCE_X_XFTFONT(fi),
+				   run->ptr, run->len, &gi);
+		}
+		rect_height = rect_height > gi.height
+			      ? rect_height : gi.height;
+#endif
+
+		XftDrawRect (xftDraw, &bg,
+			     xpos, ypos, rect_width, rect_height);
+	      }
+	
+	    if (runs[i].dimension == 1)
+	      XftDrawString8 (xftDraw, &fg, rf, xpos, dl->ypos,
+			      runs[i].ptr, runs[i].len);
+	    else
+	      XftDrawString16 (xftDraw, &fg, rf, xpos, dl->ypos,
+			       (XftChar16 *) runs[i].ptr, runs[i].len);
+	  }
+      }
+#endif /* USE_XFT */
+
+#ifdef THIS_IS_X
+      if (use_x_font)
+#endif
+	{
+	  if (need_clipping)
+	    {
+	      XLIKE_RECTANGLE clip_box;
+
+	      clip_box.x = 0;
+	      clip_box.y = 0;
+	      clip_box.width = clip_end - clip_start;
+	      clip_box.height = height;
+
+	      XLIKE_SET_CLIP_RECTANGLE (dpy, gc, clip_start, ypos, &clip_box);
+	    }
+
+#ifdef THIS_IS_X
+	  if (runs[i].dimension == 1)
+	    (bgc ? XDrawString : XDrawImageString)
+	      (dpy, x_win, gc, xpos, dl->ypos,
+	       (char *) runs[i].ptr, runs[i].len);
+	  else
+	    (bgc ? XDrawString16 : XDrawImageString16)
+	      (dpy, x_win, gc, xpos, dl->ypos,
+	       (XChar2b *) runs[i].ptr, runs[i].len);
+#else /* THIS_IS_GTK */
+
+      /* The X specific called different functions (XDraw*String
+         vs. XDraw*String16), but apparently gdk_draw_text takes care
+         of that for us.
+
+	 BUT, gdk_draw_text also does too much, by dividing the length
+	 by 2.  So we fake them out my multiplying the length by the
+	 dimension of the text.  This will do the right thing for
+	 single-dimension runs as well of course.
+      */
+      (bgc ? gdk_draw_text : gdk_draw_text_image)
+	(GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
+	 dl->ypos, (char *) runs[i].ptr, runs[i].len * runs[i].dimension);
+#endif /* (not) THIS_IS_X */
+	}
+
+      /* We draw underlines in the same color as the text. */
+      if (cachel->underline)
+	{
+	  int upos, uthick;
+#ifdef THIS_IS_X
+	  unsigned long upos_ext, uthick_ext;
+	  XFontStruct *fs =
+	    use_x_font ? FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)) : 0;
+	  /* #### the logic of the next two may be suboptimal: we may want
+	     to use the POSITION and/or THICKNESS information with Xft */
+	  if (fs && XGetFontProperty (fs, XA_UNDERLINE_POSITION, &upos_ext))
+	    upos = (int) upos_ext;
+	  else
+#else /* THIS_IS_GTK */
+	  /* Cannot get at font properties in Gtk, so we resort to
+             guessing */
+#endif /* THIS_IS_GTK */
+	    upos = dl->descent / 2;
+#ifdef THIS_IS_X
+	  if (fs && XGetFontProperty (fs, XA_UNDERLINE_THICKNESS, &uthick_ext))
+	    uthick = (int) uthick_ext;
+	  else
+#endif /* THIS_IS_X */
+	    uthick = 1;
+	  if (dl->ypos + upos < dl->ypos + dl->descent - dl->clip)
+	    {
+	      if (dl->ypos + upos + uthick > dl->ypos + dl->descent - dl->clip)
+		uthick = dl->descent - dl->clip - upos;
+
+	      if (uthick == 1)
+		{
+		  XLIKE_DRAW_LINE (dpy, x_win, gc, xpos, dl->ypos + upos,
+				   xpos + this_width, dl->ypos + upos);
+		}
+	      else if (uthick > 1)
+		{
+		  XLIKE_FILL_RECTANGLE (dpy, x_win, gc, xpos,
+					dl->ypos + upos, this_width, uthick);
+		}
+	    }
+	}
+
+      if (cachel->strikethru)
+	{
+#ifdef THIS_IS_X
+	  int ascent, descent, upos, uthick;
+	  unsigned long ascent_ext, descent_ext, uthick_ext;
+	  XFontStruct *fs = FONT_INSTANCE_X_FONT (fi);
+#else /* THIS_IS_GTK */
+	  gint ascent, descent, upos, uthick;
+	  GdkFont *gfont = FONT_INSTANCE_GTK_FONT (fi);
+#endif /* THIS_IS_GTK */
+	  
+#ifdef THIS_IS_X
+	  if (!use_x_font)
+	    {
+	      ascent = dl->ascent;
+	      descent = dl->descent;
+	      uthick = 1;
+	    }
+	  else
+	    {
+	      if (!XGetFontProperty (fs, XA_STRIKEOUT_ASCENT, &ascent_ext))
+		ascent = fs->ascent;
+	      else
+		ascent = (int) ascent_ext;
+	      if (!XGetFontProperty (fs, XA_STRIKEOUT_DESCENT, &descent_ext))
+		descent = fs->descent;
+	      else
+		descent = (int) descent_ext;
+	      if (!XGetFontProperty (fs, XA_UNDERLINE_THICKNESS, &uthick_ext))
+		uthick = 1;
+	      else
+		uthick = (int) uthick_ext;
+	    }
+#else /* THIS_IS_GTK */
+	/* Cannot get at font properties in Gtk, so we resort to
+           guessing */
+
+	  ascent = gfont->ascent;
+	  descent = gfont->descent;
+	  uthick = 1;
+#endif /* THIS_IS_GTK */
+
+	  upos = ascent - ((ascent + descent) / 2) + 1;
+
+	  /* Generally, upos will be positive (above the baseline),so
+             subtract */
+	  if (dl->ypos - upos < dl->ypos + dl->descent - dl->clip)
+	    {
+	      if (dl->ypos - upos + uthick > dl->ypos + dl->descent - dl->clip)
+		uthick = dl->descent - dl->clip + upos;
+
+	      if (uthick == 1)
+		XLIKE_DRAW_LINE (dpy, x_win, gc, xpos, dl->ypos - upos,
+				 xpos + this_width, dl->ypos - upos);
+	      else if (uthick > 1)
+		XLIKE_FILL_RECTANGLE (dpy, x_win, gc, xpos, dl->ypos + upos,
+				      this_width, uthick);
+	    }
+	}
+
+      /* Restore the GC */
+      if (need_clipping)
+	{
+#ifdef USE_XFT
+	  if (!use_x_font)
+	    {
+	      XftDrawSetClip (xftDraw, 0);
+	    }
+	  else
+#endif
+	    XLIKE_CLEAR_CLIP_MASK (dpy, gc);
+	}
+
+      /* If we are actually superimposing the cursor then redraw with just
+	 the appropriate section highlighted. */
+      if (cursor_clip && !cursor && focus && cursor_cachel)
+	{
+#ifdef USE_XFT
+	  if (!use_x_font)	/* Xft */
+	    {
+	      XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
+	  
+	      { /* set up clipping */
+		Region clip_reg = XCreateRegion();
+		XRectangle clip_box = { cursor_start, ypos,
+					cursor_width, height };
+	    
+		XUnionRectWithRegion (&clip_box, clip_reg, clip_reg); 
+		XftDrawSetClip(xftDraw, clip_reg);
+		XDestroyRegion(clip_reg);
+	      }
+	      { /* draw background rectangle & draw text */
+		int rect_height = FONT_INSTANCE_ASCENT(fi)
+				  + FONT_INSTANCE_DESCENT(fi);
+		int rect_width = x_text_width_single_run(f, cachel, &runs[i]);
+		XftColor xft_color;
+
+		xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
+		XftDrawRect (xftDraw, &xft_color,
+			     xpos, ypos, rect_width, rect_height);
+
+		xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
+		if (runs[i].dimension == 1)
+		  XftDrawString8 (xftDraw, &xft_color, rf, xpos, dl->ypos,
+				  runs[i].ptr, runs[i].len);
+		else
+		  XftDrawString16 (xftDraw, &xft_color, rf, xpos, dl->ypos,
+				   (XftChar16 *) runs[i].ptr, runs[i].len);
+	      }
+
+	      XftDrawSetClip(xftDraw, 0);
+	    }
+	  else			/* core font, not Xft */
+#endif /* USE_XFT */
+	    {
+	      XLIKE_RECTANGLE clip_box;
+	      XLIKE_GC cgc;
+	      cgc = XLIKE_get_gc (d, font, cursor_cachel->foreground,
+				  cursor_cachel->background, Qnil, Qnil);
+
+	      clip_box.x = 0;
+	      clip_box.y = 0;
+	      clip_box.width = cursor_width;
+	      clip_box.height = height;
+
+	      XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
+					&clip_box);
+#ifdef THIS_IS_X
+	      if (runs[i].dimension == 1)
+		XDrawImageString (dpy, x_win, cgc, xpos, dl->ypos,
+				  (char *) runs[i].ptr, runs[i].len);
+	      else
+		XDrawImageString16 (dpy, x_win, cgc, xpos, dl->ypos,
+				    (XChar2b *) runs[i].ptr, runs[i].len);
+#else
+	      /* The X specific called different functions (XDraw*String
+		 vs. XDraw*String16), but apparently gdk_draw_text takes care
+		 of that for us.
+
+		 BUT, gdk_draw_text also does too much, by dividing the
+		 length by 2.  So we fake them out my multiplying the
+		 length by the dimension of the text.  This will do the
+		 right thing for single-dimension runs as well of course.
+	      */
+	      gdk_draw_text_image (GDK_DRAWABLE (x_win),
+				   FONT_INSTANCE_GTK_FONT (fi), cgc, xpos,
+				   dl->ypos, (char *) runs[i].ptr,
+				   runs[i].len * runs[i].dimension);
+#endif /* (not) THIS_IS_X */
+
+	      XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
+	    }
+	}
+
+      xpos += this_width;
+    }
+
+  /* Draw the non-focus box or bar-cursor as needed. */
+  /* Can't this logic be simplified? */
+  if (cursor_cachel
+      && ((cursor && !focus && NILP (bar_cursor_value))
+	  || (cursor_width
+	      && (cursor_start + cursor_width >= clip_start)
+	      && !NILP (bar_cursor_value))))
+    {
+      int tmp_height, tmp_y;
+      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
+      int need_clipping = (cursor_start < clip_start
+			   || clip_end < cursor_start + cursor_width);
+
+      /* #### This value is correct (as far as I know) because
+	 all of the times we need to draw this cursor, we will
+	 be called with exactly one character, so we know we
+	 can always use runs[0].
+
+	 This is bogus as all hell, however.  The cursor handling in
+	 this function is way bogus and desperately needs to be
+	 cleaned up.  (In particular, the drawing of the cursor should
+	 really really be separated out of this function.  This may be
+	 a bit tricky now because this function itself does way too
+	 much stuff, a lot of which needs to be moved into
+	 redisplay.c.)  This is the only way to be able to easily add
+	 new cursor types or (e.g.) make the bar cursor be able to
+	 span two characters instead of overlaying just one. */
+      int bogusly_obtained_ascent_value =
+	XFONT_INSTANCE (FACE_CACHEL_FONT (cachel, runs[0].charset))->ascent;
+
+      if (!NILP (bar_cursor_value))
+	{
+	  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
+			     make_int (bar_width));
+	}
+      else
+	{
+	  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background,
+			     Qnil, Qnil, Qnil);
+	}
+
+      tmp_y = dl->ypos - bogusly_obtained_ascent_value;
+      tmp_height = cursor_height;
+      if (tmp_y + tmp_height > (int) (ypos + height))
+	{
+	  tmp_y = ypos + height - tmp_height;
+	  if (tmp_y < (int) ypos)
+	    tmp_y = ypos;
+	  tmp_height = ypos + height - tmp_y;
+	}
+
+      if (need_clipping)
+	{
+	  XLIKE_RECTANGLE clip_box;
+	  clip_box.x = 0;
+	  clip_box.y = 0;
+	  clip_box.width = clip_end - clip_start;
+	  clip_box.height = tmp_height;
+	  XLIKE_SET_CLIP_RECTANGLE (dpy, gc, clip_start, tmp_y, &clip_box);
+	}
+
+      if (!focus && NILP (bar_cursor_value))
+	{
+	  XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y,
+				cursor_width - 1, tmp_height - 1);
+	}
+      else if (focus && !NILP (bar_cursor_value))
+	{
+	  XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1, tmp_y,
+			   cursor_start + bar_width - 1,
+			   tmp_y + tmp_height - 1);
+	}
+
+      /* Restore the GC */
+      if (need_clipping)
+	{
+	  XLIKE_CLEAR_CLIP_MASK (dpy, gc);
+	}
+    }
+
+#ifdef USE_XFT
+#undef XFT_FROB_LISP_COLOR
+#endif
+}
+
+#ifdef THIS_IS_GTK
+static void
+our_draw_bitmap (GdkDrawable *drawable,
+		 GdkGC       *gc,
+		 GdkPixmap   *src,
+		 gint         xsrc,
+		 gint         ysrc,
+		 gint         xdest,
+		 gint         ydest,
+		 gint         width,
+		 gint         height);
+#endif /* THIS_IS_GTK */
+
+
+static void
+XLIKE_output_xlike_pixmap (struct frame *f, Lisp_Image_Instance *p, int x,
+			   int y, int xoffset, int yoffset,
+			   int width, int height,
+			   XLIKE_COLOR fg, XLIKE_COLOR bg,
+			   XLIKE_GC override_gc)
+{
+  struct device *d = XDEVICE (f->device);
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  XLIKE_GC gc;
+  XLIKE_GCVALUES gcv;
+  unsigned long pixmap_mask;
+
+  if (!override_gc)
+    {
+      memset (&gcv, ~0, sizeof (gcv));
+      gcv.graphics_exposures = XLIKE_FALSE;
+      XLIKE_SET_GC_COLOR (gcv.foreground, fg);
+      XLIKE_SET_GC_COLOR (gcv.background, bg);
+      pixmap_mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES;
+
+      if (IMAGE_INSTANCE_XLIKE_MASK (p))
+	{
+	  gcv.function = XLIKE_GX_COPY;
+	  gcv.clip_mask = IMAGE_INSTANCE_XLIKE_MASK (p);
+	  gcv.clip_x_origin = x - xoffset;
+	  gcv.clip_y_origin = y - yoffset;
+	  pixmap_mask |= (XLIKE_GC_FUNCTION | XLIKE_GC_CLIP_MASK |
+			  XLIKE_GC_CLIP_X_ORIGIN |
+			  XLIKE_GC_CLIP_Y_ORIGIN);
+	  /* Can't set a clip rectangle below because we already have a mask.
+	     We could conceivably create a new clipmask by zeroing out
+	     everything outside the clip region.  Is it worth it?
+	     Is it possible to get an equivalent effect by changing the
+	     args to XCopyArea below rather than messing with a clip box?
+	     - dkindred@cs.cmu.edu
+	     Yes. We don't clip at all now - andy@xemacs.org
+	  */
+	}
+
+      gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, pixmap_mask);
+    }
+  else
+    {
+      gc = override_gc;
+      /* override_gc might have a mask already--we don't want to nuke it.
+	 Maybe we can insist that override_gc have no mask, or use
+	 one of the suggestions above. */
+    }
+
+#ifdef THIS_IS_X
+  /* depth of 0 means it's a bitmap, not a pixmap, and we should use
+     XCopyPlane (1 = current foreground color, 0 = background) instead
+     of XCopyArea, which means that the bits in the pixmap are actual
+     pixel values, instead of symbolic of fg/bg. */
+#endif /* THIS_IS_X */
+  if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0)
+    {
+#ifdef THIS_IS_X
+      XCopyArea (dpy,
+		 IMAGE_INSTANCE_X_PIXMAP_SLICE
+		 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset,
+		 yoffset, width,
+		 height, x, y);
+#else /* THIS_IS_GTK */
+      USED (dpy);
+      gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
+		       IMAGE_INSTANCE_GTK_PIXMAP (p),
+		       xoffset, yoffset, x, y, width, height);
+#endif /* THIS_IS_GTK */
+    }
+  else
+    {
+#ifdef THIS_IS_X
+      XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE
+		  (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc,
+		  xoffset, yoffset, width, height, x, y, 1L);
+#else /* THIS_IS_GTK */
+      USED (dpy);
+      our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
+		       IMAGE_INSTANCE_GTK_PIXMAP (p),
+		       xoffset, yoffset, x, y, width, height);
+#endif /* THIS_IS_GTK */
+    }
+}
+
+static void
+XLIKE_output_pixmap (struct window *w, Lisp_Object image_instance,
+		     struct display_box *db, struct display_glyph_area *dga,
+		     face_index findex, int cursor_start, int cursor_width,
+		     int cursor_height, int UNUSED (bg_pixmap))
+{
+  struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+  Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+
+  /* Output the pixmap. */
+  {
+    Lisp_Object tmp_pixel;
+    XLIKE_COLOR tmp_bcolor, tmp_fcolor;
+
+    tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
+    tmp_fcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel);
+    tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
+    tmp_bcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel);
+
+    XLIKE_output_xlike_pixmap (f, p, db->xpos, db->ypos,
+			       dga->xoffset, dga->yoffset,
+			       dga->width, dga->height,
+			       tmp_fcolor, tmp_bcolor, 0);
+  }
+
+  /* Draw a cursor over top of the pixmap. */
+  if (cursor_width && cursor_height && (cursor_start >= db->xpos)
+      && !NILP (w->text_cursor_visible_p)
+      && (cursor_start < db->xpos + dga->width))
+    {
+      XLIKE_GC gc;
+      int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
+      struct face_cachel *cursor_cachel =
+	WINDOW_FACE_CACHEL (w,
+			    get_builtin_face_cache_index
+			    (w, Vtext_cursor_face));
+
+      gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
+
+      if (cursor_width > db->xpos + dga->width - cursor_start)
+	cursor_width = db->xpos + dga->width - cursor_start;
+
+      if (focus)
+	  XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, db->ypos,
+				cursor_width, cursor_height);
+      else
+	{
+	  XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, db->ypos,
+				cursor_width, cursor_height);
+	}
+    }
+}
+
+/*****************************************************************************
+ XLIKE_output_vertical_divider
+
+ Draw a vertical divider down the right side of the given window.
+ ****************************************************************************/
+static void
+XLIKE_output_vertical_divider (struct window *w, int USED_IF_X(clear))
+{
+  struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  Lisp_Object tmp_pixel;
+  XLIKE_GCVALUES gcv;
+  XLIKE_GC background_gc;
+  enum edge_style style;
+  unsigned long mask;
+  int x, y1, y2, width, shadow_thickness, spacing, line_width;
+  face_index div_face =
+    get_builtin_face_cache_index (w, Vvertical_divider_face);
+
+  width = window_divider_width (w);
+  shadow_thickness = XINT (w->vertical_divider_shadow_thickness);
+  spacing = XINT (w->vertical_divider_spacing);
+  line_width = XINT (w->vertical_divider_line_width);
+  x = WINDOW_RIGHT (w) - width;
+  y1 = WINDOW_TOP (w);
+  y2 = WINDOW_BOTTOM (w);
+
+  memset (&gcv, ~0, sizeof (gcv));
+
+  tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
+
+  /* First, get the GC's. */
+  XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
+  gcv.foreground = gcv.background;
+  gcv.graphics_exposures = XLIKE_FALSE;
+  mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES;
+
+  background_gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, mask);
+
+  /* Clear the divider area first.  This needs to be done when a
+     window split occurs. */
+#ifdef THIS_IS_X
+  if (clear)
+    XClearArea (dpy, x_win, x, y1, width, y2 - y1, False);
+#else /* THIS_IS_GTK */
+  USED (dpy);
+  /* if (clear) */
+  gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE,
+		      x, y1, width, y2 - y1);
+#endif /* THIS_IS_GTK */
+
+#ifndef THIS_IS_GTK
+   /* #### FIXME Why not? Formerly '#if 0' in the GDK code */
+  /* Draw the divider line. */
+  XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc,
+			x + spacing + shadow_thickness, y1,
+			line_width, y2 - y1);
+#endif /* not THIS_IS_GTK */
+
+  if (shadow_thickness < 0)
+    {
+      shadow_thickness = -shadow_thickness;
+      style = EDGE_BEVEL_IN;
+    }
+  else
+    {
+      style = EDGE_BEVEL_OUT;
+    }
+
+  /* Draw the shadows around the divider line */
+  XLIKE_bevel_area (w, div_face, x + spacing, y1,
+		    width - 2 * spacing, y2 - y1,
+		    shadow_thickness, EDGE_ALL, style);
+}
+
+/*****************************************************************************
+ XLIKE_output_blank
+
+ Output a blank by clearing the area it covers in the foreground color
+ of its face.
+ ****************************************************************************/
+static void
+XLIKE_output_blank (struct window *w, struct display_line *dl, struct rune *rb,
+		    int start_pixpos, int cursor_start, int cursor_width)
+{
+  struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  XLIKE_GC gc;
+  struct face_cachel *cursor_cachel =
+    WINDOW_FACE_CACHEL (w,
+			get_builtin_face_cache_index
+			(w, Vtext_cursor_face));
+  Lisp_Object bg_pmap;
+  Lisp_Object buffer = WINDOW_BUFFER (w);
+  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
+							 buffer);
+
+  int x = rb->xpos;
+  int y = XLIKE_DISPLAY_LINE_YPOS (dl);
+  int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
+  int width = rb->width;
+
+  /* Unmap all subwindows in the area we are going to blank. */
+  redisplay_unmap_subwindows_maybe (f, x, y, width, height);
+
+  if (start_pixpos > x)
+    {
+      if (start_pixpos >= (x + width))
+	return;
+      else
+	{
+	  width -= (start_pixpos - x);
+	  x = start_pixpos;
+	}
+    }
+
+  bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
+  if (!IMAGE_INSTANCEP (bg_pmap)
+      || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
+    bg_pmap = Qnil;
+
+  if (NILP (bg_pmap))
+    gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
+		       Qnil, Qnil, Qnil);
+  else
+    gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
+		       WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), bg_pmap,
+		       Qnil);
+
+  XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
+
+  /* If this rune is marked as having the cursor, then it is actually
+     representing a tab. */
+  if (!NILP (w->text_cursor_visible_p)
+      && (rb->cursor_type == CURSOR_ON
+	  || (cursor_width
+	      && (cursor_start + cursor_width > x)
+	      && cursor_start < (x + width))))
+    {
+      int cursor_height, cursor_y;
+      int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
+      Lisp_Font_Instance *fi;
+
+      fi = XFONT_INSTANCE (FACE_CACHEL_FONT
+			   (WINDOW_FACE_CACHEL (w, rb->findex),
+			    Vcharset_ascii));
+
+      gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
+
+      cursor_y = dl->ypos - fi->ascent;
+      cursor_height = fi->height;
+      if (cursor_y + cursor_height > y + height)
+	cursor_height = y + height - cursor_y;
+
+      if (focus)
+	{
+	  if (NILP (bar_cursor_value))
+	    {
+	      XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
+				    fi->width, cursor_height);
+	    }
+	  else
+	    {
+	      int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
+
+	      gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background,
+				 Qnil, Qnil, make_int (bar_width));
+	      XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1,
+			       cursor_y, cursor_start + bar_width - 1,
+			       cursor_y + cursor_height - 1);
+	    }
+	}
+      else if (NILP (bar_cursor_value))
+	{
+	  XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
+				fi->width - 1, cursor_height - 1);
+	}
+    }
+}
+
+/*****************************************************************************
+ XLIKE_output_horizontal_line
+
+ Output a horizontal line in the foreground of its face.
+ ****************************************************************************/
+static void
+XLIKE_output_horizontal_line (struct window *w, struct display_line *dl,
+			      struct rune *rb)
+{
+  struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  XLIKE_GC gc;
+
+  int x = rb->xpos;
+  int width = rb->width;
+  int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
+  int ypos1, ypos2, ypos3, ypos4;
+
+  ypos1 = XLIKE_DISPLAY_LINE_YPOS (dl);
+  ypos2 = ypos1 + rb->object.hline.yoffset;
+  ypos3 = ypos2 + rb->object.hline.thickness;
+  ypos4 = dl->ypos + dl->descent - dl->clip;
+
+  /* First clear the area not covered by the line. */
+  if (height - rb->object.hline.thickness > 0)
+    {
+      gc = XLIKE_get_gc (d, Qnil,
+			 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
+			 Qnil, Qnil, Qnil);
+
+      if (ypos2 - ypos1 > 0)
+	XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
+      if (ypos4 - ypos3 > 0)
+	XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
+    }
+
+#ifdef THIS_IS_GTK
+  {
+    GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
+    gtk_paint_hline (style, x_win, GTK_STATE_NORMAL, NULL,
+		     FRAME_GTK_TEXT_WIDGET (f), "hline", x, x + width, ypos2);
+  }
+#else /* THIS_IS_X */
+  /* Now draw the line. */
+  gc = XLIKE_get_gc (d, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
+		     Qnil, Qnil, Qnil);
+
+  if (ypos2 < ypos1)
+    ypos2 = ypos1;
+  if (ypos3 > ypos4)
+    ypos3 = ypos4;
+
+  if (ypos3 - ypos2 > 0)
+    XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos2, width, ypos3 - ypos2);
+#endif /* THIS_IS_X */
+}
+
+/****************************************************************************
+ XLIKE_clear_region
+
+ Clear the area in the box defined by the given parameters using the
+ given face.
+ ****************************************************************************/
+static void
+XLIKE_clear_region (Lisp_Object UNUSED (locale), struct device* d,
+		    struct frame* f, face_index UNUSED (findex), int x, int y,
+		    int width, int height, Lisp_Object fcolor,
+		    Lisp_Object bcolor, Lisp_Object background_pixmap)
+{
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  XLIKE_GC gc = NULL;
+
+  if (!UNBOUNDP (background_pixmap))
+    {
+      gc = XLIKE_get_gc (d, Qnil, fcolor, bcolor, background_pixmap, Qnil);
+    }
+
+  if (gc)
+    XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
+  else
+    XLIKE_CLEAR_AREA (dpy, x_win, x, y, width, height);
+}
+
+/*****************************************************************************
+ xlike_output_eol_cursor
+
+ Draw a cursor at the end of a line.  The end-of-line cursor is
+ narrower than the normal cursor.
+ ****************************************************************************/
+static void
+XLIKE_output_eol_cursor (struct window *w, struct display_line *dl, int xpos,
+			 face_index findex)
+{
+  struct frame *f = XFRAME (w->frame);
+  struct device *d = XDEVICE (f->device);
+  Lisp_Object window;
+
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  XLIKE_GC gc = NULL;
+  face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
+  struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, elt);
+
+  int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
+  Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
+							 WINDOW_BUFFER (w));
+
+  int x = xpos;
+  int y = XLIKE_DISPLAY_LINE_YPOS (dl);
+  int width = EOL_CURSOR_WIDTH;
+  int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
+  int cursor_height, cursor_y;
+  int defheight, defascent;
+
+  window = wrap_window (w);
+  redisplay_clear_region (window, findex, x, y, width, height);
+
+  if (NILP (w->text_cursor_visible_p))
+    return;
+
+  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil);
+
+  default_face_font_info (window, &defascent, 0, &defheight, 0, 0);
+
+  /* make sure the cursor is entirely contained between y and y+height */
+  cursor_height = min (defheight, height);
+  cursor_y = max (y, min (y + height - cursor_height,
+			  dl->ypos - defascent));
+
+  if (focus)
+    {
+#ifdef HAVE_XIM
+      XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2);
+#endif /* HAVE_XIM */
+
+      if (NILP (bar_cursor_value))
+	{
+	  XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, cursor_y, width,
+				cursor_height);
+	}
+      else
+	{
+	  int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
+
+	  gc = XLIKE_get_gc (d, Qnil, cursor_cachel->background, Qnil, Qnil,
+			     make_int (bar_width));
+	  XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y,
+			   x + bar_width - 1, cursor_y + cursor_height - 1);
+	}
+    }
+  else if (NILP (bar_cursor_value))
+    {
+      XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, x, cursor_y, width - 1,
+			    cursor_height - 1);
+    }
+}
+
+static void
+XLIKE_clear_frame_window (Lisp_Object window)
+{
+  struct window *w = XWINDOW (window);
+
+  if (!NILP (w->vchild))
+    {
+      XLIKE_clear_frame_windows (w->vchild);
+      return;
+    }
+
+  if (!NILP (w->hchild))
+    {
+      XLIKE_clear_frame_windows (w->hchild);
+      return;
+    }
+
+  redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w),
+				 WINDOW_TEXT_BOTTOM (w));
+}
+
+static void
+XLIKE_clear_frame_windows (Lisp_Object window)
+{
+  for (; !NILP (window); window = XWINDOW (window)->next)
+    XLIKE_clear_frame_window (window);
+}
+
+static void
+XLIKE_clear_frame (struct frame *f)
+{
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (XDEVICE (f->device));
+  XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
+  int x, y, width, height;
+  Lisp_Object frame;
+
+  x = FRAME_LEFT_BORDER_START (f);
+  width = (FRAME_PIXWIDTH (f) - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) -
+	   FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) -
+	   2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f) -
+	   2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f));
+  /* #### This adjustment by 1 should be being done in the macros.
+     There is some small differences between when the menubar is on
+     and off that we still need to deal with. */
+  y = FRAME_TOP_BORDER_START (f) - 1;
+  height = (FRAME_PIXHEIGHT (f) - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) -
+	    FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -
+	    2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f) -
+	    2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + 1;
+
+  XLIKE_CLEAR_AREA (dpy, x_win, x, y, width, height);
+
+  frame = wrap_frame (f);
+
+  if (!UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vdefault_face, frame))
+      || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vleft_margin_face, frame))
+      || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vright_margin_face, frame)))
+    {
+      XLIKE_clear_frame_windows (f->root_window);
+    }
+#ifdef THIS_IS_X
+  {
+    struct device *d = XDEVICE (f->device);
+    if (!(check_if_pending_expose_event (d)))
+      XFlush (DEVICE_X_DISPLAY (d));
+  }
+#endif /* THIS_IS_X */
+}
+
+/* briefly swap the foreground and background colors.
+ */
+
+static int
+XLIKE_flash (struct device *d)
+{
+  struct frame *f = device_selected_frame (d);
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_WINDOW win = GET_XLIKE_WINDOW (f);
+  XLIKE_GC gc = NULL;
+  XLIKE_GCVALUES gcv;
+  XLIKE_PIXEL tmp_fcolor, tmp_bcolor;
+  Lisp_Object tmp_pixel, frame;
+  struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
+  int flash_height;
+
+  frame = wrap_frame (f);
+
+  tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
+  tmp_fcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
+  tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame);
+  tmp_bcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
+  memset (&gcv, ~0, sizeof (gcv)); /* initialize all slots to ~0 */
+  XLIKE_SET_GC_PIXEL (gcv.foreground, tmp_fcolor ^ tmp_bcolor);
+  gcv.function = XLIKE_GX_XOR;
+  gcv.graphics_exposures = XLIKE_FALSE;
+  gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (XDEVICE (f->device)), &gcv,
+			XLIKE_GC_FOREGROUND | XLIKE_GC_FUNCTION | XLIKE_GC_EXPOSURES);
+  default_face_height_and_width (frame, &flash_height, 0);
+
+  /* If window is tall, flash top and bottom line.  */
+  if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
+    {
+      XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
+			    w->pixel_width, flash_height);
+      XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left,
+			    w->pixel_top + w->pixel_height - flash_height,
+			    w->pixel_width, flash_height);
+    }
+  else
+    /* If it is short, flash it all.  */
+    XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
+			  w->pixel_width, w->pixel_height);
+
+  XLIKE_FLUSH (dpy);
+
+#ifdef HAVE_SELECT
+  {
+    int usecs = 100000;
+    struct timeval tv;
+    tv.tv_sec  = usecs / 1000000L;
+    tv.tv_usec = usecs % 1000000L;
+    /* I'm sure someone is going to complain about this... */
+    select (0, 0, 0, 0, &tv);
+  }
+#else
+#ifdef HAVE_POLL
+  poll (0, 0, 100);
+#else /* !HAVE_POLL */
+#error bite me
+#endif /* HAVE_POLL */
+#endif /* HAVE_SELECT */
+
+  /* If window is tall, flash top and bottom line.  */
+  if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
+    {
+      XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
+			    w->pixel_width, flash_height);
+      XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left,
+			    w->pixel_top + w->pixel_height - flash_height,
+			    w->pixel_width, flash_height);
+    }
+  else
+    /* If it is short, flash it all.  */
+    XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
+			  w->pixel_width, w->pixel_height);
+
+  XLIKE_FLUSH (dpy);
+
+  return 1;
+}
+
+
+/************************************************************************/
+/*                            initialization                            */
+/************************************************************************/
+
+void
+console_type_create_redisplay_XLIKE (void)
+{
+  /* redisplay methods */
+  XLIKE_CONSOLE_HAS_METHOD (text_width);
+  XLIKE_CONSOLE_HAS_METHOD (output_display_block);
+  XLIKE_CONSOLE_HAS_METHOD (divider_height);
+  XLIKE_CONSOLE_HAS_METHOD (eol_cursor_width);
+  XLIKE_CONSOLE_HAS_METHOD (output_vertical_divider);
+  XLIKE_CONSOLE_HAS_METHOD (clear_region);
+  XLIKE_CONSOLE_HAS_METHOD (clear_frame);
+  XLIKE_CONSOLE_HAS_METHOD (flash);
+  XLIKE_CONSOLE_HAS_METHOD (ring_bell);
+  XLIKE_CONSOLE_HAS_METHOD (bevel_area);
+  XLIKE_CONSOLE_HAS_METHOD (output_string);
+  XLIKE_CONSOLE_HAS_METHOD (output_pixmap);
+
+#ifdef THIS_IS_X
+  XLIKE_CONSOLE_HAS_METHOD (window_output_begin);
+  XLIKE_CONSOLE_HAS_METHOD (window_output_end);
+#endif
+}
--- a/src/redisplay.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Display generation from window structure and buffer text.
    Copyright (C) 1994, 1995, 1996 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2005, 2010 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1996 Chuck Thompson.
 
@@ -630,8 +630,8 @@
 /***************************************************************************/
 
 static int
-redisplay_text_width_ichar_string (struct window *w, int findex,
-				    Ichar *str, Charcount len)
+redisplay_window_text_width_ichar_string (struct window *w, int findex,
+					  Ichar *str, Charcount len)
 {
   unsigned char charsets[NUM_LEADING_BYTES];
   Lisp_Object window;
@@ -640,17 +640,17 @@
   window = wrap_window (w);
   ensure_face_cachel_complete (WINDOW_FACE_CACHEL (w, findex), window,
 			       charsets);
-  return DEVMETH (XDEVICE (FRAME_DEVICE (XFRAME (WINDOW_FRAME (w)))),
-		  text_width, (XFRAME (WINDOW_FRAME (w)),
-			       WINDOW_FACE_CACHEL (w, findex), str, len));
+  return DEVMETH (WINDOW_XDEVICE (w),
+		  text_width, (w, WINDOW_FACE_CACHEL (w, findex), str,
+			       len));
 }
 
 static Ichar_dynarr *rtw_ichar_dynarr;
 
-int
-redisplay_text_width_string (struct window *w, int findex,
-			     Ibyte *nonreloc, Lisp_Object reloc,
-			     Bytecount offset, Bytecount len)
+static int
+redisplay_window_text_width_string (struct window *w, int findex,
+				    Ibyte *nonreloc, Lisp_Object reloc,
+				    Bytecount offset, Bytecount len)
 {
   if (!rtw_ichar_dynarr)
     rtw_ichar_dynarr = Dynarr_new (Ichar);
@@ -660,18 +660,19 @@
   if (STRINGP (reloc))
     nonreloc = XSTRING_DATA (reloc);
   convert_ibyte_string_into_ichar_dynarr (nonreloc, len, rtw_ichar_dynarr);
-  return redisplay_text_width_ichar_string
-    (w, findex, Dynarr_atp (rtw_ichar_dynarr, 0),
+  return redisplay_window_text_width_ichar_string
+    (w, findex, Dynarr_begin (rtw_ichar_dynarr),
      Dynarr_length (rtw_ichar_dynarr));
 }
 
 int
-redisplay_frame_text_width_string (struct frame *f, Lisp_Object face,
-				   Ibyte *nonreloc, Lisp_Object reloc,
-				   Bytecount offset, Bytecount len)
-{
+redisplay_text_width_string (Lisp_Object domain, Lisp_Object face,
+			     Ibyte *nonreloc, Lisp_Object reloc,
+			     Bytecount offset, Bytecount len)
+{
+  Lisp_Object window = DOMAIN_WINDOW (domain);
+  Lisp_Object frame  = DOMAIN_FRAME  (domain);
   unsigned char charsets[NUM_LEADING_BYTES];
-  Lisp_Object frame;
   struct face_cachel cachel;
 
   if (!rtw_ichar_dynarr)
@@ -685,10 +686,18 @@
   find_charsets_in_ibyte_string (charsets, nonreloc, len);
   reset_face_cachel (&cachel);
   cachel.face = face;
-  frame = wrap_frame (f);
-  ensure_face_cachel_complete (&cachel, frame, charsets);
-  return DEVMETH (XDEVICE (FRAME_DEVICE (f)),
-		  text_width, (f, &cachel, Dynarr_atp (rtw_ichar_dynarr, 0),
+  ensure_face_cachel_complete (&cachel,
+			       NILP (window) ? frame : window,
+			       charsets);
+  return DEVMETH (XDEVICE (FRAME_DEVICE (XFRAME (frame))),
+		  /* #### Not clear if we're always passed a window, but
+		     I think so.  If not, we will get an abort here,
+		     and then we need to either fix the callers to pass in
+		     a window, or change *text_width() to take a domain
+		     argument. */
+		  text_width, (XWINDOW (window),
+			       &cachel,
+			       Dynarr_begin (rtw_ichar_dynarr),
 			       Dynarr_length (rtw_ichar_dynarr)));
 }
 
@@ -1127,8 +1136,8 @@
 	      Ichar ch = data->font_is_bogus ? '~' : data->ch;
 
 	      data->last_char_width =
-		redisplay_text_width_ichar_string (XWINDOW (data->window),
-						    data->findex, &ch, 1);
+		redisplay_window_text_width_ichar_string
+		(XWINDOW (data->window), data->findex, &ch, 1);
 	    }
 	  else
 	    data->last_char_width = -1;
@@ -1145,9 +1154,8 @@
 
       width = data->last_char_width;
       if (width < 0) /* proportional fonts */
-	width = redisplay_text_width_ichar_string (XWINDOW (data->window),
-						    data->findex,
-						    &data->ch, 1);
+	width = redisplay_window_text_width_ichar_string
+	  (XWINDOW (data->window), data->findex, &data->ch, 1);
     }
 
   if (data->max_pixpos != -1 && (data->pixpos + width > data->max_pixpos))
@@ -1157,7 +1165,7 @@
 
   if (Dynarr_length (data->db->runes) < Dynarr_largest (data->db->runes))
     {
-      crb = Dynarr_atp (data->db->runes, Dynarr_length (data->db->runes));
+      crb = Dynarr_past_lastp (data->db->runes);
       local = 0;
     }
   else
@@ -1268,7 +1276,7 @@
 
 	      pb.type = PROP_STRING;
 	      pb.data.p_string.str = xnew_array (Ibyte, len);
-	      strncpy ((char *) pb.data.p_string.str, (char *) pos, len);
+	      qxestrncpy (pb.data.p_string.str, pos, len);
 	      pb.data.p_string.len = len;
 
 	      Dynarr_add (prop, pb);
@@ -1678,7 +1686,7 @@
 	  break;
 	case PROP_STRING:
 	  if (pb->data.p_string.str)
-	    xfree (pb->data.p_string.str, Ibyte *);
+	    xfree (pb->data.p_string.str);
 	  /* #### bogus bogus -- this doesn't do anything!
 	     Should probably call add_ibyte_string_runes(),
 	     once that function is fixed. */
@@ -2304,9 +2312,9 @@
 	     works because we always recalculate the extent-fragments
 	     for propagated data, we never actually propagate the
 	     fragments that still need to be displayed. */
-	  if (*prop && Dynarr_atp (*prop, 0)->type == PROP_GLYPH)
-	    {
-	      last_glyph = Dynarr_atp (*prop, 0)->data.p_glyph.glyph;
+	  if (*prop && Dynarr_begin (*prop)->type == PROP_GLYPH)
+	    {
+	      last_glyph = Dynarr_begin (*prop)->data.p_glyph.glyph;
 	      Dynarr_free (*prop);
 	      *prop = 0;
 	    }
@@ -2433,8 +2441,8 @@
 		 line and there are more glyphs to display then do
 		 appropriate processing to not get a continuation
 		 glyph. */
-	      if (*prop != ADD_FAILED
-		  && Dynarr_atp (*prop, 0)->type == PROP_GLYPH
+	      if (*prop != ADD_FAILED 
+		  && Dynarr_begin (*prop)->type == PROP_GLYPH
 		  && data.ch == '\n')
 		{
 		  /* If there are no more glyphs then do the normal
@@ -2445,8 +2453,8 @@
 		     this we would have to carry the index around
 		     which might be problematic since the fragment is
 		     recalculated for each line. */
-		  if (EQ (Dynarr_end (tmpglyphs)->glyph,
-			  Dynarr_atp (*prop, 0)->data.p_glyph.glyph))
+		  if (EQ (Dynarr_lastp (tmpglyphs)->glyph,
+			  Dynarr_begin (*prop)->data.p_glyph.glyph))
 		    {
 		      Dynarr_free (*prop);
 		      *prop = 0;
@@ -2911,7 +2919,7 @@
   db->start_pos = dl->bounds.left_in;
   if (Dynarr_length (db->runes))
     {
-      struct rune *rb = Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1);
+      struct rune *rb = Dynarr_lastp (db->runes);
 
       db->end_pos = rb->xpos + rb->width;
     }
@@ -3826,8 +3834,7 @@
 
   if (Dynarr_length (db->runes))
     {
-      struct rune *rb =
-	Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1);
+      struct rune *rb = Dynarr_lastp (db->runes);
       c_pixpos = rb->xpos + rb->width;
     }
   else
@@ -3864,14 +3871,14 @@
       strdata = XSTRING_DATA (result_str);
 
       for (elt = 0, len = 0; elt < Dynarr_length (db->runes); elt++)
-	{
-	  if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR)
-	    {
-	      len += (set_itext_ichar
-		      (strdata + len, Dynarr_atp (db->runes,
-						  elt)->object.chr.ch));
-	    }
-	}
+        {
+          if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR)
+            {
+              len += (set_itext_ichar
+                      (strdata + len, Dynarr_atp (db->runes,
+                                                  elt)->object.chr.ch));
+            }
+        }
 
       init_string_ascii_begin (result_str);
       bump_string_modiff (result_str);
@@ -4012,7 +4019,7 @@
     add_blank_rune (data, NULL, 0);
 
   end = (Dynarr_length (db->runes) +
-	 bytecount_to_charcount (str, strlen ((const char *) str)));
+	 bytecount_to_charcount (str, qxestrlen (str)));
   if (max_pos != -1)
     end = min (max_pos, end);
 
@@ -4075,7 +4082,7 @@
    true of max_pixsize. */
 #define SET_CURRENT_MODE_CHARS_PIXSIZE                                  \
   if (Dynarr_length (data->db->runes))                                  \
-    cur_pixsize = data->pixpos - Dynarr_atp (data->db->runes, 0)->xpos; \
+    cur_pixsize = data->pixpos - Dynarr_begin (data->db->runes)->xpos; \
   else                                                                  \
     cur_pixsize = 0;
 
@@ -4178,8 +4185,8 @@
 		      SET_CURRENT_MODE_CHARS_PIXSIZE;
 
 		      dash_pixsize =
-			redisplay_text_width_string (w, findex, &ch, Qnil, 0,
-						     1);
+			redisplay_window_text_width_string
+			(w, findex, &ch, Qnil, 0, 1);
 
 		      if (dash_pixsize == 0)
 			num_to_add = 0;
@@ -4201,7 +4208,7 @@
 
 		  decode_mode_spec (w, ch, type);
 
-		  str = Dynarr_atp (mode_spec_ibyte_string, 0);
+		  str = Dynarr_begin (mode_spec_ibyte_string);
 		  size = bytecount_to_charcount
 		    /* Skip the null character added by `decode_mode_spec' */
 		    (str, Dynarr_length (mode_spec_ibyte_string)) - 1;
@@ -4447,7 +4454,7 @@
     {
     invalid:
       {
-	const char *str = GETTEXT ("*invalid*");
+	const Ascbyte *str = GETTEXT ("*invalid*");
 	Charcount size = (Charcount) strlen (str); /* is this ok ?? -- dv */
 
 	if (size <= *offset)
@@ -4482,11 +4489,11 @@
 {
   display_line_dynarr *dla = window_display_lines (w, DESIRED_DISP);
 
-  if (!Dynarr_length (dla) || !Dynarr_atp (dla, 0)->modeline)
+  if (!Dynarr_length (dla) || !Dynarr_begin (dla)->modeline)
     return;
   else
     {
-      generate_modeline (w, Dynarr_atp (dla, 0), DESIRED_DISP);
+      generate_modeline (w, Dynarr_begin (dla), DESIRED_DISP);
       redisplay_update_line (w, 0, 0, 0);
     }
 }
@@ -4538,7 +4545,7 @@
       /* If we're adding a new place marker go ahead and generate the
 	 modeline so that it is available for use by
 	 window_modeline_height. */
-      generate_modeline (w, Dynarr_atp (dla, 0), type);
+      generate_modeline (w, Dynarr_begin (dla), type);
     }
 
   return need_modeline;
@@ -4557,9 +4564,9 @@
 
       if (Dynarr_length (dla))
 	{
-	  if (Dynarr_atp (dla, 0)->modeline)
-	    return (Dynarr_atp (dla, 0)->ascent +
-		    Dynarr_atp (dla, 0)->descent);
+	  if (Dynarr_begin (dla)->modeline)
+	    return (Dynarr_begin (dla)->ascent +
+		    Dynarr_begin (dla)->descent);
 	}
     }
   return 0;
@@ -4774,9 +4781,9 @@
 	{
 	  Lisp_Object last_glyph = Qnil;
 	  /* Deal with clipped glyphs that we have already displayed. */
-	  if (*prop && Dynarr_atp (*prop, 0)->type == PROP_GLYPH)
-	    {
-	      last_glyph = Dynarr_atp (*prop, 0)->data.p_glyph.glyph;
+	  if (*prop && Dynarr_begin (*prop)->type == PROP_GLYPH)
+	    {
+	      last_glyph = Dynarr_begin (*prop)->data.p_glyph.glyph;
 	      Dynarr_free (*prop);
 	      *prop = 0;
 	    }
@@ -5159,7 +5166,7 @@
   db->start_pos = dl->bounds.left_in;
   if (Dynarr_length (db->runes))
     {
-      struct rune *rb = Dynarr_atp (db->runes, Dynarr_length (db->runes) - 1);
+      struct rune *rb = Dynarr_lastp (db->runes);
 
       db->end_pos = rb->xpos + rb->width;
     }
@@ -5464,6 +5471,17 @@
   Dynarr_reset (dla);
   w->max_line_len = 0;
 
+  /* Added 2-1-10 -- we should never have empty face or glyph cachels
+     because we initialized them at startup and the only way to reduce
+     their number is through calling reset_face_cachels() or
+     reset_glyph_cachels(), which as a side effect sets up a number of
+     standard entries */
+  assert (Dynarr_length (w->face_cachels));
+  assert (Dynarr_length (w->glyph_cachels));
+
+#if 0
+  /* #### Delete this code sometime later than 2-1-10 when we're sure it's
+     not needed */
   /* Normally these get updated in redisplay_window but it is possible
      for this function to get called from some other points where that
      update may not have occurred.  This acts as a safety check. */
@@ -5471,6 +5489,7 @@
     reset_face_cachels (w);
   if (!Dynarr_length (w->glyph_cachels))
     reset_glyph_cachels (w);
+#endif
 
   Fset_marker (w->start[type], make_int (start_pos), w->buffer);
   Fset_marker (w->pointm[type], make_int (point), w->buffer);
@@ -5642,7 +5661,7 @@
     {
       /* We know that this is the right thing to use because we put it
 	 there when we first started working in this function. */
-      generate_modeline (w, Dynarr_atp (dla, 0), type);
+      generate_modeline (w, Dynarr_begin (dla), type);
     }
 
   if (depth >= 0)
@@ -5656,12 +5675,12 @@
       return 0;								      \
     else								      \
       {									      \
-	if (Dynarr_atp (cdla, 0)->modeline && Dynarr_atp (ddla, 0)->modeline) \
+	if (Dynarr_begin (cdla)->modeline && Dynarr_begin (ddla)->modeline) \
 	  {								      \
 	    dla_start = 1;						      \
 	  }								      \
-	else if (!Dynarr_atp (cdla, 0)->modeline			      \
-		 && !Dynarr_atp (ddla, 0)->modeline)			      \
+	else if (!Dynarr_begin (cdla)->modeline			      \
+		 && !Dynarr_begin (ddla)->modeline)			      \
 	  {								      \
 	    dla_start = 0;						      \
 	  }								      \
@@ -6095,7 +6114,7 @@
   display_line_dynarr *dla = window_display_lines (w, type);
   int first_line;
 
-  if (Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline)
+  if (Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
     first_line = 1;
   else
     first_line = 0;
@@ -6112,7 +6131,7 @@
 	{
 	  if (!MINI_WINDOW_P (w) && scroll_on_clipped_lines)
 	    {
-	      dl = Dynarr_atp (dla, Dynarr_length (dla) - 1);
+	      dl = Dynarr_lastp (dla);
 
 	      if (point >= (dl->charpos + dl->offset)
 		  && point <= (dl->end_charpos + dl->offset))
@@ -6281,10 +6300,22 @@
     }
   Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), the_buffer);
 
+  /* Added 2-1-10 -- we should never have empty face or glyph cachels
+     because we initialized them at startup and the only way to reduce
+     their number is through calling reset_face_cachels() or
+     reset_glyph_cachels(), which as a side effect sets up a number of
+     standard entries */
+  assert (Dynarr_length (w->face_cachels));
+  assert (Dynarr_length (w->glyph_cachels));
+
   /* If the buffer has changed we have to invalidate all of our face
      cache elements. */
   if ((!echo_active && b != window_display_buffer (w))
+#if 0
+  /* #### Delete this code sometime later than 2-1-10 when we're sure it's
+     not needed */
       || !Dynarr_length (w->face_cachels)
+#endif
       || f->faces_changed)
     reset_face_cachels (w);
   else
@@ -6294,7 +6325,12 @@
      the cache purely because glyphs have changed - this is now
      handled by the dirty flag.*/
   if ((!echo_active && b != window_display_buffer (w))
-      || !Dynarr_length (w->glyph_cachels) || f->faces_changed)
+#if 0
+  /* #### Delete this code sometime later than 2-1-10 when we're sure it's
+     not needed */
+      || !Dynarr_length (w->glyph_cachels)
+#endif
+      || f->faces_changed)
     reset_glyph_cachels (w);
   else
     mark_glyph_cachels_as_not_updated (w);
@@ -7194,7 +7230,7 @@
    line-number-mode is on.  The first line in the buffer is counted as
    1.  If narrowing is in effect, the lines are counted from the
    beginning of the visible portion of the buffer.  */
-static char *
+static Ascbyte *
 window_line_number (struct window *w, int type)
 {
   struct device *d = XDEVICE (XFRAME (w->frame)->device);
@@ -7214,7 +7250,7 @@
   line = buffer_line_number (b, pos, 1);
 
   {
-    static char window_line_number_buf[DECIMAL_PRINT_SIZE (long)];
+    static Ascbyte window_line_number_buf[DECIMAL_PRINT_SIZE (long)];
 
     long_to_string (window_line_number_buf, line + 1);
 
@@ -7239,7 +7275,7 @@
 decode_mode_spec (struct window *w, Ichar spec, int type)
 {
   Lisp_Object obj = Qnil;
-  const char *str = NULL;
+  const Ascbyte *str = NULL;
   struct buffer *b = XBUFFER (w->buffer);
 
   Dynarr_reset (mode_spec_ibyte_string);
@@ -7263,7 +7299,7 @@
 		    ? BUF_PT (b)
 		    : marker_position (w->pointm[type]);
 	int col = column_at_point (b, pt, 1) + !!column_number_start_at_one;
-	char buf[DECIMAL_PRINT_SIZE (long)];
+	Ascbyte buf[DECIMAL_PRINT_SIZE (long)];
 
 	long_to_string (buf, col);
 
@@ -7304,7 +7340,7 @@
 	if (FRAME_TTY_P (f) && f->order_count > 1 && f->order_count <= 99999999)
 	  {
 	    /* Naughty, naughty */
-	    char * writable_str = alloca_array (char, 10);
+	    Ascbyte *writable_str = alloca_array (Ascbyte, 10);
 	    sprintf (writable_str, "-%d", f->order_count);
 	    str = writable_str;
 	  }
@@ -7386,7 +7422,7 @@
 	{
 	  /* This hard limit is ok since the string it will hold has a
 	     fixed maximum length of 3.  But just to be safe... */
-	  char buf[10];
+	  Ascbyte buf[10];
 	  Charcount chars = pos - BUF_BEGV (b);
 	  Charcount total = BUF_ZV (b) - BUF_BEGV (b);
 
@@ -7433,7 +7469,7 @@
 	{
 	  /* This hard limit is ok since the string it will hold has a
 	     fixed maximum length of around 6.  But just to be safe... */
-	  char buf[10];
+	  Ascbyte buf[10];
 	  Charcount chars = botpos - BUF_BEGV (b);
 	  Charcount total = BUF_ZV (b) - BUF_BEGV (b);
 
@@ -7590,8 +7626,8 @@
 {
   if (gba)
     {
-      glyph_block *gb = Dynarr_atp (gba, 0);
-      glyph_block *gb_last = Dynarr_atp (gba, Dynarr_length (gba));
+      glyph_block *gb = Dynarr_begin (gba);
+      glyph_block *gb_last = Dynarr_past_lastp (gba);
 
       for (; gb < gb_last; gb++)
 	{
@@ -7608,20 +7644,20 @@
 void
 mark_redisplay_structs (display_line_dynarr *dla)
 {
-  display_line *dl = Dynarr_atp (dla, 0);
-  display_line *dl_last = Dynarr_atp (dla, Dynarr_length (dla));
+  display_line *dl = Dynarr_begin (dla);
+  display_line *dl_last = Dynarr_past_lastp (dla);
 
   for (; dl < dl_last; dl++)
     {
       display_block_dynarr *dba = dl->display_blocks;
-      display_block *db = Dynarr_atp (dba, 0);
-      display_block *db_last = Dynarr_atp (dba, Dynarr_length (dba));
+      display_block *db = Dynarr_begin (dba);
+      display_block *db_last = Dynarr_past_lastp (dba);
 
       for (; db < db_last; db++)
 	{
 	  rune_dynarr *ra = db->runes;
-	  rune *r = Dynarr_atp (ra, 0);
-	  rune *r_last = Dynarr_atp (ra, Dynarr_length (ra));
+	  rune *r = Dynarr_begin (ra);
+	  rune *r_last = Dynarr_past_lastp (ra);
 
 	  for (; r < r_last; r++)
 	    {
@@ -7725,7 +7761,7 @@
   if (!Dynarr_length (cache))
     return -1;
   else
-    return Dynarr_atp (cache, 0)->start;
+    return Dynarr_begin (cache)->start;
 }
 
 /* Return the very last buffer position contained in the given
@@ -7740,7 +7776,7 @@
   if (!Dynarr_length (cache))
     return -1;
   else
-    return Dynarr_atp (cache, Dynarr_length (cache) - 1)->end;
+    return Dynarr_lastp (cache)->end;
 }
 
 /* Return the index of the line POINT is contained within in window
@@ -8220,7 +8256,7 @@
 	     on that assert.  So we have no option but to continue the
 	     search if we found point at the top of the line_start_cache
 	     again. */
-	  cur_pos = Dynarr_atp (w->line_start_cache,0)->start;
+	  cur_pos = Dynarr_begin (w->line_start_cache)->start;
 	}
       prev_pos = cur_pos;
     }
@@ -8377,9 +8413,8 @@
 	  return;
 	}
 
-      start = Dynarr_atp (internal_cache, 0)->start;
-      end =
-	Dynarr_atp (internal_cache, Dynarr_length (internal_cache) - 1)->end;
+      start = Dynarr_begin (internal_cache)->start;
+      end = Dynarr_lastp (internal_cache)->end;
 
       /* We aren't allowed to generate additional information to fill in
 	 gaps, so if the DESIRED structs don't overlap the cache, reset the
@@ -8398,7 +8433,7 @@
 
       if (!Dynarr_length (cache))
 	{
-	  Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
+	  Dynarr_add_many (cache, Dynarr_begin (internal_cache),
 			   Dynarr_length (internal_cache));
 	  w->line_cache_validation_override--;
 	  return;
@@ -8428,13 +8463,13 @@
 	  if (!(ic_elt >= 0))
 	    {
 	      Dynarr_reset (cache);
-	      Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
+	      Dynarr_add_many (cache, Dynarr_begin (internal_cache),
 			       Dynarr_length (internal_cache));
 	      w->line_cache_validation_override--;
 	      return;
 	    }
 
-	  Dynarr_insert_many_at_start (cache, Dynarr_atp (internal_cache, 0),
+	  Dynarr_insert_many_at_start (cache, Dynarr_begin (internal_cache),
 			      ic_elt + 1);
 	}
 
@@ -8453,7 +8488,7 @@
 	  if (!(ic_elt < Dynarr_length (internal_cache)))
 	    {
 	      Dynarr_reset (cache);
-	      Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
+	      Dynarr_add_many (cache, Dynarr_begin (internal_cache),
 			       Dynarr_length (internal_cache));
 	      w->line_cache_validation_override--;
 	      return;
@@ -8485,7 +8520,7 @@
 	     to layout a single line. This is not possible since we
 	     force at least a single line to be layout for CMOTION_DISP */
 	  assert (Dynarr_length (internal_cache));
-	  assert (startp == Dynarr_atp (internal_cache, 0)->start);
+	  assert (startp == Dynarr_begin (internal_cache)->start);
 
 	  ic_elt = Dynarr_length (internal_cache) - 1;
 	  if (low_bound != -1)
@@ -8520,7 +8555,7 @@
 
 	  if (ic_elt >= 0)       /* we still have lines to add.. */
 	    {
-	      Dynarr_insert_many (cache, Dynarr_atp (internal_cache, 0),
+	      Dynarr_insert_many (cache, Dynarr_begin (internal_cache),
 				  ic_elt + 1, marker);
 	      marker += (ic_elt + 1);
 	    }
@@ -8541,11 +8576,11 @@
 
   /* Readjust the high_bound to account for any changes made while
      correcting the low_bound. */
-  high_bound = Dynarr_atp (cache, Dynarr_length (cache) - 1)->end;
+  high_bound = Dynarr_lastp (cache)->end;
 
   if (to > high_bound)
     {
-      Charbpos startp = Dynarr_atp (cache, Dynarr_length (cache) - 1)->end + 1;
+      Charbpos startp = Dynarr_lastp (cache)->end + 1;
 
       do
 	{
@@ -8555,9 +8590,9 @@
 	  /* See comment above about regenerate_window failing. */
 	  assert (Dynarr_length (internal_cache));
 
-	  Dynarr_add_many (cache, Dynarr_atp (internal_cache, 0),
+	  Dynarr_add_many (cache, Dynarr_begin (internal_cache),
 			   Dynarr_length (internal_cache));
-	  high_bound = Dynarr_atp (cache, Dynarr_length (cache) - 1)->end;
+	  high_bound = Dynarr_lastp (cache)->end;
 	  startp = high_bound + 1;
 	}
       while (to > high_bound);
@@ -8600,7 +8635,7 @@
   modeline = 0;
   if (num_disp_lines)
     {
-      if (Dynarr_atp (dla, 0)->modeline)
+      if (Dynarr_begin (dla)->modeline)
 	{
 	  num_disp_lines--;
 	  modeline = 1;
@@ -8647,7 +8682,7 @@
 
       if (Dynarr_length (dla))
 	{
-	  struct display_line *dl = Dynarr_atp (dla, Dynarr_length (dla) - 1);
+	  struct display_line *dl = Dynarr_lastp (dla);
 	  *pix_y = dl->ypos + dl->descent - dl->clip;
 	}
       else
@@ -9057,20 +9092,16 @@
 		  if (x_check <= left_bound)
 		    {
 		      if (dl->modeline)
-			*modeline_closest = Dynarr_atp (db->runes, 0)->charpos;
+			*modeline_closest = Dynarr_begin (db->runes)->charpos;
 		      else
-			*closest = Dynarr_atp (db->runes, 0)->charpos;
+			*closest = Dynarr_begin (db->runes)->charpos;
 		    }
 		  else
 		    {
 		      if (dl->modeline)
-			*modeline_closest =
-			  Dynarr_atp (db->runes,
-				      Dynarr_length (db->runes) - 1)->charpos;
+			*modeline_closest = Dynarr_lastp (db->runes)->charpos;
 		      else
-			*closest =
-			  Dynarr_atp (db->runes,
-				      Dynarr_length (db->runes) - 1)->charpos;
+			*closest = Dynarr_lastp (db->runes)->charpos;
 		    }
 
 		  if (dl->modeline)
@@ -9841,7 +9872,7 @@
 void
 vars_of_redisplay (void)
 {
-  QSin_redisplay = build_msg_string ("(in redisplay)");
+  QSin_redisplay = build_defer_string ("(in redisplay)");
   staticpro (&QSin_redisplay);
 
   Vpost_redisplay_actions = Qnil;
--- a/src/redisplay.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/redisplay.h	Wed Feb 24 01:58:04 2010 -0600
@@ -719,14 +719,9 @@
 /*************************************************************************/
 EXFUN (Fredraw_frame, 2);
 
-int redisplay_text_width_string (struct window *w, int findex,
+int redisplay_text_width_string (Lisp_Object domain, Lisp_Object face,
 				 Ibyte *nonreloc, Lisp_Object reloc,
 				 Bytecount offset, Bytecount len);
-int redisplay_frame_text_width_string (struct frame *f,
-				       Lisp_Object face,
-				       Ibyte *nonreloc,
-				       Lisp_Object reloc,
-				       Bytecount offset, Bytecount len);
 int redisplay_frame (struct frame *f, int preemption_check);
 void redisplay_no_pre_idle_hook (void);
 void redisplay (void);
--- a/src/regex.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/regex.c	Wed Feb 24 01:58:04 2010 -0600
@@ -257,7 +257,7 @@
 #define ALLOCA alloca
 #define xmalloc malloc
 #define xrealloc realloc
-#define xfree(x,type) free (x)
+#define xfree free
 #endif
 
 #ifdef emacs
@@ -363,7 +363,7 @@
 
 #define REGEX_ALLOCATE_STACK xmalloc
 #define REGEX_REALLOCATE_STACK(source, osize, nsize) xrealloc (source, nsize)
-#define REGEX_FREE_STACK(arg) xfree (arg, fail_stack_elt_t *)
+#define REGEX_FREE_STACK(arg) xfree (arg)
 
 #else /* not REGEX_MALLOC */
 
@@ -2096,7 +2096,7 @@
 #define FREE_STACK_RETURN(value)			\
 do							\
 {							\
-  xfree (compile_stack.stack, compile_stack_elt_t *);	\
+  xfree (compile_stack.stack);	\
   return value;						\
 } while (0)
 
@@ -3399,7 +3399,7 @@
   if (syntax & RE_NO_POSIX_BACKTRACKING)
     BUF_PUSH (succeed);
 
-  xfree (compile_stack.stack, compile_stack_elt_t *);
+  xfree (compile_stack.stack);
 
   /* We have succeeded; set the length of the buffer.  */
   bufp->used = buf_end - bufp->buffer;
@@ -3841,6 +3841,7 @@
 	  {
 	    int nentries;
 	    int i;
+	    int smallest_prev = 0;
 
 	    nentries = unified_range_table_nentries (p);
 	    for (i = 0; i < nentries; i++)
@@ -3848,7 +3849,6 @@
 		EMACS_INT first, last;
 		Lisp_Object dummy_val;
 		int jj;
-		int smallest_prev = 0;
 
 		unified_range_table_get_range (p, i, &first, &last,
 					       &dummy_val);
@@ -3858,6 +3858,11 @@
 		if (smallest_prev >= 0x80)
 		  break;
 	      }
+
+	    /* Also set lead bytes after the end */
+	    for (i = smallest_prev; i < 0x80; i++)
+	      fastmap[i] = 1;
+
 	    /* Calculating which leading bytes are actually allowed
 	       here is rather difficult, so we just punt and allow
 	       all of them. */
@@ -6945,8 +6950,8 @@
         }
 
       /* If we needed the temporary register info, free the space now.  */
-      xfree (regs.start, regoff_t *);
-      xfree (regs.end, regoff_t *);
+      xfree (regs.start);
+      xfree (regs.end);
     }
 
   /* We want zero return to mean success, unlike `re_search'.  */
@@ -6998,19 +7003,19 @@
 regfree (regex_t *preg)
 {
   if (preg->buffer != NULL)
-    xfree (preg->buffer, unsigned char *);
+    xfree (preg->buffer);
   preg->buffer = NULL;
 
   preg->allocated = 0;
   preg->used = 0;
 
   if (preg->fastmap != NULL)
-    xfree (preg->fastmap, char *);
+    xfree (preg->fastmap);
   preg->fastmap = NULL;
   preg->fastmap_accurate = 0;
 
   if (preg->translate != NULL)
-    xfree (preg->translate, RE_TRANSLATE_TYPE);
+    xfree (preg->translate);
   preg->translate = NULL;
 }
 
--- a/src/s/cygwin.sc	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/* Default linker script, for normal executables */
-OUTPUT_FORMAT(pei-i386)
-SEARCH_DIR("/usr/i686-pc-cygwin/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/lib/w32api");
-ENTRY(_mainCRTStartup)
-SECTIONS
-{
-  .text  __image_base__ + __section_alignment__  :
-  {
-     *(.init)
-    *(.text)
-    *(SORT(.text$*))
-    *(.glue_7t)
-    *(.glue_7)
-     ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
-			LONG (-1); *(SORT(.ctors.*)); *(.ctors); *(.ctor); LONG (0);
-     ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
-			LONG (-1); *(SORT(.dtors.*)); *(.dtors); *(.dtor);  LONG (0);
-     *(.fini)
-    /* ??? Why is .gcc_exc here?  */
-     *(.gcc_exc)
-     etext = .;
-    *(.gcc_except_table)
-  }
-  /* The Cygwin32 library uses a section to avoid copying certain data
-     on fork.  This used to be named ".data".  The linker used
-     to include this between __data_start__ and __data_end__, but that
-     breaks building the cygwin32 dll.  Instead, we name the section
-     ".data_cygwin_nocopy" and explictly include it after __data_end__. */
-  .data BLOCK(__section_alignment__) :
-  {
-    __data_start__ = . ;
-    *(.data)
-    *(.data2)
-    *(SORT(.data$*))
-    __data_end__ = . ;
-    *(.data_cygwin_nocopy)
-  }
-  .bss BLOCK(__section_alignment__) :
-  {
-    __bss_start__ = . ;
-    *(.bss)
-    *(COMMON)
-    __bss_end__ = . ;
-  }
-  .rdata BLOCK(__section_alignment__) :
-  {
-    *(.rdata)
-    *(SORT(.rdata$*))
-    *(.eh_frame)
-    ___RUNTIME_PSEUDO_RELOC_LIST__ = .;
-    __RUNTIME_PSEUDO_RELOC_LIST__ = .;
-    *(.rdata_runtime_pseudo_reloc)
-    ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
-    __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
-  }
-  .pdata BLOCK(__section_alignment__) :
-  {
-    *(.pdata)
-  }
-  .edata BLOCK(__section_alignment__) :
-  {
-    *(.edata)
-  }
-  /DISCARD/ :
-  {
-    *(.debug$S)
-    *(.debug$T)
-    *(.debug$F)
-    *(.drectve)
-  }
-  .idata BLOCK(__section_alignment__) :
-  {
-    /* This cannot currently be handled with grouped sections.
-	See pe.em:sort_sections.  */
-    SORT(*)(.idata$2)
-    SORT(*)(.idata$3)
-    /* These zeroes mark the end of the import list.  */
-    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
-    SORT(*)(.idata$4)
-    SORT(*)(.idata$5)
-    SORT(*)(.idata$6)
-    SORT(*)(.idata$7)
-  }
-  .CRT BLOCK(__section_alignment__) :
-  {
-    *(SORT(.CRT$*))
-  }
-  .endjunk BLOCK(__section_alignment__) :
-  {
-    /* end is deprecated, don't use it */
-     end = .;
-     _end = .;
-     __end__ = .;
-  }
-  .rsrc BLOCK(__section_alignment__) :
-  {
-    *(.rsrc)
-    *(SORT(.rsrc$*))
-  }
-  .reloc BLOCK(__section_alignment__) :
-  {
-    *(.reloc)
-  }
-  .stab BLOCK(__section_alignment__) (NOLOAD) :
-  {
-    [ .stab ]
-  }
-  .stabstr BLOCK(__section_alignment__) (NOLOAD) :
-  {
-    [ .stabstr ]
-  }
-}
--- a/src/s/cygwin32.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/s/cygwin32.h	Wed Feb 24 01:58:04 2010 -0600
@@ -47,6 +47,9 @@
 /* Identify ourselves */
 #define CYGWIN
 
+/* We are using Cygwin-style headers in /usr/include, also used by MinGW */
+#define CYGWIN_HEADERS
+
 /* cheesy way to determine cygwin version */
 #ifndef NOT_C_CODE
 # include <signal.h>
@@ -74,7 +77,6 @@
 #define TEXT_START -1
 #define HEAP_IN_DATA
 #define NO_LIM_DATA
-#define UNEXEC "unexcw.o"
 
 #define BROKEN_SIGIO
 
--- a/src/s/hpux11-shr.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/s/hpux11-shr.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,24 @@
-/* Synched up with: FSF 19.31. */
+/* For building XEmacs under HPUX 11.0 with dynamic libraries.
+   Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
 
-/* For building XEmacs under HPUX 11.0 with dynamic libraries. */
+XEmacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* Synched up with: FSF 19.31. */
 
 #define ORDINARY_LINK
 
--- a/src/s/mach-bsd4-3.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/s/mach-bsd4-3.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,23 @@
+/* Definitions file for XEmacs running on Mach (BSD 4.3)
+   Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
 /* Synched up with: FSF 19.31. */
 
 /* I don't care if this doesn't do more than including bsd4-3.h;
--- a/src/s/mingw32.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/s/mingw32.h	Wed Feb 24 01:58:04 2010 -0600
@@ -27,6 +27,10 @@
 
 #define MINGW
 
+/* We are using Cygwin-style headers in /usr/include, also used by
+   Cygwin itself */
+#define CYGWIN_HEADERS
+
 #ifndef ORDINARY_LINK
 #define ORDINARY_LINK
 #endif
--- a/src/s/sco7.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/s/sco7.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,24 @@
-/* Synched up with: FSF 19.31. */
+/* Definitions file for XEmacs running on SCO System V release 4.2
+   Copyright (C) 1999 Ron Record
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
 
-/* s/ file for System V release 4.2.  */
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin St. - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* Synched up with: FSF 19.31. */
 
 #include "usg5-4.h"
 
--- a/src/scrollbar-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/scrollbar-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -64,7 +64,7 @@
 	  gtk_widget_destroy (SCROLLBAR_GTK_WIDGET (instance));
 	}
 
-      xfree (instance->scrollbar_data, void *);
+      xfree (instance->scrollbar_data);
     }
 }
 
--- a/src/scrollbar-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/scrollbar-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -84,7 +84,7 @@
   Fputhash (ptr, wrap_scrollbar_instance (sb),
 	    Vmswindows_scrollbar_instance_table);
   qxeSetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_USERDATA,
-		 (LONG) LISP_TO_VOID (ptr));
+		 (LONG) STORE_LISP_IN_VOID (ptr));
 }
 
 static void
@@ -96,12 +96,12 @@
 	(void *) qxeGetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_USERDATA);
       Lisp_Object ptr;
 
-      ptr = VOID_TO_LISP (opaque);
+      ptr = GET_LISP_FROM_VOID (opaque);
       assert (OPAQUE_PTRP (ptr));
       ptr = Fremhash (ptr, Vmswindows_scrollbar_instance_table);
       assert (!NILP (ptr));
       DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
-      xfree (sb->scrollbar_data, void *);
+      xfree (sb->scrollbar_data);
     }
 }
 
@@ -223,7 +223,7 @@
   else
     {
       Lisp_Object ptr;
-      ptr = VOID_TO_LISP (v);
+      ptr = GET_LISP_FROM_VOID (v);
       assert (OPAQUE_PTRP (ptr));
       ptr = Fgethash (ptr, Vmswindows_scrollbar_instance_table, Qnil);
       sb = XSCROLLBAR_INSTANCE (ptr);
--- a/src/scrollbar-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/scrollbar-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -75,7 +75,7 @@
   if (instance->scrollbar_data)
     {
       if (SCROLLBAR_X_NAME (instance))
-	xfree (SCROLLBAR_X_NAME (instance), char *);
+	xfree (SCROLLBAR_X_NAME (instance));
 
       if (SCROLLBAR_X_WIDGET (instance))
 	{
@@ -85,7 +85,7 @@
 	  lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
 	}
 
-      xfree (instance->scrollbar_data, void *);
+      xfree (instance->scrollbar_data);
     }
 }
 
--- a/src/search.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/search.c	Wed Feb 24 01:58:04 2010 -0600
@@ -184,7 +184,7 @@
   re_set_syntax (old);
   if (val)
     {
-      maybe_signal_error (Qinvalid_regexp, 0, build_string (val),
+      maybe_signal_error (Qinvalid_regexp, 0, build_cistring (val),
 			  Qsearch, errb);
       return 0;
     }
@@ -1425,6 +1425,37 @@
                           break;
                         }
                     }
+
+		  if (ichar_len (c) > 2)
+		    {
+		      /* Case-equivalence plus repeated octets throws off
+			 the construction of the stride table; avoid this.
+
+		         It should be possible to correct boyer_moore to
+		         behave correctly even in this case--it doesn't have
+		         problems with repeated octets when case conversion
+		         is not involved--but this is not a critical
+		         issue. */
+		      Ibyte encoded[MAX_ICHAR_LEN];
+		      Bytecount clen = set_itext_ichar (encoded, c);
+		      int a, b;
+		      for (a = 0; a < clen && boyer_moore_ok; ++a)
+			{
+			  for (b = a + 1; b < clen && boyer_moore_ok; ++b)
+			    {
+			      if (encoded[a] == encoded[b])
+				{
+				  boyer_moore_ok = 0;
+				}
+			    }
+			}
+
+		      if (0 == boyer_moore_ok)
+			{
+			  break;
+			}
+		    }
+			  
                 } while (c != starting_c);
 
               if (!checked)
@@ -1779,7 +1810,8 @@
       if (!NILP (trt))
 	{
 #ifdef MULE
-	  Ichar ch, untranslated;
+	  Ichar ch = -1, untranslated;
+	  Ibyte byte;
 	  int this_translated = 1;
 
 	  /* Is *PTR the last byte of a character?  */
@@ -1829,16 +1861,23 @@
                      for charset_base.) */
                   assert (1 == count || starting_ch != ch);
 		}
+	      {
+		Ibyte tmp[MAX_ICHAR_LEN];
+		Bytecount chlen;
+
+		chlen = set_itext_ichar (tmp, ch);
+		byte = tmp[chlen - 1];
+	      }
 	    }
 	  else
 	    {
-	      ch = *ptr;
+	      byte = *ptr;
 	      this_translated = 0;
+	      ch = -1;
 	    }
-	  if (ch > 0400)
-	    j = ((unsigned char) ch | 0200);
-	  else
-	    j = (unsigned char) ch;
+
+	  /* BYTE = last byte of character CH when represented as text */
+	  j = byte;
 	      
 	  if (i == infinity)
 	    stride_for_teases = BM_tab[j];
@@ -1849,6 +1888,8 @@
 	    {
 	      Ichar starting_ch = ch;
 	      EMACS_INT starting_j = j;
+
+	      text_checking_assert (valid_ichar_p (ch));
 	      do
 		{
 		  ch = TRANSLATE (inverse_trt, ch);
@@ -1859,20 +1900,27 @@
                   if (ch > 0xFF && buffer_nothing_greater_than_0xff)
                     continue;
 
-                  if (ch > 0400)
-                    j = ((unsigned char) ch | 0200);
-                  else
-                    j = (unsigned char) ch;
-
+
+		  /* Retrieve last byte of character CH when represented as
+		     text */
+		  {
+		    Ibyte tmp[MAX_ICHAR_LEN];
+		    Bytecount chlen;
+
+		    chlen = set_itext_ichar (tmp, ch);
+		    j = tmp[chlen - 1];
+		  }
+	      
                   /* For all the characters that map into CH, set up
                      simple_translate to map the last byte into
                      STARTING_J.  */
                   simple_translate[j] = (Ibyte) starting_j;
                   BM_tab[j] = dirlen - i;
 
-		} while (ch != starting_ch);
+		}
+	      while (ch != starting_ch);
 	    }
-#else
+#else /* not MULE */
 	  EMACS_INT k;
 	  j = *ptr;
 	  k = (j = TRANSLATE (trt, j));
@@ -1886,7 +1934,7 @@
 	      simple_translate[j] = (Ibyte) k;
 	      BM_tab[j] = dirlen - i;
 	    }
-#endif
+#endif /* (not) MULE */
 	}
       else
 	{
@@ -2199,7 +2247,7 @@
       }
   if (WORD_SYNTAX_P (syntax_table, string_ichar (string, len - 1)))
     word_count++;
-  if (!word_count) return build_string ("");
+  if (!word_count) return build_ascstring ("");
 
   {
     /* The following value is an upper bound on the amount of storage we
@@ -2857,7 +2905,7 @@
 
       /* replacement can be nil. */
       if (NILP (replacement))
-	replacement = build_string ("");
+	replacement = build_ascstring ("");
 
       if (case_action == all_caps)
 	replacement = Fupcase (replacement, buffer);
--- a/src/select-common.h	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,343 +0,0 @@
-/* Selection processing for XEmacs -- common btwn select-x.c and select-gtk.c
-   Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not synched with FSF. */
-
-#ifdef PROCESSING_X_CODE
-#define XE_ATOM_TYPE Atom
-#define XE_ATOM_TO_SYMBOL x_atom_to_symbol
-#define XE_SYMBOL_TO_ATOM symbol_to_x_atom
-#else
-#define XE_ATOM_TYPE GdkAtom
-#define XE_ATOM_TO_SYMBOL atom_to_symbol
-#define XE_SYMBOL_TO_ATOM symbol_to_gtk_atom
-#endif /* PROCESSING_X_CODE */
-
-/* #### These are going to move into Lisp code(!) with the aid of
-        some new functions I'm working on - ajh */
-
-/* These functions convert from the selection data read from the server into
-   something that we can use from elisp, and vice versa.
-
-	Type:	Format:	Size:		Elisp Type:
-	-----	-------	-----		-----------
-	*	8	*		String
-	ATOM	32	1		Symbol
-	ATOM	32	> 1		Vector of Symbols
-	*	16	1		Integer
-	*	16	> 1		Vector of Integers
-	*	32	1		if <=16 bits: Integer
-					if > 16 bits: Cons of top16, bot16
-	*	32	> 1		Vector of the above
-
-   NOTE NOTE NOTE:
-   Format == 32 means that the buffer will be C longs, which need not be
-   32-bit quantities.  See the note in select-x.c (x_get_window_property).
-
-   When converting a Lisp number to C, it is assumed to be of format 16 if
-   it is an integer, and of format 32 if it is a cons of two integers.
-
-   When converting a vector of numbers from Elisp to C, it is assumed to be
-   of format 16 if every element in the vector is an integer, and is assumed
-   to be of format 32 if any element is a cons of two integers.
-
-   When converting an object to C, it may be of the form (SYMBOL . <data>)
-   where SYMBOL is what we should claim that the type is.  Format and
-   representation are as above.
-
-   NOTE: Under Mule, when someone shoves us a string without a type, we
-   set the type to `COMPOUND_TEXT' and automatically convert to Compound
-   Text.  If the string has a type, we assume that the user wants the
-   data sent as-is so we just do "binary" conversion.
- */
-
-
-static Lisp_Object
-selection_data_to_lisp_data (struct device *d,
-			     Rawbyte *data,
-			     Bytecount size,
-			     XE_ATOM_TYPE type,
-			     int format)
-{
-#ifdef PROCESSING_X_CODE
-  if (type == DEVICE_XATOM_NULL (d))
-    return QNULL;
-
-  /* Convert any 8-bit data to a string, for compactness. */
-  else if (format == 8)
-    return make_ext_string ((Extbyte *) data, size,
-			    type == DEVICE_XATOM_TEXT (d) ||
-			    type == DEVICE_XATOM_COMPOUND_TEXT (d)
-			    ? Qctext : Qbinary);
-
-  /* Convert a single atom to a Lisp Symbol.
-     Convert a set of atoms to a vector of symbols. */
-  else if (type == XA_ATOM)
-#else
-  if (type == gdk_atom_intern ("NULL", 0))
-    return QNULL;
-
-  /* Convert any 8-bit data to a string, for compactness. */
-  else if (format == 8)
-    return make_ext_string ((Extbyte *) data, size,
-			    ((type == gdk_atom_intern ("TEXT", FALSE)) ||
-			     (type == gdk_atom_intern ("COMPOUND_TEXT", FALSE)))
-			    ? Qctext : Qbinary);
-
-  /* Convert a single atom to a Lisp Symbol.
-     Convert a set of atoms to a vector of symbols. */
-  else if (type == gdk_atom_intern ("ATOM", FALSE))
-#endif /* PROCESSING_X_CODE */
-    {
-      if (size == sizeof (XE_ATOM_TYPE))
-	return XE_ATOM_TO_SYMBOL (d, *((XE_ATOM_TYPE *) data));
-      else
-	{
-	  Elemcount i;
-	  Elemcount len = size / sizeof (XE_ATOM_TYPE);
-	  Lisp_Object v = Fmake_vector (make_int (len), Qzero);
-	  for (i = 0; i < len; i++)
-	    Faset (v, make_int (i), XE_ATOM_TO_SYMBOL (d, ((XE_ATOM_TYPE *) data) [i]));
-	  return v;
-	}
-    }
-
-  /* Convert a single 16 or small 32 bit number to a Lisp Int.
-     If the number is > 16 bits, convert it to a cons of integers,
-     16 bits in each half.
-   */
-  else if (format == 32 && size == sizeof (long))
-    return word_to_lisp (((unsigned long *) data) [0]);
-  else if (format == 16 && size == sizeof (short))
-    return make_int ((int) (((unsigned short *) data) [0]));
-
-  /* Convert any other kind of data to a vector of numbers, represented
-     as above (as an integer, or a cons of two 16 bit integers).
-
-     #### Perhaps we should return the actual type to lisp as well.
-
-	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
-	==> [4 4]
-
-     and perhaps it should be
-
-	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
-	==> (SPAN . [4 4])
-
-     Right now the fact that the return type was SPAN is discarded before
-     lisp code gets to see it.
-   */
-  else if (format == 16)
-    {
-      Elemcount i;
-      Lisp_Object v = make_vector (size / 4, Qzero);
-      for (i = 0; i < size / 4; i++)
-	{
-	  int j = (int) ((unsigned short *) data) [i];
-	  Faset (v, make_int (i), make_int (j));
-	}
-      return v;
-    }
-  else
-    {
-      Elemcount i;
-      Lisp_Object v = make_vector (size / 4, Qzero);
-      for (i = 0; i < size / 4; i++)
-	{
-	  unsigned long j = ((unsigned long *) data) [i];
-	  Faset (v, make_int (i), word_to_lisp (j));
-	}
-      return v;
-    }
-}
-
-
-static void
-lisp_data_to_selection_data (struct device *d,
-			     Lisp_Object obj,
-			     Rawbyte **data_ret,
-			     XE_ATOM_TYPE *type_ret,
-			     Bytecount *size_ret,
-			     int *format_ret)
-{
-  Lisp_Object type = Qnil;
-
-  if (CONSP (obj) && SYMBOLP (XCAR (obj)))
-    {
-      type = XCAR (obj);
-      obj = XCDR (obj);
-      if (CONSP (obj) && NILP (XCDR (obj)))
-	obj = XCAR (obj);
-    }
-
-  if (EQ (obj, QNULL) || (EQ (type, QNULL)))
-    {				/* This is not the same as declining */
-      *format_ret = 32;
-      *size_ret = 0;
-      *data_ret = 0;
-      type = QNULL;
-    }
-  else if (STRINGP (obj))
-    {
-      const Extbyte *extval;
-      Bytecount extvallen;
-
-      TO_EXTERNAL_FORMAT (LISP_STRING, obj,
-			  ALLOCA, (extval, extvallen),
-			  (NILP (type) ? Qctext : Qbinary));
-      *format_ret = 8;
-      *size_ret = extvallen;
-      *data_ret = xnew_rawbytes (*size_ret);
-      memcpy (*data_ret, extval, *size_ret);
-#ifdef MULE
-      if (NILP (type)) type = QCOMPOUND_TEXT;
-#else
-      if (NILP (type)) type = QSTRING;
-#endif
-    }
-  else if (CHARP (obj))
-    {
-      Ibyte buf[MAX_ICHAR_LEN];
-      Bytecount len;
-      const Extbyte *extval;
-      Bytecount extvallen;
-
-      *format_ret = 8;
-      len = set_itext_ichar (buf, XCHAR (obj));
-      TO_EXTERNAL_FORMAT (DATA, (buf, len),
-			  ALLOCA, (extval, extvallen),
-			  Qctext);
-      *size_ret = extvallen;
-      *data_ret = xnew_rawbytes (*size_ret);
-      memcpy (*data_ret, extval, *size_ret);
-#ifdef MULE
-      if (NILP (type)) type = QCOMPOUND_TEXT;
-#else
-      if (NILP (type)) type = QSTRING;
-#endif
-    }
-  else if (SYMBOLP (obj))
-    {
-      *format_ret = 32;
-      *size_ret = 1;
-      *data_ret = xnew_rawbytes (sizeof (XE_ATOM_TYPE) + 1);
-      (*data_ret) [sizeof (XE_ATOM_TYPE)] = 0;
-      (*(XE_ATOM_TYPE **) data_ret) [0] = XE_SYMBOL_TO_ATOM (d, obj, 0);
-      if (NILP (type)) type = QATOM;
-    }
-  else if (INTP (obj) &&
-	   XINT (obj) <= 0x7FFF &&
-	   XINT (obj) >= -0x8000)
-    {
-      *format_ret = 16;
-      *size_ret = 1;
-      *data_ret = xnew_rawbytes (sizeof (short) + 1);
-      (*data_ret) [sizeof (short)] = 0;
-      (*(short **) data_ret) [0] = (short) XINT (obj);
-      if (NILP (type)) type = QINTEGER;
-    }
-  else if (INTP (obj) || CONSP (obj))
-    {
-      *format_ret = 32;
-      *size_ret = 1;
-      *data_ret = xnew_rawbytes (sizeof (long) + 1);
-      (*data_ret) [sizeof (long)] = 0;
-      (*(unsigned long **) data_ret) [0] = lisp_to_word (obj);
-      if (NILP (type)) type = QINTEGER;
-    }
-  else if (VECTORP (obj))
-    {
-      /* Lisp Vectors may represent a set of ATOMs;
-	 a set of 16 or 32 bit INTEGERs;
-	 or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
-       */
-      Elemcount i;
-
-      if (SYMBOLP (XVECTOR_DATA (obj) [0]))
-	/* This vector is an ATOM set */
-	{
-	  if (NILP (type)) type = QATOM;
-	  *size_ret = XVECTOR_LENGTH (obj);
-	  *format_ret = 32;
-	  *data_ret = xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE));
-	  for (i = 0; i < *size_ret; i++)
-	    if (SYMBOLP (XVECTOR_DATA (obj) [i]))
-	      (*(XE_ATOM_TYPE **) data_ret) [i] =
-		XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (obj) [i], 0);
-	    else
-              syntax_error
-		("all elements of the vector must be of the same type", obj);
-	}
-#if 0 /* #### MULTIPLE doesn't work yet */
-      else if (VECTORP (XVECTOR_DATA (obj) [0]))
-	/* This vector is an ATOM_PAIR set */
-	{
-	  if (NILP (type)) type = QATOM_PAIR;
-	  *size_ret = XVECTOR_LENGTH (obj);
-	  *format_ret = 32;
-	  *data_ret =
-	    xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE) * 2);
-	  for (i = 0; i < *size_ret; i++)
-	    if (VECTORP (XVECTOR_DATA (obj) [i]))
-	      {
-		Lisp_Object pair = XVECTOR_DATA (obj) [i];
-		if (XVECTOR_LENGTH (pair) != 2)
-		  syntax_error
-		    ("elements of the vector must be vectors of exactly two elements", pair);
-
-		(*(XE_ATOM_TYPE **) data_ret) [i * 2] =
-		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [0], 0);
-		(*(XE_ATOM_TYPE **) data_ret) [(i * 2) + 1] =
-		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [1], 0);
-	      }
-	    else
-	      syntax_error
-		("all elements of the vector must be of the same type", obj);
-	}
-#endif
-      else
-	/* This vector is an INTEGER set, or something like it */
-	{
-	  *size_ret = XVECTOR_LENGTH (obj);
-	  if (NILP (type)) type = QINTEGER;
-	  *format_ret = 16;
-	  for (i = 0; i < *size_ret; i++)
-	    if (CONSP (XVECTOR_DATA (obj) [i]))
-	      *format_ret = 32;
-	    else if (!INTP (XVECTOR_DATA (obj) [i]))
-	      syntax_error
-		("all elements of the vector must be integers or conses of integers", obj);
-
-	  *data_ret = xnew_rawbytes (*size_ret * (*format_ret/8));
-	  for (i = 0; i < *size_ret; i++)
-	    if (*format_ret == 32)
-	      (*((unsigned long **) data_ret)) [i] =
-		lisp_to_word (XVECTOR_DATA (obj) [i]);
-	    else
-	      (*((unsigned short **) data_ret)) [i] =
-		(unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]);
-	}
-    }
-  else
-    invalid_argument ("unrecognized selection data", obj);
-
-  *type_ret = XE_SYMBOL_TO_ATOM (d, type, 0);
-}
-
--- a/src/select-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/select-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -59,7 +59,7 @@
 
   {
     const Extbyte *nameext;
-    LISP_STRING_TO_EXTERNAL (Fsymbol_name (sym), nameext, Qctext);
+    nameext = LISP_STRING_TO_EXTERNAL (Fsymbol_name (sym), Qctext);
     return gdk_atom_intern (nameext, only_if_exists ? TRUE : FALSE);
   }
 }
@@ -76,15 +76,15 @@
 
     if (! str) return Qnil;
 
-    EXTERNAL_TO_C_STRING (str, intstr, Qctext);
+    intstr = EXTERNAL_TO_ITEXT (str, Qctext);
     g_free (str);
-    return intern_int (intstr);
+    return intern_istring (intstr);
   }
 }
 
-#define PROCESSING_GTK_CODE
-#include "select-common.h"
-#undef PROCESSING_GTK_CODE
+#define THIS_IS_GTK
+#include "select-xlike-inc.c"
+#undef THIS_IS_GTK
 
 
 /* Set the selection data to GDK_NONE and NULL data, meaning we were
@@ -213,7 +213,7 @@
     successful_p = Qt;
     /* Tell x_selection_request_lisp_error() it's cool. */
     cl->successful = TRUE;
-    xfree (data, Rawbyte *);
+    xfree (data);
   }
 
   unbind_to (count);
@@ -221,7 +221,7 @@
  DONE_LABEL:
 
   if (cl)
-    xfree (cl, struct _selection_closure *);
+    xfree (cl);
 
   UNGCPRO;
 
--- a/src/select-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/select-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -109,7 +109,7 @@
   if (STRINGP (value))
     {
       Extbyte *valext;
-      LISP_STRING_TO_TSTR (value, valext);
+      valext = LISP_STRING_TO_TSTR (value);
       return qxeRegisterClipboardFormat (valext);
     }
 
@@ -324,7 +324,7 @@
     {
       CloseClipboard ();
 
-      xfree (src, void *);
+      xfree (src);
       return Qnil;
     }
 
@@ -335,12 +335,12 @@
       GlobalFree (hValue);
       CloseClipboard ();
 
-      xfree (src, void *);
+      xfree (src);
       return Qnil;
     }
 
   memcpy (dst, src, size);
-  xfree (src, void *);
+  xfree (src);
 
   GlobalUnlock (hValue);
 
@@ -438,7 +438,7 @@
   Extbyte *nameext;
   UINT format;
 
-  LISP_STRING_TO_TSTR (type_name, nameext);
+  nameext = LISP_STRING_TO_TSTR (type_name);
   format = qxeRegisterClipboardFormat (nameext);
 
   if (format)
@@ -561,7 +561,7 @@
     }
 
   /* Place it in a Lisp string */
-  ret = make_ext_string ((Extbyte *) data, size, Qbinary);
+  ret = make_extstring ((Extbyte *) data, size, Qbinary);
 
   GlobalUnlock (data);
   CloseClipboard ();
--- a/src/select-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/select-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -139,7 +139,7 @@
 
   {
     const Extbyte *nameext;
-    LISP_STRING_TO_EXTERNAL (Fsymbol_name (sym), nameext, Qctext);
+    nameext = LISP_STRING_TO_EXTERNAL (Fsymbol_name (sym), Qctext);
     return XInternAtom (display, nameext, only_if_exists ? True : False);
   }
 }
@@ -188,17 +188,15 @@
 
     if (! str) return Qnil;
 
-    TO_INTERNAL_FORMAT (C_STRING, str,
-			C_STRING_ALLOCA, intstr,
-			Qctext);
+    intstr = EXTERNAL_TO_ITEXT (str, Qctext);
     XFree (str);
-    return intern_int (intstr);
+    return intern_istring (intstr);
   }
 }
 
-#define PROCESSING_X_CODE
-#include "select-common.h"
-#undef PROCESSING_X_CODE
+#define THIS_IS_X
+#include "select-xlike-inc.c"
+#undef THIS_IS_X
 
 /* Do protocol to assert ourself as a selection owner.
  */
@@ -339,14 +337,12 @@
 	  }
 
 	if (chartypes == LATIN_1)
-	  TO_EXTERNAL_FORMAT (LISP_STRING, selection_value,
-			      ALLOCA, (data, bytes),
-			      Qbinary);
+	  LISP_STRING_TO_SIZED_EXTERNAL (selection_value, data, bytes,
+					 Qbinary);
 	else if (chartypes == WORLD)
 	  {
-	    TO_EXTERNAL_FORMAT (LISP_STRING, selection_value,
-				ALLOCA, (data, bytes),
-				Qctext);
+	    LISP_STRING_TO_SIZED_EXTERNAL (selection_value, data, bytes,
+					   Qctext);
 	    encoding = "COMPOUND_TEXT";
 	  }
       }
@@ -697,7 +693,7 @@
        lisp/select.el . */
     if ((Rawbyte *)0 != data)
     {
-      xfree (data, Rawbyte *);
+      xfree (data);
     }
   }
 
@@ -827,7 +823,7 @@
 	    prev->next = rest->next;
 	  else
 	    for_whom_the_bell_tolls = rest->next;
-	  xfree (rest, struct prop_location *);
+	  xfree (rest);
 	  return;
 	}
       prev = rest;
@@ -868,7 +864,7 @@
 	    prev->next = rest->next;
 	  else
 	    for_whom_the_bell_tolls = rest->next;
-	  xfree (rest, struct prop_location *);
+	  xfree (rest);
 	  return;
 	}
       prev = rest;
@@ -1171,7 +1167,7 @@
 #endif
 	  unexpect_property_change (prop_id);
 	  if (tmp_data)
-	    xfree (tmp_data, Rawbyte *);
+	    xfree (tmp_data);
 	  break;
 	}
 #if 0
@@ -1188,7 +1184,7 @@
 	}
       memcpy ((*data_ret) + offset, tmp_data, tmp_size_bytes);
       offset += tmp_size_bytes;
-      xfree (tmp_data, Rawbyte *);
+      xfree (tmp_data);
     }
 }
 
@@ -1237,7 +1233,7 @@
       Bytecount min_size_bytes =
 	/* careful here. */
 	(Bytecount) (* ((unsigned int *) data));
-      xfree (data, Rawbyte *);
+      xfree (data);
       receive_incremental_selection (display, window, property, target_type,
 				     min_size_bytes, &data, &bytes,
 				     &actual_type, &actual_format,
@@ -1249,7 +1245,7 @@
   val = selection_data_to_lisp_data (d, data, bytes,
 				     actual_type, actual_format);
 
-  xfree (data, Rawbyte *);
+  xfree (data);
   return val;
 }
 
@@ -1377,11 +1373,11 @@
      COMPOUND_TEXT that we stored there ourselves earlier,
      in x-store-cutbuffer-internal  */
   ret = (bytes ?
-	 make_ext_string ((Extbyte *) data, bytes,
+	 make_extstring ((Extbyte *) data, bytes,
 			  memchr (data, 0x1b, bytes) ?
 			  Qctext : Qbinary)
 	 : Qnil);
-  xfree (data, Rawbyte *);
+  xfree (data);
   return ret;
 }
 
@@ -1442,13 +1438,9 @@
     }
 
   if (chartypes == LATIN_1)
-    TO_EXTERNAL_FORMAT (LISP_STRING, string,
-			ALLOCA, (data, bytes),
-			Qbinary);
+    LISP_STRING_TO_SIZED_EXTERNAL (string, data, bytes, Qbinary);
   else if (chartypes == WORLD)
-    TO_EXTERNAL_FORMAT (LISP_STRING, string,
-			ALLOCA, (data, bytes),
-			Qctext);
+    LISP_STRING_TO_SIZED_EXTERNAL (string, data, bytes, Qctext);
 #endif /* MULE */
 
   bytes_remaining = bytes;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/select-xlike-inc.c	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,342 @@
+/* Selection processing for XEmacs -- common btwn select-x.c and select-gtk.c
+   Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not synched with FSF. */
+
+#ifdef THIS_IS_X
+#define XE_ATOM_TYPE Atom
+#define XE_ATOM_TO_SYMBOL x_atom_to_symbol
+#define XE_SYMBOL_TO_ATOM symbol_to_x_atom
+#else
+#define XE_ATOM_TYPE GdkAtom
+#define XE_ATOM_TO_SYMBOL atom_to_symbol
+#define XE_SYMBOL_TO_ATOM symbol_to_gtk_atom
+#endif /* THIS_IS_X */
+
+/* #### These are going to move into Lisp code(!) with the aid of
+        some new functions I'm working on - ajh */
+
+/* These functions convert from the selection data read from the server into
+   something that we can use from elisp, and vice versa.
+
+	Type:	Format:	Size:		Elisp Type:
+	-----	-------	-----		-----------
+	*	8	*		String
+	ATOM	32	1		Symbol
+	ATOM	32	> 1		Vector of Symbols
+	*	16	1		Integer
+	*	16	> 1		Vector of Integers
+	*	32	1		if <=16 bits: Integer
+					if > 16 bits: Cons of top16, bot16
+	*	32	> 1		Vector of the above
+
+   NOTE NOTE NOTE:
+   Format == 32 means that the buffer will be C longs, which need not be
+   32-bit quantities.  See the note in select-x.c (x_get_window_property).
+
+   When converting a Lisp number to C, it is assumed to be of format 16 if
+   it is an integer, and of format 32 if it is a cons of two integers.
+
+   When converting a vector of numbers from Elisp to C, it is assumed to be
+   of format 16 if every element in the vector is an integer, and is assumed
+   to be of format 32 if any element is a cons of two integers.
+
+   When converting an object to C, it may be of the form (SYMBOL . <data>)
+   where SYMBOL is what we should claim that the type is.  Format and
+   representation are as above.
+
+   NOTE: Under Mule, when someone shoves us a string without a type, we
+   set the type to `COMPOUND_TEXT' and automatically convert to Compound
+   Text.  If the string has a type, we assume that the user wants the
+   data sent as-is so we just do "binary" conversion.
+ */
+
+
+static Lisp_Object
+selection_data_to_lisp_data (struct device *d,
+			     Rawbyte *data,
+			     Bytecount size,
+			     XE_ATOM_TYPE type,
+			     int format)
+{
+#ifdef THIS_IS_X
+  if (type == DEVICE_XATOM_NULL (d))
+    return QNULL;
+
+  /* Convert any 8-bit data to a string, for compactness. */
+  else if (format == 8)
+    return make_extstring ((Extbyte *) data, size,
+			    type == DEVICE_XATOM_TEXT (d) ||
+			    type == DEVICE_XATOM_COMPOUND_TEXT (d)
+			    ? Qctext : Qbinary);
+
+  /* Convert a single atom to a Lisp Symbol.
+     Convert a set of atoms to a vector of symbols. */
+  else if (type == XA_ATOM)
+#else
+  if (type == gdk_atom_intern ("NULL", 0))
+    return QNULL;
+
+  /* Convert any 8-bit data to a string, for compactness. */
+  else if (format == 8)
+    return make_extstring ((Extbyte *) data, size,
+			    ((type == gdk_atom_intern ("TEXT", FALSE)) ||
+			     (type == gdk_atom_intern ("COMPOUND_TEXT", FALSE)))
+			    ? Qctext : Qbinary);
+
+  /* Convert a single atom to a Lisp Symbol.
+     Convert a set of atoms to a vector of symbols. */
+  else if (type == gdk_atom_intern ("ATOM", FALSE))
+#endif /* THIS_IS_X */
+    {
+      if (size == sizeof (XE_ATOM_TYPE))
+	return XE_ATOM_TO_SYMBOL (d, *((XE_ATOM_TYPE *) data));
+      else
+	{
+	  Elemcount i;
+	  Elemcount len = size / sizeof (XE_ATOM_TYPE);
+	  Lisp_Object v = Fmake_vector (make_int (len), Qzero);
+	  for (i = 0; i < len; i++)
+	    Faset (v, make_int (i), XE_ATOM_TO_SYMBOL (d, ((XE_ATOM_TYPE *) data) [i]));
+	  return v;
+	}
+    }
+
+  /* Convert a single 16 or small 32 bit number to a Lisp Int.
+     If the number is > 16 bits, convert it to a cons of integers,
+     16 bits in each half.
+   */
+  else if (format == 32 && size == sizeof (long))
+    return word_to_lisp (((unsigned long *) data) [0]);
+  else if (format == 16 && size == sizeof (short))
+    return make_int ((int) (((unsigned short *) data) [0]));
+
+  /* Convert any other kind of data to a vector of numbers, represented
+     as above (as an integer, or a cons of two 16 bit integers).
+
+     #### Perhaps we should return the actual type to lisp as well.
+
+	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+	==> [4 4]
+
+     and perhaps it should be
+
+	(x-get-selection-internal 'PRIMARY 'LINE_NUMBER)
+	==> (SPAN . [4 4])
+
+     Right now the fact that the return type was SPAN is discarded before
+     lisp code gets to see it.
+   */
+  else if (format == 16)
+    {
+      Elemcount i;
+      Lisp_Object v = make_vector (size / 4, Qzero);
+      for (i = 0; i < size / 4; i++)
+	{
+	  int j = (int) ((unsigned short *) data) [i];
+	  Faset (v, make_int (i), make_int (j));
+	}
+      return v;
+    }
+  else
+    {
+      Elemcount i;
+      Lisp_Object v = make_vector (size / 4, Qzero);
+      for (i = 0; i < size / 4; i++)
+	{
+	  unsigned long j = ((unsigned long *) data) [i];
+	  Faset (v, make_int (i), word_to_lisp (j));
+	}
+      return v;
+    }
+}
+
+
+static void
+lisp_data_to_selection_data (struct device *d,
+			     Lisp_Object obj,
+			     Rawbyte **data_ret,
+			     XE_ATOM_TYPE *type_ret,
+			     Bytecount *size_ret,
+			     int *format_ret)
+{
+  Lisp_Object type = Qnil;
+
+  if (CONSP (obj) && SYMBOLP (XCAR (obj)))
+    {
+      type = XCAR (obj);
+      obj = XCDR (obj);
+      if (CONSP (obj) && NILP (XCDR (obj)))
+	obj = XCAR (obj);
+    }
+
+  if (EQ (obj, QNULL) || (EQ (type, QNULL)))
+    {				/* This is not the same as declining */
+      *format_ret = 32;
+      *size_ret = 0;
+      *data_ret = 0;
+      type = QNULL;
+    }
+  else if (STRINGP (obj))
+    {
+      const Extbyte *extval;
+      Bytecount extvallen;
+
+      LISP_STRING_TO_SIZED_EXTERNAL (obj, extval, extvallen,
+				     (NILP (type) ? Qctext : Qbinary));
+      *format_ret = 8;
+      *size_ret = extvallen;
+      *data_ret = xnew_rawbytes (*size_ret);
+      memcpy (*data_ret, extval, *size_ret);
+#ifdef MULE
+      if (NILP (type)) type = QCOMPOUND_TEXT;
+#else
+      if (NILP (type)) type = QSTRING;
+#endif
+    }
+  else if (CHARP (obj))
+    {
+      Ibyte buf[MAX_ICHAR_LEN];
+      Bytecount len;
+      const Extbyte *extval;
+      Bytecount extvallen;
+
+      *format_ret = 8;
+      len = set_itext_ichar (buf, XCHAR (obj));
+      TO_EXTERNAL_FORMAT (DATA, (buf, len),
+			  ALLOCA, (extval, extvallen),
+			  Qctext);
+      *size_ret = extvallen;
+      *data_ret = xnew_rawbytes (*size_ret);
+      memcpy (*data_ret, extval, *size_ret);
+#ifdef MULE
+      if (NILP (type)) type = QCOMPOUND_TEXT;
+#else
+      if (NILP (type)) type = QSTRING;
+#endif
+    }
+  else if (SYMBOLP (obj))
+    {
+      *format_ret = 32;
+      *size_ret = 1;
+      *data_ret = xnew_rawbytes (sizeof (XE_ATOM_TYPE) + 1);
+      (*data_ret) [sizeof (XE_ATOM_TYPE)] = 0;
+      (*(XE_ATOM_TYPE **) data_ret) [0] = XE_SYMBOL_TO_ATOM (d, obj, 0);
+      if (NILP (type)) type = QATOM;
+    }
+  else if (INTP (obj) &&
+	   XINT (obj) <= 0x7FFF &&
+	   XINT (obj) >= -0x8000)
+    {
+      *format_ret = 16;
+      *size_ret = 1;
+      *data_ret = xnew_rawbytes (sizeof (short) + 1);
+      (*data_ret) [sizeof (short)] = 0;
+      (*(short **) data_ret) [0] = (short) XINT (obj);
+      if (NILP (type)) type = QINTEGER;
+    }
+  else if (INTP (obj) || CONSP (obj))
+    {
+      *format_ret = 32;
+      *size_ret = 1;
+      *data_ret = xnew_rawbytes (sizeof (long) + 1);
+      (*data_ret) [sizeof (long)] = 0;
+      (*(unsigned long **) data_ret) [0] = lisp_to_word (obj);
+      if (NILP (type)) type = QINTEGER;
+    }
+  else if (VECTORP (obj))
+    {
+      /* Lisp Vectors may represent a set of ATOMs;
+	 a set of 16 or 32 bit INTEGERs;
+	 or a set of ATOM_PAIRs (represented as [[A1 A2] [A3 A4] ...]
+       */
+      Elemcount i;
+
+      if (SYMBOLP (XVECTOR_DATA (obj) [0]))
+	/* This vector is an ATOM set */
+	{
+	  if (NILP (type)) type = QATOM;
+	  *size_ret = XVECTOR_LENGTH (obj);
+	  *format_ret = 32;
+	  *data_ret = xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE));
+	  for (i = 0; i < *size_ret; i++)
+	    if (SYMBOLP (XVECTOR_DATA (obj) [i]))
+	      (*(XE_ATOM_TYPE **) data_ret) [i] =
+		XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (obj) [i], 0);
+	    else
+              syntax_error
+		("all elements of the vector must be of the same type", obj);
+	}
+#if 0 /* #### MULTIPLE doesn't work yet */
+      else if (VECTORP (XVECTOR_DATA (obj) [0]))
+	/* This vector is an ATOM_PAIR set */
+	{
+	  if (NILP (type)) type = QATOM_PAIR;
+	  *size_ret = XVECTOR_LENGTH (obj);
+	  *format_ret = 32;
+	  *data_ret =
+	    xnew_rawbytes ((*size_ret) * sizeof (XE_ATOM_TYPE) * 2);
+	  for (i = 0; i < *size_ret; i++)
+	    if (VECTORP (XVECTOR_DATA (obj) [i]))
+	      {
+		Lisp_Object pair = XVECTOR_DATA (obj) [i];
+		if (XVECTOR_LENGTH (pair) != 2)
+		  syntax_error
+		    ("elements of the vector must be vectors of exactly two elements", pair);
+
+		(*(XE_ATOM_TYPE **) data_ret) [i * 2] =
+		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [0], 0);
+		(*(XE_ATOM_TYPE **) data_ret) [(i * 2) + 1] =
+		  XE_SYMBOL_TO_ATOM (d, XVECTOR_DATA (pair) [1], 0);
+	      }
+	    else
+	      syntax_error
+		("all elements of the vector must be of the same type", obj);
+	}
+#endif
+      else
+	/* This vector is an INTEGER set, or something like it */
+	{
+	  *size_ret = XVECTOR_LENGTH (obj);
+	  if (NILP (type)) type = QINTEGER;
+	  *format_ret = 16;
+	  for (i = 0; i < *size_ret; i++)
+	    if (CONSP (XVECTOR_DATA (obj) [i]))
+	      *format_ret = 32;
+	    else if (!INTP (XVECTOR_DATA (obj) [i]))
+	      syntax_error
+		("all elements of the vector must be integers or conses of integers", obj);
+
+	  *data_ret = xnew_rawbytes (*size_ret * (*format_ret/8));
+	  for (i = 0; i < *size_ret; i++)
+	    if (*format_ret == 32)
+	      (*((unsigned long **) data_ret)) [i] =
+		lisp_to_word (XVECTOR_DATA (obj) [i]);
+	    else
+	      (*((unsigned short **) data_ret)) [i] =
+		(unsigned short) lisp_to_word (XVECTOR_DATA (obj) [i]);
+	}
+    }
+  else
+    invalid_argument ("unrecognized selection data", obj);
+
+  *type_ret = XE_SYMBOL_TO_ATOM (d, type, 0);
+}
+
--- a/src/sheap.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sheap.c	Wed Feb 24 01:58:04 2010 -0600
@@ -27,7 +27,7 @@
 #include <sheap-adjust.h>
 
 #define STATIC_HEAP_BASE	0x800000
-#define STATIC_HEAP_SLOP	0x40000
+#define STATIC_HEAP_SLOP	0x80000
 #define STATIC_HEAP_SIZE \
 (STATIC_HEAP_BASE + SHEAP_ADJUSTMENT + STATIC_HEAP_SLOP)
 #define BLOCKSIZE	(1<<12)
@@ -84,7 +84,7 @@
 	{
 	  printf (
 "\nRequested %d bytes, static heap exhausted!  base is %p, current ptr\n"
-"is %p. You have exhausted the static heap. \n"
+"is %p, static heap size is %ld. You have exhausted the static heap. \n"
 "\n"
 "If you are simply trying to compile, remove sheap-adjust.h\n"
 "and recompile from the top level. If this doesn't\n"
@@ -93,7 +93,7 @@
 "If you want to run temacs, change SHEAP_ADJUSTMENT in sheap-adjust.h\n"
 "to 0 or a +ve number. Generally you should *not* try to run temacs\n"
 "with a static heap, you should dump first.\n",
-          size, static_heap_base, static_heap_ptr);
+          size, static_heap_base, static_heap_ptr, static_heap_size);
 
 	  exit(-1);
 	  return 0;
@@ -111,7 +111,7 @@
 
   if (stream == NULL)
     report_file_error ("Opening sheap adjustment file",
-		       build_string ("sheap-adjust.h"));
+		       build_ascstring ("sheap-adjust.h"));
 
   fprintf (stream,
 	   "/*\tDo not edit this file!\n"
--- a/src/signal.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/signal.c	Wed Feb 24 01:58:04 2010 -0600
@@ -444,6 +444,11 @@
 #endif
     something_happened = 0;
 
+  /* Don't try to do anything clever if we're called from debug_print()
+     or very close to startup or shutdown. */
+  if (inhibit_non_essential_conversion_operations)
+    return;
+
   if (async_timeout_happened)
     {
       async_timeout_happened = 0;
--- a/src/sound.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sound.c	Wed Feb 24 01:58:04 2010 -0600
@@ -98,9 +98,9 @@
 Lisp_Object Qsound_error;
 
 DOESNT_RETURN
-report_sound_error (const Ascbyte *string, Lisp_Object data)
+report_sound_error (const Ascbyte *reason, Lisp_Object data)
 {
-  report_error_with_errno (Qsound_error, string, data);
+  report_error_with_errno (Qsound_error, reason, data);
 }
 
 DEFUN ("play-sound-file", Fplay_sound_file, 1, 3, "fSound file name: ", /*
@@ -158,7 +158,7 @@
     {
       Extbyte *fileext;
 
-      LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
+      LISP_PATHNAME_CONVERT_OUT (file, fileext);
       /* #### ALSA code should allow specification of a device. */
       if (alsa_play_sound_file (fileext, vol))
 	return Qnil;
@@ -170,7 +170,7 @@
     {
       Extbyte *fileext;
 
-      LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
+      LISP_PATHNAME_CONVERT_OUT (file, fileext);
       /* #### NAS code should allow specification of a device. */
       if (nas_play_sound_file (fileext, vol))
 	return Qnil;
@@ -183,7 +183,7 @@
       Extbyte *fileext;
       int result;
 
-      LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
+      LISP_PATHNAME_CONVERT_OUT (file, fileext);
 
       /* #### ESD uses alarm(). But why should we also stop SIGIO? */
       stop_interrupts ();
@@ -382,9 +382,7 @@
       Binbyte *soundext;
       Bytecount soundextlen;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, sound,
-			  ALLOCA, (soundext, soundextlen),
-			  Qbinary);
+      LISP_STRING_TO_SIZED_EXTERNAL (sound, soundext, soundextlen, Qbinary);
       if (alsa_play_sound_data (soundext, soundextlen, vol))
 	return Qnil;
     }
@@ -396,9 +394,7 @@
       Binbyte *soundext;
       Bytecount soundextlen;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, sound,
-			  ALLOCA, (soundext, soundextlen),
-			  Qbinary);
+      LISP_STRING_TO_SIZED_EXTERNAL (sound, soundext, soundextlen, Qbinary);
       if (nas_play_sound_data (soundext, soundextlen, vol))
 	return Qnil;
     }
@@ -411,8 +407,7 @@
       Bytecount soundextlen;
       int succes;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, sound, ALLOCA, (soundext, soundextlen),
-			  Qbinary);
+      LISP_STRING_TO_SIZED_EXTERNAL (sound, soundext, soundextlen, Qbinary);
       
       /* #### ESD uses alarm(). But why should we also stop SIGIO? */
       stop_interrupts ();
@@ -432,9 +427,7 @@
       Bytecount soundextlen;
       int succes;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, sound,
-			  ALLOCA, (soundext, soundextlen),
-			  Qbinary);
+      LISP_STRING_TO_SIZED_EXTERNAL (sound, soundext, soundextlen, Qbinary);
       /* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */
       stop_interrupts ();
       succes = play_sound_data (soundext, soundextlen, vol);
--- a/src/sound.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sound.h	Wed Feb 24 01:58:04 2010 -0600
@@ -35,12 +35,12 @@
   Ibyte *errmess;							 \
   Ibyte *string_int;							 \
   GET_STRERROR (errmess, errno);					 \
-  EXTERNAL_TO_C_STRING (string, string_int, Qnative);			 \
+  string_int = EXTERNAL_TO_ITEXT (string, Qerror_message_encoding);	 \
   warn_when_safe (Qsound, Qerror, "audio: %s, %s", string_int, errmess); \
 } while (0)
 # define sound_warn(string)					\
 do {								\
   Ibyte *string_int;						\
-  EXTERNAL_TO_C_STRING (GETTEXT (string), string_int, Qnative);	\
+  string_int = EXTERNAL_TO_ITEXT (GETTEXT (string), Qerror_message_encoding);		\
   warn_when_safe (Qsound, Qwarning, "audio: %s", string_int);	\
 } while (0)
--- a/src/specifier.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/specifier.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Specifier implementation
    Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996, 2002, 2005 Ben Wing.
+   Copyright (C) 1995, 1996, 2002, 2005, 2010 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -33,6 +33,7 @@
 #include "buffer.h"
 #include "chartab.h"
 #include "device-impl.h"
+#include "elhash.h"
 #include "frame.h"
 #include "glyphs.h"
 #include "opaque.h"
@@ -47,6 +48,14 @@
 Lisp_Object Qconsole_type, Qdevice_class;
 
 static Lisp_Object Vuser_defined_tags;
+/* This is a hash table mapping charsets to "tag lists".  A tag list here
+   is an assoc list mapping charset tags to size-two vectors (one for the
+   initial stage, one for the final stage) containing t or nil, indicating
+   whether the charset tag matches the charset for the given stage.  These
+   values are determined at the time a charset tag is defined by calling
+   the charset predicate on all the existing charsets, and at the time a
+   charset is defined by calling the predicate on all existing charset
+   tags. */
 static Lisp_Object Vcharset_tag_lists;
 
 typedef struct specifier_type_entry specifier_type_entry;
@@ -285,7 +294,7 @@
   the_specs = Fspecifier_specs (obj, Qglobal, Qnil, Qnil);
   if (NILP (the_specs))
     /* there are no global specs */
-    write_c_string (printcharfun, "<unspecified>");
+    write_ascstring (printcharfun, "<unspecified>");
   else
     print_internal (the_specs, printcharfun, 1);
   if (!NILP (sp->fallback))
@@ -303,14 +312,14 @@
   Lisp_Specifier *sp = (Lisp_Specifier *) header;
   if (!GHOST_SPECIFIER_P(sp) && sp->caching)
     {
-      xfree (sp->caching, struct specifier_caching *);
+      xfree (sp->caching);
       sp->caching = 0;
     }
 }
 #endif /* not NEW_GC */
 
 static int
-specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth, int foldcase)
 {
   Lisp_Specifier *s1 = XSPECIFIER (obj1);
   Lisp_Specifier *s2 = XSPECIFIER (obj2);
@@ -324,12 +333,12 @@
   depth++;
   retval =
     (s1->methods == s2->methods &&
-     internal_equal (s1->global_specs, s2->global_specs, depth) &&
-     internal_equal (s1->device_specs, s2->device_specs, depth) &&
-     internal_equal (s1->frame_specs,  s2->frame_specs,  depth) &&
-     internal_equal (s1->window_specs, s2->window_specs, depth) &&
-     internal_equal (s1->buffer_specs, s2->buffer_specs, depth) &&
-     internal_equal (s1->fallback,     s2->fallback,     depth));
+     internal_equal_0 (s1->global_specs, s2->global_specs, depth, foldcase) &&
+     internal_equal_0 (s1->device_specs, s2->device_specs, depth, foldcase) &&
+     internal_equal_0 (s1->frame_specs,  s2->frame_specs,  depth, foldcase) &&
+     internal_equal_0 (s1->window_specs, s2->window_specs, depth, foldcase) &&
+     internal_equal_0 (s1->buffer_specs, s2->buffer_specs, depth, foldcase) &&
+     internal_equal_0 (s1->fallback,     s2->fallback,     depth, foldcase));
 
   if (retval && HAS_SPECMETH_P (s1, equal))
     retval = SPECMETH (s1, equal, (obj1, obj2, depth - 1));
@@ -974,46 +983,42 @@
 }
 
 static int
-charset_matches_specifier_tag_set_p (Lisp_Object charset,
-				     Lisp_Object tag_set,
+charset_matches_specifier_tag_set_p (Lisp_Object charset, Lisp_Object tag_set,
 				     enum font_specifier_matchspec_stages
 				     stage)
 {
   Lisp_Object rest;
   int res = 0;
 
-  assert(stage != impossible);
+  assert(stage < NUM_MATCHSPEC_STAGES);
 
   LIST_LOOP (rest, tag_set)
     {
       Lisp_Object tag = XCAR (rest);
       Lisp_Object assoc;
+      Lisp_Object tag_list = Fgethash (charset, Vcharset_tag_lists, Qnil);
 
       /* In the event that, during the creation of a charset, no specifier
 	 tags exist for which CHARSET-PREDICATE has been specified, then
 	 that charset's entry in Vcharset_tag_lists will be nil, and this
 	 charset shouldn't match. */
 
-      if (NILP (XVECTOR_DATA(Vcharset_tag_lists)[XCHARSET_LEADING_BYTE(charset)
-						 - MIN_LEADING_BYTE]))
+      if (NILP (tag_list))
 	{
 	  return 0;
 	}
 
       /* Now, find out what the pre-calculated value is. */
-      assoc = assq_no_quit(tag,
-			   XVECTOR_DATA(Vcharset_tag_lists)
-			   [XCHARSET_LEADING_BYTE(charset)
-			    - MIN_LEADING_BYTE]);
-
-      if (!(NILP(assoc)) && !(NILP(XCDR(assoc))))
+      assoc = assq_no_quit (tag, tag_list);
+
+      if (!(NILP (assoc)))
 	{
-	  assert(VECTORP(XCDR(assoc)));
+	  assert (VECTORP (XCDR (assoc)));
 
 	  /* In the event that a tag specifies a charset, then the specifier
 	     must match for (this stage and this charset) for all
 	     charset-specifying tags.  */
-	  if (NILP(XVECTOR_DATA(XCDR(assoc))[stage]))
+	  if (NILP (XVECTOR_DATA (XCDR (assoc))[stage]))
 	    {
 	      /* It doesn't match for this tag, even though the tag
 		 specifies a charset. Return 0. */
@@ -1051,13 +1056,65 @@
   return device_matches_specifier_tag_set_p (device, tag_set) ? Qt : Qnil;
 }
 
+/* Call CHARSET_PREDICATE on CHARSET, evaluating it at both stages (initial
+   and final) and returning a size-two vector of the results. */
+
+static Lisp_Object
+call_charset_predicate (Lisp_Object charset_predicate, Lisp_Object charset)
+{
+  struct gcpro gcpro1;
+  Lisp_Object charpres = make_vector (NUM_MATCHSPEC_STAGES, Qnil);
+  int max_args = XINT (Ffunction_max_args (charset_predicate));
+  GCPRO1 (charpres);
+    
+
+#define DEFINE_SPECIFIER_TAG_FROB(stage, enumstage)		\
+  do {								\
+    if (max_args > 1)						\
+      {								\
+	XVECTOR_DATA (charpres)[enumstage] =			\
+	  call2_trapping_problems				\
+	  ("Error during specifier tag charset predicate,"	\
+	   " stage " #stage, charset_predicate,			\
+	   charset, Q##stage, 0);				\
+      }								\
+    else							\
+      {								\
+	XVECTOR_DATA (charpres)[enumstage] =			\
+	  call1_trapping_problems				\
+	  ("Error during specifier tag charset predicate,"	\
+	   " stage " #stage, charset_predicate,			\
+	   charset, 0);						\
+      }								\
+								\
+    if (UNBOUNDP (XVECTOR_DATA (charpres)[enumstage]))		\
+      {								\
+	XVECTOR_DATA (charpres)[enumstage] = Qnil;		\
+      }								\
+    else if (!NILP (XVECTOR_DATA (charpres)[enumstage]))	\
+      {								\
+	/* Don't want refs to random other objects.  */		\
+	XVECTOR_DATA (charpres)[enumstage] = Qt;		\
+      }								\
+  } while (0)
+
+  DEFINE_SPECIFIER_TAG_FROB (initial, STAGE_INITIAL);
+  DEFINE_SPECIFIER_TAG_FROB (final, STAGE_FINAL);
+
+#undef DEFINE_SPECIFIER_TAG_FROB
+
+  UNGCPRO;
+
+  return charpres;
+}
+
 Lisp_Object
-define_specifier_tag(Lisp_Object tag, Lisp_Object device_predicate,
-		     Lisp_Object charset_predicate)
+define_specifier_tag (Lisp_Object tag, Lisp_Object device_predicate,
+		      Lisp_Object charset_predicate)
 {
   Lisp_Object assoc = assq_no_quit (tag, Vuser_defined_tags),
-    concons, devcons, charpres = Qnil;
-  int recompute_devices = 0, recompute_charsets = 0, i, max_args = -1;
+    concons, devcons;
+  int recompute_devices = 0, recompute_charsets = 0;
 
   if (NILP (assoc))
     {
@@ -1073,31 +1130,14 @@
 	  DEVICE_USER_DEFINED_TAGS (d) =
 	    Fcons (Fcons (tag, Qt), DEVICE_USER_DEFINED_TAGS (d));
 	}
-
-      if (!NILP (charset_predicate))
-	{
-	  max_args = XINT(Ffunction_max_args(charset_predicate));
-	  if (max_args < 1)
-	    {
-	      invalid_argument
-		("Charset predicate must be able to take an argument", tag);
-	    }
-	}
     }
   else if (!NILP (device_predicate) && !NILP (XCADR (assoc)))
     {
       recompute_devices = 1;
-      XCDR (assoc) = list2(device_predicate, charset_predicate);
+      XCDR (assoc) = list2 (device_predicate, charset_predicate);
     }
-  else if (!NILP (charset_predicate) || !NILP(XCADDR (assoc)))
+  else if (!NILP (charset_predicate) || !NILP (XCADDR (assoc)))
     {
-      max_args = XINT(Ffunction_max_args(charset_predicate));
-      if (max_args < 1)
-	{
-	  invalid_argument
-	    ("Charset predicate must be able to take an argument", tag);
-	}
-
       /* If there exists a charset_predicate for the tag currently (even if
 	 the new charset_predicate is nil), or if we're adding one, we need
 	 to recompute.  This contrasts with the device predicates, where we
@@ -1105,7 +1145,7 @@
 	 both nil.  */
 
       recompute_charsets = 1;
-      XCDR (assoc) = list2(device_predicate, charset_predicate);
+      XCDR (assoc) = list2 (device_predicate, charset_predicate);
     }
 
   /* Recompute the tag values for all devices and charsets, if necessary. In
@@ -1133,80 +1173,28 @@
 
   if (recompute_charsets)
     {
-      if (NILP(charset_predicate))
-	{
-	  charpres = Qnil;
-	}
-
-      for (i = 0; i < NUM_LEADING_BYTES; ++i)
+
+      LIST_LOOP_2 (charset_name, Fcharset_list ())
 	{
-	  if (NILP(charset_by_leading_byte(MIN_LEADING_BYTE + i)))
-	    {
-	      continue;
-	    }
-
-	  assoc = assq_no_quit (tag,
-				XVECTOR_DATA(Vcharset_tag_lists)[i]);
-
-	  if (!NILP(charset_predicate))
+	  Lisp_Object charset = Fget_charset (charset_name);
+	  Lisp_Object tag_list = Fgethash (charset, Vcharset_tag_lists, Qnil);
+	  Lisp_Object charpres;
+
+	  if (NILP (charset_predicate))
+	    continue;
+
+	  charpres = call_charset_predicate (charset_predicate, charset);
+
+	  assoc = assq_no_quit (tag, tag_list);
+	  if (!NILP (assoc))
 	    {
-	      struct gcpro gcpro1;
-	      charpres = make_vector(impossible, Qnil);
-	      GCPRO1 (charpres);
-
-	      /* If you want to extend the number of stages available, here
-		 in setup_charset_initial_specifier_tags, and in specifier.h
-		 is where you want to go. */
-
-#define DEFINE_SPECIFIER_TAG_FROB(stage)	do {			\
-		if (max_args > 1)					\
-		  {							\
-		    XVECTOR_DATA(charpres)[stage] =			\
-		      call2_trapping_problems				\
-		      ("Error during specifier tag charset predicate,"	\
-		       " stage " #stage, charset_predicate,		\
-		       charset_by_leading_byte(MIN_LEADING_BYTE + i),	\
-		       Q##stage, 0);					\
-		  }							\
-		else							\
-		  {							\
-		    XVECTOR_DATA(charpres)[stage] =			\
-		      call1_trapping_problems				\
-		      ("Error during specifier tag charset predicate,"	\
-		       " stage " #stage, charset_predicate,		\
-		       charset_by_leading_byte(MIN_LEADING_BYTE + i),	\
-		       0);						\
-		  }							\
-									\
-		if (UNBOUNDP(XVECTOR_DATA(charpres)[stage]))		\
-		  {							\
-		    XVECTOR_DATA(charpres)[stage] = Qnil;		\
-		  }							\
-		else if (!NILP(XVECTOR_DATA(charpres)[stage]))		\
-		  {							\
-		    /* Don't want refs to random other objects.  */	\
-		    XVECTOR_DATA(charpres)[stage] = Qt;			\
-		  }							\
-	      } while (0)
-
-	      DEFINE_SPECIFIER_TAG_FROB (initial);
-	      DEFINE_SPECIFIER_TAG_FROB (final);
-
-#undef DEFINE_SPECIFIER_TAG_FROB
-
-	      UNGCPRO;
-	    }
-
-	  if (!NILP(assoc))
-	    {
-	      assert(CONSP(assoc));
+	      assert (CONSP (assoc));
 	      XCDR (assoc) = charpres;
 	    }
 	  else
 	    {
-	      XVECTOR_DATA(Vcharset_tag_lists)[i]
-		= Fcons(Fcons(tag, charpres),
-			XVECTOR_DATA (Vcharset_tag_lists)[i]);
+	      Fputhash (charset, Fcons (Fcons (tag, charpres), tag_list),
+			Vcharset_tag_lists);
 	    }
 	}
     }
@@ -1251,8 +1239,6 @@
 */
        (tag, device_predicate, charset_predicate))
 {
-  int max_args;
-
   CHECK_SYMBOL (tag);
   if (valid_device_class_p (tag) ||
       valid_console_type_p (tag) ||
@@ -1265,8 +1251,10 @@
 
   if (!NILP (charset_predicate))
     {
-      max_args = XINT(Ffunction_max_args(charset_predicate));
-      if (max_args != 1)
+      Lisp_Object min_args = Ffunction_min_args (charset_predicate);
+      Lisp_Object max_args = Ffunction_max_args (charset_predicate);
+      if (!(INTP (min_args) && XINT (min_args) == 1 &&
+	    INTP (max_args) && XINT (max_args) == 1))
 	{
 	  /* We only allow the stage argument to be specifed from C.  */
 	  invalid_change ("Charset predicate must take one argument",
@@ -1325,47 +1313,19 @@
 
   LIST_LOOP (rest, Vuser_defined_tags)
     {
-      tag = XCAR(XCAR(rest));
-      charset_predicate = XCADDR(XCAR (rest));
-
-      if (NILP(charset_predicate))
+      tag = XCAR (XCAR (rest));
+      charset_predicate = XCADDR (XCAR (rest));
+
+      if (NILP (charset_predicate))
 	{
 	  continue;
 	}
 
-      new_value = make_vector(impossible, Qnil);
-
-#define SETUP_CHARSET_TAGS_FROB(stage)		do {			\
-									\
-	XVECTOR_DATA(new_value)[stage] = call2_trapping_problems	\
-	  ("Error during specifier tag charset predicate,"		\
-	   " stage " #stage,						\
-	   charset_predicate, charset, Q##stage, 0);			\
-									\
-	if (UNBOUNDP(XVECTOR_DATA(new_value)[stage]))			\
-	  {								\
-	    XVECTOR_DATA(new_value)[stage] = Qnil;			\
-	  }								\
-	else if (!NILP(XVECTOR_DATA(new_value)[stage]))			\
-	  {								\
-	    /* Don't want random other objects hanging around. */	\
-	    XVECTOR_DATA(new_value)[stage] = Qt;			\
-	  }								\
-									\
-      } while (0)
-
-      SETUP_CHARSET_TAGS_FROB (initial);
-      SETUP_CHARSET_TAGS_FROB (final);
-      /* More later?  */
-
-#undef SETUP_CHARSET_TAGS_FROB
-
-      charset_tag_list = Fcons(Fcons(tag, new_value), charset_tag_list);
+      new_value = call_charset_predicate (charset_predicate, charset);
+      charset_tag_list = Fcons (Fcons (tag, new_value), charset_tag_list);
     }
 
-  XVECTOR_DATA
-    (Vcharset_tag_lists)[XCHARSET_LEADING_BYTE(charset) - MIN_LEADING_BYTE]
-    = charset_tag_list;
+  Fputhash (charset, charset_tag_list, Vcharset_tag_lists);
 }
 
 /* VM calls this, in vm-multiple-frames-possible-p, in the event that you're
@@ -2804,10 +2764,7 @@
   Lisp_Object device, charset = Qnil, rest;
   int count = specpdl_depth (), respected_charsets = 0;
   struct gcpro gcpro1, gcpro2;
-  enum font_specifier_matchspec_stages stage = initial;
-#ifdef DEBUG_XEMACS
-  int non_ascii;
-#endif
+  enum font_specifier_matchspec_stages stage = STAGE_INITIAL;
 
   GCPRO2 (specifier, inst_list);
 
@@ -2822,28 +2779,31 @@
     specbind (Qinhibit_quit, Qt);
 
 #ifdef MULE
-  if (CONSP(matchspec) && (CHARSETP(Ffind_charset(XCAR(matchspec)))))
+  /* #### FIXME Does this font-specific stuff need to be here and not in
+     the font-specifier-specific code? --ben */
+  if (CONSP (matchspec) && (CHARSETP (Ffind_charset (XCAR (matchspec)))))
     {
-      charset = Ffind_charset(XCAR(matchspec));
+      charset = Ffind_charset (XCAR (matchspec));
 
 #ifdef DEBUG_XEMACS
       /* This is mostly to have somewhere to set debug breakpoints. */
-      if (!EQ(charset, Vcharset_ascii))
+      if (!EQ (charset, Vcharset_ascii))
 	{
-	  non_ascii = 1;
+	  (void) 0;
 	}
 #endif /* DEBUG_XEMACS */
 
-      if (!NILP(XCDR(matchspec)))
+      if (!NILP (XCDR (matchspec)))
 	{
 
-#define FROB(new_stage) if (EQ(Q##new_stage, XCDR(matchspec)))	\
-	    {							\
-	      stage = new_stage;				\
+#define FROB(new_stage, enumstage)			\
+          if (EQ (Q##new_stage, XCDR (matchspec)))	\
+	    {						\
+	      stage = enumstage;			\
 	    }
 
-	  FROB(initial)
-	  else FROB(final)
+	  FROB (initial, STAGE_INITIAL)
+	  else FROB (final, STAGE_FINAL)
 	  else assert(0);
 #undef FROB
 
@@ -3540,7 +3500,7 @@
 {
   Lisp_Object specifier = Qnil;
 
-  specifier = VOID_TO_LISP (closure);
+  specifier = GET_LISP_FROM_VOID (closure);
   recompute_one_cached_specifier_in_window (specifier, w);
   return 0;
 }
@@ -3560,7 +3520,7 @@
       FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
 	map_windows (XFRAME (XCAR (frmcons)),
 		     recompute_cached_specifier_everywhere_mapfun,
-		     LISP_TO_VOID (specifier));
+		     STORE_LISP_IN_VOID (specifier));
     }
 
   if (XSPECIFIER (specifier)->caching->offset_into_struct_frame)
@@ -3915,6 +3875,7 @@
   Vunlock_ghost_specifiers = Qnil;
   staticpro (&Vunlock_ghost_specifiers);
 
-  Vcharset_tag_lists = make_vector(NUM_LEADING_BYTES, Qnil);
+  Vcharset_tag_lists =
+    make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ);
   staticpro (&Vcharset_tag_lists);
 }
--- a/src/specifier.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/specifier.h	Wed Feb 24 01:58:04 2010 -0600
@@ -572,16 +572,6 @@
 #define CHECK_DISPLAYTABLE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, display_table)
 #define CONCHECK_DISPLAYTABLE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, display_table)
 
-/* The various stages of font instantiation; initial means "find a font for
-   CHARSET that matches the charset's registries" and final means "find a
-   font for CHARSET that matches iso10646-1, since we haven't found a font
-   that matches its registry."  */
-enum font_specifier_matchspec_stages {
-  initial,
-  final,
-  impossible,
-};
-
 Lisp_Object define_specifier_tag(Lisp_Object tag,
 				 Lisp_Object device_predicate,
 				 Lisp_Object charset_predicate);
--- a/src/strftime.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/strftime.c	Wed Feb 24 01:58:04 2010 -0600
@@ -396,13 +396,13 @@
             case 'G':
               {
                 int year = tm->tm_year + 1900;
-                int days = iso_week_days (tm->tm_yday, tm->tm_wday);
+                int ndays = iso_week_days (tm->tm_yday, tm->tm_wday);
 
-                if (days < 0)
+                if (ndays < 0)
                   {
                     /* This ISO week belongs to the previous year.  */
                     year--;
-                    days =
+                    ndays =
                       iso_week_days (tm->tm_yday + (365 + __isleap (year)),
                                      tm->tm_wday);
                   }
@@ -415,7 +415,7 @@
                       {
                         /* This ISO week belongs to the next year.  */
                         year++;
-                        days = d;
+                        ndays = d;
                       }
                   }
 
@@ -442,7 +442,7 @@
                     
                   default:
                     length +=
-                      add_num2 (&string[length], days / 7 + 1,
+                      add_num2 (&string[length], ndays / 7 + 1,
                                 max - length, pad);
                     break;
                   }
@@ -474,7 +474,7 @@
                 /* tm diff code below is based on mktime.c, glibc 2.3.2 */
                 {
                   int lt4, ut4, lt100, ut100, lt400, ut400;
-                  int intervening_leap_days, years, days;
+                  int intervening_leap_days, years, ndays;
 
                   lt4 = (lt.tm_year >> 2) + (1900 >> 2) -
                     ! (lt.tm_year & 3);
@@ -487,9 +487,10 @@
                   intervening_leap_days =
                     (lt4 - ut4) - (lt100 - ut100) + (lt400 - ut400);
                   years = lt.tm_year - ut->tm_year;
-                  days = (365 * years + intervening_leap_days
+                  ndays = (365 * years + intervening_leap_days
                           + (lt.tm_yday - ut->tm_yday));
-                  offset = (60 * (60 * (24 * days + (lt.tm_hour - ut->tm_hour))
+                  offset = (60 * (60 * (24 * ndays
+					+ (lt.tm_hour - ut->tm_hour))
                                  + (lt.tm_min - ut->tm_min))
                            + (lt.tm_sec - ut->tm_sec));
                 }
--- a/src/symbols.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/symbols.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* "intern" and friends -- moved here from lread.c and data.c
    Copyright (C) 1985-1989, 1992-1994 Free Software Foundation, Inc.
-   Copyright (C) 1995, 2000, 2001, 2002 Ben Wing.
+   Copyright (C) 1995, 2000, 2001, 2002, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -54,6 +54,8 @@
 #include <config.h>
 #include "lisp.h"
 
+#include "bytecode.h"		/* for COMPILED_FUNCTION_ANNOTATION_HACK,
+				   defined in bytecode.h and used here. */
 #include "buffer.h"		/* for Vbuffer_defaults */
 #include "console-impl.h"
 #include "elhash.h"
@@ -177,7 +179,7 @@
 }
 
 Lisp_Object
-intern_int (const Ibyte *str)
+intern_istring (const Ibyte *str)
 {
   Bytecount len = qxestrlen (str);
   Lisp_Object obarray = Vobarray;
@@ -197,7 +199,7 @@
 Lisp_Object
 intern (const CIbyte *str)
 {
-  return intern_int ((Ibyte *) str);
+  return intern_istring ((Ibyte *) str);
 }
 
 Lisp_Object
@@ -210,7 +212,7 @@
   for (i = 0; i < len; i++)
     if (tmp[i] == '_')
       tmp[i] = '-';
-  return intern_int ((Ibyte *) tmp);
+  return intern_istring ((Ibyte *) tmp);
 }
 
 DEFUN ("intern", Fintern, 1, 2, 0, /*
@@ -600,7 +602,10 @@
 !(unloading_module && UNBOUNDP(newval)) &&
 #endif
       (symbol_is_constant (sym, val)
-       || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym))))
+#ifndef NO_NEED_TO_HANDLE_21_4_CODE
+       || (SYMBOL_IS_KEYWORD (sym) && !EQ (newval, sym))
+#endif
+      ))
     signal_error_1 (Qsetting_constant,
 		    UNBOUNDP (newval) ? list1 (sym) : list2 (sym, newval));
 }
@@ -713,12 +718,19 @@
 DEFUN ("define-function", Fdefine_function, 2, 2, 0, /*
 Set SYMBOL's function definition to NEWDEF, and return NEWDEF.
 Associates the function with the current load file, if any.
+If NEWDEF is a compiled-function object, stores the function name in
+the `annotated' slot of the compiled-function (retrievable using
+`compiled-function-annotation').
 */
        (symbol, newdef))
 {
   /* This function can GC */
   Ffset (symbol, newdef);
   LOADHIST_ATTACH (Fcons (Qdefun, symbol));
+#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
+  if (COMPILED_FUNCTIONP (newdef))
+    XCOMPILED_FUNCTION (newdef)->annotated = symbol;
+#endif /* COMPILED_FUNCTION_ANNOTATION_HACK */
   return newdef;
 }
 
@@ -728,20 +740,20 @@
 */
        (subr))
 {
-  const char *name;
+  const Ascbyte *name;
   CHECK_SUBR (subr);
 
   name = XSUBR (subr)->name;
   return make_string ((const Ibyte *)name, strlen (name));
 }
 
-DEFUN ("special-form-p", Fspecial_form_p, 1, 1, 0, /*
-Return whether SUBR is a special form.
-
-A special form is a built-in function (a subr, that is a function
+DEFUN ("special-operator-p", Fspecial_operator_p, 1, 1, 0, /*
+Return whether SUBR is a special operator.
+
+A special operator is a built-in function (a subr, that is a function
 implemented in C, not Lisp) which does not necessarily evaluate all its
 arguments.  Much of the basic XEmacs Lisp syntax is implemented by means of
-special forms; examples are `let', `condition-case', `defun', `setq' and so
+special operators; examples are `let', `condition-case', `setq', and so
 on.
 
 If you intend to write a Lisp function that does not necessarily evaluate
@@ -771,6 +783,65 @@
 /*                           symbol-value			      */
 /**********************************************************************/
 
+/*
+   NOTE NOTE NOTE:
+   ---------------
+
+   There are various different uses of "magic" with regard to symbols,
+   and they need to be distinguished:
+
+   1. `symbol-value-magic' class of objects (struct symbol_value_magic):
+      A set of Lisp object types used as the value of a variable with any
+      behavior other than just a plain repository of a value.  This
+      includes buffer-local variables, console-local variables, read-only
+      variables, variable aliases, variables that are linked to a C
+      variable, etc.  The more specific types are:
+
+      -- `symbol-value-forward': Variables that forward to a C variable.
+         NOTE:This includes built-in buffer-local and console-local
+         variables, since they forward to an element in a buffer or
+         console structure.
+
+      -- `symbol-value-buffer-local': Variables on which
+         `make-local-variable' or `make-variable-buffer-local' have
+         been called.
+
+      -- `symbol-value-lisp-magic': See below.
+
+      -- `symbol-value-varalias': Variable aliases.
+
+   2. `symbol-value-lisp-magic': Variables on which
+      `dontusethis-set-symbol-value-handler' have been called.  These
+      variables are extra-magic in that operations that would normally
+      change their value instead get forwarded out to Lisp handlers,
+      which can do anything they want. (NOTE: Handlers for getting a
+      variable's value aren't implemented yet.)
+
+   3. "magicfun" handlers on C-forwarding variables, declared with any
+      of the following:
+
+      -- DEFVAR_LISP_MAGIC
+      -- DEFVAR_INT_MAGIC
+      -- DEFVAR_BOOL_MAGIC,
+      -- DEFVAR_BUFFER_LOCAL_MAGIC
+      -- DEFVAR_BUFFER_DEFAULTS_MAGIC
+      -- DEFVAR_CONSOLE_LOCAL_MAGIC
+      -- DEFVAR_CONSOLE_DEFAULTS_MAGIC
+
+      Here, the "magic function" is a handler that is notified whenever the
+      value of a variable is changed, so that some other updating can take
+      place (e.g. setting redisplay-related dirty bits, updating a cache,
+      etc.).
+
+      Note that DEFVAR_LISP_MAGIC does *NOT* have anything to do with
+      `symbol-value-lisp-magic'.  The former refers to variables that can
+      hold an arbitrary Lisp object and forward to a C variable declared
+      `Lisp_Object foo', and have a "magicfun" as just described; the
+      latter are variables that have Lisp-level handlers that function
+      in *PLACE* of normal variable-setting mechanisms, and are established
+      with `dontusethis-set-symbol-value-handler', as described above.
+*/
+
 /* If the contents of the value cell of a symbol is one of the following
    three types of objects, then the symbol is "magic" in that setting
    and retrieving its value doesn't just set or retrieve the raw
@@ -1116,29 +1187,29 @@
       return *((Lisp_Object *)symbol_value_forward_forward (fwd));
 
     case SYMVAL_DEFAULT_BUFFER_FORWARD:
-      return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults)
-				+ ((char *)symbol_value_forward_forward (fwd)
-				   - (char *)&buffer_local_flags))));
+      return (*((Lisp_Object *)((Rawbyte *) XBUFFER (Vbuffer_defaults)
+				+ ((Rawbyte *)symbol_value_forward_forward (fwd)
+				   - (Rawbyte *)&buffer_local_flags))));
 
 
     case SYMVAL_CURRENT_BUFFER_FORWARD:
     case SYMVAL_CONST_CURRENT_BUFFER_FORWARD:
       assert (buffer);
-      return (*((Lisp_Object *)((char *)buffer
-				+ ((char *)symbol_value_forward_forward (fwd)
-				   - (char *)&buffer_local_flags))));
+      return (*((Lisp_Object *)((Rawbyte *)buffer
+				+ ((Rawbyte *)symbol_value_forward_forward (fwd)
+				   - (Rawbyte *)&buffer_local_flags))));
 
     case SYMVAL_DEFAULT_CONSOLE_FORWARD:
-      return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults)
-				+ ((char *)symbol_value_forward_forward (fwd)
-				   - (char *)&console_local_flags))));
+      return (*((Lisp_Object *)((Rawbyte *) XCONSOLE (Vconsole_defaults)
+				+ ((Rawbyte *)symbol_value_forward_forward (fwd)
+				   - (Rawbyte *)&console_local_flags))));
 
     case SYMVAL_SELECTED_CONSOLE_FORWARD:
     case SYMVAL_CONST_SELECTED_CONSOLE_FORWARD:
       assert (console);
-      return (*((Lisp_Object *)((char *)console
-				+ ((char *)symbol_value_forward_forward (fwd)
-				   - (char *)&console_local_flags))));
+      return (*((Lisp_Object *)((Rawbyte *)console
+				+ ((Rawbyte *)symbol_value_forward_forward (fwd)
+				   - (Rawbyte *)&console_local_flags))));
 
     case SYMVAL_UNBOUND_MARKER:
       return valcontents;
@@ -1164,13 +1235,13 @@
   Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt);
   const struct symbol_value_forward *fwd
     = XSYMBOL_VALUE_FORWARD (valcontents);
-  int offset = ((char *) symbol_value_forward_forward (fwd)
-		- (char *) &buffer_local_flags);
+  int offset = ((Rawbyte *) symbol_value_forward_forward (fwd)
+		- (Rawbyte *) &buffer_local_flags);
   int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd)));
   int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object,
 		   int flags) = symbol_value_forward_magicfun (fwd);
 
-  *((Lisp_Object *) (offset + (char *) XBUFFER (Vbuffer_defaults)))
+  *((Lisp_Object *) (offset + (Rawbyte *) XBUFFER (Vbuffer_defaults)))
     = value;
 
   if (mask > 0)		/* Not always per-buffer */
@@ -1183,7 +1254,7 @@
 	    {
 	      if (magicfun)
 		magicfun (sym, &value, wrap_buffer (b), 0);
-	      *((Lisp_Object *) (offset + (char *) b)) = value;
+	      *((Lisp_Object *) (offset + (Rawbyte *) b)) = value;
 	    }
 	}
     }
@@ -1204,13 +1275,13 @@
   Lisp_Object valcontents = fetch_value_maybe_past_magic (sym, Qt);
   const struct symbol_value_forward *fwd
     = XSYMBOL_VALUE_FORWARD (valcontents);
-  int offset = ((char *) symbol_value_forward_forward (fwd)
-		- (char *) &console_local_flags);
+  int offset = ((Rawbyte *) symbol_value_forward_forward (fwd)
+		- (Rawbyte *) &console_local_flags);
   int mask = XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd)));
   int (*magicfun) (Lisp_Object simm, Lisp_Object *val, Lisp_Object in_object,
 		   int flags) = symbol_value_forward_magicfun (fwd);
 
-  *((Lisp_Object *) (offset + (char *) XCONSOLE (Vconsole_defaults)))
+  *((Lisp_Object *) (offset + (Rawbyte *) XCONSOLE (Vconsole_defaults)))
     = value;
 
   if (mask > 0)		/* Not always per-console */
@@ -1223,7 +1294,7 @@
 	    {
 	      if (magicfun)
 		magicfun (sym, &value, console, 0);
-	      *((Lisp_Object *) (offset + (char *) d)) = value;
+	      *((Lisp_Object *) (offset + (Rawbyte *) d)) = value;
 	    }
 	}
     }
@@ -1300,9 +1371,9 @@
 	case SYMVAL_CURRENT_BUFFER_FORWARD:
 	  if (magicfun)
 	    magicfun (sym, &newval, wrap_buffer (current_buffer), 0);
-	  *((Lisp_Object *) ((char *) current_buffer
-			     + ((char *) symbol_value_forward_forward (fwd)
-				- (char *) &buffer_local_flags)))
+	  *((Lisp_Object *) ((Rawbyte *) current_buffer
+			     + ((Rawbyte *) symbol_value_forward_forward (fwd)
+				- (Rawbyte *) &buffer_local_flags)))
 	    = newval;
 	  return;
 
@@ -1313,9 +1384,9 @@
 	case SYMVAL_SELECTED_CONSOLE_FORWARD:
 	  if (magicfun)
 	    magicfun (sym, &newval, Vselected_console, 0);
-	  *((Lisp_Object *) ((char *) XCONSOLE (Vselected_console)
-			     + ((char *) symbol_value_forward_forward (fwd)
-				- (char *) &console_local_flags)))
+	  *((Lisp_Object *) ((Rawbyte *) XCONSOLE (Vselected_console)
+			     + ((Rawbyte *) symbol_value_forward_forward (fwd)
+				- (Rawbyte *) &console_local_flags)))
 	    = newval;
 	  return;
 
@@ -1992,18 +2063,18 @@
       {
 	const struct symbol_value_forward *fwd
 	  = XSYMBOL_VALUE_FORWARD (valcontents);
-	return (*((Lisp_Object *)((char *) XBUFFER (Vbuffer_defaults)
-				  + ((char *)symbol_value_forward_forward (fwd)
-				     - (char *)&buffer_local_flags))));
+	return (*((Lisp_Object *)((Rawbyte *) XBUFFER (Vbuffer_defaults)
+				  + ((Rawbyte *)symbol_value_forward_forward (fwd)
+				     - (Rawbyte *)&buffer_local_flags))));
       }
 
     case SYMVAL_SELECTED_CONSOLE_FORWARD:
       {
 	const struct symbol_value_forward *fwd
 	  = XSYMBOL_VALUE_FORWARD (valcontents);
-	return (*((Lisp_Object *)((char *) XCONSOLE (Vconsole_defaults)
-				  + ((char *)symbol_value_forward_forward (fwd)
-				     - (char *)&console_local_flags))));
+	return (*((Lisp_Object *)((Rawbyte *) XCONSOLE (Vconsole_defaults)
+				  + ((Rawbyte *)symbol_value_forward_forward (fwd)
+				     - (Rawbyte *)&console_local_flags))));
       }
 
     case SYMVAL_BUFFER_LOCAL:
@@ -2439,8 +2510,8 @@
       {
 	const struct symbol_value_forward *fwd
 	  = XSYMBOL_VALUE_FORWARD (valcontents);
-	int offset = ((char *) symbol_value_forward_forward (fwd)
-			       - (char *) &buffer_local_flags);
+	int offset = ((Rawbyte *) symbol_value_forward_forward (fwd)
+			       - (Rawbyte *) &buffer_local_flags);
 	int mask =
 	  XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd)));
 
@@ -2450,10 +2521,10 @@
 			     Lisp_Object in_object, int flags) =
 			       symbol_value_forward_magicfun (fwd);
 	    Lisp_Object oldval = * (Lisp_Object *)
-	      (offset + (char *) XBUFFER (Vbuffer_defaults));
+	      (offset + (Rawbyte *) XBUFFER (Vbuffer_defaults));
 	    if (magicfun)
 	      (magicfun) (variable, &oldval, wrap_buffer (current_buffer), 0);
-	    *(Lisp_Object *) (offset + (char *) current_buffer)
+	    *(Lisp_Object *) (offset + (Rawbyte *) current_buffer)
 	      = oldval;
 	    current_buffer->local_var_flags &= ~mask;
 	  }
@@ -2533,8 +2604,8 @@
       {
 	const struct symbol_value_forward *fwd
 	  = XSYMBOL_VALUE_FORWARD (valcontents);
-	int offset = ((char *) symbol_value_forward_forward (fwd)
-			       - (char *) &console_local_flags);
+	int offset = ((Rawbyte *) symbol_value_forward_forward (fwd)
+			       - (Rawbyte *) &console_local_flags);
 	int mask =
 	  XINT (*((Lisp_Object *) symbol_value_forward_forward (fwd)));
 
@@ -2544,10 +2615,10 @@
 			     Lisp_Object in_object, int flags) =
 			       symbol_value_forward_magicfun (fwd);
 	    Lisp_Object oldval = * (Lisp_Object *)
-	      (offset + (char *) XCONSOLE (Vconsole_defaults));
+	      (offset + (Rawbyte *) XCONSOLE (Vconsole_defaults));
 	    if (magicfun)
 	      magicfun (variable, &oldval, Vselected_console, 0);
-	    *(Lisp_Object *) (offset + (char *) XCONSOLE (Vselected_console))
+	    *(Lisp_Object *) (offset + (Rawbyte *) XCONSOLE (Vselected_console))
 	      = oldval;
 	    XCONSOLE (Vselected_console)->local_var_flags &= ~mask;
 	  }
@@ -3525,8 +3596,8 @@
 }
 
 static void
-defsymbol_massage_name_1 (Lisp_Object *location, const char *name, int dump_p,
-			  int multiword_predicate_p)
+defsymbol_massage_name_1 (Lisp_Object *location, const Ascbyte *name,
+			  int dump_p, int multiword_predicate_p)
 {
   char temp[500];
   int len = strlen (name) - 1;
@@ -3547,63 +3618,64 @@
       temp[i] = '-';
   *location = Fintern (make_string ((const Ibyte *) temp, len), Qnil);
   if (dump_p)
-    staticpro (location);
+    staticpro_1 (location, name);
   else
-    staticpro_nodump (location);
+    staticpro_nodump_1 (location, name);
 }
 
 void
-defsymbol_massage_name_nodump (Lisp_Object *location, const char *name)
+defsymbol_massage_name_nodump (Lisp_Object *location, const Ascbyte *name)
 {
   defsymbol_massage_name_1 (location, name, 0, 0);
 }
 
 void
-defsymbol_massage_name (Lisp_Object *location, const char *name)
+defsymbol_massage_name (Lisp_Object *location, const Ascbyte *name)
 {
   defsymbol_massage_name_1 (location, name, 1, 0);
 }
 
 void
 defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location,
-					      const char *name)
+					      const Ascbyte *name)
 {
   defsymbol_massage_name_1 (location, name, 0, 1);
 }
 
 void
-defsymbol_massage_multiword_predicate (Lisp_Object *location, const char *name)
+defsymbol_massage_multiword_predicate (Lisp_Object *location,
+				       const Ascbyte *name)
 {
   defsymbol_massage_name_1 (location, name, 1, 1);
 }
 
 void
-defsymbol_nodump (Lisp_Object *location, const char *name)
+defsymbol_nodump (Lisp_Object *location, const Ascbyte *name)
 {
   *location = Fintern (make_string_nocopy ((const Ibyte *) name,
 					   strlen (name)),
 		       Qnil);
-  staticpro_nodump (location);
+  staticpro_nodump_1 (location, name);
 }
 
 void
-defsymbol (Lisp_Object *location, const char *name)
+defsymbol (Lisp_Object *location, const Ascbyte *name)
 {
   *location = Fintern (make_string_nocopy ((const Ibyte *) name,
 					   strlen (name)),
 		       Qnil);
-  staticpro (location);
+  staticpro_1 (location, name);
 }
 
 void
-defkeyword (Lisp_Object *location, const char *name)
+defkeyword (Lisp_Object *location, const Ascbyte *name)
 {
   defsymbol (location, name);
   Fset (*location, *location);
 }
 
 void
-defkeyword_massage_name (Lisp_Object *location, const char *name)
+defkeyword_massage_name (Lisp_Object *location, const Ascbyte *name)
 {
   char temp[500];
   int len = strlen (name);
@@ -3696,7 +3768,7 @@
 									      \
     newsubr = xnew (Lisp_Subr);						      \
     memcpy (newsubr, subr, sizeof (Lisp_Subr));				      \
-    subr->doc = (const char *)newsubr;					      \
+    subr->doc = (const CIbyte *)newsubr;				      \
     subr = newsubr;							      \
   }									      \
 } while (0)
@@ -3783,7 +3855,7 @@
 }
 
 static void
-deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj,
+deferror_1 (Lisp_Object *symbol, const Ascbyte *name, const Ascbyte *messuhhj,
 	    Lisp_Object inherits_from, int massage_p)
 {
   Lisp_Object conds;
@@ -3798,25 +3870,25 @@
   /* NOT build_msg_string ().  This function is called at load time
      and the string needs to get translated at run time.  (This happens
      in the function (display-error) in cmdloop.el.) */
-  Fput (*symbol, Qerror_message, build_msg_string (messuhhj));
+  Fput (*symbol, Qerror_message, build_defer_string (messuhhj));
 }
 
 void
-deferror (Lisp_Object *symbol, const char *name, const char *messuhhj,
+deferror (Lisp_Object *symbol, const Ascbyte *name, const Ascbyte *messuhhj,
 	  Lisp_Object inherits_from)
 {
   deferror_1 (symbol, name, messuhhj, inherits_from, 0);
 }
 
 void
-deferror_massage_name (Lisp_Object *symbol, const char *name,
-		       const char *messuhhj, Lisp_Object inherits_from)
+deferror_massage_name (Lisp_Object *symbol, const Ascbyte *name,
+		       const Ascbyte *messuhhj, Lisp_Object inherits_from)
 {
   deferror_1 (symbol, name, messuhhj, inherits_from, 1);
 }
 
 void
-deferror_massage_name_and_message (Lisp_Object *symbol, const char *name,
+deferror_massage_name_and_message (Lisp_Object *symbol, const Ascbyte *name,
 				   Lisp_Object inherits_from)
 {
   char temp[500];
@@ -3893,7 +3965,7 @@
   DEFSUBR (Fdefine_function);
   Ffset (intern ("defalias"), intern ("define-function"));
   DEFSUBR (Fsubr_name);
-  DEFSUBR (Fspecial_form_p);
+  DEFSUBR (Fspecial_operator_p);
   DEFSUBR (Fsetplist);
   DEFSUBR (Fsymbol_value_in_buffer);
   DEFSUBR (Fsymbol_value_in_console);
@@ -3920,7 +3992,8 @@
 
 /* Create and initialize a Lisp variable whose value is forwarded to C data */
 void
-defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic)
+defvar_magic (const Ascbyte *symbol_name,
+	      const struct symbol_value_forward *magic)
 {
   Lisp_Object sym;
 
@@ -3932,7 +4005,7 @@
    */
   if (initialized)
     {
-      sym = Fintern (build_string (symbol_name), Qnil);
+      sym = Fintern (build_ascstring (symbol_name), Qnil);
       LOADHIST_ATTACH (sym);
     }
   else
--- a/src/symeval.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/symeval.h	Wed Feb 24 01:58:04 2010 -0600
@@ -326,16 +326,16 @@
 #endif /* not NEW_GC */
 
 MODULE_API void defsymbol_massage_name (Lisp_Object *location,
-					const char *name);
+					const Ascbyte *name);
 MODULE_API void defsymbol_massage_name_nodump (Lisp_Object *location,
-					       const char *name);
+					       const Ascbyte *name);
 MODULE_API void defsymbol_massage_multiword_predicate (Lisp_Object *location,
-						       const char *name);
+						       const Ascbyte *name);
 MODULE_API void
 defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location,
-					      const char *name);
-MODULE_API void defsymbol (Lisp_Object *location, const char *name);
-MODULE_API void defsymbol_nodump (Lisp_Object *location, const char *name);
+					      const Ascbyte *name);
+MODULE_API void defsymbol (Lisp_Object *location, const Ascbyte *name);
+MODULE_API void defsymbol_nodump (Lisp_Object *location, const Ascbyte *name);
 
 /* Defining symbols:
 
@@ -370,18 +370,18 @@
 #define DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP(name) \
   defsymbol_massage_multiword_predicate_nodump (&name, #name)
 
-MODULE_API void defkeyword (Lisp_Object *location, const char *name);
+MODULE_API void defkeyword (Lisp_Object *location, const Ascbyte *name);
 MODULE_API void defkeyword_massage_name (Lisp_Object *location,
-					 const char *name);
+					 const Ascbyte *name);
 #define DEFKEYWORD(name) defkeyword_massage_name (&name, #name)
 
-MODULE_API void deferror (Lisp_Object *symbol, const char *name,
-			  const char *message, Lisp_Object inherits_from);
-MODULE_API void deferror_massage_name (Lisp_Object *symbol, const char *name,
-				       const char *message,
+MODULE_API void deferror (Lisp_Object *symbol, const Ascbyte *name,
+			  const Ascbyte *message, Lisp_Object inherits_from);
+MODULE_API void deferror_massage_name (Lisp_Object *symbol, const Ascbyte *name,
+				       const Ascbyte *message,
 				       Lisp_Object inherits_from);
 MODULE_API void deferror_massage_name_and_message (Lisp_Object *symbol,
-						   const char *name,
+						   const Ascbyte *name,
 						   Lisp_Object inherits_from);
 #define DEFERROR(name, message, inherits_from) \
   deferror_massage_name (&name, #name, message, inherits_from)
@@ -393,7 +393,7 @@
 /* Macros we use to define forwarded Lisp variables.
    These are used in the syms_of_FILENAME functions.  */
 
-MODULE_API void defvar_magic (const char *symbol_name,
+MODULE_API void defvar_magic (const Ascbyte *symbol_name,
 			      const struct symbol_value_forward *magic);
 
 #ifdef NEW_GC
@@ -459,7 +459,7 @@
   DEFVAR_SYMVAL_FWD (lname, c_location, forward_type, magicfun);	    \
   {									    \
     Lisp_Object *DSF_location = c_location; /* Type check */		    \
-    staticpro (DSF_location);						    \
+    staticpro_1 (DSF_location, lname);					    \
     if (EQ (*DSF_location, Qnull_pointer)) *DSF_location = Qnil;	    \
   }									    \
 } while (0)
--- a/src/symsinit.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/symsinit.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* Various initialization function prototypes.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 2001, 2002 Ben Wing.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -16,11 +16,14 @@
 
 You should have received a copy of the GNU General Public License
 along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor,
+Boston, MA 02111-1301, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* There is no need to put ifdefs around the prototypes here.  Extra
+prototypes won't hurt anything. */
+
 #ifndef INCLUDED_symsinit_h_
 #define INCLUDED_symsinit_h_
 
@@ -31,10 +34,10 @@
 void init_data_very_early (void);
 void init_floatfns_very_early (void);
 void init_free_hook (void);
+void init_mswindows_dde_very_early (void);
 void init_process_times_very_early (void);
 void init_ralloc (void);
 void init_signals_very_early (void);
-void init_mswindows_dde_very_early (void);
 
 /* Early Lisp-engine initialization -- dump-time only for init, dump-time
    and post-pdump-load-time for reinit.  We call the reinit() routine
@@ -43,16 +46,16 @@
    to call the routine is tricky -- the init routine might need to do some
    stuff, call the reinit() routine, and do some more stuff.) */
 
+void reinit_alloc_early (void);
 void init_alloc_once_early (void);
-void reinit_alloc_early (void);
-void init_symbols_once_early (void);
-void reinit_symbols_early (void);
+void reinit_eistring_early (void);
+void init_eistring_once_early (void);
+void init_elhash_once_early (void);
 void init_errors_once_early (void);
 void reinit_opaque_early (void);
 void init_opaque_once_early (void);
-void init_elhash_once_early (void);
-void init_eistring_once_early (void);
-void reinit_eistring_early (void);
+void reinit_symbols_early (void);
+void init_symbols_once_early (void);
 
 /* Reset the Lisp engine.  Called both at dump-time, run-time and
    run-temacs-time; at dump-time, it's called early, before any of the
@@ -73,6 +76,7 @@
 void syms_of_buffer (void);
 void syms_of_bytecode (void);
 void syms_of_callint (void);
+EXTERN_C void syms_of_canna_api (void);
 void syms_of_casefiddle (void);
 void syms_of_casetab (void);
 void syms_of_chartab (void);
@@ -85,10 +89,12 @@
 void syms_of_database (void);
 void syms_of_debug (void);
 void syms_of_device (void);
+void syms_of_device_gtk (void);
 void syms_of_device_mswindows (void);
 void syms_of_device_tty (void);
 void syms_of_device_x (void);
 void syms_of_dialog (void);
+void syms_of_dialog_gtk (void);
 void syms_of_dialog_mswindows (void);
 void syms_of_dialog_x (void);
 void syms_of_dired (void);
@@ -101,6 +107,7 @@
 void syms_of_emacs (void);
 void syms_of_eval (void);
 void syms_of_event_Xt (void);
+void syms_of_event_gtk (void);
 void syms_of_event_mswindows (void);
 void syms_of_event_stream (void);
 void syms_of_events (void);
@@ -111,10 +118,10 @@
 void syms_of_filelock (void);
 void syms_of_floatfns (void);
 void syms_of_fns (void);
-#ifdef USE_C_FONT_LOCK
 void syms_of_font_lock (void);
-#endif /* USE_C_FONT_LOCK */
+void syms_of_font_mgr (void);
 void syms_of_frame (void);
+void syms_of_frame_gtk (void);
 void syms_of_frame_mswindows (void);
 void syms_of_frame_tty (void);
 void syms_of_frame_x (void);
@@ -122,12 +129,14 @@
 void syms_of_general (void);
 void syms_of_glyphs (void);
 void syms_of_glyphs_eimage (void);
+void syms_of_glyphs_gtk (void);
 void syms_of_glyphs_mswindows (void);
 void syms_of_glyphs_shared (void);
 void syms_of_glyphs_widget (void);
 void syms_of_glyphs_x (void);
 void syms_of_gpmevent (void);
 void syms_of_gui (void);
+void syms_of_gui_gtk (void);
 void syms_of_gui_mswindows (void);
 void syms_of_gui_x (void);
 void syms_of_gutter (void);
@@ -140,16 +149,14 @@
 void syms_of_lread (void);
 void syms_of_macros (void);
 void syms_of_marker (void);
-#ifdef NEW_GC
 void syms_of_mc_alloc (void);
-#endif /* NEW_GC */
 void syms_of_md5 (void);
 void syms_of_menubar (void);
+void syms_of_menubar_gtk (void);
 void syms_of_menubar_mswindows (void);
 void syms_of_menubar_x (void);
 void syms_of_minibuf (void);
 void syms_of_module (void);
-EXTERN_C void syms_of_canna_api (void);
 void syms_of_mule_ccl (void);
 void syms_of_mule_charset (void);
 void syms_of_mule_coding (void);
@@ -157,10 +164,10 @@
 void syms_of_nt (void);
 void syms_of_number (void);
 void syms_of_objects (void);
+void syms_of_objects_gtk (void);
 void syms_of_objects_mswindows (void);
 void syms_of_objects_tty (void);
 void syms_of_objects_x (void);
-void syms_of_font_mgr (void);
 EXTERN_C void syms_of_postgresql (void);
 void syms_of_print (void);
 void syms_of_process (void);
@@ -173,6 +180,7 @@
 void syms_of_scrollbar_mswindows(void);
 void syms_of_search (void);
 void syms_of_select (void);
+void syms_of_select_gtk (void);
 void syms_of_select_mswindows (void);
 void syms_of_select_x (void);
 void syms_of_signal (void);
@@ -185,9 +193,12 @@
 void syms_of_text (void);
 void syms_of_toolbar (void);
 void syms_of_tooltalk (void);
+void syms_of_ui_byhand (void);
+void syms_of_ui_gtk (void);
 void syms_of_undo (void);
 void syms_of_unicode (void);
 void syms_of_widget (void);
+void syms_of_widget_accessors (void);
 void syms_of_win32 (void);
 void syms_of_window (void);
 
@@ -195,49 +206,61 @@
    post-pdump-load-time only for reinit_). */
 
 void console_type_create (void);
-void console_type_create_stream (void);
-void reinit_console_type_create_stream (void);
-void console_type_create_tty (void);
-void reinit_console_type_create_tty (void);
+void console_type_create_device_gtk (void);
+void console_type_create_device_mswindows (void);
 void console_type_create_device_tty (void);
-void console_type_create_frame_tty (void);
-void console_type_create_objects_tty (void);
-void console_type_create_redisplay_tty (void);
-void console_type_create_x (void);
-void reinit_console_type_create_x (void);
 void console_type_create_device_x (void);
 void reinit_console_type_create_device_x (void);
+void console_type_create_dialog_gtk (void);
+void console_type_create_dialog_mswindows (void);
+void console_type_create_dialog_x (void);
+void console_type_create_frame_gtk (void);
+void console_type_create_frame_mswindows (void);
+void console_type_create_frame_tty (void);
 void console_type_create_frame_x (void);
+void console_type_create_glyphs_gtk (void);
+void console_type_create_glyphs_mswindows (void);
 void console_type_create_glyphs_x (void);
+void console_type_create_gtk (void);
+void reinit_console_type_create_gtk (void);
+void console_type_create_menubar_gtk (void);
+void console_type_create_menubar_mswindows (void);
 void console_type_create_menubar_x (void);
-void console_type_create_objects_x (void);
-void console_type_create_redisplay_x (void);
-void console_type_create_scrollbar_x (void);
-void console_type_create_select_x (void);
-void console_type_create_toolbar_x (void);
-void console_type_create_dialog_x (void);
 void console_type_create_mswindows (void);
 void reinit_console_type_create_mswindows (void);
-void console_type_create_device_mswindows (void);
-void console_type_create_frame_mswindows (void);
-void console_type_create_menubar_mswindows (void);
+void console_type_create_objects_gtk (void);
 void console_type_create_objects_mswindows (void);
+void console_type_create_objects_tty (void);
+void console_type_create_objects_x (void);
+void console_type_create_redisplay_gtk (void);
 void console_type_create_redisplay_mswindows (void);
+void console_type_create_redisplay_tty (void);
+void console_type_create_redisplay_x (void);
+void console_type_create_scrollbar_gtk (void);
 void console_type_create_scrollbar_mswindows (void);
+void console_type_create_scrollbar_x (void);
+void console_type_create_select_gtk (void);
+void console_type_create_select_mswindows (void);
+void console_type_create_select_x (void);
+void console_type_create_stream (void);
+void reinit_console_type_create_stream (void);
+void console_type_create_toolbar_gtk (void);
 void console_type_create_toolbar_mswindows (void);
-void console_type_create_glyphs_mswindows (void);
-void console_type_create_dialog_mswindows (void);
-void console_type_create_select_mswindows (void);
+void console_type_create_toolbar_x (void);
+void console_type_create_tty (void);
+void reinit_console_type_create_tty (void);
+void console_type_create_x (void);
+void reinit_console_type_create_x (void);
 
 /* Initialize the specifier types (dump-time only for specifier_type_(),
    post-pdump-load-time only for reinit_). */
 
 void specifier_type_create (void);
 void reinit_specifier_type_create (void);
+void specifier_type_create_gutter (void);
+void reinit_specifier_type_create_gutter (void);
 void specifier_type_create_image (void);
 void reinit_specifier_type_create_image (void);
-void specifier_type_create_gutter (void);
-void reinit_specifier_type_create_gutter (void);
 void specifier_type_create_objects (void);
 void reinit_specifier_type_create_objects (void);
 void specifier_type_create_toolbar (void);
@@ -248,36 +271,37 @@
 
 void coding_system_type_create (void);
 void reinit_coding_system_type_create (void);
-void coding_system_type_create_unicode (void);
-void reinit_coding_system_type_create_unicode (void);
 void coding_system_type_create_intl_win32 (void);
 void reinit_coding_system_type_create_intl_win32 (void);
 void coding_system_type_create_mule_coding (void);
 void reinit_coding_system_type_create_mule_coding (void);
+void coding_system_type_create_unicode (void);
+void reinit_coding_system_type_create_unicode (void);
 
 /* Initialize the structure types (dump-time only). */
 
 void structure_type_create (void);
 void structure_type_create_chartab (void);
 void structure_type_create_faces (void);
+void structure_type_create_hash_table (void);
 void structure_type_create_rangetab (void);
-void structure_type_create_hash_table (void);
 
 /* Initialize the image instantiator types (dump-time only). */
 
 void image_instantiator_format_create (void);
 void image_instantiator_format_create_glyphs_eimage (void);
+void image_instantiator_format_create_glyphs_gtk (void);
+void image_instantiator_format_create_glyphs_mswindows (void);
+void image_instantiator_format_create_glyphs_tty (void);
 void image_instantiator_format_create_glyphs_widget (void);
 void image_instantiator_format_create_glyphs_x (void);
-void image_instantiator_format_create_glyphs_mswindows (void);
-void image_instantiator_format_create_glyphs_tty (void);
 
 /* Initialize the lstream types (dump-time only). */
 
 void lstream_type_create (void);
 void lstream_type_create_file_coding (void);
+void lstream_type_create_mswindows_selectable (void);
 void lstream_type_create_print (void);
-void lstream_type_create_mswindows_selectable (void);
 
 /* Initialize process types */
 
@@ -288,6 +312,18 @@
 
 void init_provide_once (void);
 
+/* Lisp interactive function to sort groups of initialization functions by
+   name, ignoring any reinit_ or init_ at the beginning.  Put the cursor
+   after the last right paren, type C-x C-e, then select some text and
+   M-x sort-symsinit.
+
+   (defun sort-symsinit (start end)
+     (interactive "r")
+     (sort-regexp-fields nil "^.*?void \\(?:re\\)?\\(init_\\)?\\([A-Za-z0-9_]+\\).*$" "\\2"
+			 start end))
+
+*/
+
 /* Initialize most variables (dump-time for vars_, dump-time and
    post-pdump-load-time for reinit_vars). */
 
@@ -297,14 +333,17 @@
 void vars_of_buffer (void);
 void reinit_vars_of_buffer (void);
 void vars_of_bytecode (void);
+void reinit_vars_of_bytecode (void);
 void vars_of_callint (void);
+EXTERN_C void vars_of_canna_api (void);
 void vars_of_chartab (void);
 void vars_of_cmdloop (void);
 void vars_of_cmds (void);
 void vars_of_console (void);
 void reinit_vars_of_console (void);
+void vars_of_console_gtk (void);
+void vars_of_console_mswindows (void);
 void vars_of_console_stream (void);
-void vars_of_console_mswindows (void);
 void vars_of_console_tty (void);
 void vars_of_console_x (void);
 void vars_of_data (void);
@@ -313,28 +352,33 @@
 void reinit_vars_of_debug (void);
 void vars_of_device (void);
 void reinit_vars_of_device (void);
+void vars_of_device_gtk (void);
 void vars_of_device_mswindows (void);
 void vars_of_device_x (void);
 void reinit_vars_of_device_x (void);
 void vars_of_dialog (void);
+void vars_of_dialog_gtk (void);
+void vars_of_dialog_mswindows (void);
 void vars_of_dialog_x (void);
-void vars_of_dialog_mswindows (void);
 void vars_of_dired (void);
 void vars_of_dired_mswindows (void);
 void vars_of_doc (void);
 void vars_of_dragdrop (void);
 void vars_of_editfns (void);
+EXTERN_C void vars_of_eldap (void);
 void vars_of_emacs (void);
 void vars_of_eval (void);
 void reinit_vars_of_eval (void);
+void vars_of_event_Xt (void);
+void reinit_vars_of_event_Xt (void);
+void vars_of_event_gtk (void);
+void reinit_vars_of_event_gtk (void);
+void vars_of_event_mswindows (void);
+void reinit_vars_of_event_mswindows (void);
 void vars_of_event_stream (void);
 void reinit_vars_of_event_stream (void);
 void vars_of_event_tty (void);
 void reinit_vars_of_event_tty (void);
-void vars_of_event_mswindows (void);
-void reinit_vars_of_event_mswindows (void);
-void vars_of_event_Xt (void);
-void reinit_vars_of_event_Xt (void);
 void vars_of_events (void);
 void reinit_vars_of_events (void);
 void vars_of_extents (void);
@@ -343,33 +387,39 @@
 void vars_of_file_coding (void);
 void reinit_vars_of_file_coding (void);
 void vars_of_fileio (void);
+#ifdef USE_C_FONT_LOCK
 void reinit_vars_of_fileio (void);
 void vars_of_filelock (void);
+#endif /* USE_C_FONT_LOCK */
 void vars_of_floatfns (void);
 void vars_of_fns (void);
-#ifdef USE_C_FONT_LOCK
 void vars_of_font_lock (void);
 void reinit_vars_of_font_lock (void);
-#endif /* USE_C_FONT_LOCK */
-void vars_of_frame_tty (void);
+void vars_of_font_mgr (void);
+void reinit_vars_of_font_mgr (void);
+void vars_of_frame (void);
+void vars_of_frame_gtk (void);
 void vars_of_frame_mswindows (void);
 void reinit_vars_of_frame_mswindows (void);
+void vars_of_frame_tty (void);
 void vars_of_frame_x (void);
-void vars_of_frame (void);
-void vars_of_glyphs_x (void);
+void vars_of_glyphs (void);
+void reinit_vars_of_glyphs (void);
 void vars_of_glyphs_eimage (void);
+void vars_of_glyphs_gtk (void);
+void vars_of_glyphs_mswindows (void);
 void vars_of_glyphs_widget (void);
 void reinit_vars_of_glyphs_widget (void);
-void vars_of_glyphs_mswindows (void);
-void vars_of_glyphs (void);
-void reinit_vars_of_glyphs (void);
+void vars_of_glyphs_x (void);
+void vars_of_gpmevent (void);
+void vars_of_gui (void);
+void vars_of_gui_gtk (void);
 void vars_of_gui_x (void);
 void reinit_vars_of_gui_x (void);
-void vars_of_gui (void);
 void vars_of_gutter (void);
+void vars_of_indent (void);
 void vars_of_input_method_motif (void);
 void vars_of_input_method_xlib (void);
-void vars_of_indent (void);
 void vars_of_insdel (void);
 void reinit_vars_of_insdel (void);
 void vars_of_intl (void);
@@ -381,15 +431,16 @@
 void reinit_vars_of_lstream (void);
 void vars_of_macros (void);
 void vars_of_md5 (void);
+void vars_of_menubar (void);
+void vars_of_menubar_gtk (void);
+void reinit_vars_of_menubar_gtk (void);
+void vars_of_menubar_mswindows (void);
 void vars_of_menubar_x (void);
 void reinit_vars_of_menubar_x (void);
-void vars_of_menubar (void);
-void vars_of_menubar_mswindows (void);
 void vars_of_minibuf (void);
 void reinit_vars_of_minibuf (void);
 void vars_of_module (void);
 void reinit_vars_of_module (void);
-EXTERN_C void vars_of_canna_api (void);
 void vars_of_mule_ccl(void);
 void vars_of_mule_charset (void);
 void vars_of_mule_coding (void);
@@ -398,14 +449,15 @@
 void reinit_vars_of_mule_wnn (void);
 void vars_of_nt (void);
 void vars_of_number (void);
+void reinit_vars_of_number (void);
+void reinit_vars_of_object_mswindows (void);
 void vars_of_objects (void);
-void vars_of_font_mgr (void);
-void reinit_vars_of_font_mgr (void);
 void reinit_vars_of_objects (void);
-void vars_of_objects_tty (void);
+void vars_of_objects_gtk (void);
 void vars_of_objects_mswindows (void);
-void reinit_vars_of_object_mswindows (void);
+void vars_of_objects_tty (void);
 void vars_of_objects_x (void);
+EXTERN_C void vars_of_postgresql (void);
 void vars_of_print (void);
 void reinit_vars_of_print (void);
 void vars_of_process (void);
@@ -416,14 +468,18 @@
 void vars_of_realpath (void);
 void vars_of_redisplay (void);
 void vars_of_regex (void);
+void vars_of_scrollbar (void);
+void vars_of_scrollbar_gtk (void);
+void vars_of_scrollbar_mswindows (void);
 void vars_of_scrollbar_x (void);
 void reinit_vars_of_scrollbar_x (void);
-void vars_of_scrollbar (void);
-void vars_of_scrollbar_mswindows (void);
 void vars_of_search (void);
 void reinit_vars_of_search (void);
 void vars_of_select (void);
+void vars_of_select_gtk (void);
 void vars_of_select_mswindows (void);
+void vars_of_select_x (void);
+void reinit_vars_of_select_x (void);
 void vars_of_sound (void);
 void vars_of_specifier (void);
 void vars_of_sunpro (void);
@@ -434,17 +490,13 @@
 void reinit_vars_of_text (void);
 void vars_of_toolbar (void);
 void vars_of_tooltalk (void);
+void vars_of_ui_gtk (void);
 void vars_of_undo (void);
 void reinit_vars_of_undo (void);
 void vars_of_unicode (void);
+void vars_of_win32 (void);
 void vars_of_window (void);
 void reinit_vars_of_window (void);
-void vars_of_win32 (void);
-void vars_of_select_x (void);
-void reinit_vars_of_select_x (void);
-EXTERN_C void vars_of_eldap (void);
-EXTERN_C void vars_of_postgresql (void);
-void vars_of_gpmevent (void);
 
 /* Initialize specifier variables (dump-time only). */
 
@@ -463,29 +515,31 @@
    #### The reinit_() functions should be called from emacs.c, not the
    corresponding complex_vars_of_(). */
 
-void complex_vars_of_faces (void);
-void complex_vars_of_mule_charset (void);
-void complex_vars_of_file_coding (void);
-void complex_vars_of_intl_win32 (void);
-void complex_vars_of_glyphs (void);
-void complex_vars_of_glyphs_x (void);
-void complex_vars_of_glyphs_mswindows (void);
 void complex_vars_of_alloc (void);
-void complex_vars_of_menubar (void);
-void complex_vars_of_scrollbar (void);
-void complex_vars_of_frame (void);
-void complex_vars_of_syntax (void);
+void complex_vars_of_buffer (void);
+void reinit_complex_vars_of_buffer_runtime_only (void);
 void complex_vars_of_casetab (void);
 void complex_vars_of_chartab (void);
-void complex_vars_of_buffer (void);
-void reinit_complex_vars_of_buffer_runtime_only (void);
 void complex_vars_of_console (void);
 void reinit_complex_vars_of_console_runtime_only (void);
 void complex_vars_of_emacs (void);
+void complex_vars_of_faces (void);
+void complex_vars_of_file_coding (void);
+void complex_vars_of_font_mgr (void);
+void complex_vars_of_frame (void);
+void complex_vars_of_glyphs (void);
+void complex_vars_of_glyphs_gtk (void);
+void complex_vars_of_glyphs_mswindows (void);
+void complex_vars_of_glyphs_x (void);
+void complex_vars_of_intl_win32 (void);
+void complex_vars_of_keymap (void);
+void complex_vars_of_menubar (void);
 void complex_vars_of_minibuf (void);
 void reinit_complex_vars_of_minibuf (void);
-void complex_vars_of_keymap (void);
-void complex_vars_of_font_mgr (void);
+void complex_vars_of_mule_charset (void);
+void complex_vars_of_scrollbar (void);
+void complex_vars_of_syntax (void);
+void complex_vars_of_unicode (void);
 
 /* Late initialization -- stuff pertaining only to interactive usage,
    I/O, or Lisp reading. (Dump-time and run-time, but the code itself
@@ -497,6 +551,7 @@
 void init_device_tty (void);
 void init_editfns (void);
 void init_event_Xt_late (void);
+void init_event_gtk_late (void);
 void init_event_mswindows_late (void);
 void init_event_stream (void);
 void init_event_tty_late (void);
@@ -516,47 +571,6 @@
 void init_win32 (void);
 void init_xemacs_process (void);
 
-void syms_of_device_gtk (void);
-void syms_of_dialog_gtk (void);
-void syms_of_event_gtk (void);
-void syms_of_frame_gtk (void);
-void syms_of_glyphs_gtk (void);
-void syms_of_gui_gtk (void);
-void syms_of_menubar_gtk (void);
-void syms_of_objects_gtk (void);
-void syms_of_select_gtk (void);
-void syms_of_ui_gtk (void);
-void syms_of_widget_accessors (void);
-void syms_of_ui_byhand (void);
-void console_type_create_gtk (void);
-void reinit_console_type_create_gtk (void);
-void console_type_create_device_gtk (void);
-void console_type_create_frame_gtk (void);
-void console_type_create_glyphs_gtk (void);
-void console_type_create_menubar_gtk (void);
-void console_type_create_objects_gtk (void);
-void console_type_create_redisplay_gtk (void);
-void console_type_create_scrollbar_gtk (void);
-void console_type_create_toolbar_gtk (void);
-void console_type_create_dialog_gtk (void);
-void image_instantiator_format_create_glyphs_gtk (void);
-void vars_of_device_gtk (void);
-void vars_of_dialog_gtk (void);
-void vars_of_event_gtk (void);
-void reinit_vars_of_event_gtk (void);
-void vars_of_frame_gtk (void);
-void vars_of_glyphs_gtk (void);
-void vars_of_gui_gtk (void);
-void vars_of_menubar_gtk (void);
-void reinit_vars_of_menubar_gtk (void);
-void vars_of_objects_gtk (void);
-void vars_of_scrollbar_gtk (void);
-void vars_of_select_gtk (void);
-void vars_of_ui_gtk (void);
-void complex_vars_of_glyphs_gtk (void);
-void init_event_gtk_late (void);
-void console_type_create_select_gtk (void);
-
 /* Enhanced number initialization: must be done only at runtime due to complex
    interactions with the supporting libraries. */
 void init_number (void);
--- a/src/syntax.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/syntax.c	Wed Feb 24 01:58:04 2010 -0600
@@ -69,6 +69,8 @@
 /* A value that is guaranteed not be in a syntax table. */
 Lisp_Object Vbogus_syntax_table_value;
 
+Lisp_Object Qscan_error;
+
 static void syntax_cache_table_was_changed (struct buffer *buf);
 
 /* This is the internal form of the parse state used in parse-partial-sexp.  */
@@ -546,7 +548,7 @@
 uninit_buffer_syntax_cache (struct buffer *UNUSED_IF_NEW_GC (buf))
 {
 #ifndef NEW_GC
-  xfree (buf->syntax_cache, struct syntax_cache *);
+  xfree (buf->syntax_cache);
   buf->syntax_cache = 0;
 #endif /* not NEW_GC */
 }
@@ -1350,6 +1352,7 @@
   int syncode;
   int min_depth = depth;    /* Err out if depth gets less than this. */
   struct syntax_cache *scache;
+  Charbpos last_good = from;
   
   if (depth > 0) min_depth = 0;
 
@@ -1367,6 +1370,8 @@
 	  c = BUF_FETCH_CHAR (buf, from);
 	  syncode = SYNTAX_CODE_FROM_CACHE (scache, c);
 	  code = SYNTAX_FROM_CODE (syncode);
+	  if (depth == min_depth)
+	    last_good = from;
 	  from++;
 
 	  /* a 1-char comment start sequence */
@@ -1480,8 +1485,9 @@
 	      {
 		if (noerror)
 		  return Qnil;
-		syntax_error ("Containing expression ends prematurely",
-			      Qunbound);
+		signal_error_2 (Qscan_error,
+				"Containing expression ends prematurely",
+				make_int (last_good), make_int (from));
 	      }
 	    break;
 
@@ -1653,8 +1659,9 @@
 	      {
 		if (noerror)
 		  return Qnil;
-		syntax_error ("Containing expression ends prematurely",
-			      Qunbound);
+		signal_error_2 (Qscan_error,
+				"Containing expression ends prematurely",
+				make_int (last_good), make_int (from));
 	      }
 	    break;
 
@@ -1724,7 +1731,8 @@
 
 lose:
   if (!noerror)
-    syntax_error ("Unbalanced parentheses", Qunbound);
+    signal_error_2 (Qscan_error, "Unbalanced parentheses",
+		    make_int (last_good), make_int (from));
   return Qnil;
 }
 
@@ -2287,7 +2295,7 @@
 copy_to_mirrortab (struct chartab_range *range, Lisp_Object UNUSED (table),
 		   Lisp_Object val, void *arg)
 {
-  Lisp_Object mirrortab = VOID_TO_LISP (arg);
+  Lisp_Object mirrortab = GET_LISP_FROM_VOID (arg);
 
   if (CONSP (val))
     val = XCAR (val);
@@ -2301,7 +2309,7 @@
 			     Lisp_Object UNUSED (table),
 			     Lisp_Object val, void *arg)
 {
-  Lisp_Object mirrortab = VOID_TO_LISP (arg);
+  Lisp_Object mirrortab = GET_LISP_FROM_VOID (arg);
   if (CONSP (val))
     val = XCAR (val);
   if (SYNTAX_FROM_CODE (XINT (val)) != Sinherit)
@@ -2346,12 +2354,12 @@
      another mapping.)
      */
 
-  map_char_table (table, &range, copy_to_mirrortab, LISP_TO_VOID (mirrortab));
+  map_char_table (table, &range, copy_to_mirrortab, STORE_LISP_IN_VOID (mirrortab));
   /* second clause catches bootstrapping problems when initializing the
      standard syntax table */
   if (!EQ (table, Vstandard_syntax_table) && !NILP (Vstandard_syntax_table))
     map_char_table (Vstandard_syntax_table, &range,
-		    copy_if_not_already_present, LISP_TO_VOID (mirrortab));
+		    copy_if_not_already_present, STORE_LISP_IN_VOID (mirrortab));
   /* The resetting made the default be Qnil.  Put it back to Sword. */
   set_char_table_default (mirrortab, make_int (Sword));
   XCHAR_TABLE (mirrortab)->dirty = 0;
@@ -2415,6 +2423,8 @@
   DEFSUBR (Fscan_sexps);
   DEFSUBR (Fbackward_prefix_chars);
   DEFSUBR (Fparse_partial_sexp);
+
+  DEFERROR_STANDARD (Qscan_error, Qsyntax_error);
 }
 
 void
--- a/src/sysdep.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sysdep.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Interfaces to system-dependent kernel and library entries.
    Copyright (C) 1985-1988, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Tinker Systems.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -2037,11 +2037,10 @@
 #elif !defined (HAVE_GETHOSTNAME)
   struct utsname uts;
   uname (&uts);
-  Vsystem_name = build_string (uts.nodename);
+  Vsystem_name = build_extstring (uts.nodename, Qunix_host_name_encoding);
 #else /* HAVE_GETHOSTNAME */
   int hostname_size = 256;
-  /* !!#### Needs review */
-  char *hostname = (char *) ALLOCA (hostname_size);
+  Extbyte *hostname = alloca_extbytes (hostname_size);
 
   /* Try to get the host name; if the buffer is too short, try
      again.  Apparently, the only indication gethostname gives of
@@ -2057,17 +2056,17 @@
 	break;
 
       hostname_size <<= 1;
-  /* !!#### Needs review */
-      hostname = (char *) ALLOCA (hostname_size);
+      hostname = alloca_extbytes (hostname_size);
     }
-# if defined( HAVE_SOCKETS)
+# if defined (HAVE_SOCKETS)
   /* Turn the hostname into the official, fully-qualified hostname.
      Don't do this if we're going to dump; this can confuse system
      libraries on some machines and make the dumped emacs core dump. */
   if (initialized)
+    /* !!#### Could fail if we have a 7-bit external encoding */
     if (!strchr (hostname, '.'))
       {
-#  if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO))
+#  if !(defined (HAVE_GETADDRINFO) && defined (HAVE_GETNAMEINFO))
 	struct hostent *hp = NULL;
 	int count;
 #   ifdef TRY_AGAIN
@@ -2087,20 +2086,20 @@
 #   endif
 	if (hp)
 	  {
-	    const char *fqdn = (const char *) hp->h_name;
-
+	    const Extbyte *fqdn = (const Extbyte *) hp->h_name;
+
+	    /* !!#### Could fail if we have a 7-bit external encoding */
 	    if (!strchr (fqdn, '.'))
 	      {
 		/* We still don't have a fully qualified domain name.
 		   Try to find one in the list of alternate names */
-		char **alias = hp->h_aliases;
+		Extbyte **alias = hp->h_aliases;
 		while (*alias && !strchr (*alias, '.'))
 		  alias++;
 		if (*alias)
 		  fqdn = *alias;
 	      }
-  /* !!#### Needs review */
-	    hostname = (char *) ALLOCA (strlen (fqdn) + 1);
+	    hostname = alloca_extbytes (strlen (fqdn) + 1);
 	    strcpy (hostname, fqdn);
 	  }
 #  else /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */
@@ -2117,8 +2116,7 @@
 	hints.ai_protocol = 0;
 	if (!getaddrinfo (hostname, NULL, &hints, &res))
 	  {
-  /* !!#### Needs review */
-	    hostname = (char *) ALLOCA (strlen (res->ai_canonname) + 1);
+	    hostname = alloca_extbytes (strlen (res->ai_canonname) + 1);
 	    strcpy (hostname, res->ai_canonname);
 
 	    freeaddrinfo (res);
@@ -2126,7 +2124,7 @@
 #  endif  /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */
       }
 # endif /* HAVE_SOCKETS */
-  Vsystem_name = build_string (hostname);
+  Vsystem_name = build_extstring (hostname, Qunix_host_name_encoding);
 #endif /* HAVE_GETHOSTNAME  */
   {
     Ibyte *p;
@@ -2775,7 +2773,7 @@
 
       Dynarr_add_many (internal_DIRENTRY, internal_name, internal_len);
       Dynarr_add (internal_DIRENTRY, '\0'); /* NUL-terminate */
-      return (DIRENTRY *) Dynarr_atp (internal_DIRENTRY, 0);
+      return (DIRENTRY *) Dynarr_begin (internal_DIRENTRY);
     }
   }
 #endif /* MULE */
@@ -2835,8 +2833,8 @@
       if (ret)
 	{
 	  Ibyte *retin;
-	  TSTR_TO_C_STRING_MALLOC (ret, retin);
-	  xfree (cwd, Extbyte *);
+	  retin = TSTR_TO_ITEXT_MALLOC (ret);
+	  xfree (cwd);
 	  return retin;
 	}
 #else
@@ -2844,8 +2842,8 @@
       if (ret)
 	{
 	  Ibyte *retin;
-	  EXTERNAL_TO_C_STRING_MALLOC (ret, retin, Qfile_name);
-	  xfree (cwd, Extbyte *);
+	  retin = EXTERNAL_TO_ITEXT_MALLOC (ret, Qfile_name);
+	  xfree (cwd);
 	  return retin;
 	}
 #endif /* WIN32_NATIVE */
@@ -2857,17 +2855,17 @@
 	}
       else
 	{
-	  xfree (cwd, Extbyte *);
+	  xfree (cwd);
 	  return NULL;
 	}
     }
 #else
-  Extbyte chingame_limitos_arbitrarios[PATH_MAX_EXTERNAL];
+  Extbyte chingame_limitos_arbitrarios[PATH_MAX_TCHAR];
   Ibyte *ret2;
 
   if (!getwd (chingame_limitos_arbitrarios))
     return 0;
-  EXTERNAL_TO_C_STRING_MALLOC (chingame_limitos_arbitrarios, ret2, Qfile_name);
+  ret2 = EXTERNAL_TO_ITEXT_MALLOC (chingame_limitos_arbitrarios, Qfile_name);
   return ret2;
 #endif /* HAVE_GETCWD */
 }
@@ -2941,7 +2939,7 @@
 	  resolved = mswindows_read_link (eidata (name2));
 	  if (resolved)
 	    {
-	      xfree (resolved, Ibyte *);
+	      xfree (resolved);
 	      return mswindows_stat (eidata (name2), buf);
 	    }
 	}
@@ -3092,14 +3090,14 @@
     ;
   new_argv = alloca_array (Extbyte *, argc + 1);
   for (i = 0; i < argc; i++)
-    C_STRING_TO_EXTERNAL (argv[i], new_argv[i], Qnative);
+    new_argv[i] = ITEXT_TO_EXTERNAL (argv[i], Qcommand_argument_encoding);
   new_argv[argc] = NULL;
 
   for (envc = 0; envp[envc]; envc++)
     ;
   new_envp = alloca_array (Extbyte *, envc + 1);
   for (i = 0; i < envc; i++)
-    C_STRING_TO_EXTERNAL (envp[i], new_envp[i], Qnative);
+    new_envp[i] = ITEXT_TO_EXTERNAL (envp[i], Qenvironment_variable_encoding);
   new_envp[envc] = NULL;
 
 #if defined (WIN32_NATIVE)
@@ -3133,32 +3131,32 @@
     return NULL;
 
   if (cached_pwd.pw_name)
-    xfree (cached_pwd.pw_name, char *);
+    xfree (cached_pwd.pw_name);
   if (cached_pwd.pw_passwd)
-    xfree (cached_pwd.pw_passwd, char *);
+    xfree (cached_pwd.pw_passwd);
   if (cached_pwd.pw_gecos)
-    xfree (cached_pwd.pw_gecos, char *);
+    xfree (cached_pwd.pw_gecos);
   if (cached_pwd.pw_dir)
-    xfree (cached_pwd.pw_dir, char *);
+    xfree (cached_pwd.pw_dir);
   if (cached_pwd.pw_shell)
-    xfree (cached_pwd.pw_shell, char *);
+    xfree (cached_pwd.pw_shell);
 
   cached_pwd = *pwd;
-  if (cached_pwd.pw_name)
-    TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_name,
-			C_STRING_MALLOC, cached_pwd.pw_name, Qnative);
-  if (cached_pwd.pw_passwd)
-    TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_passwd,
-			C_STRING_MALLOC, cached_pwd.pw_passwd, Qnative);
-  if (cached_pwd.pw_gecos)
-    TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_gecos,
-			C_STRING_MALLOC, cached_pwd.pw_gecos, Qnative);
-  if (cached_pwd.pw_dir)
-    TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_dir,
-			C_STRING_MALLOC, cached_pwd.pw_dir, Qfile_name);
-  if (cached_pwd.pw_shell)
-    TO_INTERNAL_FORMAT (C_STRING, cached_pwd.pw_shell,
-			C_STRING_MALLOC, cached_pwd.pw_shell, Qfile_name);
+
+#define FROB(field, encoding)					\
+do								\
+{								\
+  if (cached_pwd.field)						\
+    cached_pwd.field = (CIbyte *)				\
+      EXTERNAL_TO_ITEXT_MALLOC (cached_pwd.field, encoding);	\
+} while (0)
+
+  FROB (pw_name, Quser_name_encoding);
+  FROB (pw_passwd, Quser_name_encoding);
+  FROB (pw_gecos, Quser_name_encoding);
+  FROB (pw_dir, Qfile_name);
+  FROB (pw_shell, Qfile_name);
+#undef FROB
   return &cached_pwd;
 }
 
@@ -3169,8 +3167,7 @@
   /* Synthetic versions are defined in nt.c and already do conversion. */
   return getpwnam (name);
 #else
-  Extbyte *nameext;
-  C_STRING_TO_EXTERNAL (name, nameext, Qnative);
+  Extbyte *nameext = ITEXT_TO_EXTERNAL (name, Quser_name_encoding);
 
   return copy_in_passwd (getpwnam (nameext));
 #endif /* WIN32_NATIVE */
@@ -3209,8 +3206,8 @@
   if (!str) /* can happen on MS Windows */
     return (Ibyte *) "Sun Jan 01 00:00:00 1970";
   if (ctime_static)
-    xfree (ctime_static, Ibyte *);
-  EXTERNAL_TO_C_STRING_MALLOC (str, ctime_static, Qnative);
+    xfree (ctime_static);
+  ctime_static = EXTERNAL_TO_ITEXT_MALLOC (str, Qtime_function_encoding);
   return ctime_static;
 }
 
@@ -3385,14 +3382,14 @@
   Extbyte *filename;
   utb.actime = EMACS_SECS (atime);
   utb.modtime = EMACS_SECS (mtime);
-  LISP_STRING_TO_EXTERNAL (path, filename, Qfile_name);
+  LISP_PATHNAME_CONVERT_OUT (path, filename);
   return utime (filename, &utb);
 #elif defined (HAVE_UTIMES)
   struct timeval tv[2];
   Extbyte *filename;
   tv[0] = atime;
   tv[1] = mtime;
-  LISP_STRING_TO_EXTERNAL (path, filename, Qfile_name);
+  LISP_PATHNAME_CONVERT_OUT (path, filename);
   return utimes (filename, tv);
 #else
   /* No file times setting function available. */
@@ -3568,7 +3565,7 @@
 #if defined(WIN32_NATIVE) || defined(CYGWIN)
 const char *sys_siglist[] =
   {
-    /* $$####begin-snarf */
+    /* @@@begin-snarf@@@ */
     "bum signal!!",
     "hangup",
     "interrupt",
@@ -3594,8 +3591,8 @@
     "background write attempted from control tty",
     "input record available at control tty",
     "exceeded CPU time limit",
-    "exceeded file size limit"
-    /* $$####end-snarf */
+    "exceeded file size limit",
+    /* @@@end-snarf@@@ */
     };
 #endif
 
@@ -3604,83 +3601,85 @@
 const char *sys_siglist[NSIG + 1] =
   {
     /* AIX has changed the signals a bit */
-    DEFER_GETTEXT ("bogus signal"),			/* 0 */
-    DEFER_GETTEXT ("hangup"),				/* 1  SIGHUP */
-    DEFER_GETTEXT ("interrupt"),			/* 2  SIGINT */
-    DEFER_GETTEXT ("quit"),				/* 3  SIGQUIT */
-    DEFER_GETTEXT ("illegal instruction"),		/* 4  SIGILL */
-    DEFER_GETTEXT ("trace trap"),			/* 5  SIGTRAP */
-    DEFER_GETTEXT ("IOT instruction"),			/* 6  SIGIOT */
-    DEFER_GETTEXT ("crash likely"),			/* 7  SIGDANGER */
-    DEFER_GETTEXT ("floating point exception"),		/* 8  SIGFPE */
-    DEFER_GETTEXT ("kill"),				/* 9  SIGKILL */
-    DEFER_GETTEXT ("bus error"),			/* 10 SIGBUS */
-    DEFER_GETTEXT ("segmentation violation"),		/* 11 SIGSEGV */
-    DEFER_GETTEXT ("bad argument to system call"),	/* 12 SIGSYS */
-    DEFER_GETTEXT ("write on a pipe with no one to read it"), /* 13 SIGPIPE */
-    DEFER_GETTEXT ("alarm clock"),			/* 14 SIGALRM */
-    DEFER_GETTEXT ("software termination signal"),	/* 15 SIGTERM */
-    DEFER_GETTEXT ("user defined signal 1"),		/* 16 SIGUSR1 */
-    DEFER_GETTEXT ("user defined signal 2"),		/* 17 SIGUSR2 */
-    DEFER_GETTEXT ("death of a child"),			/* 18 SIGCLD */
-    DEFER_GETTEXT ("power-fail restart"),		/* 19 SIGPWR */
-    DEFER_GETTEXT ("bogus signal"),			/* 20 */
-    DEFER_GETTEXT ("bogus signal"),			/* 21 */
-    DEFER_GETTEXT ("bogus signal"),			/* 22 */
-    DEFER_GETTEXT ("bogus signal"),			/* 23 */
-    DEFER_GETTEXT ("bogus signal"),			/* 24 */
-    DEFER_GETTEXT ("LAN I/O interrupt"),		/* 25 SIGAIO */
-    DEFER_GETTEXT ("PTY I/O interrupt"),		/* 26 SIGPTY */
-    DEFER_GETTEXT ("I/O intervention required"),	/* 27 SIGIOINT */
-    /* $$####end-snarf */
+    /* @@@begin-snarf@@@ */
+    "bogus signal",				/* 0 */
+    "hangup",					/* 1  SIGHUP */
+    "interrupt",				/* 2  SIGINT */
+    "quit",					/* 3  SIGQUIT */
+    "illegal instruction",			/* 4  SIGILL */
+    "trace trap",				/* 5  SIGTRAP */
+    "IOT instruction",				/* 6  SIGIOT */
+    "crash likely",				/* 7  SIGDANGER */
+    "floating point exception",			/* 8  SIGFPE */
+    "kill",					/* 9  SIGKILL */
+    "bus error",				/* 10 SIGBUS */
+    "segmentation violation",			/* 11 SIGSEGV */
+    "bad argument to system call",		/* 12 SIGSYS */
+    "write on a pipe with no one to read it",	/* 13 SIGPIPE */
+    "alarm clock",				/* 14 SIGALRM */
+    "software termination signal",		/* 15 SIGTERM */
+    "user defined signal 1",			/* 16 SIGUSR1 */
+    "user defined signal 2",			/* 17 SIGUSR2 */
+    "death of a child",				/* 18 SIGCLD */
+    "power-fail restart",			/* 19 SIGPWR */
+    "bogus signal",				/* 20 */
+    "bogus signal",				/* 21 */
+    "bogus signal",				/* 22 */
+    "bogus signal",				/* 23 */
+    "bogus signal",				/* 24 */
+    "LAN I/O interrupt",			/* 25 SIGAIO */
+    "PTY I/O interrupt",			/* 26 SIGPTY */
+    "I/O intervention required",		/* 27 SIGIOINT */
+    /* @@@end-snarf@@@ */
     0
   };
 #else /* USG, not AIX */
 const char *sys_siglist[NSIG + 1] =
   {
-    DEFER_GETTEXT ("bogus signal"),			/* 0 */
-    DEFER_GETTEXT ("hangup"),				/* 1  SIGHUP */
-    DEFER_GETTEXT ("interrupt"),			/* 2  SIGINT */
-    DEFER_GETTEXT ("quit"),				/* 3  SIGQUIT */
-    DEFER_GETTEXT ("illegal instruction"),		/* 4  SIGILL */
-    DEFER_GETTEXT ("trace trap"),			/* 5  SIGTRAP */
-    DEFER_GETTEXT ("IOT instruction"),			/* 6  SIGIOT */
-    DEFER_GETTEXT ("EMT instruction"),			/* 7  SIGEMT */
-    DEFER_GETTEXT ("floating point exception"),		/* 8  SIGFPE */
-    DEFER_GETTEXT ("kill"),				/* 9  SIGKILL */
-    DEFER_GETTEXT ("bus error"),			/* 10 SIGBUS */
-    DEFER_GETTEXT ("segmentation violation"),		/* 11 SIGSEGV */
-    DEFER_GETTEXT ("bad argument to system call"),	/* 12 SIGSYS */
-    DEFER_GETTEXT ("write on a pipe with no one to read it"), /* 13 SIGPIPE */
-    DEFER_GETTEXT ("alarm clock"),			/* 14 SIGALRM */
-    DEFER_GETTEXT ("software termination signal"),	/* 15 SIGTERM */
-    DEFER_GETTEXT ("user defined signal 1"),		/* 16 SIGUSR1 */
-    DEFER_GETTEXT ("user defined signal 2"),		/* 17 SIGUSR2 */
-    DEFER_GETTEXT ("death of a child"),			/* 18 SIGCLD */
-    DEFER_GETTEXT ("power-fail restart"),		/* 19 SIGPWR */
-#ifdef sun
-    "window size changed",		/* 20 SIGWINCH */
-    "urgent socket condition",		/* 21 SIGURG */
-    "pollable event occurred",		/* 22 SIGPOLL */
-    "stop (cannot be caught or ignored)", /*  23 SIGSTOP */
-    "user stop requested from tty",	/* 24 SIGTSTP */
-    "stopped process has been continued", /* 25 SIGCONT */
-    "background tty read attempted",	/* 26 SIGTTIN */
-    "background tty write attempted",	/* 27 SIGTTOU */
-    "virtual timer expired",		/* 28 SIGVTALRM */
-    "profiling timer expired",		/* 29 SIGPROF */
-    "exceeded cpu limit",		/* 30 SIGXCPU */
-    "exceeded file size limit",		/* 31 SIGXFSZ */
-    "process's lwps are blocked",	/* 32 SIGWAITING */
-    "special signal used by thread library", /* 33 SIGLWP */
+    /* @@@begin-snarf@@@ */
+    "bogus signal",				/* 0 */
+    "hangup",					/* 1  SIGHUP */
+    "interrupt",				/* 2  SIGINT */
+    "quit",					/* 3  SIGQUIT */
+    "illegal instruction",			/* 4  SIGILL */
+    "trace trap",				/* 5  SIGTRAP */
+    "IOT instruction",				/* 6  SIGIOT */
+    "EMT instruction",				/* 7  SIGEMT */
+    "floating point exception",			/* 8  SIGFPE */
+    "kill",					/* 9  SIGKILL */
+    "bus error",				/* 10 SIGBUS */
+    "segmentation violation",			/* 11 SIGSEGV */
+    "bad argument to system call",		/* 12 SIGSYS */
+    "write on a pipe with no one to read it",	/* 13 SIGPIPE */
+    "alarm clock",				/* 14 SIGALRM */
+    "software termination signal",		/* 15 SIGTERM */
+    "user defined signal 1",			/* 16 SIGUSR1 */
+    "user defined signal 2",			/* 17 SIGUSR2 */
+    "death of a child",				/* 18 SIGCLD */
+    "power-fail restart",			/* 19 SIGPWR */
+#ifdef sun					
+    "window size changed",			/* 20 SIGWINCH */
+    "urgent socket condition",			/* 21 SIGURG */
+    "pollable event occurred",			/* 22 SIGPOLL */
+    "stop (cannot be caught or ignored)",	/*  23 SIGSTOP */
+    "user stop requested from tty",		/* 24 SIGTSTP */
+    "stopped process has been continued",	/* 25 SIGCONT */
+    "background tty read attempted",		/* 26 SIGTTIN */
+    "background tty write attempted",		/* 27 SIGTTOU */
+    "virtual timer expired",			/* 28 SIGVTALRM */
+    "profiling timer expired",			/* 29 SIGPROF */
+    "exceeded cpu limit",			/* 30 SIGXCPU */
+    "exceeded file size limit",			/* 31 SIGXFSZ */
+    "process's lwps are blocked",		/* 32 SIGWAITING */
+    "special signal used by thread library",	/* 33 SIGLWP */
 #ifdef SIGFREEZE
-    "special signal used by CPR",        /* 34 SIGFREEZE */
+    "special signal used by CPR",		/* 34 SIGFREEZE */
 #endif
 #ifdef SIGTHAW
-    "special signal used by CPR",        /* 35 SIGTHAW */
+    "special signal used by CPR",		/* 35 SIGTHAW */
 #endif
 #endif /* sun */
-    /* $$####end-snarf */
+    /* @@@end-snarf@@@ */
     0
   };
 #endif /* not AIX */
@@ -3709,9 +3708,9 @@
      in one block.  Why in the world are we freeing this ourselves
      anyway?  */
 #if ! (defined (sun) && defined (USG5_4))
-  xfree (dirp->dd_buf, char *); /* directory block defined in <dirent.h> */
+  xfree (dirp->dd_buf); /* directory block defined in <dirent.h> */
 #endif
-  xfree (dirp, DIR *);
+  xfree (dirp);
   return (rtnval);
 }
 #endif /* not HAVE_CLOSEDIR */
@@ -3748,7 +3747,7 @@
 closedir (DIR *dirp)		/* stream from opendir */
 {
   retry_close (dirp->dd_fd);
-  xfree (dirp, DIR *);
+  xfree (dirp);
 }
 
 
--- a/src/sysdll.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sysdll.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,7 @@
 /* sysdll.c --- system dependent support for dynamic linked libraries
    Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 2010 Ben Wing.
+
    Author:  William Perry <wmperry@aventail.com>
 
 This file is part of XEmacs.
@@ -19,6 +21,8 @@
 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+/* This file has been Mule-ized, Ben Wing, 1-26-10. */
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -29,9 +33,9 @@
 
 #ifdef DLSYM_NEEDS_UNDERSCORE
 #define MAYBE_PREPEND_UNDERSCORE(n) do {		\
-  CIbyte *buf = alloca_array (CIbyte, strlen (n) + 2);	\
+  Ibyte *buf = alloca_array (Ibyte, qxestrlen (n) + 2);	\
   *buf = '_';						\
-  strcpy (buf + 1, n);					\
+  qxestrcpy (buf + 1, n);				\
   n = buf;						\
 } while (0)
 #else
@@ -73,7 +77,7 @@
     }
   else
     {
-      LISP_STRING_TO_EXTERNAL (fname, soname, Qdll_filename_encoding);
+      soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding);
     }
   return (dll_handle) dlopen (soname, RTLD_NOW);
 }
@@ -85,17 +89,21 @@
 }
 
 dll_func
-dll_function (dll_handle h, const CIbyte *n)
+dll_function (dll_handle h, const Ibyte *n)
 {
+  Extbyte *next;
   MAYBE_PREPEND_UNDERSCORE (n);
-  return (dll_func) dlsym ((void *) h, n);
+  next = ITEXT_TO_EXTERNAL (n, Qdll_function_name_encoding);
+  return (dll_func) dlsym ((void *) h, next);
 }
 
 dll_var
-dll_variable (dll_handle h, const CIbyte *n)
+dll_variable (dll_handle h, const Ibyte *n)
 {
+  Extbyte *next;
   MAYBE_PREPEND_UNDERSCORE (n);
-  return (dll_var)dlsym ((void *)h, n);
+  next = ITEXT_TO_EXTERNAL (n, Qdll_variable_name_encoding);
+  return (dll_var)dlsym ((void *)h, next);
 }
 
 Lisp_Object
@@ -109,7 +117,7 @@
 #else
   msg = (const Extbyte *) "Shared library error";
 #endif
-  return build_ext_string (msg, Qnative);
+  return build_extstring (msg, Qerror_message_encoding);
 }
 
 #elif defined(HAVE_SHL_LOAD)
@@ -126,7 +134,7 @@
     }
   else
     {
-      LISP_STRING_TO_EXTERNAL (fname, soname, Qdll_filename_encoding);
+      soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding);
     }
   return (dll_handle) shl_load (soname, BIND_DEFERRED, 0L);
 }
@@ -164,7 +172,7 @@
 {
   /* #### WTF?!  Shouldn't this at least attempt to get strerror or
      something?  --hniksic */
-  return build_string ("Generic shared library error", Qnative);
+  return build_ascstring ("Generic shared library error");
 }
 
 #elif defined (WIN32_NATIVE) || defined (CYGWIN)
@@ -183,7 +191,7 @@
     }
   else
     {
-      LOCAL_FILE_FORMAT_TO_TSTR (fname, soname);
+      LISP_LOCAL_FILE_FORMAT_TO_TSTR (fname, soname);
     }
   return (dll_handle) qxeLoadLibrary (soname);
 }
@@ -195,25 +203,27 @@
 }
 
 dll_func
-dll_function (dll_handle h, const CIbyte *n)
+dll_function (dll_handle h, const Ibyte *n)
 {
-  return (dll_func) GetProcAddress ((HINSTANCE) h, n);
+  Extbyte *next = ITEXT_TO_EXTERNAL (n, Qmswindows_multibyte);
+  return (dll_func) GetProcAddress ((HINSTANCE) h, next);
 }
 
 dll_func
-dll_variable (dll_handle h, const CIbyte *n)
+dll_variable (dll_handle h, const Ibyte *n)
 {
-  return (dll_func) GetProcAddress ((HINSTANCE) h, n);
+  Extbyte *next = ITEXT_TO_EXTERNAL (n, Qmswindows_multibyte);
+  return (dll_func) GetProcAddress ((HINSTANCE) h, next);
 }
 
 Lisp_Object
 dll_error ()
 {
-  CIbyte err[32];
+  Ascbyte err[32];
   snprintf (err, 32, "Windows DLL Error %lu", GetLastError ());
-  return build_string (err);
+  return build_ascstring (err);
 }
-#elif defined(HAVE_DYLD)
+#elif defined (HAVE_DYLD)
 /* This section supports MacOSX dynamic libraries. Dynamically
    loadable libraries must be compiled as bundles, not dynamiclibs.
 */
@@ -240,23 +250,22 @@
     }
   else
     {
-      LISP_STRING_TO_EXTERNAL (fname, soname, Qdll_filename_encoding);
+      soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding);
     }
-  ret = NSCreateObjectFileImageFromFile(soname, &file);
-  if (ret != NSObjectFileImageSuccess) {
+  ret = NSCreateObjectFileImageFromFile (soname, &file);
+  if (ret != NSObjectFileImageSuccess)
     return NULL;
-  }
-  out = NSLinkModule(file, soname,
-		     NSLINKMODULE_OPTION_BINDNOW |
-		     NSLINKMODULE_OPTION_PRIVATE |
-		     NSLINKMODULE_OPTION_RETURN_ON_ERROR);
-  return (dll_handle)out;
+  out = NSLinkModule (file, soname,
+		      NSLINKMODULE_OPTION_BINDNOW |
+		      NSLINKMODULE_OPTION_PRIVATE |
+		      NSLINKMODULE_OPTION_RETURN_ON_ERROR);
+  return (dll_handle) out;
 }
 
 int
 dll_close (dll_handle h)
 {
-  return NSUnLinkModule((NSModule)h, NSUNLINKMODULE_OPTION_NONE);
+  return NSUnLinkModule ((NSModule) h, NSUNLINKMODULE_OPTION_NONE);
 }
 
 /* Given an address, return the mach_header for the image containing it
@@ -267,27 +276,28 @@
  * (http://www.opendarwin.org/projects/dlcompat).
  */
 
-static const struct mach_header*
-image_for_address(void *address)
+static const struct mach_header *
+image_for_address (void *address)
 {
   unsigned long i;
-  unsigned long count = _dyld_image_count();
+  unsigned long count = _dyld_image_count ();
   const struct mach_header *mh = 0;
 
   for (i = 0; i < count; i++)
     {
-      unsigned long addr = (unsigned long)address -
-	_dyld_get_image_vmaddr_slide(i);
-      mh = _dyld_get_image_header(i);
+      unsigned long addr = (unsigned long) address -
+	_dyld_get_image_vmaddr_slide (i);
+      mh = _dyld_get_image_header (i);
 
       if (mh)
 	{
 	  struct load_command *lc =
-	    (struct load_command *)((char *)mh + sizeof(struct mach_header));
+	    (struct load_command *) ((Rawbyte *) mh +
+				     sizeof(struct mach_header));
 	  unsigned long j;
 
 	  for (j = 0; j < mh->ncmds;
-	       j++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+	       j++, lc = (struct load_command *) ((Rawbyte *)lc + lc->cmdsize))
 	    {
 	      if (LC_SEGMENT == lc->cmd &&
 		  addr >= ((struct segment_command *)lc)->vmaddr &&
@@ -307,25 +317,25 @@
   return mh;
 }
 
-static const struct mach_header*
-my_find_image(const char *name)
+static const struct mach_header *
+my_find_image (const char *name)
 {
   const struct mach_header *mh = (struct mach_header *)
-    NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED |
-	       NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+    NSAddImage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED |
+		NSADDIMAGE_OPTION_RETURN_ON_ERROR);
 
   if (!mh)
     {
-      int count = _dyld_image_count();
+      int count = _dyld_image_count ();
       int j;
 
       for (j = 0; j < count; j++)
 	{
-	  const char *id = _dyld_get_image_name(j);
+	  const char *id = _dyld_get_image_name (j);
 
-	  if (!strcmp(id, name))
+	  if (!strcmp (id, name))
 	    {
-	      mh = _dyld_get_image_header(j);
+	      mh = _dyld_get_image_header (j);
 	      break;
 	    }
 	}
@@ -342,32 +352,36 @@
  * dependencies, then it probably isn't there.
  */
 static NSSymbol
-search_linked_libs(const struct mach_header * mh, const char *symbol)
+search_linked_libs (const struct mach_header * mh, const Ibyte *symbol)
 {
   unsigned long n;
   NSSymbol nssym = 0;
 
   struct load_command *lc =
-    (struct load_command *)((char *)mh + sizeof(struct mach_header));
+    (struct load_command *) ((Rawbyte *) mh + sizeof (struct mach_header));
 
   for (n = 0; n < mh->ncmds;
-       n++, lc = (struct load_command *)((char *)lc + lc->cmdsize))
+       n++, lc = (struct load_command *) ((Rawbyte *) lc + lc->cmdsize))
     {
       if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
 	{
 	  struct mach_header *wh;
 
 	  if ((wh = (struct mach_header *)
-	       my_find_image((char *)(((struct dylib_command *)lc)->dylib.name.offset +
-				      (char *)lc))))
+	       my_find_image((Rawbyte *)
+			     (((struct dylib_command *) lc)->
+			      dylib.name.offset + (Rawbyte *) lc))))
 	    {
-	      if (NSIsSymbolNameDefinedInImage(wh, symbol))
+	      Extbyte *symext =
+		ITEXT_TO_EXTERNAL (symbol, Qdll_symbol_encoding);
+	      if (NSIsSymbolNameDefinedInImage (wh, symext))
 		{
 		  nssym =
-		    NSLookupSymbolInImage(wh,
-					  symbol,
-					  NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
-					  NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+		    NSLookupSymbolInImage
+		    (wh,
+		     symext,
+		     NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
+		     NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
 		  break;
 		}
 	    }
@@ -378,10 +392,13 @@
 }
 
 dll_func
-dll_function (dll_handle h, const CIbyte *n)
+dll_function (dll_handle h, const Ibyte *n)
 {
   NSSymbol sym = 0;
+  Extbyte *next;
+
   MAYBE_PREPEND_UNDERSCORE (n);
+  next = ITEXT_TO_EXTERNAL (n, Qdll_function_name_encoding);
 
   /* NULL means the program image and shared libraries, not bundles. */
 
@@ -389,49 +406,55 @@
     {
       /* NOTE: This assumes that this function is included in the main program
 	 and not in a shared library. */
-      const struct mach_header* my_mh = image_for_address((void*) &dll_function);
+      const struct mach_header* my_mh =
+	image_for_address ((void*) &dll_function);
 
-      if (NSIsSymbolNameDefinedInImage(my_mh, n))
+      if (NSIsSymbolNameDefinedInImage (my_mh, next))
 	{
 	  sym =
-	    NSLookupSymbolInImage(my_mh,
-				  n,
-				  NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
-				  NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
+	    NSLookupSymbolInImage
+	    (my_mh,
+	     next,
+	     NSLOOKUPSYMBOLINIMAGE_OPTION_BIND |
+	     NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
 	}
 
       if (!sym)
 	{
-	  sym = search_linked_libs(my_mh, n);
+	  sym = search_linked_libs (my_mh, n);
 	}
     }
   else
     {
-      sym = NSLookupSymbolInModule((NSModule)h, n);
+      sym = NSLookupSymbolInModule ((NSModule)h, next);
     }
 
    if (sym == 0) return 0;
-   return (dll_func)NSAddressOfSymbol(sym);
+   return (dll_func) NSAddressOfSymbol (sym);
  }
 
 dll_var
-dll_variable (dll_handle h, const CIbyte *n)
+dll_variable (dll_handle h, const Ibyte *n)
 {
   NSSymbol sym;
+  Extbyte *next;
+
   MAYBE_PREPEND_UNDERSCORE (n);
-  sym = NSLookupSymbolInModule((NSModule)h, n);
+  next = ITEXT_TO_EXTERNAL (n, Qdll_variable_name_encoding);
+
+  sym = NSLookupSymbolInModule ((NSModule) h, n);
   if (sym == 0) return 0;
-  return (dll_var)NSAddressOfSymbol(sym);
+  return (dll_var) NSAddressOfSymbol (sym);
 }
 
 Lisp_Object
-dll_error ()
+dll_error (void)
 {
   NSLinkEditErrors c;
   int errorNumber;
-  const CIbyte *fileNameWithError, *errorString;
-  NSLinkEditError(&c, &errorNumber, &fileNameWithError, &errorString);
-  return build_ext_string (errorString, Qnative);
+  const Extbyte *fileNameWithError, *errorString;
+  NSLinkEditError (&c, &errorNumber, &fileNameWithError, &errorString);
+  return build_extstring (errorString, Qerror_message_encoding);
 }
 #elif HAVE_LTDL
 /* Libtool's libltdl */
@@ -448,7 +471,7 @@
     }
   else
     {
-      LISP_STRING_TO_EXTERNAL (fname, soname, Qdll_filename_encoding);
+      soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding);
     }
   return (dll_handle) lt_dlopen (soname);
 }
@@ -460,23 +483,27 @@
 }
 
 dll_func
-dll_function (dll_handle h, const CIbyte *n)
+dll_function (dll_handle h, const Ibyte *n)
 {
+  Extbyte *next;
   MAYBE_PREPEND_UNDERSCORE (n);
-  return (dll_func) lt_dlsym ((lt_dlhandle) h, n);
+  next = ITEXT_TO_EXTERNAL (n, Qdll_function_name_encoding);
+  return (dll_func) lt_dlsym ((lt_dlhandle) h, next);
 }
 
 dll_var
-dll_variable (dll_handle h, const CIbyte *n)
+dll_variable (dll_handle h, const Ibyte *n)
 {
+  Extbyte *next;
   MAYBE_PREPEND_UNDERSCORE (n);
-  return (dll_var) lt_dlsym ((lt_dlhandle) h, n);
+  next = ITEXT_TO_EXTERNAL (n, Qdll_variable_name_encoding);
+  return (dll_var) lt_dlsym ((lt_dlhandle) h, next);
 }
 
 Lisp_Object
-dll_error ()
+dll_error (void)
 {
-  return build_ext_string (lt_dlerror (), Qnative);
+  return build_extstring (lt_dlerror (), Qerror_message_encoding);
 }
 #else
 /* Catchall if we don't know about this system's method of dynamic loading */
@@ -493,21 +520,21 @@
 }
 
 dll_func
-dll_function (dll_handle h, const CIbyte *n)
+dll_function (dll_handle h, const Ibyte *n)
 {
   return NULL;
 }
 
 dll_func
-dll_variable (dll_handle h, const CIbyte *n)
+dll_variable (dll_handle h, const Ibyte *n)
 {
   return NULL;
 }
 
 Lisp_Object
-dll_error ()
+dll_error (void)
 {
-  return build_string ("Shared libraries not implemented on this system");
+  return build_ascstring ("Shared libraries not implemented on this system");
 }
 #endif /* System conditionals */
 
--- a/src/sysdll.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sysdll.h	Wed Feb 24 01:58:04 2010 -0600
@@ -19,6 +19,8 @@
 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
+/* This file has been Mule-ized, Ben Wing, 1-26-10. */
+
 #ifndef INCLUDED_sysdll_h_
 #define INCLUDED_sysdll_h_
 
@@ -30,15 +32,10 @@
 
 extern dll_handle dll_open (Lisp_Object);
 extern int dll_close (dll_handle);
-extern dll_func dll_function (dll_handle, const CIbyte *);
-extern dll_var dll_variable (dll_handle, const CIbyte *);
+extern dll_func dll_function (dll_handle, const Ibyte *);
+extern dll_var dll_variable (dll_handle, const Ibyte *);
 extern Lisp_Object dll_error (void);
 
-/* More stand-ins ... */
-
-#define Qdll_filename_encoding Qfile_name
-#define Qdll_function_name_encoding Qnative
-
 END_C_DECLS
 
 #endif /* INCLUDED_sysdll_h_ */
--- a/src/sysfile.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/sysfile.h	Wed Feb 24 01:58:04 2010 -0600
@@ -38,6 +38,11 @@
 # include <sys/errno.h>		/* <errno.h> does not always imply this */
 #endif
 
+/* EOVERFLOW isn't defined on native Windows under VC6 */
+#ifndef EOVERFLOW
+# define EOVERFLOW    10139
+#endif
+
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
@@ -86,6 +91,12 @@
 /* # include <sys/fcntl.h> */
 #endif /* WIN32_NATIVE */
 
+/* Needed for ITEXT_TO_TSTR, MAX_XETCHAR_SIZE below; but syswindows.h
+   depends on lisp.h being previously included. */
+#if defined (WIN32_ANY) && defined (emacs)
+# include "syswindows.h"
+#endif
+
 #ifndef	STDERR_FILENO
 #define	STDIN_FILENO	0
 #define	STDOUT_FILENO	1
@@ -302,14 +313,16 @@
 # define QXE_PATH_MAX 1024
 #endif
 
-/* Client .c files should use PATH_MAX_INTERNAL or PATH_MAX_EXTERNAL
+/* Client .c files should use PATH_MAX_INTERNAL or PATH_MAX_TCHAR
    if they must use either one at all. */
 
 /* Use for internally formatted text, which can potentially have up to
    four bytes per character */
 #define PATH_MAX_INTERNAL (QXE_PATH_MAX * MAX_ICHAR_LEN)
-/* Use for externally formatted text. */
-#define PATH_MAX_EXTERNAL (QXE_PATH_MAX * MAX_XETCHAR_SIZE)
+#ifdef WIN32_ANY
+/* Use for externally formatted text in TCHAR's. */
+#define PATH_MAX_TCHAR (QXE_PATH_MAX * MAX_XETCHAR_SIZE)
+#endif
 
 /* The following definitions are needed under Windows, at least */
 #ifndef X_OK
@@ -484,7 +497,7 @@
 }
 #define DIRECTORY_SEP sysfile_get_directory_sep()
 
-#define DEFAULT_DIRECTORY_FALLBACK ((const CIbyte *)"C:\\")
+#define DEFAULT_DIRECTORY_FALLBACK "C:\\"
 
 #else /* not emacs */
 
@@ -498,7 +511,7 @@
 #define SEPCHAR ':'
 #define DEFAULT_DIRECTORY_SEP '/'
 #define DIRECTORY_SEP '/'
-#define DEFAULT_DIRECTORY_FALLBACK ((const CIbyte *)"/")
+#define DEFAULT_DIRECTORY_FALLBACK "/"
 
 #endif /* WIN32_NATIVE */
 
@@ -579,17 +592,31 @@
    false, because they just call the native Win32 routines directly, which
    always use the system-default encoding (which is what Qmswindows_tstr
    will give us when not XEUNICODE_P). */
+#define PATHNAME_CONVERT_OUT_TSTR(path, pathout)	\
+do							\
+{							\
+  const Ibyte *_pco_path_;				\
+  PATHNAME_RESOLVE_LINKS (path, _pco_path_);		\
+  (pathout) = ITEXT_TO_TSTR (_pco_path_);		\
+} while (0)
+
+#define PATHNAME_CONVERT_OUT_UTF_8(path, pathout)		\
+do								\
+{								\
+  const Ibyte *_pco_path_;					\
+  PATHNAME_RESOLVE_LINKS (path, _pco_path_);			\
+  (pathout) = ITEXT_TO_EXTERNAL (_pco_path_, Qutf_8);	\
+} while (0)
+
 #ifdef WIN32_NATIVE
-# define PATHNAME_CONVERT_OUT(path, pathout)	\
-do						\
-{						\
-  const Ibyte *_pco_path_;			\
-  PATHNAME_RESOLVE_LINKS (path, _pco_path_);	\
-  C_STRING_TO_TSTR (_pco_path_, pathout);	\
+#define PATHNAME_CONVERT_OUT(path, pathout) \
+  PATHNAME_CONVERT_OUT_TSTR (path, pathout)
+#else
+# define PATHNAME_CONVERT_OUT(path, pathout)		\
+do							\
+{							\
+  (pathout) = ITEXT_TO_EXTERNAL (path, Qfile_name);	\
 } while (0)
-#else
-# define PATHNAME_CONVERT_OUT(path, pathout) \
-  C_STRING_TO_EXTERNAL (path, pathout, Qfile_name)
 #endif
 
 #define LISP_PATHNAME_CONVERT_OUT(path, pathout) \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sysgdkx.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,36 @@
+/* Basic wrapper file around gdk/gdkx.h.
+
+   Copyright (C) 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Authorship:
+
+   Ben Wing, 1-28-10 extracted out of console-gtk.h and various other
+   files.  We have a separate file rather than just putting it together
+   with sysgtk.h because Bill wanted to keep the X-specific stuff isolated.
+*/
+
+#ifndef INCLUDED_sysgdkx_h_
+#define INCLUDED_sysgdkx_h_
+
+#include <gdk/gdkx.h>
+
+#endif /* INCLUDED_sysgdkx_h_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/sysgtk.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,38 @@
+/* Basic include file for GTK/GDK includes.
+
+   Copyright (C) 2010 Ben Wing.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+/* Authorship:
+
+   Ben Wing, 1-28-10 extracted out of console-gtk.h and various other
+   files.
+*/
+
+#ifndef INCLUDED_sysgtk_h_
+#define INCLUDED_sysgtk_h_
+
+#include <gtk/gtk.h>
+#include <gtk/gtkfixed.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
+
+#endif /* INCLUDED_sysgtk_h_ */
--- a/src/syswindows.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/syswindows.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,5 @@
 /* Copyright (C) 2000 Free Software Foundation, Inc.
-   Copyright (C) 2000, 2001, 2002, 2004 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2004, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -20,6 +20,9 @@
 
 /* Synched up with: Not in FSF. */
 
+#ifndef INCLUDED_syswindows_h_
+#define INCLUDED_syswindows_h_
+
 /* Authorship:
 
    Current primary author: Ben Wing <ben@xemacs.org>
@@ -36,10 +39,98 @@
 
 */
 
-#ifndef INCLUDED_syswindows_h_
-#define INCLUDED_syswindows_h_
+/* See win32.c for info about the different Windows files in XEmacs. */
+
+/* 
+   A capsule introduction to Windows-related build flags:
+
+   See also: (Info-goto-node "(internals)Windows Build Flags")
+
+   1. Operating-system level:
+   --------------------------
+
+   `CYGWIN'	Compiled for Cygwin.  Cygwin provides a full Unix-like
+		environment under Windows.  Applications compiled for Cygwin
+		are linked with CYGWIN1.DLL, which provides the POSIX
+		emulation.
+
+		Corresponding s/ file: s/cygwin32.h
+
+   `MINGW'	Compiled for MinGW.  MinGW is a Unix-like environment under
+		Windows that allows for the use of `gcc' to create fully
+		native Windows applications that link with the normal
+		Microsoft C-runtime library (e.g. MSVCRT.DLL), and don't
+		require a special POSIX-emulation DLL (e.g. CYGWIN1.DLL).
+		Conversely, the only POSIX-like services available are
+		those in MSVCRT.DLL, which isn't much.  Essentially, coding
+		for MinGW is identical to coding for native Windows using
+		Visual C++ or the like, whereas coding for Cygwin is like
+		coding for Linux, but with the additional possibility of
+		making Win32-API calls.  Additional confusion comes from
+		the fact that you can use the Cygwin environment and
+		compilers to build a MINGW application (e.g. by passing the
+		`-mno-cygwin' command-line argument to `gcc').
+
+		Corresponding s/ file: s/mingw32.h
+
+   (none)	There's no flag to indicate that you are specifically
+		targetting native Windows and not doing this with MINGW.
+		Presumably this means you're using Visual C++.
+
+		Corresponding s/ file: s/windowsnt.h
+
+   `WIN32_ANY'	Any of the above three environments.
+
+		Corresponding s/ file: s/win32-common.h
 
-/* See win32.c for info about the different Windows files in XEmacs. */
+   `WIN32_NATIVE'
+		Native Windows target, either MinGW or Visual C++.
+                That is, not Cygwin.
+
+		Corresponding s/ file: s/win32-native.h
+
+
+   2. Compiler level:
+   ------------------
+
+   `__GNUC__'	Defined whenever compiling with gcc (Cygwin or MinGW).
+
+   `_MSC_VER'	Defined whenever compiling with Visual C++.
+
+   `CYGWIN_HEADERS'
+		Defined whenever using Cygwin-style header files rather
+		than Visual C++ headers.  Currently this means the same
+		as "Cygwin or MinGW" and the same as "compiling with gcc".
+		This applies especially to the header files in
+		/usr/include/w32api, which is a free replacement for the
+		standard Visual C++ headers for the Win32 API.
+
+
+   3. Window-system level:
+   -----------------------
+
+   `HAVE_MS_WINDOWS'
+		MS Windows native windowing system (anything related to the
+		appearance of the graphical screen).  May or may not apply
+		to any of VC++, MinGW, or Cygwin.  For example, it's
+		definitely possible to compile XEmacs under Cygwin with
+		support for X-Windows frames and TTY frames, but no
+		native MS Windows frames.  It may also be possible to do that
+		under MinGW or (less likely, but feasible) Visual C++.
+   
+   `HAVE_X_WINDOWS'
+		Support for X-Windows frames, regardless of whether under
+		MS Windows.  You can certainly compile XEmacs with support
+		for X-Windows frames when running on MS Windows, using Cygwin.
+
+   `HAVE_GTK', `HAVE_TTY'
+		Likewise.  All are available on MS Windows with Cygwin.
+
+    Note further that more than one of these can be defined at the same time.
+    In fact, in general, it's possible to compile with support for all of
+    these at the same time.
+
+*/
 
 /* ------------------------- Basic includes ------------------------- */
 
@@ -47,8 +138,7 @@
 #define WIN32_LEAN_AND_MEAN
 #endif
 
-#if defined (CYGWIN) || defined (MINGW)
-# define CYGWIN_HEADERS
+#ifdef CYGWIN_HEADERS
 # ifndef _WIN32_IE
 #  define _WIN32_IE 0x0400
 # endif
@@ -137,6 +227,7 @@
 
 #include <cygwin/stat.h> /* for struct stat */
 #include <w32api.h> /* for version info */
+#include <sys/cygwin.h> /* path conversion functions */
 
 /* Test for a specific version of w32api */
 #define W32API_VER(major,minor) (((major) << 16) + (minor))
@@ -473,8 +564,15 @@
 typedef LPCDLGTEMPLATE LPCDLGTEMPLATEA;
 
 #else /* !CYGWIN_HEADERS */
+
 #define W32API_VER(major,minor) 0
 #define W32API_INSTALLED_VER 0
+
+/* Some types that show up in Cygwin headers but not in Visual Studio headers,
+   and cause problems if we used Cygwin headers to generate
+   intl-auto-encap-win32.[ch]. */
+typedef LPCVOID PCVOID;
+
 #endif /* CYGWIN_HEADERS */
 
 /* Not in VC 6 */
@@ -836,17 +934,14 @@
   (XEUNICODE_P ? (char *) wcsdup ((wchar_t *) s) \
    : xstrdup (s))
 
-#define C_STRING_TO_TSTR(in, out) \
-  C_STRING_TO_EXTERNAL (in, out, Qmswindows_tstr)
-#define LISP_STRING_TO_TSTR(in, out) \
-  LISP_STRING_TO_EXTERNAL (in, out, Qmswindows_tstr)
-#define TSTR_TO_C_STRING(in, out) \
-  EXTERNAL_TO_C_STRING (in, out, Qmswindows_tstr)
-#define TSTR_TO_C_STRING_MALLOC(in, out) \
-  EXTERNAL_TO_C_STRING_MALLOC (in, out, Qmswindows_tstr)
+#define ITEXT_TO_TSTR(in) ITEXT_TO_EXTERNAL (in, Qmswindows_tstr)
+#define LISP_STRING_TO_TSTR(in) LISP_STRING_TO_EXTERNAL (in, Qmswindows_tstr)
+#define TSTR_TO_ITEXT(in) EXTERNAL_TO_ITEXT (in, Qmswindows_tstr)
+#define TSTR_TO_ITEXT_MALLOC(in) \
+  EXTERNAL_TO_ITEXT_MALLOC (in, Qmswindows_tstr)
 
 #define build_tstr_string(in) \
-  make_ext_string (in, qxetcsbytelen ((Extbyte *) in), Qmswindows_tstr)
+  make_extstring (in, qxetcsbytelen ((Extbyte *) in), Qmswindows_tstr)
 
 #define MAX_ANSI_CHAR_LEN 1
 #define MAX_UNICODE_CHAR_LEN 2
@@ -931,28 +1026,70 @@
 
 #ifdef CYGWIN
 
-BEGIN_C_DECLS
+/* We should just remove the Windows 9x support */
 
-void cygwin_win32_to_posix_path_list (const char *, char *);
-int cygwin_win32_to_posix_path_list_buf_size (const char *);
-void cygwin_posix_to_win32_path_list (const char *, char *);
-int cygwin_posix_to_win32_path_list_buf_size (const char *);
-extern int cygwin_conv_to_full_win32_path (const char *, char *);
-
-END_C_DECLS
+#define CCP_POSIX_TO_WIN_T \
+  (XEUNICODE_P ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A)
+#define CCP_WIN_T_TO_POSIX \
+  (XEUNICODE_P ? CCP_WIN_W_TO_POSIX : CCP_WIN_A_TO_POSIX)
 
 #endif
 
-#define LOCAL_FILE_FORMAT_TO_TSTR(path, out)			\
-do {								\
-  Ibyte *lttff;							\
-								\
-  LOCAL_TO_WIN32_FILE_FORMAT (XSTRING_DATA (path), lttff);	\
-  PATHNAME_CONVERT_OUT (lttff, out);				\
+#ifdef HAVE_CYGWIN_CONV_PATH
+#define LOCAL_FILE_FORMAT_TO_TSTR(path, out)				\
+do {									\
+  const Ibyte *lfftt = (path);						\
+  const Extbyte **lffttout = (const Extbyte **) &(out);			\
+  if (isalpha (lfftt[0]) && (IS_DEVICE_SEP (lfftt[1])))			\
+    PATHNAME_CONVERT_OUT_TSTR (lfftt, *lffttout);			\
+  else									\
+    {									\
+      int lfftt_size;							\
+      Extbyte *lfftt_utf8_path;						\
+      Extbyte *lfftt_tstr_path;						\
+									\
+      PATHNAME_CONVERT_OUT_UTF_8 (lfftt, lfftt_utf8_path);		\
+      lfftt_size = cygwin_conv_path (CCP_POSIX_TO_WIN_T | CCP_RELATIVE,	\
+				     lfftt_utf8_path, NULL, 0);		\
+      lfftt_tstr_path = alloca_extbytes (lfftt_size);			\
+      cygwin_conv_path (CCP_POSIX_TO_WIN_T | CCP_RELATIVE,		\
+			lfftt_utf8_path, lfftt_tstr_path, lfftt_size);	\
+      *lffttout = lfftt_tstr_path;					\
+    }									\
 } while (0)
+#define TSTR_TO_LOCAL_FILE_FORMAT(path, out)				\
+do {									\
+  const Extbyte *ttlff = (path);					\
+  int ttlff_size;							\
+  Extbyte *ttlff_utf8_path;						\
+									\
+  ttlff_size = cygwin_conv_path (CCP_WIN_T_TO_POSIX | CCP_RELATIVE,	\
+				 ttlff, NULL, 0);			\
+  ttlff_utf8_path = alloca_extbytes (ttlff_size);			\
+  cygwin_conv_path (CCP_WIN_T_TO_POSIX | CCP_RELATIVE,			\
+		    ttlff, ttlff_utf8_path, ttlff_size);		\
+  (out) = EXTERNAL_TO_ITEXT (ttlff_utf8_path, Qutf_8);			\
+} while (0)
+#else /* not HAVE_CYGWIN_CONV_PATH */
+#define LOCAL_FILE_FORMAT_TO_TSTR(path, out)		\
+do {							\
+  const Ibyte *lfftt;					\
+  const Extbyte **lffttout = (const Extbyte **) &(out);	\
+							\
+  LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (path, lfftt);	\
+  PATHNAME_CONVERT_OUT_TSTR (lfftt, *lffttout);		\
+} while (0)
+#define TSTR_TO_LOCAL_FILE_FORMAT(path, out)		\
+do {							\
+  const Ibyte *ttlff;					\
+							\
+  ttlff = TSTR_TO_ITEXT (path);				\
+  INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (ttlff, out);	\
+} while (0)
+#endif /* (not) HAVE_CYGWIN_CONV_PATH */
 
-Lisp_Object tstr_to_local_file_format (Extbyte *pathout);
-
+#define LISP_LOCAL_FILE_FORMAT_TO_TSTR(path, out) \
+  LOCAL_FILE_FORMAT_TO_TSTR (XSTRING_DATA (path), out)
 /* Convert from local file format, as used in XEmacs, to valid win32
    filenames as can be given to Windows API routines.  Under native XEmacs,
    this is a no-op, but under Cygwin, the local names look different --
@@ -962,57 +1099,77 @@
    check, look for letter plus colon at beginning of name) and do nothing
    in that case. */
 
-#ifdef CYGWIN
-#define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout)			   \
-do {									   \
-  /* NOTE: It is a bit evil that here and below we are passing		   \
-     internal-format data to a function that (nominally) should work	   \
-     with external-format data.  But in point of fact, the Cygwin	   \
-     conversion functions are *NOT* localized, and will fail if they	   \
-     get 7-bit ISO2022-encoded data.  We know that our internal format	   \
-     is ASCII-compatible, and so these functions will work fine with	   \
-     this data. */							   \
-  Ibyte *ltwffp = (path);						   \
-  if (isalpha (ltwffp[0]) && (IS_DEVICE_SEP (ltwffp[1])))		   \
-    pathout = ltwffp;							   \
-  else									   \
-    {									   \
-      int ltwff2 =							   \
-        cygwin_posix_to_win32_path_list_buf_size ((char *) ltwffp);	   \
-      pathout = alloca_ibytes (ltwff2);				   \
-      cygwin_posix_to_win32_path_list ((char *) ltwffp, (char *) pathout); \
-    }									   \
+#ifdef HAVE_CYGWIN_CONV_PATH
+/* When Cygwin uses UTF-8, we can't just manipulate internal-format data
+   with its routines because it will mangle the high bytes, so we need to
+   convert to UTF-8 first, then to Win32 TSTR format (i.e. UTF-16, on
+   Windows NT), then back to internal format.  Routines that want external
+   format should avoid this by using LISP_LOCAL_FILE_FORMAT_TO_TSTR().
+   Same thing applies going the other direction. */
+#define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout)	\
+do								\
+  {								\
+    const Extbyte *lfftiwp;					\
+								\
+    LOCAL_FILE_FORMAT_TO_TSTR (path, lfftiwp);			\
+    (pathout) = TSTR_TO_ITEXT (lfftiwp);			\
+  }								\
+while (0)
+#define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout)	\
+do {								\
+  const Extbyte *iwtlffp;					\
+  iwtlffp = ITEXT_TO_TSTR (path);				\
+  TSTR_TO_LOCAL_FILE_FORMAT (iwtlffp, pathout);			\
 } while (0)
-#else
-#define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout)	\
-do {							\
-  (pathout) = (path);					\
+#elif defined (CYGWIN)
+#define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout)		\
+do {									\
+  /* NOTE: It is a bit evil that here and below we are passing		\
+     internal-format data to a function that (nominally) should work	\
+     with external-format data.  But in point of fact, the Cygwin	\
+     conversion functions are *NOT* localized, and will fail if they	\
+     get 7-bit ISO2022-encoded data.  We know that our internal format	\
+     is ASCII-compatible, and so these functions will work fine with	\
+     this data (maybe ...  not when Cygwin uses UTF-8) */		\
+  const Ibyte *lfftiwp = (path);					\
+  if (isalpha (lfftiwp[0]) && (IS_DEVICE_SEP (lfftiwp[1])))		\
+    (pathout) = lfftiwp;						\
+  else									\
+    {									\
+      int lfftiw2 =							\
+        cygwin_posix_to_win32_path_list_buf_size ((char *) lfftiwp);	\
+      (pathout) = alloca_ibytes (lfftiw2);				\
+      cygwin_posix_to_win32_path_list ((char *) lfftiwp, (char *) pathout); \
+    }									\
 } while (0)
-#endif
-
-#ifdef CYGWIN
-#define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout)			\
+#define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout)		\
 do {									\
-  Ibyte *wtlff1 = (path);						\
+  const Ibyte *wtlff1 = (path);						\
   int wtlff2 =								\
     cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1);		\
   Ibyte *wtlff3 = alloca_ibytes (wtlff2);				\
   cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3);	\
   (pathout) = wtlff3;							\
 } while (0)
-#else
-#define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout)	\
-do {							\
-  (pathout) = (path);					\
+#else /* not defined (CYGWIN) */
+#define LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN(path, pathout)	\
+do {								\
+  (pathout) = (path);						\
 } while (0)
-#endif
+#define INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT(path, pathout)	\
+do {								\
+  (pathout) = (path);						\
+} while (0)
+#endif /* (not) defined (CYGWIN) */
+
+Lisp_Object tstr_to_local_file_format (Extbyte *pathout);
 
 /* Convert a local-format file name or URL in internal format into a Win32
    file name or URL in tstr format. */
 
 #ifdef CYGWIN
 
-#define LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout)		\
+#define LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout)	\
 do									\
 {									\
   Ibyte *lffmutt_fname1;						\
@@ -1027,7 +1184,8 @@
       if (qxestrncasecmp_ascii (lffmutt_pathint, "file://", 7) == 0)	\
 	{								\
 	  Ibyte *lffmutt_path1, *lffmutt_path2;				\
-	  LOCAL_TO_WIN32_FILE_FORMAT (lffmutt_pathint + 7, lffmutt_path1); \
+	  LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (lffmutt_pathint + 7,	\
+                                               lffmutt_path1);		\
 	  if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */	\
 	    lffmutt_path2 = lffmutt_pathint;				\
 	  else								\
@@ -1037,22 +1195,22 @@
 	      qxestrncpy (lffmutt_path2, lffmutt_pathint, 7);		\
 	      qxestrcpy (lffmutt_path2 + 7, lffmutt_path1);		\
 	    }								\
-	  C_STRING_TO_TSTR (lffmutt_path2, pathout);			\
+	  (pathout) = ITEXT_TO_TSTR (lffmutt_path2);			\
 	}								\
       else								\
 	/* A straight URL, just convert */				\
-	LISP_STRING_TO_TSTR (lispstr, pathout);				\
+	(pathout) = LISP_STRING_TO_TSTR (lispstr);			\
     }									\
   else									\
     /* Not URL-style, must be a straight filename. */			\
-    LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout);			\
+    LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout);			\
 } while (0)
 
 #else /* not CYGWIN */
 
   /* URL's (and everything else) are already in the right format */
-#define LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \
-   LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout)
+#define LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \
+   LISP_LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout)
 
 #endif /* not CYGWIN */
 
@@ -1177,8 +1335,8 @@
 
 /* in win32.c */
 Extbyte *mswindows_get_module_file_name (void);
-void mswindows_output_last_error (char *frob);
-DECLARE_DOESNT_RETURN (mswindows_report_process_error (const char *string,
+void mswindows_output_last_error (const Ascbyte *frob);
+DECLARE_DOESNT_RETURN (mswindows_report_process_error (const Ascbyte *reason,
 						       Lisp_Object data,
 						       int errnum));
 Lisp_Object mswindows_lisp_error (int errnum);
--- a/src/termcap.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/termcap.c	Wed Feb 24 01:58:04 2010 -0600
@@ -411,7 +411,7 @@
 
       /* Free old `term' if appropriate.  */
       if (term != name)
-	xfree (term, const char *);
+	xfree (term);
 
       /* If BP is malloc'd by us, make sure it is big enough.  */
       if (malloc_size)
@@ -441,7 +441,7 @@
     }
 
   retry_close (fd);
-  xfree (buf.beg, char *);
+  xfree (buf.beg);
 
   if (malloc_size)
     {
@@ -651,7 +651,7 @@
 	  printf ("\\%0o", *y);
 	else
 	  putchar (*y);
-      xfree (x, char *);
+      xfree (x);
     }
   else
     printf ("none");
--- a/src/tests.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/tests.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,6 @@
 /* C support for testing XEmacs - see tests/automated/c-tests.el
    Copyright (C) 2000 Martin Buchholz
-   Copyright (C) 2001, 2002 Ben Wing.
+   Copyright (C) 2001, 2002, 2010 Ben Wing.
    Copyright (C) 2006 The Free Software Foundation, Inc.
 
 This file is part of XEmacs.
@@ -148,20 +148,20 @@
 #define DFC_CHECK_LENGTH(len1,len2,str1)	\
     else if ((len1) != (len2))			\
       conversion_result =			\
-        Fcons (list3 (build_string(str1), Qnil, build_string("wrong length")), \
+        Fcons (list3 (build_cistring(str1), Qnil, build_ascstring("wrong length")), \
 	       conversion_result)
 
 #define DFC_CHECK_CONTENT(str1,str2,len1,str3)	\
     else if (memcmp (str1, str2, len1))		\
       conversion_result =			\
-	Fcons (list3 (build_string(str3), Qnil,			\
-		      build_string("octet comparison failed")),	\
+	Fcons (list3 (build_cistring(str3), Qnil,			\
+		      build_ascstring("octet comparison failed")),	\
 	       conversion_result)
 
 #define DFC_RESULT_PASS(str1)		\
     else				\
       conversion_result =		\
-	Fcons (list3 (build_string(str1), Qt, Qnil),	\
+	Fcons (list3 (build_cistring(str1), Qt, Qnil),	\
 	       conversion_result)
 
 #ifdef MULE
@@ -191,7 +191,7 @@
 		      MALLOC, (ptr, len),
 		      intern ("iso-8859-2"));
   DFC_CHECK_DATA (ptr, len, ext_latin, "Latin-2 DATA, MALLOC, Latin-2");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2) - 1),
 		      LISP_OPAQUE, opaque,
@@ -212,7 +212,7 @@
 		      intern ("iso-latin-2-with-esc"));
   DFC_CHECK_DATA (ptr, len, int_latin2,
 		  "Latin-2/ESC, MALLOC, Latin-1 DATA");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
 		      LISP_STRING, string,
@@ -309,7 +309,7 @@
 		      Qbinary);
   DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1,
 			    "Latin-1 DATA, MALLOC, binary");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   ptr = NULL, len = rand();
   TO_EXTERNAL_FORMAT (DATA, (int_latin2, sizeof (int_latin2)),
@@ -317,7 +317,7 @@
 		      Qbinary);
   DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, ext_tilde, int_latin2,
 				"Latin-2 DATA, MALLOC, binary/NUL");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   ptr = NULL, len = rand();
   TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
@@ -325,7 +325,7 @@
 		      intern ("iso-8859-1"));
   DFC_CHECK_DATA_COND_MULE (ptr, len, ext_latin, int_latin1,
 			    "Latin-1 DATA, MALLOC, Latin-1");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   TO_EXTERNAL_FORMAT (DATA, (int_latin1, sizeof (int_latin1) - 1),
 		      LISP_OPAQUE, opaque,
@@ -368,7 +368,7 @@
 		      intern ("iso-8859-1"));
   DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin,
 				"Latin-1 DATA, MALLOC, Latin-1");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   ptr = NULL, len = rand();
   TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin)),
@@ -376,7 +376,7 @@
 		      Qnil);
   DFC_CHECK_DATA_COND_MULE_NUL (ptr, len, int_latin1, ext_latin,
 				"Latin-1 DATA, MALLOC, nil");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   TO_INTERNAL_FORMAT (DATA, (ext_latin, sizeof (ext_latin) - 1),
 		      LISP_STRING, string,
@@ -407,7 +407,7 @@
 		      Qbinary);
   DFC_CHECK_DATA_NUL (ptr, len, ext_unix,
 		      "ASCII DATA, MALLOC, binary/LF/NUL");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   ptr = NULL, len = rand();
   TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
@@ -433,7 +433,7 @@
 		      MALLOC, (ptr, len),
 		      intern ("no-conversion-mac"));
   DFC_CHECK_DATA (ptr, len, ext_mac, "ASCII Lisp string, MALLOC, binary/CR");
-  xfree (ptr, void *);
+  xfree (ptr);
 
   ptr = NULL, len = rand();
   TO_EXTERNAL_FORMAT (DATA, (int_foo, sizeof (int_foo) - 1),
@@ -607,17 +607,17 @@
   data.sum = 0;
   elisp_maphash_unsafe (test_hash_tables_mapper,
 			data.hash_table, (void *) &data);
-  hash_result = Fcons (list3 (build_string ("simple mapper"),
+  hash_result = Fcons (list3 (build_ascstring ("simple mapper"),
 				   (data.sum == 2 + 4) ? Qt : Qnil,
-				   build_string ("sum != 2 + 4")),
+				   build_ascstring ("sum != 2 + 4")),
 			    hash_result);
 
   data.sum = 0;
   elisp_maphash (test_hash_tables_modifying_mapper,
 		 data.hash_table, (void *) &data);
-  hash_result = Fcons (list3 (build_string ("modifying mapper"),
+  hash_result = Fcons (list3 (build_ascstring ("modifying mapper"),
 				   (data.sum == 2 + 4) ? Qt : Qnil,
-				   build_string ("sum != 2 + 4")),
+				   build_ascstring ("sum != 2 + 4")),
 			    hash_result);
 
   /* hash table now contains:  (1, 2) (3, 4) (-1, 2*2) (-3, 2*4) */
@@ -625,9 +625,9 @@
   data.sum = 0;
   elisp_maphash_unsafe (test_hash_tables_mapper,
 			data.hash_table, (void *) &data);
-  hash_result = Fcons (list3 (build_string ("simple mapper"),
+  hash_result = Fcons (list3 (build_ascstring ("simple mapper"),
 				   (data.sum == 3 * (2 + 4)) ? Qt : Qnil,
-				   build_string ("sum != 3 * (2 + 4)")),
+				   build_ascstring ("sum != 3 * (2 + 4)")),
 			    hash_result);
 
   /* Remove entries with negative keys, added by modifying mapper */
@@ -637,14 +637,54 @@
   data.sum = 0;
   elisp_maphash_unsafe (test_hash_tables_mapper,
 			data.hash_table, (void *) &data);
-  hash_result = Fcons (list3 (build_string ("remove negatives mapper"),
+  hash_result = Fcons (list3 (build_ascstring ("remove negatives mapper"),
 				   (data.sum == 2 + 4) ? Qt : Qnil,
-				   build_string ("sum != 2 + 4")),
+				   build_ascstring ("sum != 2 + 4")),
 			    hash_result);
 
   return hash_result;
 }
 
+DEFUN ("test-store-void-in-lisp", Ftest_store_void_in_lisp, 0, 0, "", /*
+  Test STORE_VOID_IN_LISP and its inverse GET_VOID_FROM_LISP.
+Tests by internal assert(); only returns if it succeeds.
+*/
+       ())
+{
+  struct foobar { int x; int y; short z; void *q; } baz;
+
+#define FROB(val)							\
+do									\
+{									\
+  void *pval = (void *) (val);						\
+  assert (GET_VOID_FROM_LISP (STORE_VOID_IN_LISP (pval)) == pval);	\
+}									\
+while (0)
+  assert (INT_VALBITS >= 31);
+  FROB (&baz);
+  FROB (&baz.x);
+  FROB (&baz.y);
+  FROB (&baz.z);
+  FROB (&baz.q);
+  FROB (0);
+  FROB (2);
+  FROB (&Vtest_function_list);
+  FROB (0x00000080);
+  FROB (0x00008080);
+  FROB (0x00808080);
+  FROB (0x80808080);
+  FROB (0xCAFEBABE);
+  FROB (0xFFFFFFFE);
+#if INT_VALBITS >= 63
+  FROB (0x0000808080808080);
+  FROB (0x8080808080808080);
+  FROB (0XDEADBEEFCAFEBABE);
+  FROB (0XFFFFFFFFFFFFFFFE);
+#endif /* INT_VALBITS >= 63 */
+
+  return list3 (build_ascstring ("STORE_VOID_IN_LISP"), Qt, Qnil);
+}
+
 
 
 #ifdef NEW_GC
@@ -671,6 +711,7 @@
 
   TESTS_DEFSUBR (Ftest_data_format_conversion);
   TESTS_DEFSUBR (Ftest_hash_tables);
+  TESTS_DEFSUBR (Ftest_store_void_in_lisp);
   /* Add other test functions here with TESTS_DEFSUBR */
 }
 
--- a/src/text.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/text.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1422,15 +1422,15 @@
 {
   while (*s1 && *s2)
     {
-      if (DOWNCASE (0, itext_ichar (s1)) !=
-	  DOWNCASE (0, itext_ichar (s2)))
+      if (CANONCASE (0, itext_ichar (s1)) !=
+	  CANONCASE (0, itext_ichar (s2)))
 	break;
       INC_IBYTEPTR (s1);
       INC_IBYTEPTR (s2);
     }
 
-  return (DOWNCASE (0, itext_ichar (s1)) -
-	  DOWNCASE (0, itext_ichar (s2)));
+  return (CANONCASE (0, itext_ichar (s1)) -
+	  CANONCASE (0, itext_ichar (s2)));
 }
 
 /* The only difference between these next two and
@@ -1481,8 +1481,8 @@
   while (len_from_s1 > 0)
     {
       const Ibyte *old_s1 = s1;
-      int diff = (DOWNCASE (0, itext_ichar (s1)) -
-		  DOWNCASE (0, itext_ichar (s2)));
+      int diff = (CANONCASE (0, itext_ichar (s1)) -
+		  CANONCASE (0, itext_ichar (s2)));
       if (diff != 0)
 	return diff;
       if (!*s1)
@@ -1604,8 +1604,8 @@
     {
       const Ibyte *old_s1 = s1;
       const Ibyte *old_s2 = s2;
-      int diff = (DOWNCASE (0, itext_ichar (s1)) -
-		  DOWNCASE (0, itext_ichar (s2)));
+      int diff = (CANONCASE (0, itext_ichar (s1)) -
+		  CANONCASE (0, itext_ichar (s2)));
       if (diff != 0)
 	return diff;
       INC_IBYTEPTR (s1);
@@ -1631,8 +1631,8 @@
     {
       const Ibyte *old_s1 = s1;
       const Ibyte *old_s2 = s2;
-      int diff = (DOWNCASE (0, itext_ichar (s1)) -
-		  DOWNCASE (0, itext_ichar (s2)));
+      int diff = (CANONCASE (0, itext_ichar (s1)) -
+		  CANONCASE (0, itext_ichar (s2)));
       if (diff != 0)
 	return diff;
       INC_IBYTEPTR (s1);
@@ -1647,7 +1647,7 @@
 }
 
 int
-lisp_strcasecmp (Lisp_Object s1, Lisp_Object s2)
+lisp_strcasecmp_ascii (Lisp_Object s1, Lisp_Object s2)
 {
   Ibyte *cm = strcasecmp_charmap;
   Ibyte *p1 = XSTRING_DATA (s1);
@@ -4238,7 +4238,7 @@
       /* double zero-extend because we may be dealing with Unicode data */
       Dynarr_add (conversion_out_dynarr, '\0');
       Dynarr_add (conversion_out_dynarr, '\0');
-      sink->data.ptr = Dynarr_atp (conversion_out_dynarr, 0);
+      sink->data.ptr = Dynarr_begin (conversion_out_dynarr);
     }
 
   PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion);
@@ -4470,7 +4470,7 @@
 	 cases.  So we add a second zero, just like for external data
 	 (in that case, because we may be converting to Unicode). */
       Dynarr_add (conversion_in_dynarr, '\0');
-      sink->data.ptr = Dynarr_atp (conversion_in_dynarr, 0);
+      sink->data.ptr = Dynarr_begin (conversion_in_dynarr);
     }
 
   PROFILE_RECORD_EXITING_SECTION (QSin_internal_external_conversion);
@@ -4532,8 +4532,8 @@
 /* We handle here the cases where SRC is a Lisp_Object, internal data
    (sized or unsized), or external data (sized or unsized), and return type
    is unsized alloca() or malloc() data.  If the return type is a
-   Lisp_Object, use build_ext_string() for unsized external data,
-   make_ext_string() for sized external data.  If the return type needs to
+   Lisp_Object, use build_extstring() for unsized external data,
+   make_extstring() for sized external data.  If the return type needs to
    be sized data, use the *_TO_SIZED_*() macros, and for other more
    complicated cases, use the original TO_*_FORMAT() macros. */
 
@@ -4571,7 +4571,7 @@
       break;
 
     case DFC_LISP_STRING:
-      TO_EXTERNAL_FORMAT (LISP_STRING, VOID_TO_LISP (src),
+      TO_EXTERNAL_FORMAT (LISP_STRING, GET_LISP_FROM_VOID (src),
 			  MALLOC, (*dst, *dst_size), codesys);
       break;
 
@@ -4613,7 +4613,7 @@
   vals = Dynarr_atp (active_alloca_convert, i);
   assert (alloca_data);
   memcpy (alloca_data, vals->dst, vals->dst_size);
-  xfree (vals->dst, void *);
+  xfree (vals->dst);
   Dynarr_delete (active_alloca_convert, i);
   return alloca_data;
 }
@@ -5158,10 +5158,10 @@
 void
 vars_of_text (void)
 {
-  QSin_char_byte_conversion = build_msg_string ("(in char-byte conversion)");
+  QSin_char_byte_conversion = build_defer_string ("(in char-byte conversion)");
   staticpro (&QSin_char_byte_conversion);
   QSin_internal_external_conversion =
-    build_msg_string ("(in internal-external conversion)");
+    build_defer_string ("(in internal-external conversion)");
   staticpro (&QSin_internal_external_conversion);
 
 #ifdef ENABLE_COMPOSITE_CHARS
--- a/src/text.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/text.h	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 /* Header file for text manipulation primitives and macros.
    Copyright (C) 1985-1995 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -480,7 +480,7 @@
 /* Note that this reads the byte at *PTR! */
 
 #define VALIDATE_IBYTEPTR_BACKWARD(ptr) do {	\
-  while (!valid_ibyteptr_p (ptr)) ptr--;		\
+  while (!valid_ibyteptr_p (ptr)) ptr--;	\
 } while (0)
 
 /* Make sure that PTR is pointing to the beginning of a character.  If not,
@@ -538,6 +538,17 @@
 
 #endif /* MULE */
 
+/* ASSERT_ASCTEXT_ASCII(ptr): Check that an Ascbyte * pointer points to
+   purely ASCII text.  Useful for checking that putatively ASCII strings
+   (i.e. declared as Ascbyte * or const Ascbyte *) are actually ASCII.
+   This is important because otherwise we need to worry about what
+   encoding they are in -- internal or some external encoding.
+
+   ASSERT_ASCTEXT_ASCII_LEN(ptr, len): Same as ASSERT_ASCTEXT_ASCII()
+   but where the length has been explicitly given.  Useful if the string
+   may contain embedded zeroes.
+*/
+
 #ifdef ERROR_CHECK_TEXT
 #define ASSERT_ASCTEXT_ASCII_LEN(ptr, len)			\
 do {								\
@@ -770,8 +781,7 @@
      
 DECLARE_INLINE_HEADER (
 Bytecount
-itext_ichar_len_fmt (const Ibyte *USED_IF_MULE_OR_CHECK_TEXT (ptr),
-		     Internal_Format fmt)
+itext_ichar_len_fmt (const Ibyte *ptr, Internal_Format fmt)
 )
 {
   switch (fmt)
@@ -1059,8 +1069,7 @@
 /* Convert a byte index into a string into a char index. */
 DECLARE_INLINE_HEADER (
 Charcount
-string_index_byte_to_char (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s),
-			   Bytecount idx)
+string_index_byte_to_char (Lisp_Object s, Bytecount idx)
 )
 {
   Charcount retval;
@@ -1087,8 +1096,7 @@
 /* Convert a char index into a string into a byte index. */
 DECLARE_INLINE_HEADER (
 Bytecount
-string_index_char_to_byte (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s),
-			   Charcount idx)
+string_index_char_to_byte (Lisp_Object s, Charcount idx)
 )
 {
   Bytecount retval;
@@ -1115,9 +1123,7 @@
    chars. */
 DECLARE_INLINE_HEADER (
 Charcount
-string_offset_byte_to_char_len (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s),
-				Bytecount USED_IF_MULE_OR_CHECK_TEXT (off),
-				Bytecount len)
+string_offset_byte_to_char_len (Lisp_Object s, Bytecount off, Bytecount len)
 )
 {
   Charcount retval;
@@ -1146,9 +1152,7 @@
    bytes. */
 DECLARE_INLINE_HEADER (
 Bytecount
-string_offset_char_to_byte_len (Lisp_Object USED_IF_MULE_OR_CHECK_TEXT (s),
-				Bytecount USED_IF_MULE_OR_CHECK_TEXT (off),
-				Charcount len)
+string_offset_char_to_byte_len (Lisp_Object s, Bytecount off, Charcount len)
 )
 {
   Bytecount retval;
@@ -1810,41 +1814,41 @@
    including existing zero terminator.  Put a new zero terminator where it
    should go if NEWZ if non-zero.  All args but EI are evalled only once. */
 
-#define EI_ALLOC(ei, newbytelen, newcharlen, newz)			      \
-do {									      \
-  int ei1oldeibytelen = (ei)->bytelen_;					      \
-									      \
-  (ei)->charlen_ = (newcharlen);					      \
-  (ei)->bytelen_ = (newbytelen);					      \
-									      \
-  if (ei1oldeibytelen != (ei)->bytelen_)				      \
-    {									      \
-      int ei1newsize = (ei)->max_size_allocated_;			      \
-      while (ei1newsize < (ei)->bytelen_ + 1)				      \
-	{								      \
-	  ei1newsize = (int) (ei1newsize * 1.5);			      \
-	  if (ei1newsize < 32)						      \
-	    ei1newsize = 32;						      \
-	}								      \
-      if (ei1newsize != (ei)->max_size_allocated_)			      \
-	{								      \
-	  if ((ei)->mallocp_)						      \
+#define EI_ALLOC(ei, newbytelen, newcharlen, newz)			\
+do {									\
+  int ei1oldeibytelen = (ei)->bytelen_;					\
+									\
+  (ei)->charlen_ = (newcharlen);					\
+  (ei)->bytelen_ = (newbytelen);					\
+									\
+  if (ei1oldeibytelen != (ei)->bytelen_)				\
+    {									\
+      int ei1newsize = (ei)->max_size_allocated_;			\
+      while (ei1newsize < (ei)->bytelen_ + 1)				\
+	{								\
+	  ei1newsize = (int) (ei1newsize * 1.5);			\
+	  if (ei1newsize < 32)						\
+	    ei1newsize = 32;						\
+	}								\
+      if (ei1newsize != (ei)->max_size_allocated_)			\
+	{								\
+	  if ((ei)->mallocp_)						\
 	    /* xrealloc always preserves existing data as much as possible */ \
-	    (ei)->data_ = (Ibyte *) xrealloc ((ei)->data_, ei1newsize);       \
-	  else								      \
-	    {								      \
-	      /* We don't have realloc, so ALLOCA() more space and copy the   \
-		 data into it. */					      \
-	      Ibyte *ei1oldeidata = (ei)->data_;			      \
-	      (ei)->data_ = alloca_ibytes (ei1newsize);		      \
-              if (ei1oldeidata)						      \
-	        memcpy ((ei)->data_, ei1oldeidata, ei1oldeibytelen + 1);      \
-	    }								      \
-	  (ei)->max_size_allocated_ = ei1newsize;			      \
-	}								      \
-      if (newz)								      \
-        (ei)->data_[(ei)->bytelen_] = '\0';				      \
-    }									      \
+	    (ei)->data_ = (Ibyte *) xrealloc ((ei)->data_, ei1newsize);	\
+	  else								\
+	    {								\
+	      /* We don't have realloc, so ALLOCA() more space and copy the \
+		 data into it. */					\
+	      Ibyte *ei1oldeidata = (ei)->data_;			\
+	      (ei)->data_ = alloca_ibytes (ei1newsize);			\
+              if (ei1oldeidata)						\
+	        memcpy ((ei)->data_, ei1oldeidata, ei1oldeibytelen + 1); \
+	    }								\
+	  (ei)->max_size_allocated_ = ei1newsize;			\
+	}								\
+      if (newz)								\
+        (ei)->data_[(ei)->bytelen_] = '\0';				\
+    }									\
 } while (0)
 
 #define EI_ALLOC_AND_COPY(ei, data, bytelen, charlen)	\
@@ -1932,14 +1936,15 @@
   eicpy_ext_len (ei, ei6, ei6len, Qbinary);	\
 } while (0)
 
-#define eicpy_ext_len(ei, extdata, extlen, codesys)			 \
-do {									 \
-  const Extbyte *ei7 = (extdata);					 \
-  int ei7len = (extlen);						 \
-									 \
-  SIZED_EXTERNAL_TO_SIZED_C_STRING (ei7, ei7len, (ei)->data_,		 \
-				    (ei)->bytelen_, codesys);		 \
-  (ei)->max_size_allocated_ = (ei)->bytelen_ + 1;			 \
+#define eicpy_ext_len(ei, extdata, extlen, codesys)			\
+do {									\
+  const Extbyte *ei7 = (extdata);					\
+  int ei7len = (extlen);						\
+									\
+  TO_INTERNAL_FORMAT (DATA, (ei7, ei7len),				\
+		      ALLOCA, ((ei)->data_, (ei)->bytelen_),		\
+		      codesys);						\
+  (ei)->max_size_allocated_ = (ei)->bytelen_ + 1;			\
   (ei)->charlen_ = bytecount_to_charcount ((ei)->data_, (ei)->bytelen_); \
 } while (0)
 
@@ -1994,7 +1999,7 @@
   assert (ei23fmt == FORMAT_DEFAULT);				\
 								\
   *ei23lenout = (eistr)->bytelen_;				\
-  *ei23ptrout = alloca_ibytes ((eistr)->bytelen_ + 1);	\
+  *ei23ptrout = alloca_ibytes ((eistr)->bytelen_ + 1);		\
   memcpy (*ei23ptrout, (eistr)->data_, (eistr)->bytelen_ + 1);	\
 } while (0)
 
@@ -2005,9 +2010,9 @@
   if ((ei)->mallocp_)				\
     {						\
       if ((ei)->data_)				\
-	xfree ((ei)->data_, Ibyte *);		\
+	xfree ((ei)->data_);			\
       if ((ei)->extdata_)			\
-	xfree ((ei)->extdata_, Extbyte *);	\
+	xfree ((ei)->extdata_);			\
       eiinit_malloc (ei);			\
     }						\
   else						\
@@ -2032,7 +2037,7 @@
 	eifind_large_enough_buffer (0, (ei)->bytelen_ + 1);		\
       ei13newdata = alloca_ibytes ((ei)->max_size_allocated_);		\
       memcpy (ei13newdata, (ei)->data_, (ei)->bytelen_ + 1);		\
-      xfree ((ei)->data_, Ibyte *);					\
+      xfree ((ei)->data_);						\
       (ei)->data_ = ei13newdata;					\
     }									\
 									\
@@ -2044,7 +2049,7 @@
       /* Double null-terminate in case of Unicode data */		\
       ei13newdata[(ei)->extlen_] = '\0';				\
       ei13newdata[(ei)->extlen_ + 1] = '\0';				\
-      xfree ((ei)->extdata_, Extbyte *);				\
+      xfree ((ei)->extdata_);						\
       (ei)->extdata_ = ei13newdata;					\
     }									\
 } while (0)
@@ -2246,7 +2251,7 @@
     {									\
       if ((ei)->extdata_)						\
 	{								\
-	  xfree ((ei)->extdata_, Extbyte *);				\
+	  xfree ((ei)->extdata_);					\
 	  (ei)->extdata_ = 0;						\
 	}								\
       TO_EXTERNAL_FORMAT (DATA, ((ei)->data_, (ei)->bytelen_),		\
@@ -2424,17 +2429,69 @@
   However, 99% of conversions involve raw data or Lisp strings as both
   source and sink, and usually data is output as alloca() rather than
   malloc().  For this reason, convenience macros are defined for many types
-  of conversions involving raw data and/or Lisp strings, especially when
-  the output is an alloca()ed string. (When the destination is a
+  of conversions involving raw data and/or Lisp strings, when the output is
+  an alloca()ed or malloc()ed string. (When the destination is a
   Lisp_String, there are other functions that should be used instead --
-  build_ext_string() and make_ext_string(), for example.) The convenience
-  macros are of two types -- the older kind that store the result into a
-  specified variable, and the newer kind that return the result.  The newer
-  kind of macros don't exist when the output is sized data, because that
-  would have two return values.  NOTE: All convenience macros are
-  ultimately defined in terms of TO_EXTERNAL_FORMAT and TO_INTERNAL_FORMAT.
-  Thus, any comments below about the workings of these macros also apply to
-  all convenience macros.
+  build_extstring() and make_extstring(), for example.) In general, the
+  convenience macros return their result as a return value, even if the
+  result is an alloca()ed string -- some trickery is required to do this,
+  but it's definitely possible.  However, for macros whose result is a
+  "sized string" (i.e. a string plus a length), there are two values to
+  return, and both are returned through parameters.
+
+  The convenience macros have the form:
+
+  (a) (SIZED_)?EXTERNAL_TO_ITEXT(_MALLOC)?
+  (b) (ITEXT|LISP_STRING)_TO_(SIZED_)?EXTERNAL(_MALLOC)?
+
+  Note also that there are some additional, more specific macros defined
+  elsewhere, for example macros like EXTERNAL_TO_TSTR() in syswindows.h for
+  conversions that specifically involve the `mswindows-tstr' coding system
+  (which is normally an alias of `mswindows-unicode', a variation of
+  UTF-16).
+
+  Convenience macros of type (a) are for conversion from external to
+  internal, while type (b) macros convert internal to external.  A few
+  notes:
+
+  -- The output is an alloca()ed string unless `_MALLOC' is appended,
+     in which case it's a malloc()ed string.
+  -- When the destination says ITEXT, it means internally-formatted text of
+     type `Ibyte *' (which boils down to `unsigned char *').
+  -- When the destination says EXTERNAL, it means externally-formatted
+     text of type `Extbyte *' (which boils down to `char *').  Because
+     `Ibyte *' and `Extbyte *' are different underlying types, accidentally
+     mixing them will generally lead to a warning under gcc, and an error
+     under g++.
+  -- When SIZED_EXTERNAL is involved, there are two parameters, one for
+     the string and one for its length.  When SIZED_EXTERNAL is the
+     destination, these two parameters should be lvalues and will have the
+     result stored into them.
+  -- There is no LISP_STRING destination; use `build_extstring' instead of
+     `EXTERNAL_TO_LISP_STRING' and `make_extstring' instead of
+     `SIZED_EXTERNAL_TO_LISP_STRING'.
+  -- There is no SIZED_ITEXT type.  If you need this: First, if your data
+     is coming from a Lisp string, it would be better to use the
+     LISP_STRING_TO_* macros.  If this doesn't apply or work, call the
+     TO_EXTERNAL_FORMAT() or TO_INTERNAL_FORMAT() macros directly.
+
+  Note that previously the convenience macros, like the raw TO_*_FORMAT
+  macros, were always written to store their arguments into a passed-in
+  lvalue rather than return them, due to major bugs in calling alloca()
+  inside of a function call on x86 gcc circa version 2.6.  This has
+  apparently long since been fixed, but just to make sure we have a
+  `configure' test for broken alloca() in function calls, and in such case
+  the portable xemacs_c_alloca() implementation is substituted instead.
+  Note that this implementation actually uses malloc() but notes the stack
+  pointer at the time of allocation, and at next call any allocations
+  belonging to inner stack frames are freed.  This isn't perfect but
+  more-or-less gets the job done as an emergency backup, and in most
+  circumstances it prevents arbitrary memory leakage -- at most you should
+  get a fixed amount of leakage.
+
+  NOTE: All convenience macros are ultimately defined in terms of
+  TO_EXTERNAL_FORMAT and TO_INTERNAL_FORMAT.  Thus, any comments below
+  about the workings of these macros also apply to all convenience macros.
 
   TO_EXTERNAL_FORMAT (source_type, source, sink_type, sink, codesys)
   TO_INTERNAL_FORMAT (source_type, source, sink_type, sink, codesys)
@@ -2504,25 +2561,12 @@
   Anything prefixed by dfc_ (`data format conversion') is private.
   They are only used to implement these macros.
 
-  [[Using C_STRING* is appropriate for using with external APIs that
-  take null-terminated strings.  For internal data, we should try to
-  be '\0'-clean - i.e. allow arbitrary data to contain embedded '\0'.
-
-  Sometime in the future we might allow output to C_STRING_ALLOCA or
-  C_STRING_MALLOC _only_ with TO_EXTERNAL_FORMAT(), not
-  TO_INTERNAL_FORMAT().]]
-
-  The above comments are not true.  Frequently (most of the time, in
-  fact), external strings come as zero-terminated entities, where the
-  zero-termination is the only way to find out the length.  Even in
-  cases where you can get the length, most of the time the system will
-  still use the null to signal the end of the string, and there will
-  still be no way to either send in or receive a string with embedded
-  nulls.  In such situations, it's pointless to track the length
-  because null bytes can never be in the string.  We have a lot of
-  operations that make it easy to operate on zero-terminated strings,
-  and forcing the user the deal with the length everywhere would only
-  make the code uglier and more complicated, for no gain. --ben
+  Using C_STRING* is appropriate for data that comes from or is going to
+  an external API that takes null-terminated strings, or when the string is
+  always intended to contain text and never binary data, e.g. file names.
+  Any time we are dealing with binary or general data, we must be '\0'-clean,
+  i.e. allow arbitrary data which might contain embedded '\0', by tracking
+  both pointer and length.
 
   There is no problem using the same lvalue for source and sink.
 
@@ -2548,44 +2592,7 @@
   the most you can rely on is that sink data in Unicode format will
   have two terminating nulls, which combine to form one Unicode null
   character.
-
-  NOTE: You might ask, why are these not written as functions that
-  *RETURN* the converted string, since that would allow them to be used
-  much more conveniently, without having to constantly declare temporary
-  variables?  The answer is that in fact I originally did write the
-  routines that way, but that required either
-
-  (a) calling alloca() inside of a function call, or
-  (b) using expressions separated by commas and a global temporary variable, or
-  (c) using the GCC extension ({ ... }).
-
-  Turned out that all of the above had bugs, all caused by GCC (hence the
-  comments about "those GCC wankers" and "ream gcc up the ass").  As for
-  (a), some versions of GCC (especially on Intel platforms), which had
-  buggy implementations of alloca() that couldn't handle being called
-  inside of a function call -- they just decremented the stack right in the
-  middle of pushing args.  Oops, crash with stack trashing, very bad.  (b)
-  was an attempt to fix (a), and that led to further GCC crashes, esp. when
-  you had two such calls in a single subexpression, because GCC couldn't be
-  counted upon to follow even a minimally reasonable order of execution.
-  True, you can't count on one argument being evaluated before another, but
-  GCC would actually interleave them so that the temp var got stomped on by
-  one while the other was accessing it.  So I tried (c), which was
-  problematic because that GCC extension has more bugs in it than a
-  termite's nest.
-
-  So reluctantly I converted to the current way.  Now, that was awhile ago
-  (c. 1994), and it appears that the bug involving alloca in function calls
-  has long since been fixed.  More recently, I defined the new-dfc routines
-  down below, which DO allow exactly such convenience of returning your
-  args rather than store them in temp variables, and I also wrote a
-  configure check to see whether alloca() causes crashes inside of function
-  calls, and if so use the portable alloca() implementation in alloca.c.
-  If you define TEST_NEW_DFC, the old routines get written in terms of the
-  new ones, and I've had a beta put out with this on and it appeared to
-  this appears to cause no problems -- so we should consider
-  switching, and feel no compunctions about writing further such function-
-  like alloca() routines in lieu of statement-like ones. --ben */
+*/
 
 #define TO_EXTERNAL_FORMAT(source_type, source, sink_type, sink, codesys)  \
 do {									   \
@@ -2799,104 +2806,14 @@
   memcpy (dfc_sink_ret, dfc_sink.data.ptr, dfc_sink.data.len + 2);	\
   VOIDP_CAST (sink) = dfc_sink_ret;					\
 } while (0)
-#define DFC_LISP_STRING_USE_CONVERTED_DATA(sink) \
+#define DFC_LISP_STRING_USE_CONVERTED_DATA(sink)			\
   sink = make_string ((Ibyte *) dfc_sink.data.ptr, dfc_sink.data.len)
-#define DFC_LISP_OPAQUE_USE_CONVERTED_DATA(sink) \
+#define DFC_LISP_OPAQUE_USE_CONVERTED_DATA(sink)		\
   sink = make_opaque (dfc_sink.data.ptr, dfc_sink.data.len)
 #define DFC_LISP_LSTREAM_USE_CONVERTED_DATA(sink) /* data already used */
-#define DFC_LISP_BUFFER_USE_CONVERTED_DATA(sink) \
+#define DFC_LISP_BUFFER_USE_CONVERTED_DATA(sink)	\
   Lstream_delete (XLSTREAM (dfc_sink.lisp_object))
 
-/* #define TEST_NEW_DFC */
-
-/* Convenience macros for extremely common invocations */
-#ifdef TEST_NEW_DFC
-#define C_STRING_TO_EXTERNAL(in, out, codesys)			\
-  do { * (Extbyte **) &(out) = 					\
-       NEW_C_STRING_TO_EXTERNAL (in, codesys); } while (0)
-#define SIZED_C_STRING_TO_EXTERNAL(in, inlen, out, codesys)		\
-  do { * (Extbyte **) &(out) =						\
-       NEW_SIZED_C_STRING_TO_EXTERNAL (in, inlen, codesys); } while (0)
-#define EXTERNAL_TO_C_STRING(in, out, codesys)			\
-  do { * (Ibyte **) &(out) =					\
-       NEW_EXTERNAL_TO_C_STRING (in, codesys); } while (0)
-#define SIZED_EXTERNAL_TO_C_STRING(in, inlen, out, codesys)		\
-  do { * (Ibyte **) &(out) =						\
-       NEW_SIZED_EXTERNAL_TO_C_STRING (in, inlen, codesys); } while (0)
-#define LISP_STRING_TO_EXTERNAL(in, out, codesys)		\
-  do { * (Extbyte **) &(out) =					\
-       NEW_LISP_STRING_TO_EXTERNAL (in, codesys); } while (0)
-#else
-#define C_STRING_TO_EXTERNAL(in, out, codesys) \
-  TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys)
-#define SIZED_C_STRING_TO_EXTERNAL(in, inlen, out, codesys) \
-  TO_EXTERNAL_FORMAT (DATA, (in, inlen), C_STRING_ALLOCA, out, codesys)
-#define EXTERNAL_TO_C_STRING(in, out, codesys) \
-  TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, codesys)
-#define SIZED_EXTERNAL_TO_C_STRING(in, inlen, out, codesys) \
-  TO_INTERNAL_FORMAT (DATA, (in, inlen), C_STRING_ALLOCA, out, codesys)
-#define LISP_STRING_TO_EXTERNAL(in, out, codesys) \
-  TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_ALLOCA, out, codesys)
-#endif /* TEST_NEW_DFC */
-
-#define C_STRING_TO_SIZED_EXTERNAL(in, out, outlen, codesys) \
-  TO_EXTERNAL_FORMAT (C_STRING, in, ALLOCA, (out, outlen), codesys)
-#define SIZED_C_STRING_TO_SIZED_EXTERNAL(in, inlen, out, outlen, codesys) \
-  TO_EXTERNAL_FORMAT (DATA, (in, inlen), ALLOCA, (out, outlen), codesys)
-#define EXTERNAL_TO_SIZED_C_STRING(in, out, outlen, codesys) \
-  TO_INTERNAL_FORMAT (C_STRING, in, ALLOCA, (out, outlen), codesys)
-#define SIZED_EXTERNAL_TO_SIZED_C_STRING(in, inlen, out, outlen, codesys) \
-  TO_INTERNAL_FORMAT (DATA, (in, inlen), ALLOCA, (out, outlen), codesys)
-#define LISP_STRING_TO_SIZED_EXTERNAL(in, out, outlen, codesys) \
-  TO_EXTERNAL_FORMAT (LISP_STRING, in, ALLOCA, (out, outlen), codesys)
-
-/* In place of EXTERNAL_TO_LISP_STRING(), use build_ext_string() and/or
-   make_ext_string(). */
-
-#ifdef TEST_NEW_DFC
-#define C_STRING_TO_EXTERNAL_MALLOC(in, out, codesys)			\
-  do { * (Extbyte **) &(out) =						\
-       NEW_C_STRING_TO_EXTERNAL_MALLOC (in, codesys); } while (0)
-#define SIZED_C_STRING_TO_EXTERNAL_MALLOC(in, inlen, out, codesys)	\
-  do { * (Extbyte **) &(out) =						\
-       NEW_SIZED_C_STRING_TO_EXTERNAL_MALLOC (in, inlen, codesys); }	\
-  while (0)
-#define EXTERNAL_TO_C_STRING_MALLOC(in, out, codesys)			\
-  do { * (Ibyte **) &(out) =						\
-       NEW_EXTERNAL_TO_C_STRING_MALLOC (in, codesys); } while (0)
-#define SIZED_EXTERNAL_TO_C_STRING_MALLOC(in, inlen, out, codesys)	\
-  do { * (Ibyte **) &(out) =						\
-       NEW_SIZED_EXTERNAL_TO_C_STRING_MALLOC (in, inlen, codesys); }	\
-  while (0)
-#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, codesys)		\
-  do { * (Extbyte **) &(out) =						\
-       NEW_LISP_STRING_TO_EXTERNAL_MALLOC (in, codesys); } while (0)
-#else
-#define C_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \
-  TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, codesys)
-#define SIZED_C_STRING_TO_EXTERNAL_MALLOC(in, inlen, out, codesys) \
-  TO_EXTERNAL_FORMAT (DATA, (in, inlen), C_STRING_MALLOC, out, codesys)
-#define EXTERNAL_TO_C_STRING_MALLOC(in, out, codesys) \
-  TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, codesys)
-#define SIZED_EXTERNAL_TO_C_STRING_MALLOC(in, inlen, out, codesys) \
-  TO_INTERNAL_FORMAT (DATA, (in, inlen), C_STRING_MALLOC, out, codesys)
-#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, codesys) \
-  TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, codesys)
-#endif /* TEST_NEW_DFC */
-
-#define C_STRING_TO_SIZED_EXTERNAL_MALLOC(in, out, outlen, codesys) \
-  TO_EXTERNAL_FORMAT (C_STRING, in, MALLOC, (out, outlen), codesys)
-#define SIZED_C_STRING_TO_SIZED_EXTERNAL_MALLOC(in, inlen, out, outlen, \
-						codesys)		\
-  TO_EXTERNAL_FORMAT (DATA, (in, inlen), MALLOC, (out, outlen), codesys)
-#define EXTERNAL_TO_SIZED_C_STRING_MALLOC(in, out, outlen, codesys) \
-  TO_INTERNAL_FORMAT (C_STRING, in, MALLOC, (out, outlen), codesys)
-#define SIZED_EXTERNAL_TO_SIZED_C_STRING_MALLOC(in, inlen, out, outlen, \
-						codesys)		\
-  TO_INTERNAL_FORMAT (DATA, (in, inlen), MALLOC, (out, outlen), codesys)
-#define LISP_STRING_TO_SIZED_EXTERNAL_MALLOC(in, out, outlen, codesys) \
-  TO_EXTERNAL_FORMAT (LISP_STRING, in, MALLOC, (out, outlen), codesys)
-
 enum new_dfc_src_type
 {
   DFC_EXTERNAL,
@@ -2919,7 +2836,7 @@
 
 END_C_DECLS
 
-/* Version of EXTERNAL_TO_C_STRING that *RETURNS* the translated string,
+/* Version of EXTERNAL_TO_ITEXT that *RETURNS* the translated string,
    still in alloca() space.  Requires some trickiness to do this, but gets
    it done! */
 
@@ -2941,41 +2858,36 @@
    (#src, ALLOCA_FUNCALL_OK (new_dfc_convert_size (#src, src, src_size,	\
 						   type, codesys)))
 
-#define NEW_EXTERNAL_TO_C_STRING(src, codesys)	\
-  (Ibyte *) NEW_DFC_CONVERT_1_ALLOCA (src, -1, DFC_EXTERNAL, codesys)
-#define NEW_EXTERNAL_TO_C_STRING_MALLOC(src, codesys)	\
-  (Ibyte *) new_dfc_convert_malloc (src, -1, DFC_EXTERNAL, codesys)
-#define NEW_SIZED_EXTERNAL_TO_C_STRING(src, len, codesys)	\
-  (Ibyte *) NEW_DFC_CONVERT_1_ALLOCA (src, len, DFC_SIZED_EXTERNAL, codesys)
-#define NEW_SIZED_EXTERNAL_TO_C_STRING_MALLOC(src, len, codesys)	\
-  (Ibyte *) new_dfc_convert_malloc (src, len, DFC_SIZED_EXTERNAL, codesys)
-#define NEW_C_STRING_TO_EXTERNAL(src, codesys)	\
-  (Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (src, -1, DFC_INTERNAL, codesys)
-#define NEW_C_STRING_TO_EXTERNAL_MALLOC(src, codesys)	\
-  (Extbyte *) new_dfc_convert_malloc (src, -1, DFC_INTERNAL, codesys)
-#define NEW_SIZED_C_STRING_TO_EXTERNAL(src, len, codesys)	\
-  (Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (src, len, DFC_SIZED_INTERNAL, codesys)
-#define NEW_SIZED_C_STRING_TO_EXTERNAL_MALLOC(src, len, codesys)	\
-  (Extbyte *) new_dfc_convert_malloc (src, len, DFC_SIZED_INTERNAL, codesys)
-#define NEW_LISP_STRING_TO_EXTERNAL(src, codesys)			\
-  (Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (LISP_TO_VOID (src), -1,		\
-					DFC_LISP_STRING, codesys)
-#define NEW_LISP_STRING_TO_EXTERNAL_MALLOC(src, codesys)	\
-  (Extbyte *) new_dfc_convert_malloc (LISP_TO_VOID (src), -1,	\
-				      DFC_LISP_STRING, codesys)
-
-/* Standins for various encodings. */
-#ifdef WEXTTEXT_IS_WIDE
-#define Qcommand_argument_encoding Qmswindows_unicode
-#define Qenvironment_variable_encoding Qmswindows_unicode
-#else
-#define Qcommand_argument_encoding Qnative
-#define Qenvironment_variable_encoding Qnative
-#endif
-#define Qunix_host_name_encoding Qnative
-#define Qunix_service_name_encoding Qnative
-#define Qmswindows_host_name_encoding Qmswindows_multibyte
-#define Qmswindows_service_name_encoding Qmswindows_multibyte
+#define EXTERNAL_TO_ITEXT(src, codesys)					\
+  ((Ibyte *) NEW_DFC_CONVERT_1_ALLOCA (src, -1, DFC_EXTERNAL, codesys))
+#define EXTERNAL_TO_ITEXT_MALLOC(src, codesys)				\
+  ((Ibyte *) new_dfc_convert_malloc (src, -1, DFC_EXTERNAL, codesys))
+#define SIZED_EXTERNAL_TO_ITEXT(src, len, codesys)			\
+  ((Ibyte *) NEW_DFC_CONVERT_1_ALLOCA (src, len, DFC_SIZED_EXTERNAL, codesys))
+#define SIZED_EXTERNAL_TO_ITEXT_MALLOC(src, len, codesys)		\
+  ((Ibyte *) new_dfc_convert_malloc (src, len, DFC_SIZED_EXTERNAL, codesys))
+#define ITEXT_TO_EXTERNAL(src, codesys)					\
+  ((Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (src, -1, DFC_INTERNAL, codesys))
+#define ITEXT_TO_EXTERNAL_MALLOC(src, codesys)				\
+  ((Extbyte *) new_dfc_convert_malloc (src, -1, DFC_INTERNAL, codesys))
+#define LISP_STRING_TO_EXTERNAL(src, codesys)				\
+  ((Extbyte *) NEW_DFC_CONVERT_1_ALLOCA (STORE_LISP_IN_VOID (src), -1,	\
+					DFC_LISP_STRING, codesys))
+#define LISP_STRING_TO_EXTERNAL_MALLOC(src, codesys)			\
+  ((Extbyte *) new_dfc_convert_malloc (STORE_LISP_IN_VOID (src), -1,	\
+				      DFC_LISP_STRING, codesys))
+/* In place of EXTERNAL_TO_LISP_STRING(), use build_extstring() and/or
+   make_extstring(). */
+
+/* The next four have two outputs, so we make both of them be parameters */
+#define ITEXT_TO_SIZED_EXTERNAL(in, out, outlen, codesys) \
+  TO_EXTERNAL_FORMAT (C_STRING, in, ALLOCA, (out, outlen), codesys)
+#define LISP_STRING_TO_SIZED_EXTERNAL(in, out, outlen, codesys) \
+  TO_EXTERNAL_FORMAT (LISP_STRING, in, ALLOCA, (out, outlen), codesys)
+#define ITEXT_TO_SIZED_EXTERNAL_MALLOC(in, out, outlen, codesys) \
+  TO_EXTERNAL_FORMAT (C_STRING, in, MALLOC, (out, outlen), codesys)
+#define LISP_STRING_TO_SIZED_EXTERNAL_MALLOC(in, out, outlen, codesys) \
+  TO_EXTERNAL_FORMAT (LISP_STRING, in, MALLOC, (out, outlen), codesys)
 
 /* Wexttext functions.  The type of Wexttext is selected at compile time
    and will sometimes be wchar_t, sometimes char. */
@@ -3001,7 +2913,7 @@
 #define wext_atol(str) wcstol (str, 0, 10)
 #define wext_sprintf wsprintfW /* Huh?  both wsprintfA and wsprintfW? */
 #define wext_getenv _wgetenv
-#define build_wext_string(str, cs) build_ext_string ((Extbyte *) str, cs)
+#define build_wext_string(str, cs) build_extstring ((Extbyte *) str, cs)
 #define WEXTTEXT_TO_8_BIT(arg) WEXTTEXT_TO_MULTIBYTE(arg)
 #ifdef WIN32_NATIVE
 int XCDECL wext_retry_open (const Wexttext *path, int oflag, ...);
@@ -3026,14 +2938,14 @@
 #define wext_atol(str) atol (str)
 #define wext_sprintf sprintf
 #define wext_getenv getenv
-#define build_wext_string build_ext_string
+#define build_wext_string build_extstring
 #define wext_retry_open retry_open
 #define wext_access access
 #define wext_stat stat
 #define WEXTTEXT_TO_8_BIT(arg) ((Extbyte *) arg)
 #endif
 
-/* Standins for various X encodings.
+/* Standins for various encodings.
 
    About encodings in X:
 
@@ -3089,6 +3001,31 @@
    COMPOUND_TEXT otherwise.
    */
 
+#ifdef WEXTTEXT_IS_WIDE
+#define Qcommand_argument_encoding Qmswindows_unicode
+#define Qenvironment_variable_encoding Qmswindows_unicode
+#else
+#define Qcommand_argument_encoding Qnative
+#define Qenvironment_variable_encoding Qnative
+#endif
+#define Qunix_host_name_encoding Qnative
+#define Qunix_service_name_encoding Qnative
+#define Qtime_function_encoding Qnative
+#define Qtime_zone_encoding Qtime_function_encoding
+#define Qmswindows_host_name_encoding Qmswindows_multibyte
+#define Qmswindows_service_name_encoding Qmswindows_multibyte
+#define Quser_name_encoding Qnative
+#define Qerror_message_encoding Qnative
+#define Qjpeg_error_message_encoding Qerror_message_encoding
+#define Qtooltalk_encoding Qnative
+#define Qgtk_encoding Qnative
+
+#define Qdll_symbol_encoding Qnative
+#define Qdll_function_name_encoding Qdll_symbol_encoding
+#define Qdll_variable_name_encoding Qdll_symbol_encoding
+#define Qdll_filename_encoding Qfile_name
+#define Qemodule_string_encoding Qnative
+
 /* !!#### Need to verify the encoding used in lwlib -- Qnative or Qctext?
    Almost certainly the former.  Use a standin for now. */
 #define Qlwlib_encoding Qnative
@@ -3107,6 +3044,7 @@
    Qenvironment_variable_encoding */
 #define Qx_display_name_encoding Qx_hpc_encoding
 #define Qx_xpm_data_encoding Qx_hpc_encoding
+#define Qx_error_message_encoding Qx_hpc_encoding
 
 /* !!#### Verify these! */
 #define Qxt_widget_arg_encoding Qnative
@@ -3129,11 +3067,11 @@
 								\
   if (!__gserr__)						\
     {								\
-      var = alloca_ibytes (99);			\
+      var = alloca_ibytes (99);					\
       qxesprintf (var, "Unknown error %d", __gsnum__);		\
     }								\
   else								\
-    EXTERNAL_TO_C_STRING (__gserr__, var, Qstrerror_encoding);	\
+    var = EXTERNAL_TO_ITEXT (__gserr__, Qstrerror_encoding);	\
 } while (0)
 
 #endif /* INCLUDED_text_h_ */
--- a/src/toolbar-common.c	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,730 +0,0 @@
-/* toolbar implementation -- "Generic" (X or GTK) redisplay interface.
-   Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995 Sun Microsystems, Inc.
-   Copyright (C) 1995, 1996, 2002 Ben Wing.
-   Copyright (C) 1996 Chuck Thompson.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not in FSF. */
-
-#include <config.h>
-#include "lisp.h"
-
-#include "device-impl.h"
-#include "faces.h"
-#include "frame-impl.h"
-#include "glyphs.h"
-#include "toolbar.h"
-#include "window.h"
-
-/* This is used when we need to draw the toolbars ourselves -- on X or GTK.
-   On MS Windows, we use the built-in toolbar controls. */
-
-/* Only a very few things need to differ based on the toolkit used.
-**
-** Some of the routines used assert(FRAME_yyy_P(f)) checks, this is
-** now abstracted into __INTERNAL_APPROPRIATENESS_CHECK().  When we
-** add new window systems that use this code, we should either add a
-** new case here, or just remove the checks completely.
-**
-** At least for X & GTK redraw_frame_toolbars() might end up getting
-** called before we are completely initialized.  To avoid this, we use
-** the __INTERNAL_MAPPED_P(f) macro, that should return 0 if we should
-** not draw the toolbars yet.  When we add new window systems that use
-** this code, we should add a new case here, if they need it.
-**
-** When clearing the toolbar, it is nice to flush the drawing queue.
-** Use __INTERNAL_FLUSH to do this.  It is passed a device.
-*/
-#if defined(HAVE_GTK)
-#include "console-gtk-impl.h"
-#define __INTERNAL_MAPPED_P(f) GTK_WIDGET_REALIZED (FRAME_GTK_TEXT_WIDGET (f))
-#define __INTERNAL_FLUSH(d) gdk_flush()
-#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_GTK_P (f))
-#elif defined(HAVE_X_WINDOWS)
-#include "console-x-impl.h"
-#define __INTERNAL_MAPPED_P(f) XtIsRealized (FRAME_X_SHELL_WIDGET (f))
-#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_X_P (f))
-#define __INTERNAL_FLUSH(d) XFlush (DEVICE_X_DISPLAY (d))
-#else
-#define __INTERNAL_MAPPED_P(f) ABORT()
-#define __INTERNAL_APPROPRIATENESS_CHECK(f) ABORT()
-#define __INTERNAL_FLUSH(f) ABORT()
-#endif
-
-#include "toolbar-common.h"
-
-extern Lisp_Object Vtoolbar_shadow_thickness;
-
-static void __prepare_button_area (struct frame *f,
-				   struct toolbar_button *tb)
-{
-  int sx = tb->x;
-  int sy = tb->y;
-  int swidth = tb->width;
-  int sheight = tb->height;
-  int border_width = tb->border_width;
-  int x_adj, width_adj, y_adj, height_adj;
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  struct window *w = XWINDOW (window);
-  int shadow_thickness;
-  int def_shadow_thickness = XINT (Fspecifier_instance(Vtoolbar_shadow_thickness, window, Qnil, Qnil));
-  face_index toolbar_findex;
-
-  if (tb->vertical)
-    {
-      x_adj = border_width;
-      width_adj = - 2 * border_width;
-      y_adj = height_adj = 0;
-    }
-  else
-    {
-      x_adj = width_adj = 0;
-      y_adj = border_width;
-      height_adj = - 2 * border_width;
-    }
-
-  toolbar_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
-
-  /* Blank toolbar buttons that should be 3d will have EQ(tb->up_glyph, Qt)
-  ** Blank toolbar buttons that should be flat will have NILP (tb->up_glyph)
-  **
-  ** Real toolbar buttons will check tb->enabled && tb->down
-  */
-  if (EQ (Qt, tb->up_glyph))
-    {
-      shadow_thickness = def_shadow_thickness;
-    }
-  else if (NILP (tb->up_glyph))
-    {
-      shadow_thickness = 0;
-    }
-  else
-    {
-      if (tb->enabled)
-	{
-	  if (tb->down)
-	    shadow_thickness = -def_shadow_thickness;
-	  else
-	    shadow_thickness = def_shadow_thickness;
-	}
-      else
-	{
-	  shadow_thickness = 0;
-	}
-    }
-  
-  /* Blank the entire area. */
-  redisplay_clear_region (window, toolbar_findex,
-			  sx + x_adj, sy + y_adj,
-			  swidth + width_adj,
-			  sheight + height_adj);
-
-  /* Draw the outline. */
-  if (shadow_thickness)
-    {
-      MAYBE_DEVMETH (d, bevel_area,
-		     (w, toolbar_findex, sx + x_adj,
-		      sy + y_adj, swidth + width_adj,
-		      sheight + height_adj, abs(shadow_thickness),
-		      EDGE_ALL, (shadow_thickness < 0) ? EDGE_BEVEL_IN
-						       : EDGE_BEVEL_OUT));
-    }
-
-  /* Handle the borders... */
-  redisplay_clear_region (window, toolbar_findex,
-			  sx, sy,
-			  (tb->vertical ? border_width : swidth),
-			  (tb->vertical ? sheight : border_width));
-  redisplay_clear_region (window, toolbar_findex,
-			  (tb->vertical ? sx + swidth : sx),
-			  (tb->vertical ? sy : sy + sheight),
-			  (tb->vertical ? border_width : swidth),
-			  (tb->vertical ? sheight : border_width));
-}
-
-#define common_draw_blank_toolbar_button(f,tb) __prepare_button_area (f,tb)
-
-void
-common_output_toolbar_button (struct frame *f, Lisp_Object button)
-{
-  int shadow_thickness = 2;
-  int x_adj, y_adj, width_adj, height_adj;
-  struct device *d = XDEVICE (f->device);
-  Lisp_Object instance, window, glyph;
-  struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
-  struct Lisp_Image_Instance *p;
-  struct window *w;
-  int vertical = tb->vertical;
-  int border_width = tb->border_width;
-  face_index button_findex;
-
-  if (vertical)
-    {
-      x_adj = border_width;
-      width_adj = - 2 * border_width;
-      y_adj = 0;
-      height_adj = 0;
-    }
-  else
-    {
-      x_adj = 0;
-      width_adj = 0;
-      y_adj = border_width;
-      height_adj = - 2 * border_width;
-    }
-
-  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  w = XWINDOW (window);
-
-  glyph = get_toolbar_button_glyph (w, tb);
-
-  if (tb->enabled)
-    {
-      if (tb->down)
-	{
-	  shadow_thickness = -2;
-	}
-      else
-	{
-	  shadow_thickness = 2;
-	}
-    }
-  else
-    {
-      shadow_thickness = 0;
-    }
-
-  /* #### It is currently possible for users to trash us by directly
-     changing the toolbar glyphs.  Avoid crashing in that case. */
-  if (GLYPHP (glyph))
-    {
-      /* WARNING: this interface may change */
-      Lisp_Object face_list[2] = { XGLYPH_FACE (glyph), Vtoolbar_face };
-
-      button_findex = merge_face_list_to_cache_index (w, face_list, 2);
-      instance = glyph_image_instance (glyph, window, ERROR_ME_DEBUG_WARN, 1);
-    }
-  else
-    {
-      button_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
-      instance = Qnil;
-    }
-
-  __prepare_button_area (f, tb);
-
-  if (IMAGE_INSTANCEP (instance))
-    {
-      int width = tb->width + width_adj - shadow_thickness * 2;
-      int height = tb->height + height_adj - shadow_thickness * 2;
-      int x_offset = x_adj + shadow_thickness;
-      int y_offset = y_adj + shadow_thickness;
-
-      p = XIMAGE_INSTANCE (instance);
-
-      if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
-	{
-	  struct display_box db;
-	  struct display_glyph_area dga;
-
-	  if (width > (int) IMAGE_INSTANCE_PIXMAP_WIDTH (p))
-	    {
-	      x_offset += ((int) (width - IMAGE_INSTANCE_PIXMAP_WIDTH (p))
-			   / 2);
-	      width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
-	    }
-	  if (height > (int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
-	    {
-	      y_offset += ((int) (height - IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
-			   / 2);
-	      height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
-	    }
-
-	  /* Draw exactly in the area specified... */
-	  db.xpos = tb->x + x_offset;
-	  db.ypos = tb->y + y_offset;
-	  db.width = width;
-	  db.height = height;
-
-	  /* Display the whole glyph */
-	  dga.xoffset = 0;
-	  dga.yoffset = 0;
-	  dga.width = width;
-	  dga.height = height;
-	  
-	  redisplay_output_pixmap (w, instance,
-				   &db, &dga, 
-				   button_findex, 0, 0, 0, 0);
-	}
-      else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT)
-	{
-	  /* #### We need to make the face used configurable. */
-	  struct face_cachel *cachel =
-	    WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
-	  struct display_line dl;
-	  Lisp_Object string = IMAGE_INSTANCE_TEXT_STRING (p);
-	  unsigned char charsets[NUM_LEADING_BYTES];
-	  Ichar_dynarr *buf;
-	  struct font_metric_info fm;
-
-	  /* This could be true if we were called via the Expose event
-             handler.  Mark the button as dirty and return
-             immediately. */
-	  if (f->window_face_cache_reset)
-	    {
-	      tb->dirty = 1;
-	      MARK_TOOLBAR_CHANGED;
-	      return;
-	    }
-	  buf = Dynarr_new (Ichar);
-	  convert_ibyte_string_into_ichar_dynarr
-	    (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
-	  find_charsets_in_ichar_string (charsets, Dynarr_atp (buf, 0),
-					  Dynarr_length (buf));
-	  ensure_face_cachel_complete (cachel, window, charsets);
-	  face_cachel_charset_font_metric_info (cachel, charsets, &fm);
-
-	  dl.ascent = fm.ascent;
-	  dl.descent = fm.descent;
-	  dl.ypos = tb->y + y_offset + fm.ascent;
-
-	  if (fm.ascent + fm.descent <= height)
-	    {
-	      dl.ypos += (height - fm.ascent - fm.descent) / 2;
-	      dl.clip = 0;
-	    }
-	  else
-	    {
-	      dl.clip = fm.ascent + fm.descent - height;
-	    }
-
-	  MAYBE_DEVMETH (d, output_string,
-			 (w, &dl, buf, tb->x + x_offset, 0, 0, width,
-			  button_findex, 0, 0, 0, 0));
-	  Dynarr_free (buf);
-	}
-
-      /* We silently ignore the image if it isn't a pixmap or text. */
-    }
-
-  tb->dirty = 0;
-}
-
-static int
-common_get_button_size (struct frame *f, Lisp_Object window,
-			struct toolbar_button *tb, int vert, int pos)
-{
-  int shadow_thickness = 2;
-  int size;
-
-  if (tb->blank)
-    {
-      if (!NILP (tb->down_glyph))
-	size = XINT (tb->down_glyph);
-      else
-	size = DEFAULT_TOOLBAR_BLANK_SIZE;
-    }
-  else
-    {
-      struct window *w = XWINDOW (window);
-      Lisp_Object glyph = get_toolbar_button_glyph (w, tb);
-
-      /* Unless, of course, the user has done something stupid like
-         change the glyph out from under us.  Use a blank placeholder
-         in that case. */
-      if (NILP (glyph))
-	return XINT (f->toolbar_size[pos]);
-
-      if (vert)
-	size = glyph_height (glyph, window);
-      else
-	size = glyph_width (glyph, window);
-    }
-
-  if (!size)
-    {
-      /* If the glyph doesn't have a size we'll insert a blank
-         placeholder instead. */
-      return XINT (f->toolbar_size[pos]);
-    }
-
-  size += shadow_thickness * 2;
-
-  return (size);
-}
-
-#define COMMON_OUTPUT_BUTTONS_LOOP(left)				\
-  do {									\
-    while (!NILP (button))						\
-      {									\
-	struct toolbar_button *tb = XTOOLBAR_BUTTON (button);		\
-	int size, height, width;					\
-									\
-	if (left && tb->pushright)					\
-	  break;							\
-									\
-        size = common_get_button_size (f, window, tb, vert, pos);	\
-									\
-	if (vert)							\
-	  {								\
-	    width = bar_width;						\
-	    if (y + size > max_pixpos)					\
-	      height = max_pixpos - y;					\
-	    else							\
-	      height = size;						\
-	  }								\
-	else								\
-	  {								\
-	    if (x + size > max_pixpos)					\
-	      width = max_pixpos - x;					\
-	    else							\
-	      width = size;						\
-	    height = bar_height;					\
-	  }								\
-									\
-	if (tb->x != x							\
-	    || tb->y != y						\
-	    || tb->width != width					\
-	    || tb->height != height					\
-	    || tb->dirty						\
-	    || f->clear) /* This is clearly necessary. */		\
-	  {								\
-	    if (width && height)					\
-	      {								\
-		tb->x = x;						\
-		tb->y = y;						\
-		tb->width = width;					\
-		tb->height = height;					\
-	        tb->border_width = border_width;			\
-	        tb->vertical = vert;					\
-									\
-                if (tb->blank || NILP (tb->up_glyph))			\
-		  {							\
-		    common_draw_blank_toolbar_button (f, tb);		\
-		  }							\
-	        else							\
-		  common_output_toolbar_button (f, button);		\
-	      }								\
-	  }								\
-									\
-	if (vert)							\
-	  y += height;							\
-	else								\
-	  x += width;							\
-									\
-	if ((vert && y == max_pixpos) || (!vert && x == max_pixpos))	\
-	  button = Qnil;						\
-	else								\
-	  button = tb->next;						\
-      }									\
-  } while (0)
-
-#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag)			\
-  do {									\
-    switch (pos)							\
-      {									\
-      case TOP_TOOLBAR:							\
-	(frame)->top_toolbar_was_visible = flag;			\
-	break;								\
-      case BOTTOM_TOOLBAR:						\
-	(frame)->bottom_toolbar_was_visible = flag;			\
-	break;								\
-      case LEFT_TOOLBAR:						\
-	(frame)->left_toolbar_was_visible = flag;			\
-	break;								\
-      case RIGHT_TOOLBAR:						\
-	(frame)->right_toolbar_was_visible = flag;			\
-	break;								\
-      default:								\
-	ABORT ();							\
-      }									\
-  } while (0)
-
-static void
-common_output_toolbar (struct frame *f, enum toolbar_pos pos)
-{
-  int x, y, bar_width, bar_height, vert;
-  int max_pixpos, right_size, right_start, blank_size;
-  int border_width = FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos);
-  Lisp_Object button, window;
-  face_index toolbar_findex;
-
-  get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 1);
-  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
-  toolbar_findex = get_builtin_face_cache_index (XWINDOW (window), Vtoolbar_face);
-
-  /* Do the border */
-  redisplay_clear_region (window, toolbar_findex,
-			  x, y,
-			  (vert ? bar_width : border_width),
-			  (vert ? border_width : bar_height));
-  redisplay_clear_region (window, toolbar_findex,
-			  (vert ? x : x + bar_width - border_width),
-			  (vert ? y + bar_height - border_width : y),
-			  (vert ? bar_width : border_width),
-			  (vert ? border_width : bar_height));
-
-  if (vert)
-    {
-      max_pixpos = y + bar_height - border_width;
-      y += border_width;
-    }
-  else
-    {
-      max_pixpos = x + bar_width - border_width;
-      x += border_width;
-    }
-
-  button = FRAME_TOOLBAR_BUTTONS (f, pos);
-  right_size = 0;
-
-  /* First loop over all of the buttons to determine how much room we
-     need for left hand and right hand buttons.  This loop will also
-     make sure that all instances are instantiated so when we actually
-     output them they will come up immediately. */
-  while (!NILP (button))
-    {
-      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
-      int size = common_get_button_size (f, window, tb, vert, pos);
-
-      if (tb->pushright)
-	right_size += size;
-
-      button = tb->next;
-    }
-
-  button = FRAME_TOOLBAR_BUTTONS (f, pos);
-
-  /* Loop over the left buttons, updating and outputting them. */
-  COMMON_OUTPUT_BUTTONS_LOOP (1);
-
-  /* Now determine where the right buttons start. */
-  right_start = max_pixpos - right_size;
-  if (right_start < (vert ? y : x))
-    right_start = (vert ? y : x);
-
-  /* Output the blank which goes from the end of the left buttons to
-     the start of the right. */
-  blank_size = right_start - (vert ? y : x);
-  if (blank_size)
-    {
-      int height, width;
-
-      if (vert)
-	{
-	  width = bar_width;
-	  height = blank_size;
-	}
-      else
-	{
-	  width = blank_size;
-	  height = bar_height;
-	}
-
-      /*
-       * Use a 3D pushright separator only if there isn't a toolbar
-       * border.  A flat separator meshes with the border and looks
-       * better.
-       */
-      if (1)
-	{
-	  struct toolbar_button tb;
-
-	  tb.x = x;
-	  tb.y = y;
-	  tb.width = width;
-	  tb.height = height;
-	  tb.border_width = border_width;
-	  tb.vertical = vert;
-	  tb.enabled = 1;
-	  tb.up_glyph = border_width ? Qt : Qnil;
-
-	  __prepare_button_area (f, &tb);
-	}
-
-      if (vert)
-	y += height;
-      else
-	x += width;
-    }
-
-  /* Loop over the right buttons, updating and outputting them. */
-  COMMON_OUTPUT_BUTTONS_LOOP (0);
-
-  if (!vert)
-    {
-      Lisp_Object frame = wrap_frame (f);
-
-      redisplay_clear_region (frame,
-			      DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
-			      bar_height);
-    }
-
-  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
-  __INTERNAL_FLUSH (XDEVICE (f->device));
-}
-
-static void
-common_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change)
-{
-  Lisp_Object frame;
-  int x, y, width, height, vert;
-
-  get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 1);
-  frame = wrap_frame (f);
-
-  /* The thickness_change parameter is used by the toolbar resize routines
-     to clear any excess toolbar if the size shrinks. */
-  if (thickness_change < 0)
-    {
-      if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR)
-	{
-	  x = x + width + thickness_change;
-	  width = -thickness_change;
-	}
-      else
-	{
-	  y = y + height + thickness_change;
-	  height = -thickness_change;
-	}
-    }
-
-  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
-
-  redisplay_clear_region (frame, DEFAULT_INDEX, x, y, width, height);
-
-  __INTERNAL_FLUSH (XDEVICE (f->device));
-}
-
-void
-common_output_frame_toolbars (struct frame *f)
-{
-  __INTERNAL_APPROPRIATENESS_CHECK(f);
-
-  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, TOP_TOOLBAR);
-
-  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, BOTTOM_TOOLBAR);
-
-  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, LEFT_TOOLBAR);
-
-  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
-    common_output_toolbar (f, RIGHT_TOOLBAR);
-}
-
-void
-common_clear_frame_toolbars (struct frame *f)
-{
-  __INTERNAL_APPROPRIATENESS_CHECK(f);
-
-  if (f->top_toolbar_was_visible
-      && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, TOP_TOOLBAR, 0);
-  if (f->bottom_toolbar_was_visible
-      && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, BOTTOM_TOOLBAR, 0);
-  if (f->left_toolbar_was_visible 
-      && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, LEFT_TOOLBAR, 0);
-  if (f->right_toolbar_was_visible 
-       && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
-    common_clear_toolbar (f, RIGHT_TOOLBAR, 0);
-}
-
-static void
-common_redraw_exposed_toolbar (struct frame *f, enum toolbar_pos pos, int x, int y,
-			    int width, int height)
-{
-  int bar_x, bar_y, bar_width, bar_height, vert;
-  Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos);
-
-  get_toolbar_coords (f, pos, &bar_x, &bar_y, &bar_width, &bar_height,
-		      &vert, 1);
-
-  if (((y + height) < bar_y) || (y > (bar_y + bar_height)))
-    return;
-  if (((x + width) < bar_x) || (x > (bar_x + bar_width)))
-    return;
-
-  while (!NILP (button))
-    {
-      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
-
-      if (vert)
-	{
-	  if (((tb->y + tb->height) > y) && (tb->y < (y + height)))
-	    tb->dirty = 1;
-
-	  /* If this is true we have gone past the exposed region. */
-	  if (tb->y > (y + height))
-	    break;
-	}
-      else
-	{
-	  if (((tb->x + tb->width) > x) && (tb->x < (x + width)))
-	    tb->dirty = 1;
-
-	  /* If this is true we have gone past the exposed region. */
-	  if (tb->x > (x + width))
-	    break;
-	}
-
-      button = tb->next;
-    }
-
-  /* Even if none of the buttons is in the area, the blank region at
-     the very least must be because the first thing we did is verify
-     that some portion of the toolbar is in the exposed region. */
-  common_output_toolbar (f, pos);
-}
-
-void
-common_redraw_exposed_toolbars (struct frame *f, int x, int y, int width,
-				int height)
-{
-  __INTERNAL_APPROPRIATENESS_CHECK(f);
-
-  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, TOP_TOOLBAR, x, y, width, height);
-
-  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, BOTTOM_TOOLBAR, x, y, width, height);
-
-  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, LEFT_TOOLBAR, x, y, width, height);
-
-  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
-    common_redraw_exposed_toolbar (f, RIGHT_TOOLBAR, x, y, width, height);
-}
-
-void
-common_redraw_frame_toolbars (struct frame *f)
-{
-  /* There are certain startup paths that lead to update_EmacsFrame in
-     faces.c being called before a new frame is fully initialized.  In
-     particular before we have actually mapped it.  That routine can
-     call this one.  So, we need to make sure that the frame is
-     actually ready before we try and draw all over it. */
-  if (__INTERNAL_MAPPED_P(f))
-    common_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
-				    FRAME_PIXHEIGHT (f));
-}
--- a/src/toolbar-common.h	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/* toolbar-common.h
-**
-** Description: 
-**
-** Created by: William M. Perry
-** Copyright (c) 2001 Free Software Foundation
-**
-*/
-
-#ifndef __TOOLBAR_COMMON_H__
-#define __TOOLBAR_COMMON_H__
-
-extern void common_output_frame_toolbars (struct frame *f);
-extern void common_redraw_exposed_toolbars (struct frame *f,
-					    int x, int y,
-					    int width, int height);
-extern void common_redraw_frame_toolbars (struct frame *f);
-extern void common_output_toolbar_button (struct frame *f, Lisp_Object button);
-extern void common_clear_frame_toolbars (struct frame *f);
-
-#endif /* __TOOLBAR_COMMON_H__ */
--- a/src/toolbar-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/toolbar-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -28,19 +28,19 @@
 
 #include "frame.h"
 
-#include "toolbar-common.h"
+#include "toolbar-xlike.h"
 
 #include "console-gtk-impl.h"
 
-/* We should really create a 'common' console type and fill it with
+/* We should really create a 'xlike' console type and fill it with
 ** all the shared code.  We would then just use
-** CONSOLE_INHERITS_METHOD(x,common,blah)
+** CONSOLE_INHERITS_METHOD(x,xlike,blah)
 */
-#define gtk_output_frame_toolbars common_output_frame_toolbars
-#define gtk_output_toolbar_button common_output_toolbar_button
-#define gtk_redraw_exposed_toolbars common_redraw_exposed_toolbars
-#define gtk_redraw_frame_toolbars common_redraw_frame_toolbars
-#define gtk_clear_frame_toolbars common_clear_frame_toolbars
+#define gtk_output_frame_toolbars xlike_output_frame_toolbars
+#define gtk_output_toolbar_button xlike_output_toolbar_button
+#define gtk_redraw_exposed_toolbars xlike_redraw_exposed_toolbars
+#define gtk_redraw_frame_toolbars xlike_redraw_frame_toolbars
+#define gtk_clear_frame_toolbars xlike_clear_frame_toolbars
 
 
 static void
--- a/src/toolbar-msw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/toolbar-msw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -294,7 +294,7 @@
 			  if (! (bitmap = mswindows_create_resized_bitmap 
 				 (p, f, bmwidth, bmheight)))
 			    {
-			      xfree (button_tbl, TBBUTTON *);
+			      xfree (button_tbl);
 			      if (ilist) ImageList_Destroy (ilist);
 			      gui_error ("Couldn't resize pixmap", instance);
 			    }
@@ -317,7 +317,7 @@
 					 ? ILC_MASK  : 0) | ILC_COLOR24, 
 					nbuttons, nbuttons * 2 )))
 			{
-			  xfree (button_tbl, TBBUTTON *);
+			  xfree (button_tbl);
 			  gui_error ("Couldn't create image list", instance);
 			}
 
@@ -332,7 +332,7 @@
 			    mask ? mask 
 			    : IMAGE_INSTANCE_MSWINDOWS_MASK (p))) < 0)
 			{
-			  xfree (button_tbl, TBBUTTON *);
+			  xfree (button_tbl);
 			  if (ilist)
 			    ImageList_Destroy (ilist);
 			  gui_error 
@@ -394,7 +394,7 @@
 			      NULL, 
 			      NULL))==NULL)
 	{
-	  xfree (button_tbl, TBBUTTON *);
+	  xfree (button_tbl);
 	  ImageList_Destroy (ilist);
 	  gui_error ("couldn't create toolbar", Qunbound);
 	}
@@ -468,7 +468,7 @@
       mswindows_move_toolbar (f, pos);
 
       if (button_tbl)
-	xfree (button_tbl, TBBUTTON *);
+	xfree (button_tbl);
 
       SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
     }
--- a/src/toolbar-x.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/toolbar-x.c	Wed Feb 24 01:58:04 2010 -0600
@@ -33,7 +33,7 @@
 #include "toolbar.h"
 #include "window.h"
 
-#include "toolbar-common.h"
+#include "toolbar-xlike.h"
 
 #include "console-x-impl.h"
 #include "glyphs-x.h"
@@ -42,15 +42,15 @@
 #include "EmacsFrame.h"
 #include "EmacsFrameP.h"
 
-/* We should really create a 'common' console type and fill it with
+/* We should really create a 'xlike' console type and fill it with
 ** all the shared code.  We would then just use
-** CONSOLE_INHERITS_METHOD(x,common,blah)
+** CONSOLE_INHERITS_METHOD(x,xlike,blah)
 */
-#define x_output_frame_toolbars common_output_frame_toolbars
-#define x_output_toolbar_button common_output_toolbar_button
-#define x_redraw_exposed_toolbars common_redraw_exposed_toolbars
-#define x_redraw_frame_toolbars common_redraw_frame_toolbars
-#define x_clear_frame_toolbars common_clear_frame_toolbars
+#define x_output_frame_toolbars xlike_output_frame_toolbars
+#define x_output_toolbar_button xlike_output_toolbar_button
+#define x_redraw_exposed_toolbars xlike_redraw_exposed_toolbars
+#define x_redraw_frame_toolbars xlike_redraw_frame_toolbars
+#define x_clear_frame_toolbars xlike_clear_frame_toolbars
 
 static void
 x_initialize_frame_toolbars (struct frame *f)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/toolbar-xlike.c	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,730 @@
+/* toolbar implementation -- "Generic" (X or GTK) redisplay interface.
+   Copyright (C) 1995 Board of Trustees, University of Illinois.
+   Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 1995, 1996, 2002, 2010 Ben Wing.
+   Copyright (C) 1996 Chuck Thompson.
+
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+/* Synched up with: Not in FSF. */
+
+#include <config.h>
+#include "lisp.h"
+
+#include "device-impl.h"
+#include "faces.h"
+#include "frame-impl.h"
+#include "glyphs.h"
+#include "toolbar.h"
+#include "window.h"
+
+/* This is used when we need to draw the toolbars ourselves -- on X or GTK.
+   On MS Windows, we use the built-in toolbar controls. */
+
+/* Only a very few things need to differ based on the toolkit used.
+**
+** Some of the routines used assert(FRAME_yyy_P(f)) checks, this is
+** now abstracted into __INTERNAL_APPROPRIATENESS_CHECK().  When we
+** add new window systems that use this code, we should either add a
+** new case here, or just remove the checks completely.
+**
+** At least for X & GTK redraw_frame_toolbars() might end up getting
+** called before we are completely initialized.  To avoid this, we use
+** the __INTERNAL_MAPPED_P(f) macro, that should return 0 if we should
+** not draw the toolbars yet.  When we add new window systems that use
+** this code, we should add a new case here, if they need it.
+**
+** When clearing the toolbar, it is nice to flush the drawing queue.
+** Use __INTERNAL_FLUSH to do this.  It is passed a device.
+*/
+#if defined(HAVE_GTK)
+#include "console-gtk-impl.h"
+#define __INTERNAL_MAPPED_P(f) GTK_WIDGET_REALIZED (FRAME_GTK_TEXT_WIDGET (f))
+#define __INTERNAL_FLUSH(d) gdk_flush()
+#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_GTK_P (f))
+#elif defined(HAVE_X_WINDOWS)
+#include "console-x-impl.h"
+#define __INTERNAL_MAPPED_P(f) XtIsRealized (FRAME_X_SHELL_WIDGET (f))
+#define __INTERNAL_APPROPRIATENESS_CHECK(f) assert(FRAME_X_P (f))
+#define __INTERNAL_FLUSH(d) XFlush (DEVICE_X_DISPLAY (d))
+#else
+#define __INTERNAL_MAPPED_P(f) ABORT()
+#define __INTERNAL_APPROPRIATENESS_CHECK(f) ABORT()
+#define __INTERNAL_FLUSH(f) ABORT()
+#endif
+
+#include "toolbar-xlike.h"
+
+extern Lisp_Object Vtoolbar_shadow_thickness;
+
+static void __prepare_button_area (struct frame *f,
+				   struct toolbar_button *tb)
+{
+  int sx = tb->x;
+  int sy = tb->y;
+  int swidth = tb->width;
+  int sheight = tb->height;
+  int border_width = tb->border_width;
+  int x_adj, width_adj, y_adj, height_adj;
+  struct device *d = XDEVICE (f->device);
+  Lisp_Object  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+  struct window *w = XWINDOW (window);
+  int shadow_thickness;
+  int def_shadow_thickness = XINT (Fspecifier_instance(Vtoolbar_shadow_thickness, window, Qnil, Qnil));
+  face_index toolbar_findex;
+
+  if (tb->vertical)
+    {
+      x_adj = border_width;
+      width_adj = - 2 * border_width;
+      y_adj = height_adj = 0;
+    }
+  else
+    {
+      x_adj = width_adj = 0;
+      y_adj = border_width;
+      height_adj = - 2 * border_width;
+    }
+
+  toolbar_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
+
+  /* Blank toolbar buttons that should be 3d will have EQ(tb->up_glyph, Qt)
+  ** Blank toolbar buttons that should be flat will have NILP (tb->up_glyph)
+  **
+  ** Real toolbar buttons will check tb->enabled && tb->down
+  */
+  if (EQ (Qt, tb->up_glyph))
+    {
+      shadow_thickness = def_shadow_thickness;
+    }
+  else if (NILP (tb->up_glyph))
+    {
+      shadow_thickness = 0;
+    }
+  else
+    {
+      if (tb->enabled)
+	{
+	  if (tb->down)
+	    shadow_thickness = -def_shadow_thickness;
+	  else
+	    shadow_thickness = def_shadow_thickness;
+	}
+      else
+	{
+	  shadow_thickness = 0;
+	}
+    }
+  
+  /* Blank the entire area. */
+  redisplay_clear_region (window, toolbar_findex,
+			  sx + x_adj, sy + y_adj,
+			  swidth + width_adj,
+			  sheight + height_adj);
+
+  /* Draw the outline. */
+  if (shadow_thickness)
+    {
+      MAYBE_DEVMETH (d, bevel_area,
+		     (w, toolbar_findex, sx + x_adj,
+		      sy + y_adj, swidth + width_adj,
+		      sheight + height_adj, abs(shadow_thickness),
+		      EDGE_ALL, (shadow_thickness < 0) ? EDGE_BEVEL_IN
+						       : EDGE_BEVEL_OUT));
+    }
+
+  /* Handle the borders... */
+  redisplay_clear_region (window, toolbar_findex,
+			  sx, sy,
+			  (tb->vertical ? border_width : swidth),
+			  (tb->vertical ? sheight : border_width));
+  redisplay_clear_region (window, toolbar_findex,
+			  (tb->vertical ? sx + swidth : sx),
+			  (tb->vertical ? sy : sy + sheight),
+			  (tb->vertical ? border_width : swidth),
+			  (tb->vertical ? sheight : border_width));
+}
+
+#define xlike_draw_blank_toolbar_button(f,tb) __prepare_button_area (f,tb)
+
+void
+xlike_output_toolbar_button (struct frame *f, Lisp_Object button)
+{
+  int shadow_thickness = 2;
+  int x_adj, y_adj, width_adj, height_adj;
+  struct device *d = XDEVICE (f->device);
+  Lisp_Object instance, window, glyph;
+  struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+  struct Lisp_Image_Instance *p;
+  struct window *w;
+  int vertical = tb->vertical;
+  int border_width = tb->border_width;
+  face_index button_findex;
+
+  if (vertical)
+    {
+      x_adj = border_width;
+      width_adj = - 2 * border_width;
+      y_adj = 0;
+      height_adj = 0;
+    }
+  else
+    {
+      x_adj = 0;
+      width_adj = 0;
+      y_adj = border_width;
+      height_adj = - 2 * border_width;
+    }
+
+  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+  w = XWINDOW (window);
+
+  glyph = get_toolbar_button_glyph (w, tb);
+
+  if (tb->enabled)
+    {
+      if (tb->down)
+	{
+	  shadow_thickness = -2;
+	}
+      else
+	{
+	  shadow_thickness = 2;
+	}
+    }
+  else
+    {
+      shadow_thickness = 0;
+    }
+
+  /* #### It is currently possible for users to trash us by directly
+     changing the toolbar glyphs.  Avoid crashing in that case. */
+  if (GLYPHP (glyph))
+    {
+      /* WARNING: this interface may change */
+      Lisp_Object face_list[2] = { XGLYPH_FACE (glyph), Vtoolbar_face };
+
+      button_findex = merge_face_list_to_cache_index (w, face_list, 2);
+      instance = glyph_image_instance (glyph, window, ERROR_ME_DEBUG_WARN, 1);
+    }
+  else
+    {
+      button_findex = get_builtin_face_cache_index (w, Vtoolbar_face);
+      instance = Qnil;
+    }
+
+  __prepare_button_area (f, tb);
+
+  if (IMAGE_INSTANCEP (instance))
+    {
+      int width = tb->width + width_adj - shadow_thickness * 2;
+      int height = tb->height + height_adj - shadow_thickness * 2;
+      int x_offset = x_adj + shadow_thickness;
+      int y_offset = y_adj + shadow_thickness;
+
+      p = XIMAGE_INSTANCE (instance);
+
+      if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
+	{
+	  struct display_box db;
+	  struct display_glyph_area dga;
+
+	  if (width > (int) IMAGE_INSTANCE_PIXMAP_WIDTH (p))
+	    {
+	      x_offset += ((int) (width - IMAGE_INSTANCE_PIXMAP_WIDTH (p))
+			   / 2);
+	      width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
+	    }
+	  if (height > (int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
+	    {
+	      y_offset += ((int) (height - IMAGE_INSTANCE_PIXMAP_HEIGHT (p))
+			   / 2);
+	      height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
+	    }
+
+	  /* Draw exactly in the area specified... */
+	  db.xpos = tb->x + x_offset;
+	  db.ypos = tb->y + y_offset;
+	  db.width = width;
+	  db.height = height;
+
+	  /* Display the whole glyph */
+	  dga.xoffset = 0;
+	  dga.yoffset = 0;
+	  dga.width = width;
+	  dga.height = height;
+	  
+	  redisplay_output_pixmap (w, instance,
+				   &db, &dga, 
+				   button_findex, 0, 0, 0, 0);
+	}
+      else if (IMAGE_INSTANCE_TYPE (p) == IMAGE_TEXT)
+	{
+	  /* #### We need to make the face used configurable. */
+	  struct face_cachel *cachel =
+	    WINDOW_FACE_CACHEL (w, DEFAULT_INDEX);
+	  struct display_line dl;
+	  Lisp_Object string = IMAGE_INSTANCE_TEXT_STRING (p);
+	  unsigned char charsets[NUM_LEADING_BYTES];
+	  Ichar_dynarr *buf;
+	  struct font_metric_info fm;
+
+	  /* This could be true if we were called via the Expose event
+             handler.  Mark the button as dirty and return
+             immediately. */
+	  if (f->window_face_cache_reset)
+	    {
+	      tb->dirty = 1;
+	      MARK_TOOLBAR_CHANGED;
+	      return;
+	    }
+	  buf = Dynarr_new (Ichar);
+	  convert_ibyte_string_into_ichar_dynarr
+	    (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
+	  find_charsets_in_ichar_string (charsets, Dynarr_begin (buf),
+					  Dynarr_length (buf));
+	  ensure_face_cachel_complete (cachel, window, charsets);
+	  face_cachel_charset_font_metric_info (cachel, charsets, &fm);
+
+	  dl.ascent = fm.ascent;
+	  dl.descent = fm.descent;
+	  dl.ypos = tb->y + y_offset + fm.ascent;
+
+	  if (fm.ascent + fm.descent <= height)
+	    {
+	      dl.ypos += (height - fm.ascent - fm.descent) / 2;
+	      dl.clip = 0;
+	    }
+	  else
+	    {
+	      dl.clip = fm.ascent + fm.descent - height;
+	    }
+
+	  MAYBE_DEVMETH (d, output_string,
+			 (w, &dl, buf, tb->x + x_offset, 0, 0, width,
+			  button_findex, 0, 0, 0, 0));
+	  Dynarr_free (buf);
+	}
+
+      /* We silently ignore the image if it isn't a pixmap or text. */
+    }
+
+  tb->dirty = 0;
+}
+
+static int
+xlike_get_button_size (struct frame *f, Lisp_Object window,
+			struct toolbar_button *tb, int vert, int pos)
+{
+  int shadow_thickness = 2;
+  int size;
+
+  if (tb->blank)
+    {
+      if (!NILP (tb->down_glyph))
+	size = XINT (tb->down_glyph);
+      else
+	size = DEFAULT_TOOLBAR_BLANK_SIZE;
+    }
+  else
+    {
+      struct window *w = XWINDOW (window);
+      Lisp_Object glyph = get_toolbar_button_glyph (w, tb);
+
+      /* Unless, of course, the user has done something stupid like
+         change the glyph out from under us.  Use a blank placeholder
+         in that case. */
+      if (NILP (glyph))
+	return XINT (f->toolbar_size[pos]);
+
+      if (vert)
+	size = glyph_height (glyph, window);
+      else
+	size = glyph_width (glyph, window);
+    }
+
+  if (!size)
+    {
+      /* If the glyph doesn't have a size we'll insert a blank
+         placeholder instead. */
+      return XINT (f->toolbar_size[pos]);
+    }
+
+  size += shadow_thickness * 2;
+
+  return (size);
+}
+
+#define XLIKE_OUTPUT_BUTTONS_LOOP(left)				\
+  do {									\
+    while (!NILP (button))						\
+      {									\
+	struct toolbar_button *tb = XTOOLBAR_BUTTON (button);		\
+	int size, height, width;					\
+									\
+	if (left && tb->pushright)					\
+	  break;							\
+									\
+        size = xlike_get_button_size (f, window, tb, vert, pos);	\
+									\
+	if (vert)							\
+	  {								\
+	    width = bar_width;						\
+	    if (y + size > max_pixpos)					\
+	      height = max_pixpos - y;					\
+	    else							\
+	      height = size;						\
+	  }								\
+	else								\
+	  {								\
+	    if (x + size > max_pixpos)					\
+	      width = max_pixpos - x;					\
+	    else							\
+	      width = size;						\
+	    height = bar_height;					\
+	  }								\
+									\
+	if (tb->x != x							\
+	    || tb->y != y						\
+	    || tb->width != width					\
+	    || tb->height != height					\
+	    || tb->dirty						\
+	    || f->clear) /* This is clearly necessary. */		\
+	  {								\
+	    if (width && height)					\
+	      {								\
+		tb->x = x;						\
+		tb->y = y;						\
+		tb->width = width;					\
+		tb->height = height;					\
+	        tb->border_width = border_width;			\
+	        tb->vertical = vert;					\
+									\
+                if (tb->blank || NILP (tb->up_glyph))			\
+		  {							\
+		    xlike_draw_blank_toolbar_button (f, tb);		\
+		  }							\
+	        else							\
+		  xlike_output_toolbar_button (f, button);		\
+	      }								\
+	  }								\
+									\
+	if (vert)							\
+	  y += height;							\
+	else								\
+	  x += width;							\
+									\
+	if ((vert && y == max_pixpos) || (!vert && x == max_pixpos))	\
+	  button = Qnil;						\
+	else								\
+	  button = tb->next;						\
+      }									\
+  } while (0)
+
+#define SET_TOOLBAR_WAS_VISIBLE_FLAG(frame, pos, flag)			\
+  do {									\
+    switch (pos)							\
+      {									\
+      case TOP_TOOLBAR:							\
+	(frame)->top_toolbar_was_visible = flag;			\
+	break;								\
+      case BOTTOM_TOOLBAR:						\
+	(frame)->bottom_toolbar_was_visible = flag;			\
+	break;								\
+      case LEFT_TOOLBAR:						\
+	(frame)->left_toolbar_was_visible = flag;			\
+	break;								\
+      case RIGHT_TOOLBAR:						\
+	(frame)->right_toolbar_was_visible = flag;			\
+	break;								\
+      default:								\
+	ABORT ();							\
+      }									\
+  } while (0)
+
+static void
+xlike_output_toolbar (struct frame *f, enum toolbar_pos pos)
+{
+  int x, y, bar_width, bar_height, vert;
+  int max_pixpos, right_size, right_start, blank_size;
+  int border_width = FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos);
+  Lisp_Object button, window;
+  face_index toolbar_findex;
+
+  get_toolbar_coords (f, pos, &x, &y, &bar_width, &bar_height, &vert, 1);
+  window = FRAME_LAST_NONMINIBUF_WINDOW (f);
+  toolbar_findex = get_builtin_face_cache_index (XWINDOW (window), Vtoolbar_face);
+
+  /* Do the border */
+  redisplay_clear_region (window, toolbar_findex,
+			  x, y,
+			  (vert ? bar_width : border_width),
+			  (vert ? border_width : bar_height));
+  redisplay_clear_region (window, toolbar_findex,
+			  (vert ? x : x + bar_width - border_width),
+			  (vert ? y + bar_height - border_width : y),
+			  (vert ? bar_width : border_width),
+			  (vert ? border_width : bar_height));
+
+  if (vert)
+    {
+      max_pixpos = y + bar_height - border_width;
+      y += border_width;
+    }
+  else
+    {
+      max_pixpos = x + bar_width - border_width;
+      x += border_width;
+    }
+
+  button = FRAME_TOOLBAR_BUTTONS (f, pos);
+  right_size = 0;
+
+  /* First loop over all of the buttons to determine how much room we
+     need for left hand and right hand buttons.  This loop will also
+     make sure that all instances are instantiated so when we actually
+     output them they will come up immediately. */
+  while (!NILP (button))
+    {
+      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+      int size = xlike_get_button_size (f, window, tb, vert, pos);
+
+      if (tb->pushright)
+	right_size += size;
+
+      button = tb->next;
+    }
+
+  button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+  /* Loop over the left buttons, updating and outputting them. */
+  XLIKE_OUTPUT_BUTTONS_LOOP (1);
+
+  /* Now determine where the right buttons start. */
+  right_start = max_pixpos - right_size;
+  if (right_start < (vert ? y : x))
+    right_start = (vert ? y : x);
+
+  /* Output the blank which goes from the end of the left buttons to
+     the start of the right. */
+  blank_size = right_start - (vert ? y : x);
+  if (blank_size)
+    {
+      int height, width;
+
+      if (vert)
+	{
+	  width = bar_width;
+	  height = blank_size;
+	}
+      else
+	{
+	  width = blank_size;
+	  height = bar_height;
+	}
+
+      /*
+       * Use a 3D pushright separator only if there isn't a toolbar
+       * border.  A flat separator meshes with the border and looks
+       * better.
+       */
+      if (1)
+	{
+	  struct toolbar_button tb;
+
+	  tb.x = x;
+	  tb.y = y;
+	  tb.width = width;
+	  tb.height = height;
+	  tb.border_width = border_width;
+	  tb.vertical = vert;
+	  tb.enabled = 1;
+	  tb.up_glyph = border_width ? Qt : Qnil;
+
+	  __prepare_button_area (f, &tb);
+	}
+
+      if (vert)
+	y += height;
+      else
+	x += width;
+    }
+
+  /* Loop over the right buttons, updating and outputting them. */
+  XLIKE_OUTPUT_BUTTONS_LOOP (0);
+
+  if (!vert)
+    {
+      Lisp_Object frame = wrap_frame (f);
+
+      redisplay_clear_region (frame,
+			      DEFAULT_INDEX, FRAME_PIXWIDTH (f) - 1, y, 1,
+			      bar_height);
+    }
+
+  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 1);
+  __INTERNAL_FLUSH (XDEVICE (f->device));
+}
+
+static void
+xlike_clear_toolbar (struct frame *f, enum toolbar_pos pos, int thickness_change)
+{
+  Lisp_Object frame;
+  int x, y, width, height, vert;
+
+  get_toolbar_coords (f, pos, &x, &y, &width, &height, &vert, 1);
+  frame = wrap_frame (f);
+
+  /* The thickness_change parameter is used by the toolbar resize routines
+     to clear any excess toolbar if the size shrinks. */
+  if (thickness_change < 0)
+    {
+      if (pos == LEFT_TOOLBAR || pos == RIGHT_TOOLBAR)
+	{
+	  x = x + width + thickness_change;
+	  width = -thickness_change;
+	}
+      else
+	{
+	  y = y + height + thickness_change;
+	  height = -thickness_change;
+	}
+    }
+
+  SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
+
+  redisplay_clear_region (frame, DEFAULT_INDEX, x, y, width, height);
+
+  __INTERNAL_FLUSH (XDEVICE (f->device));
+}
+
+void
+xlike_output_frame_toolbars (struct frame *f)
+{
+  __INTERNAL_APPROPRIATENESS_CHECK(f);
+
+  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, TOP_TOOLBAR);
+
+  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, BOTTOM_TOOLBAR);
+
+  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, LEFT_TOOLBAR);
+
+  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
+    xlike_output_toolbar (f, RIGHT_TOOLBAR);
+}
+
+void
+xlike_clear_frame_toolbars (struct frame *f)
+{
+  __INTERNAL_APPROPRIATENESS_CHECK(f);
+
+  if (f->top_toolbar_was_visible
+      && !FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, TOP_TOOLBAR, 0);
+  if (f->bottom_toolbar_was_visible
+      && !FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, BOTTOM_TOOLBAR, 0);
+  if (f->left_toolbar_was_visible 
+      && !FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, LEFT_TOOLBAR, 0);
+  if (f->right_toolbar_was_visible 
+       && !FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
+    xlike_clear_toolbar (f, RIGHT_TOOLBAR, 0);
+}
+
+static void
+xlike_redraw_exposed_toolbar (struct frame *f, enum toolbar_pos pos, int x, int y,
+			    int width, int height)
+{
+  int bar_x, bar_y, bar_width, bar_height, vert;
+  Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, pos);
+
+  get_toolbar_coords (f, pos, &bar_x, &bar_y, &bar_width, &bar_height,
+		      &vert, 1);
+
+  if (((y + height) < bar_y) || (y > (bar_y + bar_height)))
+    return;
+  if (((x + width) < bar_x) || (x > (bar_x + bar_width)))
+    return;
+
+  while (!NILP (button))
+    {
+      struct toolbar_button *tb = XTOOLBAR_BUTTON (button);
+
+      if (vert)
+	{
+	  if (((tb->y + tb->height) > y) && (tb->y < (y + height)))
+	    tb->dirty = 1;
+
+	  /* If this is true we have gone past the exposed region. */
+	  if (tb->y > (y + height))
+	    break;
+	}
+      else
+	{
+	  if (((tb->x + tb->width) > x) && (tb->x < (x + width)))
+	    tb->dirty = 1;
+
+	  /* If this is true we have gone past the exposed region. */
+	  if (tb->x > (x + width))
+	    break;
+	}
+
+      button = tb->next;
+    }
+
+  /* Even if none of the buttons is in the area, the blank region at
+     the very least must be because the first thing we did is verify
+     that some portion of the toolbar is in the exposed region. */
+  xlike_output_toolbar (f, pos);
+}
+
+void
+xlike_redraw_exposed_toolbars (struct frame *f, int x, int y, int width,
+				int height)
+{
+  __INTERNAL_APPROPRIATENESS_CHECK(f);
+
+  if (FRAME_REAL_TOP_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, TOP_TOOLBAR, x, y, width, height);
+
+  if (FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, BOTTOM_TOOLBAR, x, y, width, height);
+
+  if (FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, LEFT_TOOLBAR, x, y, width, height);
+
+  if (FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f))
+    xlike_redraw_exposed_toolbar (f, RIGHT_TOOLBAR, x, y, width, height);
+}
+
+void
+xlike_redraw_frame_toolbars (struct frame *f)
+{
+  /* There are certain startup paths that lead to update_EmacsFrame in
+     faces.c being called before a new frame is fully initialized.  In
+     particular before we have actually mapped it.  That routine can
+     call this one.  So, we need to make sure that the frame is
+     actually ready before we try and draw all over it. */
+  if (__INTERNAL_MAPPED_P(f))
+    xlike_redraw_exposed_toolbars (f, 0, 0, FRAME_PIXWIDTH (f),
+				    FRAME_PIXHEIGHT (f));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/toolbar-xlike.h	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,21 @@
+/* toolbar-xlike.h
+**
+** Description: 
+**
+** Created by: William M. Perry
+** Copyright (c) 2001 Free Software Foundation
+**
+*/
+
+#ifndef __TOOLBAR_XLIKE_H__
+#define __TOOLBAR_XLIKE_H__
+
+extern void xlike_output_frame_toolbars (struct frame *f);
+extern void xlike_redraw_exposed_toolbars (struct frame *f,
+					    int x, int y,
+					    int width, int height);
+extern void xlike_redraw_frame_toolbars (struct frame *f);
+extern void xlike_output_toolbar_button (struct frame *f, Lisp_Object button);
+extern void xlike_clear_frame_toolbars (struct frame *f);
+
+#endif /* __TOOLBAR_XLIKE_H__ */
--- a/src/tooltalk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/tooltalk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -172,10 +172,9 @@
   Lisp_Tooltalk_Message *p = XTOOLTALK_MESSAGE (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<tooltalk_message 0x%x>",
-				p->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
 
-  write_fmt_string (printcharfun, "#<tooltalk_message id:0x%lx 0x%x>",
+  write_fmt_string (printcharfun, "#<tooltalk-message id:0x%lx 0x%x>",
 		    (long) (p->m), p->header.uid);
 }
 
@@ -248,10 +247,9 @@
   Lisp_Tooltalk_Pattern *p = XTOOLTALK_PATTERN (obj);
 
   if (print_readably)
-    printing_unreadable_object ("#<tooltalk_pattern 0x%x>",
-				p->header.uid);
+    printing_unreadable_lcrecord (obj, 0);
 
-  write_fmt_string (printcharfun, "#<tooltalk_pattern id:0x%lx 0x%x>",
+  write_fmt_string (printcharfun, "#<tooltalk-pattern id:0x%lx 0x%x>",
 		    (long) (p->p), p->header.uid);
 }
 
@@ -310,7 +308,7 @@
     {
       CIbyte *err;
 
-      EXTERNAL_TO_C_STRING (tt_status_message (st), err, Qnative);
+      err = EXTERNAL_TO_ITEXT (tt_status_message (st), Qtooltalk_encoding);
       signal_error (Qtooltalk_error, err, Qunbound);
     }
 }
@@ -358,7 +356,7 @@
   fflush (tooltalk_log_file);
 #endif
 
-  message_ = VOID_TO_LISP (tt_message_user (m, TOOLTALK_MESSAGE_KEY));
+  message_ = GET_LISP_FROM_VOID (tt_message_user (m, TOOLTALK_MESSAGE_KEY));
   pattern = make_tooltalk_pattern (p);
   cb = XTOOLTALK_MESSAGE (message_)->callback;
   GCPRO2 (message_, pattern);
@@ -402,7 +400,7 @@
 #endif
 
   message_ = make_tooltalk_message (m);
-  pattern = VOID_TO_LISP (tt_pattern_user (p, TOOLTALK_PATTERN_KEY));
+  pattern = GET_LISP_FROM_VOID (tt_pattern_user (p, TOOLTALK_PATTERN_KEY));
   cb = XTOOLTALK_PATTERN (pattern)->callback;
   GCPRO2 (message_, pattern);
   if (!NILP (Vtooltalk_pattern_handler_hook))
@@ -512,27 +510,27 @@
 static Lisp_Object
 tt_build_c_string (char *s)
 {
-  return build_string (s ? s : "");
+  return build_cistring (s ? s : "");
 }
 
 static Lisp_Object
 tt_opnum_string (int n)
 {
-  char buf[32];
+  Ascbyte buf[32];
 
   sprintf (buf, "%u", n);
-  return build_string (buf);
+  return build_ascstring (buf);
 }
 
 static Lisp_Object
 tt_message_arg_ival_string (Tt_message m, int n)
 {
-  char buf[DECIMAL_PRINT_SIZE (long)];
+  Ascbyte buf[DECIMAL_PRINT_SIZE (long)];
   int value;
 
   check_status (tt_message_arg_ival (m, n, &value));
   long_to_string (buf, value);
-  return build_string (buf);
+  return build_ascstring (buf);
 }
 
 static Lisp_Object
@@ -771,9 +769,8 @@
       Extbyte *value_ext;
       Bytecount value_ext_len;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value,
-			  ALLOCA, (value_ext, value_ext_len),
-			  Qnative);
+      LISP_STRING_TO_SIZED_EXTERNAL (value, value_ext, value_ext_len,
+				     Qtooltalk_encoding);
       tt_message_arg_bval_set (m, n, (unsigned char *) value_ext, value_ext_len);
     }
   else if (EQ (attribute, Qtt_arg_ival))
@@ -785,7 +782,7 @@
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_message_arg_val_set (m, n, value_ext);
     }
   else if (EQ (attribute, Qtt_status))
@@ -810,7 +807,7 @@
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       (*fun_str) (m, value_ext);
     }
 
@@ -863,7 +860,7 @@
       tt_message_callback_add (m, tooltalk_message_callback);
     }
   tt_message_session_set (m, tt_default_session ());
-  tt_message_user_set (m, TOOLTALK_MESSAGE_KEY, LISP_TO_VOID (message_));
+  tt_message_user_set (m, TOOLTALK_MESSAGE_KEY, STORE_LISP_IN_VOID (message_));
   return message_;
 }
 
@@ -926,13 +923,13 @@
   {
     const char *vtype_ext;
 
-    LISP_STRING_TO_EXTERNAL (vtype, vtype_ext, Qnative);
+    vtype_ext = LISP_STRING_TO_EXTERNAL (vtype, Qtooltalk_encoding);
     if (NILP (value))
       tt_message_arg_add (m, n, vtype_ext, NULL);
     else if (STRINGP (value))
       {
 	const char *value_ext;
-	LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+	value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
 	tt_message_arg_add (m, n, vtype_ext, value_ext);
       }
     else if (INTP (value))
@@ -971,7 +968,7 @@
 
   tt_pattern_callback_add (p, tooltalk_pattern_callback);
   tt_pattern_session_add (p, tt_default_session ());
-  tt_pattern_user_set (p, TOOLTALK_PATTERN_KEY, LISP_TO_VOID (pattern));
+  tt_pattern_user_set (p, TOOLTALK_PATTERN_KEY, STORE_LISP_IN_VOID (pattern));
 
   return pattern;
 }
@@ -1037,28 +1034,28 @@
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_file_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_object))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_object_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_op))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_op_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_otype))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_otype_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_scope))
@@ -1070,21 +1067,21 @@
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_sender_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_sender_ptype))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_sender_ptype_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_session))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+      value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
       tt_pattern_session_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_state))
@@ -1125,13 +1122,13 @@
   {
     const char *vtype_ext;
 
-    LISP_STRING_TO_EXTERNAL (vtype, vtype_ext, Qnative);
+    vtype_ext = LISP_STRING_TO_EXTERNAL (vtype, Qtooltalk_encoding);
     if (NILP (value))
       tt_pattern_arg_add (p, n, vtype_ext, NULL);
     else if (STRINGP (value))
       {
 	const char *value_ext;
-	LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
+	value_ext = LISP_STRING_TO_EXTERNAL (value, Qtooltalk_encoding);
 	tt_pattern_arg_add (p, n, vtype_ext, value_ext);
       }
     else if (INTP (value))
@@ -1213,8 +1210,8 @@
 */
        ())
 {
-  char *procid = tt_default_procid ();
-  return procid ? build_string (procid) : Qnil;
+  Extbyte *procid = tt_default_procid ();
+  return procid ? build_extstring (procid, Qtooltalk_encoding) : Qnil;
 }
 
 DEFUN ("tooltalk-default-session", Ftooltalk_default_session, 0, 0, 0, /*
@@ -1222,8 +1219,8 @@
 */
        ())
 {
-  char *session = tt_default_session ();
-  return session ? build_string (session) : Qnil;
+  Extbyte *session = tt_default_session ();
+  return session ? build_extstring (session, Qtooltalk_encoding) : Qnil;
 }
 
 static void
@@ -1263,7 +1260,7 @@
 
   tt_session_join (tt_default_session ());
 
-  lp = connect_to_file_descriptor (build_string ("tooltalk"), Qnil,
+  lp = connect_to_file_descriptor (build_ascstring ("tooltalk"), Qnil,
 				   Vtooltalk_fd, Vtooltalk_fd);
   if (!NILP (lp))
     {
@@ -1419,8 +1416,8 @@
 */ );
   Vtooltalk_unprocessed_message_hook = Qnil;
 
-  Tooltalk_Message_plist_str = build_msg_string ("Tooltalk Message plist");
-  Tooltalk_Pattern_plist_str = build_msg_string ("Tooltalk Pattern plist");
+  Tooltalk_Message_plist_str = build_defer_string ("Tooltalk Message plist");
+  Tooltalk_Pattern_plist_str = build_defer_string ("Tooltalk Pattern plist");
 
   staticpro(&Tooltalk_Message_plist_str);
   staticpro(&Tooltalk_Pattern_plist_str);
--- a/src/ui-byhand.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/ui-byhand.c	Wed Feb 24 01:58:04 2010 -0600
@@ -187,7 +187,7 @@
 
   if (text)
     {
-      rval = build_string (text);
+      rval = build_cistring (text);
       /* NOTE: This is NOT a memory leak.  GtkCList returns a pointer
 	 to internally used memory, not a copy of it.
 	 g_free (text);
@@ -274,7 +274,7 @@
 
   return (list3 (pixmap ? build_gtk_boxed (pixmap, GTK_TYPE_GDK_WINDOW) : Qnil,
 		 mask ? build_gtk_boxed (mask, GTK_TYPE_GDK_WINDOW) : Qnil,
-		 (text && text[0]) ? build_string (text) : Qnil));
+		 (text && text[0]) ? build_cistring (text) : Qnil));
 }
 
 /* void gtk_color_selection_get_color(GtkColorSelection *colorsel, gdouble *color); */
@@ -425,7 +425,7 @@
 
   gtk_label_get (GTK_LABEL (XGTK_OBJECT (label)->object), &string);
 
-  return (build_string (string));
+  return (build_cistring (string));
 }
 
 DEFUN ("gtk-notebook-query-tab-label-packing", Fgtk_notebook_query_tab_label_packing, 2, 2, 0, /*
@@ -490,7 +490,7 @@
   Lisp_Object callback;
   Lisp_Object lisp_user_data;
 
-  callback = VOID_TO_LISP (user_data);
+  callback = GET_LISP_FROM_VOID (user_data);
 
   lisp_user_data = XCAR (callback);
   callback = XCDR (callback);
@@ -549,7 +549,7 @@
 	 (char*) XSTRING_DATA (tooltip_private_text),
 	 GTK_WIDGET (XGTK_OBJECT (icon)->object),
 	 GTK_SIGNAL_FUNC (__generic_toolbar_callback),
-	 LISP_TO_VOID (callback));
+	 STORE_LISP_IN_VOID (callback));
     }
   else
     {
@@ -559,7 +559,7 @@
 				   (char*) XSTRING_DATA (tooltip_private_text),
 				   GTK_WIDGET (XGTK_OBJECT (icon)->object),
 				   GTK_SIGNAL_FUNC (__generic_toolbar_callback),
-				   LISP_TO_VOID (callback),
+				   STORE_LISP_IN_VOID (callback),
 				   XINT (position));
     }
 
@@ -599,7 +599,7 @@
 {
   Lisp_Object closure;
 
-  closure = VOID_TO_LISP (user_data);
+  closure = GET_LISP_FROM_VOID (user_data);
 
   call3 (XCAR (closure),
 	 build_gtk_object (GTK_OBJECT (ctree)),
@@ -666,7 +666,7 @@
 	(GTK_CTREE (XGTK_OBJECT (ctree)->object),
 	 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
 	 __emacs_gtk_ctree_recurse_internal,
-	 LISP_TO_VOID (closure));
+	 STORE_LISP_IN_VOID (closure));
     }
   else
     {
@@ -675,7 +675,7 @@
 	 NILP (node) ? NULL : (GtkCTreeNode *) XGTK_BOXED (node)->object,
 	 XINT (depth),
 	 __emacs_gtk_ctree_recurse_internal,
-	 LISP_TO_VOID (closure));
+	 STORE_LISP_IN_VOID (closure));
     }
 
   UNGCPRO;
--- a/src/ui-gtk.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/ui-gtk.c	Wed Feb 24 01:58:04 2010 -0600
@@ -21,24 +21,23 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #include <config.h>
 #include "lisp.h"
 
 #include "buffer.h"
-#include "console-gtk-impl.h"
 #include "device.h"
 #include "elhash.h"
-#include "event-gtk.h"
 #include "events.h"
 #include "faces.h"
+#include "hash.h"
+#include "sysdll.h"
+#include "window.h"
+
+#include "console-gtk-impl.h"
 #include "glyphs-gtk.h"
-#include "hash.h"
 #include "objects-gtk.h"
-#include "sysdll.h"
 #include "ui-gtk.h"
-#include "window.h"
 
 /* XEmacs specific GTK types */
 #include "gtk-glue.c"
@@ -94,7 +93,7 @@
 
   /* If the dll name has a directory component in it, then we should
      expand it. */
-  if (!NILP (Fstring_match (build_string ("/"), dll, Qnil, Qnil)))
+  if (!NILP (Fstring_match (build_ascstring ("/"), dll, Qnil, Qnil)))
     dll = Fexpand_file_name (dll, Qnil);
 
   /* Check if we have already opened it first */
@@ -327,7 +326,7 @@
 		    int UNUSED (escapeflag))
 {
   if (print_readably)
-    printing_unreadable_object ("#<ffi %p>", XFFI (obj)->function_ptr);
+    printing_unreadable_lcrecord (obj, 0);
 
   write_fmt_string_lisp (printcharfun, "#<ffi %S", 1, XFFI (obj)->function_name);
   if (XFFI (obj)->n_args)
@@ -385,7 +384,7 @@
 	GTK_VALUE_POINTER (a) = * (void **) v;		\
 	break;						\
       }							\
-    if (freep) xfree(v, void *);			\
+    if (freep) xfree (v);			\
   } while (0)
 
 static gpointer __allocate_object_storage (GtkType t)
@@ -463,43 +462,43 @@
   switch (GTK_FUNDAMENTAL_TYPE (t))
     {
     case GTK_TYPE_NONE:
-      return (build_string ("NONE"));
+      return (build_ascstring ("NONE"));
       /* flag types */
     case GTK_TYPE_CHAR:
     case GTK_TYPE_UCHAR:
-      return (build_string ("CHAR"));
+      return (build_ascstring ("CHAR"));
     case GTK_TYPE_BOOL:
-      return (build_string ("BOOL"));
+      return (build_ascstring ("BOOL"));
     case GTK_TYPE_ENUM:
     case GTK_TYPE_FLAGS:
     case GTK_TYPE_INT:
     case GTK_TYPE_UINT:
-      return (build_string ("INT"));
+      return (build_ascstring ("INT"));
     case GTK_TYPE_LONG:
     case GTK_TYPE_ULONG:
-      return (build_string ("LONG"));
+      return (build_ascstring ("LONG"));
     case GTK_TYPE_FLOAT:
     case GTK_TYPE_DOUBLE:
-      return (build_string ("FLOAT"));
+      return (build_ascstring ("FLOAT"));
     case GTK_TYPE_STRING:
-      return (build_string ("STRING"));
+      return (build_ascstring ("STRING"));
     case GTK_TYPE_BOXED:
     case GTK_TYPE_POINTER:
-      return (build_string ("POINTER"));
+      return (build_ascstring ("POINTER"));
     case GTK_TYPE_OBJECT:
-      return (build_string ("OBJECT"));
+      return (build_ascstring ("OBJECT"));
     case GTK_TYPE_CALLBACK:
-      return (build_string ("CALLBACK"));
+      return (build_ascstring ("CALLBACK"));
     default:
       /* I can't put this in the main switch statement because it is a
          new fundamental type that is not fixed at compile time.
          *sigh*
 	 */
       if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_ARRAY))
-	return (build_string ("ARRAY"));
+	return (build_ascstring ("ARRAY"));
 
       if (IS_XEMACS_GTK_FUNDAMENTAL_TYPE(t, GTK_TYPE_LISTOF))
-	return (build_string ("LIST"));
+	return (build_ascstring ("LIST"));
       return (Qnil);
     }
 }
@@ -643,13 +642,13 @@
 	    {
 	      invalid_argument ("Do not know how to marshal", type);
 	    }
-	  marshaller = concat3 (marshaller, build_string ("_"), marshaller_type);
+	  marshaller = concat3 (marshaller, build_ascstring ("_"), marshaller_type);
 	  n_args++;
 	}
     }
   else
     {
-      marshaller = concat3 (marshaller, build_string ("_"), type_to_marshaller_type (GTK_TYPE_NONE));
+      marshaller = concat3 (marshaller, build_ascstring ("_"), type_to_marshaller_type (GTK_TYPE_NONE));
     }
 
   rettype = Fsymbol_name (rettype);
@@ -662,8 +661,8 @@
 
   import_gtk_type (data->return_type);
 
-  marshaller = concat3 (type_to_marshaller_type (data->return_type), build_string ("_"), marshaller);
-  marshaller = concat2 (build_string ("emacs_gtk_marshal_"), marshaller);
+  marshaller = concat3 (type_to_marshaller_type (data->return_type), build_ascstring ("_"), marshaller);
+  marshaller = concat2 (build_ascstring ("emacs_gtk_marshal_"), marshaller);
 
   marshaller_func = (ffi_marshalling_function) find_marshaller ((char *) XSTRING_DATA (marshaller));
 
@@ -796,13 +795,13 @@
 			  int UNUSED (escapeflag))
 {
   if (print_readably)
-    printing_unreadable_object ("#<GtkObject %p>", XGTK_OBJECT (obj)->object);
+    printing_unreadable_lcrecord (obj, 0);
 
-  write_c_string (printcharfun, "#<GtkObject (");
+  write_ascstring (printcharfun, "#<GtkObject (");
   if (XGTK_OBJECT (obj)->alive_p)
-    write_c_string (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
+    write_cistring (printcharfun, gtk_type_name (GTK_OBJECT_TYPE (XGTK_OBJECT (obj)->object)));
   else
-    write_c_string (printcharfun, "dead");
+    write_ascstring (printcharfun, "dead");
   write_fmt_string (printcharfun, ") %p>", (void *) XGTK_OBJECT (obj)->object);
 }
 
@@ -1006,7 +1005,7 @@
 {
   Lisp_Object lisp_data;
 
-  lisp_data = VOID_TO_LISP (data);
+  lisp_data = GET_LISP_FROM_VOID (data);
 
   ungcpro_popup_callbacks (XINT (XCAR (lisp_data)));
 }
@@ -1022,7 +1021,7 @@
   struct gcpro gcpro1;
   int i;
 
-  callback_fn = VOID_TO_LISP (data);
+  callback_fn = GET_LISP_FROM_VOID (data);
 
   /* Nuke the GUI_ID off the front */
   callback_fn = XCDR (callback_fn);
@@ -1088,7 +1087,7 @@
   gcpro_popup_callbacks (id, func);
 
   gtk_signal_connect_full (XGTK_OBJECT (obj)->object, (char *) XSTRING_DATA (name),
-			   NULL, __internal_callback_marshal, LISP_TO_VOID (func),
+			   NULL, __internal_callback_marshal, STORE_LISP_IN_VOID (func),
 			   __internal_callback_destroy, c_object_signal, c_after);
   return (Qt);
 }
@@ -1104,10 +1103,10 @@
 			 int UNUSED (escapeflag))
 {
   if (print_readably)
-    printing_unreadable_object ("#<GtkBoxed %p>", XGTK_BOXED (obj)->object);
+    printing_unreadable_lcrecord (obj, 0);
 
-  write_c_string (printcharfun, "#<GtkBoxed (");
-  write_c_string (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type));
+  write_ascstring (printcharfun, "#<GtkBoxed (");
+  write_cistring (printcharfun, gtk_type_name (XGTK_BOXED (obj)->object_type));
   write_fmt_string (printcharfun, ") %p>", (void *) XGTK_BOXED (obj)->object);
 }
 
@@ -1481,7 +1480,7 @@
     case GTK_TYPE_DOUBLE:
       return (make_float (GTK_VALUE_DOUBLE (*arg)));
     case GTK_TYPE_STRING:
-      return (build_string (GTK_VALUE_STRING (*arg)));
+      return (build_cistring (GTK_VALUE_STRING (*arg)));
     case GTK_TYPE_FLAGS:
       return (flags_to_list (GTK_VALUE_FLAGS (*arg), arg->type));
     case GTK_TYPE_ENUM:
@@ -1501,7 +1500,7 @@
 	{
 	  Lisp_Object rval;
 	  
-	  rval = VOID_TO_LISP (GTK_VALUE_POINTER (*arg));
+	  rval = GET_LISP_FROM_VOID (GTK_VALUE_POINTER (*arg));
 	  return (rval);
 	}
       else
@@ -1516,7 +1515,7 @@
       {
 	Lisp_Object rval;
 
-	rval = VOID_TO_LISP (GTK_VALUE_CALLBACK (*arg).data);
+	rval = GET_LISP_FROM_VOID (GTK_VALUE_CALLBACK (*arg).data);
 
 	return (rval);
       }
@@ -1737,7 +1736,7 @@
       if (NILP (obj))
 	GTK_VALUE_POINTER(*arg) = NULL;
       else
-	GTK_VALUE_POINTER(*arg) = LISP_TO_VOID (obj);
+	GTK_VALUE_POINTER(*arg) = STORE_LISP_IN_VOID (obj);
       break;
 
       /* structured types */
@@ -2017,7 +2016,7 @@
       if (NILP (obj))
 	*(GTK_RETLOC_POINTER(*arg)) = NULL;
       else
-	*(GTK_RETLOC_POINTER(*arg)) = LISP_TO_VOID (obj);
+	*(GTK_RETLOC_POINTER(*arg)) = STORE_LISP_IN_VOID (obj);
       break;
 
       /* structured types */
@@ -2121,7 +2120,7 @@
 
   if (NILP (alist))
     {
-      invalid_argument ("Unknown enumeration", build_string (gtk_type_name (t)));
+      invalid_argument ("Unknown enumeration", build_cistring (gtk_type_name (t)));
     }
 
   value = Fassq (obj, alist);
@@ -2190,7 +2189,7 @@
 
   if (NILP (alist))
     {
-      invalid_argument ("Unknown enumeration", build_string (gtk_type_name (t)));
+      invalid_argument ("Unknown enumeration", build_cistring (gtk_type_name (t)));
     }
 
   cell = Frassq (make_int (value), alist);
--- a/src/ui-gtk.h	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/ui-gtk.h	Wed Feb 24 01:58:04 2010 -0600
@@ -21,15 +21,14 @@
 ** along with XEmacs; see the file COPYING.  If not, write to
 ** the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 ** Boston, MA 02111-1301, USA.  */
-*/
 
 #ifndef __UI_GTK_H__
 #define __UI_GTK_H__
 
 /* Encapsulate a foreign function call */
-#include <gtk/gtk.h>
+
+#include "sysgtk.h"
 #include "sysdll.h"
-#include "lrecord.h"
 
 typedef void (*ffi_actual_function) (void);
 typedef void (*ffi_marshalling_function) (ffi_actual_function, GtkArg *);
--- a/src/unexaix.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/unexaix.c	Wed Feb 24 01:58:04 2010 -0600
@@ -122,7 +122,7 @@
   if (fd)
     close (fd);
   report_error_with_errno (Qio_error, "Cannot unexec",
-			   build_string (file));
+			   build_cistring (file));
 }
 #endif /* emacs */
 
--- a/src/unexcw.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/unexcw.c	Wed Feb 24 01:58:04 2010 -0600
@@ -102,7 +102,7 @@
 {
   /* ugly nt hack - should be in lisp */
   int a_new, a_out = -1;
-  char new_name[PATH_MAX_EXTERNAL], a_name[PATH_MAX_EXTERNAL];
+  char new_name[PATH_MAX_TCHAR], a_name[PATH_MAX_TCHAR];
   char *ptr;
   
   /* Make sure that the input and output filenames have the
--- a/src/unexec.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/unexec.c	Wed Feb 24 01:58:04 2010 -0600
@@ -298,7 +298,7 @@
   if (fd)
     close (fd);
   report_error_with_errno (Qio_error, "Cannot unexec",
-			   build_ext_string (file, Qfile_name));
+			   build_extstring (file, Qfile_name));
 }
 #endif /* emacs */
 
--- a/src/unexnt.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/unexnt.c	Wed Feb 24 01:58:04 2010 -0600
@@ -133,7 +133,7 @@
      won't work.)  */
   if (heap_state == HEAP_UNLOADED) 
     {
-      Extbyte executable_path[PATH_MAX_EXTERNAL];
+      Extbyte executable_path[PATH_MAX_TCHAR];
 
       /* Don't use mswindows_get_module_file_name() because it uses
 	 xmalloc() */
--- a/src/unicode.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/unicode.c	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,5 @@
 /* Code to handle Unicode conversion.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -508,7 +508,7 @@
       }
     }
 
-  xfree (table, void *);
+  xfree (table);
 }
 
 static void
@@ -526,7 +526,7 @@
 	}
     }
 
-  xfree (table, void *);
+  xfree (table);
 }
 
 void
@@ -1155,7 +1155,7 @@
 	  qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets);
 
 	  Vcurrent_jit_charset = Fmake_charset 
-	    (intern((const CIbyte *)setname), Vcharset_descr, 
+	    (intern_istring (setname), Vcharset_descr, 
 	     /* Set encode-as-utf-8 to t, to have this character set written
 		using UTF-8 escapes in escape-quoted and ctext. This
 		sidesteps the fact that our internal character -> Unicode
@@ -2826,10 +2826,10 @@
   write_fmt_string_lisp (printcharfun, "(%s", 1,
                          unicode_getprop (cs, Qunicode_type));
   if (XCODING_SYSTEM_UNICODE_LITTLE_ENDIAN (cs))
-    write_c_string (printcharfun, ", little-endian");
+    write_ascstring (printcharfun, ", little-endian");
   if (XCODING_SYSTEM_UNICODE_NEED_BOM (cs))
-    write_c_string (printcharfun, ", need-bom");
-  write_c_string (printcharfun, ")");
+    write_ascstring (printcharfun, ", need-bom");
+  write_ascstring (printcharfun, ")");
 }
 
 #ifdef MULE
@@ -3048,18 +3048,12 @@
 
               if (flags & QUERY_METHOD_ERRORP)
                 {
-                  DECLARE_EISTRING (error_details);
-
-                  eicpy_ascii (error_details, "Cannot encode ");
-                  eicat_lstr (error_details,
-                              make_string_from_buffer (buf, fail_range_start, 
-                                                       pos -
-                                                       fail_range_start));
-                  eicat_ascii (error_details, " using coding system");
-
-                  signal_error (Qtext_conversion_error, 
-                                (const CIbyte *)(eidata (error_details)),
-                                XCODING_SYSTEM_NAME (codesys));
+                  signal_error_2
+		    (Qtext_conversion_error,
+		     "Cannot encode using coding system",
+		     make_string_from_buffer (buf, fail_range_start,
+					      pos - fail_range_start),
+		     XCODING_SYSTEM_NAME (codesys));
                 }
 
               if (NILP (result))
@@ -3219,7 +3213,7 @@
   Vlast_jit_charset_final = make_char (0x30);
   staticpro (&Vcharset_descr);
   Vcharset_descr
-    = build_string ("Mule charset for otherwise unknown Unicode code points.");
+    = build_defer_string ("Mule charset for otherwise unknown Unicode code points.");
 
   staticpro (&Vlanguage_unicode_precedence_list);
   Vlanguage_unicode_precedence_list = Qnil;
@@ -3268,7 +3262,7 @@
 found (that is, they're probably Mule-specific charsets like Ethiopic or
 IPA.)
 */ );
-  Qunicode_registries = vector1(build_string("iso10646-1"));
+  Qunicode_registries = vector1(build_ascstring("iso10646-1"));
 
   /* Initialised in lisp/mule/general-late.el, by a call to
      #'set-unicode-query-skip-chars-args. Or at least they would be, but we
@@ -3290,3 +3284,38 @@
   Vutf_8_invalid_string = Qnil;
 #endif /* MULE */
 }
+
+void
+complex_vars_of_unicode (void)
+{
+  /* We used to define this in unicode.el.  But we need it early for
+     Cygwin 1.7 -- used in LOCAL_FILE_FORMAT_TO_TSTR() et al. */
+  Fmake_coding_system_internal
+    (Qutf_8, Qunicode,
+     build_defer_string ("UTF-8"),
+     nconc2 (list4 (Qdocumentation,
+		    build_defer_string (
+"UTF-8 Unicode encoding -- ASCII-compatible 8-bit variable-width encoding\n"
+"sharing the following principles with the Mule-internal encoding:\n"
+"\n"
+"  -- All ASCII characters (codepoints 0 through 127) are represented\n"
+"     by themselves (i.e. using one byte, with the same value as the\n"
+"     ASCII codepoint), and these bytes are disjoint from bytes\n"
+"     representing non-ASCII characters.\n"
+"\n"
+"     This means that any 8-bit clean application can safely process\n"
+"     UTF-8-encoded text as it were ASCII, with no corruption (e.g. a\n"
+"     '/' byte is always a slash character, never the second byte of\n"
+"     some other character, as with Big5, so a pathname encoded in\n"
+"     UTF-8 can safely be split up into components and reassembled\n"
+"     again using standard ASCII processes).\n"
+"\n"
+"  -- Leading bytes and non-leading bytes in the encoding of a\n"
+"     character are disjoint, so moving backwards is easy.\n"
+"\n"
+"  -- Given only the leading byte, you know how many following bytes\n"
+"     are present.\n"
+),
+		    Qmnemonic, build_ascstring ("UTF8")),
+	     list2 (Qunicode_type, Qutf_8)));
+}
--- a/src/win32.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/win32.c	Wed Feb 24 01:58:04 2010 -0600
@@ -70,7 +70,7 @@
 {
   Ibyte *pseudo_url;
   
-  WIN32_TO_LOCAL_FILE_FORMAT (filename, filename);
+  INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (filename, filename);
   pseudo_url = xnew_array (Ibyte, 5 + qxestrlen (filename) + 1);
   qxestrcpy_ascii (pseudo_url, "file:");
   qxestrcat (pseudo_url, filename);
@@ -90,12 +90,10 @@
 Lisp_Object
 tstr_to_local_file_format (Extbyte *path)
 {
-  Ibyte *ttlff;
+  Ibyte *pathint = TSTR_TO_ITEXT (path);
+  INTERNAL_MSWIN_TO_LOCAL_FILE_FORMAT (pathint, pathint);
 
-  TSTR_TO_C_STRING (path, ttlff);
-  WIN32_TO_LOCAL_FILE_FORMAT (ttlff, ttlff);
-
-  return build_intstring (ttlff);
+  return build_istring (pathint);
 }
 
 /* Normalize filename by converting all path separators to the specified
@@ -271,7 +269,7 @@
 	break;
     }
 
-  TSTR_TO_C_STRING (lpMsgBuf, inres);
+  inres = TSTR_TO_ITEXT (lpMsgBuf);
   len = qxestrlen (inres);
   /* Messages tend to end with a period and newline */
   if (len >= 3 && !qxestrcmp_ascii (inres + len - 3, ".\r\n"))
@@ -289,7 +287,7 @@
 }
 
 void
-mswindows_output_last_error (char *frob)
+mswindows_output_last_error (const Ascbyte *frob)
 {
   int errval = GetLastError ();
   Lisp_Object errmess = mswindows_lisp_error (errval);
@@ -299,11 +297,10 @@
 }
 
 DOESNT_RETURN
-mswindows_report_process_error (const char *string, Lisp_Object data,
+mswindows_report_process_error (const Ascbyte *reason, Lisp_Object data,
 				int errnum)
 {
-  report_file_type_error (Qprocess_error, mswindows_lisp_error (errnum),
-			  string, data);
+  signal_error_2 (Qprocess_error, reason, mswindows_lisp_error (errnum), data);
 }
 
 DEFUN ("mswindows-shell-execute", Fmswindows_shell_execute, 2, 4, 0, /*
@@ -345,14 +342,14 @@
     Extbyte *doc = NULL;
 
     if (STRINGP (operation))
-      LISP_STRING_TO_TSTR (operation, opext);
+      opext = LISP_STRING_TO_TSTR (operation);
     /* #### What about path names, which may be links? */
     if (STRINGP (parameters))
-      LISP_STRING_TO_TSTR (parameters, parmext);
+      parmext = LISP_STRING_TO_TSTR (parameters);
     if (STRINGP (current_dir))
-      LOCAL_FILE_FORMAT_TO_TSTR (current_dir, path);
+      LISP_LOCAL_FILE_FORMAT_TO_TSTR (current_dir, path);
     if (STRINGP (document))
-      LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR (document, doc);
+      LISP_LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR (document, doc);
 
     ret = (int) qxeShellExecute (NULL, opext, doc, parmext, path,
 				 (INTP (show_flag) ?
@@ -404,8 +401,8 @@
     return path;
 
   /* Use mule and cygwin-safe APIs top get at file data. */
-  LOCAL_TO_WIN32_FILE_FORMAT (p, p);
-  return build_intstring (p);
+  LOCAL_FILE_FORMAT_TO_INTERNAL_MSWIN (p, p);
+  return build_istring (p);
 }
 #endif
 
@@ -418,7 +415,7 @@
 static Ibyte *
 mswindows_read_link_1 (const Ibyte *fname)
 {
-#ifdef NO_CYGWIN_COM_SUPPORT
+#if defined (NO_CYGWIN_COM_SUPPORT) || !defined (HAVE_MS_WINDOWS)
   return NULL;
 #else
   Ibyte *retval = NULL;
@@ -435,7 +432,7 @@
 
   if (!mswindows_read_link_hash)
     mswindows_read_link_hash = make_string_hash_table (1000);
-  C_STRING_TO_TSTR (fname, fnameext);
+  fnameext = ITEXT_TO_TSTR (fname);
 
   /* See if we can find a cached value. */
 
@@ -521,7 +518,7 @@
 	    {
 	      Extbyte *fname_unicode;
 	      WIN32_FIND_DATAW wfd;
-	      LPWSTR resolved = alloca_array (WCHAR, PATH_MAX_EXTERNAL + 1);
+	      LPWSTR resolved = alloca_array (WCHAR, PATH_MAX_TCHAR + 1);
 
 	      /* Always Unicode.  Not obvious from the
 		 IPersistFile documentation, but look under
@@ -546,13 +543,13 @@
 		  /* Another Cygwin prototype error,
 		     fixed in v2.2 of w32api */
 		  XECOMCALL4 (psl, GetPath, (LPSTR) resolved,
-			      PATH_MAX_EXTERNAL, &wfd, 0)
+			      PATH_MAX_TCHAR, &wfd, 0)
 #else
 		  XECOMCALL4 (psl, GetPath, resolved,
-			      PATH_MAX_EXTERNAL, &wfd, 0)
+			      PATH_MAX_TCHAR, &wfd, 0)
 #endif
 		  == S_OK)
-		TSTR_TO_C_STRING_MALLOC (resolved, retval);
+		retval = TSTR_TO_ITEXT_MALLOC (resolved);
 
 	      XECOMCALL0 (ppf, Release);
 	    }
@@ -579,20 +576,19 @@
 	    {
 	      Extbyte *fname_unicode;
 	      WIN32_FIND_DATAA wfd;
-	      LPSTR resolved = alloca_array (CHAR, PATH_MAX_EXTERNAL + 1);
+	      LPSTR resolved = alloca_array (CHAR, PATH_MAX_TCHAR + 1);
 
 	      /* Always Unicode.  Not obvious from the
 		 IPersistFile documentation, but look under
 		 "Shell Link" for example code. */
-	      C_STRING_TO_EXTERNAL (fname, fname_unicode,
-				    Qmswindows_unicode);
+	      fname_unicode = ITEXT_TO_EXTERNAL (fname, Qmswindows_unicode);
 
 	      if (XECOMCALL2 (ppf, Load,
 			      (LPWSTR) fname_unicode,
 			      STGM_READ) == S_OK
 		  && XECOMCALL4 (psl, GetPath, resolved,
-				 PATH_MAX_EXTERNAL, &wfd, 0) == S_OK)
-		TSTR_TO_C_STRING_MALLOC (resolved, retval);
+				 PATH_MAX_TCHAR, &wfd, 0) == S_OK)
+		retval = TSTR_TO_ITEXT_MALLOC (resolved);
 
 	      XECOMCALL0 (ppf, Release);
 	    }
@@ -603,7 +599,7 @@
 
   /* Cache newly found value */
   if (rlh->resolved)
-    xfree (rlh->resolved, Ibyte *);
+    xfree (rlh->resolved);
   rlh->resolved = retval ? qxestrdup (retval) : NULL;
 
   return retval;
--- a/src/window.c	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/window.c	Wed Feb 24 01:58:04 2010 -0600
@@ -306,13 +306,19 @@
 print_window (Lisp_Object obj, Lisp_Object printcharfun,
 	      int UNUSED (escapeflag))
 {
+  Lisp_Object buf;
+
   if (print_readably)
-    printing_unreadable_object ("#<window 0x%x>", XWINDOW (obj)->header.uid);
-
-  write_c_string (printcharfun, "#<window");
-  if (!NILP (XWINDOW (obj)->buffer))
+    printing_unreadable_lcrecord (obj, 0);
+
+  write_ascstring (printcharfun, "#<window");
+  buf = XWINDOW_BUFFER (obj);
+  if (EQ (buf, Qt))
+    write_ascstring (printcharfun, " during creation");
+  else if (!NILP (buf))
     {
-      Lisp_Object name = XBUFFER (XWINDOW (obj)->buffer)->name;
+      
+      Lisp_Object name = XBUFFER (buf)->name;
       write_fmt_string_lisp (printcharfun, " on %S", 1, name);
     }
   write_fmt_string (printcharfun, " 0x%x>", XWINDOW (obj)->header.uid);
@@ -1033,7 +1039,7 @@
 }
 
 int
-window_scrollbar_width (struct window *w)
+window_scrollbar_width (struct window * USED_IF_SCROLLBARS (w))
 {
 #ifdef HAVE_SCROLLBARS
   if (!WINDOW_WIN_P (w)
@@ -1052,7 +1058,7 @@
 /* Horizontal scrollbars are only active on windows with truncation
    turned on. */
 int
-window_scrollbar_height (struct window *w)
+window_scrollbar_height (struct window * USED_IF_SCROLLBARS (w))
 {
 #ifdef HAVE_SCROLLBARS
   if (!WINDOW_WIN_P (w)
@@ -1110,15 +1116,15 @@
              since there is a redisplay condition that these
              structures be identical outside of redisplay. */
 	  dla = window_display_lines (w, DESIRED_DISP);
-	  if (dla && Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline)
-	    modeline_height = (Dynarr_atp (dla, 0)->ascent +
-			       Dynarr_atp (dla, 0)->descent);
+	  if (dla && Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
+	    modeline_height = (Dynarr_begin (dla)->ascent +
+			       Dynarr_begin (dla)->descent);
 	  else
 	    {
 	      dla = window_display_lines (w, CURRENT_DISP);
-	      if (dla && Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline)
-		modeline_height = (Dynarr_atp (dla, 0)->ascent +
-				   Dynarr_atp (dla, 0)->descent);
+	      if (dla && Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
+		modeline_height = (Dynarr_begin (dla)->ascent +
+				   Dynarr_begin (dla)->descent);
 	      else
 		/* This should be an abort except I'm not yet 100%
                    confident that it won't ever get hit (though I
@@ -1259,7 +1265,8 @@
 }
 
 static int
-window_left_window_gutter_width (struct window *w, int modeline)
+window_left_window_gutter_width (struct window *w,
+				 int USED_IF_SCROLLBARS (modeline))
 {
   if (!NILP (w->hchild) || !NILP (w->vchild))
     return 0;
@@ -1279,7 +1286,8 @@
 }
 
 static int
-window_right_window_gutter_width (struct window *w, int modeline)
+window_right_window_gutter_width (struct window *w,
+				  int USED_IF_SCROLLBARS (modeline))
 {
   int gutter = 0;
 
@@ -1906,7 +1914,7 @@
   struct display_line *dl;
 
   /* No lines - no clipped lines */
-  if (num_lines == 0 || (num_lines == 1 && Dynarr_atp (dla, 0)->modeline))
+  if (num_lines == 0 || (num_lines == 1 && Dynarr_begin (dla)->modeline))
     return Qnil;
 
   dl = Dynarr_atp (dla, num_lines - 1);
@@ -4191,7 +4199,7 @@
      indicates that end-of-buffer is being displayed. */
   if (end_pos == -1)
     {
-      struct display_line *dl = Dynarr_atp (dla, 0);
+      struct display_line *dl = Dynarr_begin (dla);
       int ypos1 = dl->ypos + dl->descent;
       int ypos2 = WINDOW_TEXT_BOTTOM (w);
       Lisp_Object window;
@@ -4226,7 +4234,7 @@
     }
   else
     {
-      if (num_lines > 1 && Dynarr_atp (dla, 0)->modeline)
+      if (num_lines > 1 && Dynarr_begin (dla)->modeline)
 	num_lines--;
 
       if (scroll_on_clipped_lines
@@ -4599,7 +4607,7 @@
     default_face_height_and_width (window, &fheight, &fwidth);
 
   if (Dynarr_length (dla) >= 1)
-    modeline = Dynarr_atp (dla, 0)->modeline;
+    modeline = Dynarr_begin (dla)->modeline;
 
   dl = Dynarr_atp (dla, modeline);
 
@@ -5287,7 +5295,7 @@
       CHECK_INT (pos);
       point = XINT (pos);
 
-      if (Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline)
+      if (Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
 	first_line = 1;
       else
 	first_line = 0;
--- a/src/xemacs.def.in.in	Wed Jan 20 07:05:57 2010 -0600
+++ b/src/xemacs.def.in.in	Wed Feb 24 01:58:04 2010 -0600
@@ -1,5 +1,6 @@
 /* The module API: core symbols that are visible to modules.
    Copyright (C) 2008 Jerry James
+   Copyright (C) 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -22,8 +23,14 @@
    meant to be used directly, but a macro or inline function in the
    API expands to a form containing the symbol, then the macro or
    inline function is named in a comment to the right. */
+
 #define NOT_C_CODE
 #include <config.h>
+
+#if defined (ERROR_CHECK_TYPES) && defined (XEMACS_DEFS_NEEDS_INLINE_DECLS)
+#define XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS
+#endif
+
 NAME xemacs.exe
 EXPORTS
 /* Exported functions */
@@ -45,11 +52,13 @@
 #ifdef USE_ASSERTIONS
 assert_failed			/* abort(), assert(), etc. */
 #endif
-build_ext_string
-build_intstring
-build_msg_intstring
-build_msg_string
-build_string
+build_extstring
+build_istring
+build_cistring
+build_ascstring
+build_msg_istring
+build_msg_cistring
+build_msg_ascstring
 #ifdef MULE
 bytecount_to_charcount_fun	/* bytecount_to_charcount */
 #endif
@@ -67,6 +76,8 @@
 #endif
 check_quit			/* QUITP */
 check_what_happened		/* QUIT */
+concat2
+concat3
 cons3
 copy_lisp_object
 dead_wrong_type_argument	/* CHECK_xxx */
@@ -104,7 +115,7 @@
 #ifdef DEBUG_XEMACS
 eq_with_ebola_notice		/* EQ_WITH_EBOLA_NOTICE */
 #endif
-#ifdef ERROR_CHECK_TYPES
+#ifdef XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS
 error_check_cons
 #ifdef HAVE_LDAP
 error_check_ldap
@@ -120,7 +131,7 @@
 error_check_string_indirect_data
 #endif
 error_check_symbol_value_forward
-#endif
+#endif /* XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS */
 free_opaque_ptr
 get_coding_system_for_text_file
 intern
@@ -135,13 +146,14 @@
 list4
 list5
 list6
-make_ext_string
+make_extstring
 make_float
 make_opaque_ptr
 make_string
 make_vector
 maybe_invalid_operation
 message
+nconc2
 new_dfc_convert_copy_data	/* C_STRING_TO_EXTERNAL, ... */
 new_dfc_convert_malloc		/* C_STRING_TO_EXTERNAL_MALLOC, ... */
 new_dfc_convert_size		/* C_STRING_TO_EXTERNAL, ... */
@@ -153,6 +165,38 @@
 #endif
 out_of_memory			/* The postgresql module uses this */
 printing_unreadable_object
+#ifdef XEMACS_DEFS_NEEDS_INLINE_DECLS
+qxestrdup
+qxestrlen
+qxestrcharlen
+qxestrcmp
+qxestrcmp_ascii
+qxestrncmp
+qxestrncmp_ascii
+qxestrcpy
+qxestrcpy_ascii
+qxestrncpy
+qxestrncpy_ascii
+qxestrcat
+qxestrcat_ascii
+qxestrncat
+qxestrncat_ascii
+qxestrchr
+qxestrrchr
+qxestrstr
+qxestrcspn
+qxestrspn
+qxestrpbrk
+qxestrtok
+qxestrtod
+qxestrtol
+qxestrtoul
+qxeatoi
+qxestrupr
+qxestrlwr
+qxesprintf
+qxesscanf_ascii_1
+#endif /* XEMACS_DEFS_NEEDS_INLINE_DECLS */
 record_unwind_protect
 record_unwind_protect_freeing
 report_process_error
@@ -178,17 +222,20 @@
 #else
 unstaticpro_nodump_1
 #endif
+vconcat2
+vconcat3
 vector1
 vector2
 vector3
 warn_when_safe
-#ifdef ERROR_CHECK_TYPES
+#ifdef XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS
 wrap_record_1
 #endif
-write_c_string
+write_cistring
 write_fmt_string
 write_fmt_string_lisp
-write_string
+write_istring
+write_ascstring
 wrong_type_argument		/* CONCHECK_xxx */
 xemacs_c_alloca			/* ALLOCA */
 xfree_1				/* xfree */
@@ -228,7 +275,7 @@
 Fsignal
 Fthrow
 Fvector
-#ifdef ERROR_CHECK_TYPES
+#ifdef XEMACS_DEFS_NEEDS_ERROR_CHECK_TYPES_DECLS
 XINT_1
 #endif
 
--- a/src/xgccache.c	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-/* Efficient caching of X GCs (graphics contexts).
-   Copyright (C) 1993 Free Software Foundation, Inc.
-   Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not in FSF. */
-
-/* Emacs uses a lot of different display attributes; for example, assume
-   that only four fonts are in use (normal, bold, italic, and bold-italic).
-   Then assume that one stipple or background is used for text selections,
-   and another is used for highlighting mousable regions.  That makes 16
-   GCs already.  Add in the fact that another GC may be needed to display
-   the text cursor in any of those regions, and you've got 32.  Add in
-   more fonts, and it keeps increasing exponentially.
-
-   We used to keep these GCs in a cache of merged (fully qualified) faces.
-   However, a lot of other code in xterm.c used XChangeGC of existing GCs,
-   which is kind of slow and kind of random.  Also, managing the face cache
-   was tricky because it was hard to know when a face was no longer visible
-   on the frame -- we had to mark all frames as garbaged whenever a face
-   was changed, which caused an unpleasant amount of flicker (since faces are
-   created/destroyed (= changed) whenever a frame is created/destroyed.
-
-   So this code maintains a cache at the GC level instead of at the face
-   level.  There is an upper limit on the size of the cache, after which we
-   will stop creating GCs and start reusing them (reusing the least-recently-
-   used ones first).  So if faces get changed, their GCs will eventually be
-   recycled.  Also more sharing of GCs is possible.
-
-   This code uses hash tables.  It could be that, if the cache size is small
-   enough, a linear search might be faster; but I doubt it, since we need
-   `equal' comparisons, not `eq', and I expect that the optimal cache size
-   will be ~100.
-
-   Written by jwz, 14 jun 93
- */
-
-#include <config.h>
-#include <X11/Xlib.h>
-#include "xgccache.h"
-
-
-#define GC_CACHE_SIZE 100
-
-#define GCCACHE_HASH
-
-
-#ifdef GCCACHE_HASH
-#include "lisp.h"
-#include "hash.h"
-#endif
-
-struct gcv_and_mask {
-  XGCValues gcv;
-  unsigned long mask;
-};
-
-struct gc_cache_cell {
-  GC gc;
-  struct gcv_and_mask gcvm;
-  struct gc_cache_cell *prev, *next;
-};
-
-struct gc_cache {
-  Display *dpy;		/* used only as arg to XCreateGC/XFreeGC */
-  Window window;	/* used only as arg to XCreateGC */
-  int size;
-  struct gc_cache_cell *head;
-  struct gc_cache_cell *tail;
-#ifdef GCCACHE_HASH
-  struct hash_table *table;
-#endif
-
-  int create_count;
-  int delete_count;
-};
-
-#ifdef GCCACHE_HASH
-static Hashcode
-gc_cache_hash (const void *arg)
-{
-  const struct gcv_and_mask *gcvm = (const struct gcv_and_mask *) arg;
-  unsigned long *longs = (unsigned long *) &gcvm->gcv;
-  Hashcode hash = gcvm->mask;
-  int i;
-  /* This could look at the mask and only use the used slots in the
-     hash code.  That would win in that we wouldn't have to initialize
-     every slot of the gcv when calling gc_cache_lookup.  But we need
-     the hash function to be as fast as possible; some timings should
-     be done. */
-  for (i = 0; i < (int) (sizeof (XGCValues) / sizeof (unsigned long)); i++)
-    hash = (hash << 1) ^ *longs++;
-  return hash;
-}
-
-#endif /* GCCACHE_HASH */
-
-static int
-gc_cache_eql (const void *arg1, const void *arg2)
-{
-  /* See comment in gc_cache_hash */
-  return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask));
-}
-
-struct gc_cache *
-make_gc_cache (Display *dpy, Window window)
-{
-  struct gc_cache *cache = xnew (struct gc_cache);
-  cache->dpy = dpy;
-  cache->window = window;
-  cache->size = 0;
-  cache->head = cache->tail = 0;
-  cache->create_count = cache->delete_count = 0;
-#ifdef GCCACHE_HASH
-  cache->table =
-    make_general_hash_table (GC_CACHE_SIZE, gc_cache_hash, gc_cache_eql);
-#endif
-  return cache;
-}
-
-void
-free_gc_cache (struct gc_cache *cache)
-{
-  struct gc_cache_cell *rest, *next;
-  rest = cache->head;
-  while (rest)
-    {
-      XFreeGC (cache->dpy, rest->gc);
-      next = rest->next;
-      xfree (rest, struct gc_cache_cell *);
-      rest = next;
-    }
-#ifdef GCCACHE_HASH
-  free_hash_table (cache->table);
-#endif
-  xfree (cache, struct gc_cache *);
-}
-
-GC
-gc_cache_lookup (struct gc_cache *cache, XGCValues *gcv, unsigned long mask)
-{
-  struct gc_cache_cell *cell, *next, *prev;
-  struct gcv_and_mask gcvm;
-
-#ifdef DEBUG_XEMACS
-  (void) describe_gc_cache (cache, DGCCFLAG_DISABLE);
-#endif
-
-  if ((!!cache->head) != (!!cache->tail)) ABORT ();
-  if (cache->head && (cache->head->prev || cache->tail->next)) ABORT ();
-
-  gcvm.mask = mask;
-  gcvm.gcv = *gcv;	/* this copies... */
-
-#ifdef GCCACHE_HASH
-
-  /* The intermediate cast fools gcc into not outputting strict-aliasing
-     complaints */
-  if (gethash (&gcvm, cache->table, (const void **) (void *) &cell))
-
-#else /* !GCCACHE_HASH */
-
-  cell = cache->tail;	/* start at the end (most recently used) */
-  while (cell)
-    {
-      if (gc_cache_eql (&gcvm, &cell->gcvm))
-	break;
-      else
-	cell = cell->prev;
-    }
-
-  /* #### This whole file needs some serious overhauling. */
-  if (!(mask | GCTile) && cell->gc->values.tile)
-    cell = 0;
-  else if (!(mask | GCStipple) && cell->gc->values.stipple)
-    cell = 0;
-
-  if (cell)
-
-#endif /* !GCCACHE_HASH */
-
-    {
-      /* Found a cell.  Move this cell to the end of the list, so that it
-	 will be less likely to be collected than a cell that was accessed
-	 less recently.
-       */
-#if 0
-      debug_out ("Returning cached GC: %08lx\n", XE_GCONTEXT(cell));
-#endif
-      if (cell == cache->tail)
-	return cell->gc;
-
-      next = cell->next;
-      prev = cell->prev;
-      if (prev) prev->next = next;
-      if (next) next->prev = prev;
-      if (cache->head == cell) cache->head = next;
-      cell->next = 0;
-      cell->prev = cache->tail;
-      cache->tail->next = cell;
-      cache->tail = cell;
-      if (cache->head == cell) ABORT ();
-      if (cell->next) ABORT ();
-      if (cache->head->prev) ABORT ();
-      if (cache->tail->next) ABORT ();
-      return cell->gc;
-    }
-
-  /* else, cache miss. */
-
-  if (cache->size == GC_CACHE_SIZE)
-    /* Reuse the first cell on the list (least-recently-used).
-       Remove it from the list, and unhash it from the table.
-     */
-    {
-      cell = cache->head;
-      cache->head = cell->next;
-      cache->head->prev = 0;
-      if (cache->tail == cell) cache->tail = 0; /* only one */
-#if 0
-      debug_out ("Cache full, freeing GC: %08lx\n  ", XE_GCONTEXT(cell));
-#endif
-      XFreeGC (cache->dpy, cell->gc);
-      cache->delete_count++;
-#ifdef GCCACHE_HASH
-      remhash (&cell->gcvm, cache->table);
-#endif
-    }
-  else if (cache->size > GC_CACHE_SIZE)
-    ABORT ();
-  else
-    {
-      /* Allocate a new cell (don't put it in the list or table yet). */
-      cell = xnew (struct gc_cache_cell);
-      cache->size++;
-    }
-
-  /* Now we've got a cell (new or reused).  Fill it in. */
-  memcpy (&cell->gcvm.gcv, gcv, sizeof (XGCValues));
-  cell->gcvm.mask = mask;
-
-  /* Put the cell on the end of the list. */
-  cell->next = 0;
-  cell->prev = cache->tail;
-  if (cache->tail) cache->tail->next = cell;
-  cache->tail = cell;
-  if (! cache->head) cache->head = cell;
-
-  cache->create_count++;
-#ifdef GCCACHE_HASH
-  /* Hash it in the table */
-  puthash (&cell->gcvm, cell, cache->table);
-#endif
-
-  /* Now make and return the GC. */
-  cell->gc = XCreateGC (cache->dpy, cache->window, mask, gcv);
-
-  /* debug */
-  assert (cell->gc == gc_cache_lookup (cache, gcv, mask));
-
-#if 0
-  debug_out ("Returning new GC: %08lx\n  ", XE_GCONTEXT(cell));
-#endif
-  return cell->gc;
-}
-
-
-#ifdef DEBUG_XEMACS
-
-/* FLAGS
-   The flags argument is a bitwise or of any of the following:
-
-   DGCCFLAG_SUMMARY		Summary statistics for cache
-   DGCCFLAG_LIST_CELLS		If summary is being printed, print cell IDs too.
-   DGCCFLAG_CELL_DETAILS	If cell IDs are being printed, additionally
-				print the internal fields used and values.
-
-   DGCCFLAG_DEFAULT		A predefined combination giving whatever the
-				maintainers are currently interested in seeing.
-*/
-void
-describe_gc_cache (struct gc_cache *cache, int flags)
-{
-  int count = 0;
-  struct gc_cache_cell *cell = cache->head;
-
-  if (! flags & DGCCFLAG_SUMMARY) return;
-
-  stderr_out ("\nsize:    %d", cache->size);
-  stderr_out ("\ncreated: %d", cache->create_count);
-  stderr_out ("\ndeleted: %d", cache->delete_count);
-
-  if (flags & DGCCFLAG_LIST_CELLS)
-    while (cell)
-      {
-	struct gc_cache_cell *cell2;
-	int i = 0;
-	stderr_out ("\n%d:\t0x%lx  GC: 0x%08lx  hash: 0x%08lx\n",
-		    count, (long) cell, (long) XE_GCONTEXT(cell),
-		    gc_cache_hash (&cell->gcvm));
-
-	for (cell2 = cache->head; cell2; cell2 = cell2->next, i++)
-	  if (count != i &&
-	      gc_cache_hash (&cell->gcvm) == gc_cache_hash (&cell2->gcvm))
-	    stderr_out ("\tHASH COLLISION with cell %d\n", i);
-	stderr_out ("\tmask:       %8lx\n", cell->gcvm.mask);
-
-	if (flags & DGCCFLAG_CELL_DETAILS)
-	  {
-#define FROB(field) do {						\
-  if ((int)cell->gcvm.gcv.field != (~0))				\
-    stderr_out ("\t%-12s%8x\n", #field ":", (int)cell->gcvm.gcv.field);	\
-} while (0)
-	    FROB (function);
-	    FROB (plane_mask);
-	    FROB (foreground);
-	    FROB (background);
-	    FROB (line_width);
-	    FROB (line_style);
-	    FROB (cap_style);
-	    FROB (join_style);
-	    FROB (fill_style);
-	    FROB (fill_rule);
-	    FROB (arc_mode);
-	    FROB (tile);
-	    FROB (stipple);
-	    FROB (ts_x_origin);
-	    FROB (ts_y_origin);
-	    FROB (font);
-	    FROB (subwindow_mode);
-	    FROB (graphics_exposures);
-	    FROB (clip_x_origin);
-	    FROB (clip_y_origin);
-	    FROB (clip_mask);
-	    FROB (dash_offset);
-#undef FROB
-	  }
-
-	count++;
-	if (cell->next && cell == cache->tail)
-	  stderr_out ("\nERROR!  tail is here!\n\n");
-	else if (!cell->next && cell != cache->tail)
-	  stderr_out ("\nERROR!  tail is not at the end\n\n");
-	cell = cell->next;
-      }	/* while (cell) */
-
-  if (count != cache->size)
-    stderr_out ("\nERROR!  count should be %d\n\n", cache->size);
-}
-
-#endif /* DEBUG_XEMACS */
--- a/src/xgccache.h	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/* Efficient caching of X GCs (graphics contexts).
-   Copyright (C) 1993 Free Software Foundation, Inc.
-
-
-This file is part of XEmacs.
-
-XEmacs is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-XEmacs is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with XEmacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
-
-/* Synched up with: Not in FSF. */
-
-/* Written by jwz, 14 jun 93 */
-
-#ifndef INCLUDED_xgccache_h_
-#define INCLUDED_xgccache_h_
-
-struct gc_cache;
-struct gc_cache *make_gc_cache (Display *, Window);
-void free_gc_cache (struct gc_cache *cache);
-GC gc_cache_lookup (struct gc_cache *, XGCValues *, unsigned long mask);
-
-#define XE_GCONTEXT(cell) (XGContextFromGC(cell->gc))
-
-#ifdef DEBUG_XEMACS
-
-void describe_gc_cache (struct gc_cache *cache, int flags);
-
-#define DGCCFLAG_DISABLE		0
-#define DGCCFLAG_SUMMARY		1 << 0
-#define DGCCFLAG_LIST_CELLS		1 << 1
-#define DGCCFLAG_CELL_DETAILS		1 << 2
-/* A combination of the flags above. */
-#define DGCCFLAG_DEFAULT		DGCCFLAG_SUMMARY | DGCCFLAG_LIST_CELLS
-#endif
-
-#endif /* INCLUDED_xgccache_h_ */
--- a/tests/ChangeLog	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/ChangeLog	Wed Feb 24 01:58:04 2010 -0600
@@ -1,3 +1,309 @@
+2010-02-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el:
+	Change the #'split-string-by-char text to use US federal
+	government information instead of a couple of sentences from the
+	OED; the latter would probably have qualified as non-infringement,
+	but with the former the question won't arise.
+	(The German text in the same tests is from a very public domain
+	19th-century work.)
+
+2010-02-19  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el:
+	Check that multiple values are discarded correctly with #'mapcar
+	and one SEQUENCE.
+	(equal): 
+
+2010-02-05  Jerry James  <james@xemacs.org>
+
+	* DLL/dltest.c: Remove old test.  Building and using any module now
+	provides a better test than this.
+
+2010-02-05  Jerry James  <james@xemacs.org>
+
+	* frame.el: Martin Buchholz claims ownership.
+
+2010-01-25  Ben Wing  <ben@xemacs.org>
+
+	* automated/file-tests.el:
+	New file.
+	
+	* automated/mule-tests.el (featurep):
+	
+	* automated/test-harness.el (test-harness-from-buffer):
+	* automated/test-harness.el (batch-test-emacs):
+
+2010-01-25  Ben Wing  <ben@xemacs.org>
+
+	* automated/file-tests.el:
+	* automated/mule-tests.el (featurep):
+	Clean up charsets-in-HELLO test and fix the list of expected
+	charsets.
+	
+	* automated/test-harness.el (test-harness-from-buffer):
+	Reverse order of "got" and "expected" values so it matches
+	order of call to comparison.
+	
+	* automated/test-harness.el (batch-test-emacs):
+	Update doc to indicate that a directory is allowed.
+
+2010-02-01  Ben Wing  <ben@xemacs.org>
+
+	* automated/case-tests.el:
+	* automated/case-tests.el (uni-mappings):
+	* automated/search-tests.el:
+	Delete old pristine-case-table code.  Rewrite the Unicode torture
+	test to take into account whether overlapping mappings exist for
+	more than one character, and not doing the upcase/downcase
+	comparisons in such cases.
+	
+	* automated/lisp-tests.el (foo):
+	* automated/lisp-tests.el (string-variable):
+	* automated/lisp-tests.el (featurep):
+	Replace Assert (equal ... with Assert-equal; same for other types
+	of equality.  Replace some awkward equivalents of Assert-equalp
+	with Assert-equalp.  Add lots of equalp tests.
+	
+	* automated/case-tests.el:
+	* automated/regexp-tests.el:
+	* automated/search-tests.el:
+	Fix up the comments at the top of the files.  Move rules about where
+	to put tests into case-tests.el.
+	
+	* automated/test-harness.el:
+	* automated/test-harness.el (test-harness-aborted-summary-template): New.
+	* automated/test-harness.el (test-harness-from-buffer):
+	* automated/test-harness.el (batch-test-emacs):
+	Fix Assert-test-not.  Create Assert-not-equal and variants.
+	Delete the doc strings from all these convenience functions to avoid
+	excessive repetition; instead use one copy in a comment.
+
+2010-01-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/search-tests.el:
+	Check that multidimensional characters with repeated octets and
+	case information force simple_search(), since boyer_moore()
+	doesn't understand them when constructing its stride table.
+	In passing; correct my spelling.
+	* automated/case-tests.el (uni-mappings):
+	In passing; delete a couple of redundant tests, correct the logic
+	of another.
+
+2010-01-30  Ben Wing  <ben@xemacs.org>
+
+	* automated/search-tests.el:
+	* automated/search-tests.el (insert):
+	Use LF not CRLF for line endings.
+
+2010-01-30  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/regexp-tests.el:
+	Make sure that control-1 characters are no longer treated as
+	second-class citizens in regexp ranges, as in
+	http://mid.gmane.org/18829.34118.709782.704574@parhasard.net .
+
+2010-01-29  Ben Wing  <ben@xemacs.org>
+
+	* automated/search-tests.el:
+	New file.
+
+	* automated/search-tests.el:
+	* automated/case-tests.el:
+	* automated/case-tests.el (pristine-case-table): Removed.
+	* automated/case-tests.el (uni-mappings):
+	* automated/lisp-tests.el:
+	* automated/regexp-tests.el:
+	Extract some search-related code from case-tests and regexp-tests
+	and move to search-tests.  Move some regexp-related code from
+	lisp-tests to regexp-tests.
+
+	Write a comment trying to express the proper division of labor
+	between case-tests, search-tests and regexp-tests.
+
+	Add a new test for the Control-1 search bug.
+
+	Fix a buggy test in the Unicode torture-test section of case-tests.el.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* automated/test-harness.el (test-harness-from-buffer):
+	Update doc string of `Assert-test' and change the failing-case
+	message to be clearer.  Also add `Assert-test-not' for asserting
+	that a comparison should fail.
+
+2010-01-27  Ben Wing  <ben@xemacs.org>
+
+	* automated/case-tests.el:
+	* automated/case-tests.el (char-as-unicode-escape): New.
+	Add a "torture test" that uses the full set of lower-upper case
+	mappings from Unicode.  See whether strings composed of all
+	lower-case characters across all languages will correctly be
+	uppercased to the string equivalent to all uppercase characters,
+	and vice-versa, and whether you can correctly do a case-folding
+	search in a buffer for these characters, all at once or individually.
+	Result: a number of assertion failures.
+
+2010-01-26  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/mule-tests.el:
+	Only give the list of character sets in HELLO once; correct it to
+	reflect its current contents and the extant character sets.
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* automated/mule-tests.el (featurep):
+	Accidentally included changes from Unicode-internal ws that
+	broke things.
+
+2010-01-14  Ben Wing  <ben@xemacs.org>
+
+	* automated/base64-tests.el (bt-base64-encode-string):
+	* automated/base64-tests.el (bt-base64-decode-string):
+	* automated/base64-tests.el (for):
+	* automated/byte-compiler-tests.el:
+	* automated/byte-compiler-tests.el (before-and-after-compile-equal):
+	* automated/case-tests.el:
+	* automated/case-tests.el (downcase-string):
+	* automated/case-tests.el (insert):
+	* automated/case-tests.el (featurep):
+	* automated/case-tests.el (let):
+	* automated/case-tests.el (boundp):
+	* automated/ccl-tests.el (ccl-test-normal-expr):
+	* automated/ccl-tests.el (ccl-test-map-instructions):
+	* automated/ccl-tests.el (ccl-test-suites):
+	* automated/database-tests.el (delete-database-files):
+	* automated/extent-tests.el (let):
+	* automated/extent-tests.el (insert):
+	* automated/extent-tests.el (props):
+	* automated/hash-table-tests.el (test):
+	* automated/hash-table-tests.el (for):
+	* automated/hash-table-tests.el (ht):
+	* automated/hash-table-tests.el (iterations):
+	* automated/hash-table-tests.el (h1):
+	* automated/hash-table-tests.el (make-hash-table):
+	* automated/hash-table-tests.el (sxhash):
+	* automated/lisp-tests.el:
+	* automated/lisp-tests.el (setq):
+	* automated/lisp-tests.el (test-setq):
+	* automated/lisp-tests.el (my-vector):
+	* automated/lisp-tests.el (nconc):
+	* automated/lisp-tests.el (x):
+	* automated/lisp-tests.el (y):
+	* automated/lisp-tests.el (butlast):
+	* automated/lisp-tests.el (+):
+	* automated/lisp-tests.el (featurep):
+	* automated/lisp-tests.el (-):
+	* automated/lisp-tests.el (six):
+	* automated/lisp-tests.el (three):
+	* automated/lisp-tests.el (1):
+	* automated/lisp-tests.el (one):
+	* automated/lisp-tests.el (two):
+	* automated/lisp-tests.el (0):
+	* automated/lisp-tests.el (five):
+	* automated/lisp-tests.el (logxor):
+	* automated/lisp-tests.el (test1):
+	* automated/lisp-tests.el (division-test):
+	* automated/lisp-tests.el (for):
+	* automated/lisp-tests.el (check-function-argcounts):
+	* automated/lisp-tests.el (type-of):
+	* automated/lisp-tests.el (mapcar):
+	* automated/lisp-tests.el (z):
+	* automated/lisp-tests.el (mapvector):
+	* automated/lisp-tests.el (mapconcat):
+	* automated/lisp-tests.el ([1 2 3]):
+	* automated/lisp-tests.el (#*010):
+	* automated/lisp-tests.el (test-harness-risk-infloops):
+	* automated/lisp-tests.el (erase-buffer):
+	* automated/lisp-tests.el (sym):
+	* automated/lisp-tests.el (subseq):
+	* automated/lisp-tests.el (length):
+	* automated/lisp-tests.el (102):
+	* automated/lisp-tests.el (read):
+	* automated/lisp-tests.el (new-char):
+	* automated/lisp-tests.el (new-load-file-name):
+	* automated/lisp-tests.el (cl-floor):
+	* automated/lisp-tests.el (foo):
+	* automated/lisp-tests.el (string-variable):
+	* automated/md5-tests.el (lambda):
+	* automated/md5-tests.el (large-string):
+	* automated/md5-tests.el (mapcar):
+	* automated/md5-tests.el (insert):
+	* automated/mule-tests.el (test-chars):
+	* automated/mule-tests.el (existing-file-name):
+	* automated/mule-tests.el (featurep):
+	* automated/query-coding-tests.el (featurep):
+	* automated/regexp-tests.el:
+	* automated/regexp-tests.el (insert):
+	* automated/regexp-tests.el (Assert):
+	* automated/regexp-tests.el (string-match):
+	* automated/regexp-tests.el (featurep):
+	* automated/regexp-tests.el (text):
+	* automated/regexp-tests.el (text1):
+	* automated/regexp-tests.el ("a�a"):
+	* automated/symbol-tests.el:
+	* automated/symbol-tests.el (name):
+	* automated/symbol-tests.el (check-weak-list-unique):
+	* automated/symbol-tests.el (string):
+	* automated/symbol-tests.el (list):
+	* automated/symbol-tests.el (foo):
+	* automated/symbol-tests.el (read):
+	* automated/symbol-tests.el (eval):
+	* automated/symbol-tests.el (fresh-keyword-name):
+	* automated/symbol-tests.el (set):
+	* automated/symbol-tests.el (print-gensym):
+	* automated/symbol-tests.el (mysym):
+	* automated/syntax-tests.el (test-forward-word):
+	* automated/syntax-tests.el (test-backward-word):
+	* automated/syntax-tests.el (test-syntax-table):
+	* automated/syntax-tests.el (with-syntax-table):
+	* automated/syntax-tests.el (Skip-Test-Unless):
+	* automated/syntax-tests.el (with):
+	* automated/tag-tests.el (testfile):
+	* automated/test-harness.el:
+	* automated/test-harness.el (test-harness-from-buffer):
+	* automated/weak-tests.el (w):
+	* automated/weak-tests.el (p):
+	* automated/weak-tests.el (a):
+	Create Assert-eq, Assert-equal, etc.  These are equivalent to
+	(Assert (eq ...)) etc. but display both the actual value and the
+	expected value of the comparison.  Use them throughout the test
+	suite.
+
+	* automated/test-harness.el (Assert):
+	Clean up code and doc string of macro Assert.
+	
+
+2010-01-13  Ben Wing  <ben@xemacs.org>
+
+	* automated/test-harness.el (Assert):
+	Need to quote the assertion expression, but not the description
+	expression.
+
+2010-01-11  Ben Wing  <ben@xemacs.org>
+
+	* automated/mule-tests.el (featurep):
+	Use utf-8 as file-name-coding-system under Cygwin 1.7+.
+
+2010-02-07  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el (split-string-by-char):
+	Test this function, and its new ESCAPE-CHAR argument.
+
+2010-01-01  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el: 
+	Test #'functionp, making sure it gives nil for special forms.
+
+2009-12-31  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/lisp-tests.el: 
+	Test much of the functionality of equalp; add a pointer to Paul
+	Dietz' ANSI test suite for this function, converted to Emacs
+	Lisp. Not including the tests themselves in XEmacs because who
+	owns the copyright on the files is unclear and the GCL people
+	didn't respond to my queries. 
+
 2009-12-21  Jerry James  <james@xemacs.org>
 
 	* Dnd/README: Remove references to OffiX drag-and-drop.
--- a/tests/DLL/dltest.c	Wed Jan 20 07:05:57 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-Make a symbolic link to ${blddir}/src/config.h in this directory and do:
-
-gcc -shared -fPIC -Demacs -DHAVE_CONFIG_H -I. \
-		-I/home/xemacs/xemacs-20.0/src -g dltest.c -o dltest
-*/
-
-# include <config.h>
-# include "lisp.h"
-
-Lisp_Object Qdltest_counter;
-
-DEFUN ("dltest", Fdltest, 0, 0, 0, /*
-Simple test function.
-*/
-())
-{
-	Qdltest_counter = make_int(XINT(Qdltest_counter) + 1);
-
-	return Qdltest_counter;
-}
-
-void
-vars_of()
-{
-	DEFVAR_LISP("dltest-counter", &Qdltest_counter /*
-counter.
-*/ );
-
-	printf("Ten = %d\n", 10);
-
-	Qdltest_counter = make_int(10);
-}
-
-void
-syms_of()
-{
-	DEFSUBR(Fdltest);
-}
--- a/tests/automated/base64-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/base64-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -52,8 +52,8 @@
       (erase-buffer)
       (insert string)
       (setq length (base64-encode-region (point-min) (point-max) no-line-break))
-      (Assert (eq length (- (point-max) (point-min))))
-      (Assert (equal (buffer-string) string-result))
+      (Assert-eq length (- (point-max) (point-min)))
+      (Assert-equal (buffer-string) string-result)
       ;; partial
       (erase-buffer)
       (insert "random junk........\0\0';'eqwrkw[erpqf")
@@ -62,8 +62,8 @@
 	(setq p2 (point-marker))
 	(insert "...more random junk.q,f3/.qrm314.r,m2typ' 2436T@W$^@$#^T@")
 	(setq length (base64-encode-region p1 p2 no-line-break))
-	(Assert (eq length (- p2 p1)))
-	(Assert (equal (buffer-substring p1 p2) string-result))))
+	(Assert-eq length (- p2 p1))
+	(Assert-equal (buffer-substring p1 p2) string-result)))
     string-result))
 
 (defun bt-base64-decode-string (string)
@@ -75,12 +75,12 @@
       (insert string)
       (setq length (base64-decode-region (point-min) (point-max)))
       (cond (string-result
-	     (Assert (eq length (- (point-max) (point-min))))
-	     (Assert (equal (buffer-string) string-result)))
+	     (Assert-eq length (- (point-max) (point-min)))
+	     (Assert-equal (buffer-string) string-result))
 	    (t
 	     (Assert (null length))
 	     ;; The buffer should not have been modified.
-	     (Assert (equal (buffer-string) string))))
+	     (Assert-equal (buffer-string) string)))
       ;; partial
       (erase-buffer)
       (insert "random junk........\0\0';'eqwrkw[erpqf")
@@ -90,12 +90,12 @@
 	(insert "...more random junk.q,f3/.qrm314.\0\0r,m2typ' 2436T@W$^@$#T@")
 	(setq length (base64-decode-region p1 p2))
 	(cond (string-result
-	       (Assert (eq length (- p2 p1)))
-	       (Assert (equal (buffer-substring p1 p2) string-result)))
+	       (Assert-eq length (- p2 p1))
+	       (Assert-equal (buffer-substring p1 p2) string-result))
 	      (t
 	       (Assert (null length))
 	       ;; The buffer should not have been modified.
-	       (Assert (equal (buffer-substring p1 p2) string))))))
+	       (Assert-equal (buffer-substring p1 p2) string)))))
     string-result))
 
 (defun bt-remove-newlines (str)
@@ -126,9 +126,9 @@
 ;;-----------------------------------------------------
 
 (loop for (raw encoded) in bt-test-strings do
-  (Assert (equal (bt-base64-encode-string raw) encoded))
+  (Assert-equal (bt-base64-encode-string raw) encoded)
   ;; test the NO-LINE-BREAK flag
-  (Assert (equal (bt-base64-encode-string raw t) (bt-remove-newlines encoded))))
+  (Assert-equal (bt-base64-encode-string raw t) (bt-remove-newlines encoded)))
 
 ;; When Mule is around, Lisp programmers should make sure that the
 ;; buffer contains only characters whose `char-int' is in the [0, 256)
@@ -150,8 +150,8 @@
 ;;-----------------------------------------------------
 
 (loop for (raw encoded) in bt-test-strings do
-  (Assert (equal (bt-base64-decode-string encoded) raw))
-  (Assert (equal (bt-base64-decode-string (bt-remove-newlines encoded)) raw)))
+  (Assert-equal (bt-base64-decode-string encoded) raw)
+  (Assert-equal (bt-base64-decode-string (bt-remove-newlines encoded)) raw))
 
 ;; Test errors
 (dolist (str `("foo" "AAC" "foo\0bar" "====" "Zm=9v" ,bt-allchars))
@@ -182,7 +182,7 @@
       ;; Whitespace at the beginning, end, and middle.
       (let ((mangled (concat bt-nonbase64-chars left bt-nonbase64-chars right
 			     bt-nonbase64-chars)))
-	(Assert (equal (bt-base64-decode-string mangled) raw)))
+	(Assert-equal (bt-base64-decode-string mangled) raw))
 
       ;; Whitespace between every char.
       (let ((mangled (concat bt-nonbase64-chars
@@ -191,7 +191,7 @@
 			     (mapconcat #'char-to-string encoded
 					(apply #'string bt-nonbase64-chars))
 			     bt-nonbase64-chars)))
-	(Assert (equal (bt-base64-decode-string mangled) raw))))))
+	(Assert-equal (bt-base64-decode-string mangled) raw)))))
 
 ;;-----------------------------------------------------
 ;; Mixed...
@@ -205,22 +205,22 @@
 ;; practically all aspects of the encoding and decoding process.
 
 (loop for (raw ignored) in bt-test-strings do
-  (Assert (equal (bt-base64-decode-string
+  (Assert-equal (bt-base64-decode-string
 		  (bt-base64-encode-string raw))
-		 raw))
-  (Assert (equal (bt-base64-decode-string
+		 raw)
+  (Assert-equal (bt-base64-decode-string
 		  (bt-base64-decode-string
 		   (bt-base64-encode-string
 		    (bt-base64-encode-string raw))))
-		 raw))
-  (Assert (equal (bt-base64-decode-string
+		 raw)
+  (Assert-equal (bt-base64-decode-string
 		  (bt-base64-decode-string
 		   (bt-base64-decode-string
 		    (bt-base64-encode-string
 		     (bt-base64-encode-string
 		      (bt-base64-encode-string raw))))))
-		 raw))
-  (Assert (equal (bt-base64-decode-string
+		 raw)
+  (Assert-equal (bt-base64-decode-string
 		  (bt-base64-decode-string
 		   (bt-base64-decode-string
 		    (bt-base64-decode-string
@@ -228,8 +228,8 @@
 		      (bt-base64-encode-string
 		       (bt-base64-encode-string
 			(bt-base64-encode-string raw))))))))
-		 raw))
-  (Assert (equal (bt-base64-decode-string
+		 raw)
+  (Assert-equal (bt-base64-decode-string
 		  (bt-base64-decode-string
 		   (bt-base64-decode-string
 		    (bt-base64-decode-string
@@ -239,4 +239,4 @@
 			(bt-base64-encode-string
 			 (bt-base64-encode-string
 			  (bt-base64-encode-string raw))))))))))
-		 raw)))
+		 raw))
--- a/tests/automated/byte-compiler-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/byte-compiler-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -92,8 +92,8 @@
  (eval '(let* ((x 1 2)) 3)))
 
 (defmacro before-and-after-compile-equal (&rest form)
-  `(Assert (equal (funcall (quote (lambda () ,@form)))
-		 (funcall (byte-compile (quote (lambda () ,@form)))))))
+  `(Assert-equal (funcall (quote (lambda () ,@form)))
+    (funcall (byte-compile (quote (lambda () ,@form))))))
 
 (defvar simplyamarker (point-min-marker))
 
--- a/tests/automated/case-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/case-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,6 +1,7 @@
 ;;; -*- coding: iso-8859-1 -*-
 
 ;; Copyright (C) 2000 Free Software Foundation, Inc.
+;; Copyright (C) 2010 Ben Wing.
 
 ;; Author: Yoshiki Hayashi  <yoshiki@xemacs.org>
 ;; Maintainer: Yoshiki Hayashi  <yoshiki@xemacs.org>
@@ -28,17 +29,30 @@
 
 ;;; Commentary:
 
-;; Test case-table related functionality.
+;; Test case-table related functionality.  See test-harness.el for
+;; instructions on how to run these tests.
 
-(defvar pristine-case-table nil
-  "The standard case table, without manipulation from case-tests.el")
+;; NOTE NOTE NOTE: See also:
+;;
+;; (1) regexp-tests.el, for case-related regexp searching.
+;; (2) search-tests.el, for case-related non-regexp searching.
+;; (3) lisp-tests.el, for case-related comparisons with `equalp'.
 
-(setq pristine-case-table (or
-			   ;; This is the compiled run; we've retained
-			   ;; it from the interpreted run.
-			   pristine-case-table 
-			   ;; This is the interpreted run; set it.
-			   (copy-case-table (standard-case-table))))
+;; NOTE NOTE NOTE: There is some domain overlap among case-tests.el,
+;; lisp-tests.el, regexp-tests.el, and search-tests.el.  The current rule
+;; for what goes where is:
+;;
+;; (1) Anything regexp-related goes in regexp-tests.el, including searches.
+;; (2) Non-regexp searches go in search-tests.el.  This includes case-folding
+;;     searches in the situation where the test tests both folding and
+;;     non-folding behavior.
+;; (3) Anything else that involves case-testing but in an ancillary manner
+;;     goes into whichever primary area it is involved in (e.g. searches for
+;;     search-tests.el, Lisp primitives in lisp-tests.el).  But if it is
+;;     primarily case-related and happens to involve other areas in an
+;;     ancillary manner, it goes into case-tests.el.  This includes, for
+;;     example, the Unicode case map torture tests.
+
 
 (Assert (case-table-p (standard-case-table)))
 ;; Old case table test.
@@ -95,10 +109,10 @@
 		"�����������������������������������������������������������������������������������������������"))
        (table (standard-case-table)))
   (dotimes (i 256)
-    (Assert (eq (get-case-table 'downcase (int-to-char i) table)
-		(aref downcase-string i)))
-    (Assert (eq (get-case-table 'upcase (int-to-char i) table)
-		(aref upcase-string i)))))
+    (Assert-eq (get-case-table 'downcase (int-to-char i) table)
+		(aref downcase-string i))
+    (Assert-eq (get-case-table 'upcase (int-to-char i) table)
+		(aref upcase-string i))))
 
 (Check-Error-Message error "Char case must be downcase or upcase"
 		     (get-case-table 'foo ?a (standard-case-table)))
@@ -161,173 +175,1382 @@
     (downcase "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ")
     "!\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz")))
 
-(with-temp-buffer
-  (insert "Test Buffer")
-  (let ((case-fold-search t))
-    (goto-char (point-min))
-    (Assert (eq (search-forward "test buffer" nil t) 12))
-    (goto-char (point-min))
-    (Assert (eq (search-forward "Test buffer" nil t) 12))
-    (goto-char (point-min))
-    (Assert (eq (search-forward "Test Buffer" nil t) 12))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-    (setq case-fold-search nil)
-    (goto-char (point-min))
-    (Assert (not (search-forward "test buffer" nil t)))
-    (goto-char (point-min))
-    (Assert (not (search-forward "Test buffer" nil t)))
-    (goto-char (point-min))
-    (Assert (eq (search-forward "Test Buffer" nil t) 12))))
+;; Torture test, using all the non-"full" mappings from the Unicode case
+;; tables. (Full mappings are those that involve sequences of more than one
+;; character, e.g. lowercase German � (esszet) -> uppercase sequence "SS").
 
-(with-temp-buffer
-  (insert "abcdefghijklmn�opqrstu�vwxyz")
-  ;; case insensitive
-  (Assert (not (search-forward "�" nil t)))
-  (goto-char (point-min))
-  (Assert (eq 16 (search-forward "�" nil t)))
-  (Assert (eq 24 (search-forward "�" nil t)))
-  (goto-char (point-min))
-  (Assert (eq 16 (search-forward "�" nil t)))
-  (Assert (eq 24 (search-forward "�" nil t)))
-  (goto-char (point-max))
-  (Assert (eq 23 (search-backward "�" nil t)))
-  (Assert (eq 15 (search-backward "�" nil t)))
-  (goto-char (point-max))
-  (Assert (eq 23 (search-backward "�" nil t)))
-  (Assert (eq 15 (search-backward "�" nil t)))
-  ;; case sensitive
-  (setq case-fold-search nil)
-  (goto-char (point-min))
-  (Assert (not (search-forward "�" nil t)))
-  (goto-char (point-min))
-  (Assert (eq 16 (search-forward "�" nil t)))
-  (Assert (not (search-forward "�" nil t)))
-  (goto-char (point-min))
-  (Assert (eq 24 (search-forward "�" nil t)))
-  (goto-char 16)
-  (Assert (eq 24 (search-forward "�" nil t)))
-  (goto-char (point-max))
-  (Assert (eq 15 (search-backward "�" nil t)))
-  (goto-char 15)
-  (Assert (not (search-backward "�" nil t)))
-  (goto-char (point-max))
-  (Assert (eq 23 (search-backward "�" nil t)))
-  (Assert (not (search-backward "�" nil t))))
-
-(with-temp-buffer
-  (insert "aaaa����������bbbb")
-  (goto-char (point-min))
-  (Assert (eq 15 (search-forward "��" nil t 5)))
-  (goto-char (point-min))
-  (Assert (not (search-forward "��" nil t 6)))
-  (goto-char (point-max))
-  (Assert (eq 5 (search-backward "��" nil t 5)))
-  (goto-char (point-max))
-  (Assert (not (search-backward "��" nil t 6))))
+(defun char-as-unicode-escape (ch)
+  "Return a string corresponding to the Unicode read-expression of CH.
+For example, if CH is ?\\u00F1, the return value will be the string
+\"?\\\\u00F1\"."
+  (let ((uni (char-to-unicode ch)))
+    (if (< uni #x10000) (format "?\\u%04X" uni) (format "?\\U%08X" uni))))
 
-(when (featurep 'mule)
-  (let* ((hiragana-a (make-char 'japanese-jisx0208 36 34))
-	 (a-diaeresis ?�)
-	 (case-table (copy-case-table (standard-case-table)))
-	 (str-hiragana-a (char-to-string hiragana-a))
-	 (str-a-diaeresis (char-to-string a-diaeresis))
-	 (string (concat str-hiragana-a str-a-diaeresis)))
-    (put-case-table-pair hiragana-a a-diaeresis case-table)
-    (with-temp-buffer
-      (set-case-table case-table)
-      (insert hiragana-a "abcdefg" a-diaeresis)
-      ;; forward
-      (goto-char (point-min))
-      (Assert (not (search-forward "�" nil t)))
-      (goto-char (point-min))
-      (Assert (eq 2 (search-forward str-hiragana-a nil t)))
-      (goto-char (point-min))
-      (Assert (eq 2 (search-forward str-a-diaeresis nil t)))
-      (goto-char (1+ (point-min)))
-      (Assert (eq (point-max)
-		  (search-forward str-hiragana-a nil t)))
-      (goto-char (1+ (point-min)))
-      (Assert (eq (point-max)
-		  (search-forward str-a-diaeresis nil t)))
-      ;; backward
-      (goto-char (point-max))
-      (Assert (not (search-backward "�" nil t)))
-      (goto-char (point-max))
-      (Assert (eq (1- (point-max)) (search-backward str-hiragana-a nil t)))
-      (goto-char (point-max))
-      (Assert (eq (1- (point-max)) (search-backward str-a-diaeresis nil t)))
-      (goto-char (1- (point-max)))
-      (Assert (eq 1 (search-backward str-hiragana-a nil t)))
-      (goto-char (1- (point-max)))
-      (Assert (eq 1 (search-backward str-a-diaeresis nil t)))
-      (replace-match "a")
-      (Assert (looking-at (format "abcdefg%c" a-diaeresis))))
-    (with-temp-buffer
-      (set-case-table case-table)
-      (insert string)
-      (insert string)
-      (insert string)
-      (insert string)
-      (insert string)
-      (goto-char (point-min))
-      (Assert (eq 11 (search-forward string nil t 5)))
-      (goto-char (point-min))
-      (Assert (not (search-forward string nil t 6)))
-      (goto-char (point-max))
-      (Assert (eq 1 (search-backward string nil t 5)))
-      (goto-char (point-max))
-      (Assert (not (search-backward string nil t 6))))))
+(let* ((uni-mappings
+	'(;  UPPER   LOWER
+	  (?\u0041 ?\u0061) ;; LATIN CAPITAL LETTER A
+	  (?\u0042 ?\u0062) ;; LATIN CAPITAL LETTER B
+	  (?\u0043 ?\u0063) ;; LATIN CAPITAL LETTER C
+	  (?\u0044 ?\u0064) ;; LATIN CAPITAL LETTER D
+	  (?\u0045 ?\u0065) ;; LATIN CAPITAL LETTER E
+	  (?\u0046 ?\u0066) ;; LATIN CAPITAL LETTER F
+	  (?\u0047 ?\u0067) ;; LATIN CAPITAL LETTER G
+	  (?\u0048 ?\u0068) ;; LATIN CAPITAL LETTER H
+	  (?\u0049 ?\u0069) ;; LATIN CAPITAL LETTER I
+;;; WARNING: Unhandled Turkish mapping:
+;;;        0049; T; 0131; # LATIN CAPITAL LETTER I
+	  (?\u004A ?\u006A) ;; LATIN CAPITAL LETTER J
+	  (?\u004B ?\u006B) ;; LATIN CAPITAL LETTER K
+	  (?\u004C ?\u006C) ;; LATIN CAPITAL LETTER L
+	  (?\u004D ?\u006D) ;; LATIN CAPITAL LETTER M
+	  (?\u004E ?\u006E) ;; LATIN CAPITAL LETTER N
+	  (?\u004F ?\u006F) ;; LATIN CAPITAL LETTER O
+	  (?\u0050 ?\u0070) ;; LATIN CAPITAL LETTER P
+	  (?\u0051 ?\u0071) ;; LATIN CAPITAL LETTER Q
+	  (?\u0052 ?\u0072) ;; LATIN CAPITAL LETTER R
+	  (?\u0053 ?\u0073) ;; LATIN CAPITAL LETTER S
+	  (?\u0054 ?\u0074) ;; LATIN CAPITAL LETTER T
+	  (?\u0055 ?\u0075) ;; LATIN CAPITAL LETTER U
+	  (?\u0056 ?\u0076) ;; LATIN CAPITAL LETTER V
+	  (?\u0057 ?\u0077) ;; LATIN CAPITAL LETTER W
+	  (?\u0058 ?\u0078) ;; LATIN CAPITAL LETTER X
+	  (?\u0059 ?\u0079) ;; LATIN CAPITAL LETTER Y
+	  (?\u005A ?\u007A) ;; LATIN CAPITAL LETTER Z
+	  (?\u00B5 ?\u03BC) ;; MICRO SIGN
+	  (?\u00C0 ?\u00E0) ;; LATIN CAPITAL LETTER A WITH GRAVE
+	  (?\u00C1 ?\u00E1) ;; LATIN CAPITAL LETTER A WITH ACUTE
+	  (?\u00C2 ?\u00E2) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+	  (?\u00C3 ?\u00E3) ;; LATIN CAPITAL LETTER A WITH TILDE
+	  (?\u00C4 ?\u00E4) ;; LATIN CAPITAL LETTER A WITH DIAERESIS
+	  (?\u00C5 ?\u00E5) ;; LATIN CAPITAL LETTER A WITH RING ABOVE
+	  (?\u00C6 ?\u00E6) ;; LATIN CAPITAL LETTER AE
+	  (?\u00C7 ?\u00E7) ;; LATIN CAPITAL LETTER C WITH CEDILLA
+	  (?\u00C8 ?\u00E8) ;; LATIN CAPITAL LETTER E WITH GRAVE
+	  (?\u00C9 ?\u00E9) ;; LATIN CAPITAL LETTER E WITH ACUTE
+	  (?\u00CA ?\u00EA) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+	  (?\u00CB ?\u00EB) ;; LATIN CAPITAL LETTER E WITH DIAERESIS
+	  (?\u00CC ?\u00EC) ;; LATIN CAPITAL LETTER I WITH GRAVE
+	  (?\u00CD ?\u00ED) ;; LATIN CAPITAL LETTER I WITH ACUTE
+	  (?\u00CE ?\u00EE) ;; LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+	  (?\u00CF ?\u00EF) ;; LATIN CAPITAL LETTER I WITH DIAERESIS
+	  (?\u00D0 ?\u00F0) ;; LATIN CAPITAL LETTER ETH
+	  (?\u00D1 ?\u00F1) ;; LATIN CAPITAL LETTER N WITH TILDE
+	  (?\u00D2 ?\u00F2) ;; LATIN CAPITAL LETTER O WITH GRAVE
+	  (?\u00D3 ?\u00F3) ;; LATIN CAPITAL LETTER O WITH ACUTE
+	  (?\u00D4 ?\u00F4) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+	  (?\u00D5 ?\u00F5) ;; LATIN CAPITAL LETTER O WITH TILDE
+	  (?\u00D6 ?\u00F6) ;; LATIN CAPITAL LETTER O WITH DIAERESIS
+	  (?\u00D8 ?\u00F8) ;; LATIN CAPITAL LETTER O WITH STROKE
+	  (?\u00D9 ?\u00F9) ;; LATIN CAPITAL LETTER U WITH GRAVE
+	  (?\u00DA ?\u00FA) ;; LATIN CAPITAL LETTER U WITH ACUTE
+	  (?\u00DB ?\u00FB) ;; LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+	  (?\u00DC ?\u00FC) ;; LATIN CAPITAL LETTER U WITH DIAERESIS
+	  (?\u00DD ?\u00FD) ;; LATIN CAPITAL LETTER Y WITH ACUTE
+	  (?\u00DE ?\u00FE) ;; LATIN CAPITAL LETTER THORN
+;;; WARNING: Unhandled full mapping:
+;;;   00DF; F; 0073 0073; # LATIN SMALL LETTER SHARP S
+	  (?\u0100 ?\u0101) ;; LATIN CAPITAL LETTER A WITH MACRON
+	  (?\u0102 ?\u0103) ;; LATIN CAPITAL LETTER A WITH BREVE
+	  (?\u0104 ?\u0105) ;; LATIN CAPITAL LETTER A WITH OGONEK
+	  (?\u0106 ?\u0107) ;; LATIN CAPITAL LETTER C WITH ACUTE
+	  (?\u0108 ?\u0109) ;; LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+	  (?\u010A ?\u010B) ;; LATIN CAPITAL LETTER C WITH DOT ABOVE
+	  (?\u010C ?\u010D) ;; LATIN CAPITAL LETTER C WITH CARON
+	  (?\u010E ?\u010F) ;; LATIN CAPITAL LETTER D WITH CARON
+	  (?\u0110 ?\u0111) ;; LATIN CAPITAL LETTER D WITH STROKE
+	  (?\u0112 ?\u0113) ;; LATIN CAPITAL LETTER E WITH MACRON
+	  (?\u0114 ?\u0115) ;; LATIN CAPITAL LETTER E WITH BREVE
+	  (?\u0116 ?\u0117) ;; LATIN CAPITAL LETTER E WITH DOT ABOVE
+	  (?\u0118 ?\u0119) ;; LATIN CAPITAL LETTER E WITH OGONEK
+	  (?\u011A ?\u011B) ;; LATIN CAPITAL LETTER E WITH CARON
+	  (?\u011C ?\u011D) ;; LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+	  (?\u011E ?\u011F) ;; LATIN CAPITAL LETTER G WITH BREVE
+	  (?\u0120 ?\u0121) ;; LATIN CAPITAL LETTER G WITH DOT ABOVE
+	  (?\u0122 ?\u0123) ;; LATIN CAPITAL LETTER G WITH CEDILLA
+	  (?\u0124 ?\u0125) ;; LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+	  (?\u0126 ?\u0127) ;; LATIN CAPITAL LETTER H WITH STROKE
+	  (?\u0128 ?\u0129) ;; LATIN CAPITAL LETTER I WITH TILDE
+	  (?\u012A ?\u012B) ;; LATIN CAPITAL LETTER I WITH MACRON
+	  (?\u012C ?\u012D) ;; LATIN CAPITAL LETTER I WITH BREVE
+	  (?\u012E ?\u012F) ;; LATIN CAPITAL LETTER I WITH OGONEK
+;;; WARNING: Unhandled full mapping:
+;;;   0130; F; 0069 0307; # LATIN CAPITAL LETTER I WITH DOT ABOVE
+;;; WARNING: Unhandled Turkish mapping:
+;;;        0130; T; 0069; # LATIN CAPITAL LETTER I WITH DOT ABOVE
+	  (?\u0132 ?\u0133) ;; LATIN CAPITAL LIGATURE IJ
+	  (?\u0134 ?\u0135) ;; LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+	  (?\u0136 ?\u0137) ;; LATIN CAPITAL LETTER K WITH CEDILLA
+	  (?\u0139 ?\u013A) ;; LATIN CAPITAL LETTER L WITH ACUTE
+	  (?\u013B ?\u013C) ;; LATIN CAPITAL LETTER L WITH CEDILLA
+	  (?\u013D ?\u013E) ;; LATIN CAPITAL LETTER L WITH CARON
+	  (?\u013F ?\u0140) ;; LATIN CAPITAL LETTER L WITH MIDDLE DOT
+	  (?\u0141 ?\u0142) ;; LATIN CAPITAL LETTER L WITH STROKE
+	  (?\u0143 ?\u0144) ;; LATIN CAPITAL LETTER N WITH ACUTE
+	  (?\u0145 ?\u0146) ;; LATIN CAPITAL LETTER N WITH CEDILLA
+	  (?\u0147 ?\u0148) ;; LATIN CAPITAL LETTER N WITH CARON
+;;; WARNING: Unhandled full mapping:
+;;;   0149; F; 02BC 006E; # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
+	  (?\u014A ?\u014B) ;; LATIN CAPITAL LETTER ENG
+	  (?\u014C ?\u014D) ;; LATIN CAPITAL LETTER O WITH MACRON
+	  (?\u014E ?\u014F) ;; LATIN CAPITAL LETTER O WITH BREVE
+	  (?\u0150 ?\u0151) ;; LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+	  (?\u0152 ?\u0153) ;; LATIN CAPITAL LIGATURE OE
+	  (?\u0154 ?\u0155) ;; LATIN CAPITAL LETTER R WITH ACUTE
+	  (?\u0156 ?\u0157) ;; LATIN CAPITAL LETTER R WITH CEDILLA
+	  (?\u0158 ?\u0159) ;; LATIN CAPITAL LETTER R WITH CARON
+	  (?\u015A ?\u015B) ;; LATIN CAPITAL LETTER S WITH ACUTE
+	  (?\u015C ?\u015D) ;; LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+	  (?\u015E ?\u015F) ;; LATIN CAPITAL LETTER S WITH CEDILLA
+	  (?\u0160 ?\u0161) ;; LATIN CAPITAL LETTER S WITH CARON
+	  (?\u0162 ?\u0163) ;; LATIN CAPITAL LETTER T WITH CEDILLA
+	  (?\u0164 ?\u0165) ;; LATIN CAPITAL LETTER T WITH CARON
+	  (?\u0166 ?\u0167) ;; LATIN CAPITAL LETTER T WITH STROKE
+	  (?\u0168 ?\u0169) ;; LATIN CAPITAL LETTER U WITH TILDE
+	  (?\u016A ?\u016B) ;; LATIN CAPITAL LETTER U WITH MACRON
+	  (?\u016C ?\u016D) ;; LATIN CAPITAL LETTER U WITH BREVE
+	  (?\u016E ?\u016F) ;; LATIN CAPITAL LETTER U WITH RING ABOVE
+	  (?\u0170 ?\u0171) ;; LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+	  (?\u0172 ?\u0173) ;; LATIN CAPITAL LETTER U WITH OGONEK
+	  (?\u0174 ?\u0175) ;; LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+	  (?\u0176 ?\u0177) ;; LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+	  (?\u0178 ?\u00FF) ;; LATIN CAPITAL LETTER Y WITH DIAERESIS
+	  (?\u0179 ?\u017A) ;; LATIN CAPITAL LETTER Z WITH ACUTE
+	  (?\u017B ?\u017C) ;; LATIN CAPITAL LETTER Z WITH DOT ABOVE
+	  (?\u017D ?\u017E) ;; LATIN CAPITAL LETTER Z WITH CARON
+	  (?\u017F ?\u0073) ;; LATIN SMALL LETTER LONG S
+	  (?\u0181 ?\u0253) ;; LATIN CAPITAL LETTER B WITH HOOK
+	  (?\u0182 ?\u0183) ;; LATIN CAPITAL LETTER B WITH TOPBAR
+	  (?\u0184 ?\u0185) ;; LATIN CAPITAL LETTER TONE SIX
+	  (?\u0186 ?\u0254) ;; LATIN CAPITAL LETTER OPEN O
+	  (?\u0187 ?\u0188) ;; LATIN CAPITAL LETTER C WITH HOOK
+	  (?\u0189 ?\u0256) ;; LATIN CAPITAL LETTER AFRICAN D
+	  (?\u018A ?\u0257) ;; LATIN CAPITAL LETTER D WITH HOOK
+	  (?\u018B ?\u018C) ;; LATIN CAPITAL LETTER D WITH TOPBAR
+	  (?\u018E ?\u01DD) ;; LATIN CAPITAL LETTER REVERSED E
+	  (?\u018F ?\u0259) ;; LATIN CAPITAL LETTER SCHWA
+	  (?\u0190 ?\u025B) ;; LATIN CAPITAL LETTER OPEN E
+	  (?\u0191 ?\u0192) ;; LATIN CAPITAL LETTER F WITH HOOK
+	  (?\u0193 ?\u0260) ;; LATIN CAPITAL LETTER G WITH HOOK
+	  (?\u0194 ?\u0263) ;; LATIN CAPITAL LETTER GAMMA
+	  (?\u0196 ?\u0269) ;; LATIN CAPITAL LETTER IOTA
+	  (?\u0197 ?\u0268) ;; LATIN CAPITAL LETTER I WITH STROKE
+	  (?\u0198 ?\u0199) ;; LATIN CAPITAL LETTER K WITH HOOK
+	  (?\u019C ?\u026F) ;; LATIN CAPITAL LETTER TURNED M
+	  (?\u019D ?\u0272) ;; LATIN CAPITAL LETTER N WITH LEFT HOOK
+	  (?\u019F ?\u0275) ;; LATIN CAPITAL LETTER O WITH MIDDLE TILDE
+	  (?\u01A0 ?\u01A1) ;; LATIN CAPITAL LETTER O WITH HORN
+	  (?\u01A2 ?\u01A3) ;; LATIN CAPITAL LETTER OI
+	  (?\u01A4 ?\u01A5) ;; LATIN CAPITAL LETTER P WITH HOOK
+	  (?\u01A6 ?\u0280) ;; LATIN LETTER YR
+	  (?\u01A7 ?\u01A8) ;; LATIN CAPITAL LETTER TONE TWO
+	  (?\u01A9 ?\u0283) ;; LATIN CAPITAL LETTER ESH
+	  (?\u01AC ?\u01AD) ;; LATIN CAPITAL LETTER T WITH HOOK
+	  (?\u01AE ?\u0288) ;; LATIN CAPITAL LETTER T WITH RETROFLEX HOOK
+	  (?\u01AF ?\u01B0) ;; LATIN CAPITAL LETTER U WITH HORN
+	  (?\u01B1 ?\u028A) ;; LATIN CAPITAL LETTER UPSILON
+	  (?\u01B2 ?\u028B) ;; LATIN CAPITAL LETTER V WITH HOOK
+	  (?\u01B3 ?\u01B4) ;; LATIN CAPITAL LETTER Y WITH HOOK
+	  (?\u01B5 ?\u01B6) ;; LATIN CAPITAL LETTER Z WITH STROKE
+	  (?\u01B7 ?\u0292) ;; LATIN CAPITAL LETTER EZH
+	  (?\u01B8 ?\u01B9) ;; LATIN CAPITAL LETTER EZH REVERSED
+	  (?\u01BC ?\u01BD) ;; LATIN CAPITAL LETTER TONE FIVE
+	  (?\u01C4 ?\u01C6) ;; LATIN CAPITAL LETTER DZ WITH CARON
+	  (?\u01C5 ?\u01C6) ;; LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+	  (?\u01C7 ?\u01C9) ;; LATIN CAPITAL LETTER LJ
+	  (?\u01C8 ?\u01C9) ;; LATIN CAPITAL LETTER L WITH SMALL LETTER J
+	  (?\u01CA ?\u01CC) ;; LATIN CAPITAL LETTER NJ
+	  (?\u01CB ?\u01CC) ;; LATIN CAPITAL LETTER N WITH SMALL LETTER J
+	  (?\u01CD ?\u01CE) ;; LATIN CAPITAL LETTER A WITH CARON
+	  (?\u01CF ?\u01D0) ;; LATIN CAPITAL LETTER I WITH CARON
+	  (?\u01D1 ?\u01D2) ;; LATIN CAPITAL LETTER O WITH CARON
+	  (?\u01D3 ?\u01D4) ;; LATIN CAPITAL LETTER U WITH CARON
+	  (?\u01D5 ?\u01D6) ;; LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+	  (?\u01D7 ?\u01D8) ;; LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+	  (?\u01D9 ?\u01DA) ;; LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+	  (?\u01DB ?\u01DC) ;; LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+	  (?\u01DE ?\u01DF) ;; LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+	  (?\u01E0 ?\u01E1) ;; LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+	  (?\u01E2 ?\u01E3) ;; LATIN CAPITAL LETTER AE WITH MACRON
+	  (?\u01E4 ?\u01E5) ;; LATIN CAPITAL LETTER G WITH STROKE
+	  (?\u01E6 ?\u01E7) ;; LATIN CAPITAL LETTER G WITH CARON
+	  (?\u01E8 ?\u01E9) ;; LATIN CAPITAL LETTER K WITH CARON
+	  (?\u01EA ?\u01EB) ;; LATIN CAPITAL LETTER O WITH OGONEK
+	  (?\u01EC ?\u01ED) ;; LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+	  (?\u01EE ?\u01EF) ;; LATIN CAPITAL LETTER EZH WITH CARON
+;;; WARNING: Unhandled full mapping:
+;;;   01F0; F; 006A 030C; # LATIN SMALL LETTER J WITH CARON
+	  (?\u01F1 ?\u01F3) ;; LATIN CAPITAL LETTER DZ
+	  (?\u01F2 ?\u01F3) ;; LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+	  (?\u01F4 ?\u01F5) ;; LATIN CAPITAL LETTER G WITH ACUTE
+	  (?\u01F6 ?\u0195) ;; LATIN CAPITAL LETTER HWAIR
+	  (?\u01F7 ?\u01BF) ;; LATIN CAPITAL LETTER WYNN
+	  (?\u01F8 ?\u01F9) ;; LATIN CAPITAL LETTER N WITH GRAVE
+	  (?\u01FA ?\u01FB) ;; LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+	  (?\u01FC ?\u01FD) ;; LATIN CAPITAL LETTER AE WITH ACUTE
+	  (?\u01FE ?\u01FF) ;; LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+	  (?\u0200 ?\u0201) ;; LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
+	  (?\u0202 ?\u0203) ;; LATIN CAPITAL LETTER A WITH INVERTED BREVE
+	  (?\u0204 ?\u0205) ;; LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
+	  (?\u0206 ?\u0207) ;; LATIN CAPITAL LETTER E WITH INVERTED BREVE
+	  (?\u0208 ?\u0209) ;; LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
+	  (?\u020A ?\u020B) ;; LATIN CAPITAL LETTER I WITH INVERTED BREVE
+	  (?\u020C ?\u020D) ;; LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
+	  (?\u020E ?\u020F) ;; LATIN CAPITAL LETTER O WITH INVERTED BREVE
+	  (?\u0210 ?\u0211) ;; LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
+	  (?\u0212 ?\u0213) ;; LATIN CAPITAL LETTER R WITH INVERTED BREVE
+	  (?\u0214 ?\u0215) ;; LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
+	  (?\u0216 ?\u0217) ;; LATIN CAPITAL LETTER U WITH INVERTED BREVE
+	  (?\u0218 ?\u0219) ;; LATIN CAPITAL LETTER S WITH COMMA BELOW
+	  (?\u021A ?\u021B) ;; LATIN CAPITAL LETTER T WITH COMMA BELOW
+	  (?\u021C ?\u021D) ;; LATIN CAPITAL LETTER YOGH
+	  (?\u021E ?\u021F) ;; LATIN CAPITAL LETTER H WITH CARON
+	  (?\u0220 ?\u019E) ;; LATIN CAPITAL LETTER N WITH LONG RIGHT LEG
+	  (?\u0222 ?\u0223) ;; LATIN CAPITAL LETTER OU
+	  (?\u0224 ?\u0225) ;; LATIN CAPITAL LETTER Z WITH HOOK
+	  (?\u0226 ?\u0227) ;; LATIN CAPITAL LETTER A WITH DOT ABOVE
+	  (?\u0228 ?\u0229) ;; LATIN CAPITAL LETTER E WITH CEDILLA
+	  (?\u022A ?\u022B) ;; LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+	  (?\u022C ?\u022D) ;; LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+	  (?\u022E ?\u022F) ;; LATIN CAPITAL LETTER O WITH DOT ABOVE
+	  (?\u0230 ?\u0231) ;; LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+	  (?\u0232 ?\u0233) ;; LATIN CAPITAL LETTER Y WITH MACRON
+	  (?\u023A ?\u2C65) ;; LATIN CAPITAL LETTER A WITH STROKE
+	  (?\u023B ?\u023C) ;; LATIN CAPITAL LETTER C WITH STROKE
+	  (?\u023D ?\u019A) ;; LATIN CAPITAL LETTER L WITH BAR
+	  (?\u023E ?\u2C66) ;; LATIN CAPITAL LETTER T WITH DIAGONAL STROKE
+	  (?\u0241 ?\u0242) ;; LATIN CAPITAL LETTER GLOTTAL STOP
+	  (?\u0243 ?\u0180) ;; LATIN CAPITAL LETTER B WITH STROKE
+	  (?\u0244 ?\u0289) ;; LATIN CAPITAL LETTER U BAR
+	  (?\u0245 ?\u028C) ;; LATIN CAPITAL LETTER TURNED V
+	  (?\u0246 ?\u0247) ;; LATIN CAPITAL LETTER E WITH STROKE
+	  (?\u0248 ?\u0249) ;; LATIN CAPITAL LETTER J WITH STROKE
+	  (?\u024A ?\u024B) ;; LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL
+	  (?\u024C ?\u024D) ;; LATIN CAPITAL LETTER R WITH STROKE
+	  (?\u024E ?\u024F) ;; LATIN CAPITAL LETTER Y WITH STROKE
+	  (?\u0345 ?\u03B9) ;; COMBINING GREEK YPOGEGRAMMENI
+	  (?\u0370 ?\u0371) ;; GREEK CAPITAL LETTER HETA
+	  (?\u0372 ?\u0373) ;; GREEK CAPITAL LETTER ARCHAIC SAMPI
+	  (?\u0376 ?\u0377) ;; GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA
+	  (?\u0386 ?\u03AC) ;; GREEK CAPITAL LETTER ALPHA WITH TONOS
+	  (?\u0388 ?\u03AD) ;; GREEK CAPITAL LETTER EPSILON WITH TONOS
+	  (?\u0389 ?\u03AE) ;; GREEK CAPITAL LETTER ETA WITH TONOS
+	  (?\u038A ?\u03AF) ;; GREEK CAPITAL LETTER IOTA WITH TONOS
+	  (?\u038C ?\u03CC) ;; GREEK CAPITAL LETTER OMICRON WITH TONOS
+	  (?\u038E ?\u03CD) ;; GREEK CAPITAL LETTER UPSILON WITH TONOS
+	  (?\u038F ?\u03CE) ;; GREEK CAPITAL LETTER OMEGA WITH TONOS
+;;; WARNING: Unhandled full mapping:
+;;;   0390; F; 03B9 0308 0301; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+	  (?\u0391 ?\u03B1) ;; GREEK CAPITAL LETTER ALPHA
+	  (?\u0392 ?\u03B2) ;; GREEK CAPITAL LETTER BETA
+	  (?\u0393 ?\u03B3) ;; GREEK CAPITAL LETTER GAMMA
+	  (?\u0394 ?\u03B4) ;; GREEK CAPITAL LETTER DELTA
+	  (?\u0395 ?\u03B5) ;; GREEK CAPITAL LETTER EPSILON
+	  (?\u0396 ?\u03B6) ;; GREEK CAPITAL LETTER ZETA
+	  (?\u0397 ?\u03B7) ;; GREEK CAPITAL LETTER ETA
+	  (?\u0398 ?\u03B8) ;; GREEK CAPITAL LETTER THETA
+	  (?\u0399 ?\u03B9) ;; GREEK CAPITAL LETTER IOTA
+	  (?\u039A ?\u03BA) ;; GREEK CAPITAL LETTER KAPPA
+	  (?\u039B ?\u03BB) ;; GREEK CAPITAL LETTER LAMDA
+	  (?\u039C ?\u03BC) ;; GREEK CAPITAL LETTER MU
+	  (?\u039D ?\u03BD) ;; GREEK CAPITAL LETTER NU
+	  (?\u039E ?\u03BE) ;; GREEK CAPITAL LETTER XI
+	  (?\u039F ?\u03BF) ;; GREEK CAPITAL LETTER OMICRON
+	  (?\u03A0 ?\u03C0) ;; GREEK CAPITAL LETTER PI
+	  (?\u03A1 ?\u03C1) ;; GREEK CAPITAL LETTER RHO
+	  (?\u03A3 ?\u03C3) ;; GREEK CAPITAL LETTER SIGMA
+	  (?\u03A4 ?\u03C4) ;; GREEK CAPITAL LETTER TAU
+	  (?\u03A5 ?\u03C5) ;; GREEK CAPITAL LETTER UPSILON
+	  (?\u03A6 ?\u03C6) ;; GREEK CAPITAL LETTER PHI
+	  (?\u03A7 ?\u03C7) ;; GREEK CAPITAL LETTER CHI
+	  (?\u03A8 ?\u03C8) ;; GREEK CAPITAL LETTER PSI
+	  (?\u03A9 ?\u03C9) ;; GREEK CAPITAL LETTER OMEGA
+	  (?\u03AA ?\u03CA) ;; GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+	  (?\u03AB ?\u03CB) ;; GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+;;; WARNING: Unhandled full mapping:
+;;;   03B0; F; 03C5 0308 0301; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+	  (?\u03C2 ?\u03C3) ;; GREEK SMALL LETTER FINAL SIGMA
+	  (?\u03CF ?\u03D7) ;; GREEK CAPITAL KAI SYMBOL
+	  (?\u03D0 ?\u03B2) ;; GREEK BETA SYMBOL
+	  (?\u03D1 ?\u03B8) ;; GREEK THETA SYMBOL
+	  (?\u03D5 ?\u03C6) ;; GREEK PHI SYMBOL
+	  (?\u03D6 ?\u03C0) ;; GREEK PI SYMBOL
+	  (?\u03D8 ?\u03D9) ;; GREEK LETTER ARCHAIC KOPPA
+	  (?\u03DA ?\u03DB) ;; GREEK LETTER STIGMA
+	  (?\u03DC ?\u03DD) ;; GREEK LETTER DIGAMMA
+	  (?\u03DE ?\u03DF) ;; GREEK LETTER KOPPA
+	  (?\u03E0 ?\u03E1) ;; GREEK LETTER SAMPI
+	  (?\u03E2 ?\u03E3) ;; COPTIC CAPITAL LETTER SHEI
+	  (?\u03E4 ?\u03E5) ;; COPTIC CAPITAL LETTER FEI
+	  (?\u03E6 ?\u03E7) ;; COPTIC CAPITAL LETTER KHEI
+	  (?\u03E8 ?\u03E9) ;; COPTIC CAPITAL LETTER HORI
+	  (?\u03EA ?\u03EB) ;; COPTIC CAPITAL LETTER GANGIA
+	  (?\u03EC ?\u03ED) ;; COPTIC CAPITAL LETTER SHIMA
+	  (?\u03EE ?\u03EF) ;; COPTIC CAPITAL LETTER DEI
+	  (?\u03F0 ?\u03BA) ;; GREEK KAPPA SYMBOL
+	  (?\u03F1 ?\u03C1) ;; GREEK RHO SYMBOL
+	  (?\u03F4 ?\u03B8) ;; GREEK CAPITAL THETA SYMBOL
+	  (?\u03F5 ?\u03B5) ;; GREEK LUNATE EPSILON SYMBOL
+	  (?\u03F7 ?\u03F8) ;; GREEK CAPITAL LETTER SHO
+	  (?\u03F9 ?\u03F2) ;; GREEK CAPITAL LUNATE SIGMA SYMBOL
+	  (?\u03FA ?\u03FB) ;; GREEK CAPITAL LETTER SAN
+	  (?\u03FD ?\u037B) ;; GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL
+	  (?\u03FE ?\u037C) ;; GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL
+	  (?\u03FF ?\u037D) ;; GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL
+	  (?\u0400 ?\u0450) ;; CYRILLIC CAPITAL LETTER IE WITH GRAVE
+	  (?\u0401 ?\u0451) ;; CYRILLIC CAPITAL LETTER IO
+	  (?\u0402 ?\u0452) ;; CYRILLIC CAPITAL LETTER DJE
+	  (?\u0403 ?\u0453) ;; CYRILLIC CAPITAL LETTER GJE
+	  (?\u0404 ?\u0454) ;; CYRILLIC CAPITAL LETTER UKRAINIAN IE
+	  (?\u0405 ?\u0455) ;; CYRILLIC CAPITAL LETTER DZE
+	  (?\u0406 ?\u0456) ;; CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+	  (?\u0407 ?\u0457) ;; CYRILLIC CAPITAL LETTER YI
+	  (?\u0408 ?\u0458) ;; CYRILLIC CAPITAL LETTER JE
+	  (?\u0409 ?\u0459) ;; CYRILLIC CAPITAL LETTER LJE
+	  (?\u040A ?\u045A) ;; CYRILLIC CAPITAL LETTER NJE
+	  (?\u040B ?\u045B) ;; CYRILLIC CAPITAL LETTER TSHE
+	  (?\u040C ?\u045C) ;; CYRILLIC CAPITAL LETTER KJE
+	  (?\u040D ?\u045D) ;; CYRILLIC CAPITAL LETTER I WITH GRAVE
+	  (?\u040E ?\u045E) ;; CYRILLIC CAPITAL LETTER SHORT U
+	  (?\u040F ?\u045F) ;; CYRILLIC CAPITAL LETTER DZHE
+	  (?\u0410 ?\u0430) ;; CYRILLIC CAPITAL LETTER A
+	  (?\u0411 ?\u0431) ;; CYRILLIC CAPITAL LETTER BE
+	  (?\u0412 ?\u0432) ;; CYRILLIC CAPITAL LETTER VE
+	  (?\u0413 ?\u0433) ;; CYRILLIC CAPITAL LETTER GHE
+	  (?\u0414 ?\u0434) ;; CYRILLIC CAPITAL LETTER DE
+	  (?\u0415 ?\u0435) ;; CYRILLIC CAPITAL LETTER IE
+	  (?\u0416 ?\u0436) ;; CYRILLIC CAPITAL LETTER ZHE
+	  (?\u0417 ?\u0437) ;; CYRILLIC CAPITAL LETTER ZE
+	  (?\u0418 ?\u0438) ;; CYRILLIC CAPITAL LETTER I
+	  (?\u0419 ?\u0439) ;; CYRILLIC CAPITAL LETTER SHORT I
+	  (?\u041A ?\u043A) ;; CYRILLIC CAPITAL LETTER KA
+	  (?\u041B ?\u043B) ;; CYRILLIC CAPITAL LETTER EL
+	  (?\u041C ?\u043C) ;; CYRILLIC CAPITAL LETTER EM
+	  (?\u041D ?\u043D) ;; CYRILLIC CAPITAL LETTER EN
+	  (?\u041E ?\u043E) ;; CYRILLIC CAPITAL LETTER O
+	  (?\u041F ?\u043F) ;; CYRILLIC CAPITAL LETTER PE
+	  (?\u0420 ?\u0440) ;; CYRILLIC CAPITAL LETTER ER
+	  (?\u0421 ?\u0441) ;; CYRILLIC CAPITAL LETTER ES
+	  (?\u0422 ?\u0442) ;; CYRILLIC CAPITAL LETTER TE
+	  (?\u0423 ?\u0443) ;; CYRILLIC CAPITAL LETTER U
+	  (?\u0424 ?\u0444) ;; CYRILLIC CAPITAL LETTER EF
+	  (?\u0425 ?\u0445) ;; CYRILLIC CAPITAL LETTER HA
+	  (?\u0426 ?\u0446) ;; CYRILLIC CAPITAL LETTER TSE
+	  (?\u0427 ?\u0447) ;; CYRILLIC CAPITAL LETTER CHE
+	  (?\u0428 ?\u0448) ;; CYRILLIC CAPITAL LETTER SHA
+	  (?\u0429 ?\u0449) ;; CYRILLIC CAPITAL LETTER SHCHA
+	  (?\u042A ?\u044A) ;; CYRILLIC CAPITAL LETTER HARD SIGN
+	  (?\u042B ?\u044B) ;; CYRILLIC CAPITAL LETTER YERU
+	  (?\u042C ?\u044C) ;; CYRILLIC CAPITAL LETTER SOFT SIGN
+	  (?\u042D ?\u044D) ;; CYRILLIC CAPITAL LETTER E
+	  (?\u042E ?\u044E) ;; CYRILLIC CAPITAL LETTER YU
+	  (?\u042F ?\u044F) ;; CYRILLIC CAPITAL LETTER YA
+	  (?\u0460 ?\u0461) ;; CYRILLIC CAPITAL LETTER OMEGA
+	  (?\u0462 ?\u0463) ;; CYRILLIC CAPITAL LETTER YAT
+	  (?\u0464 ?\u0465) ;; CYRILLIC CAPITAL LETTER IOTIFIED E
+	  (?\u0466 ?\u0467) ;; CYRILLIC CAPITAL LETTER LITTLE YUS
+	  (?\u0468 ?\u0469) ;; CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS
+	  (?\u046A ?\u046B) ;; CYRILLIC CAPITAL LETTER BIG YUS
+	  (?\u046C ?\u046D) ;; CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS
+	  (?\u046E ?\u046F) ;; CYRILLIC CAPITAL LETTER KSI
+	  (?\u0470 ?\u0471) ;; CYRILLIC CAPITAL LETTER PSI
+	  (?\u0472 ?\u0473) ;; CYRILLIC CAPITAL LETTER FITA
+	  (?\u0474 ?\u0475) ;; CYRILLIC CAPITAL LETTER IZHITSA
+	  (?\u0476 ?\u0477) ;; CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+	  (?\u0478 ?\u0479) ;; CYRILLIC CAPITAL LETTER UK
+	  (?\u047A ?\u047B) ;; CYRILLIC CAPITAL LETTER ROUND OMEGA
+	  (?\u047C ?\u047D) ;; CYRILLIC CAPITAL LETTER OMEGA WITH TITLO
+	  (?\u047E ?\u047F) ;; CYRILLIC CAPITAL LETTER OT
+	  (?\u0480 ?\u0481) ;; CYRILLIC CAPITAL LETTER KOPPA
+	  (?\u048A ?\u048B) ;; CYRILLIC CAPITAL LETTER SHORT I WITH TAIL
+	  (?\u048C ?\u048D) ;; CYRILLIC CAPITAL LETTER SEMISOFT SIGN
+	  (?\u048E ?\u048F) ;; CYRILLIC CAPITAL LETTER ER WITH TICK
+	  (?\u0490 ?\u0491) ;; CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+	  (?\u0492 ?\u0493) ;; CYRILLIC CAPITAL LETTER GHE WITH STROKE
+	  (?\u0494 ?\u0495) ;; CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK
+	  (?\u0496 ?\u0497) ;; CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER
+	  (?\u0498 ?\u0499) ;; CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
+	  (?\u049A ?\u049B) ;; CYRILLIC CAPITAL LETTER KA WITH DESCENDER
+	  (?\u049C ?\u049D) ;; CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
+	  (?\u049E ?\u049F) ;; CYRILLIC CAPITAL LETTER KA WITH STROKE
+	  (?\u04A0 ?\u04A1) ;; CYRILLIC CAPITAL LETTER BASHKIR KA
+	  (?\u04A2 ?\u04A3) ;; CYRILLIC CAPITAL LETTER EN WITH DESCENDER
+	  (?\u04A4 ?\u04A5) ;; CYRILLIC CAPITAL LIGATURE EN GHE
+	  (?\u04A6 ?\u04A7) ;; CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK
+	  (?\u04A8 ?\u04A9) ;; CYRILLIC CAPITAL LETTER ABKHASIAN HA
+	  (?\u04AA ?\u04AB) ;; CYRILLIC CAPITAL LETTER ES WITH DESCENDER
+	  (?\u04AC ?\u04AD) ;; CYRILLIC CAPITAL LETTER TE WITH DESCENDER
+	  (?\u04AE ?\u04AF) ;; CYRILLIC CAPITAL LETTER STRAIGHT U
+	  (?\u04B0 ?\u04B1) ;; CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
+	  (?\u04B2 ?\u04B3) ;; CYRILLIC CAPITAL LETTER HA WITH DESCENDER
+	  (?\u04B4 ?\u04B5) ;; CYRILLIC CAPITAL LIGATURE TE TSE
+	  (?\u04B6 ?\u04B7) ;; CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
+	  (?\u04B8 ?\u04B9) ;; CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE
+	  (?\u04BA ?\u04BB) ;; CYRILLIC CAPITAL LETTER SHHA
+	  (?\u04BC ?\u04BD) ;; CYRILLIC CAPITAL LETTER ABKHASIAN CHE
+	  (?\u04BE ?\u04BF) ;; CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER
+	  (?\u04C0 ?\u04CF) ;; CYRILLIC LETTER PALOCHKA
+	  (?\u04C1 ?\u04C2) ;; CYRILLIC CAPITAL LETTER ZHE WITH BREVE
+	  (?\u04C3 ?\u04C4) ;; CYRILLIC CAPITAL LETTER KA WITH HOOK
+	  (?\u04C5 ?\u04C6) ;; CYRILLIC CAPITAL LETTER EL WITH TAIL
+	  (?\u04C7 ?\u04C8) ;; CYRILLIC CAPITAL LETTER EN WITH HOOK
+	  (?\u04C9 ?\u04CA) ;; CYRILLIC CAPITAL LETTER EN WITH TAIL
+	  (?\u04CB ?\u04CC) ;; CYRILLIC CAPITAL LETTER KHAKASSIAN CHE
+	  (?\u04CD ?\u04CE) ;; CYRILLIC CAPITAL LETTER EM WITH TAIL
+	  (?\u04D0 ?\u04D1) ;; CYRILLIC CAPITAL LETTER A WITH BREVE
+	  (?\u04D2 ?\u04D3) ;; CYRILLIC CAPITAL LETTER A WITH DIAERESIS
+	  (?\u04D4 ?\u04D5) ;; CYRILLIC CAPITAL LIGATURE A IE
+	  (?\u04D6 ?\u04D7) ;; CYRILLIC CAPITAL LETTER IE WITH BREVE
+	  (?\u04D8 ?\u04D9) ;; CYRILLIC CAPITAL LETTER SCHWA
+	  (?\u04DA ?\u04DB) ;; CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
+	  (?\u04DC ?\u04DD) ;; CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
+	  (?\u04DE ?\u04DF) ;; CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
+	  (?\u04E0 ?\u04E1) ;; CYRILLIC CAPITAL LETTER ABKHASIAN DZE
+	  (?\u04E2 ?\u04E3) ;; CYRILLIC CAPITAL LETTER I WITH MACRON
+	  (?\u04E4 ?\u04E5) ;; CYRILLIC CAPITAL LETTER I WITH DIAERESIS
+	  (?\u04E6 ?\u04E7) ;; CYRILLIC CAPITAL LETTER O WITH DIAERESIS
+	  (?\u04E8 ?\u04E9) ;; CYRILLIC CAPITAL LETTER BARRED O
+	  (?\u04EA ?\u04EB) ;; CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
+	  (?\u04EC ?\u04ED) ;; CYRILLIC CAPITAL LETTER E WITH DIAERESIS
+	  (?\u04EE ?\u04EF) ;; CYRILLIC CAPITAL LETTER U WITH MACRON
+	  (?\u04F0 ?\u04F1) ;; CYRILLIC CAPITAL LETTER U WITH DIAERESIS
+	  (?\u04F2 ?\u04F3) ;; CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
+	  (?\u04F4 ?\u04F5) ;; CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
+	  (?\u04F6 ?\u04F7) ;; CYRILLIC CAPITAL LETTER GHE WITH DESCENDER
+	  (?\u04F8 ?\u04F9) ;; CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
+	  (?\u04FA ?\u04FB) ;; CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK
+	  (?\u04FC ?\u04FD) ;; CYRILLIC CAPITAL LETTER HA WITH HOOK
+	  (?\u04FE ?\u04FF) ;; CYRILLIC CAPITAL LETTER HA WITH STROKE
+	  (?\u0500 ?\u0501) ;; CYRILLIC CAPITAL LETTER KOMI DE
+	  (?\u0502 ?\u0503) ;; CYRILLIC CAPITAL LETTER KOMI DJE
+	  (?\u0504 ?\u0505) ;; CYRILLIC CAPITAL LETTER KOMI ZJE
+	  (?\u0506 ?\u0507) ;; CYRILLIC CAPITAL LETTER KOMI DZJE
+	  (?\u0508 ?\u0509) ;; CYRILLIC CAPITAL LETTER KOMI LJE
+	  (?\u050A ?\u050B) ;; CYRILLIC CAPITAL LETTER KOMI NJE
+	  (?\u050C ?\u050D) ;; CYRILLIC CAPITAL LETTER KOMI SJE
+	  (?\u050E ?\u050F) ;; CYRILLIC CAPITAL LETTER KOMI TJE
+	  (?\u0510 ?\u0511) ;; CYRILLIC CAPITAL LETTER REVERSED ZE
+	  (?\u0512 ?\u0513) ;; CYRILLIC CAPITAL LETTER EL WITH HOOK
+	  (?\u0514 ?\u0515) ;; CYRILLIC CAPITAL LETTER LHA
+	  (?\u0516 ?\u0517) ;; CYRILLIC CAPITAL LETTER RHA
+	  (?\u0518 ?\u0519) ;; CYRILLIC CAPITAL LETTER YAE
+	  (?\u051A ?\u051B) ;; CYRILLIC CAPITAL LETTER QA
+	  (?\u051C ?\u051D) ;; CYRILLIC CAPITAL LETTER WE
+	  (?\u051E ?\u051F) ;; CYRILLIC CAPITAL LETTER ALEUT KA
+	  (?\u0520 ?\u0521) ;; CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK
+	  (?\u0522 ?\u0523) ;; CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK
+	  (?\u0524 ?\u0525) ;; CYRILLIC CAPITAL LETTER PE WITH DESCENDER
+	  (?\u0531 ?\u0561) ;; ARMENIAN CAPITAL LETTER AYB
+	  (?\u0532 ?\u0562) ;; ARMENIAN CAPITAL LETTER BEN
+	  (?\u0533 ?\u0563) ;; ARMENIAN CAPITAL LETTER GIM
+	  (?\u0534 ?\u0564) ;; ARMENIAN CAPITAL LETTER DA
+	  (?\u0535 ?\u0565) ;; ARMENIAN CAPITAL LETTER ECH
+	  (?\u0536 ?\u0566) ;; ARMENIAN CAPITAL LETTER ZA
+	  (?\u0537 ?\u0567) ;; ARMENIAN CAPITAL LETTER EH
+	  (?\u0538 ?\u0568) ;; ARMENIAN CAPITAL LETTER ET
+	  (?\u0539 ?\u0569) ;; ARMENIAN CAPITAL LETTER TO
+	  (?\u053A ?\u056A) ;; ARMENIAN CAPITAL LETTER ZHE
+	  (?\u053B ?\u056B) ;; ARMENIAN CAPITAL LETTER INI
+	  (?\u053C ?\u056C) ;; ARMENIAN CAPITAL LETTER LIWN
+	  (?\u053D ?\u056D) ;; ARMENIAN CAPITAL LETTER XEH
+	  (?\u053E ?\u056E) ;; ARMENIAN CAPITAL LETTER CA
+	  (?\u053F ?\u056F) ;; ARMENIAN CAPITAL LETTER KEN
+	  (?\u0540 ?\u0570) ;; ARMENIAN CAPITAL LETTER HO
+	  (?\u0541 ?\u0571) ;; ARMENIAN CAPITAL LETTER JA
+	  (?\u0542 ?\u0572) ;; ARMENIAN CAPITAL LETTER GHAD
+	  (?\u0543 ?\u0573) ;; ARMENIAN CAPITAL LETTER CHEH
+	  (?\u0544 ?\u0574) ;; ARMENIAN CAPITAL LETTER MEN
+	  (?\u0545 ?\u0575) ;; ARMENIAN CAPITAL LETTER YI
+	  (?\u0546 ?\u0576) ;; ARMENIAN CAPITAL LETTER NOW
+	  (?\u0547 ?\u0577) ;; ARMENIAN CAPITAL LETTER SHA
+	  (?\u0548 ?\u0578) ;; ARMENIAN CAPITAL LETTER VO
+	  (?\u0549 ?\u0579) ;; ARMENIAN CAPITAL LETTER CHA
+	  (?\u054A ?\u057A) ;; ARMENIAN CAPITAL LETTER PEH
+	  (?\u054B ?\u057B) ;; ARMENIAN CAPITAL LETTER JHEH
+	  (?\u054C ?\u057C) ;; ARMENIAN CAPITAL LETTER RA
+	  (?\u054D ?\u057D) ;; ARMENIAN CAPITAL LETTER SEH
+	  (?\u054E ?\u057E) ;; ARMENIAN CAPITAL LETTER VEW
+	  (?\u054F ?\u057F) ;; ARMENIAN CAPITAL LETTER TIWN
+	  (?\u0550 ?\u0580) ;; ARMENIAN CAPITAL LETTER REH
+	  (?\u0551 ?\u0581) ;; ARMENIAN CAPITAL LETTER CO
+	  (?\u0552 ?\u0582) ;; ARMENIAN CAPITAL LETTER YIWN
+	  (?\u0553 ?\u0583) ;; ARMENIAN CAPITAL LETTER PIWR
+	  (?\u0554 ?\u0584) ;; ARMENIAN CAPITAL LETTER KEH
+	  (?\u0555 ?\u0585) ;; ARMENIAN CAPITAL LETTER OH
+	  (?\u0556 ?\u0586) ;; ARMENIAN CAPITAL LETTER FEH
+;;; WARNING: Unhandled full mapping:
+;;;   0587; F; 0565 0582; # ARMENIAN SMALL LIGATURE ECH YIWN
+	  (?\u10A0 ?\u2D00) ;; GEORGIAN CAPITAL LETTER AN
+	  (?\u10A1 ?\u2D01) ;; GEORGIAN CAPITAL LETTER BAN
+	  (?\u10A2 ?\u2D02) ;; GEORGIAN CAPITAL LETTER GAN
+	  (?\u10A3 ?\u2D03) ;; GEORGIAN CAPITAL LETTER DON
+	  (?\u10A4 ?\u2D04) ;; GEORGIAN CAPITAL LETTER EN
+	  (?\u10A5 ?\u2D05) ;; GEORGIAN CAPITAL LETTER VIN
+	  (?\u10A6 ?\u2D06) ;; GEORGIAN CAPITAL LETTER ZEN
+	  (?\u10A7 ?\u2D07) ;; GEORGIAN CAPITAL LETTER TAN
+	  (?\u10A8 ?\u2D08) ;; GEORGIAN CAPITAL LETTER IN
+	  (?\u10A9 ?\u2D09) ;; GEORGIAN CAPITAL LETTER KAN
+	  (?\u10AA ?\u2D0A) ;; GEORGIAN CAPITAL LETTER LAS
+	  (?\u10AB ?\u2D0B) ;; GEORGIAN CAPITAL LETTER MAN
+	  (?\u10AC ?\u2D0C) ;; GEORGIAN CAPITAL LETTER NAR
+	  (?\u10AD ?\u2D0D) ;; GEORGIAN CAPITAL LETTER ON
+	  (?\u10AE ?\u2D0E) ;; GEORGIAN CAPITAL LETTER PAR
+	  (?\u10AF ?\u2D0F) ;; GEORGIAN CAPITAL LETTER ZHAR
+	  (?\u10B0 ?\u2D10) ;; GEORGIAN CAPITAL LETTER RAE
+	  (?\u10B1 ?\u2D11) ;; GEORGIAN CAPITAL LETTER SAN
+	  (?\u10B2 ?\u2D12) ;; GEORGIAN CAPITAL LETTER TAR
+	  (?\u10B3 ?\u2D13) ;; GEORGIAN CAPITAL LETTER UN
+	  (?\u10B4 ?\u2D14) ;; GEORGIAN CAPITAL LETTER PHAR
+	  (?\u10B5 ?\u2D15) ;; GEORGIAN CAPITAL LETTER KHAR
+	  (?\u10B6 ?\u2D16) ;; GEORGIAN CAPITAL LETTER GHAN
+	  (?\u10B7 ?\u2D17) ;; GEORGIAN CAPITAL LETTER QAR
+	  (?\u10B8 ?\u2D18) ;; GEORGIAN CAPITAL LETTER SHIN
+	  (?\u10B9 ?\u2D19) ;; GEORGIAN CAPITAL LETTER CHIN
+	  (?\u10BA ?\u2D1A) ;; GEORGIAN CAPITAL LETTER CAN
+	  (?\u10BB ?\u2D1B) ;; GEORGIAN CAPITAL LETTER JIL
+	  (?\u10BC ?\u2D1C) ;; GEORGIAN CAPITAL LETTER CIL
+	  (?\u10BD ?\u2D1D) ;; GEORGIAN CAPITAL LETTER CHAR
+	  (?\u10BE ?\u2D1E) ;; GEORGIAN CAPITAL LETTER XAN
+	  (?\u10BF ?\u2D1F) ;; GEORGIAN CAPITAL LETTER JHAN
+	  (?\u10C0 ?\u2D20) ;; GEORGIAN CAPITAL LETTER HAE
+	  (?\u10C1 ?\u2D21) ;; GEORGIAN CAPITAL LETTER HE
+	  (?\u10C2 ?\u2D22) ;; GEORGIAN CAPITAL LETTER HIE
+	  (?\u10C3 ?\u2D23) ;; GEORGIAN CAPITAL LETTER WE
+	  (?\u10C4 ?\u2D24) ;; GEORGIAN CAPITAL LETTER HAR
+	  (?\u10C5 ?\u2D25) ;; GEORGIAN CAPITAL LETTER HOE
+	  (?\u1E00 ?\u1E01) ;; LATIN CAPITAL LETTER A WITH RING BELOW
+	  (?\u1E02 ?\u1E03) ;; LATIN CAPITAL LETTER B WITH DOT ABOVE
+	  (?\u1E04 ?\u1E05) ;; LATIN CAPITAL LETTER B WITH DOT BELOW
+	  (?\u1E06 ?\u1E07) ;; LATIN CAPITAL LETTER B WITH LINE BELOW
+	  (?\u1E08 ?\u1E09) ;; LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+	  (?\u1E0A ?\u1E0B) ;; LATIN CAPITAL LETTER D WITH DOT ABOVE
+	  (?\u1E0C ?\u1E0D) ;; LATIN CAPITAL LETTER D WITH DOT BELOW
+	  (?\u1E0E ?\u1E0F) ;; LATIN CAPITAL LETTER D WITH LINE BELOW
+	  (?\u1E10 ?\u1E11) ;; LATIN CAPITAL LETTER D WITH CEDILLA
+	  (?\u1E12 ?\u1E13) ;; LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
+	  (?\u1E14 ?\u1E15) ;; LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+	  (?\u1E16 ?\u1E17) ;; LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+	  (?\u1E18 ?\u1E19) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
+	  (?\u1E1A ?\u1E1B) ;; LATIN CAPITAL LETTER E WITH TILDE BELOW
+	  (?\u1E1C ?\u1E1D) ;; LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+	  (?\u1E1E ?\u1E1F) ;; LATIN CAPITAL LETTER F WITH DOT ABOVE
+	  (?\u1E20 ?\u1E21) ;; LATIN CAPITAL LETTER G WITH MACRON
+	  (?\u1E22 ?\u1E23) ;; LATIN CAPITAL LETTER H WITH DOT ABOVE
+	  (?\u1E24 ?\u1E25) ;; LATIN CAPITAL LETTER H WITH DOT BELOW
+	  (?\u1E26 ?\u1E27) ;; LATIN CAPITAL LETTER H WITH DIAERESIS
+	  (?\u1E28 ?\u1E29) ;; LATIN CAPITAL LETTER H WITH CEDILLA
+	  (?\u1E2A ?\u1E2B) ;; LATIN CAPITAL LETTER H WITH BREVE BELOW
+	  (?\u1E2C ?\u1E2D) ;; LATIN CAPITAL LETTER I WITH TILDE BELOW
+	  (?\u1E2E ?\u1E2F) ;; LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+	  (?\u1E30 ?\u1E31) ;; LATIN CAPITAL LETTER K WITH ACUTE
+	  (?\u1E32 ?\u1E33) ;; LATIN CAPITAL LETTER K WITH DOT BELOW
+	  (?\u1E34 ?\u1E35) ;; LATIN CAPITAL LETTER K WITH LINE BELOW
+	  (?\u1E36 ?\u1E37) ;; LATIN CAPITAL LETTER L WITH DOT BELOW
+	  (?\u1E38 ?\u1E39) ;; LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+	  (?\u1E3A ?\u1E3B) ;; LATIN CAPITAL LETTER L WITH LINE BELOW
+	  (?\u1E3C ?\u1E3D) ;; LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
+	  (?\u1E3E ?\u1E3F) ;; LATIN CAPITAL LETTER M WITH ACUTE
+	  (?\u1E40 ?\u1E41) ;; LATIN CAPITAL LETTER M WITH DOT ABOVE
+	  (?\u1E42 ?\u1E43) ;; LATIN CAPITAL LETTER M WITH DOT BELOW
+	  (?\u1E44 ?\u1E45) ;; LATIN CAPITAL LETTER N WITH DOT ABOVE
+	  (?\u1E46 ?\u1E47) ;; LATIN CAPITAL LETTER N WITH DOT BELOW
+	  (?\u1E48 ?\u1E49) ;; LATIN CAPITAL LETTER N WITH LINE BELOW
+	  (?\u1E4A ?\u1E4B) ;; LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
+	  (?\u1E4C ?\u1E4D) ;; LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+	  (?\u1E4E ?\u1E4F) ;; LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+	  (?\u1E50 ?\u1E51) ;; LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+	  (?\u1E52 ?\u1E53) ;; LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+	  (?\u1E54 ?\u1E55) ;; LATIN CAPITAL LETTER P WITH ACUTE
+	  (?\u1E56 ?\u1E57) ;; LATIN CAPITAL LETTER P WITH DOT ABOVE
+	  (?\u1E58 ?\u1E59) ;; LATIN CAPITAL LETTER R WITH DOT ABOVE
+	  (?\u1E5A ?\u1E5B) ;; LATIN CAPITAL LETTER R WITH DOT BELOW
+	  (?\u1E5C ?\u1E5D) ;; LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+	  (?\u1E5E ?\u1E5F) ;; LATIN CAPITAL LETTER R WITH LINE BELOW
+	  (?\u1E60 ?\u1E61) ;; LATIN CAPITAL LETTER S WITH DOT ABOVE
+	  (?\u1E62 ?\u1E63) ;; LATIN CAPITAL LETTER S WITH DOT BELOW
+	  (?\u1E64 ?\u1E65) ;; LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+	  (?\u1E66 ?\u1E67) ;; LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+	  (?\u1E68 ?\u1E69) ;; LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+	  (?\u1E6A ?\u1E6B) ;; LATIN CAPITAL LETTER T WITH DOT ABOVE
+	  (?\u1E6C ?\u1E6D) ;; LATIN CAPITAL LETTER T WITH DOT BELOW
+	  (?\u1E6E ?\u1E6F) ;; LATIN CAPITAL LETTER T WITH LINE BELOW
+	  (?\u1E70 ?\u1E71) ;; LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
+	  (?\u1E72 ?\u1E73) ;; LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
+	  (?\u1E74 ?\u1E75) ;; LATIN CAPITAL LETTER U WITH TILDE BELOW
+	  (?\u1E76 ?\u1E77) ;; LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
+	  (?\u1E78 ?\u1E79) ;; LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+	  (?\u1E7A ?\u1E7B) ;; LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+	  (?\u1E7C ?\u1E7D) ;; LATIN CAPITAL LETTER V WITH TILDE
+	  (?\u1E7E ?\u1E7F) ;; LATIN CAPITAL LETTER V WITH DOT BELOW
+	  (?\u1E80 ?\u1E81) ;; LATIN CAPITAL LETTER W WITH GRAVE
+	  (?\u1E82 ?\u1E83) ;; LATIN CAPITAL LETTER W WITH ACUTE
+	  (?\u1E84 ?\u1E85) ;; LATIN CAPITAL LETTER W WITH DIAERESIS
+	  (?\u1E86 ?\u1E87) ;; LATIN CAPITAL LETTER W WITH DOT ABOVE
+	  (?\u1E88 ?\u1E89) ;; LATIN CAPITAL LETTER W WITH DOT BELOW
+	  (?\u1E8A ?\u1E8B) ;; LATIN CAPITAL LETTER X WITH DOT ABOVE
+	  (?\u1E8C ?\u1E8D) ;; LATIN CAPITAL LETTER X WITH DIAERESIS
+	  (?\u1E8E ?\u1E8F) ;; LATIN CAPITAL LETTER Y WITH DOT ABOVE
+	  (?\u1E90 ?\u1E91) ;; LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
+	  (?\u1E92 ?\u1E93) ;; LATIN CAPITAL LETTER Z WITH DOT BELOW
+	  (?\u1E94 ?\u1E95) ;; LATIN CAPITAL LETTER Z WITH LINE BELOW
+;;; WARNING: Unhandled full mapping:
+;;;   1E96; F; 0068 0331; # LATIN SMALL LETTER H WITH LINE BELOW
+;;; WARNING: Unhandled full mapping:
+;;;   1E97; F; 0074 0308; # LATIN SMALL LETTER T WITH DIAERESIS
+;;; WARNING: Unhandled full mapping:
+;;;   1E98; F; 0077 030A; # LATIN SMALL LETTER W WITH RING ABOVE
+;;; WARNING: Unhandled full mapping:
+;;;   1E99; F; 0079 030A; # LATIN SMALL LETTER Y WITH RING ABOVE
+;;; WARNING: Unhandled full mapping:
+;;;   1E9A; F; 0061 02BE; # LATIN SMALL LETTER A WITH RIGHT HALF RING
+	  (?\u1E9B ?\u1E61) ;; LATIN SMALL LETTER LONG S WITH DOT ABOVE
+;;; WARNING: Unhandled full mapping:
+;;;   1E9E; F; 0073 0073; # LATIN CAPITAL LETTER SHARP S
+	  (?\u1E9E ?\u00DF) ;; LATIN CAPITAL LETTER SHARP S
+	  (?\u1EA0 ?\u1EA1) ;; LATIN CAPITAL LETTER A WITH DOT BELOW
+	  (?\u1EA2 ?\u1EA3) ;; LATIN CAPITAL LETTER A WITH HOOK ABOVE
+	  (?\u1EA4 ?\u1EA5) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+	  (?\u1EA6 ?\u1EA7) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+	  (?\u1EA8 ?\u1EA9) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+	  (?\u1EAA ?\u1EAB) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+	  (?\u1EAC ?\u1EAD) ;; LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+	  (?\u1EAE ?\u1EAF) ;; LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+	  (?\u1EB0 ?\u1EB1) ;; LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+	  (?\u1EB2 ?\u1EB3) ;; LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+	  (?\u1EB4 ?\u1EB5) ;; LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+	  (?\u1EB6 ?\u1EB7) ;; LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+	  (?\u1EB8 ?\u1EB9) ;; LATIN CAPITAL LETTER E WITH DOT BELOW
+	  (?\u1EBA ?\u1EBB) ;; LATIN CAPITAL LETTER E WITH HOOK ABOVE
+	  (?\u1EBC ?\u1EBD) ;; LATIN CAPITAL LETTER E WITH TILDE
+	  (?\u1EBE ?\u1EBF) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+	  (?\u1EC0 ?\u1EC1) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+	  (?\u1EC2 ?\u1EC3) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+	  (?\u1EC4 ?\u1EC5) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+	  (?\u1EC6 ?\u1EC7) ;; LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+	  (?\u1EC8 ?\u1EC9) ;; LATIN CAPITAL LETTER I WITH HOOK ABOVE
+	  (?\u1ECA ?\u1ECB) ;; LATIN CAPITAL LETTER I WITH DOT BELOW
+	  (?\u1ECC ?\u1ECD) ;; LATIN CAPITAL LETTER O WITH DOT BELOW
+	  (?\u1ECE ?\u1ECF) ;; LATIN CAPITAL LETTER O WITH HOOK ABOVE
+	  (?\u1ED0 ?\u1ED1) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+	  (?\u1ED2 ?\u1ED3) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+	  (?\u1ED4 ?\u1ED5) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+	  (?\u1ED6 ?\u1ED7) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+	  (?\u1ED8 ?\u1ED9) ;; LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+	  (?\u1EDA ?\u1EDB) ;; LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+	  (?\u1EDC ?\u1EDD) ;; LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+	  (?\u1EDE ?\u1EDF) ;; LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+	  (?\u1EE0 ?\u1EE1) ;; LATIN CAPITAL LETTER O WITH HORN AND TILDE
+	  (?\u1EE2 ?\u1EE3) ;; LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+	  (?\u1EE4 ?\u1EE5) ;; LATIN CAPITAL LETTER U WITH DOT BELOW
+	  (?\u1EE6 ?\u1EE7) ;; LATIN CAPITAL LETTER U WITH HOOK ABOVE
+	  (?\u1EE8 ?\u1EE9) ;; LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+	  (?\u1EEA ?\u1EEB) ;; LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+	  (?\u1EEC ?\u1EED) ;; LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+	  (?\u1EEE ?\u1EEF) ;; LATIN CAPITAL LETTER U WITH HORN AND TILDE
+	  (?\u1EF0 ?\u1EF1) ;; LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+	  (?\u1EF2 ?\u1EF3) ;; LATIN CAPITAL LETTER Y WITH GRAVE
+	  (?\u1EF4 ?\u1EF5) ;; LATIN CAPITAL LETTER Y WITH DOT BELOW
+	  (?\u1EF6 ?\u1EF7) ;; LATIN CAPITAL LETTER Y WITH HOOK ABOVE
+	  (?\u1EF8 ?\u1EF9) ;; LATIN CAPITAL LETTER Y WITH TILDE
+	  (?\u1EFA ?\u1EFB) ;; LATIN CAPITAL LETTER MIDDLE-WELSH LL
+	  (?\u1EFC ?\u1EFD) ;; LATIN CAPITAL LETTER MIDDLE-WELSH V
+	  (?\u1EFE ?\u1EFF) ;; LATIN CAPITAL LETTER Y WITH LOOP
+	  (?\u1F08 ?\u1F00) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI
+	  (?\u1F09 ?\u1F01) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA
+	  (?\u1F0A ?\u1F02) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+	  (?\u1F0B ?\u1F03) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+	  (?\u1F0C ?\u1F04) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+	  (?\u1F0D ?\u1F05) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+	  (?\u1F0E ?\u1F06) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+	  (?\u1F0F ?\u1F07) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+	  (?\u1F18 ?\u1F10) ;; GREEK CAPITAL LETTER EPSILON WITH PSILI
+	  (?\u1F19 ?\u1F11) ;; GREEK CAPITAL LETTER EPSILON WITH DASIA
+	  (?\u1F1A ?\u1F12) ;; GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+	  (?\u1F1B ?\u1F13) ;; GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+	  (?\u1F1C ?\u1F14) ;; GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+	  (?\u1F1D ?\u1F15) ;; GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+	  (?\u1F28 ?\u1F20) ;; GREEK CAPITAL LETTER ETA WITH PSILI
+	  (?\u1F29 ?\u1F21) ;; GREEK CAPITAL LETTER ETA WITH DASIA
+	  (?\u1F2A ?\u1F22) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+	  (?\u1F2B ?\u1F23) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+	  (?\u1F2C ?\u1F24) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+	  (?\u1F2D ?\u1F25) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+	  (?\u1F2E ?\u1F26) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+	  (?\u1F2F ?\u1F27) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+	  (?\u1F38 ?\u1F30) ;; GREEK CAPITAL LETTER IOTA WITH PSILI
+	  (?\u1F39 ?\u1F31) ;; GREEK CAPITAL LETTER IOTA WITH DASIA
+	  (?\u1F3A ?\u1F32) ;; GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+	  (?\u1F3B ?\u1F33) ;; GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+	  (?\u1F3C ?\u1F34) ;; GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+	  (?\u1F3D ?\u1F35) ;; GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+	  (?\u1F3E ?\u1F36) ;; GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+	  (?\u1F3F ?\u1F37) ;; GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+	  (?\u1F48 ?\u1F40) ;; GREEK CAPITAL LETTER OMICRON WITH PSILI
+	  (?\u1F49 ?\u1F41) ;; GREEK CAPITAL LETTER OMICRON WITH DASIA
+	  (?\u1F4A ?\u1F42) ;; GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+	  (?\u1F4B ?\u1F43) ;; GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+	  (?\u1F4C ?\u1F44) ;; GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+	  (?\u1F4D ?\u1F45) ;; GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1F50; F; 03C5 0313; # GREEK SMALL LETTER UPSILON WITH PSILI
+;;; WARNING: Unhandled full mapping:
+;;;   1F52; F; 03C5 0313 0300; # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+;;; WARNING: Unhandled full mapping:
+;;;   1F54; F; 03C5 0313 0301; # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1F56; F; 03C5 0313 0342; # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+	  (?\u1F59 ?\u1F51) ;; GREEK CAPITAL LETTER UPSILON WITH DASIA
+	  (?\u1F5B ?\u1F53) ;; GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+	  (?\u1F5D ?\u1F55) ;; GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+	  (?\u1F5F ?\u1F57) ;; GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+	  (?\u1F68 ?\u1F60) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI
+	  (?\u1F69 ?\u1F61) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA
+	  (?\u1F6A ?\u1F62) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+	  (?\u1F6B ?\u1F63) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+	  (?\u1F6C ?\u1F64) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+	  (?\u1F6D ?\u1F65) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+	  (?\u1F6E ?\u1F66) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+	  (?\u1F6F ?\u1F67) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F80; F; 1F00 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F81; F; 1F01 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F82; F; 1F02 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F83; F; 1F03 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F84; F; 1F04 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F85; F; 1F05 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F86; F; 1F06 03B9; # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F87; F; 1F07 03B9; # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F88; F; 1F00 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+	  (?\u1F88 ?\u1F80) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F89; F; 1F01 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+	  (?\u1F89 ?\u1F81) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F8A; F; 1F02 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+	  (?\u1F8A ?\u1F82) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F8B; F; 1F03 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+	  (?\u1F8B ?\u1F83) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F8C; F; 1F04 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+	  (?\u1F8C ?\u1F84) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F8D; F; 1F05 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+	  (?\u1F8D ?\u1F85) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F8E; F; 1F06 03B9; # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+	  (?\u1F8E ?\u1F86) ;; GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F8F; F; 1F07 03B9; # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+	  (?\u1F8F ?\u1F87) ;; GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F90; F; 1F20 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F91; F; 1F21 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F92; F; 1F22 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F93; F; 1F23 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F94; F; 1F24 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F95; F; 1F25 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F96; F; 1F26 03B9; # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F97; F; 1F27 03B9; # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F98; F; 1F20 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+	  (?\u1F98 ?\u1F90) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F99; F; 1F21 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+	  (?\u1F99 ?\u1F91) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F9A; F; 1F22 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+	  (?\u1F9A ?\u1F92) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F9B; F; 1F23 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+	  (?\u1F9B ?\u1F93) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F9C; F; 1F24 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+	  (?\u1F9C ?\u1F94) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F9D; F; 1F25 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+	  (?\u1F9D ?\u1F95) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F9E; F; 1F26 03B9; # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+	  (?\u1F9E ?\u1F96) ;; GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1F9F; F; 1F27 03B9; # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+	  (?\u1F9F ?\u1F97) ;; GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA0; F; 1F60 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA1; F; 1F61 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA2; F; 1F62 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA3; F; 1F63 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA4; F; 1F64 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA5; F; 1F65 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA6; F; 1F66 03B9; # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA7; F; 1F67 03B9; # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA8; F; 1F60 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+	  (?\u1FA8 ?\u1FA0) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FA9; F; 1F61 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+	  (?\u1FA9 ?\u1FA1) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FAA; F; 1F62 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+	  (?\u1FAA ?\u1FA2) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FAB; F; 1F63 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+	  (?\u1FAB ?\u1FA3) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FAC; F; 1F64 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+	  (?\u1FAC ?\u1FA4) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FAD; F; 1F65 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+	  (?\u1FAD ?\u1FA5) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FAE; F; 1F66 03B9; # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+	  (?\u1FAE ?\u1FA6) ;; GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FAF; F; 1F67 03B9; # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+	  (?\u1FAF ?\u1FA7) ;; GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FB2; F; 1F70 03B9; # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FB3; F; 03B1 03B9; # GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FB4; F; 03AC 03B9; # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FB6; F; 03B1 0342; # GREEK SMALL LETTER ALPHA WITH PERISPOMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FB7; F; 03B1 0342 03B9; # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+	  (?\u1FB8 ?\u1FB0) ;; GREEK CAPITAL LETTER ALPHA WITH VRACHY
+	  (?\u1FB9 ?\u1FB1) ;; GREEK CAPITAL LETTER ALPHA WITH MACRON
+	  (?\u1FBA ?\u1F70) ;; GREEK CAPITAL LETTER ALPHA WITH VARIA
+	  (?\u1FBB ?\u1F71) ;; GREEK CAPITAL LETTER ALPHA WITH OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FBC; F; 03B1 03B9; # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+	  (?\u1FBC ?\u1FB3) ;; GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+	  (?\u1FBE ?\u03B9) ;; GREEK PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FC2; F; 1F74 03B9; # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FC3; F; 03B7 03B9; # GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FC4; F; 03AE 03B9; # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FC6; F; 03B7 0342; # GREEK SMALL LETTER ETA WITH PERISPOMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FC7; F; 03B7 0342 03B9; # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+	  (?\u1FC8 ?\u1F72) ;; GREEK CAPITAL LETTER EPSILON WITH VARIA
+	  (?\u1FC9 ?\u1F73) ;; GREEK CAPITAL LETTER EPSILON WITH OXIA
+	  (?\u1FCA ?\u1F74) ;; GREEK CAPITAL LETTER ETA WITH VARIA
+	  (?\u1FCB ?\u1F75) ;; GREEK CAPITAL LETTER ETA WITH OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FCC; F; 03B7 03B9; # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+	  (?\u1FCC ?\u1FC3) ;; GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FD2; F; 03B9 0308 0300; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FD3; F; 03B9 0308 0301; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FD6; F; 03B9 0342; # GREEK SMALL LETTER IOTA WITH PERISPOMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FD7; F; 03B9 0308 0342; # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+	  (?\u1FD8 ?\u1FD0) ;; GREEK CAPITAL LETTER IOTA WITH VRACHY
+	  (?\u1FD9 ?\u1FD1) ;; GREEK CAPITAL LETTER IOTA WITH MACRON
+	  (?\u1FDA ?\u1F76) ;; GREEK CAPITAL LETTER IOTA WITH VARIA
+	  (?\u1FDB ?\u1F77) ;; GREEK CAPITAL LETTER IOTA WITH OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FE2; F; 03C5 0308 0300; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FE3; F; 03C5 0308 0301; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FE4; F; 03C1 0313; # GREEK SMALL LETTER RHO WITH PSILI
+;;; WARNING: Unhandled full mapping:
+;;;   1FE6; F; 03C5 0342; # GREEK SMALL LETTER UPSILON WITH PERISPOMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FE7; F; 03C5 0308 0342; # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+	  (?\u1FE8 ?\u1FE0) ;; GREEK CAPITAL LETTER UPSILON WITH VRACHY
+	  (?\u1FE9 ?\u1FE1) ;; GREEK CAPITAL LETTER UPSILON WITH MACRON
+	  (?\u1FEA ?\u1F7A) ;; GREEK CAPITAL LETTER UPSILON WITH VARIA
+	  (?\u1FEB ?\u1F7B) ;; GREEK CAPITAL LETTER UPSILON WITH OXIA
+	  (?\u1FEC ?\u1FE5) ;; GREEK CAPITAL LETTER RHO WITH DASIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FF2; F; 1F7C 03B9; # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FF3; F; 03C9 03B9; # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FF4; F; 03CE 03B9; # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FF6; F; 03C9 0342; # GREEK SMALL LETTER OMEGA WITH PERISPOMENI
+;;; WARNING: Unhandled full mapping:
+;;;   1FF7; F; 03C9 0342 03B9; # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+	  (?\u1FF8 ?\u1F78) ;; GREEK CAPITAL LETTER OMICRON WITH VARIA
+	  (?\u1FF9 ?\u1F79) ;; GREEK CAPITAL LETTER OMICRON WITH OXIA
+	  (?\u1FFA ?\u1F7C) ;; GREEK CAPITAL LETTER OMEGA WITH VARIA
+	  (?\u1FFB ?\u1F7D) ;; GREEK CAPITAL LETTER OMEGA WITH OXIA
+;;; WARNING: Unhandled full mapping:
+;;;   1FFC; F; 03C9 03B9; # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+	  (?\u1FFC ?\u1FF3) ;; GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+	  (?\u2126 ?\u03C9) ;; OHM SIGN
+	  (?\u212A ?\u006B) ;; KELVIN SIGN
+	  (?\u212B ?\u00E5) ;; ANGSTROM SIGN
+	  (?\u2132 ?\u214E) ;; TURNED CAPITAL F
+	  (?\u2160 ?\u2170) ;; ROMAN NUMERAL ONE
+	  (?\u2161 ?\u2171) ;; ROMAN NUMERAL TWO
+	  (?\u2162 ?\u2172) ;; ROMAN NUMERAL THREE
+	  (?\u2163 ?\u2173) ;; ROMAN NUMERAL FOUR
+	  (?\u2164 ?\u2174) ;; ROMAN NUMERAL FIVE
+	  (?\u2165 ?\u2175) ;; ROMAN NUMERAL SIX
+	  (?\u2166 ?\u2176) ;; ROMAN NUMERAL SEVEN
+	  (?\u2167 ?\u2177) ;; ROMAN NUMERAL EIGHT
+	  (?\u2168 ?\u2178) ;; ROMAN NUMERAL NINE
+	  (?\u2169 ?\u2179) ;; ROMAN NUMERAL TEN
+	  (?\u216A ?\u217A) ;; ROMAN NUMERAL ELEVEN
+	  (?\u216B ?\u217B) ;; ROMAN NUMERAL TWELVE
+	  (?\u216C ?\u217C) ;; ROMAN NUMERAL FIFTY
+	  (?\u216D ?\u217D) ;; ROMAN NUMERAL ONE HUNDRED
+	  (?\u216E ?\u217E) ;; ROMAN NUMERAL FIVE HUNDRED
+	  (?\u216F ?\u217F) ;; ROMAN NUMERAL ONE THOUSAND
+	  (?\u2183 ?\u2184) ;; ROMAN NUMERAL REVERSED ONE HUNDRED
+	  (?\u24B6 ?\u24D0) ;; CIRCLED LATIN CAPITAL LETTER A
+	  (?\u24B7 ?\u24D1) ;; CIRCLED LATIN CAPITAL LETTER B
+	  (?\u24B8 ?\u24D2) ;; CIRCLED LATIN CAPITAL LETTER C
+	  (?\u24B9 ?\u24D3) ;; CIRCLED LATIN CAPITAL LETTER D
+	  (?\u24BA ?\u24D4) ;; CIRCLED LATIN CAPITAL LETTER E
+	  (?\u24BB ?\u24D5) ;; CIRCLED LATIN CAPITAL LETTER F
+	  (?\u24BC ?\u24D6) ;; CIRCLED LATIN CAPITAL LETTER G
+	  (?\u24BD ?\u24D7) ;; CIRCLED LATIN CAPITAL LETTER H
+	  (?\u24BE ?\u24D8) ;; CIRCLED LATIN CAPITAL LETTER I
+	  (?\u24BF ?\u24D9) ;; CIRCLED LATIN CAPITAL LETTER J
+	  (?\u24C0 ?\u24DA) ;; CIRCLED LATIN CAPITAL LETTER K
+	  (?\u24C1 ?\u24DB) ;; CIRCLED LATIN CAPITAL LETTER L
+	  (?\u24C2 ?\u24DC) ;; CIRCLED LATIN CAPITAL LETTER M
+	  (?\u24C3 ?\u24DD) ;; CIRCLED LATIN CAPITAL LETTER N
+	  (?\u24C4 ?\u24DE) ;; CIRCLED LATIN CAPITAL LETTER O
+	  (?\u24C5 ?\u24DF) ;; CIRCLED LATIN CAPITAL LETTER P
+	  (?\u24C6 ?\u24E0) ;; CIRCLED LATIN CAPITAL LETTER Q
+	  (?\u24C7 ?\u24E1) ;; CIRCLED LATIN CAPITAL LETTER R
+	  (?\u24C8 ?\u24E2) ;; CIRCLED LATIN CAPITAL LETTER S
+	  (?\u24C9 ?\u24E3) ;; CIRCLED LATIN CAPITAL LETTER T
+	  (?\u24CA ?\u24E4) ;; CIRCLED LATIN CAPITAL LETTER U
+	  (?\u24CB ?\u24E5) ;; CIRCLED LATIN CAPITAL LETTER V
+	  (?\u24CC ?\u24E6) ;; CIRCLED LATIN CAPITAL LETTER W
+	  (?\u24CD ?\u24E7) ;; CIRCLED LATIN CAPITAL LETTER X
+	  (?\u24CE ?\u24E8) ;; CIRCLED LATIN CAPITAL LETTER Y
+	  (?\u24CF ?\u24E9) ;; CIRCLED LATIN CAPITAL LETTER Z
+	  (?\u2C00 ?\u2C30) ;; GLAGOLITIC CAPITAL LETTER AZU
+	  (?\u2C01 ?\u2C31) ;; GLAGOLITIC CAPITAL LETTER BUKY
+	  (?\u2C02 ?\u2C32) ;; GLAGOLITIC CAPITAL LETTER VEDE
+	  (?\u2C03 ?\u2C33) ;; GLAGOLITIC CAPITAL LETTER GLAGOLI
+	  (?\u2C04 ?\u2C34) ;; GLAGOLITIC CAPITAL LETTER DOBRO
+	  (?\u2C05 ?\u2C35) ;; GLAGOLITIC CAPITAL LETTER YESTU
+	  (?\u2C06 ?\u2C36) ;; GLAGOLITIC CAPITAL LETTER ZHIVETE
+	  (?\u2C07 ?\u2C37) ;; GLAGOLITIC CAPITAL LETTER DZELO
+	  (?\u2C08 ?\u2C38) ;; GLAGOLITIC CAPITAL LETTER ZEMLJA
+	  (?\u2C09 ?\u2C39) ;; GLAGOLITIC CAPITAL LETTER IZHE
+	  (?\u2C0A ?\u2C3A) ;; GLAGOLITIC CAPITAL LETTER INITIAL IZHE
+	  (?\u2C0B ?\u2C3B) ;; GLAGOLITIC CAPITAL LETTER I
+	  (?\u2C0C ?\u2C3C) ;; GLAGOLITIC CAPITAL LETTER DJERVI
+	  (?\u2C0D ?\u2C3D) ;; GLAGOLITIC CAPITAL LETTER KAKO
+	  (?\u2C0E ?\u2C3E) ;; GLAGOLITIC CAPITAL LETTER LJUDIJE
+	  (?\u2C0F ?\u2C3F) ;; GLAGOLITIC CAPITAL LETTER MYSLITE
+	  (?\u2C10 ?\u2C40) ;; GLAGOLITIC CAPITAL LETTER NASHI
+	  (?\u2C11 ?\u2C41) ;; GLAGOLITIC CAPITAL LETTER ONU
+	  (?\u2C12 ?\u2C42) ;; GLAGOLITIC CAPITAL LETTER POKOJI
+	  (?\u2C13 ?\u2C43) ;; GLAGOLITIC CAPITAL LETTER RITSI
+	  (?\u2C14 ?\u2C44) ;; GLAGOLITIC CAPITAL LETTER SLOVO
+	  (?\u2C15 ?\u2C45) ;; GLAGOLITIC CAPITAL LETTER TVRIDO
+	  (?\u2C16 ?\u2C46) ;; GLAGOLITIC CAPITAL LETTER UKU
+	  (?\u2C17 ?\u2C47) ;; GLAGOLITIC CAPITAL LETTER FRITU
+	  (?\u2C18 ?\u2C48) ;; GLAGOLITIC CAPITAL LETTER HERU
+	  (?\u2C19 ?\u2C49) ;; GLAGOLITIC CAPITAL LETTER OTU
+	  (?\u2C1A ?\u2C4A) ;; GLAGOLITIC CAPITAL LETTER PE
+	  (?\u2C1B ?\u2C4B) ;; GLAGOLITIC CAPITAL LETTER SHTA
+	  (?\u2C1C ?\u2C4C) ;; GLAGOLITIC CAPITAL LETTER TSI
+	  (?\u2C1D ?\u2C4D) ;; GLAGOLITIC CAPITAL LETTER CHRIVI
+	  (?\u2C1E ?\u2C4E) ;; GLAGOLITIC CAPITAL LETTER SHA
+	  (?\u2C1F ?\u2C4F) ;; GLAGOLITIC CAPITAL LETTER YERU
+	  (?\u2C20 ?\u2C50) ;; GLAGOLITIC CAPITAL LETTER YERI
+	  (?\u2C21 ?\u2C51) ;; GLAGOLITIC CAPITAL LETTER YATI
+	  (?\u2C22 ?\u2C52) ;; GLAGOLITIC CAPITAL LETTER SPIDERY HA
+	  (?\u2C23 ?\u2C53) ;; GLAGOLITIC CAPITAL LETTER YU
+	  (?\u2C24 ?\u2C54) ;; GLAGOLITIC CAPITAL LETTER SMALL YUS
+	  (?\u2C25 ?\u2C55) ;; GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL
+	  (?\u2C26 ?\u2C56) ;; GLAGOLITIC CAPITAL LETTER YO
+	  (?\u2C27 ?\u2C57) ;; GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS
+	  (?\u2C28 ?\u2C58) ;; GLAGOLITIC CAPITAL LETTER BIG YUS
+	  (?\u2C29 ?\u2C59) ;; GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS
+	  (?\u2C2A ?\u2C5A) ;; GLAGOLITIC CAPITAL LETTER FITA
+	  (?\u2C2B ?\u2C5B) ;; GLAGOLITIC CAPITAL LETTER IZHITSA
+	  (?\u2C2C ?\u2C5C) ;; GLAGOLITIC CAPITAL LETTER SHTAPIC
+	  (?\u2C2D ?\u2C5D) ;; GLAGOLITIC CAPITAL LETTER TROKUTASTI A
+	  (?\u2C2E ?\u2C5E) ;; GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE
+	  (?\u2C60 ?\u2C61) ;; LATIN CAPITAL LETTER L WITH DOUBLE BAR
+	  (?\u2C62 ?\u026B) ;; LATIN CAPITAL LETTER L WITH MIDDLE TILDE
+	  (?\u2C63 ?\u1D7D) ;; LATIN CAPITAL LETTER P WITH STROKE
+	  (?\u2C64 ?\u027D) ;; LATIN CAPITAL LETTER R WITH TAIL
+	  (?\u2C67 ?\u2C68) ;; LATIN CAPITAL LETTER H WITH DESCENDER
+	  (?\u2C69 ?\u2C6A) ;; LATIN CAPITAL LETTER K WITH DESCENDER
+	  (?\u2C6B ?\u2C6C) ;; LATIN CAPITAL LETTER Z WITH DESCENDER
+	  (?\u2C6D ?\u0251) ;; LATIN CAPITAL LETTER ALPHA
+	  (?\u2C6E ?\u0271) ;; LATIN CAPITAL LETTER M WITH HOOK
+	  (?\u2C6F ?\u0250) ;; LATIN CAPITAL LETTER TURNED A
+	  (?\u2C70 ?\u0252) ;; LATIN CAPITAL LETTER TURNED ALPHA
+	  (?\u2C72 ?\u2C73) ;; LATIN CAPITAL LETTER W WITH HOOK
+	  (?\u2C75 ?\u2C76) ;; LATIN CAPITAL LETTER HALF H
+	  (?\u2C7E ?\u023F) ;; LATIN CAPITAL LETTER S WITH SWASH TAIL
+	  (?\u2C7F ?\u0240) ;; LATIN CAPITAL LETTER Z WITH SWASH TAIL
+	  (?\u2C80 ?\u2C81) ;; COPTIC CAPITAL LETTER ALFA
+	  (?\u2C82 ?\u2C83) ;; COPTIC CAPITAL LETTER VIDA
+	  (?\u2C84 ?\u2C85) ;; COPTIC CAPITAL LETTER GAMMA
+	  (?\u2C86 ?\u2C87) ;; COPTIC CAPITAL LETTER DALDA
+	  (?\u2C88 ?\u2C89) ;; COPTIC CAPITAL LETTER EIE
+	  (?\u2C8A ?\u2C8B) ;; COPTIC CAPITAL LETTER SOU
+	  (?\u2C8C ?\u2C8D) ;; COPTIC CAPITAL LETTER ZATA
+	  (?\u2C8E ?\u2C8F) ;; COPTIC CAPITAL LETTER HATE
+	  (?\u2C90 ?\u2C91) ;; COPTIC CAPITAL LETTER THETHE
+	  (?\u2C92 ?\u2C93) ;; COPTIC CAPITAL LETTER IAUDA
+	  (?\u2C94 ?\u2C95) ;; COPTIC CAPITAL LETTER KAPA
+	  (?\u2C96 ?\u2C97) ;; COPTIC CAPITAL LETTER LAULA
+	  (?\u2C98 ?\u2C99) ;; COPTIC CAPITAL LETTER MI
+	  (?\u2C9A ?\u2C9B) ;; COPTIC CAPITAL LETTER NI
+	  (?\u2C9C ?\u2C9D) ;; COPTIC CAPITAL LETTER KSI
+	  (?\u2C9E ?\u2C9F) ;; COPTIC CAPITAL LETTER O
+	  (?\u2CA0 ?\u2CA1) ;; COPTIC CAPITAL LETTER PI
+	  (?\u2CA2 ?\u2CA3) ;; COPTIC CAPITAL LETTER RO
+	  (?\u2CA4 ?\u2CA5) ;; COPTIC CAPITAL LETTER SIMA
+	  (?\u2CA6 ?\u2CA7) ;; COPTIC CAPITAL LETTER TAU
+	  (?\u2CA8 ?\u2CA9) ;; COPTIC CAPITAL LETTER UA
+	  (?\u2CAA ?\u2CAB) ;; COPTIC CAPITAL LETTER FI
+	  (?\u2CAC ?\u2CAD) ;; COPTIC CAPITAL LETTER KHI
+	  (?\u2CAE ?\u2CAF) ;; COPTIC CAPITAL LETTER PSI
+	  (?\u2CB0 ?\u2CB1) ;; COPTIC CAPITAL LETTER OOU
+	  (?\u2CB2 ?\u2CB3) ;; COPTIC CAPITAL LETTER DIALECT-P ALEF
+	  (?\u2CB4 ?\u2CB5) ;; COPTIC CAPITAL LETTER OLD COPTIC AIN
+	  (?\u2CB6 ?\u2CB7) ;; COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE
+	  (?\u2CB8 ?\u2CB9) ;; COPTIC CAPITAL LETTER DIALECT-P KAPA
+	  (?\u2CBA ?\u2CBB) ;; COPTIC CAPITAL LETTER DIALECT-P NI
+	  (?\u2CBC ?\u2CBD) ;; COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI
+	  (?\u2CBE ?\u2CBF) ;; COPTIC CAPITAL LETTER OLD COPTIC OOU
+	  (?\u2CC0 ?\u2CC1) ;; COPTIC CAPITAL LETTER SAMPI
+	  (?\u2CC2 ?\u2CC3) ;; COPTIC CAPITAL LETTER CROSSED SHEI
+	  (?\u2CC4 ?\u2CC5) ;; COPTIC CAPITAL LETTER OLD COPTIC SHEI
+	  (?\u2CC6 ?\u2CC7) ;; COPTIC CAPITAL LETTER OLD COPTIC ESH
+	  (?\u2CC8 ?\u2CC9) ;; COPTIC CAPITAL LETTER AKHMIMIC KHEI
+	  (?\u2CCA ?\u2CCB) ;; COPTIC CAPITAL LETTER DIALECT-P HORI
+	  (?\u2CCC ?\u2CCD) ;; COPTIC CAPITAL LETTER OLD COPTIC HORI
+	  (?\u2CCE ?\u2CCF) ;; COPTIC CAPITAL LETTER OLD COPTIC HA
+	  (?\u2CD0 ?\u2CD1) ;; COPTIC CAPITAL LETTER L-SHAPED HA
+	  (?\u2CD2 ?\u2CD3) ;; COPTIC CAPITAL LETTER OLD COPTIC HEI
+	  (?\u2CD4 ?\u2CD5) ;; COPTIC CAPITAL LETTER OLD COPTIC HAT
+	  (?\u2CD6 ?\u2CD7) ;; COPTIC CAPITAL LETTER OLD COPTIC GANGIA
+	  (?\u2CD8 ?\u2CD9) ;; COPTIC CAPITAL LETTER OLD COPTIC DJA
+	  (?\u2CDA ?\u2CDB) ;; COPTIC CAPITAL LETTER OLD COPTIC SHIMA
+	  (?\u2CDC ?\u2CDD) ;; COPTIC CAPITAL LETTER OLD NUBIAN SHIMA
+	  (?\u2CDE ?\u2CDF) ;; COPTIC CAPITAL LETTER OLD NUBIAN NGI
+	  (?\u2CE0 ?\u2CE1) ;; COPTIC CAPITAL LETTER OLD NUBIAN NYI
+	  (?\u2CE2 ?\u2CE3) ;; COPTIC CAPITAL LETTER OLD NUBIAN WAU
+	  (?\u2CEB ?\u2CEC) ;; COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI
+	  (?\u2CED ?\u2CEE) ;; COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA
+	  (?\uA640 ?\uA641) ;; CYRILLIC CAPITAL LETTER ZEMLYA
+	  (?\uA642 ?\uA643) ;; CYRILLIC CAPITAL LETTER DZELO
+	  (?\uA644 ?\uA645) ;; CYRILLIC CAPITAL LETTER REVERSED DZE
+	  (?\uA646 ?\uA647) ;; CYRILLIC CAPITAL LETTER IOTA
+	  (?\uA648 ?\uA649) ;; CYRILLIC CAPITAL LETTER DJERV
+	  (?\uA64A ?\uA64B) ;; CYRILLIC CAPITAL LETTER MONOGRAPH UK
+	  (?\uA64C ?\uA64D) ;; CYRILLIC CAPITAL LETTER BROAD OMEGA
+	  (?\uA64E ?\uA64F) ;; CYRILLIC CAPITAL LETTER NEUTRAL YER
+	  (?\uA650 ?\uA651) ;; CYRILLIC CAPITAL LETTER YERU WITH BACK YER
+	  (?\uA652 ?\uA653) ;; CYRILLIC CAPITAL LETTER IOTIFIED YAT
+	  (?\uA654 ?\uA655) ;; CYRILLIC CAPITAL LETTER REVERSED YU
+	  (?\uA656 ?\uA657) ;; CYRILLIC CAPITAL LETTER IOTIFIED A
+	  (?\uA658 ?\uA659) ;; CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS
+	  (?\uA65A ?\uA65B) ;; CYRILLIC CAPITAL LETTER BLENDED YUS
+	  (?\uA65C ?\uA65D) ;; CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS
+	  (?\uA65E ?\uA65F) ;; CYRILLIC CAPITAL LETTER YN
+	  (?\uA662 ?\uA663) ;; CYRILLIC CAPITAL LETTER SOFT DE
+	  (?\uA664 ?\uA665) ;; CYRILLIC CAPITAL LETTER SOFT EL
+	  (?\uA666 ?\uA667) ;; CYRILLIC CAPITAL LETTER SOFT EM
+	  (?\uA668 ?\uA669) ;; CYRILLIC CAPITAL LETTER MONOCULAR O
+	  (?\uA66A ?\uA66B) ;; CYRILLIC CAPITAL LETTER BINOCULAR O
+	  (?\uA66C ?\uA66D) ;; CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O
+	  (?\uA680 ?\uA681) ;; CYRILLIC CAPITAL LETTER DWE
+	  (?\uA682 ?\uA683) ;; CYRILLIC CAPITAL LETTER DZWE
+	  (?\uA684 ?\uA685) ;; CYRILLIC CAPITAL LETTER ZHWE
+	  (?\uA686 ?\uA687) ;; CYRILLIC CAPITAL LETTER CCHE
+	  (?\uA688 ?\uA689) ;; CYRILLIC CAPITAL LETTER DZZE
+	  (?\uA68A ?\uA68B) ;; CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK
+	  (?\uA68C ?\uA68D) ;; CYRILLIC CAPITAL LETTER TWE
+	  (?\uA68E ?\uA68F) ;; CYRILLIC CAPITAL LETTER TSWE
+	  (?\uA690 ?\uA691) ;; CYRILLIC CAPITAL LETTER TSSE
+	  (?\uA692 ?\uA693) ;; CYRILLIC CAPITAL LETTER TCHE
+	  (?\uA694 ?\uA695) ;; CYRILLIC CAPITAL LETTER HWE
+	  (?\uA696 ?\uA697) ;; CYRILLIC CAPITAL LETTER SHWE
+	  (?\uA722 ?\uA723) ;; LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF
+	  (?\uA724 ?\uA725) ;; LATIN CAPITAL LETTER EGYPTOLOGICAL AIN
+	  (?\uA726 ?\uA727) ;; LATIN CAPITAL LETTER HENG
+	  (?\uA728 ?\uA729) ;; LATIN CAPITAL LETTER TZ
+	  (?\uA72A ?\uA72B) ;; LATIN CAPITAL LETTER TRESILLO
+	  (?\uA72C ?\uA72D) ;; LATIN CAPITAL LETTER CUATRILLO
+	  (?\uA72E ?\uA72F) ;; LATIN CAPITAL LETTER CUATRILLO WITH COMMA
+	  (?\uA732 ?\uA733) ;; LATIN CAPITAL LETTER AA
+	  (?\uA734 ?\uA735) ;; LATIN CAPITAL LETTER AO
+	  (?\uA736 ?\uA737) ;; LATIN CAPITAL LETTER AU
+	  (?\uA738 ?\uA739) ;; LATIN CAPITAL LETTER AV
+	  (?\uA73A ?\uA73B) ;; LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR
+	  (?\uA73C ?\uA73D) ;; LATIN CAPITAL LETTER AY
+	  (?\uA73E ?\uA73F) ;; LATIN CAPITAL LETTER REVERSED C WITH DOT
+	  (?\uA740 ?\uA741) ;; LATIN CAPITAL LETTER K WITH STROKE
+	  (?\uA742 ?\uA743) ;; LATIN CAPITAL LETTER K WITH DIAGONAL STROKE
+	  (?\uA744 ?\uA745) ;; LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE
+	  (?\uA746 ?\uA747) ;; LATIN CAPITAL LETTER BROKEN L
+	  (?\uA748 ?\uA749) ;; LATIN CAPITAL LETTER L WITH HIGH STROKE
+	  (?\uA74A ?\uA74B) ;; LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY
+	  (?\uA74C ?\uA74D) ;; LATIN CAPITAL LETTER O WITH LOOP
+	  (?\uA74E ?\uA74F) ;; LATIN CAPITAL LETTER OO
+	  (?\uA750 ?\uA751) ;; LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER
+	  (?\uA752 ?\uA753) ;; LATIN CAPITAL LETTER P WITH FLOURISH
+	  (?\uA754 ?\uA755) ;; LATIN CAPITAL LETTER P WITH SQUIRREL TAIL
+	  (?\uA756 ?\uA757) ;; LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER
+	  (?\uA758 ?\uA759) ;; LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE
+	  (?\uA75A ?\uA75B) ;; LATIN CAPITAL LETTER R ROTUNDA
+	  (?\uA75C ?\uA75D) ;; LATIN CAPITAL LETTER RUM ROTUNDA
+	  (?\uA75E ?\uA75F) ;; LATIN CAPITAL LETTER V WITH DIAGONAL STROKE
+	  (?\uA760 ?\uA761) ;; LATIN CAPITAL LETTER VY
+	  (?\uA762 ?\uA763) ;; LATIN CAPITAL LETTER VISIGOTHIC Z
+	  (?\uA764 ?\uA765) ;; LATIN CAPITAL LETTER THORN WITH STROKE
+	  (?\uA766 ?\uA767) ;; LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER
+	  (?\uA768 ?\uA769) ;; LATIN CAPITAL LETTER VEND
+	  (?\uA76A ?\uA76B) ;; LATIN CAPITAL LETTER ET
+	  (?\uA76C ?\uA76D) ;; LATIN CAPITAL LETTER IS
+	  (?\uA76E ?\uA76F) ;; LATIN CAPITAL LETTER CON
+	  (?\uA779 ?\uA77A) ;; LATIN CAPITAL LETTER INSULAR D
+	  (?\uA77B ?\uA77C) ;; LATIN CAPITAL LETTER INSULAR F
+	  (?\uA77D ?\u1D79) ;; LATIN CAPITAL LETTER INSULAR G
+	  (?\uA77E ?\uA77F) ;; LATIN CAPITAL LETTER TURNED INSULAR G
+	  (?\uA780 ?\uA781) ;; LATIN CAPITAL LETTER TURNED L
+	  (?\uA782 ?\uA783) ;; LATIN CAPITAL LETTER INSULAR R
+	  (?\uA784 ?\uA785) ;; LATIN CAPITAL LETTER INSULAR S
+	  (?\uA786 ?\uA787) ;; LATIN CAPITAL LETTER INSULAR T
+	  (?\uA78B ?\uA78C) ;; LATIN CAPITAL LETTER SALTILLO
+;;; WARNING: Unhandled full mapping:
+;;;   FB00; F; 0066 0066; # LATIN SMALL LIGATURE FF
+;;; WARNING: Unhandled full mapping:
+;;;   FB01; F; 0066 0069; # LATIN SMALL LIGATURE FI
+;;; WARNING: Unhandled full mapping:
+;;;   FB02; F; 0066 006C; # LATIN SMALL LIGATURE FL
+;;; WARNING: Unhandled full mapping:
+;;;   FB03; F; 0066 0066 0069; # LATIN SMALL LIGATURE FFI
+;;; WARNING: Unhandled full mapping:
+;;;   FB04; F; 0066 0066 006C; # LATIN SMALL LIGATURE FFL
+;;; WARNING: Unhandled full mapping:
+;;;   FB05; F; 0073 0074; # LATIN SMALL LIGATURE LONG S T
+;;; WARNING: Unhandled full mapping:
+;;;   FB06; F; 0073 0074; # LATIN SMALL LIGATURE ST
+;;; WARNING: Unhandled full mapping:
+;;;   FB13; F; 0574 0576; # ARMENIAN SMALL LIGATURE MEN NOW
+;;; WARNING: Unhandled full mapping:
+;;;   FB14; F; 0574 0565; # ARMENIAN SMALL LIGATURE MEN ECH
+;;; WARNING: Unhandled full mapping:
+;;;   FB15; F; 0574 056B; # ARMENIAN SMALL LIGATURE MEN INI
+;;; WARNING: Unhandled full mapping:
+;;;   FB16; F; 057E 0576; # ARMENIAN SMALL LIGATURE VEW NOW
+;;; WARNING: Unhandled full mapping:
+;;;   FB17; F; 0574 056D; # ARMENIAN SMALL LIGATURE MEN XEH
+	  (?\uFF21 ?\uFF41) ;; FULLWIDTH LATIN CAPITAL LETTER A
+	  (?\uFF22 ?\uFF42) ;; FULLWIDTH LATIN CAPITAL LETTER B
+	  (?\uFF23 ?\uFF43) ;; FULLWIDTH LATIN CAPITAL LETTER C
+	  (?\uFF24 ?\uFF44) ;; FULLWIDTH LATIN CAPITAL LETTER D
+	  (?\uFF25 ?\uFF45) ;; FULLWIDTH LATIN CAPITAL LETTER E
+	  (?\uFF26 ?\uFF46) ;; FULLWIDTH LATIN CAPITAL LETTER F
+	  (?\uFF27 ?\uFF47) ;; FULLWIDTH LATIN CAPITAL LETTER G
+	  (?\uFF28 ?\uFF48) ;; FULLWIDTH LATIN CAPITAL LETTER H
+	  (?\uFF29 ?\uFF49) ;; FULLWIDTH LATIN CAPITAL LETTER I
+	  (?\uFF2A ?\uFF4A) ;; FULLWIDTH LATIN CAPITAL LETTER J
+	  (?\uFF2B ?\uFF4B) ;; FULLWIDTH LATIN CAPITAL LETTER K
+	  (?\uFF2C ?\uFF4C) ;; FULLWIDTH LATIN CAPITAL LETTER L
+	  (?\uFF2D ?\uFF4D) ;; FULLWIDTH LATIN CAPITAL LETTER M
+	  (?\uFF2E ?\uFF4E) ;; FULLWIDTH LATIN CAPITAL LETTER N
+	  (?\uFF2F ?\uFF4F) ;; FULLWIDTH LATIN CAPITAL LETTER O
+	  (?\uFF30 ?\uFF50) ;; FULLWIDTH LATIN CAPITAL LETTER P
+	  (?\uFF31 ?\uFF51) ;; FULLWIDTH LATIN CAPITAL LETTER Q
+	  (?\uFF32 ?\uFF52) ;; FULLWIDTH LATIN CAPITAL LETTER R
+	  (?\uFF33 ?\uFF53) ;; FULLWIDTH LATIN CAPITAL LETTER S
+	  (?\uFF34 ?\uFF54) ;; FULLWIDTH LATIN CAPITAL LETTER T
+	  (?\uFF35 ?\uFF55) ;; FULLWIDTH LATIN CAPITAL LETTER U
+	  (?\uFF36 ?\uFF56) ;; FULLWIDTH LATIN CAPITAL LETTER V
+	  (?\uFF37 ?\uFF57) ;; FULLWIDTH LATIN CAPITAL LETTER W
+	  (?\uFF38 ?\uFF58) ;; FULLWIDTH LATIN CAPITAL LETTER X
+	  (?\uFF39 ?\uFF59) ;; FULLWIDTH LATIN CAPITAL LETTER Y
+	  (?\uFF3A ?\uFF5A) ;; FULLWIDTH LATIN CAPITAL LETTER Z
+	  (?\U00010400 ?\U00010428) ;; DESERET CAPITAL LETTER LONG I
+	  (?\U00010401 ?\U00010429) ;; DESERET CAPITAL LETTER LONG E
+	  (?\U00010402 ?\U0001042A) ;; DESERET CAPITAL LETTER LONG A
+	  (?\U00010403 ?\U0001042B) ;; DESERET CAPITAL LETTER LONG AH
+	  (?\U00010404 ?\U0001042C) ;; DESERET CAPITAL LETTER LONG O
+	  (?\U00010405 ?\U0001042D) ;; DESERET CAPITAL LETTER LONG OO
+	  (?\U00010406 ?\U0001042E) ;; DESERET CAPITAL LETTER SHORT I
+	  (?\U00010407 ?\U0001042F) ;; DESERET CAPITAL LETTER SHORT E
+	  (?\U00010408 ?\U00010430) ;; DESERET CAPITAL LETTER SHORT A
+	  (?\U00010409 ?\U00010431) ;; DESERET CAPITAL LETTER SHORT AH
+	  (?\U0001040A ?\U00010432) ;; DESERET CAPITAL LETTER SHORT O
+	  (?\U0001040B ?\U00010433) ;; DESERET CAPITAL LETTER SHORT OO
+	  (?\U0001040C ?\U00010434) ;; DESERET CAPITAL LETTER AY
+	  (?\U0001040D ?\U00010435) ;; DESERET CAPITAL LETTER OW
+	  (?\U0001040E ?\U00010436) ;; DESERET CAPITAL LETTER WU
+	  (?\U0001040F ?\U00010437) ;; DESERET CAPITAL LETTER YEE
+	  (?\U00010410 ?\U00010438) ;; DESERET CAPITAL LETTER H
+	  (?\U00010411 ?\U00010439) ;; DESERET CAPITAL LETTER PEE
+	  (?\U00010412 ?\U0001043A) ;; DESERET CAPITAL LETTER BEE
+	  (?\U00010413 ?\U0001043B) ;; DESERET CAPITAL LETTER TEE
+	  (?\U00010414 ?\U0001043C) ;; DESERET CAPITAL LETTER DEE
+	  (?\U00010415 ?\U0001043D) ;; DESERET CAPITAL LETTER CHEE
+	  (?\U00010416 ?\U0001043E) ;; DESERET CAPITAL LETTER JEE
+	  (?\U00010417 ?\U0001043F) ;; DESERET CAPITAL LETTER KAY
+	  (?\U00010418 ?\U00010440) ;; DESERET CAPITAL LETTER GAY
+	  (?\U00010419 ?\U00010441) ;; DESERET CAPITAL LETTER EF
+	  (?\U0001041A ?\U00010442) ;; DESERET CAPITAL LETTER VEE
+	  (?\U0001041B ?\U00010443) ;; DESERET CAPITAL LETTER ETH
+	  (?\U0001041C ?\U00010444) ;; DESERET CAPITAL LETTER THEE
+	  (?\U0001041D ?\U00010445) ;; DESERET CAPITAL LETTER ES
+	  (?\U0001041E ?\U00010446) ;; DESERET CAPITAL LETTER ZEE
+	  (?\U0001041F ?\U00010447) ;; DESERET CAPITAL LETTER ESH
+	  (?\U00010420 ?\U00010448) ;; DESERET CAPITAL LETTER ZHEE
+	  (?\U00010421 ?\U00010449) ;; DESERET CAPITAL LETTER ER
+	  (?\U00010422 ?\U0001044A) ;; DESERET CAPITAL LETTER EL
+	  (?\U00010423 ?\U0001044B) ;; DESERET CAPITAL LETTER EM
+	  (?\U00010424 ?\U0001044C) ;; DESERET CAPITAL LETTER EN
+	  (?\U00010425 ?\U0001044D) ;; DESERET CAPITAL LETTER ENG
+	  (?\U00010426 ?\U0001044E) ;; DESERET CAPITAL LETTER OI
+	  (?\U00010427 ?\U0001044F) ;; DESERET CAPITAL LETTER EW
+	  ))
+       ;; a table to track mappings that overlap with some other mapping
+       (multi-hash (make-hash-table))
+       (uni-casetab
+	(loop
+	  with case-table = (make-case-table)
+	  for (uc lc) in uni-mappings do
+	  ;; see if there are existing mappings for either char of the new
+	  ;; mapping pair.
+	  (let* ((curucval (get-case-table 'downcase uc case-table))
+		 (curlcval (get-case-table 'upcase lc case-table))
+		 (curucval (and (not (eq curucval uc)) curucval))
+		 (curlcval (and (not (eq curlcval lc)) curlcval))
+		 )
+	    ;; if so, flag both the existing and new mapping pair as having
+	    ;; an overlapping mapping. 
+	    (when (or curucval curlcval)
+	      (loop for ch in (list curucval curlcval uc lc) do
+		(puthash ch t multi-hash)))
 
-;; Bug reported in http://mid.gmane.org/y9lk5lu5orq.fsf@deinprogramm.de from
-;; Michael Sperber. Fixed 2008-01-29.
-(with-string-as-buffer-contents "\n\nDer beruhmte deutsche Flei\xdf\n\n"
-  (goto-char (point-min))
-  (Assert (search-forward "Flei\xdf")))
-
-(with-temp-buffer
-  (let ((target "M\xe9zard")
-        (debug-xemacs-searches 1))
-    (Assert (not (search-forward target nil t)))
-    (insert target)
-    (goto-char (point-min))
-    ;; #### search-algorithm-used is simple-search after the following,
-    ;; which shouldn't be necessary; it should be possible to use
-    ;; Boyer-Moore. 
-    ;;
-    ;; But searches for ASCII strings in buffers with nothing above ?\xFF
-    ;; use Boyer Moore with the current implementation, which is the
-    ;; important thing for the Gnus use case.
-    (Assert (= (1+ (length target)) (search-forward target nil t)))))
+	    ;; finally, make the new mapping.
+	    (put-case-table-pair uc lc case-table))
+	  finally return case-table)))
+  (flet ((ismulti (uc lc)
+	   (or (gethash uc multi-hash) (gethash lc multi-hash))))
+    (let (
+	  ;; All lowercase
+	  (lowermulti (with-output-to-string
+			(loop for (uc lc) in uni-mappings do (princ lc))))
+	  ;; All uppercase
+	  (uppermulti (with-output-to-string
+			(loop for (uc lc) in uni-mappings do (princ uc))))
+	  ;; For each pair, lower followed by upper
+	  (loweruppermulti (with-output-to-string
+			     (loop for (uc lc) in uni-mappings
+			       do (princ lc) (princ uc))))
+	  ;; For each pair, upper followed by lower
+	  (upperlowermulti (with-output-to-string
+			     (loop for (uc lc) in uni-mappings
+			       do (princ uc) (princ lc))))
+	  ;; All lowercase, no complex mappings
+	  (lower (with-output-to-string
+		   (loop for (uc lc) in uni-mappings do
+		     (unless (ismulti uc lc) (princ lc)))))
+	  ;; All uppercase, no complex mappings
+	  (upper (with-output-to-string
+		   (loop for (uc lc) in uni-mappings do
+		     (unless (ismulti uc lc) (princ uc)))))
+	  ;; For each pair, lower followed by upper, no complex mappings
+	  (lowerupper (with-output-to-string
+			(loop for (uc lc) in uni-mappings do
+			  (unless (ismulti uc lc) (princ lc) (princ uc)))))
+	  ;; For each pair, upper followed by lower, no complex mappings
+	  (upperlower (with-output-to-string
+			(loop for (uc lc) in uni-mappings do
+			  (unless (ismulti uc lc) (princ uc) (princ lc)))))
+	  )
+      (with-case-table
+	uni-casetab
+	;; Comparison with `equalp' uses a canonical mapping internally and
+	;; so should be able to handle multi-mappings.  Just comparing
+	;; using downcase and upcase, however, won't necessarily work in
+	;; the presence of such mappings -- that's what the internal canon
+	;; and eqv tables are for.
+	(Assert-equalp lowermulti uppermulti)
+	(Assert-equalp loweruppermulti upperlowermulti)
+	(Assert-equal lower (downcase upper))
+	(Assert-equal upper (upcase lower))
+	(Assert-equal (downcase lower) (downcase (downcase lower)))
+	(Assert-equal (upcase lowerupper) (upcase upperlower))
+	(Assert-equal (downcase lowerupper) (downcase upperlower))
+	;; Individually -- we include multi-mappings since we're using
+	;; `equalp'.
+	(loop
+	  for (uc lc) in uni-mappings do
+	  (Assert-equalp uc lc)
+	  (Assert-equalp (string uc) (string lc)))
+	)
 
-(Skip-Test-Unless
- (boundp 'debug-xemacs-searches) ; normal when we have DEBUG_XEMACS
- "not a DEBUG_XEMACS build"
- "checks that the algorithm chosen by #'search-forward is relatively sane"
- (let ((debug-xemacs-searches 1))
-   (with-temp-buffer
-     (set-case-table pristine-case-table)
-     (insert "\n\nDer beruhmte deutsche Fleiss\n\n")
-     (goto-char (point-min))
-     (Assert (search-forward "Fleiss"))
-     (delete-region (point-min) (point-max))
-     (insert "\n\nDer beruhmte deutsche Flei\xdf\n\n")
-     (goto-char (point-min))
-     (Assert (search-forward "Flei\xdf"))
-     (Assert (eq 'boyer-moore search-algorithm-used))
-     (delete-region (point-min) (point-max))
-     (when (featurep 'mule)
-       (insert "\n\nDer beruhmte deutsche Flei\xdf\n\n")
-       (goto-char (point-min))
-       (Assert 
-        (search-forward (format "Fle%c\xdf"
-                                (make-char 'latin-iso8859-9 #xfd))))
-       (Assert (eq 'boyer-moore search-algorithm-used))
-       (insert (make-char 'latin-iso8859-9 #xfd))
-       (goto-char (point-min))
-       (Assert (search-forward "Flei\xdf"))
-       (Assert (eq 'simple-search search-algorithm-used)) 
-       (goto-char (point-min))
-       (Assert (search-forward (format "Fle%c\xdf"
-                                       (make-char 'latin-iso8859-9 #xfd))))
-       (Assert (eq 'simple-search search-algorithm-used))))))
-
+      ;; Here we include multi-mappings -- searching should be able to
+      ;; handle it.
+      (with-temp-buffer
+	(set-case-table uni-casetab)
+	(loop for (str1 str2) in `((,lowermulti ,uppermulti)
+				   (,loweruppermulti ,upperlowermulti)
+				   (,uppermulti ,lowermulti)
+				   (,upperlowermulti ,loweruppermulti))
+	  do
+	  (erase-buffer)
+	  (Assert= (point-min) 1)
+	  (Assert= (point) 1)
+	  (insert str1)
+	  (let ((point (point))
+		(case-fold-search t))
+	    (Assert= (length str1) (1- point))
+	    (goto-char (point-min))
+	    (Assert-eql (search-forward str2 nil t) point)))
+	(loop for (uc lc) in uni-mappings do
+	  (loop for (ch1 ch2) in `((,uc ,lc)
+				   (,lc ,uc))
+	    do
+	    (erase-buffer)
+	    (insert ?0)
+	    (insert ch1)
+	    (insert ?1)
+	    (goto-char (point-min))
+	    (Assert-eql (search-forward (char-to-string ch2) nil t) 3
+			(format "Case-folded searching doesn't equate %s and %s"
+				(char-as-unicode-escape ch1)
+				(char-as-unicode-escape ch2))))))
+      )))
--- a/tests/automated/ccl-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/ccl-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -141,9 +141,9 @@
 (defun ccl-test-normal-expr ()
   ;; normal-expr
   (let ((r0 0) (r1 10) (r2 20) (r3 21) (r4 7))
-    (Assert (= (ccl-test '(0 ((r0 = ((((r1 * r2) + r3) % r4) << 2))))
+    (Assert= (ccl-test '(0 ((r0 = ((((r1 * r2) + r3) % r4) << 2))))
 			 (list r0 r1 r2 r3 r4))
-	       (ash (% (+ (* r1 r2) r3) r4) 2))))
+	       (ash (% (+ (* r1 r2) r3) r4) 2)))
 
   (Assert (\= (ccl-test '(0 ((r2 = (r1 < 10))
 			     (r0 = (r2 > 10))))
@@ -151,9 +151,9 @@
 	   0))
 
   (let ((r0 0) (r1 #x10FF) (r2 #xCC) (r3 #xE0))
-    (Assert (= (ccl-test '(0 ((r0 = (((r1 & #xFF) ^ r2) | r3))))
+    (Assert= (ccl-test '(0 ((r0 = (((r1 & #xFF) ^ r2) | r3))))
 			 (list r0 r1 r2 r3))
-	       (logior (logxor (logand r1 #xFF) r2) r3))))
+	       (logior (logxor (logand r1 #xFF) r2) r3)))
 
   ;; checking range of SJIS
   ;; 81(40-7E, 80-FC), 82, 9F, E0, E1, EF
@@ -187,16 +187,16 @@
 	(setq low (1+ low)))))
 
   ;; self-expr
-  (Assert (= (ccl-test '(0 ((r0 += 20)
+  (Assert= (ccl-test '(0 ((r0 += 20)
 			    (r0 *= 40)
 			    (r0 -= 15)))
 		       '(100))
-	     (- (* (+ 100 20) 40) 15)))
+	     (- (* (+ 100 20) 40) 15))
 
   ;; ref. array
-  (Assert (= (ccl-test '(0 ((r0 = r0 [100 101 102 103 104])))
+  (Assert= (ccl-test '(0 ((r0 = r0 [100 101 102 103 104])))
 		       '(3))
-	     103)))
+	     103))
 
 ;;; Section 2.  Simple read and write
 (defun ccl-test-simple-read-and-write ()
@@ -360,7 +360,7 @@
       ((r0 = -1))))
 
   ;; 1-level normal 1 mapping
-  (Assert (equal
+  (Assert-equal
 	   (mapcar
 	    (lambda (val)
 	      (ccl-test-map-multiple
@@ -369,9 +369,9 @@
 	    '(0 99 100 101 102 103 104 105 106 107))
 	   '((0 . -1) (99 . -1)
 	     (1 . 0) (2 . 0) (3 . 0) (4 . 0) (5 . 0)
-	     (105 . -1) (106 . -1) (107 . -1))))
+	     (105 . -1) (106 . -1) (107 . -1)))
 
-  (Assert (equal
+  (Assert-equal
 	   (mapcar
 	    (lambda (val)
 	      (ccl-test-iterate-multiple-map
@@ -380,10 +380,10 @@
 	    '(0 99 100 101 102 103 104 105 106 107))
 	   '((0 . -1) (99 . -1)
 	     (1 . 0) (2 . 0) (3 . 0) (4 . 0) (5 . 0)
-	     (105 . -1) (106 . -1) (107 . -1))))
+	     (105 . -1) (106 . -1) (107 . -1)))
 
   ;; 1-level normal 2 mappings
-  (Assert (equal
+  (Assert-equal
 	   (mapcar
 	    (lambda (val)
 	      (ccl-test-map-multiple
@@ -393,9 +393,9 @@
 	    '(0 99 100 101 102 103 104 105 106 107))
 	   '((0 . -1) (99 . -1) (1 . 0) (2 . 0)
 	     (13 . 1) (4 . 0) (5 . 0) (16 . 1) (17 . 1)
-	     (107 . -1))))
+	     (107 . -1)))
 
-  (Assert (equal
+  (Assert-equal
 	   (mapcar
 	    (lambda (val)
 	      (ccl-test-iterate-multiple-map
@@ -404,11 +404,11 @@
 		 [101 12 13 14 15 16 17])))
 	    '(0 99 100 101 102 103 104 105 106 107))
 	   '((0 . -1) (99 . -1) (1 . 0) (2 . 0) (3 . 0)
-	     (4 . 0) (5 . 0) (16 . 1) (17 . 1) (107 . -1))))
+	     (4 . 0) (5 . 0) (16 . 1) (17 . 1) (107 . -1)))
 
 
   ;; 1-level normal 7 mappings
-  (Assert (equal
+  (Assert-equal
 	   (mapcar
 	    (lambda (val)
 	      (ccl-test-map-multiple
@@ -432,9 +432,9 @@
 	     (105 . 2) (106 . 2) (1007 . 3) (108 . 2) (9999 . -1)
 	     (10000 . -1) (10001 . -1) (10002 . -1) (10003 . -1)
 	     (10004 . -1) (19999 . -1) (20000 . 5) (20001 . 5)
-	     (20002 . 5) (30000 . 6) (20004 . 5) (20005 . 5) (20006 . 5))))
+	     (20002 . 5) (30000 . 6) (20004 . 5) (20005 . 5) (20006 . 5)))
 	   
-      (Assert (equal
+      (Assert-equal
 	       (mapcar
 		(lambda (val)
 		  (ccl-test-iterate-multiple-map
@@ -458,11 +458,11 @@
 		 (105 . 2) (106 . 2) (1007 . 3) (108 . 2) (9999 . -1)
 		 (10000 . -1) (10001 . -1) (10002 . -1) (10003 . -1)
 		 (10004 . -1) (19999 . -1) (20000 . 5) (20001 . 5)
-		 (20002 . 5)(30000 . 6)(20004 . 5)(20005 . 5)(20006 . 5))))
+		 (20002 . 5)(30000 . 6)(20004 . 5)(20005 . 5)(20006 . 5)))
 
       ;; 1-level 7 mappings including CCL call
 
-      (Assert (equal
+      (Assert-equal
 	       (mapcar
 		(lambda (val)
 		  (ccl-test-map-multiple
@@ -487,9 +487,9 @@
 		 (1009 . 3) (1009 . 3) (9999 . -1) (10000 . -1)
 		 (10001 . -1) (10002 . -1) (10003 . -1) (10004 . -1)
 		 (19999 . -1) (20000 . 5) (20001 . 5) (20002 . 5)
-		 (30000 . 6)(20004 . 5)(20005 . 5)(20006 . 5))))
+		 (30000 . 6)(20004 . 5)(20005 . 5)(20006 . 5)))
 
-      (Assert (equal
+      (Assert-equal
 	       (mapcar
 		(lambda (val)
 		  (ccl-test-iterate-multiple-map
@@ -514,10 +514,10 @@
 		 (1009 . 3) (-3 . 0) (9999 . -1) (10000 . -1)
 		 (10001 . -1) (10002 . -1) (10003 . -1) (10004 . -1)
 		 (19999 . -1) (20000 . 5) (20001 . 5) (20002 . 5)
-		 (30000 . 6) (20004 . 5) (20005 . 5) (20006 . 5))))
+		 (30000 . 6) (20004 . 5) (20005 . 5) (20006 . 5)))
 
       ;; 3-level mappings
-      (Assert (equal
+      (Assert-equal
 	       (mapcar
 		(lambda (val)
 		  (ccl-test-map-multiple
@@ -550,11 +550,11 @@
 		 (30040 . 10) (30050 . 10) (10008 . 11) (10009 . 11)
 		 (10010 . 11) (19999 . 11) (20000 . 11) (20001 . 11)
 		 (20002 . 11) (20003 . 11) (20004 . 11) (20005 . 11)
-		 (20006 . 11))))
+		 (20006 . 11)))
 
 
       ;; 3-level mappings including CCL call
-      (Assert (equal
+      (Assert-equal
 	       (mapcar
 		(lambda (val)
 		  (ccl-test-map-multiple
@@ -592,7 +592,7 @@
 		 (10005 . 14) (30040 . 12) (1020008 . 12) (10008 . 14)
 		 (10009 . 14) (10010 . 14) (19999 . 14) (20000 . 14)
 		 (20001 . 14) (20002 . 14) (20003 . 14) (20004 . 14)
-		 (20005 . 14) (20006 . 14))))
+		 (20005 . 14) (20006 . 14)))
       ;; All map-instruction tests ends here.
       )
 
--- a/tests/automated/database-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/database-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -46,9 +46,9 @@
        (test-database (db)
 	(Assert (databasep db))
 	(put-database "key1" "val1" db)
-	(Assert (equal "val1" (get-database "key1" db)))
+	(Assert-equal "val1" (get-database "key1" db))
 	(remove-database "key1" db)
-	(Assert (equal nil (get-database "key1" db)))
+	(Assert-equal nil (get-database "key1" db))
 	(close-database db)
 	(Assert (not (database-live-p db)))
 	(Assert (databasep db))))
--- a/tests/automated/extent-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/extent-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -52,12 +52,12 @@
 
     ;; Put it in a buffer.
     (set-extent-endpoints extent 1 1 (current-buffer))
-    (Assert (eq (extent-object extent) (current-buffer)))
+    (Assert-eq (extent-object extent) (current-buffer))
 
     ;; And then into another buffer.
     (with-temp-buffer
       (set-extent-endpoints extent 1 1 (current-buffer))
-      (Assert (eq (extent-object extent) (current-buffer))))
+      (Assert-eq (extent-object extent) (current-buffer)))
 
     ;; Now that the buffer doesn't exist, extent should be detached
     ;; again.
@@ -65,39 +65,39 @@
 
     ;; This line crashes XEmacs 21.2.46 and prior.
     (set-extent-endpoints extent 1 (length string) string)
-    (Assert (eq (extent-object extent) string))
+    (Assert-eq (extent-object extent) string)
     )
 
   (let ((extent (make-extent 1 1)))
     ;; By default, extent should be closed-open
-    (Assert (eq (get extent 'start-closed) t))
-    (Assert (eq (get extent 'start-open) nil))
-    (Assert (eq (get extent 'end-open) t))
-    (Assert (eq (get extent 'end-closed) nil))
+    (Assert-eq (get extent 'start-closed) t)
+    (Assert-eq (get extent 'start-open) nil)
+    (Assert-eq (get extent 'end-open) t)
+    (Assert-eq (get extent 'end-closed) nil)
 
     ;; Make it closed-closed.
     (set-extent-property extent 'end-closed t)
 
-    (Assert (eq (get extent 'start-closed) t))
-    (Assert (eq (get extent 'start-open) nil))
-    (Assert (eq (get extent 'end-open) nil))
-    (Assert (eq (get extent 'end-closed) t))
+    (Assert-eq (get extent 'start-closed) t)
+    (Assert-eq (get extent 'start-open) nil)
+    (Assert-eq (get extent 'end-open) nil)
+    (Assert-eq (get extent 'end-closed) t)
 
     ;; open-closed
     (set-extent-property extent 'start-open t)
 
-    (Assert (eq (get extent 'start-closed) nil))
-    (Assert (eq (get extent 'start-open) t))
-    (Assert (eq (get extent 'end-open) nil))
-    (Assert (eq (get extent 'end-closed) t))
+    (Assert-eq (get extent 'start-closed) nil)
+    (Assert-eq (get extent 'start-open) t)
+    (Assert-eq (get extent 'end-open) nil)
+    (Assert-eq (get extent 'end-closed) t)
 
     ;; open-open
     (set-extent-property extent 'end-open t)
 
-    (Assert (eq (get extent 'start-closed) nil))
-    (Assert (eq (get extent 'start-open) t))
-    (Assert (eq (get extent 'end-open) t))
-    (Assert (eq (get extent 'end-closed) nil)))
+    (Assert-eq (get extent 'start-closed) nil)
+    (Assert-eq (get extent 'start-open) t)
+    (Assert-eq (get extent 'end-open) t)
+    (Assert-eq (get extent 'end-closed) nil))
 
   )
 
@@ -125,25 +125,25 @@
   (let ((e (make-extent 4 7)))
     ;; current state: "###[eee)###"
     ;;                 123 456 789
-    (Assert (equal (et-range e) '(4 7)))
+    (Assert-equal (et-range e) '(4 7))
 
     (et-insert-at "xxx" 4)
 
     ;; current state: "###[xxxeee)###"
     ;;                 123 456789 012
-    (Assert (equal (et-range e) '(4 10)))
+    (Assert-equal (et-range e) '(4 10))
 
     (et-insert-at "yyy" 7)
 
     ;; current state: "###[xxxyyyeee)###"
     ;;                 123 456789012 345
-    (Assert (equal (et-range e) '(4 13)))
+    (Assert-equal (et-range e) '(4 13))
 
     (et-insert-at "zzz" 13)
 
     ;; current state: "###[xxxyyyeee)zzz###"
     ;;                 123 456789012 345678
-    (Assert (equal (et-range e) '(4 13)))
+    (Assert-equal (et-range e) '(4 13))
     ))
 
 ;; closed-closed
@@ -155,25 +155,25 @@
 
     ;; current state: "###[eee]###"
     ;;                 123 456 789
-    (Assert (equal (et-range e) '(4 7)))
+    (Assert-equal (et-range e) '(4 7))
 
     (et-insert-at "xxx" 4)
 
     ;; current state: "###[xxxeee]###"
     ;;                 123 456789 012
-    (Assert (equal (et-range e) '(4 10)))
+    (Assert-equal (et-range e) '(4 10))
 
     (et-insert-at "yyy" 7)
 
     ;; current state: "###[xxxyyyeee]###"
     ;;                 123 456789012 345
-    (Assert (equal (et-range e) '(4 13)))
+    (Assert-equal (et-range e) '(4 13))
 
     (et-insert-at "zzz" 13)
 
     ;; current state: "###[xxxyyyeeezzz]###"
     ;;                 123 456789012345 678
-    (Assert (equal (et-range e) '(4 16)))
+    (Assert-equal (et-range e) '(4 16))
     ))
 
 ;; open-closed
@@ -186,25 +186,25 @@
 
     ;; current state: "###(eee]###"
     ;;                 123 456 789
-    (Assert (equal (et-range e) '(4 7)))
+    (Assert-equal (et-range e) '(4 7))
 
     (et-insert-at "xxx" 4)
 
     ;; current state: "###xxx(eee]###"
     ;;                 123456 789 012
-    (Assert (equal (et-range e) '(7 10)))
+    (Assert-equal (et-range e) '(7 10))
 
     (et-insert-at "yyy" 8)
 
     ;; current state: "###xxx(eyyyee]###"
     ;;                 123456 789012 345
-    (Assert (equal (et-range e) '(7 13)))
+    (Assert-equal (et-range e) '(7 13))
 
     (et-insert-at "zzz" 13)
 
     ;; current state: "###xxx(eyyyeezzz]###"
     ;;                 123456 789012345 678
-    (Assert (equal (et-range e) '(7 16)))
+    (Assert-equal (et-range e) '(7 16))
     ))
 
 ;; open-open
@@ -216,25 +216,25 @@
 
     ;; current state: "###(eee)###"
     ;;                 123 456 789
-    (Assert (equal (et-range e) '(4 7)))
+    (Assert-equal (et-range e) '(4 7))
 
     (et-insert-at "xxx" 4)
 
     ;; current state: "###xxx(eee)###"
     ;;                 123456 789 012
-    (Assert (equal (et-range e) '(7 10)))
+    (Assert-equal (et-range e) '(7 10))
 
     (et-insert-at "yyy" 8)
 
     ;; current state: "###xxx(eyyyee)###"
     ;;                 123456 789012 345
-    (Assert (equal (et-range e) '(7 13)))
+    (Assert-equal (et-range e) '(7 13))
 
     (et-insert-at "zzz" 13)
 
     ;; current state: "###xxx(eyyyee)zzz###"
     ;;                 123456 789012 345678
-    (Assert (equal (et-range e) '(7 13)))
+    (Assert-equal (et-range e) '(7 13))
     ))
 
 
@@ -256,31 +256,31 @@
 
       ;; current state: xx[xxxxxx]xx
       ;;                12 345678 90
-      (Assert (equal (et-range e) '(3 9)))
+      (Assert-equal (et-range e) '(3 9))
 
       (delete-region 1 2)
 
       ;; current state: x[xxxxxx]xx
       ;;                1 234567 89
-      (Assert (equal (et-range e) '(2 8)))
+      (Assert-equal (et-range e) '(2 8))
 
       (delete-region 2 4)
 
       ;; current state: x[xxxx]xx
       ;;                1 2345 67
-      (Assert (equal (et-range e) '(2 6)))
+      (Assert-equal (et-range e) '(2 6))
 
       (delete-region 1 3)
 
       ;; current state: [xxx]xx
       ;;                 123 45
-      (Assert (equal (et-range e) '(1 4)))
+      (Assert-equal (et-range e) '(1 4))
 
       (delete-region 3 5)
 
       ;; current state: [xx]x
       ;;                 12 3
-      (Assert (equal (et-range e) '(1 3)))
+      (Assert-equal (et-range e) '(1 3))
 
       )))
 
@@ -329,7 +329,7 @@
       (delete-region 4 6)
       ;; ###[]###
       (Assert (not (extent-detached-p e)))
-      (Assert (equal (et-range e) '(4 4)))
+      (Assert-equal (et-range e) '(4 4))
       ))
   )
 
@@ -343,7 +343,7 @@
   (insert "######")
   (let ((e (make-extent 4 4)))
     (et-insert-at "foo" 4)
-    (Assert (equal (et-range e) '(4 4)))))
+    (Assert-equal (et-range e) '(4 4))))
 
 ;; open-closed (should move)
 (with-temp-buffer
@@ -352,7 +352,7 @@
     (put e 'start-open t)
     (put e 'end-closed t)
     (et-insert-at "foo" 4)
-    (Assert (equal (et-range e) '(7 7)))))
+    (Assert-equal (et-range e) '(7 7))))
 
 ;; closed-closed (should extend)
 (with-temp-buffer
@@ -360,7 +360,7 @@
   (let ((e (make-extent 4 4)))
     (put e 'end-closed t)
     (et-insert-at "foo" 4)
-    (Assert (equal (et-range e) '(4 7)))))
+    (Assert-equal (et-range e) '(4 7))))
 
 ;; open-open (illegal; forced to behave like closed-open)
 (with-temp-buffer
@@ -368,4 +368,4 @@
   (let ((e (make-extent 4 4)))
     (put e 'start-open t)
     (et-insert-at "foo" 4)
-    (Assert (equal (et-range e) '(4 4)))))
+    (Assert-equal (et-range e) '(4 4))))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/automated/file-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,45 @@
+;;; file-tests.el --- test support for filesystem primitives
+
+;; Copyright (C) 2010 Ben Wing.
+
+;; Author: Ben Wing <ben@xemacs.org>
+;; Maintainer: Ben Wing <ben@xemacs.org>
+;; Created: 2010 January 25
+;; Keywords: files, filenames, file names
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF.
+
+;;; Commentary:
+
+;; Test file-system support.  Opening files, file names, etc.
+;; See test-harness.el for instructions on how to run these tests.
+
+;; Test that `file-truename' is idempotent (same value when called multiple
+;; times).  Under Cygwin 1.7 as of 1-24-10, not true!
+(loop for file in (list (temp-directory)
+			(file-name-as-directory (temp-directory))
+			"/"
+			(file-name-as-directory "/")
+			(make-temp-name "foo")
+			)
+  do
+  (Assert-equal (file-truename (file-truename file)) (file-truename file)))
+
+
--- a/tests/automated/hash-table-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/hash-table-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -49,26 +49,26 @@
 		       :rehash-size rehash-size
 		       :rehash-threshold rehash-threshold
 		       :weakness weakness)))
-	      (Assert (equal ht (car (let ((print-readably t))
-				       (read-from-string (prin1-to-string ht))))))
-	      (Assert (eq test (hash-table-test ht)))
+	      (Assert-equal ht (car (let ((print-readably t))
+				       (read-from-string (prin1-to-string ht)))))
+	      (Assert-eq test (hash-table-test ht))
 	      (Assert (<= size (hash-table-size ht)))
-	      (Assert (eql rehash-size (hash-table-rehash-size ht)))
-	      (Assert (eql rehash-threshold (hash-table-rehash-threshold ht)))
-	      (Assert (eq weakness (hash-table-weakness ht))))))))))
+	      (Assert-eql rehash-size (hash-table-rehash-size ht))
+	      (Assert-eql rehash-threshold (hash-table-rehash-threshold ht))
+	      (Assert-eq weakness (hash-table-weakness ht)))))))))
 
 (loop for (fun weakness) in '((make-hashtable nil)
 			      (make-weak-hashtable key-and-value)
 			      (make-key-weak-hashtable key)
 			      (make-value-weak-hashtable value))
-  do (Assert (eq weakness (hash-table-weakness (funcall fun 10)))))
+  do (Assert-eq weakness (hash-table-weakness (funcall fun 10))))
 
 (loop for (type weakness) in '((non-weak nil)
 			       (weak key-and-value)
 			       (key-weak key)
 			       (value-weak value))
-  do (Assert (equal (make-hash-table :type type)
-		    (make-hash-table :weakness weakness))))
+  do (Assert-equal (make-hash-table :type type)
+		    (make-hash-table :weakness weakness)))
 
 (Assert (not (equal (make-hash-table :weakness nil)
 		    (make-hash-table :weakness t))))
@@ -77,86 +77,86 @@
       (size 80))
   (Assert (hashtablep ht))
   (Assert (hash-table-p ht))
-  (Assert (eq 'eq (hash-table-test ht)))
-  (Assert (eq 'non-weak (hash-table-type ht)))
-  (Assert (eq 'non-weak (hashtable-type ht)))
-  (Assert (eq 'nil (hash-table-weakness ht)))
+  (Assert-eq 'eq (hash-table-test ht))
+  (Assert-eq 'non-weak (hash-table-type ht))
+  (Assert-eq 'non-weak (hashtable-type ht))
+  (Assert-eq 'nil (hash-table-weakness ht))
   (dotimes (j size)
     (puthash j (- j) ht)
-    (Assert (eq (gethash j ht) (- j)))
-    (Assert (= (hash-table-count ht) (1+ j)))
-    (Assert (= (hashtable-fullness ht) (hash-table-count ht)))
+    (Assert-eq (gethash j ht) (- j))
+    (Assert= (hash-table-count ht) (1+ j))
+    (Assert= (hashtable-fullness ht) (hash-table-count ht))
     (puthash j j ht)
-    (Assert (eq (gethash j ht 'foo) j))
-    (Assert (= (hash-table-count ht) (1+ j)))
+    (Assert-eq (gethash j ht 'foo) j)
+    (Assert= (hash-table-count ht) (1+ j))
     (setf (gethash j ht) (- j))
-    (Assert (eq (gethash j ht) (- j)))
-    (Assert (= (hash-table-count ht) (1+ j))))
+    (Assert-eq (gethash j ht) (- j))
+    (Assert= (hash-table-count ht) (1+ j)))
 
   (clrhash ht)
-  (Assert (= 0 (hash-table-count ht)))
+  (Assert= 0 (hash-table-count ht))
 
   (dotimes (j size)
     (puthash j (- j) ht)
-    (Assert (eq (gethash j ht) (- j)))
-    (Assert (= (hash-table-count ht) (1+ j))))
+    (Assert-eq (gethash j ht) (- j))
+    (Assert= (hash-table-count ht) (1+ j)))
 
   (let ((k-sum 0) (v-sum 0))
     (maphash #'(lambda (k v) (incf k-sum k) (incf v-sum v)) ht)
-    (Assert (= k-sum (/ (* size (- size 1)) 2)))
-    (Assert (= v-sum (- k-sum))))
+    (Assert= k-sum (/ (* size (- size 1)) 2))
+    (Assert= v-sum (- k-sum)))
 
   (let ((count size))
     (dotimes (j size)
       (remhash j ht)
-      (Assert (eq (gethash j ht) nil))
-      (Assert (eq (gethash j ht 'foo) 'foo))
-      (Assert (= (hash-table-count ht) (decf count))))))
+      (Assert-eq (gethash j ht) nil)
+      (Assert-eq (gethash j ht 'foo) 'foo)
+      (Assert= (hash-table-count ht) (decf count)))))
 
 (let ((ht (make-hash-table :size 30 :rehash-threshold .25 :test 'equal))
       (size 70))
   (Assert (hashtablep ht))
   (Assert (hash-table-p ht))
   (Assert (>= (hash-table-size ht) (/ 30 .25)))
-  (Assert (eql .25 (hash-table-rehash-threshold ht)))
-  (Assert (eq 'equal (hash-table-test ht)))
-  (Assert (eq (hash-table-test ht) (hashtable-test-function ht)))
-  (Assert (eq 'non-weak (hash-table-type ht)))
+  (Assert-eql .25 (hash-table-rehash-threshold ht))
+  (Assert-eq 'equal (hash-table-test ht))
+  (Assert-eq (hash-table-test ht) (hashtable-test-function ht))
+  (Assert-eq 'non-weak (hash-table-type ht))
   (dotimes (j size)
     (puthash (int-to-string j) (- j) ht)
-    (Assert (eq (gethash (int-to-string j) ht) (- j)))
-    (Assert (= (hash-table-count ht) (1+ j)))
+    (Assert-eq (gethash (int-to-string j) ht) (- j))
+    (Assert= (hash-table-count ht) (1+ j))
     (puthash (int-to-string j) j ht)
-    (Assert (eq (gethash (int-to-string j) ht 'foo) j))
-    (Assert (= (hash-table-count ht) (1+ j))))
+    (Assert-eq (gethash (int-to-string j) ht 'foo) j)
+    (Assert= (hash-table-count ht) (1+ j)))
 
   (clrhash ht)
-  (Assert (= 0 (hash-table-count ht)))
-  (Assert (equal ht (copy-hash-table ht)))
+  (Assert= 0 (hash-table-count ht))
+  (Assert-equal ht (copy-hash-table ht))
 
   (dotimes (j size)
     (setf (gethash (int-to-string j) ht) (- j))
-    (Assert (eq (gethash (int-to-string j) ht) (- j)))
-    (Assert (= (hash-table-count ht) (1+ j))))
+    (Assert-eq (gethash (int-to-string j) ht) (- j))
+    (Assert= (hash-table-count ht) (1+ j)))
 
   (let ((count size))
     (dotimes (j size)
       (remhash (int-to-string j) ht)
-      (Assert (eq (gethash (int-to-string j) ht) nil))
-      (Assert (eq (gethash (int-to-string j) ht 'foo) 'foo))
-      (Assert (= (hash-table-count ht) (decf count))))))
+      (Assert-eq (gethash (int-to-string j) ht) nil)
+      (Assert-eq (gethash (int-to-string j) ht 'foo) 'foo)
+      (Assert= (hash-table-count ht) (decf count)))))
 
 (let ((iterations 5) (one 1.0) (two 2.0))
   (flet ((check-copy
 	  (ht)
 	  (let ((copy-of-ht (copy-hash-table ht)))
-	    (Assert (equal ht copy-of-ht))
+	    (Assert-equal ht copy-of-ht)
 	    (Assert (not (eq ht copy-of-ht)))
-	    (Assert (eq  (hash-table-count ht) (hash-table-count copy-of-ht)))
-	    (Assert (eq  (hash-table-type  ht) (hash-table-type  copy-of-ht)))
-	    (Assert (eq  (hash-table-size  ht) (hash-table-size  copy-of-ht)))
-	    (Assert (eql (hash-table-rehash-size ht) (hash-table-rehash-size copy-of-ht)))
-	    (Assert (eql (hash-table-rehash-threshold ht) (hash-table-rehash-threshold copy-of-ht))))))
+	    (Assert-eq  (hash-table-count ht) (hash-table-count copy-of-ht))
+	    (Assert-eq  (hash-table-type  ht) (hash-table-type  copy-of-ht))
+	    (Assert-eq  (hash-table-size  ht) (hash-table-size  copy-of-ht))
+	    (Assert-eql (hash-table-rehash-size ht) (hash-table-rehash-size copy-of-ht))
+	    (Assert-eql (hash-table-rehash-threshold ht) (hash-table-rehash-threshold copy-of-ht)))))
 
   (let ((ht (make-hash-table :size 100 :rehash-threshold .6 :test 'eq)))
     (dotimes (j iterations)
@@ -164,11 +164,11 @@
       (puthash (+ two 0.0) t ht)
       (puthash (cons 1 2) t ht)
       (puthash (cons 3 4) t ht))
-    (Assert (eq (hashtable-test-function ht) 'eq))
-    (Assert (eq (hash-table-test ht) 'eq))
-    (Assert (= (* iterations 4) (hash-table-count ht)))
-    (Assert (eq nil (gethash 1.0 ht)))
-    (Assert (eq nil (gethash '(1 . 2) ht)))
+    (Assert-eq (hashtable-test-function ht) 'eq)
+    (Assert-eq (hash-table-test ht) 'eq)
+    (Assert= (* iterations 4) (hash-table-count ht))
+    (Assert-eq nil (gethash 1.0 ht))
+    (Assert-eq nil (gethash '(1 . 2) ht))
     (check-copy ht)
     )
 
@@ -178,11 +178,11 @@
       (puthash (+ two 0.0) t ht)
       (puthash (cons 1 2) t ht)
       (puthash (cons 3 4) t ht))
-    (Assert (eq (hashtable-test-function ht) 'eql))
-    (Assert (eq (hash-table-test ht) 'eql))
-    (Assert (= (+ 2 (* 2 iterations)) (hash-table-count ht)))
-    (Assert (eq t (gethash 1.0 ht)))
-    (Assert (eq nil (gethash '(1 . 2) ht)))
+    (Assert-eq (hashtable-test-function ht) 'eql)
+    (Assert-eq (hash-table-test ht) 'eql)
+    (Assert= (+ 2 (* 2 iterations)) (hash-table-count ht))
+    (Assert-eq t (gethash 1.0 ht))
+    (Assert-eq nil (gethash '(1 . 2) ht))
     (check-copy ht)
     )
 
@@ -192,11 +192,11 @@
       (puthash (+ two 0.0) t ht)
       (puthash (cons 1 2) t ht)
       (puthash (cons 3 4) t ht))
-    (Assert (eq (hashtable-test-function ht) 'equal))
-    (Assert (eq (hash-table-test ht) 'equal))
-    (Assert (= 4 (hash-table-count ht)))
-    (Assert (eq t (gethash 1.0 ht)))
-    (Assert (eq t (gethash '(1 . 2) ht)))
+    (Assert-eq (hashtable-test-function ht) 'equal)
+    (Assert-eq (hash-table-test ht) 'equal)
+    (Assert= 4 (hash-table-count ht))
+    (Assert-eq t (gethash 1.0 ht))
+    (Assert-eq t (gethash '(1 . 2) ht))
     (check-copy ht)
     )
 
@@ -223,18 +223,18 @@
 		 (when (integerp k) (incf k-sum k))
 		 (when (integerp v) (incf v-sum v)))
 	     ht)
-    (Assert (eq 38 k-sum))
-    (Assert (eq 25 v-sum)))
-  (Assert (eq 6 (hash-table-count ht)))
+    (Assert-eq 38 k-sum)
+    (Assert-eq 25 v-sum))
+  (Assert-eq 6 (hash-table-count ht))
   (garbage-collect)
-  (Assert (eq expected-count (hash-table-count ht)))
+  (Assert-eq expected-count (hash-table-count ht))
   (let ((k-sum 0) (v-sum 0))
     (maphash #'(lambda (k v)
 		 (when (integerp k) (incf k-sum k))
 		 (when (integerp v) (incf v-sum v)))
 	     ht)
-    (Assert (eq expected-k-sum k-sum))
-    (Assert (eq expected-v-sum v-sum)))))
+    (Assert-eq expected-k-sum k-sum)
+    (Assert-eq expected-v-sum v-sum))))
 
 ;;; Test the ability to puthash and remhash the current elt of a maphash
 (let ((ht (make-hash-table :test 'eql)))
@@ -244,41 +244,41 @@
 	   ht)
   (let ((k-sum 0) (v-sum 0))
     (maphash #'(lambda (k v) (incf k-sum k) (incf v-sum v)) ht)
-    (Assert (= (* 50 49) k-sum))
-    (Assert (= v-sum k-sum))))
+    (Assert= (* 50 49) k-sum)
+    (Assert= v-sum k-sum)))
 
 ;;; Test reading and printing of hash-table objects
 (let ((h1 #s(hashtable  weakness t rehash-size 3.0 rehash-threshold .2 test eq data (1 2 3 4)))
       (h2 #s(hash-table weakness t rehash-size 3.0 rehash-threshold .2 test eq data (1 2 3 4)))
       (h3 (make-hash-table :weakness t :rehash-size 3.0 :rehash-threshold .2 :test 'eq)))
-  (Assert (equal h1 h2))
+  (Assert-equal h1 h2)
   (Assert (not (equal h1 h3)))
   (puthash 1 2 h3)
   (puthash 3 4 h3)
-  (Assert (equal h1 h3)))
+  (Assert-equal h1 h3))
 
 ;;; Testing equality of hash tables
-(Assert (equal (make-hash-table :test 'eql :size 300 :rehash-threshold .9 :rehash-size 3.0)
-	       (make-hash-table :test 'eql)))
+(Assert-equal (make-hash-table :test 'eql :size 300 :rehash-threshold .9 :rehash-size 3.0)
+	       (make-hash-table :test 'eql))
 (Assert (not (equal (make-hash-table :test 'eq)
 		    (make-hash-table :test 'equal))))
 (let ((h1 (make-hash-table))
       (h2 (make-hash-table)))
-  (Assert (equal h1 h2))
+  (Assert-equal h1 h2)
   (Assert (not (eq h1 h2)))
   (puthash 1 2 h1)
   (Assert (not (equal h1 h2)))
   (puthash 1 2 h2)
-  (Assert (equal h1 h2))
+  (Assert-equal h1 h2)
   (puthash 1 3 h2)
   (Assert (not (equal h1 h2)))
   (clrhash h1)
   (Assert (not (equal h1 h2)))
   (clrhash h2)
-  (Assert (equal h1 h2))
+  (Assert-equal h1 h2)
   )
 
 ;;; Test sxhash
-(Assert (= (sxhash "foo") (sxhash "foo")))
-(Assert (= (sxhash '(1 2 3)) (sxhash '(1 2 3))))
+(Assert= (sxhash "foo") (sxhash "foo"))
+(Assert= (sxhash '(1 2 3)) (sxhash '(1 2 3)))
 (Assert (/= (sxhash '(1 2 3)) (sxhash '(3 2 1))))
--- a/tests/automated/lisp-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/lisp-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,4 @@
-;; Copyright (C) 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1998 Free Software Foundation, Inc. -*- coding: iso-8859-1 -*-
 
 ;; Author: Martin Buchholz <martin@xemacs.org>
 ;; Maintainer: Martin Buchholz <martin@xemacs.org>
@@ -42,19 +42,19 @@
 (Check-Error wrong-number-of-arguments (setq setq-test-foo 1 setq-test-bar))
 (Check-Error wrong-number-of-arguments (setq-default setq-test-foo))
 (Check-Error wrong-number-of-arguments (setq-default setq-test-foo 1 setq-test-bar))
-(Assert (eq (setq)         nil))
-(Assert (eq (setq-default) nil))
-(Assert (eq (setq         setq-test-foo 42) 42))
-(Assert (eq (setq-default setq-test-foo 42) 42))
-(Assert (eq (setq         setq-test-foo 42 setq-test-bar 99) 99))
-(Assert (eq (setq-default setq-test-foo 42 setq-test-bar 99) 99))
+(Assert-eq (setq)         nil)
+(Assert-eq (setq-default) nil)
+(Assert-eq (setq         setq-test-foo 42) 42)
+(Assert-eq (setq-default setq-test-foo 42) 42)
+(Assert-eq (setq         setq-test-foo 42 setq-test-bar 99) 99)
+(Assert-eq (setq-default setq-test-foo 42 setq-test-bar 99) 99)
 
 (macrolet ((test-setq (expected-result &rest body)
 		      `(progn
 			 (defun test-setq-fun () ,@body)
-			 (Assert (eq ,expected-result (test-setq-fun)))
+			 (Assert-eq ,expected-result (test-setq-fun))
 			 (byte-compile 'test-setq-fun)
-			 (Assert (eq ,expected-result (test-setq-fun))))))
+			 (Assert-eq ,expected-result (test-setq-fun)))))
   (test-setq nil (setq))
   (test-setq nil (setq-default))
   (test-setq 42  (setq         test-setq-var 42))
@@ -69,38 +69,38 @@
       (my-list '(1 2 3 4)))
 
   ;;(Assert (fooooo)) ;; Generate Other failure
-  ;;(Assert (eq 1 2)) ;; Generate Assertion failure
+  ;;(Assert-eq 1 2) ;; Generate Assertion failure
 
   (dolist (sequence (list my-vector my-bit-vector my-string my-list))
     (Assert (sequencep sequence))
-    (Assert (eq 4 (length sequence))))
+    (Assert-eq 4 (length sequence)))
 
   (dolist (array (list my-vector my-bit-vector my-string))
     (Assert (arrayp array)))
 
-  (Assert (eq (elt my-vector 0) 1))
-  (Assert (eq (elt my-bit-vector 0) 1))
-  (Assert (eq (elt my-string 0) ?1))
-  (Assert (eq (elt my-list 0) 1))
+  (Assert-eq (elt my-vector 0) 1)
+  (Assert-eq (elt my-bit-vector 0) 1)
+  (Assert-eq (elt my-string 0) ?1)
+  (Assert-eq (elt my-list 0) 1)
 
   (fillarray my-vector 5)
   (fillarray my-bit-vector 1)
   (fillarray my-string ?5)
 
   (dolist (array (list my-vector my-bit-vector))
-    (Assert (eq 4 (length array))))
+    (Assert-eq 4 (length array)))
 
-  (Assert (eq (elt my-vector 0) 5))
-  (Assert (eq (elt my-bit-vector 0) 1))
-  (Assert (eq (elt my-string 0) ?5))
+  (Assert-eq (elt my-vector 0) 5)
+  (Assert-eq (elt my-bit-vector 0) 1)
+  (Assert-eq (elt my-string 0) ?5)
 
-  (Assert (eq (elt my-vector 3) 5))
-  (Assert (eq (elt my-bit-vector 3) 1))
-  (Assert (eq (elt my-string 3) ?5))
+  (Assert-eq (elt my-vector 3) 5)
+  (Assert-eq (elt my-bit-vector 3) 1)
+  (Assert-eq (elt my-string 3) ?5)
 
   (fillarray my-bit-vector 0)
-  (Assert (eq 4 (length my-bit-vector)))
-  (Assert (eq (elt my-bit-vector 2) 0))
+  (Assert-eq 4 (length my-bit-vector))
+  (Assert-eq (elt my-bit-vector 2) 0)
   )
 
 (defun make-circular-list (length)
@@ -124,22 +124,22 @@
   (Check-Error circular-list (nconc '(1 . 2) (make-circular-list length) 'foo))
   (Check-Error circular-list (nconc '(1 . 2) '(3 . 4) (make-circular-list length) 'foo)))
 
-(Assert (eq (nconc) nil))
-(Assert (eq (nconc nil) nil))
-(Assert (eq (nconc nil nil) nil))
-(Assert (eq (nconc nil nil nil) nil))
+(Assert-eq (nconc) nil)
+(Assert-eq (nconc nil) nil)
+(Assert-eq (nconc nil nil) nil)
+(Assert-eq (nconc nil nil nil) nil)
 
-(let ((x (make-list-012))) (Assert (eq (nconc nil x) x)))
-(let ((x (make-list-012))) (Assert (eq (nconc x nil) x)))
-(let ((x (make-list-012))) (Assert (eq (nconc nil x nil) x)))
-(let ((x (make-list-012))) (Assert (eq (nconc x) x)))
-(let ((x (make-list-012))) (Assert (eq (nconc x (make-circular-list 3)) x)))
+(let ((x (make-list-012))) (Assert-eq (nconc nil x) x))
+(let ((x (make-list-012))) (Assert-eq (nconc x nil) x))
+(let ((x (make-list-012))) (Assert-eq (nconc nil x nil) x))
+(let ((x (make-list-012))) (Assert-eq (nconc x) x))
+(let ((x (make-list-012))) (Assert-eq (nconc x (make-circular-list 3)) x))
 
-(Assert (equal (nconc '(1 . 2) '(3 . 4) '(5 . 6)) '(1 3 5 . 6)))
+(Assert-equal (nconc '(1 . 2) '(3 . 4) '(5 . 6)) '(1 3 5 . 6))
 
 (let ((y (nconc (make-list-012) nil (list 3 4 5) nil)))
-  (Assert (eq (length y) 6))
-  (Assert (eq (nth 3 y) 3)))
+  (Assert-eq (length y) 6)
+  (Assert-eq (nth 3 y) 3))
 
 ;;-----------------------------------------------------
 ;; Test `last'
@@ -150,15 +150,15 @@
 (Check-Error circular-list (last (make-circular-list 1)))
 (Check-Error circular-list (last (make-circular-list 2000)))
 (let ((x (list 0 1 2 3)))
-  (Assert (eq (last nil) nil))
-  (Assert (eq (last x 0) nil))
-  (Assert (eq (last x  ) (cdddr x)))
-  (Assert (eq (last x 1) (cdddr x)))
-  (Assert (eq (last x 2) (cddr x)))
-  (Assert (eq (last x 3) (cdr x)))
-  (Assert (eq (last x 4) x))
-  (Assert (eq (last x 9) x))
-  (Assert (eq (last '(1 . 2) 0) 2))
+  (Assert-eq (last nil) nil)
+  (Assert-eq (last x 0) nil)
+  (Assert-eq (last x  ) (cdddr x))
+  (Assert-eq (last x 1) (cdddr x))
+  (Assert-eq (last x 2) (cddr x))
+  (Assert-eq (last x 3) (cdr x))
+  (Assert-eq (last x 4) x)
+  (Assert-eq (last x 9) x)
+  (Assert-eq (last '(1 . 2) 0) 2)
   )
 
 ;;-----------------------------------------------------
@@ -178,31 +178,31 @@
 (let* ((x (list 0 1 2 3))
        (y (butlast x))
        (z (nbutlast x)))
-  (Assert (eq z x))
+  (Assert-eq z x)
   (Assert (not (eq y x)))
-  (Assert (equal y '(0 1 2)))
-  (Assert (equal z y)))
+  (Assert-equal y '(0 1 2))
+  (Assert-equal z y))
 
 (let* ((x (list 0 1 2 3 4))
        (y (butlast x 2))
        (z (nbutlast x 2)))
-  (Assert (eq z x))
+  (Assert-eq z x)
   (Assert (not (eq y x)))
-  (Assert (equal y '(0 1 2)))
-  (Assert (equal z y)))
+  (Assert-equal y '(0 1 2))
+  (Assert-equal z y))
 
 (let* ((x (list 0 1 2 3))
        (y (butlast x 0))
        (z (nbutlast x 0)))
-  (Assert (eq z x))
+  (Assert-eq z x)
   (Assert (not (eq y x)))
-  (Assert (equal y '(0 1 2 3)))
-  (Assert (equal z y)))
+  (Assert-equal y '(0 1 2 3))
+  (Assert-equal z y))
 
-(Assert (eq (butlast  '(x)) nil))
-(Assert (eq (nbutlast '(x)) nil))
-(Assert (eq (butlast  '()) nil))
-(Assert (eq (nbutlast '()) nil))
+(Assert-eq (butlast  '(x)) nil)
+(Assert-eq (nbutlast '(x)) nil)
+(Assert-eq (butlast  '()) nil)
+(Assert-eq (nbutlast '()) nil)
 
 ;;-----------------------------------------------------
 ;; Test `copy-list'
@@ -212,7 +212,7 @@
 (Check-Error wrong-number-of-arguments (copy-list '(1 2) 1))
 (Check-Error circular-list (copy-list (make-circular-list 1)))
 (Check-Error circular-list (copy-list (make-circular-list 2000)))
-(Assert (eq '() (copy-list '())))
+(Assert-eq '() (copy-list '()))
 (dolist (x '((1) (1 2) (1 2 3) (1 2 . 3)))
   (let ((y (copy-list x)))
     (Assert (and (equal x y) (not (eq x y))))))
@@ -222,24 +222,24 @@
 ;;-----------------------------------------------------
 
 ;; Test `+'
-(Assert (eq (+ 1 1) 2))
-(Assert (= (+ 1.0 1.0) 2.0))
-(Assert (= (+ 1.0 3.0 0.0) 4.0))
-(Assert (= (+ 1 1.0) 2.0))
-(Assert (= (+ 1.0 1) 2.0))
-(Assert (= (+ 1.0 1 1) 3.0))
-(Assert (= (+ 1 1 1.0) 3.0))
+(Assert-eq (+ 1 1) 2)
+(Assert= (+ 1.0 1.0) 2.0)
+(Assert= (+ 1.0 3.0 0.0) 4.0)
+(Assert= (+ 1 1.0) 2.0)
+(Assert= (+ 1.0 1) 2.0)
+(Assert= (+ 1.0 1 1) 3.0)
+(Assert= (+ 1 1 1.0) 3.0)
 (if (featurep 'bignum)
     (progn
       (Assert (bignump (1+ most-positive-fixnum)))
-      (Assert (eq most-positive-fixnum (1- (1+ most-positive-fixnum))))
+      (Assert-eq most-positive-fixnum (1- (1+ most-positive-fixnum)))
       (Assert (bignump (+ most-positive-fixnum 1)))
-      (Assert (eq most-positive-fixnum (- (+ most-positive-fixnum 1) 1)))
-      (Assert (= (1+ most-positive-fixnum) (- most-negative-fixnum)))
+      (Assert-eq most-positive-fixnum (- (+ most-positive-fixnum 1) 1))
+      (Assert= (1+ most-positive-fixnum) (- most-negative-fixnum))
       (Assert (zerop (+ (* 3 most-negative-fixnum) (* 3 most-positive-fixnum)
 			3))))
-  (Assert (eq (1+ most-positive-fixnum) most-negative-fixnum))
-  (Assert (eq (+ most-positive-fixnum 1) most-negative-fixnum)))
+  (Assert-eq (1+ most-positive-fixnum) most-negative-fixnum)
+  (Assert-eq (+ most-positive-fixnum 1) most-negative-fixnum))
 
 (when (featurep 'ratio)
   (let ((threefourths (read "3/4"))
@@ -247,47 +247,47 @@
 	(bigpos (div (+ most-positive-fixnum 2) (1+ most-positive-fixnum)))
 	(bigneg (div (+ most-positive-fixnum 2) most-negative-fixnum))
 	(negone (div (1+ most-positive-fixnum) most-negative-fixnum)))
-    (Assert (= negone -1))
-    (Assert (= threehalfs (+ threefourths threefourths)))
+    (Assert= negone -1)
+    (Assert= threehalfs (+ threefourths threefourths))
     (Assert (zerop (+ bigpos bigneg)))))
 
 ;; Test `-'
 (Check-Error wrong-number-of-arguments (-))
-(Assert (eq (- 0) 0))
-(Assert (eq (- 1) -1))
+(Assert-eq (- 0) 0)
+(Assert-eq (- 1) -1)
 (dolist (one `(1 1.0 ?\1 ,(Int-to-Marker 1)))
-  (Assert (= (+ 1 one) 2))
-  (Assert (= (+ one) 1))
-  (Assert (= (+ one) one))
-  (Assert (= (- one) -1))
-  (Assert (= (- one one) 0))
-  (Assert (= (- one one one) -1))
-  (Assert (= (- 0 one) -1))
-  (Assert (= (- 0 one one) -2))
-  (Assert (= (+ one 1) 2))
+  (Assert= (+ 1 one) 2)
+  (Assert= (+ one) 1)
+  (Assert= (+ one) one)
+  (Assert= (- one) -1)
+  (Assert= (- one one) 0)
+  (Assert= (- one one one) -1)
+  (Assert= (- 0 one) -1)
+  (Assert= (- 0 one one) -2)
+  (Assert= (+ one 1) 2)
   (dolist (zero '(0 0.0 ?\0))
-    (Assert (= (+ 1 zero) 1) zero)
-    (Assert (= (+ zero 1) 1) zero)
-    (Assert (= (- zero) zero) zero)
-    (Assert (= (- zero) 0) zero)
-    (Assert (= (- zero zero) 0) zero)
-    (Assert (= (- zero one one) -2) zero)))
+    (Assert= (+ 1 zero) 1 zero)
+    (Assert= (+ zero 1) 1 zero)
+    (Assert= (- zero) zero zero)
+    (Assert= (- zero) 0 zero)
+    (Assert= (- zero zero) 0 zero)
+    (Assert= (- zero one one) -2 zero)))
 
-(Assert (= (- 1.5 1) .5))
-(Assert (= (- 1 1.5) (- .5)))
+(Assert= (- 1.5 1) .5)
+(Assert= (- 1 1.5) (- .5))
 
 (if (featurep 'bignum)
     (progn
       (Assert (bignump (1- most-negative-fixnum)))
-      (Assert (eq most-negative-fixnum (1+ (1- most-negative-fixnum))))
+      (Assert-eq most-negative-fixnum (1+ (1- most-negative-fixnum)))
       (Assert (bignump (- most-negative-fixnum 1)))
-      (Assert (eq most-negative-fixnum (+ (- most-negative-fixnum 1) 1)))
-      (Assert (= (1- most-negative-fixnum) (- 0 most-positive-fixnum 2)))
-      (Assert (eq (- (- most-positive-fixnum most-negative-fixnum)
+      (Assert-eq most-negative-fixnum (+ (- most-negative-fixnum 1) 1))
+      (Assert= (1- most-negative-fixnum) (- 0 most-positive-fixnum 2))
+      (Assert-eq (- (- most-positive-fixnum most-negative-fixnum)
 		     (* 2 most-positive-fixnum))
-		  1)))
-  (Assert (eq (1- most-negative-fixnum) most-positive-fixnum))
-  (Assert (eq (- most-negative-fixnum 1) most-positive-fixnum)))
+		  1))
+  (Assert-eq (1- most-negative-fixnum) most-positive-fixnum)
+  (Assert-eq (- most-negative-fixnum 1) most-positive-fixnum))
 
 (when (featurep 'ratio)
   (let ((threefourths (read "3/4"))
@@ -295,9 +295,9 @@
 	(bigpos (div (+ most-positive-fixnum 2) (1+ most-positive-fixnum)))
 	(bigneg (div most-positive-fixnum most-negative-fixnum))
 	(negone (div (1+ most-positive-fixnum) most-negative-fixnum)))
-    (Assert (= (- negone) 1))
-    (Assert (= threefourths (- threehalfs threefourths)))
-    (Assert (= (- bigpos bigneg) 2))))
+    (Assert= (- negone) 1)
+    (Assert= threefourths (- threehalfs threefourths))
+    (Assert= (- bigpos bigneg) 2)))
 
 ;; Test `/'
 
@@ -312,180 +312,180 @@
 ;; Other tests for `/'
 (Check-Error wrong-number-of-arguments (/))
 (let (x)
-  (Assert (= (/ (setq x 2))   0))
-  (Assert (= (/ (setq x 2.0)) 0.5)))
+  (Assert= (/ (setq x 2))   0)
+  (Assert= (/ (setq x 2.0)) 0.5))
 
 (dolist (six '(6 6.0 ?\06))
   (dolist (two '(2 2.0 ?\02))
     (dolist (three '(3 3.0 ?\03))
-      (Assert (= (/ six two) three) (list six two three)))))
+      (Assert= (/ six two) three (list six two three)))))
 
 (dolist (three '(3 3.0 ?\03))
-  (Assert (= (/ three 2.0) 1.5) three))
+  (Assert= (/ three 2.0) 1.5 three))
 (dolist (two '(2 2.0 ?\02))
-  (Assert (= (/ 3.0 two) 1.5) two))
+  (Assert= (/ 3.0 two) 1.5 two))
 
 (when (featurep 'bignum)
   (let* ((million 1000000)
 	 (billion (* million 1000))	;; American, not British, billion
 	 (trillion (* billion 1000)))
-    (Assert (= (/ billion 1000) (/ trillion million) million 1000000.0))
-    (Assert (= (/ billion -1000) (/ trillion (- million)) (- million)))
-    (Assert (= (/ trillion 1000) billion 1000000000.0))
-    (Assert (= (/ trillion -1000) (- billion) -1000000000.0))
-    (Assert (= (/ trillion 10) (* 100 billion) 100000000000.0))
-    (Assert (= (/ (- trillion) 10) (* -100 billion) -100000000000.0))))
+    (Assert= (/ billion 1000) (/ trillion million) million 1000000.0)
+    (Assert= (/ billion -1000) (/ trillion (- million)) (- million))
+    (Assert= (/ trillion 1000) billion 1000000000.0)
+    (Assert= (/ trillion -1000) (- billion) -1000000000.0)
+    (Assert= (/ trillion 10) (* 100 billion) 100000000000.0)
+    (Assert= (/ (- trillion) 10) (* -100 billion) -100000000000.0)))
 
 (when (featurep 'ratio)
   (let ((half (div 1 2))
 	(fivefourths (div 5 4))
 	(fivehalfs (div 5 2)))
-    (Assert (= half (read "3000000000/6000000000")))
-    (Assert (= (/ fivehalfs fivefourths) 2))
-    (Assert (= (/ fivefourths fivehalfs) half))
-    (Assert (= (- half) (read "-3000000000/6000000000")))
-    (Assert (= (/ fivehalfs (- fivefourths)) -2))
-    (Assert (= (/ (- fivefourths) fivehalfs) (- half)))))
+    (Assert= half (read "3000000000/6000000000"))
+    (Assert= (/ fivehalfs fivefourths) 2)
+    (Assert= (/ fivefourths fivehalfs) half)
+    (Assert= (- half) (read "-3000000000/6000000000"))
+    (Assert= (/ fivehalfs (- fivefourths)) -2)
+    (Assert= (/ (- fivefourths) fivehalfs) (- half))))
 
 ;; Test `*'
-(Assert (= 1 (*)))
+(Assert= 1 (*))
 
 (dolist (one `(1 1.0 ?\01 ,(Int-to-Marker 1)))
-  (Assert (= 1 (* one)) one))
+  (Assert= 1 (* one) one))
 
 (dolist (two '(2 2.0 ?\02))
-  (Assert (= 2 (* two)) two))
+  (Assert= 2 (* two) two))
 
 (dolist (six '(6 6.0 ?\06))
   (dolist (two '(2 2.0 ?\02))
     (dolist (three '(3 3.0 ?\03))
-      (Assert (= (* three two) six) (list three two six)))))
+      (Assert= (* three two) six (list three two six)))))
 
 (dolist (three '(3 3.0 ?\03))
   (dolist (two '(2 2.0 ?\02))
-    (Assert (= (* 1.5 two) three) (list two three))
+    (Assert= (* 1.5 two) three (list two three))
     (dolist (five '(5 5.0 ?\05))
-      (Assert (= 30 (* five two three)) (list five two three)))))
+      (Assert= 30 (* five two three) (list five two three)))))
 
 (when (featurep 'bignum)
   (let ((64K 65536))
-    (Assert (= (* 64K 64K) (read "4294967296")))
-    (Assert (= (* (- 64K) 64K) (read "-4294967296")))
+    (Assert= (* 64K 64K) (read "4294967296"))
+    (Assert= (* (- 64K) 64K) (read "-4294967296"))
     (Assert (/= (* -1 most-negative-fixnum) most-negative-fixnum))))
 
 (when (featurep 'ratio)
   (let ((half (div 1 2))
 	(fivefourths (div 5 4))
 	(twofifths (div 2 5)))
-    (Assert (= (* fivefourths twofifths) half))
-    (Assert (= (* half twofifths) (read "3/15")))))
+    (Assert= (* fivefourths twofifths) half)
+    (Assert= (* half twofifths) (read "3/15"))))
 
 ;; Test `+'
-(Assert (= 0 (+)))
+(Assert= 0 (+))
 
 (dolist (one `(1 1.0 ?\01 ,(Int-to-Marker 1)))
-  (Assert (= 1 (+ one)) one))
+  (Assert= 1 (+ one) one))
 
 (dolist (two '(2 2.0 ?\02))
-  (Assert (= 2 (+ two)) two))
+  (Assert= 2 (+ two) two))
 
 (dolist (five '(5 5.0 ?\05))
   (dolist (two '(2 2.0 ?\02))
     (dolist (three '(3 3.0 ?\03))
-      (Assert (= (+ three two) five) (list three two five))
-      (Assert (= 10 (+ five two three)) (list five two three)))))
+      (Assert= (+ three two) five (list three two five))
+      (Assert= 10 (+ five two three) (list five two three)))))
 
 ;; Test `max', `min'
 (dolist (one `(1 1.0 ?\01 ,(Int-to-Marker 1)))
-  (Assert (= one (max one)) one)
-  (Assert (= one (max one one)) one)
-  (Assert (= one (max one one one)) one)
-  (Assert (= one (min one)) one)
-  (Assert (= one (min one one)) one)
-  (Assert (= one (min one one one)) one)
+  (Assert= one (max one) one)
+  (Assert= one (max one one) one)
+  (Assert= one (max one one one) one)
+  (Assert= one (min one) one)
+  (Assert= one (min one one) one)
+  (Assert= one (min one one one) one)
   (dolist (two `(2 2.0 ?\02 ,(Int-to-Marker 2)))
-    (Assert (= one (min one two)) (list one two))
-    (Assert (= one (min one two two)) (list one two))
-    (Assert (= one (min two two one)) (list one two))
-    (Assert (= two (max one two)) (list one two))
-    (Assert (= two (max one two two)) (list one two))
-    (Assert (= two (max two two one)) (list one two))))
+    (Assert= one (min one two) (list one two))
+    (Assert= one (min one two two) (list one two))
+    (Assert= one (min two two one) (list one two))
+    (Assert= two (max one two) (list one two))
+    (Assert= two (max one two two) (list one two))
+    (Assert= two (max two two one) (list one two))))
 
 (when (featurep 'bignum)
   (let ((big (1+ most-positive-fixnum))
 	(small (1- most-negative-fixnum)))
-    (Assert (= big (max 1 1000000.0 most-positive-fixnum big)))
-    (Assert (= small (min -1 -1000000.0 most-negative-fixnum small)))))
+    (Assert= big (max 1 1000000.0 most-positive-fixnum big))
+    (Assert= small (min -1 -1000000.0 most-negative-fixnum small))))
 
 (when (featurep 'ratio)
   (let* ((big (1+ most-positive-fixnum))
 	 (small (1- most-negative-fixnum))
 	 (bigr (div (* 5 (1+ most-positive-fixnum)) 4))
 	 (smallr (- bigr)))
-    (Assert (= bigr (max 1 1000000.0 most-positive-fixnum big bigr)))
-    (Assert (= smallr (min -1 -1000000.0 most-negative-fixnum small smallr)))))
+    (Assert= bigr (max 1 1000000.0 most-positive-fixnum big bigr))
+    (Assert= smallr (min -1 -1000000.0 most-negative-fixnum small smallr))))
 
 ;; The byte compiler has special handling for these constructs:
 (let ((three 3) (five 5))
-  (Assert (= (+ three five 1) 9))
-  (Assert (= (+ 1 three five) 9))
-  (Assert (= (+ three five -1) 7))
-  (Assert (= (+ -1 three five) 7))
-  (Assert (= (+ three 1) 4))
-  (Assert (= (+ three -1) 2))
-  (Assert (= (+ -1 three) 2))
-  (Assert (= (+ -1 three) 2))
-  (Assert (= (- three five 1) -3))
-  (Assert (= (- 1 three five) -7))
-  (Assert (= (- three five -1) -1))
-  (Assert (= (- -1 three five) -9))
-  (Assert (= (- three 1) 2))
-  (Assert (= (- three 2 1) 0))
-  (Assert (= (- 2 three 1) -2))
-  (Assert (= (- three -1) 4))
-  (Assert (= (- three 0) 3))
-  (Assert (= (- three 0 five) -2))
-  (Assert (= (- 0 three 0 five) -8))
-  (Assert (= (- 0 three five) -8))
-  (Assert (= (* three 2) 6))
-  (Assert (= (* three -1 five) -15))
-  (Assert (= (* three 1 five) 15))
-  (Assert (= (* three 0 five) 0))
-  (Assert (= (* three 2 five) 30))
-  (Assert (= (/ three 1) 3))
-  (Assert (= (/ three -1) -3))
-  (Assert (= (/ (* five five) 2 2) 6))
-  (Assert (= (/ 64 five 2) 6)))
+  (Assert= (+ three five 1) 9)
+  (Assert= (+ 1 three five) 9)
+  (Assert= (+ three five -1) 7)
+  (Assert= (+ -1 three five) 7)
+  (Assert= (+ three 1) 4)
+  (Assert= (+ three -1) 2)
+  (Assert= (+ -1 three) 2)
+  (Assert= (+ -1 three) 2)
+  (Assert= (- three five 1) -3)
+  (Assert= (- 1 three five) -7)
+  (Assert= (- three five -1) -1)
+  (Assert= (- -1 three five) -9)
+  (Assert= (- three 1) 2)
+  (Assert= (- three 2 1) 0)
+  (Assert= (- 2 three 1) -2)
+  (Assert= (- three -1) 4)
+  (Assert= (- three 0) 3)
+  (Assert= (- three 0 five) -2)
+  (Assert= (- 0 three 0 five) -8)
+  (Assert= (- 0 three five) -8)
+  (Assert= (* three 2) 6)
+  (Assert= (* three -1 five) -15)
+  (Assert= (* three 1 five) 15)
+  (Assert= (* three 0 five) 0)
+  (Assert= (* three 2 five) 30)
+  (Assert= (/ three 1) 3)
+  (Assert= (/ three -1) -3)
+  (Assert= (/ (* five five) 2 2) 6)
+  (Assert= (/ 64 five 2) 6))
 
 
 ;;-----------------------------------------------------
 ;; Logical bit-twiddling operations
 ;;-----------------------------------------------------
-(Assert (= (logxor)  0))
-(Assert (= (logior)  0))
-(Assert (= (logand) -1))
+(Assert= (logxor)  0)
+(Assert= (logior)  0)
+(Assert= (logand) -1)
 
 (Check-Error wrong-type-argument (logxor 3.0))
 (Check-Error wrong-type-argument (logior 3.0))
 (Check-Error wrong-type-argument (logand 3.0))
 
 (dolist (three '(3 ?\03))
-  (Assert (eq 3 (logand three)) three)
-  (Assert (eq 3 (logxor three)) three)
-  (Assert (eq 3 (logior three)) three)
-  (Assert (eq 3 (logand three three)) three)
-  (Assert (eq 0 (logxor three three)) three)
-  (Assert (eq 3 (logior three three))) three)
+  (Assert-eq 3 (logand three) three)
+  (Assert-eq 3 (logxor three) three)
+  (Assert-eq 3 (logior three) three)
+  (Assert-eq 3 (logand three three) three)
+  (Assert-eq 0 (logxor three three) three)
+  (Assert-eq 3 (logior three three)) three)
 
 (dolist (one `(1 ?\01 ,(Int-to-Marker 1)))
   (dolist (two '(2 ?\02))
-    (Assert (eq 0 (logand one two)) (list one two))
-    (Assert (eq 3 (logior one two)) (list one two))
-    (Assert (eq 3 (logxor one two)) (list one two)))
+    (Assert-eq 0 (logand one two) (list one two))
+    (Assert-eq 3 (logior one two) (list one two))
+    (Assert-eq 3 (logxor one two) (list one two)))
   (dolist (three '(3 ?\03))
-    (Assert (eq 1 (logand one three)) (list one three))
-    (Assert (eq 3 (logior one three)) (list one three))
-    (Assert (eq 2 (logxor one three)) (list one three))))
+    (Assert-eq 1 (logand one three) (list one three))
+    (Assert-eq 3 (logior one three) (list one three))
+    (Assert-eq 2 (logxor one three) (list one three))))
 
 ;;-----------------------------------------------------
 ;; Test `%', mod
@@ -501,11 +501,11 @@
 (Check-Error wrong-type-argument (% 10.0 2))
 (Check-Error wrong-type-argument (% 10 2.0))
 
-(flet ((test1 (x) (Assert (eql x (+ (% x 17) (* (/ x 17) 17))) x))
-       (test2 (x) (Assert (eql (- x) (+ (% (- x) 17) (* (/ (- x) 17) 17))) x))
-       (test3 (x) (Assert (eql x (+ (% (- x) 17) (* (/ (- x) 17) 17))) x))
-       (test4 (x) (Assert (eql (% x -17) (- (% (- x) 17))) x))
-       (test5 (x) (Assert (eql (% x -17) (% (- x) 17))) x))
+(flet ((test1 (x) (Assert-eql x (+ (% x 17) (* (/ x 17) 17)) x))
+       (test2 (x) (Assert-eql (- x) (+ (% (- x) 17) (* (/ (- x) 17) 17)) x))
+       (test3 (x) (Assert-eql x (+ (% (- x) 17) (* (/ (- x) 17) 17)) x))
+       (test4 (x) (Assert-eql (% x -17) (- (% (- x) 17)) x))
+       (test5 (x) (Assert-eql (% x -17) (% (- x) 17)) x))
   (test1 most-negative-fixnum)
   (if (featurep 'bignum)
       (progn
@@ -527,54 +527,54 @@
 (macrolet
     ((division-test (seven)
     `(progn
-       (Assert (eq (% ,seven      2)  1))
-       (Assert (eq (% ,seven     -2)  1))
-       (Assert (eq (% (- ,seven)  2) -1))
-       (Assert (eq (% (- ,seven) -2) -1))
+       (Assert-eq (% ,seven      2)  1)
+       (Assert-eq (% ,seven     -2)  1)
+       (Assert-eq (% (- ,seven)  2) -1)
+       (Assert-eq (% (- ,seven) -2) -1)
 
-       (Assert (eq (% ,seven      4)  3))
-       (Assert (eq (% ,seven     -4)  3))
-       (Assert (eq (% (- ,seven)  4) -3))
-       (Assert (eq (% (- ,seven) -4) -3))
+       (Assert-eq (% ,seven      4)  3)
+       (Assert-eq (% ,seven     -4)  3)
+       (Assert-eq (% (- ,seven)  4) -3)
+       (Assert-eq (% (- ,seven) -4) -3)
 
-       (Assert (eq (%  35 ,seven)     0))
-       (Assert (eq (% -35 ,seven)     0))
-       (Assert (eq (%  35 (- ,seven)) 0))
-       (Assert (eq (% -35 (- ,seven)) 0))
+       (Assert-eq (%  35 ,seven)     0)
+       (Assert-eq (% -35 ,seven)     0)
+       (Assert-eq (%  35 (- ,seven)) 0)
+       (Assert-eq (% -35 (- ,seven)) 0)
 
-       (Assert (eq (mod ,seven      2)  1))
-       (Assert (eq (mod ,seven     -2) -1))
-       (Assert (eq (mod (- ,seven)  2)  1))
-       (Assert (eq (mod (- ,seven) -2) -1))
+       (Assert-eq (mod ,seven      2)  1)
+       (Assert-eq (mod ,seven     -2) -1)
+       (Assert-eq (mod (- ,seven)  2)  1)
+       (Assert-eq (mod (- ,seven) -2) -1)
 
-       (Assert (eq (mod ,seven      4)  3))
-       (Assert (eq (mod ,seven     -4) -1))
-       (Assert (eq (mod (- ,seven)  4)  1))
-       (Assert (eq (mod (- ,seven) -4) -3))
+       (Assert-eq (mod ,seven      4)  3)
+       (Assert-eq (mod ,seven     -4) -1)
+       (Assert-eq (mod (- ,seven)  4)  1)
+       (Assert-eq (mod (- ,seven) -4) -3)
 
-       (Assert (eq (mod  35 ,seven)     0))
-       (Assert (eq (mod -35 ,seven)     0))
-       (Assert (eq (mod  35 (- ,seven)) 0))
-       (Assert (eq (mod -35 (- ,seven)) 0))
+       (Assert-eq (mod  35 ,seven)     0)
+       (Assert-eq (mod -35 ,seven)     0)
+       (Assert-eq (mod  35 (- ,seven)) 0)
+       (Assert-eq (mod -35 (- ,seven)) 0)
 
-       (Assert (= (mod ,seven      2.0)  1.0))
-       (Assert (= (mod ,seven     -2.0) -1.0))
-       (Assert (= (mod (- ,seven)  2.0)  1.0))
-       (Assert (= (mod (- ,seven) -2.0) -1.0))
+       (Assert= (mod ,seven      2.0)  1.0)
+       (Assert= (mod ,seven     -2.0) -1.0)
+       (Assert= (mod (- ,seven)  2.0)  1.0)
+       (Assert= (mod (- ,seven) -2.0) -1.0)
 
-       (Assert (= (mod ,seven      4.0)  3.0))
-       (Assert (= (mod ,seven     -4.0) -1.0))
-       (Assert (= (mod (- ,seven)  4.0)  1.0))
-       (Assert (= (mod (- ,seven) -4.0) -3.0))
+       (Assert= (mod ,seven      4.0)  3.0)
+       (Assert= (mod ,seven     -4.0) -1.0)
+       (Assert= (mod (- ,seven)  4.0)  1.0)
+       (Assert= (mod (- ,seven) -4.0) -3.0)
 
-       (Assert (eq (% 0 ,seven) 0))
-       (Assert (eq (% 0 (- ,seven)) 0))
+       (Assert-eq (% 0 ,seven) 0)
+       (Assert-eq (% 0 (- ,seven)) 0)
 
-       (Assert (eq (mod 0 ,seven) 0))
-       (Assert (eq (mod 0 (- ,seven)) 0))
+       (Assert-eq (mod 0 ,seven) 0)
+       (Assert-eq (mod 0 (- ,seven)) 0)
 
-       (Assert (= (mod 0.0 ,seven) 0.0))
-       (Assert (= (mod 0.0 (- ,seven)) 0.0)))))
+       (Assert= (mod 0.0 ,seven) 0.0)
+       (Assert= (mod 0.0 (- ,seven)) 0.0))))
 
   (division-test 7)
   (division-test ?\07)
@@ -600,12 +600,12 @@
 
 ;; One argument always yields t
 (loop for x in `(1 1.0 ,(Int-to-Marker 1) ?z) do
-  (Assert (eq t (=  x)) x)
-  (Assert (eq t (<  x)) x)
-  (Assert (eq t (>  x)) x)
-  (Assert (eq t (>= x)) x)
-  (Assert (eq t (<= x)) x)
-  (Assert (eq t (/= x)) x)
+  (Assert-eq t (=  x) x)
+  (Assert-eq t (<  x) x)
+  (Assert-eq t (>  x) x)
+  (Assert-eq t (>= x) x)
+  (Assert-eq t (<= x) x)
+  (Assert-eq t (/= x) x)
   )
 
 ;; Type checking
@@ -633,7 +633,7 @@
     (Assert (not (< one one two two)) (list one two))
     (Assert (>= two two one one) (list one two))
     (Assert (not (> two two one one)) (list one two))
-    (Assert (= one one one) one)
+    (Assert= one one one one)
     (Assert (not (= one one one two)) (list one two))
     (Assert (not (/= one two one)) (list one two))
     ))
@@ -654,7 +654,7 @@
     (Assert (not (< one one two two)) (list one two))
     (Assert (>= two two one one) (list one two))
     (Assert (not (> two two one one)) (list one two))
-    (Assert (= one one one) one)
+    (Assert= one one one one)
     (Assert (not (= one one one two)) (list one two))
     (Assert (not (/= one two one)) (list one two))
     ))
@@ -674,8 +674,8 @@
 (Assert (<= 1 1))
 
 (Assert (not (eq (point) (point-marker))))
-(Assert (= 1 (Int-to-Marker 1)))
-(Assert (= (point) (point-marker)))
+(Assert= 1 (Int-to-Marker 1))
+(Assert= (point) (point-marker))
 
 (when (featurep 'bignum)
   (let ((big1 (1+ most-positive-fixnum))
@@ -700,8 +700,8 @@
 	(small1 (div (* 10 most-negative-fixnum) 4))
 	(small2 (div (* 5 most-negative-fixnum) 2))
 	(small3 (div (* 7 most-negative-fixnum) 2)))
-    (Assert (= big1 big2))
-    (Assert (= small1 small2))
+    (Assert= big1 big2)
+    (Assert= small1 small2)
     (Assert (< small3 small1 most-negative-fixnum most-positive-fixnum big1
 	       big3))
     (Assert (<= small3 small2 small1 most-negative-fixnum most-positive-fixnum
@@ -737,56 +737,56 @@
 	     remassoc remassq remrassoc remrassq))
 
 (let ((x '((1 . 2) 3 (4 . 5))))
-  (Assert (eq (assoc  1 x) (car x)))
-  (Assert (eq (assq   1 x) (car x)))
-  (Assert (eq (rassoc 1 x) nil))
-  (Assert (eq (rassq  1 x) nil))
-  (Assert (eq (assoc  2 x) nil))
-  (Assert (eq (assq   2 x) nil))
-  (Assert (eq (rassoc 2 x) (car x)))
-  (Assert (eq (rassq  2 x) (car x)))
-  (Assert (eq (assoc  3 x) nil))
-  (Assert (eq (assq   3 x) nil))
-  (Assert (eq (rassoc 3 x) nil))
-  (Assert (eq (rassq  3 x) nil))
-  (Assert (eq (assoc  4 x) (caddr x)))
-  (Assert (eq (assq   4 x) (caddr x)))
-  (Assert (eq (rassoc 4 x) nil))
-  (Assert (eq (rassq  4 x) nil))
-  (Assert (eq (assoc  5 x) nil))
-  (Assert (eq (assq   5 x) nil))
-  (Assert (eq (rassoc 5 x) (caddr x)))
-  (Assert (eq (rassq  5 x) (caddr x)))
-  (Assert (eq (assoc  6 x) nil))
-  (Assert (eq (assq   6 x) nil))
-  (Assert (eq (rassoc 6 x) nil))
-  (Assert (eq (rassq  6 x) nil)))
+  (Assert-eq (assoc  1 x) (car x))
+  (Assert-eq (assq   1 x) (car x))
+  (Assert-eq (rassoc 1 x) nil)
+  (Assert-eq (rassq  1 x) nil)
+  (Assert-eq (assoc  2 x) nil)
+  (Assert-eq (assq   2 x) nil)
+  (Assert-eq (rassoc 2 x) (car x))
+  (Assert-eq (rassq  2 x) (car x))
+  (Assert-eq (assoc  3 x) nil)
+  (Assert-eq (assq   3 x) nil)
+  (Assert-eq (rassoc 3 x) nil)
+  (Assert-eq (rassq  3 x) nil)
+  (Assert-eq (assoc  4 x) (caddr x))
+  (Assert-eq (assq   4 x) (caddr x))
+  (Assert-eq (rassoc 4 x) nil)
+  (Assert-eq (rassq  4 x) nil)
+  (Assert-eq (assoc  5 x) nil)
+  (Assert-eq (assq   5 x) nil)
+  (Assert-eq (rassoc 5 x) (caddr x))
+  (Assert-eq (rassq  5 x) (caddr x))
+  (Assert-eq (assoc  6 x) nil)
+  (Assert-eq (assq   6 x) nil)
+  (Assert-eq (rassoc 6 x) nil)
+  (Assert-eq (rassq  6 x) nil))
 
 (let ((x '(("1" . "2") "3" ("4" . "5"))))
-  (Assert (eq (assoc  "1" x) (car x)))
-  (Assert (eq (assq   "1" x) nil))
-  (Assert (eq (rassoc "1" x) nil))
-  (Assert (eq (rassq  "1" x) nil))
-  (Assert (eq (assoc  "2" x) nil))
-  (Assert (eq (assq   "2" x) nil))
-  (Assert (eq (rassoc "2" x) (car x)))
-  (Assert (eq (rassq  "2" x) nil))
-  (Assert (eq (assoc  "3" x) nil))
-  (Assert (eq (assq   "3" x) nil))
-  (Assert (eq (rassoc "3" x) nil))
-  (Assert (eq (rassq  "3" x) nil))
-  (Assert (eq (assoc  "4" x) (caddr x)))
-  (Assert (eq (assq   "4" x) nil))
-  (Assert (eq (rassoc "4" x) nil))
-  (Assert (eq (rassq  "4" x) nil))
-  (Assert (eq (assoc  "5" x) nil))
-  (Assert (eq (assq   "5" x) nil))
-  (Assert (eq (rassoc "5" x) (caddr x)))
-  (Assert (eq (rassq  "5" x) nil))
-  (Assert (eq (assoc  "6" x) nil))
-  (Assert (eq (assq   "6" x) nil))
-  (Assert (eq (rassoc "6" x) nil))
-  (Assert (eq (rassq  "6" x) nil)))
+  (Assert-eq (assoc  "1" x) (car x))
+  (Assert-eq (assq   "1" x) nil)
+  (Assert-eq (rassoc "1" x) nil)
+  (Assert-eq (rassq  "1" x) nil)
+  (Assert-eq (assoc  "2" x) nil)
+  (Assert-eq (assq   "2" x) nil)
+  (Assert-eq (rassoc "2" x) (car x))
+  (Assert-eq (rassq  "2" x) nil)
+  (Assert-eq (assoc  "3" x) nil)
+  (Assert-eq (assq   "3" x) nil)
+  (Assert-eq (rassoc "3" x) nil)
+  (Assert-eq (rassq  "3" x) nil)
+  (Assert-eq (assoc  "4" x) (caddr x))
+  (Assert-eq (assq   "4" x) nil)
+  (Assert-eq (rassoc "4" x) nil)
+  (Assert-eq (rassq  "4" x) nil)
+  (Assert-eq (assoc  "5" x) nil)
+  (Assert-eq (assq   "5" x) nil)
+  (Assert-eq (rassoc "5" x) (caddr x))
+  (Assert-eq (rassq  "5" x) nil)
+  (Assert-eq (assoc  "6" x) nil)
+  (Assert-eq (assq   "6" x) nil)
+  (Assert-eq (rassoc "6" x) nil)
+  (Assert-eq (rassq  "6" x) nil))
 
 (flet ((a () (list '(1 . 2) 3 '(4 . 5))))
   (Assert (let* ((x (a)) (y (remassoc  1 x))) (and (not (eq x y)) (equal y '(3 (4 . 5))))))
@@ -868,8 +868,8 @@
 ;;-----------------------------------------------------
 (defmacro check-function-argcounts (fun min max)
   `(progn
-     (Assert (eq (function-min-args ,fun) ,min))
-     (Assert (eq (function-max-args ,fun) ,max))))
+     (Assert-eq (function-min-args ,fun) ,min)
+     (Assert-eq (function-max-args ,fun) ,max)))
 
 (check-function-argcounts 'prog1 1 nil)         ; special form
 (check-function-argcounts 'command-execute 1 3)	; normal subr
@@ -896,7 +896,7 @@
     (list (0 . many))
     (type-of (1 . 1))
     (garbage-collect (0 . 0)))
-  do (Assert (equal (subr-arity (symbol-function function-name)) arity)))
+  do (Assert-equal (subr-arity (symbol-function function-name)) arity))
   
 (Check-Error wrong-type-argument (subr-arity
                                   (lambda () (message "Hi there!"))))
@@ -918,37 +918,37 @@
 ;;-----------------------------------------------------
 ;; Test `type-of'
 ;;-----------------------------------------------------
-(Assert (eq (type-of load-path) 'cons))
-(Assert (eq (type-of obarray) 'vector))
-(Assert (eq (type-of 42) 'integer))
-(Assert (eq (type-of ?z) 'character))
-(Assert (eq (type-of "42") 'string))
-(Assert (eq (type-of 'foo) 'symbol))
-(Assert (eq (type-of (selected-device)) 'device))
+(Assert-eq (type-of load-path) 'cons)
+(Assert-eq (type-of obarray) 'vector)
+(Assert-eq (type-of 42) 'integer)
+(Assert-eq (type-of ?z) 'character)
+(Assert-eq (type-of "42") 'string)
+(Assert-eq (type-of 'foo) 'symbol)
+(Assert-eq (type-of (selected-device)) 'device)
 
 ;;-----------------------------------------------------
 ;; Test mapping functions
 ;;-----------------------------------------------------
 (Check-Error wrong-type-argument (mapcar #'identity (current-buffer)))
-(Assert (equal (mapcar #'identity load-path) load-path))
-(Assert (equal (mapcar #'identity '(1 2 3)) '(1 2 3)))
-(Assert (equal (mapcar #'identity "123") '(?1 ?2 ?3)))
-(Assert (equal (mapcar #'identity [1 2 3]) '(1 2 3)))
-(Assert (equal (mapcar #'identity #*010) '(0 1 0)))
+(Assert-equal (mapcar #'identity load-path) load-path)
+(Assert-equal (mapcar #'identity '(1 2 3)) '(1 2 3))
+(Assert-equal (mapcar #'identity "123") '(?1 ?2 ?3))
+(Assert-equal (mapcar #'identity [1 2 3]) '(1 2 3))
+(Assert-equal (mapcar #'identity #*010) '(0 1 0))
 
 (let ((z 0) (list (make-list 1000 1)))
   (mapc (lambda (x) (incf z x)) list)
-  (Assert (eq 1000 z)))
+  (Assert-eq 1000 z))
 
 (Check-Error wrong-type-argument (mapvector #'identity (current-buffer)))
-(Assert (equal (mapvector #'identity '(1 2 3)) [1 2 3]))
-(Assert (equal (mapvector #'identity "123") [?1 ?2 ?3]))
-(Assert (equal (mapvector #'identity [1 2 3]) [1 2 3]))
-(Assert (equal (mapvector #'identity #*010) [0 1 0]))
+(Assert-equal (mapvector #'identity '(1 2 3)) [1 2 3])
+(Assert-equal (mapvector #'identity "123") [?1 ?2 ?3])
+(Assert-equal (mapvector #'identity [1 2 3]) [1 2 3])
+(Assert-equal (mapvector #'identity #*010) [0 1 0])
 
 (Check-Error wrong-type-argument (mapconcat #'identity (current-buffer) "foo"))
-(Assert (equal (mapconcat #'identity '("1" "2" "3") "|") "1|2|3"))
-(Assert (equal (mapconcat #'identity ["1" "2" "3"]  "|") "1|2|3"))
+(Assert-equal (mapconcat #'identity '("1" "2" "3") "|") "1|2|3")
+(Assert-equal (mapconcat #'identity ["1" "2" "3"]  "|") "1|2|3")
 
 ;; The following 2 functions used to crash XEmacs via mapcar1().
 ;; We don't test the actual values of the mapcar, since they're undefined.
@@ -973,32 +973,38 @@
       (car y))
     x)))
 
+(Assert-eql
+ (length (multiple-value-list
+          (car (mapcar #'(lambda (argument) (floor argument)) (list pi e)))))
+ 1
+ "checking multiple values are correctly discarded in mapcar")
+
 ;;-----------------------------------------------------
 ;; Test vector functions
 ;;-----------------------------------------------------
-(Assert (equal [1 2 3] [1 2 3]))
-(Assert (equal [] []))
+(Assert-equal [1 2 3] [1 2 3])
+(Assert-equal [] [])
 (Assert (not (equal [1 2 3] [])))
 (Assert (not (equal [1 2 3] [1 2 4])))
 (Assert (not (equal [0 2 3] [1 2 3])))
 (Assert (not (equal [1 2 3] [1 2 3 4])))
 (Assert (not (equal [1 2 3 4] [1 2 3])))
-(Assert (equal (vector 1 2 3) [1 2 3]))
-(Assert (equal (make-vector 3 1) [1 1 1]))
+(Assert-equal (vector 1 2 3) [1 2 3])
+(Assert-equal (make-vector 3 1) [1 1 1])
 
 ;;-----------------------------------------------------
 ;; Test bit-vector functions
 ;;-----------------------------------------------------
-(Assert (equal #*010 #*010))
-(Assert (equal #* #*))
+(Assert-equal #*010 #*010)
+(Assert-equal #* #*)
 (Assert (not (equal #*010 #*011)))
 (Assert (not (equal #*010 #*)))
 (Assert (not (equal #*110 #*010)))
 (Assert (not (equal #*010 #*0100)))
 (Assert (not (equal #*0101 #*010)))
-(Assert (equal (bit-vector 0 1 0) #*010))
-(Assert (equal (make-bit-vector 3 1) #*111))
-(Assert (equal (make-bit-vector 3 0) #*000))
+(Assert-equal (bit-vector 0 1 0) #*010)
+(Assert-equal (make-bit-vector 3 1) #*111)
+(Assert-equal (make-bit-vector 3 0) #*000)
 
 ;;-----------------------------------------------------
 ;; Test buffer-local variables used as (ugh!) function parameters
@@ -1016,120 +1022,179 @@
 ;; Hrvoje didn't like the next 3 tests so I'm disabling them for now. -sb
 ;; I assume Hrvoje worried about the possibility of infloops. -sjt
 (when test-harness-risk-infloops
-  (Assert (equal (split-string "foo" "") '("" "f" "o" "o" "")))
-  (Assert (equal (split-string "foo" "^") '("" "foo")))
-  (Assert (equal (split-string "foo" "$") '("foo" ""))))
-(Assert (equal (split-string "foo,bar" ",") '("foo" "bar")))
-(Assert (equal (split-string ",foo,bar," ",") '("" "foo" "bar" "")))
-(Assert (equal (split-string ",foo,bar," "^,") '("" "foo,bar,")))
-(Assert (equal (split-string ",foo,bar," ",$") '(",foo,bar" "")))
-(Assert (equal (split-string ",foo,,bar," ",") '("" "foo" "" "bar" "")))
-(Assert (equal (split-string "foo,,,bar" ",") '("foo" "" "" "bar")))
-(Assert (equal (split-string "foo,,bar,," ",") '("foo" "" "bar" "" "")))
-(Assert (equal (split-string "foo,,bar" ",+") '("foo" "bar")))
-(Assert (equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" "")))
+  (Assert-equal (split-string "foo" "") '("" "f" "o" "o" ""))
+  (Assert-equal (split-string "foo" "^") '("" "foo"))
+  (Assert-equal (split-string "foo" "$") '("foo" "")))
+(Assert-equal (split-string "foo,bar" ",") '("foo" "bar"))
+(Assert-equal (split-string ",foo,bar," ",") '("" "foo" "bar" ""))
+(Assert-equal (split-string ",foo,bar," "^,") '("" "foo,bar,"))
+(Assert-equal (split-string ",foo,bar," ",$") '(",foo,bar" ""))
+(Assert-equal (split-string ",foo,,bar," ",") '("" "foo" "" "bar" ""))
+(Assert-equal (split-string "foo,,,bar" ",") '("foo" "" "" "bar"))
+(Assert-equal (split-string "foo,,bar,," ",") '("foo" "" "bar" "" ""))
+(Assert-equal (split-string "foo,,bar" ",+") '("foo" "bar"))
+(Assert-equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" ""))
 ;; Omit nulls, explicit SEPARATORS
 (when test-harness-risk-infloops
-  (Assert (equal (split-string "foo" "" t) '("f" "o" "o")))
-  (Assert (equal (split-string "foo" "^" t) '("foo")))
-  (Assert (equal (split-string "foo" "$" t) '("foo"))))
-(Assert (equal (split-string "foo,bar" "," t) '("foo" "bar")))
-(Assert (equal (split-string ",foo,bar," "," t) '("foo" "bar")))
-(Assert (equal (split-string ",foo,bar," "^," t) '("foo,bar,")))
-(Assert (equal (split-string ",foo,bar," ",$" t) '(",foo,bar")))
-(Assert (equal (split-string ",foo,,bar," "," t) '("foo" "bar")))
-(Assert (equal (split-string "foo,,,bar" "," t) '("foo" "bar")))
-(Assert (equal (split-string "foo,,bar,," "," t) '("foo" "bar")))
-(Assert (equal (split-string "foo,,bar" ",+" t) '("foo" "bar")))
-(Assert (equal (split-string ",foo,,bar," ",+" t) '("foo" "bar")))
+  (Assert-equal (split-string "foo" "" t) '("f" "o" "o"))
+  (Assert-equal (split-string "foo" "^" t) '("foo"))
+  (Assert-equal (split-string "foo" "$" t) '("foo")))
+(Assert-equal (split-string "foo,bar" "," t) '("foo" "bar"))
+(Assert-equal (split-string ",foo,bar," "," t) '("foo" "bar"))
+(Assert-equal (split-string ",foo,bar," "^," t) '("foo,bar,"))
+(Assert-equal (split-string ",foo,bar," ",$" t) '(",foo,bar"))
+(Assert-equal (split-string ",foo,,bar," "," t) '("foo" "bar"))
+(Assert-equal (split-string "foo,,,bar" "," t) '("foo" "bar"))
+(Assert-equal (split-string "foo,,bar,," "," t) '("foo" "bar"))
+(Assert-equal (split-string "foo,,bar" ",+" t) '("foo" "bar"))
+(Assert-equal (split-string ",foo,,bar," ",+" t) '("foo" "bar"))
 ;; "Double-default" case
-(Assert (equal (split-string "foo bar") '("foo" "bar")))
-(Assert (equal (split-string " foo bar ") '("foo" "bar")))
-(Assert (equal (split-string " foo  bar ") '("foo" "bar")))
-(Assert (equal (split-string "foo   bar") '("foo" "bar")))
-(Assert (equal (split-string "foo  bar  ") '("foo" "bar")))
-(Assert (equal (split-string "foobar") '("foobar")))
+(Assert-equal (split-string "foo bar") '("foo" "bar"))
+(Assert-equal (split-string " foo bar ") '("foo" "bar"))
+(Assert-equal (split-string " foo  bar ") '("foo" "bar"))
+(Assert-equal (split-string "foo   bar") '("foo" "bar"))
+(Assert-equal (split-string "foo  bar  ") '("foo" "bar"))
+(Assert-equal (split-string "foobar") '("foobar"))
 ;; Semantics are identical to "double-default" case!  Fool ya?
-(Assert (equal (split-string "foo bar" nil t) '("foo" "bar")))
-(Assert (equal (split-string " foo bar " nil t) '("foo" "bar")))
-(Assert (equal (split-string " foo  bar " nil t) '("foo" "bar")))
-(Assert (equal (split-string "foo   bar" nil t) '("foo" "bar")))
-(Assert (equal (split-string "foo  bar  " nil t) '("foo" "bar")))
-(Assert (equal (split-string "foobar" nil t) '("foobar")))
+(Assert-equal (split-string "foo bar" nil t) '("foo" "bar"))
+(Assert-equal (split-string " foo bar " nil t) '("foo" "bar"))
+(Assert-equal (split-string " foo  bar " nil t) '("foo" "bar"))
+(Assert-equal (split-string "foo   bar" nil t) '("foo" "bar"))
+(Assert-equal (split-string "foo  bar  " nil t) '("foo" "bar"))
+(Assert-equal (split-string "foobar" nil t) '("foobar"))
 ;; Perverse "anti-double-default" case
-(Assert (equal (split-string "foo bar" split-string-default-separators)
-	       '("foo" "bar")))
-(Assert (equal (split-string " foo bar " split-string-default-separators)
-	       '("" "foo" "bar" "")))
-(Assert (equal (split-string " foo  bar " split-string-default-separators)
-	       '("" "foo" "bar" "")))
-(Assert (equal (split-string "foo   bar" split-string-default-separators)
-	       '("foo" "bar")))
-(Assert (equal (split-string "foo  bar  " split-string-default-separators)
-	       '("foo" "bar" "")))
-(Assert (equal (split-string "foobar" split-string-default-separators)
-	       '("foobar")))
+(Assert-equal (split-string "foo bar" split-string-default-separators)
+	       '("foo" "bar"))
+(Assert-equal (split-string " foo bar " split-string-default-separators)
+	       '("" "foo" "bar" ""))
+(Assert-equal (split-string " foo  bar " split-string-default-separators)
+	       '("" "foo" "bar" ""))
+(Assert-equal (split-string "foo   bar" split-string-default-separators)
+	       '("foo" "bar"))
+(Assert-equal (split-string "foo  bar  " split-string-default-separators)
+	       '("foo" "bar" ""))
+(Assert-equal (split-string "foobar" split-string-default-separators)
+	       '("foobar"))
+
+;;-----------------------------------------------------
+;; Test split-string-by-char
+;;-----------------------------------------------------
 
-(Assert (not (string-match "\\(\\.\\=\\)" ".")))
-(Assert (string= "" (let ((str "test string"))
-		      (if (string-match "^.*$" str)
-			  (replace-match "\\U" t nil str)))))
-(with-temp-buffer
-  (erase-buffer)
-  (insert "test string")
-  (re-search-backward "^.*$")
-  (replace-match "\\U" t)
-  (Assert (and (bobp) (eobp))))
+(Assert
+ (equal
+  (split-string-by-char
+   #r"re\:ee:this\\is\\text\\\\:oo\ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
+wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
+unreinen\: Geister br�ten.\\
+Serum concentrations of vitamin E: (alpha-tocopherol) depend on the liver,
+which takes up the nutrient after the various forms are absorbed from the
+small intestine. The liver preferentially resecretes only alpha-tocopherol
+via the hepatic alpha-tocopherol transfer protein"
+  ?: ?\\)
+  '("re:ee" "this\\is\\text\\\\" "oops" "
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
+wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
+unreinen: Geister br�ten.\\
+Serum concentrations of vitamin E" " (alpha-tocopherol) depend on the liver,
+which takes up the nutrient after the various forms are absorbed from the
+small intestine. The liver preferentially resecretes only alpha-tocopherol
+via the hepatic alpha-tocopherol transfer protein")))
+(Assert
+ (equal
+  (split-string-by-char
+   #r"re\:ee:this\\is\\text\\\\:oo\ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
+wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
+unreinen\: Geister br�ten.\\
+Serum concentrations of vitamin E: (alpha-tocopherol) depend on the liver,
+which takes up the nutrient after the various forms are absorbed from the
+small intestine. The liver preferentially resecretes only alpha-tocopherol
+via the hepatic alpha-tocopherol transfer protein"
+   ?: ?\x00)
+  '("re\\" "ee" "this\\\\is\\\\text\\\\\\\\" "oo\\ps" "
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
+wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
+unreinen\\" " Geister br�ten.\\\\
+Serum concentrations of vitamin E" " (alpha-tocopherol) depend on the liver,
+which takes up the nutrient after the various forms are absorbed from the
+small intestine. The liver preferentially resecretes only alpha-tocopherol
+via the hepatic alpha-tocopherol transfer protein")))
+(Assert
+ (equal
+  (split-string-by-char
+   #r"re\:ee:this\\is\\text\\\\:oo\ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
+wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
+unreinen\: Geister br�ten.\\
+Serum concentrations of vitamin E: (alpha-tocopherol) depend on the liver,
+which takes up the nutrient after the various forms are absorbed from the
+small intestine. The liver preferentially resecretes only alpha-tocopherol
+via the hepatic alpha-tocopherol transfer protein" ?\\)
+  '("re" ":ee:this" "" "is" "" "text" "" "" "" ":oo" "ps:
+Eine Sprache, die stagnirt, ist zu vergleichen mit einem See, dem der
+bisherige Quellenzuflu� versiegt oder abgeleitet wird. Aus dem Wasser,
+wor�ber der Geist Gottes schwebte, wird Sumpf und Moder, wor�ber die
+unreinen" ": Geister br�ten." "" "
+Serum concentrations of vitamin E: (alpha-tocopherol) depend on the liver,
+which takes up the nutrient after the various forms are absorbed from the
+small intestine. The liver preferentially resecretes only alpha-tocopherol
+via the hepatic alpha-tocopherol transfer protein")))
 
 ;;-----------------------------------------------------
 ;; Test near-text buffer functions.
 ;;-----------------------------------------------------
 (with-temp-buffer
   (erase-buffer)
-  (Assert (eq (char-before) nil))
-  (Assert (eq (char-before (point)) nil))
-  (Assert (eq (char-before (point-marker)) nil))
-  (Assert (eq (char-before (point) (current-buffer)) nil))
-  (Assert (eq (char-before (point-marker) (current-buffer)) nil))
-  (Assert (eq (char-after) nil))
-  (Assert (eq (char-after (point)) nil))
-  (Assert (eq (char-after (point-marker)) nil))
-  (Assert (eq (char-after (point) (current-buffer)) nil))
-  (Assert (eq (char-after (point-marker) (current-buffer)) nil))
-  (Assert (eq (preceding-char) 0))
-  (Assert (eq (preceding-char (current-buffer)) 0))
-  (Assert (eq (following-char) 0))
-  (Assert (eq (following-char (current-buffer)) 0))
+  (Assert-eq (char-before) nil)
+  (Assert-eq (char-before (point)) nil)
+  (Assert-eq (char-before (point-marker)) nil)
+  (Assert-eq (char-before (point) (current-buffer)) nil)
+  (Assert-eq (char-before (point-marker) (current-buffer)) nil)
+  (Assert-eq (char-after) nil)
+  (Assert-eq (char-after (point)) nil)
+  (Assert-eq (char-after (point-marker)) nil)
+  (Assert-eq (char-after (point) (current-buffer)) nil)
+  (Assert-eq (char-after (point-marker) (current-buffer)) nil)
+  (Assert-eq (preceding-char) 0)
+  (Assert-eq (preceding-char (current-buffer)) 0)
+  (Assert-eq (following-char) 0)
+  (Assert-eq (following-char (current-buffer)) 0)
   (insert "foobar")
-  (Assert (eq (char-before) ?r))
-  (Assert (eq (char-after) nil))
-  (Assert (eq (preceding-char) ?r))
-  (Assert (eq (following-char) 0))
+  (Assert-eq (char-before) ?r)
+  (Assert-eq (char-after) nil)
+  (Assert-eq (preceding-char) ?r)
+  (Assert-eq (following-char) 0)
   (goto-char (point-min))
-  (Assert (eq (char-before) nil))
-  (Assert (eq (char-after) ?f))
-  (Assert (eq (preceding-char) 0))
-  (Assert (eq (following-char) ?f))
+  (Assert-eq (char-before) nil)
+  (Assert-eq (char-after) ?f)
+  (Assert-eq (preceding-char) 0)
+  (Assert-eq (following-char) ?f)
   )
 
 ;;-----------------------------------------------------
 ;; Test plist manipulation functions.
 ;;-----------------------------------------------------
 (let ((sym (make-symbol "test-symbol")))
-  (Assert (eq t (get* sym t t)))
-  (Assert (eq t (get  sym t t)))
-  (Assert (eq t (getf nil t t)))
-  (Assert (eq t (plist-get nil t t)))
+  (Assert-eq t (get* sym t t))
+  (Assert-eq t (get  sym t t))
+  (Assert-eq t (getf nil t t))
+  (Assert-eq t (plist-get nil t t))
   (put sym 'bar 'baz)
-  (Assert (eq 'baz (get sym 'bar)))
-  (Assert (eq 'baz (getf '(bar baz) 'bar)))
-  (Assert (eq 'baz (getf (symbol-plist sym) 'bar)))
-  (Assert (eq 2 (getf '(1 2) 1)))
-  (Assert (eq 4 (put sym 3 4)))
-  (Assert (eq 4 (get sym 3)))
-  (Assert (eq t (remprop sym 3)))
-  (Assert (eq nil (remprop sym 3)))
-  (Assert (eq 5 (get sym 3 5)))
+  (Assert-eq 'baz (get sym 'bar))
+  (Assert-eq 'baz (getf '(bar baz) 'bar))
+  (Assert-eq 'baz (getf (symbol-plist sym) 'bar))
+  (Assert-eq 2 (getf '(1 2) 1))
+  (Assert-eq 4 (put sym 3 4))
+  (Assert-eq 4 (get sym 3))
+  (Assert-eq t (remprop sym 3))
+  (Assert-eq nil (remprop sym 3))
+  (Assert-eq 5 (get sym 3 5))
   )
 
 (loop for obj in
@@ -1138,18 +1203,18 @@
 	(make-extent nil nil nil)
 	(make-face 'test-face))
   do
-  (Assert (eq 2 (get obj ?1 2)) obj)
-  (Assert (eq 4 (put obj ?3 4)) obj)
-  (Assert (eq 4 (get obj ?3)) obj)
+  (Assert-eq 2 (get obj ?1 2) obj)
+  (Assert-eq 4 (put obj ?3 4) obj)
+  (Assert-eq 4 (get obj ?3) obj)
   (when (or (stringp obj) (symbolp obj))
-    (Assert (equal '(?3 4) (object-plist obj)) obj))
-  (Assert (eq t (remprop obj ?3)) obj)
+    (Assert-equal '(?3 4) (object-plist obj) obj))
+  (Assert-eq t (remprop obj ?3) obj)
   (when (or (stringp obj) (symbolp obj))
-    (Assert (eq '() (object-plist obj)) obj))
-  (Assert (eq nil (remprop obj ?3)) obj)
+    (Assert-eq '() (object-plist obj) obj))
+  (Assert-eq nil (remprop obj ?3) obj)
   (when (or (stringp obj) (symbolp obj))
-    (Assert (eq '() (object-plist obj)) obj))
-  (Assert (eq 5 (get obj ?3 5)) obj)
+    (Assert-eq '() (object-plist obj) obj))
+  (Assert-eq 5 (get obj ?3 5) obj)
   )
 
 (Check-Error-Message
@@ -1175,15 +1240,15 @@
 ;;-----------------------------------------------------
 ;; Test subseq
 ;;-----------------------------------------------------
-(Assert (equal (subseq nil 0) nil))
-(Assert (equal (subseq [1 2 3] 0) [1 2 3]))
-(Assert (equal (subseq [1 2 3] 1 -1) [2]))
-(Assert (equal (subseq "123" 0) "123"))
-(Assert (equal (subseq "1234" -3 -1) "23"))
-(Assert (equal (subseq #*0011 0) #*0011))
-(Assert (equal (subseq #*0011 -3 3) #*01))
-(Assert (equal (subseq '(1 2 3) 0) '(1 2 3)))
-(Assert (equal (subseq '(1 2 3 4) -3 nil) '(2 3 4)))
+(Assert-equal (subseq nil 0) nil)
+(Assert-equal (subseq [1 2 3] 0) [1 2 3])
+(Assert-equal (subseq [1 2 3] 1 -1) [2])
+(Assert-equal (subseq "123" 0) "123")
+(Assert-equal (subseq "1234" -3 -1) "23")
+(Assert-equal (subseq #*0011 0) #*0011)
+(Assert-equal (subseq #*0011 -3 3) #*01)
+(Assert-equal (subseq '(1 2 3) 0) '(1 2 3))
+(Assert-equal (subseq '(1 2 3 4) -3 nil) '(2 3 4))
 
 (Check-Error wrong-type-argument (subseq 3 2))
 (Check-Error args-out-of-range (subseq [1 2 3] -42))
@@ -1192,7 +1257,7 @@
 ;;-----------------------------------------------------
 ;; Time-related tests
 ;;-----------------------------------------------------
-(Assert (= (length (current-time-string)) 24))
+(Assert= (length (current-time-string)) 24)
 
 ;;-----------------------------------------------------
 ;; format test
@@ -1282,20 +1347,20 @@
 
 ;;; The following two tests used to use 1000 instead of 100,
 ;;; but that merely found buffer overflow bugs in Solaris sprintf().
-(Assert (= 102 (length (format "%.100f" 3.14))))
-(Assert (= 100 (length (format "%100f" 3.14))))
+(Assert= 102 (length (format "%.100f" 3.14)))
+(Assert= 100 (length (format "%100f" 3.14)))
 
 ;;; Check for 64-bit cleanness on LP64 platforms.
-(Assert (= (read (format "%d"  most-positive-fixnum)) most-positive-fixnum))
-(Assert (= (read (format "%ld" most-positive-fixnum)) most-positive-fixnum))
-(Assert (= (read (format "%u"  most-positive-fixnum)) most-positive-fixnum))
-(Assert (= (read (format "%lu" most-positive-fixnum)) most-positive-fixnum))
-(Assert (= (read (format "%d"  most-negative-fixnum)) most-negative-fixnum))
-(Assert (= (read (format "%ld" most-negative-fixnum)) most-negative-fixnum))
+(Assert= (read (format "%d"  most-positive-fixnum)) most-positive-fixnum)
+(Assert= (read (format "%ld" most-positive-fixnum)) most-positive-fixnum)
+(Assert= (read (format "%u"  most-positive-fixnum)) most-positive-fixnum)
+(Assert= (read (format "%lu" most-positive-fixnum)) most-positive-fixnum)
+(Assert= (read (format "%d"  most-negative-fixnum)) most-negative-fixnum)
+(Assert= (read (format "%ld" most-negative-fixnum)) most-negative-fixnum)
 
 ;; These used to crash. 
-(Assert (eql (read (format "%f" 1.2e+302)) 1.2e+302))
-(Assert (eql (read (format "%.1000d" 1)) 1))
+(Assert-eql (read (format "%f" 1.2e+302)) 1.2e+302)
+(Assert-eql (read (format "%.1000d" 1)) 1)
 
 ;;; "%u" is undocumented, and Emacs Lisp has no unsigned type.
 ;;; What to do if "%u" is used with a negative number?
@@ -1353,12 +1418,12 @@
   (if (= new-char old-char)
       (setq new-char ?/))
   (aset load-file-name 0 new-char)
-  (Assert (= new-char (aref load-file-name 0))
+  (Assert= new-char (aref load-file-name 0)
 	  \"Check that we can modify the string value of load-file-name\"))
 
 (let* ((new-load-file-name \"hi there\")
        (load-file-name new-load-file-name))
-  (Assert (eq new-load-file-name load-file-name)
+  (Assert-eq new-load-file-name load-file-name
 	  \"Checking that we can bind load-file-name successfully.\"))
 
 ")
@@ -1402,137 +1467,137 @@
 			 one-fround-result two-fround-result
 			 one-truncate-result two-truncate-result
 			 one-ftruncate-result two-ftruncate-result)
-	 (Assert (equal one-floor-result (multiple-value-list
-					  (floor first)))
+	 (Assert-equal one-floor-result (multiple-value-list
+					  (floor first))
 		 (format "checking (floor %S) gives %S"
 			 first one-floor-result))
-	 (Assert (equal one-floor-result (multiple-value-list
-					  (floor first 1)))
+	 (Assert-equal one-floor-result (multiple-value-list
+					  (floor first 1))
 		 (format "checking (floor %S 1) gives %S"
 			 first one-floor-result))
 	 (Check-Error arith-error (floor first 0))
 	 (Check-Error arith-error (floor first 0.0))
-	 (Assert (equal two-floor-result (multiple-value-list
-					  (floor first second)))
+	 (Assert-equal two-floor-result (multiple-value-list
+					  (floor first second))
 		 (format
 		  "checking (floor %S %S) gives %S"
 		  first second two-floor-result))
-	 (Assert (equal (cl-floor first second)
-			(multiple-value-list (floor first second)))
+	 (Assert-equal (cl-floor first second)
+			(multiple-value-list (floor first second))
 		 (format
 		  "checking (floor %S %S) gives the same as the old code"
 		  first second))
-	 (Assert (equal one-ffloor-result (multiple-value-list
-					   (ffloor first)))
+	 (Assert-equal one-ffloor-result (multiple-value-list
+					   (ffloor first))
 		 (format "checking (ffloor %S) gives %S"
 			 first one-ffloor-result))
-	 (Assert (equal one-ffloor-result (multiple-value-list
-					   (ffloor first 1)))
+	 (Assert-equal one-ffloor-result (multiple-value-list
+					   (ffloor first 1))
 		 (format "checking (ffloor %S 1) gives %S"
 			 first one-ffloor-result))
 	 (Check-Error arith-error (ffloor first 0))
 	 (Check-Error arith-error (ffloor first 0.0))
-	 (Assert (equal two-ffloor-result (multiple-value-list
-					   (ffloor first second)))
+	 (Assert-equal two-ffloor-result (multiple-value-list
+					   (ffloor first second))
 		 (format "checking (ffloor %S %S) gives %S"
 			 first second two-ffloor-result))
-	 (Assert (equal one-ceiling-result (multiple-value-list
-					    (ceiling first)))
+	 (Assert-equal one-ceiling-result (multiple-value-list
+					    (ceiling first))
 		 (format "checking (ceiling %S) gives %S"
 			 first one-ceiling-result))
-	 (Assert (equal one-ceiling-result (multiple-value-list
-					    (ceiling first 1)))
+	 (Assert-equal one-ceiling-result (multiple-value-list
+					    (ceiling first 1))
 		 (format "checking (ceiling %S 1) gives %S"
 			 first one-ceiling-result))
 	 (Check-Error arith-error (ceiling first 0))
 	 (Check-Error arith-error (ceiling first 0.0))
-	 (Assert (equal two-ceiling-result (multiple-value-list
-					    (ceiling first second)))
+	 (Assert-equal two-ceiling-result (multiple-value-list
+					    (ceiling first second))
 		 (format "checking (ceiling %S %S) gives %S"
 			 first second two-ceiling-result))
-	 (Assert (equal (cl-ceiling first second)
-			(multiple-value-list (ceiling first second)))
+	 (Assert-equal (cl-ceiling first second)
+			(multiple-value-list (ceiling first second))
 		 (format
 		  "checking (ceiling %S %S) gives the same as the old code"
 		  first second))
-	 (Assert (equal one-fceiling-result (multiple-value-list
-					     (fceiling first)))
+	 (Assert-equal one-fceiling-result (multiple-value-list
+					     (fceiling first))
 		 (format "checking (fceiling %S) gives %S"
 			 first one-fceiling-result))
-	 (Assert (equal one-fceiling-result (multiple-value-list
-					     (fceiling first 1)))
+	 (Assert-equal one-fceiling-result (multiple-value-list
+					     (fceiling first 1))
 		 (format "checking (fceiling %S 1) gives %S"
 			 first one-fceiling-result))
 	 (Check-Error arith-error (fceiling first 0))
 	 (Check-Error arith-error (fceiling first 0.0))
-	 (Assert (equal two-fceiling-result (multiple-value-list
-					  (fceiling first second)))
+	 (Assert-equal two-fceiling-result (multiple-value-list
+					  (fceiling first second))
 		 (format "checking (fceiling %S %S) gives %S"
 			 first second two-fceiling-result))
-	 (Assert (equal one-round-result (multiple-value-list
-					  (round first)))
+	 (Assert-equal one-round-result (multiple-value-list
+					  (round first))
 		 (format "checking (round %S) gives %S"
 			 first one-round-result))
-	 (Assert (equal one-round-result (multiple-value-list
-					  (round first 1)))
+	 (Assert-equal one-round-result (multiple-value-list
+					  (round first 1))
 		 (format "checking (round %S 1) gives %S"
 			 first one-round-result))
 	 (Check-Error arith-error (round first 0))
 	 (Check-Error arith-error (round first 0.0))
-	 (Assert (equal two-round-result (multiple-value-list
-					  (round first second)))
+	 (Assert-equal two-round-result (multiple-value-list
+					  (round first second))
 		 (format "checking (round %S %S) gives %S"
 			 first second two-round-result))
-	 (Assert (equal one-fround-result (multiple-value-list
-					   (fround first)))
+	 (Assert-equal one-fround-result (multiple-value-list
+					   (fround first))
 		 (format "checking (fround %S) gives %S"
 			 first one-fround-result))
-	 (Assert (equal one-fround-result (multiple-value-list
-					   (fround first 1)))
+	 (Assert-equal one-fround-result (multiple-value-list
+					   (fround first 1))
 		 (format "checking (fround %S 1) gives %S"
 			 first one-fround-result))
 	 (Check-Error arith-error (fround first 0))
 	 (Check-Error arith-error (fround first 0.0))
-	 (Assert (equal two-fround-result (multiple-value-list
-					   (fround first second)))
+	 (Assert-equal two-fround-result (multiple-value-list
+					   (fround first second))
 		 (format "checking (fround %S %S) gives %S"
 			 first second two-fround-result))
-	 (Assert (equal (cl-round first second)
-			(multiple-value-list (round first second)))
+	 (Assert-equal (cl-round first second)
+			(multiple-value-list (round first second))
 		 (format
 		  "checking (round %S %S) gives the same as the old code"
 		  first second))
-	 (Assert (equal one-truncate-result (multiple-value-list
-					     (truncate first)))
+	 (Assert-equal one-truncate-result (multiple-value-list
+					     (truncate first))
 		 (format "checking (truncate %S) gives %S"
 			 first one-truncate-result))
-	 (Assert (equal one-truncate-result (multiple-value-list
-					     (truncate first 1)))
+	 (Assert-equal one-truncate-result (multiple-value-list
+					     (truncate first 1))
 		 (format "checking (truncate %S 1) gives %S"
 			 first one-truncate-result))
 	 (Check-Error arith-error (truncate first 0))
 	 (Check-Error arith-error (truncate first 0.0))
-	 (Assert (equal two-truncate-result (multiple-value-list
-					     (truncate first second)))
+	 (Assert-equal two-truncate-result (multiple-value-list
+					     (truncate first second))
 		 (format "checking (truncate %S %S) gives %S"
 			 first second two-truncate-result))
-	 (Assert (equal (cl-truncate first second)
-			(multiple-value-list (truncate first second)))
+	 (Assert-equal (cl-truncate first second)
+			(multiple-value-list (truncate first second))
 		 (format
 		  "checking (truncate %S %S) gives the same as the old code"
 		  first second))
-	 (Assert (equal one-ftruncate-result (multiple-value-list
-					      (ftruncate first)))
+	 (Assert-equal one-ftruncate-result (multiple-value-list
+					      (ftruncate first))
 		 (format "checking (ftruncate %S) gives %S"
 			 first one-ftruncate-result))
-	 (Assert (equal one-ftruncate-result (multiple-value-list
-					      (ftruncate first 1)))
+	 (Assert-equal one-ftruncate-result (multiple-value-list
+					      (ftruncate first 1))
 		 (format "checking (ftruncate %S 1) gives %S"
 			 first one-ftruncate-result))
 	 (Check-Error arith-error (ftruncate first 0))
 	 (Check-Error arith-error (ftruncate first 0.0))
-	 (Assert (equal two-ftruncate-result (multiple-value-list
-					      (ftruncate first second)))
+	 (Assert-equal two-ftruncate-result (multiple-value-list
+					      (ftruncate first second))
 		 (format "checking (ftruncate %S %S) gives %S"
 			 first second two-ftruncate-result)))
        (Assert-rounding-floating (pie ee)
@@ -1968,41 +2033,34 @@
 		 (foo-zero 400 (1+ most-positive-fixnum)))))
    "Checking multiple values are discarded correctly when forced")
   (Check-Error setting-constant (setq multiple-values-limit 20))
-  (Assert
-   (equal '(-1 1)
-	  (multiple-value-list (floor -3 4)))
+  (Assert-equal '(-1 1)
+	  (multiple-value-list (floor -3 4))
    "Checking #'multiple-value-list gives a sane result")
   (let ((ey 40000)
 	(bee "this is a string")
 	(cee #s(hash-table size 256 data (969 ?\xF9))))
-    (Assert
-     (equal
-      (multiple-value-list (values ey bee cee))
-      (multiple-value-list (values-list (list ey bee cee))))
+    (Assert-equal
+     (multiple-value-list (values ey bee cee))
+     (multiple-value-list (values-list (list ey bee cee)))
      "Checking that #'values and #'values-list are correctly related")
-    (Assert
-     (equal
-      (multiple-value-list (values-list (list ey bee cee)))
-      (multiple-value-list (apply #'values (list ey bee cee))))
+    (Assert-equal
+     (multiple-value-list (values-list (list ey bee cee)))
+     (multiple-value-list (apply #'values (list ey bee cee)))
      "Checking #'values-list and #'apply with #values are correctly related"))
-  (Assert
-   (= (multiple-value-call #'+ (floor 5 3) (floor 19 4)) 10)
+  (Assert= (multiple-value-call #'+ (floor 5 3) (floor 19 4)) 10
    "Checking #'multiple-value-call gives reasonable results.")
-  (Assert
-   (= (multiple-value-call (values '+ '*) (floor 5 3) (floor 19 4)) 10)
+  (Assert= (multiple-value-call (values '+ '*) (floor 5 3) (floor 19 4)) 10
    "Checking #'multiple-value-call correct when first arg multiple.")
-  (Assert
-   (= 1 (length (multiple-value-list (prog1 (floor pi) "hi there"))))
+  (Assert= 1 (length (multiple-value-list (prog1 (floor pi) "hi there")))
    "Checking #'prog1 does not pass back multiple values")
-  (Assert
-   (= 2 (length (multiple-value-list
-		 (multiple-value-prog1 (floor pi) "hi there"))))
+  (Assert= 2 (length (multiple-value-list
+		 (multiple-value-prog1 (floor pi) "hi there")))
    "Checking #'multiple-value-prog1 passes back multiple values")
   (multiple-value-bind (floored remainder this-is-nil)
       (floor pi 1.0)
-    (Assert (= floored 3)
+    (Assert= floored 3
 	    "Checking floored bound correctly")
-    (Assert (eql remainder (- pi 3.0))
+    (Assert-eql remainder (- pi 3.0)
 	    "Checking remainder bound correctly") 
     (Assert (null this-is-nil)
 	    "Checking trailing arg bound but nil"))
@@ -2011,88 +2069,243 @@
 	(cee #s(hash-table size 256 data (969 ?\xF9))))
     (multiple-value-setq (ey bee cee)
       (ffloor e 1.0))
-    (Assert (eql 2.0 ey) "Checking ey set correctly")
-    (Assert (eql bee (- e 2.0)) "Checking bee set correctly")
+    (Assert-eql 2.0 ey "Checking ey set correctly")
+    (Assert-eql bee (- e 2.0) "Checking bee set correctly")
     (Assert (null cee) "Checking cee set to nil correctly"))
-  (Assert
-   (= 3 (length (multiple-value-list (eval '(values nil t pi)))))
+  (Assert= 3 (length (multiple-value-list (eval '(values nil t pi))))
    "Checking #'eval passes back multiple values")
-  (Assert
-   (= 2 (length (multiple-value-list (apply #'floor '(5 3)))))
+  (Assert= 2 (length (multiple-value-list (apply #'floor '(5 3))))
    "Checking #'apply passes back multiple values")
-  (Assert 
-   (= 2 (length (multiple-value-list (funcall #'floor 5 3))))
+  (Assert= 2 (length (multiple-value-list (funcall #'floor 5 3)))
    "Checking #'funcall passes back multiple values")
-  (Assert 
-   (equal '(1 2) (multiple-value-list 
-		  (multiple-value-call #'floor (values 5 3))))
+  (Assert-equal '(1 2) (multiple-value-list 
+		  (multiple-value-call #'floor (values 5 3)))
    "Checking #'multiple-value-call passes back multiple values correctly")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (and (multiple-value-function-returning-nil) t))))
+  (Assert= 1 (length (multiple-value-list
+		 (and (multiple-value-function-returning-nil) t)))
    "Checking multiple values from non-trailing forms discarded by #'and")
-  (Assert
-   (= 5 (length (multiple-value-list 
-		 (and t (multiple-value-function-returning-nil)))))
+  (Assert= 5 (length (multiple-value-list 
+		 (and t (multiple-value-function-returning-nil))))
    "Checking multiple values from final forms not discarded by #'and")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (or (multiple-value-function-returning-t) t))))
+  (Assert= 1 (length (multiple-value-list
+		 (or (multiple-value-function-returning-t) t)))
    "Checking multiple values from non-trailing forms discarded by #'and")
-  (Assert
-   (= 5 (length (multiple-value-list 
-		 (or nil (multiple-value-function-returning-t)))))
+  (Assert= 5 (length (multiple-value-list 
+		 (or nil (multiple-value-function-returning-t))))
    "Checking multiple values from final forms not discarded by #'and")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (cond ((multiple-value-function-returning-t))))))
+  (Assert= 1 (length (multiple-value-list
+		 (cond ((multiple-value-function-returning-t)))))
    "Checking cond doesn't pass back multiple values in tests.")
-  (Assert
-   (equal (list nil pi e radians-to-degrees degrees-to-radians)
+  (Assert-equal (list nil pi e radians-to-degrees degrees-to-radians)
 	  (multiple-value-list
-	   (cond (t (multiple-value-function-returning-nil)))))
+	   (cond (t (multiple-value-function-returning-nil))))
    "Checking cond passes back multiple values in clauses.")
-  (Assert
-   (= 1 (length (multiple-value-list
-		 (prog1 (multiple-value-function-returning-nil)))))
+  (Assert= 1 (length (multiple-value-list
+		 (prog1 (multiple-value-function-returning-nil))))
    "Checking prog1 discards multiple values correctly.")
-  (Assert
-   (= 5 (length (multiple-value-list
+  (Assert= 5 (length (multiple-value-list
 		 (multiple-value-prog1
-		  (multiple-value-function-returning-nil)))))
+		  (multiple-value-function-returning-nil))))
    "Checking multiple-value-prog1 passes back multiple values correctly.")
-  (Assert
-   (equal (list t pi e degrees-to-radians radians-to-degrees)
+  (Assert-equal (list t pi e degrees-to-radians radians-to-degrees)
 	  (multiple-value-list
-	   (catch 'VoN61Lo4Y (function-throwing-multiple-values)))))
-  (Assert
-   (equal (list t pi e degrees-to-radians radians-to-degrees)
+	   (catch 'VoN61Lo4Y (function-throwing-multiple-values))))
+  (Assert-equal (list t pi e degrees-to-radians radians-to-degrees)
 	  (multiple-value-list
 	   (loop
 	     for eye in `(a b c d ,e f g ,nil ,pi)
 	     do (when (null eye)
-		  (return (multiple-value-function-returning-t))))))
+		  (return (multiple-value-function-returning-t)))))
    "Checking #'loop passes back multiple values correctly.")
   (Assert
    (null (or))
    "Checking #'or behaves correctly with zero arguments.")
-  (Assert
-   (eq t (and))
+  (Assert-eq t (and)
    "Checking #'and behaves correctly with zero arguments.")
-  (Assert
-   (= (* 3.0 (- pi 3.0))
+  (Assert= (* 3.0 (- pi 3.0))
       (letf (((values three one-four-one-five-nine) (floor pi)))
-        (* three one-four-one-five-nine)))
+        (* three one-four-one-five-nine))
    "checking letf handles #'values in a basic sense"))
 
-(Assert (equalp "hi there" "Hi There")
-	"checking equalp isn't case-sensitive")
-(Assert (equalp 99 99.0)
-	"checking equalp compares numerical values of different types")
-(Assert (null (equalp 99 ?c))
-	"checking equalp does not convert characters to numbers")
-;; Fixed in Hg d0ea57eb3de4.
-(Assert (null (equalp "hi there" [hi there]))
-	"checking equalp doesn't error with string and non-string")
+;; #'equalp tests.
+(let ((string-variable "aBcDeeFgH\u00Edj")
+      (eacute-character ?\u00E9)
+      (Eacute-character ?\u00c9)
+      (+base-chars+ (loop
+		      with res = (make-string 96 ?\x20)
+		      for int-char from #x20 to #x7f
+		      for char being each element in-ref res
+		      do (setf char (int-to-char int-char))
+		      finally return res)))
+  (let ((equal-lists
+	 '((111111111111111111111111111111111111111111111111111
+	    111111111111111111111111111111111111111111111111111.0)
+	   (0 0.0 0.000 -0 -0.0 -0.000 #b0 0/5 -0/5)
+	   (21845 #b101010101010101 #x5555)
+	   (1.5 1.500000000000000000000000000000000000000000000000000000000
+		3/2)
+	   (-55 -110/2)
+	   ;; Can't use this, these values aren't `='.
+	   ;;(-12345678901234567890123457890123457890123457890123457890123457890
+	   ;; -12345678901234567890123457890123457890123457890123457890123457890.0)
+	   )))
+    (loop for li in equal-lists do
+      (loop for (x . tail) on li do
+	(loop for y in tail do
+	  (Assert-equalp x y)
+	  (Assert-equalp y x)))))
+
+  (let ((diff-list
+	 `(0 1 2 3 1000 5000000000 5555555555555555555555555555555555555
+	   -1 -2 -3 -1000 -5000000000 -5555555555555555555555555555555555555
+	   1/2 1/3 2/3 8/2 355/113 (/ 3/2 0.2) (/ 3/2 0.7)
+	   55555555555555555555555555555555555555555/2718281828459045
+	   0.111111111111111111111111111111111111111111111111111111111111111
+	   1e+300 1e+301 -1e+300 -1e+301)))
+    (loop for (x . tail) on diff-list do
+      (loop for y in tail do
+	(Assert-not-equalp x y)
+	(Assert-not-equalp y x))))
+
+  (Assert-equalp "hi there" "Hi There"
+		 "checking equalp isn't case-sensitive")
+  (Assert-equalp 99 99.0
+		 "checking equalp compares numerical values of different types")
+  (Assert (null (equalp 99 ?c))
+	  "checking equalp does not convert characters to numbers")
+  ;; Fixed in Hg d0ea57eb3de4.
+  (Assert (null (equalp "hi there" [hi there]))
+	  "checking equalp doesn't error with string and non-string")
+  (Assert-equalp "ABCDEEFGH\u00CDJ" string-variable
+		 "checking #'equalp is case-insensitive with an upcased constant") 
+  (Assert-equalp "abcdeefgh\xedj" string-variable
+		 "checking #'equalp is case-insensitive with a downcased constant")
+  (Assert-equalp string-variable string-variable
+		 "checking #'equalp works when handed the same string twice")
+  (Assert-equalp string-variable "aBcDeeFgH\u00Edj"
+		 "check #'equalp is case-insensitive with a variable-cased constant")
+  (Assert-equalp "" (bit-vector) 
+		 "check empty string and empty bit-vector are #'equalp.")
+  (Assert-equalp (string) (bit-vector) 
+		 "check empty string and empty bit-vector are #'equalp, no constants")
+  (Assert-equalp "hi there" (vector ?h ?i ?\  ?t ?h ?e ?r ?e)
+		 "check string and vector with same contents #'equalp")
+  (Assert-equalp (string ?h ?i ?\  ?t ?h ?e ?r ?e)
+		 (vector ?h ?i ?\  ?t ?h ?e ?r ?e)
+	     "check string and vector with same contents #'equalp, no constants")
+  (Assert-equalp [?h ?i ?\  ?t ?h ?e ?r ?e]
+		 (string ?h ?i ?\  ?t ?h ?e ?r ?e)
+	     "check string and vector with same contents #'equalp, vector constant")
+  (Assert-equalp [0 1.0 0.0 0 1]
+		 (bit-vector 0 1 0 0 1)
+	     "check vector and bit-vector with same contents #'equalp,\
+ vector constant")
+  (Assert-not-equalp [0 2 0.0 0 1]
+		     (bit-vector 0 1 0 0 1)
+	     "check vector and bit-vector with different contents not #'equalp,\
+ vector constant")
+  (Assert-equalp #*01001
+		 (vector 0 1.0 0.0 0 1)
+	     "check vector and bit-vector with same contents #'equalp,\
+ bit-vector constant")
+  (Assert-equalp ?\u00E9 Eacute-character
+		 "checking characters are case-insensitive, one constant")
+  (Assert-not-equalp ?\u00E9 (aref (format "%c" ?a) 0)
+		     "checking distinct characters are not equalp, one constant")
+  (Assert-equalp t (and)
+		 "checking symbols are correctly #'equalp")
+  (Assert-not-equalp t (or nil '#:t)
+		     "checking distinct symbols with the same name are not #'equalp")
+  (Assert-equalp #s(char-table type generic data (?\u0080 "hi-there"))
+		 (let ((aragh (make-char-table 'generic)))
+		   (put-char-table ?\u0080 "hi-there" aragh)
+		   aragh)
+		 "checking #'equalp succeeds correctly, char-tables")
+  (Assert-equalp #s(char-table type generic data (?\u0080 "hi-there"))
+		 (let ((aragh (make-char-table 'generic)))
+		   (put-char-table ?\u0080 "HI-THERE" aragh)
+		   aragh)
+		 "checking #'equalp succeeds correctly, char-tables")
+  (Assert-not-equalp #s(char-table type generic data (?\u0080 "hi-there"))
+		     (let ((aragh (make-char-table 'generic)))
+		       (put-char-table ?\u0080 "hi there" aragh)
+		       aragh)
+	     "checking #'equalp fails correctly, char-tables"))
+
+;; There are more tests available for equalp here: 
+;;
+;; http://www.parhasard.net/xemacs/equalp-tests.el
+;;
+;; They are taken from Paul Dietz' GCL ANSI test suite, licensed under the
+;; LGPL and part of GNU Common Lisp; the GCL people didn't respond to
+;; several requests for information on who owned the copyright for the
+;; files, so I haven't included the tests with XEmacs. Anyone doing XEmacs
+;; development on equalp should still run them, though. Aidan Kehoe, Thu Dec
+;; 31 14:53:52 GMT 2009. 
+
+(loop
+  for special-form in '(multiple-value-call setq-default quote throw
+			save-current-buffer and or)
+  with not-special-form = nil
+  do
+  (Assert (special-form-p special-form)
+	  (format "checking %S is a special operator" special-form))
+  (setq not-special-form 
+	(intern (format "%s-gMAu" (symbol-name special-form))))
+  (Assert (not (special-form-p not-special-form))
+	  (format "checking %S is a special operator" special-form))
+  (Assert (not (functionp special-form))
+	  (format "checking %S is not a function" special-form)))
+
+(loop
+  for real-function in '(find-file quote-maybe + - find-file-read-only)
+  do (Assert (functionp real-function)
+	     (format "checking %S is a function" real-function)))
+
+;; #'member, #'assoc tests.
+
+(when (featurep 'bignum)
+  (let* ((member*-list `(0 9 342 [hi there] ,(1+ most-positive-fixnum) 0
+			 0.0 ,(1- most-negative-fixnum) nil))
+	 (assoc*-list (loop
+			for elt in member*-list
+			collect (cons elt (random))))
+	 (hashing (make-hash-table :test 'eql))
+	 hashed-bignum)
+    (macrolet
+	((1+most-positive-fixnum ()
+	   (1+ most-positive-fixnum))
+	 (1-most-negative-fixnum ()
+	   (1- most-negative-fixnum))
+	 (*-2-most-positive-fixnum ()
+	   (* 2 most-positive-fixnum))) 
+      (Assert-eq
+       (member* (1+ most-positive-fixnum) member*-list)
+       (member* (1+ most-positive-fixnum) member*-list :test #'eql)
+       "checking #'member* correct if #'eql not explicitly specified")
+      (Assert-eq
+       (assoc* (1+ most-positive-fixnum) assoc*-list)
+       (assoc* (1+ most-positive-fixnum) assoc*-list :test #'eql)
+       "checking #'assoc* correct if #'eql not explicitly specified")
+      (Assert-eq
+       (rassoc* (1- most-negative-fixnum) assoc*-list)
+       (rassoc* (1- most-negative-fixnum) assoc*-list :test #'eql)
+       "checking #'rassoc* correct if #'eql not explicitly specified")
+      (Assert-eql (1+most-positive-fixnum) (1+ most-positive-fixnum)
+		  "checking #'eql handles a bignum literal properly.")
+      (Assert-eq 
+       (member* (1+most-positive-fixnum) member*-list)
+       (member* (1+ most-positive-fixnum) member*-list :test #'equal)
+       "checking #'member* compiler macro correct with literal bignum")
+      (Assert-eq
+       (assoc* (1+most-positive-fixnum) assoc*-list)
+       (assoc* (1+ most-positive-fixnum) assoc*-list :test #'equal)
+       "checking #'assoc* compiler macro correct with literal bignum")
+      (puthash (setq hashed-bignum (*-2-most-positive-fixnum)) 
+	       (gensym) hashing)
+      (Assert-eq
+       (gethash (* 2 most-positive-fixnum) hashing)
+       (gethash hashed-bignum hashing)
+       "checking hashing works correctly with #'eql tests and bignums"))))
 
 ;;; end of lisp-tests.el
--- a/tests/automated/md5-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/md5-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -56,7 +56,7 @@
 ;;-----------------------------------------------------
 
 (mapcar (lambda (x)
-	  (Assert (equal (md5 (car x)) (cdr x))))
+	  (Assert-equal (md5 (car x)) (cdr x)))
 	md5-tests)
 
 ;;-----------------------------------------------------
@@ -66,8 +66,8 @@
 (let ((large-string (mapconcat #'car md5-tests "")))
   (let ((count 0))
     (mapcar (lambda (x)
-	      (Assert (equal (md5 large-string count (+ count (length (car x))))
-			     (cdr x)))
+	      (Assert-equal (md5 large-string count (+ count (length (car x))))
+			     (cdr x))
 	      (incf count (length (car x))))
 	    md5-tests)))
 
@@ -79,7 +79,7 @@
   (mapcar (lambda (x)
 	    (erase-buffer)
 	    (insert (car x))
-	    (Assert (equal (md5 (current-buffer)) (cdr x))))
+	    (Assert-equal (md5 (current-buffer)) (cdr x)))
 	  md5-tests))
 
 ;;-----------------------------------------------------
@@ -90,7 +90,7 @@
   (insert (mapconcat #'car md5-tests ""))
   (let ((point 1))
     (mapcar (lambda (x)
-	      (Assert (equal (md5 (current-buffer) point (+ point (length (car x))))
-			     (cdr x)))
+	      (Assert-equal (md5 (current-buffer) point (+ point (length (car x))))
+			     (cdr x))
 	      (incf point (length (car x))))
 	    md5-tests)))
--- a/tests/automated/mule-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/mule-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -65,7 +65,7 @@
 	  ;; buffer.
 	  (with-temp-buffer
 	    (insert string)
-	    (Assert (equal (buffer-string) string)))
+	    (Assert-equal (buffer-string) string))
 	;; For use without test harness: use a normal buffer, so that
 	;; you can also test whether redisplay works.
 	(switch-to-buffer (get-buffer-create "test"))
@@ -152,12 +152,12 @@
   (dolist (coding-system '(utf-8 windows-1251 macintosh big5))
     (when (find-coding-system coding-system)
       (find-file existing-file-name coding-system)
-      (Assert (eq (find-coding-system coding-system)
-                  buffer-file-coding-system))
+      (Assert-eq (find-coding-system coding-system)
+                  buffer-file-coding-system)
       (kill-buffer nil)
       (find-file nonexistent-file-name coding-system)
-      (Assert (eq (find-coding-system coding-system)
-                  buffer-file-coding-system))
+      (Assert-eq (find-coding-system coding-system)
+                  buffer-file-coding-system)
       (set-buffer-modified-p nil)
       (kill-buffer nil)))
   (delete-file existing-file-name))
@@ -177,9 +177,9 @@
 	      (char2 (make-char charset2 69)))
 	  `(let ((string (make-string 1000 ,char1)))
 	     (fillarray string ,char2)
-	     (Assert (eq (aref string 0) ,char2))
-	     (Assert (eq (aref string (1- (length string))) ,char2))
-	     (Assert (eq (length string) 1000))))))
+	     (Assert-eq (aref string 0) ,char2)
+	     (Assert-eq (aref string (1- (length string))) ,char2)
+	     (Assert-eq (length string) 1000)))))
     (fillarray-test ascii latin-iso8859-1)
     (fillarray-test ascii latin-iso8859-2)
     (fillarray-test latin-iso8859-1 ascii)
@@ -188,7 +188,7 @@
   ;; Test aset
   (let ((string (string (make-char 'ascii 69) (make-char 'latin-iso8859-2 69))))
     (aset string 0 (make-char 'latin-iso8859-2 42))
-    (Assert (eq (aref string 1) (make-char 'latin-iso8859-2 69))))
+    (Assert-eq (aref string 1) (make-char 'latin-iso8859-2 69)))
 
   ;;---------------------------------------------------------------
   ;; Test coding system functions
@@ -210,8 +210,8 @@
   (define-coding-system-alias 'mule-tests-alias 'binary)
   (Assert (coding-system-alias-p 'mule-tests-alias))
   (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
-  (Assert (eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias)))
-  (Assert (eq 'binary (coding-system-aliasee 'mule-tests-alias)))
+  (Assert-eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias))
+  (Assert-eq 'binary (coding-system-aliasee 'mule-tests-alias))
   (Assert (not (coding-system-alias-p 'mule-tests-alias-unix)))
   (Assert (not (coding-system-alias-p 'mule-tests-alias-dos)))
   (Assert (not (coding-system-alias-p 'mule-tests-alias-mac)))
@@ -219,8 +219,8 @@
   (define-coding-system-alias 'mule-tests-alias (get-coding-system 'binary))
   (Assert (coding-system-alias-p 'mule-tests-alias))
   (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
-  (Assert (eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias)))
-  (Assert (eq 'binary (coding-system-aliasee 'mule-tests-alias)))
+  (Assert-eq (get-coding-system 'binary) (get-coding-system 'mule-tests-alias))
+  (Assert-eq 'binary (coding-system-aliasee 'mule-tests-alias))
   (Assert (not (coding-system-alias-p 'mule-tests-alias-unix)))
   (Assert (not (coding-system-alias-p 'mule-tests-alias-dos)))
   (Assert (not (coding-system-alias-p 'mule-tests-alias-mac)))
@@ -228,9 +228,9 @@
   (define-coding-system-alias 'nested-mule-tests-alias 'mule-tests-alias)
   (Assert (coding-system-alias-p 'nested-mule-tests-alias))
   (Assert (not (coding-system-canonical-name-p 'nested-mule-tests-alias)))
-  (Assert (eq (get-coding-system 'binary) (get-coding-system 'nested-mule-tests-alias)))
-  (Assert (eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias))
-  (Assert (eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias)))
+  (Assert-eq (get-coding-system 'binary) (get-coding-system 'nested-mule-tests-alias))
+  (Assert-eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias)
+  (Assert-eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias))
   (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-unix)))
   (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-dos)))
   (Assert (not (coding-system-alias-p 'nested-mule-tests-alias-mac)))
@@ -266,8 +266,8 @@
   (define-coding-system-alias 'mule-tests-alias 'iso-8859-7)
   (Assert (coding-system-alias-p 'mule-tests-alias))
   (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
-  (Assert (eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias)))
-  (Assert (eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias)))
+  (Assert-eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias))
+  (Assert-eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias))
   (Assert (coding-system-alias-p 'mule-tests-alias-unix))
   (Assert (coding-system-alias-p 'mule-tests-alias-dos))
   (Assert (coding-system-alias-p 'mule-tests-alias-mac))
@@ -275,26 +275,26 @@
   (define-coding-system-alias 'mule-tests-alias (get-coding-system 'iso-8859-7))
   (Assert (coding-system-alias-p 'mule-tests-alias))
   (Assert (not (coding-system-canonical-name-p 'mule-tests-alias)))
-  (Assert (eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias)))
-  (Assert (eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias)))
+  (Assert-eq (get-coding-system 'iso-8859-7) (get-coding-system 'mule-tests-alias))
+  (Assert-eq 'iso-8859-7 (coding-system-aliasee 'mule-tests-alias))
   (Assert (coding-system-alias-p 'mule-tests-alias-unix))
   (Assert (coding-system-alias-p 'mule-tests-alias-dos))
   (Assert (coding-system-alias-p 'mule-tests-alias-mac))
-  (Assert (eq (find-coding-system 'mule-tests-alias-mac)
-	      (find-coding-system 'iso-8859-7-mac)))
+  (Assert-eq (find-coding-system 'mule-tests-alias-mac)
+	      (find-coding-system 'iso-8859-7-mac))
 
   (define-coding-system-alias 'nested-mule-tests-alias 'mule-tests-alias)
   (Assert (coding-system-alias-p 'nested-mule-tests-alias))
   (Assert (not (coding-system-canonical-name-p 'nested-mule-tests-alias)))
-  (Assert (eq (get-coding-system 'iso-8859-7)
-	      (get-coding-system 'nested-mule-tests-alias)))
-  (Assert (eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias))
-  (Assert (eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias)))
+  (Assert-eq (get-coding-system 'iso-8859-7)
+	      (get-coding-system 'nested-mule-tests-alias))
+  (Assert-eq (coding-system-aliasee 'nested-mule-tests-alias) 'mule-tests-alias)
+  (Assert-eq 'mule-tests-alias (coding-system-aliasee 'nested-mule-tests-alias))
   (Assert (coding-system-alias-p 'nested-mule-tests-alias-unix))
   (Assert (coding-system-alias-p 'nested-mule-tests-alias-dos))
   (Assert (coding-system-alias-p 'nested-mule-tests-alias-mac))
-  (Assert (eq (find-coding-system 'nested-mule-tests-alias-unix)
-	      (find-coding-system 'iso-8859-7-unix)))
+  (Assert-eq (find-coding-system 'nested-mule-tests-alias-unix)
+	      (find-coding-system 'iso-8859-7-unix))
 
   (Check-Error-Message
    error "Attempt to create a coding system alias loop"
@@ -351,28 +351,28 @@
     (loop for j from 0 below (length string) do
       (aset string j (aref greek-string (mod j 96))))
     (loop for k in '(0 1 58 59) do
-      (Assert (equal (substring string (* 96 k) (* 96 (1+ k))) greek-string))))
+      (Assert-equal (substring string (* 96 k) (* 96 (1+ k))) greek-string)))
 
   (let ((greek-string (charset-char-string 'greek-iso8859-7))
 	(string (make-string (* 96 60) ??)))
    (loop for j from (1- (length string)) downto 0 do
      (aset string j (aref greek-string (mod j 96))))
    (loop for k in '(0 1 58 59) do
-     (Assert (equal (substring string (* 96 k) (* 96 (1+ k))) greek-string))))
+     (Assert-equal (substring string (* 96 k) (* 96 (1+ k))) greek-string)))
 
   (let ((ascii-string (charset-char-string 'ascii))
 	(string (make-string (* 94 60) (make-char 'greek-iso8859-7 57))))
    (loop for j from 0 below (length string) do
       (aset string j (aref ascii-string (mod j 94))))
     (loop for k in '(0 1 58 59) do
-      (Assert (equal (substring string (* 94 k) (+ 94 (* 94 k))) ascii-string))))
+      (Assert-equal (substring string (* 94 k) (+ 94 (* 94 k))) ascii-string)))
 
   (let ((ascii-string (charset-char-string 'ascii))
 	(string (make-string (* 94 60) (make-char 'greek-iso8859-7 57))))
     (loop for j from (1- (length string)) downto 0 do
       (aset string j (aref ascii-string (mod j 94))))
     (loop for k in '(0 1 58 59) do
-      (Assert (equal (substring string (* 94 k) (* 94 (1+ k))) ascii-string))))
+      (Assert-equal (substring string (* 94 k) (* 94 (1+ k))) ascii-string)))
 
   ;;---------------------------------------------------------------
   ;; Test file-system character conversion (and, en passant, file ops)
@@ -385,7 +385,8 @@
 	 (file-name-coding-system
 	  ;; 'iso-8859-X doesn't work on darwin (as of "Panther" 10.3), it
 	  ;; seems to know that file-name-coding-system is definitely utf-8
-	  (if (string-match "darwin" system-configuration)
+	  (if (or (string-match "darwin" system-configuration)
+		  (featurep 'cygwin-use-utf-8))
 	      'utf-8
 	    'iso-8859-2))
          ;; make-temp-name does stat(), which on OS X requires that you
@@ -414,8 +415,8 @@
     (when working-symlinks
       (make-symbolic-link name1 name2)
       (Assert (file-exists-p name2))
-      (Assert (equal (file-truename name2) name1))
-      (Assert (equal (file-truename name1) name1)))
+      (Assert-equal (file-truename name2) name1)
+      (Assert-equal (file-truename name1) name1))
     (ignore-file-errors (delete-file name1))
     (ignore-file-errors (delete-file name2))
     (ignore-file-errors (delete-file name3)))
@@ -433,8 +434,8 @@
       do
       (progn
 	(set-unicode-conversion scaron code)
-	(Assert (eq code (char-to-unicode scaron)))
-	(Assert (eq scaron (unicode-to-char code '(latin-iso8859-2)))))
+	(Assert-eq code (char-to-unicode scaron))
+	(Assert-eq scaron (unicode-to-char code '(latin-iso8859-2))))
       finally (set-unicode-conversion scaron initial-unicode))
     (Check-Error wrong-type-argument (set-unicode-conversion scaron -10000)))
 
@@ -449,37 +450,37 @@
     (let* ((xemacs-character (car (append 
 				  (decode-coding-string utf-8-char 'utf-8) 
 				  nil)))
-	   (xemacs-charset (car (split-char xemacs-character))))
+	   (xemacs-charset (char-charset xemacs-character)))
 
       ;; Trivial test of the UTF-8 support of the escape-quoted character set. 
-      (Assert (equal (decode-coding-string utf-8-char 'utf-8)
+      (Assert-equal (decode-coding-string utf-8-char 'utf-8)
 		     (decode-coding-string (concat "\033%G" utf-8-char)
-					   'escape-quoted)))
+					   'escape-quoted))
 
       ;; Check that the reverse mapping holds. 
-      (Assert (equal (unicode-code-point-to-utf-8-string 
+      (Assert-equal (unicode-code-point-to-utf-8-string 
 		      (encode-char xemacs-character 'ucs))
-		     utf-8-char))
+		     utf-8-char)
 
       ;; Check that, if this character has been JIT-allocated, it is encoded
       ;; in escape-quoted using the corresponding UTF-8 escape. 
       (when (charset-property xemacs-charset 'encode-as-utf-8)
-	(Assert (equal (concat "\033%G" utf-8-char)
-		       (encode-coding-string xemacs-character 'escape-quoted)))
-	(Assert (equal (concat "\033%G" utf-8-char)
-		       (encode-coding-string xemacs-character 'ctext))))))
+	(Assert-equal (concat "\033%G" utf-8-char)
+		       (encode-coding-string xemacs-character 'escape-quoted))
+	(Assert-equal (concat "\033%G" utf-8-char)
+		       (encode-coding-string xemacs-character 'ctext)))))
 
   (loop
     for (code-point utf-16-big-endian utf-16-little-endian) 
     in '((#x10000 "\xd8\x00\xdc\x00" "\x00\xd8\x00\xdc")
          (#x10FFFD "\xdb\xff\xdf\xfd" "\xff\xdb\xfd\xdf"))
     do
-    (Assert (equal (encode-coding-string 
+    (Assert-equal (encode-coding-string 
                     (decode-char 'ucs code-point) 'utf-16)
-                   utf-16-big-endian))
-    (Assert (equal (encode-coding-string 
+                   utf-16-big-endian)
+    (Assert-equal (encode-coding-string 
                     (decode-char 'ucs code-point) 'utf-16-le)
-                   utf-16-little-endian)))
+                   utf-16-little-endian))
 
          
   ;;---------------------------------------------------------------
@@ -496,11 +497,11 @@
 	 (write-multibyte-character r0 r1))) 
       "CCL program that writes two control-1 multibyte characters.") 
  
-    (Assert (equal 
+    (Assert-equal 
 	     (ccl-execute-on-string 'ccl-write-two-control-1-chars  
 				    ccl-vector "") 
 	     (format "%c%c" (make-char 'control-1 0) 
-		     (make-char 'control-1 31))))
+		     (make-char 'control-1 31)))
 
     (define-ccl-program ccl-unicode-two-control-1-chars 
       `(1 
@@ -538,11 +539,11 @@
 	       ;; (maybe we should):
 	       (eq 'lf (coding-system-eol-type coding-system)))
       ;; These coding systems are round-trip compatible with themselves.
-      (Assert (equal (encode-coding-string 
+      (Assert-equal (encode-coding-string 
 		      (decode-coding-string all-possible-octets
 					    coding-system)
 		      coding-system)
-		     all-possible-octets)
+		     all-possible-octets
               (format "checking %s is transparent" coding-system))))
 
   ;;---------------------------------------------------------------
@@ -550,25 +551,23 @@
   ;;---------------------------------------------------------------
   (with-temp-buffer
     (insert-file-contents (locate-data-file "HELLO"))
-    (Assert (equal 
-             ;; The sort is to make the algorithm of charsets-in-region
-             ;; irrelevant.
-             (sort (charsets-in-region (point-min) (point-max))
-                   #'string<)
-             '(ascii chinese-big5-1 chinese-gb2312 cyrillic-iso8859-5
-               ethiopic greek-iso8859-7 hebrew-iso8859-8 japanese-jisx0208
-               japanese-jisx0212 jit-ucs-charset-0 katakana-jisx0201
-               korean-ksc5601 latin-iso8859-1 latin-iso8859-2 thai-xtis
-               vietnamese-viscii-lower)))
-    (Assert (equal 
-             (sort (charsets-in-string (buffer-substring (point-min)
-							 (point-max)))
-                   #'string<)
-             '(ascii chinese-big5-1 chinese-gb2312 cyrillic-iso8859-5
-               ethiopic greek-iso8859-7 hebrew-iso8859-8 japanese-jisx0208
-               japanese-jisx0212 jit-ucs-charset-0 katakana-jisx0201
-               korean-ksc5601 latin-iso8859-1 latin-iso8859-2 thai-xtis
-               vietnamese-viscii-lower))))
+    (let ((sorted-charsets-in-HELLO
+	   '(arabic-iso8859-6 ascii chinese-big5-1 chinese-gb2312
+	     cyrillic-iso8859-5 ethiopic greek-iso8859-7
+	     hebrew-iso8859-8 japanese-jisx0208 japanese-jisx0212
+	     katakana-jisx0201 korean-ksc5601 latin-iso8859-1
+	     latin-iso8859-2 vietnamese-viscii-lower)))
+      (Assert-equal 
+       ;; The sort is to make the algorithm of charsets-in-region
+       ;; irrelevant.
+       (sort (charsets-in-region (point-min) (point-max))
+	     #'string<)
+       sorted-charsets-in-HELLO)
+      (Assert-equal 
+       (sort (charsets-in-string (buffer-substring (point-min)
+						   (point-max)))
+	     #'string<)
+       sorted-charsets-in-HELLO)))
 
   ;;---------------------------------------------------------------
   ;; Language environments, and whether the specified values are sane.
@@ -581,7 +580,7 @@
     do
     ;; s-l-e can call #'require, which says "Loading ..."
     (Silence-Message (set-language-environment language))
-    (Assert (equal language current-language-environment))
+    (Assert-equal language current-language-environment)
 
     (setq language-input-method
 	  (get-language-info language 'input-method))
@@ -601,7 +600,7 @@
        ;; s-i-m can load files.
        (Silence-Message
 	(set-input-method language-input-method))
-       (Assert (equal language-input-method current-input-method))))
+       (Assert-equal language-input-method current-input-method)))
 
     (dolist (charset (get-language-info language 'charset))
       (Assert (charsetp (find-charset charset))))
--- a/tests/automated/query-coding-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/query-coding-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -70,7 +70,7 @@
                 :test #'eq))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-region (point-min) (point-max) coding-system)
-          (Assert (eq t query-coding-succeeded)
+          (Assert-eq t query-coding-succeeded
                   (format "checking query-coding-region ASCII-transparency, %s"
                           coding-system))
           (Assert (null query-coding-table)
@@ -78,7 +78,7 @@
                           coding-system)))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-string ascii-chars-string coding-system)
-          (Assert (eq t query-coding-succeeded)
+          (Assert-eq t query-coding-succeeded
                   (format "checking query-coding-string ASCII-transparency, %s"
                           coding-system))
           (Assert (null query-coding-table)
@@ -89,20 +89,19 @@
       (insert latin-1-chars-string)
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'iso-8859-1-unix)
-        (Assert (eq t query-coding-succeeded)
+        (Assert-eq t query-coding-succeeded
                 "checking query-coding-region iso-8859-1-transparency")
         (Assert (null query-coding-table)
                 "checking query-coding-region iso-8859-1-transparency"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-string (buffer-string) 'iso-8859-1-unix)
-        (Assert (eq t query-coding-succeeded)
+        (Assert-eq t query-coding-succeeded
                 "checking query-coding-string iso-8859-1-transparency")
         (Assert (null query-coding-table)
                 "checking query-coding-string iso-8859-1-transparency"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-string (buffer-string) 'iso-latin-1-with-esc-unix)
-        (Assert
-         (eq t query-coding-succeeded)
+        (Assert-eq t query-coding-succeeded
          "checking query-coding-region iso-latin-1-with-esc-transparency")
         (Assert
          (null query-coding-table)
@@ -114,10 +113,9 @@
         (Assert
          (null query-coding-succeeded)
          "checking that query-coding-region fails, U+20AC, iso-8859-1")
-        (Assert
-         (equal query-coding-table
+        (Assert-equal query-coding-table
                 #s(range-table type start-closed-end-open data
-                               ((257 258) unencodable)))
+                               ((257 258) unencodable))
          "checking query-coding-region fails correctly, U+20AC, iso-8859-1"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max)
@@ -161,19 +159,17 @@
         (Assert
          (null query-coding-succeeded)
          "check query-coding-region fails, windows-1252, invalid-sequences")
-        (Assert
-         (equal query-coding-table
+        (Assert-equal query-coding-table
                 #s(range-table type start-closed-end-open
                                data ((130 131) invalid-sequence
                                      (142 143) invalid-sequence
                                      (144 146) invalid-sequence
-                                     (158 159) invalid-sequence)))
+                                     (158 159) invalid-sequence))
          "check query-coding-region fails, windows-1252, invalid-sequences"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'windows-1252-unix
 			       (current-buffer) t)
-        (Assert
-         (eq t query-coding-succeeded)
+        (Assert-eq t query-coding-succeeded
          "checking that query-coding-region succeeds, U+20AC, windows-1252")
         (Assert
          (null query-coding-table)
@@ -185,24 +181,22 @@
         (Assert
          (null query-coding-succeeded)
          "checking that query-coding-region fails, U+0080, windows-1252")
-        (Assert
-         (equal query-coding-table
+        (Assert-equal query-coding-table
                 #s(range-table type start-closed-end-open data
-                               ((257 258) unencodable)))
+                               ((257 258) unencodable))
          "checking that query-coding-region fails, U+0080, windows-1252"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'windows-1252-unix)
         (Assert
          (null query-coding-succeeded)
          "check query-coding-region fails, U+0080, invalid-sequence, cp1252")
-        (Assert
-         (equal query-coding-table
+        (Assert-equal query-coding-table
                 #s(range-table type start-closed-end-open
                                data ((130 131) invalid-sequence
                                      (142 143) invalid-sequence
                                      (144 146) invalid-sequence
                                      (158 159) invalid-sequence
-                                     (257 258) unencodable)))
+                                     (257 258) unencodable))
          "check query-coding-region fails, U+0080, invalid-sequence, cp1252"))
       ;; Try a similar approach with koi8-o, the koi8 variant with
       ;; support for Old Church Slavonic.
@@ -219,7 +213,7 @@
          "checking that query-coding-region succeeds, koi8-o-unix"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'escape-quoted)
-        (Assert (eq t query-coding-succeeded)
+        (Assert-eq t query-coding-succeeded
          "checking that query-coding-region succeeds, escape-quoted")
         (Assert (null query-coding-table)
          "checking that query-coding-region succeeds, escape-quoted"))
@@ -283,15 +277,15 @@
             (query-coding-region (point-min) (point-max) coding-system)
           (Assert (null query-coding-succeeded)
                   "checking unicode coding systems fail with unmapped chars")
-          (Assert (equal query-coding-table
+          (Assert-equal query-coding-table
                          #s(range-table type start-closed-end-open data
                                         ((173 174) unencodable
                                          (209 210) unencodable
-                                         (254 255) unencodable)))
+                                         (254 255) unencodable))
                   "checking unicode coding systems fail with unmapped chars"))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-region (point-min) 173 coding-system)
-          (Assert (eq t query-coding-succeeded)
+          (Assert-eq t query-coding-succeeded
                   "checking unicode coding systems succeed sans unmapped chars")
           (Assert
            (null query-coding-table)
@@ -306,7 +300,7 @@
            "checking unicode coding systems succeed sans unmapped chars again"))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-region 210 254 coding-system)
-          (Assert (eq t query-coding-succeeded))
+          (Assert-eq t query-coding-succeeded)
           (Assert (null query-coding-table)))
         ;; Check that it errors correctly. 
         (setq text-conversion-error-signalled nil)
@@ -342,11 +336,11 @@
                   (format 
                    "checking %s fails with unmapped chars and invalid seqs"
                    coding-system))
-          (Assert (equal query-coding-table
+          (Assert-equal query-coding-table
                          #s(range-table type start-closed-end-open
                                         data ((1 5) unencodable
                                               (5 9) invalid-sequence
-                                              (9 13) unencodable)))
+                                              (9 13) unencodable))
                   (format 
                    "checking %s fails with unmapped chars and invalid seqs"
                    coding-system)))
@@ -396,23 +390,23 @@
        "check #'unencodable-char-position has some borked GNU semantics")
       (dotimes (i 6) (insert (decode-char 'ucs #x20ac)))
       ;; Check if it stops at one:
-      (Assert (equal '(257) (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 1))
+      (Assert-equal '(257) (unencodable-char-position (point-min) (point-max)
+                                                       'iso-8859-1 1)
               "check #'unencodable-char-position stops at 1 when asked to")
       ;; Check if it stops at four:
-      (Assert (equal '(260 259 258 257)
+      (Assert-equal '(260 259 258 257)
                      (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 4))
+                                                       'iso-8859-1 4)
               "check #'unencodable-char-position stops at 4 when asked to")
       ;; Check whether it stops at seven: 
-      (Assert (equal '(263 262 261 260 259 258 257)
+      (Assert-equal '(263 262 261 260 259 258 257)
                      (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 7))
+                                                       'iso-8859-1 7)
               "check #'unencodable-char-position stops at 7 when asked to")
       ;; Check that it still stops at seven:
-      (Assert (equal '(263 262 261 260 259 258 257)
+      (Assert-equal '(263 262 261 260 259 258 257)
                      (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 2000))
+                                                       'iso-8859-1 2000)
               "check #'unencodable-char-position stops at 7 if 2000 asked for")
       ;; Now, #'check-coding-systems-region. 
       ;; UTF-8 should certainly be able to encode these characters:
--- a/tests/automated/regexp-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/regexp-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -28,7 +28,10 @@
 
 ;;; Commentary:
 
-;; Test regular expression.
+;; Test regular expressions.
+
+;; NOTE NOTE NOTE: There is some domain overlap among case-tests.el,
+;; regexp-tests.el and search-tests.el.  See case-tests.el.
 
 (Check-Error-Message error "Trailing backslash"
 		     (string-match "\\" "a"))
@@ -93,40 +96,40 @@
   ;; forward
   (goto-char (point-min))
   ;; Avoid trivial regexp.
-  (Assert (eq 2 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 2 (re-search-forward "�\\|a" nil t))
   (goto-char (point-min))
-  (Assert (eq 2 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 2 (re-search-forward "�\\|a" nil t))
   (goto-char (1+ (point-min)))
-  (Assert (eq 3 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 3 (re-search-forward "�\\|a" nil t))
   (goto-char (1+ (point-min)))
-  (Assert (eq 3 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 3 (re-search-forward "�\\|a" nil t))
   ;; backward
   (goto-char (point-max))
-  (Assert (eq 2 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 2 (re-search-backward "�\\|a" nil t))
   (goto-char (point-max))
-  (Assert (eq 2 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 2 (re-search-backward "�\\|a" nil t))
   (goto-char (1- (point-max)))
-  (Assert (eq 1 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 1 (re-search-backward "�\\|a" nil t))
   (goto-char (1- (point-max)))
-  (Assert (eq 1 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 1 (re-search-backward "�\\|a" nil t))
   ;; case sensitive
   (setq case-fold-search nil)
   ;; forward
   (goto-char (point-min))
-  (Assert (eq 2 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 2 (re-search-forward "�\\|a" nil t))
   (goto-char (point-min))
-  (Assert (eq 3 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 3 (re-search-forward "�\\|a" nil t))
   (goto-char (1+ (point-min)))
   (Assert (not (re-search-forward "�\\|a" nil t)))
   (goto-char (1+ (point-min)))
-  (Assert (eq 3 (re-search-forward "�\\|a" nil t)))
+  (Assert-eq 3 (re-search-forward "�\\|a" nil t))
   ;; backward
   (goto-char (point-max))
-  (Assert (eq 1 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 1 (re-search-backward "�\\|a" nil t))
   (goto-char (point-max))
-  (Assert (eq 2 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 2 (re-search-backward "�\\|a" nil t))
   (goto-char (1- (point-max)))
-  (Assert (eq 1 (re-search-backward "�\\|a" nil t)))
+  (Assert-eq 1 (re-search-backward "�\\|a" nil t))
   (goto-char (1- (point-max)))
   (Assert (not (re-search-backward "�\\|a" nil t))))
 
@@ -214,25 +217,25 @@
   (forward-line 1)
   (Assert (not (looking-at "^[a]\\{3,5\\}$")))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "a\\{4,4\\}")))
+  (Assert= 12 (re-search-forward "a\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "b?a\\{4,4\\}")))
+  (Assert= 12 (re-search-forward "b?a\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 31 (re-search-forward "ba\\{4,4\\}")))
+  (Assert= 31 (re-search-forward "ba\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 31 (re-search-forward "[b]a\\{4,4\\}")))
+  (Assert= 31 (re-search-forward "[b]a\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 31 (re-search-forward "\\(b\\)a\\{4,4\\}")))
+  (Assert= 31 (re-search-forward "\\(b\\)a\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "^a\\{4,4\\}")))
+  (Assert= 12 (re-search-forward "^a\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "^a\\{4,4\\}$")))
+  (Assert= 12 (re-search-forward "^a\\{4,4\\}$"))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "[a]\\{4,4\\}")))
+  (Assert= 12 (re-search-forward "[a]\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "^[a]\\{4,4\\}")))
+  (Assert= 12 (re-search-forward "^[a]\\{4,4\\}"))
   (goto-char (point-min))
-  (Assert (= 12 (re-search-forward "^[a]\\{4,4\\}$")))
+  (Assert= 12 (re-search-forward "^[a]\\{4,4\\}$"))
   )
 
 ;; charset, charset_not
@@ -312,15 +315,15 @@
   (Assert (string= (match-string 1) nil)))
 
 ;; Test word boundaries
-(Assert (= (string-match "\\<a" " a") 1))
-(Assert (= (string-match "a\\>" "a ") 0))
-(Assert (= (string-match "\\ba" " a") 1))
-(Assert (= (string-match "a\\b" "a ") 0))
+(Assert= (string-match "\\<a" " a") 1)
+(Assert= (string-match "a\\>" "a ") 0)
+(Assert= (string-match "\\ba" " a") 1)
+(Assert= (string-match "a\\b" "a ") 0)
 ;; should work at target boundaries
-(Assert (= (string-match "\\<a" "a") 0))
-(Assert (= (string-match "a\\>" "a") 0))
-(Assert (= (string-match "\\ba" "a") 0))
-(Assert (= (string-match "a\\b" "a") 0))
+(Assert= (string-match "\\<a" "a") 0)
+(Assert= (string-match "a\\>" "a") 0)
+(Assert= (string-match "\\ba" "a") 0)
+(Assert= (string-match "a\\b" "a") 0)
 ;; Check for weirdness
 (Assert (not (string-match " \\> " "  ")))
 (Assert (not (string-match " \\< " "  ")))
@@ -348,17 +351,17 @@
 	  (ch1 (make-char 'japanese-jisx0208 51 65)))
       (Assert (not (string-match "A" (string ch0))))
       (Assert (not (string-match "[A]" (string ch0))))
-      (Assert (eq (string-match "[^A]" (string ch0)) 0))
+      (Assert-eq (string-match "[^A]" (string ch0)) 0)
       (Assert (not (string-match "@A" (string ?@ ch0))))
       (Assert (not (string-match "@[A]" (string ?@ ch0))))
-      (Assert (eq (string-match "@[^A]" (string ?@ ch0)) 0))
+      (Assert-eq (string-match "@[^A]" (string ?@ ch0)) 0)
       (Assert (not (string-match "@?A" (string ?@ ch0))))
       (Assert (not (string-match "A" (string ch1))))
       (Assert (not (string-match "[A]" (string ch1))))
-      (Assert (eq (string-match "[^A]" (string ch1)) 0))
+      (Assert-eq (string-match "[^A]" (string ch1)) 0)
       (Assert (not (string-match "@A" (string ?@ ch1))))
       (Assert (not (string-match "@[A]" (string ?@ ch1))))
-      (Assert (eq (string-match "@[^A]" (string ?@ ch1)) 0))
+      (Assert-eq (string-match "@[^A]" (string ?@ ch1)) 0)
       (Assert (not (string-match "@?A" (string ?@ ch1))))
       )
   )
@@ -405,24 +408,24 @@
 ;; fix submitted by sjt 2004-09-08
 ;; trailing comments are values from buggy 21.4.15
 (let ((text "abc"))
-  (Assert (eq 0 (string-match "\\(?:ab+\\)*c" text)))	; 2
-  (Assert (eq 0 (string-match "^\\(?:ab+\\)*c" text)))	; nil
-  (Assert (eq 0 (string-match "^\\(?:ab+\\)*" text)))	; 0
-  (Assert (eq 0 (string-match "^\\(?:ab+\\)c" text)))	; 0
-  (Assert (eq 0 (string-match "^\\(?:ab\\)*c" text)))	; 0
-  (Assert (eq 0 (string-match "^\\(?:a+\\)*b" text)))	; nil
-  (Assert (eq 0 (string-match "^\\(?:a\\)*b" text)))	; 0
+  (Assert-eq 0 (string-match "\\(?:ab+\\)*c" text))	; 2
+  (Assert-eq 0 (string-match "^\\(?:ab+\\)*c" text))	; nil
+  (Assert-eq 0 (string-match "^\\(?:ab+\\)*" text))	; 0
+  (Assert-eq 0 (string-match "^\\(?:ab+\\)c" text))	; 0
+  (Assert-eq 0 (string-match "^\\(?:ab\\)*c" text))	; 0
+  (Assert-eq 0 (string-match "^\\(?:a+\\)*b" text))	; nil
+  (Assert-eq 0 (string-match "^\\(?:a\\)*b" text))	; 0
 )
 
 ;; per Steve Youngs 2004-09-30 <microsoft-free.87ekkjhj7t.fsf@youngs.au.com>
 ;; fix submitted by sjt 2004-10-07
 ;; trailing comments are values from buggy 21.4.pre16
 (let ((text "abc"))
-  (Assert (eq 0 (string-match "\\(?:a\\(b\\)\\)" text)))	; 0
+  (Assert-eq 0 (string-match "\\(?:a\\(b\\)\\)" text))	; 0
   (Assert (string= (match-string 1 text) "b"))			; ab
   (Assert (null (match-string 2 text)))				; b
   (Assert (null (match-string 3 text)))				; nil
-  (Assert (eq 0 (string-match "\\(?:a\\(?:b\\(c\\)\\)\\)" text)))	; 0
+  (Assert-eq 0 (string-match "\\(?:a\\(?:b\\(c\\)\\)\\)" text))	; 0
   (Assert (string= (match-string 1 text) "c"))			; abc
   (Assert (null (match-string 2 text)))				; ab
   (Assert (null (match-string 3 text)))				; c
@@ -437,7 +440,7 @@
       (re2 "\\(?:a\\)\\(b\\)\\1")
       (re3 "\\(a\\)\\(?:b\\)\\1"))
 
-  (Assert (eq 0 (string-match re0 text1)))
+  (Assert-eq 0 (string-match re0 text1))
   (Assert (string= text1 (match-string 0 text1)))
   (Assert (string= "a" (match-string 1 text1)))
   (Assert (string= "b" (match-string 2 text1)))
@@ -446,14 +449,14 @@
   (Check-Error-Message 'invalid-regexp "Invalid back reference"
 		       (string-match re1 text1))
 
-  (Assert (eq 0 (string-match re2 text1)))
+  (Assert-eq 0 (string-match re2 text1))
   (Assert (string= text1 (match-string 0 text1)))
   (Assert (string= "b" (match-string 1 text1)))
   (Assert (null (match-string 2 text1)))
   (Assert (null (string-match re2 text2)))
 
   (Assert (null (string-match re3 text1)))
-  (Assert (eq 0 (string-match re3 text2)))
+  (Assert-eq 0 (string-match re3 text2))
   (Assert (string= text2 (match-string 0 text2)))
   (Assert (string= "a" (match-string 1 text2)))
   (Assert (null (match-string 2 text2)))
@@ -528,14 +531,14 @@
     "-]-----------------------------][]]------------------------"
   (goto-char (point-min))
   (skip-chars-forward (skip-chars-quote "-[]"))
-  (Assert (= (point) (point-max)))
+  (Assert= (point) (point-max))
   (skip-chars-backward (skip-chars-quote "-[]"))
-  (Assert (= (point) (point-min)))
+  (Assert= (point) (point-min))
   ;; Testing in passing for an old bug in #'skip-chars-forward where I
   ;; thought it was impossible to call it with a string containing only ?-
   ;; and ?]: 
-  (Assert (= (skip-chars-forward (skip-chars-quote "-]"))
-             (position ?[ (buffer-string) :test #'=)))
+  (Assert= (skip-chars-forward (skip-chars-quote "-]"))
+             (position ?[ (buffer-string) :test #'=))
   ;; This used to error, incorrectly: 
   (Assert (skip-chars-quote "[-")))
 
@@ -551,15 +554,46 @@
 (with-string-as-buffer-contents "a�a"
   (goto-char (point-min))
   (Assert (looking-at "\\="))
-  (Assert (= (re-search-forward "\\=") 1))
+  (Assert= (re-search-forward "\\=") 1)
   (forward-char 1)
   (Assert (looking-at "\\="))
-  (Assert (= (re-search-forward "\\=") 2))
+  (Assert= (re-search-forward "\\=") 2)
+  (forward-char 1)
+  (Assert (looking-at "\\="))
+  (Assert= (re-search-forward "\\=") 3)
   (forward-char 1)
   (Assert (looking-at "\\="))
-  (Assert (= (re-search-forward "\\=") 3))
-  (forward-char 1)
-  (Assert (looking-at "\\="))
-  (Assert (= (re-search-forward "\\=") 4)))
+  (Assert= (re-search-forward "\\=") 4))
 
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;     Tests involving case-changing replace-match   ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(Assert (not (string-match "\\(\\.\\=\\)" ".")))
+(Assert (string= "" (let ((str "test string"))
+		      (if (string-match "^.*$" str)
+			  (replace-match "\\U" t nil str)))))
+(with-temp-buffer
+  (erase-buffer)
+  (insert "test string")
+  (re-search-backward "^.*$")
+  (replace-match "\\U" t)
+  (Assert (and (bobp) (eobp))))
+
+;; Control-1 characters were second-class citizens in regexp ranges
+;; for a while there.  Addressed in Ben's Mercurial changeset
+;; 2e15c29cc2b3; attempt to ensure this doesn't happen again.
+(Assert-eql (string-match "[\x00-\x7f\x80-\x9f]" "a") 0)
+(Assert-eql (string-match "[\x00-\x7f\x80-\x9f]" "�") nil)
+;; Gave nil in 21.5 for a couple of years.
+(Assert-eql (string-match "[\x00-\x7f\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x00-\x7f]\\|[\x80-\x9f]" "\x80") 0)
+;; Gave nil
+(Assert-eql (string-match "[\x7f\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x7f\x80-\x9e]" "\x80") 0)
+;; Used to succeed even with the bug.
+(Assert-eql (string-match "[\x7f\x80\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x7e\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x7f\x81-\x9f]" "\x81") 0)
--- a/tests/automated/region-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/region-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -71,7 +71,7 @@
       ;; Region not active in this second temp buffer
       (Assert (not (region-active-p)))
       ;; Region still active in first temp buffer
-      (Assert (eq (zmacs-region-buffer) first-buffer))
+      (Assert-eq (zmacs-region-buffer) first-buffer)
       ;; Activate region in second temp buffer
       (Silence-Message
        (mark-whole-buffer))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/automated/search-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -0,0 +1,245 @@
+;;; -*- coding: iso-8859-1 -*-
+
+;; Copyright (C) 2000 Free Software Foundation, Inc.
+;; Copyright (C) 2010 Ben Wing.
+
+;; Author: Yoshiki Hayashi  <yoshiki@xemacs.org>
+;; Maintainer: Yoshiki Hayashi  <yoshiki@xemacs.org>
+;; Created: 2000
+;; Keywords: tests
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF.
+
+;;; Commentary:
+
+;; Test of non-regexp searching.
+
+;; Split out of case-tests.el.
+
+;; NOTE NOTE NOTE: See also:
+;;
+;; (1) regexp-tests.el, for regexp searching.
+;; (2) case-tests.el, for some case-related searches.
+
+;; NOTE NOTE NOTE: There is some domain overlap among case-tests.el,
+;; regexp-tests.el and search-tests.el.  See case-tests.el.
+
+(with-temp-buffer
+  (insert "Test Buffer")
+  (let ((case-fold-search t))
+    (goto-char (point-min))
+    (Assert-eq (search-forward "test buffer" nil t) 12)
+    (goto-char (point-min))
+    (Assert-eq (search-forward "Test buffer" nil t) 12)
+    (goto-char (point-min))
+    (Assert-eq (search-forward "Test Buffer" nil t) 12)
+
+    (setq case-fold-search nil)
+    (goto-char (point-min))
+    (Assert (not (search-forward "test buffer" nil t)))
+    (goto-char (point-min))
+    (Assert (not (search-forward "Test buffer" nil t)))
+    (goto-char (point-min))
+    (Assert-eq (search-forward "Test Buffer" nil t) 12)))
+
+(with-temp-buffer
+  (insert "abcdefghijklmn�opqrstu�vwxyz")
+  ;; case insensitive
+  (Assert (not (search-forward "�" nil t)))
+  (goto-char (point-min))
+  (Assert-eq 16 (search-forward "�" nil t))
+  (Assert-eq 24 (search-forward "�" nil t))
+  (goto-char (point-min))
+  (Assert-eq 16 (search-forward "�" nil t))
+  (Assert-eq 24 (search-forward "�" nil t))
+  (goto-char (point-max))
+  (Assert-eq 23 (search-backward "�" nil t))
+  (Assert-eq 15 (search-backward "�" nil t))
+  (goto-char (point-max))
+  (Assert-eq 23 (search-backward "�" nil t))
+  (Assert-eq 15 (search-backward "�" nil t))
+  ;; case sensitive
+  (setq case-fold-search nil)
+  (goto-char (point-min))
+  (Assert (not (search-forward "�" nil t)))
+  (goto-char (point-min))
+  (Assert-eq 16 (search-forward "�" nil t))
+  (Assert (not (search-forward "�" nil t)))
+  (goto-char (point-min))
+  (Assert-eq 24 (search-forward "�" nil t))
+  (goto-char 16)
+  (Assert-eq 24 (search-forward "�" nil t))
+  (goto-char (point-max))
+  (Assert-eq 15 (search-backward "�" nil t))
+  (goto-char 15)
+  (Assert (not (search-backward "�" nil t)))
+  (goto-char (point-max))
+  (Assert-eq 23 (search-backward "�" nil t))
+  (Assert (not (search-backward "�" nil t))))
+
+(with-temp-buffer
+  (insert "aaaa����������bbbb")
+  (goto-char (point-min))
+  (Assert-eq 15 (search-forward "��" nil t 5))
+  (goto-char (point-min))
+  (Assert (not (search-forward "��" nil t 6)))
+  (goto-char (point-max))
+  (Assert-eq 5 (search-backward "��" nil t 5))
+  (goto-char (point-max))
+  (Assert (not (search-backward "��" nil t 6))))
+
+(when (featurep 'mule)
+  (let* ((hiragana-a (make-char 'japanese-jisx0208 36 34))
+	 (a-diaeresis ?�)
+	 (case-table (copy-case-table (standard-case-table)))
+	 (str-hiragana-a (char-to-string hiragana-a))
+	 (str-a-diaeresis (char-to-string a-diaeresis))
+	 (string (concat str-hiragana-a str-a-diaeresis)))
+    (put-case-table-pair hiragana-a a-diaeresis case-table)
+    (with-temp-buffer
+      (set-case-table case-table)
+      (insert hiragana-a "abcdefg" a-diaeresis)
+      ;; forward
+      (goto-char (point-min))
+      (Assert (not (search-forward "�" nil t)))
+      (goto-char (point-min))
+      (Assert-eq 2 (search-forward str-hiragana-a nil t))
+      (goto-char (point-min))
+      (Assert-eq 2 (search-forward str-a-diaeresis nil t))
+      (goto-char (1+ (point-min)))
+      (Assert-eq (point-max)
+		  (search-forward str-hiragana-a nil t))
+      (goto-char (1+ (point-min)))
+      (Assert-eq (point-max)
+		  (search-forward str-a-diaeresis nil t))
+      ;; backward
+      (goto-char (point-max))
+      (Assert (not (search-backward "�" nil t)))
+      (goto-char (point-max))
+      (Assert-eq (1- (point-max)) (search-backward str-hiragana-a nil t))
+      (goto-char (point-max))
+      (Assert-eq (1- (point-max)) (search-backward str-a-diaeresis nil t))
+      (goto-char (1- (point-max)))
+      (Assert-eq 1 (search-backward str-hiragana-a nil t))
+      (goto-char (1- (point-max)))
+      (Assert-eq 1 (search-backward str-a-diaeresis nil t))
+      (replace-match "a")
+      (Assert (looking-at (format "abcdefg%c" a-diaeresis))))
+    (with-temp-buffer
+      (set-case-table case-table)
+      (insert string)
+      (insert string)
+      (insert string)
+      (insert string)
+      (insert string)
+      (goto-char (point-min))
+      (Assert-eq 11 (search-forward string nil t 5))
+      (goto-char (point-min))
+      (Assert (not (search-forward string nil t 6)))
+      (goto-char (point-max))
+      (Assert-eq 1 (search-backward string nil t 5))
+      (goto-char (point-max))
+      (Assert (not (search-backward string nil t 6))))))
+
+;; Bug reported in http://mid.gmane.org/y9lk5lu5orq.fsf@deinprogramm.de from
+;; Michael Sperber. Fixed 2008-01-29.
+(with-string-as-buffer-contents "\n\nDer beruhmte deutsche Flei\xdf\n\n"
+  (goto-char (point-min))
+  (Assert (search-forward "Flei\xdf")))
+
+(with-temp-buffer
+  (let ((target "M\xe9zard")
+        (debug-xemacs-searches 1))
+    (Assert (not (search-forward target nil t)))
+    (insert target)
+    (goto-char (point-min))
+    ;; #### search-algorithm-used is simple-search after the following,
+    ;; which shouldn't be necessary; it should be possible to use
+    ;; Boyer-Moore. 
+    ;;
+    ;; But searches for ASCII strings in buffers with nothing above ?\xFF
+    ;; use Boyer Moore with the current implementation, which is the
+    ;; important thing for the Gnus use case.
+    (Assert= (1+ (length target)) (search-forward target nil t))))
+
+(Skip-Test-Unless
+ (boundp 'debug-xemacs-searches) ; normal when we have DEBUG_XEMACS
+ "not a DEBUG_XEMACS build"
+ "checks that the algorithm chosen by #'search-forward is relatively sane"
+ (let ((debug-xemacs-searches 1)
+       newcase)
+   (with-temp-buffer
+     (insert "\n\nDer beruehmte deutsche Fleiss\n\n")
+     (goto-char (point-min))
+     (Assert (search-forward "Fleiss"))
+     (delete-region (point-min) (point-max))
+     (insert "\n\nDer ber\xfchmte deutsche Flei\xdf\n\n")
+     (goto-char (point-min))
+     (Assert (search-forward "Flei\xdf"))
+     (Assert-eq 'boyer-moore search-algorithm-used)
+     (delete-region (point-min) (point-max))
+     (when (featurep 'mule)
+       (insert "\n\nDer ber\xfchmte deutsche Flei\xdf\n\n")
+       (goto-char (point-min))
+       (Assert 
+        (search-forward (format "Fle%c\xdf"
+                                (make-char 'latin-iso8859-9 #xfd))))
+       (Assert-eq 'boyer-moore search-algorithm-used)
+       (insert (make-char 'latin-iso8859-9 #xfd))
+       (goto-char (point-min))
+       (Assert (search-forward "Flei\xdf"))
+       (Assert-eq 'simple-search search-algorithm-used) 
+       (goto-char (point-min))
+       (Assert (search-forward (format "Fle%c\xdf"
+                                       (make-char 'latin-iso8859-9 #xfd))))
+       (Assert-eq 'simple-search search-algorithm-used)
+       (setq newcase (copy-case-table (standard-case-table)))
+       (put-case-table-pair (make-char 'ethiopic #x23 #x23)
+			    (make-char 'ethiopic #x23 #x25)
+			    newcase)
+       (with-case-table
+	 ;; Check that when a multidimensional character has case and two
+	 ;; repeating octets, searches involving it in the search pattern
+	 ;; use simple-search; otherwise boyer_moore() gets confused in the
+	 ;; construction of the stride table.
+	 newcase
+	 (delete-region (point-min) (point-max))
+	 (insert ?0)
+	 (insert (make-char 'ethiopic #x23 #x23))
+	 (insert ?1)
+	 (goto-char (point-min))
+	 (Assert-eql (search-forward
+		      (string (make-char 'ethiopic #x23 #x25))
+		      nil t)
+		     3)
+	 (Assert-eq 'simple-search search-algorithm-used)
+	 (goto-char (point-min))
+	 (Assert-eql (search-forward
+		      (string (make-char 'ethiopic #x23 #x27))
+		      nil t)
+		     nil)
+	 (Assert-eq 'boyer-moore search-algorithm-used))))))
+
+;; XEmacs bug of long standing.
+
+(with-temp-buffer
+  (insert "foo\201bar")
+  (goto-char (point-min))
+  (Assert-eq (search-forward "\201" nil t) 5))
--- a/tests/automated/symbol-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/symbol-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -63,8 +63,8 @@
 	(uninterned (make-symbol name)))
     (Assert (symbolp interned))
     (Assert (symbolp uninterned))
-    (Assert (equal (symbol-name interned) name))
-    (Assert (equal (symbol-name uninterned) name))
+    (Assert-equal (symbol-name interned) name)
+    (Assert-equal (symbol-name uninterned) name)
     (Assert (not (eq interned uninterned)))
     (Assert (not (equal interned uninterned)))))
 
@@ -76,12 +76,12 @@
 	       (Implementation-Incomplete-Expect-Failure
 		(Assert (not (zerop len)))
 		(garbage-collect)
-		(Assert (eq (length (weak-list-list weak-list))
-			    (if (not reversep) 0 len))))
+		(Assert-eq (length (weak-list-list weak-list))
+			    (if (not reversep) 0 len)))
 	     (Assert (not (zerop len)))
 	     (garbage-collect)
-	     (Assert (eq (length (weak-list-list weak-list))
-			 (if (not reversep) 0 len)))))))
+	     (Assert-eq (length (weak-list-list weak-list))
+			 (if (not reversep) 0 len))))))
   (let ((weak-list (make-weak-list))
 	(gc-cons-threshold most-positive-fixnum))
     ;; Symbols created with `make-symbol' and `gensym' should be fresh
@@ -112,7 +112,7 @@
 	string (read (concat "\"" string "\"")))
   (Assert (intern-soft string))
   (Assert (intern-soft symbol))
-  (Assert (eq (intern-soft string) (intern-soft symbol))))
+  (Assert-eq (intern-soft string) (intern-soft symbol)))
 
 (let ((fresh (read (concat "#:" (ts-fresh-symbol-name "foo")))))
   (Assert (not (intern-soft fresh))))
@@ -127,15 +127,15 @@
        (bar3 (nth 5 list)))
   (Assert (symbolp foo))
   (Assert (not (intern-soft foo)))
-  (Assert (equal (symbol-name foo) "foo"))
+  (Assert-equal (symbol-name foo) "foo")
   (Assert (symbolp bar))
   (Assert (not (intern-soft bar)))
-  (Assert (equal (symbol-name bar) "bar"))
+  (Assert-equal (symbol-name bar) "bar")
 
-  (Assert (eq foo foo2))
-  (Assert (eq foo2 foo3))
-  (Assert (eq bar bar2))
-  (Assert (eq bar2 bar3)))
+  (Assert-eq foo foo2)
+  (Assert-eq foo2 foo3)
+  (Assert-eq bar bar2)
+  (Assert-eq bar2 bar3))
 
 ;; Check #N=OBJECT and #N# print syntax.
 (let* ((foo (make-symbol "foo"))
@@ -143,10 +143,10 @@
        (list (list foo foo bar bar foo bar)))
   (let* ((print-gensym nil)
 	 (printed-list (prin1-to-string list)))
-    (Assert (equal printed-list "(foo foo bar bar foo bar)")))
+    (Assert-equal printed-list "(foo foo bar bar foo bar)"))
   (let* ((print-gensym t)
 	 (printed-list (prin1-to-string list)))
-    (Assert (equal printed-list "(#1=#:foo #1# #2=#:bar #2# #1# #2#)"))))
+    (Assert-equal printed-list "(#1=#:foo #1# #2=#:bar #2# #1# #2#)")))
 
 ;;-----------------------------------------------------
 ;; Read-only symbols
@@ -164,18 +164,18 @@
 (let ((foo 0)
       (bar 1))
   (defvaralias 'foo 'bar)
-  (Assert (eq foo bar))
-  (Assert (eq foo 1))
-  (Assert (eq (variable-alias 'foo) 'bar))
+  (Assert-eq foo bar)
+  (Assert-eq foo 1)
+  (Assert-eq (variable-alias 'foo) 'bar)
   (defvaralias 'bar 'foo)
   (Check-Error cyclic-variable-indirection
     (symbol-value 'foo))
   (Check-Error cyclic-variable-indirection
     (symbol-value 'bar))
   (defvaralias 'foo nil)
-  (Assert (eq foo 0))
+  (Assert-eq foo 0)
   (defvaralias 'bar nil)
-  (Assert (eq bar 1)))
+  (Assert-eq bar 1))
 
 ;;-----------------------------------------------------
 ;; Keywords
@@ -187,10 +187,10 @@
 ;; that is interned in the global obarray.
 
 ;; In Elisp, a keyword is interned as any other symbol.
-(Assert (eq (read ":foo") (intern ":foo")))
+(Assert-eq (read ":foo") (intern ":foo"))
 
 ;; A keyword is self-quoting and evaluates to itself.
-(Assert (eq (eval (intern ":foo")) :foo))
+(Assert-eq (eval (intern ":foo")) :foo)
 
 ;; Keywords are recognized as such only if interned in the global
 ;; obarray, and `keywordp' is aware of that.
@@ -208,14 +208,14 @@
 ;; keyword.
 (let* ((fresh-keyword-name (ts-fresh-symbol-name ":foo"))
        (fresh-keyword (intern fresh-keyword-name)))
-  (Assert (eq (symbol-value fresh-keyword) fresh-keyword))
+  (Assert-eq (symbol-value fresh-keyword) fresh-keyword)
   (Assert (keywordp fresh-keyword)))
 
 ;; Likewise, reading a fresh keyword string should produce a regular
 ;; keyword.
 (let* ((fresh-keyword-name (ts-fresh-symbol-name ":foo"))
        (fresh-keyword (read fresh-keyword-name)))
-  (Assert (eq (symbol-value fresh-keyword) fresh-keyword))
+  (Assert-eq (symbol-value fresh-keyword) fresh-keyword)
   (Assert (keywordp fresh-keyword)))
 
 ;;; Assigning to keywords
@@ -236,19 +236,19 @@
 
 ;; But symbols not interned in the global obarray are not real
 ;; keywords (in elisp):
-(Assert (eq (set (intern ":foo" [0]) 5) 5))
+(Assert-eq (set (intern ":foo" [0]) 5) 5)
 
 ;;; Printing keywords
 
 (let ((print-gensym t))
-  (Assert (equal (prin1-to-string :foo)                ":foo"))
-  (Assert (equal (prin1-to-string (intern ":foo"))     ":foo"))
-  (Assert (equal (prin1-to-string (intern ":foo" [0])) "#::foo")))
+  (Assert-equal (prin1-to-string :foo)                ":foo")
+  (Assert-equal (prin1-to-string (intern ":foo"))     ":foo")
+  (Assert-equal (prin1-to-string (intern ":foo" [0])) "#::foo"))
 
 (let ((print-gensym nil))
-  (Assert (equal (prin1-to-string :foo)                ":foo"))
-  (Assert (equal (prin1-to-string (intern ":foo"))     ":foo"))
-  (Assert (equal (prin1-to-string (intern ":foo" [0])) ":foo")))
+  (Assert-equal (prin1-to-string :foo)                ":foo")
+  (Assert-equal (prin1-to-string (intern ":foo"))     ":foo")
+  (Assert-equal (prin1-to-string (intern ":foo" [0])) ":foo"))
 
 ;; #### Add many more tests for printing and reading symbols, as well
 ;; as print-gensym and print-gensym-alist!
@@ -270,17 +270,17 @@
    (lambda (&rest args)
      (throw 'test-tag args)))
   (Assert (not (boundp mysym)))
-  (Assert (equal (catch 'test-tag
+  (Assert-equal (catch 'test-tag
 		   (set mysym 'foo))
-		 `(,mysym (foo) set nil nil)))
+		 `(,mysym (foo) set nil nil))
   (Assert (not (boundp mysym)))
   (dontusethis-set-symbol-value-handler
    mysym
    'set-value
    (lambda (&rest args) (setq save (nth 1 args))))
   (set mysym 'foo)
-  (Assert (equal save '(foo)))
-  (Assert (eq (symbol-value mysym) 'foo))
+  (Assert-equal save '(foo))
+  (Assert-eq (symbol-value mysym) 'foo)
   )
 
 (let ((mysym (make-symbol "test-symbol"))
@@ -290,9 +290,9 @@
    'make-unbound
    (lambda (&rest args)
      (throw 'test-tag args)))
-  (Assert (equal (catch 'test-tag
+  (Assert-equal (catch 'test-tag
 		   (makunbound mysym))
-		 `(,mysym nil makunbound nil nil)))
+		 `(,mysym nil makunbound nil nil))
   (dontusethis-set-symbol-value-handler
    mysym
    'make-unbound
@@ -300,27 +300,27 @@
   (Assert (not (boundp mysym)))
   (set mysym 'bar)
   (Assert (null save))
-  (Assert (eq (symbol-value mysym) 'bar))
+  (Assert-eq (symbol-value mysym) 'bar)
   (makunbound mysym)
   (Assert (not (boundp mysym)))
-  (Assert (eq save 'makunbound))
+  (Assert-eq save 'makunbound)
   )
 
 ;; pathname-coding-system is no more.
 ; (when (featurep 'file-coding)
-;   (Assert (eq pathname-coding-system file-name-coding-system))
+;   (Assert-eq pathname-coding-system file-name-coding-system)
 ;   (let ((val1 file-name-coding-system)
 ; 	(val2 pathname-coding-system))
-;     (Assert (eq val1 val2))
+;     (Assert-eq val1 val2)
 ;     (let ((file-name-coding-system 'no-conversion-dos))
-;       (Assert (eq file-name-coding-system 'no-conversion-dos))
-;       (Assert (eq pathname-coding-system file-name-coding-system)))
+;       (Assert-eq file-name-coding-system 'no-conversion-dos)
+;       (Assert-eq pathname-coding-system file-name-coding-system))
 ;     (let ((pathname-coding-system 'no-conversion-mac))
-;       (Assert (eq file-name-coding-system 'no-conversion-mac))
-;       (Assert (eq pathname-coding-system file-name-coding-system)))
-;     (Assert (eq file-name-coding-system pathname-coding-system))
-;     (Assert (eq val1 file-name-coding-system)))
-;   (Assert (eq pathname-coding-system file-name-coding-system)))
+;       (Assert-eq file-name-coding-system 'no-conversion-mac)
+;       (Assert-eq pathname-coding-system file-name-coding-system))
+;     (Assert-eq file-name-coding-system pathname-coding-system)
+;     (Assert-eq val1 file-name-coding-system))
+;   (Assert-eq pathname-coding-system file-name-coding-system))
 
 
 ;(let ((mysym (make-symbol "test-symbol")))
--- a/tests/automated/syntax-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/syntax-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -49,7 +49,7 @@
     (insert string)
     (goto-char point)
     (forward-word 1)
-    (Assert (eq (point) (+ point stop)))))
+    (Assert-eq (point) (+ point stop))))
 
 (with-temp-buffer
   ;; -!- W NW
@@ -77,7 +77,7 @@
   (insert string)
   (let ((point (point)))
     (backward-word 1)
-    (Assert (eq (point) (- point stop)))))
+    (Assert-eq (point) (- point stop))))
 
 (with-temp-buffer
   ;; NW W -!-
@@ -120,7 +120,7 @@
 			 'syntax-table apply-syntax)
       (goto-char point)
       (forward-word 1)
-      (Assert (eq (point) (+ point stop))))))
+      (Assert-eq (point) (+ point stop)))))
 
 ;; test syntax-table extents
 (with-temp-buffer
@@ -143,7 +143,7 @@
   (with-syntax-table (make-syntax-table)
     (insert "foo bar")
     (backward-sexp 1)
-    (Assert (eql (point) 5))))
+    (Assert-eql (point) 5)))
 
 ;; Test forward-comment at buffer boundaries
 ;; #### The second Assert fails (once interpreted, once compiled) on 21.4.9
@@ -156,13 +156,13 @@
     
     (insert "// comment\n")
     (forward-comment -2)
-    (Assert (eq (point) (point-min)))
+    (Assert-eq (point) (point-min))
 
     (let ((point (point)))
       (insert "/* comment */")
       (goto-char point)
       (forward-comment 2)
-      (Assert (eq (point) (point-max)))
+      (Assert-eq (point) (point-max))
 
       ;; this last used to crash
       (parse-partial-sexp point (point-max)))))
@@ -203,7 +203,7 @@
 			 "Unbalanced parentheses"
 			 (backward-up-list-moves-point-from-to 25 nil))
     ;; special-case check that point didn't move
-    (Assert (= (point) 25))))
+    (Assert= (point) 25)))
 
 (loop
   with envvar-not-existing = (symbol-name (gensym "whatever"))
--- a/tests/automated/tag-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/tag-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -70,7 +70,7 @@
     ;; Search for the tag "mystruct"; this should succeed
     (Silence-Message
      (find-tag "mystruct"))
-    (Assert (eq (point) 2))
+    (Assert-eq (point) 2)
 
     ;; Search again.  The search should fail, based on the patch that
     ;; Sven Grundmann submitted for 21.4.16.
@@ -86,7 +86,7 @@
 	(Silence-Message
 	 (find-tag "require"))
       (t t))
-    (Assert (eq (point) 52)))
+    (Assert-eq (point) 52))
 
   (kill-buffer testfile)
   (delete-file testfile)
--- a/tests/automated/test-harness.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/test-harness.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,7 +1,7 @@
 ;; test-harness.el --- Run Emacs Lisp test suites.
 
 ;;; Copyright (C) 1998, 2002, 2003 Free Software Foundation, Inc.
-;;; Copyright (C) 2002 Ben Wing.
+;;; Copyright (C) 2002, 2010 Ben Wing.
 
 ;; Author: Martin Buchholz
 ;; Maintainer: Stephen J. Turnbull <stephen@xemacs.org>
@@ -115,6 +115,12 @@
 	  (length "byte-compiler-tests.el:")) ; use the longest file name
   "Format for \"No tests\" lines printed after a file is run.")
 
+(defconst test-harness-aborted-summary-template
+  (format "%%-%ds          %%%dd tests completed (aborted)."
+	  (length "byte-compiler-tests.el:") ; use the longest file name
+	  5)
+  "Format for summary lines printed after a test run on a file was aborted.")
+
 ;;;###autoload
 (defun test-emacs-test-file (filename)
   "Test a file of Lisp code named FILENAME.
@@ -209,12 +215,20 @@
       (defconst test-harness-failure-tag "FAIL")
       (defconst test-harness-success-tag "PASS")
 
+;;;;; BEGIN DEFINITION OF MACROS USEFUL IN TEST CODE
+
       (defmacro Known-Bug-Expect-Failure (&rest body)
+	"Wrap a BODY that consists of tests that are known to fail.
+This causes messages to be printed on failure indicating that this is expected,
+and on success indicating that this is unexpected."
 	`(let ((test-harness-failure-tag "KNOWN BUG")
 	       (test-harness-success-tag "PASS (FAILURE EXPECTED)"))
 	  ,@body))
 
       (defmacro Known-Bug-Expect-Error (expected-error &rest body)
+	"Wrap a BODY that consists of tests that are known to trigger an error.
+This causes messages to be printed on failure indicating that this is expected,
+and on success indicating that this is unexpected."
 	(let ((quoted-body (if (= 1 (length body))
 			       `(quote ,(car body)) `(quote (progn ,@body)))))
           `(let ((test-harness-failure-tag "KNOWN BUG")
@@ -237,6 +251,10 @@
                (incf wrong-error-failures))))))
 
       (defmacro Implementation-Incomplete-Expect-Failure (&rest body)
+	"Wrap a BODY containing tests that are known to fail due to incomplete code.
+This causes messages to be printed on failure indicating that the
+implementation is incomplete (and hence the failure is expected); and on
+success indicating that this is unexpected."
 	`(let ((test-harness-failure-tag "IMPLEMENTATION INCOMPLETE")
 	       (test-harness-success-tag "PASS (FAILURE EXPECTED)"))
 	  ,@body))
@@ -269,28 +287,118 @@
 
       (defmacro Assert (assertion &optional failing-case description)
 	"Test passes if ASSERTION is true.
-Optional FAILING-CASE describes the particular failure.
-Optional DESCRIPTION describes the assertion.
-FAILING-CASE and DESCRIPTION are useful when Assert is used in a loop."
-	`(condition-case error-info
-	  (progn
-	    (assert ,assertion)
-	    (Print-Pass "%S" (quote ,(or description assertion)))
-	    (incf passes))
-	  (cl-assertion-failed
-	   (Print-Failure (if ,failing-case
-			      "Assertion failed: %S; failing case = %S"
-			    "Assertion failed: %S")
-			  (quote ,(or description assertion)) ,failing-case)
-	   (incf assertion-failures))
-	  (t (Print-Failure (if ,failing-case
-				"%S ==> error: %S; failing case =  %S"
-			      "%S ==> error: %S")
-			    (quote ,(or description assertion))
-			    error-info ,failing-case)
-	     (incf other-failures)
-	     )))
+Optional FAILING-CASE describes the particular failure.  Optional
+DESCRIPTION describes the assertion; by default, the unevalated assertion
+expression is given.  FAILING-CASE and DESCRIPTION are useful when Assert
+is used in a loop."
+	(let ((description
+	       (or description `(quote ,assertion))))
+	  `(condition-case error-info
+	    (progn
+	      (assert ,assertion)
+	      (Print-Pass "%S" ,description)
+	      (incf passes))
+	    (cl-assertion-failed
+	     (Print-Failure (if ,failing-case
+				"Assertion failed: %S; failing case = %S"
+			      "Assertion failed: %S")
+			    ,description ,failing-case)
+	     (incf assertion-failures))
+	    (t (Print-Failure (if ,failing-case
+				  "%S ==> error: %S; failing case =  %S"
+				"%S ==> error: %S")
+			      ,description error-info ,failing-case)
+	       (incf other-failures)
+	       ))))
+
+;;;;; BEGIN DEFINITION OF SPECIFIC KINDS OF ASSERT MACROS
+
+      (defmacro Assert-test (test testval expected &optional failing-case
+			     description)
+	"Test passes if TESTVAL compares correctly to EXPECTED using TEST.
+TEST should be a two-argument predicate (i.e. a function of two arguments
+that returns t or nil), such as `eq', `eql', `equal', `equalp', `=', `<=',
+'>', 'file-newer-than-file-p' etc.  Optional FAILING-CASE describes the
+particular failure; any value given here will be concatenated with a phrase
+describing the expected and actual values of the comparison.  Optional
+DESCRIPTION describes the assertion; by default, the unevalated comparison
+expressions are given.  FAILING-CASE and DESCRIPTION are useful when Assert
+is used in a loop."
+	(let* ((assertion `(,test ,testval ,expected))
+	       (failmsg `(format "%S should be `%s' to %S but isn't"
+			  ,testval ',test ,expected))
+	       (failmsg2 (if failing-case `(concat 
+					   (format "%S, " ,failing-case)
+					   ,failmsg)
+			  failmsg)))
+	  `(Assert ,assertion ,failmsg2 ,description)))
 
+      (defmacro Assert-test-not (test testval expected &optional failing-case
+				 description)
+	"Test passes if TESTVAL does not compare correctly to EXPECTED using TEST.
+TEST should be a two-argument predicate (i.e. a function of two arguments
+that returns t or nil), such as `eq', `eql', `equal', `equalp', `=', `<=',
+'>', 'file-newer-than-file-p' etc.  Optional FAILING-CASE describes the
+particular failure; any value given here will be concatenated with a phrase
+describing the expected and actual values of the comparison.  Optional
+DESCRIPTION describes the assertion; by default, the unevalated comparison
+expressions are given.  FAILING-CASE and DESCRIPTION are useful when Assert
+is used in a loop."
+	(let* ((assertion `(not (,test ,testval ,expected)))
+	       (failmsg `(format "%S shouldn't be `%s' to %S but is"
+			  ,testval ',test ,expected))
+	       (failmsg2 (if failing-case `(concat 
+					   (format "%S, " ,failing-case)
+					   ,failmsg)
+			  failmsg)))
+	  `(Assert ,assertion ,failmsg2 ,description)))
+
+      ;; Specific versions of `Assert-test'.  These are just convenience
+      ;; functions, functioning identically to `Assert-test', and duplicating
+      ;; the doc string for each would be too annoying.
+      (defmacro Assert-eq (testval expected &optional failing-case
+			   description)
+	`(Assert-test eq ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-eql (testval expected &optional failing-case
+			    description)
+	`(Assert-test eql ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-equal (testval expected &optional failing-case
+			      description)
+	`(Assert-test equal ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-equalp (testval expected &optional failing-case
+			      description)
+	`(Assert-test equalp ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-string= (testval expected &optional failing-case
+			      description)
+	`(Assert-test string= ,testval ,expected ,failing-case ,description))
+      (defmacro Assert= (testval expected &optional failing-case
+			 description)
+	`(Assert-test = ,testval ,expected ,failing-case ,description))
+      (defmacro Assert<= (testval expected &optional failing-case
+			  description)
+	`(Assert-test <= ,testval ,expected ,failing-case ,description))
+
+      ;; Specific versions of `Assert-test-not'.  These are just convenience
+      ;; functions, functioning identically to `Assert-test-not', and
+      ;; duplicating the doc string for each would be too annoying.
+      (defmacro Assert-not-eq (testval expected &optional failing-case
+			       description)
+	`(Assert-test-not eq ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-eql (testval expected &optional failing-case
+				description)
+	`(Assert-test-not eql ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-equal (testval expected &optional failing-case
+				  description)
+	`(Assert-test-not equal ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-equalp (testval expected &optional failing-case
+				   description)
+	`(Assert-test-not equalp ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not-string= (testval expected &optional failing-case
+				    description)
+	`(Assert-test-not string= ,testval ,expected ,failing-case ,description))
+      (defmacro Assert-not= (testval expected &optional failing-case
+			     description)
+	`(Assert-test-not = ,testval ,expected ,failing-case ,description))
 
       (defmacro Check-Error (expected-error &rest body)
 	(let ((quoted-body (if (= 1 (length body))
@@ -396,7 +504,7 @@
 	 (princ (format "Unexpected error %S while executing interpreted code\n"
 		error-info))
 	 (message "Unexpected error %S while executing interpreted code." error-info)
-	 (message "Test suite execution aborted." error-info)
+	 (message "Test suite execution aborted.")
 	 ))
       (princ "\nTesting Compiled Lisp\n\n")
       (let (code
@@ -417,7 +525,7 @@
 	   (princ (format "Unexpected error %S while executing byte-compiled code\n"
 			  error-info))
 	   (message "Unexpected error %S while executing byte-compiled code." error-info)
-	   (message "Test suite execution aborted." error-info)
+	   (message "Test suite execution aborted.")
 	   )))
       (princ (format "\nSUMMARY for %s:\n" filename))
       (princ (format "\t%5d passes\n" passes))
@@ -434,12 +542,16 @@
 		       other-failures))
 	     (basename (file-name-nondirectory filename))
 	     (summary-msg
-	      (if (> total 0)
-		  (format test-harness-file-summary-template
-			  (concat basename ":")
-			  passes total (/ (* 100 passes) total))
-		(format test-harness-null-summary-template
-			(concat basename ":"))))
+	      (cond ((> unexpected-test-file-failures 0)
+		     (format test-harness-aborted-summary-template
+			     (concat basename ":") total))
+		    ((> total 0)
+		     (format test-harness-file-summary-template
+			     (concat basename ":")
+			     passes total (/ (* 100 passes) total)))
+		    (t
+		     (format test-harness-null-summary-template
+			     (concat basename ":")))))
 	     (reasons ""))
 	(maphash (lambda (key value)
 		   (setq reasons
@@ -530,7 +642,10 @@
 Use this from the command line, with `-batch';
 it won't work in an interactive Emacs.
 Each file is processed even if an error occurred previously.
-For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\""
+A directory can be given as well, and all files will be processed --
+however, the file test-harness.el, which implements the test harness,
+will be skipped.
+For example, invoke \"xemacs -batch -f batch-test-emacs tests\""
   ;; command-line-args-left is what is left of the command line (from
   ;; startup.el)
   (defvar command-line-args-left)	;Avoid 'free variable' warning
@@ -579,14 +694,19 @@
 		 (basename (file-name-nondirectory (first head)))
 		 (nsucc (second head))
 		 (ntest (third head)))
-	    (if (> ntest 0)
-		(message test-harness-file-summary-template
-			 (concat basename ":")
-			 nsucc
-			 ntest
-			 (/ (* 100 nsucc) ntest))
-	      (message test-harness-null-summary-template
-		       (concat basename ":")))
+	    (cond ((member (first head) unexpected-test-suite-failure-files)
+		   (message test-harness-aborted-summary-template
+			    (concat basename ":")
+			    ntest))
+		  ((> ntest 0)
+		   (message test-harness-file-summary-template
+			    (concat basename ":")
+			    nsucc
+			    ntest
+			    (/ (* 100 nsucc) ntest)))
+		  (t
+		   (message test-harness-null-summary-template
+			    (concat basename ":"))))
 	    (setq results (cdr results)))))
       (when (> unexpected-test-suite-failures 0)
 	(message "\n***** There %s %d unexpected test suite %s in %s:"
--- a/tests/automated/weak-tests.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/automated/weak-tests.el	Wed Feb 24 01:58:04 2010 -0600
@@ -40,7 +40,7 @@
 
 ;; tests for weak-boxes
 (let ((w (make-weak-box (cons 2 3))))
-  (Assert (equal (cons 2 3) (weak-box-ref w)))
+  (Assert-equal (cons 2 3) (weak-box-ref w))
   (garbage-collect)
   (Assert (not (weak-box-ref w))))
 
@@ -53,7 +53,7 @@
 			     #'(lambda (value)
                                  (setq finalized-p t))))
        (eph2 (make-ephemeron p p)))
-  (Assert (eq p (ephemeron-ref (make-ephemeron (cons 1 2) p))))
+  (Assert-eq p (ephemeron-ref (make-ephemeron (cons 1 2) p)))
   (Assert (ephemeron-p (make-ephemeron (cons 1 2) p)))
 
   (garbage-collect)
@@ -64,7 +64,7 @@
 
   (garbage-collect)
   
-  (Assert (eq p (ephemeron-ref eph2))))
+  (Assert-eq p (ephemeron-ref eph2)))
 
 (garbage-collect)
 
@@ -81,20 +81,20 @@
   (set-weak-list-list weaklist3 (list a (cons 1 2) b))
   (set-weak-list-list weaklist4 (list a b (cons 1 2)))
   (Assert (weak-list-p weaklist1))
-  (Assert (eq (weak-list-type weaklist1) 'simple))
+  (Assert-eq (weak-list-type weaklist1) 'simple)
   (Assert (weak-list-p weaklist2))
-  (Assert (eq (weak-list-type weaklist2) 'simple))
+  (Assert-eq (weak-list-type weaklist2) 'simple)
   (Assert (weak-list-p weaklist3))
-  (Assert (eq (weak-list-type weaklist3) 'simple))
+  (Assert-eq (weak-list-type weaklist3) 'simple)
   (Assert (weak-list-p weaklist4))
-  (Assert (eq (weak-list-type weaklist4) 'simple))
+  (Assert-eq (weak-list-type weaklist4) 'simple)
 
   (garbage-collect)
 
-  (Assert (eq (weak-list-list weaklist1) testlist))
-  (Assert (equal (weak-list-list weaklist2) testlist))
-  (Assert (equal (weak-list-list weaklist3) testlist))
-  (Assert (equal (weak-list-list weaklist4) testlist)))
+  (Assert-eq (weak-list-list weaklist1) testlist)
+  (Assert-equal (weak-list-list weaklist2) testlist)
+  (Assert-equal (weak-list-list weaklist3) testlist)
+  (Assert-equal (weak-list-list weaklist4) testlist))
 
 (garbage-collect)
 
@@ -111,20 +111,20 @@
   (set-weak-list-list weaklist3 (list b (cons a (cons 1 2)) b))
   (set-weak-list-list weaklist4 (list b (cons (cons 1 2) (cons 3 4)) b))
   (Assert (weak-list-p weaklist1))
-  (Assert (eq (weak-list-type weaklist1) 'assoc))
+  (Assert-eq (weak-list-type weaklist1) 'assoc)
   (Assert (weak-list-p weaklist2))
-  (Assert (eq (weak-list-type weaklist2) 'assoc))
+  (Assert-eq (weak-list-type weaklist2) 'assoc)
   (Assert (weak-list-p weaklist3))
-  (Assert (eq (weak-list-type weaklist3) 'assoc))
+  (Assert-eq (weak-list-type weaklist3) 'assoc)
   (Assert (weak-list-p weaklist4))
-  (Assert (eq (weak-list-type weaklist4) 'assoc))
+  (Assert-eq (weak-list-type weaklist4) 'assoc)
 
   (garbage-collect)
 
-  (Assert (eq (weak-list-list weaklist1) testlist))
-  (Assert (equal (weak-list-list weaklist2) testlist))
-  (Assert (equal (weak-list-list weaklist3) testlist))
-  (Assert (equal (weak-list-list weaklist4) testlist)))
+  (Assert-eq (weak-list-list weaklist1) testlist)
+  (Assert-equal (weak-list-list weaklist2) testlist)
+  (Assert-equal (weak-list-list weaklist3) testlist)
+  (Assert-equal (weak-list-list weaklist4) testlist))
 
 (garbage-collect)
 
@@ -141,20 +141,20 @@
   (set-weak-list-list weaklist3 (list b (cons a (cons 1 2)) b))
   (set-weak-list-list weaklist4 (list b (cons (cons 1 2) (cons 3 4)) b))
   (Assert (weak-list-p weaklist1))
-  (Assert (eq (weak-list-type weaklist1) 'key-assoc))
+  (Assert-eq (weak-list-type weaklist1) 'key-assoc)
   (Assert (weak-list-p weaklist2))
-  (Assert (eq (weak-list-type weaklist2) 'key-assoc))
+  (Assert-eq (weak-list-type weaklist2) 'key-assoc)
   (Assert (weak-list-p weaklist3))
-  (Assert (eq (weak-list-type weaklist3) 'key-assoc))
+  (Assert-eq (weak-list-type weaklist3) 'key-assoc)
   (Assert (weak-list-p weaklist4))
-  (Assert (eq (weak-list-type weaklist4) 'key-assoc))
+  (Assert-eq (weak-list-type weaklist4) 'key-assoc)
 
   (garbage-collect)
 
-  (Assert (eq (weak-list-list weaklist1) testlist))
-  (Assert (equal (weak-list-list weaklist2) testlist))
-  (Assert (equal (weak-list-list weaklist3) (list b (cons a (cons 1 2)) b)))
-  (Assert (equal (weak-list-list weaklist4) testlist)))
+  (Assert-eq (weak-list-list weaklist1) testlist)
+  (Assert-equal (weak-list-list weaklist2) testlist)
+  (Assert-equal (weak-list-list weaklist3) (list b (cons a (cons 1 2)) b))
+  (Assert-equal (weak-list-list weaklist4) testlist))
 
 (garbage-collect)
 
@@ -171,20 +171,20 @@
   (set-weak-list-list weaklist3 (list b (cons a (cons 1 2)) b))
   (set-weak-list-list weaklist4 (list b (cons (cons 1 2) (cons 3 4)) b))
   (Assert (weak-list-p weaklist1))
-  (Assert (eq (weak-list-type weaklist1) 'value-assoc))
+  (Assert-eq (weak-list-type weaklist1) 'value-assoc)
   (Assert (weak-list-p weaklist2))
-  (Assert (eq (weak-list-type weaklist2) 'value-assoc))
+  (Assert-eq (weak-list-type weaklist2) 'value-assoc)
   (Assert (weak-list-p weaklist3))
-  (Assert (eq (weak-list-type weaklist3) 'value-assoc))
+  (Assert-eq (weak-list-type weaklist3) 'value-assoc)
   (Assert (weak-list-p weaklist4))
-  (Assert (eq (weak-list-type weaklist4) 'value-assoc))
+  (Assert-eq (weak-list-type weaklist4) 'value-assoc)
 
   (garbage-collect)
 
-  (Assert (eq (weak-list-list weaklist1) testlist))
-  (Assert (equal (weak-list-list weaklist2) (list b (cons (cons 1 2) a) b)))
-  (Assert (equal (weak-list-list weaklist3) testlist))
-  (Assert (equal (weak-list-list weaklist4) testlist)))
+  (Assert-eq (weak-list-list weaklist1) testlist)
+  (Assert-equal (weak-list-list weaklist2) (list b (cons (cons 1 2) a) b))
+  (Assert-equal (weak-list-list weaklist3) testlist)
+  (Assert-equal (weak-list-list weaklist4) testlist))
 
 (garbage-collect)
 
@@ -201,20 +201,20 @@
   (set-weak-list-list weaklist3 (list b (cons a (cons 1 2)) b))
   (set-weak-list-list weaklist4 (list b (cons (cons 1 2) (cons 3 4)) b))
   (Assert (weak-list-p weaklist1))
-  (Assert (eq (weak-list-type weaklist1) 'full-assoc))
+  (Assert-eq (weak-list-type weaklist1) 'full-assoc)
   (Assert (weak-list-p weaklist2))
-  (Assert (eq (weak-list-type weaklist2) 'full-assoc))
+  (Assert-eq (weak-list-type weaklist2) 'full-assoc)
   (Assert (weak-list-p weaklist3))
-  (Assert (eq (weak-list-type weaklist3) 'full-assoc))
+  (Assert-eq (weak-list-type weaklist3) 'full-assoc)
   (Assert (weak-list-p weaklist4))
-  (Assert (eq (weak-list-type weaklist4) 'full-assoc))
+  (Assert-eq (weak-list-type weaklist4) 'full-assoc)
 
   (garbage-collect)
 
-  (Assert (eq (weak-list-list weaklist1) testlist))
-  (Assert (equal (weak-list-list weaklist2) (list b (cons (cons 1 2) a) b)))
-  (Assert (equal (weak-list-list weaklist3) (list b (cons a (cons 1 2)) b)))
-  (Assert (equal (weak-list-list weaklist4) testlist)))
+  (Assert-eq (weak-list-list weaklist1) testlist)
+  (Assert-equal (weak-list-list weaklist2) (list b (cons (cons 1 2) a) b))
+  (Assert-equal (weak-list-list weaklist3) (list b (cons a (cons 1 2)) b))
+  (Assert-equal (weak-list-list weaklist4) testlist))
 
 (garbage-collect)
 
--- a/tests/frame.el	Wed Jan 20 07:05:57 2010 -0600
+++ b/tests/frame.el	Wed Feb 24 01:58:04 2010 -0600
@@ -1,4 +1,24 @@
-;;; Test geometry settings for frames
+;;; Test geometry setting for frames.
+;;;
+;;; Copyright (C) 1997 Martin Buchholz
+;;;
+;;; This file is part of XEmacs.
+;;;
+;;; XEmacs is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your
+;;; option) any later version.
+;;;
+;;; XEmacs is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;;; Boston, MA 02110-1301, USA.
+
 (defmacro check-frame-geometry (xx yy)
   `(loop for frame in (list nil (selected-frame))
 	 do
@@ -24,4 +44,3 @@
 	    (check-frame-geometry x (+ y 3))
 	    (set-frame-property frame 'left (+ x 3))
 	    (check-frame-geometry (+ x 3) (+ y 3))))
-