Commits

Anonymous committed e7ef978

Import from CVS: tag r21-2-43

Comments (0)

Files changed (46)

+to 21.2.43 "Terspichore"
+-- Important gnuserv security fix.  Upgrade if you use gnuserv.
+   -- Klaus Frank, Jan Vroonhof, Gunnar Evermann
+-- C-level alignment correctness fixes -- Martin Buchholz
+-- cut-and-paste slowness under Motif fixed -- Andy Piper
+-- pdump now works on SunOS 4 and HP-UX -- Martin Buchholz
+-- Packages documentation updates -- Steve Youngs
+-- Windows netinstall changes -- Andy Piper
+
 to 21.2.42 "Poseidon"
 -- 64-bit platforms (Alpha) broken in 21.2.41 now fixed -- Martin Buchholz
 -- Windows packaging changes -- Andy Piper
 -- Calls to the following functions are now better optimized:
    backward-char backward-word plusp, minusp oddp evenp -- Martin Buchholz
 -- COUNT argument to following functions is now optional:
-   forward-word backward-word mark-word kill-word backward-kill-word 
+   forward-word backward-word mark-word kill-word backward-kill-word
    forward-comment delete-char backward-delete-char -- Martin Buchholz
 -- Don't put gutters/tabs on popup windows -- Andy Piper
 -- Fix up info file cross references -- Adrian Aichner
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
+2001-01-21  Steve Youngs  <youngs@xemacs.org>
+
+	* ./etc/PACKAGES: Doc fix.
+
+	* README.packages: Doc fix.
+
+2001-01-17  Steve Youngs  <youngs@xemacs.org>
+
+	* README.packages: Update.
+
+	* ./etc/PACKAGES: Update.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
+                                                            -*- Outline -*-
+This file is in Outline mode.  It is best viewed under XEmacs.
+
+Press C-c C-o (Ctrl+c Ctrl+o) now to see a list of headings.
+  To expand a heading:  Put the cursor on the heading and press C-c C-s
+To collapse a heading:  Press C-c C-d
+
+For general XEmacs navigation tips: Press C-h t
+
 The XEmacs Packages Quick Start Guide
 -------------------------------------
 
 and its packages from start.  For details see the 'Startup Paths' and
 'Packages' sections of the XEmacs info manual.
 
-Real Real Quickstart FAQ
-------------------------
+* Real Real Quickstart FAQ
+--------------------------
 
 Q. Do I need to have the packages to compile XEmacs?
 A. No, XEmacs will build and install just fine without any packages
    you.  You can either track it down and install it, or install the
    `Sumo Tarball' (see the second FAQ).
 
-A note of caution
------------------
+* A note of caution
+-------------------
 
 The XEmacs package system is still in its infancy. Please expect a few
 minor hurdles on the way. Also neither the interface nor the structure is
 backwards compatibility as quirks are worked out over the coming
 releases.
 
-Some Package Theory
--------------------
+* Some Package Theory
+---------------------
 
 In order to reduce the size and increase the maintainability of XEmacs,
 the majority of the Elisp packages that came with previous releases
 the right place. On startup XEmacs will find them, set up the load
 path correctly, install autoloads, etc, etc.
 
-Package hierarchies
--------------------
+* Package hierarchies
+---------------------
 
 On Startup XEmacs looks for packages in so called package hierarchies.
 These can be specified by the 'package-path' parameter to the
 'configure' script. However by default there are three system wide
-hierarchies.
-
-$prefix/lib/xemacs/site-packages
-     Local and 3rd party packages go here.
-
-$prefix/lib/xemacs/mule-packages
-     Only searched by MULE-enabled XEmacsen.
+hierarchies. ("$prefix" defaults to "/usr/local")
 
 $prefix/lib/xemacs/xemacs-packages
      Normal packages go here.
 
-Where to get the packages
--------------------------
+$prefix/lib/xemacs/mule-packages
+     Mule packages go here and are only searched by MULE-enabled XEmacsen.
+
+$prefix/lib/xemacs/site-packages/
+     Local and 3rd party packages go here.
+
+
+* Where to get the packages
+---------------------------
 
 Packages are available from ftp://ftp.xemacs.org/pub/xemacs/packages
 and its mirrors.
 
-How to install the packages
----------------------------
+* How to install the packages
+-----------------------------
+There are a few different ways to install packages:
 
-1. All at once, using the 'Sumo Tarball'.
-2. By hand.
-3. Automatically, using the package tools from XEmacs.
+	1. Manually, all at once, using the 'Sumo Tarball'.
+	2. Manually, using individual package tarballs.
+	3. Automatically, using the package tools from XEmacs.
 
-The Sumo Tarball
-----------------
+** Manually, all at once, using the 'Sumo Tarball'
+--------------------------------------------------
 
 Those with little time, cheap connections and plenty of disk space can
 install all the packages at once using the sumo tarballs.
-Download the file
+Download the file:
 
-xemacs-sumo.tar.gz
+   xemacs-sumo.tar.gz
 
-For an XEmacs compiled with Mule you also need
+For an XEmacs compiled with Mule you also need:
 
-xemacs-mule-sumo.tar.gz
+   xemacs-mule-sumo.tar.gz
 
 N.B. They are called 'Sumo Tarballs' for good reason. They are
-currently about 15MB and 2.3MB (gzipped) respectively.
+currently about 19MB and 4.5MB (gzipped) respectively.
 
-Install them by
+Install them by:
 
-cd $prefix/lib/xemacs ; gunzip -c <tarballname> | tar xf -
+   cd $prefix/lib/xemacs ; gunzip -c <tarballname> | tar xvf - RET
+
+Or, if you have GNU tar:
+
+   cd $prefix/lib/xemacs ; tar zxvf /path/to/<tarballname> RET
 
 As the Sumo tarballs are not regenerated as often as the individual
 packages, it is recommended that you use the automatic package tools
 afterwards to pick up any recent updates.
 
-Installing by Hand
-------------------
+** Manually, using individual package tarballs
+----------------------------------------------
 
-Fetch the packages from the ftp site, CDROM whatever. The filenames
+Fetch the packages from the FTP site, CD-ROM whatever. The filenames
 have the form name-<version>-pkg.tar.gz and are gzipped tar files. For
 a fresh install it is sufficient to untar the file at the top of the
-package hierarchy. For example if we are installing the 'xemacs-base'
-package in version 1.27:
+package hierarchy. 
 
-mkdir $prefix/lib/xemacs/xemacs-packages # if it does not exist yet
-cd $prefix/lib/xemacs/xemacs-packages
-gunzip -c ...../xemacs-base-1.27-pkg.tar.gz | tar xf -
+Note: If you are upgrading packages already installed, it's best to
+remove the old package first (see 'Upgrading/Removing Packages' below).
 
-For MULE related packages, it is best to untar in the mule-packages
-hierarchy, i.e. for the mule-base package, version 1.25
+For example if we are installing the 'xemacs-base'
+package (version 1.48):
 
-mkdir $prefix/lib/xemacs/mule-packages # if it does not exist yet
-cd $prefix/lib/xemacs/mule-packages
-gunzip -c ...../mule-base-1.25-pkg.tar.gz | tar xf -
+   mkdir $prefix/lib/xemacs/xemacs-packages RET # if it does not exist yet
+   cd $prefix/lib/xemacs/xemacs-packages RET
+   gunzip -c /path/to/xemacs-base-1.48-pkg.tar.gz | tar xvf - RET
 
-Installing automatically
-------------------------
+Or if you have GNU tar, the last step can be:
+
+   tar zxvf /path/to/xemacs-base-1.48-pkg.tar.gz RET
+
+For MULE related packages, it is best to untar into the mule-packages
+hierarchy, i.e. for the mule-base package, version 1.37:
+
+   mkdir $prefix/lib/xemacs/mule-packages RET # if it does not exist yet
+   cd $prefix/lib/xemacs/mule-packages RET
+   gunzip -c /path/to/mule-base-1.37-pkg.tar.gz | tar xvf - RET
+
+Or if you have GNU tar, the last step can be:
+
+   tar zxvf /path/to/mule-base-1.37-pkg.tar.gz RET
+
+
+** Automatically, using the package tools from XEmacs
+-----------------------------------------------------
 
 XEmacs comes with some tools to make the periodic updating and
 installing easier. It will notice if new packages or versions are
-available and will fetch them from the ftp site.
+available and will fetch them from the FTP site.
 
 Unfortunately this requires that a few packages are already in place.
 You will have to install them by hand as above or use a SUMO tarball.
 This requirement will hopefully go away in the future. The packages
 you need are:
 
-   efs          - To fetch the files from the ftp site or mirrors.
+   efs          - To fetch the files from the FTP site or mirrors.
    xemacs-base  - Needed by efs.
 
 and optionally:
 
-   mailcrypt    - If you have PGP installed and want to verify the
-                  signature of the index file.
    mule-base    - Needed if you want to use XEmacs with MULE.
 
-After installing these by hand, you can start XEmacs. (It is a good
-idea to use 'xemacs -vanilla' here as your startup files might need
-things now moved to packages.)
+After installing these by hand, fire up XEmacs and follow these
+steps.
 
- - First you need to specify an FTP site to use.
-      Use Options->Manage Packages->Add Download Site
-       or M-x customize-variable RET package-get-remote RET
+Note: The menus in XEmacs 21.2.x and up have changed slightly, so
+where I mention "Options -> Manage Packages", substitute "Tools ->
+Packages".
 
-   Alternatively, if you already have the packages on a local disk
-   then you can specify this directly using 'M-x
-   pui-add-install-directory'. Please make sure you also have a
-   corresponding copy of the package index there.
+  (1) Choose a download site.
+      - via menu: Options -> Manages Packages -> Add Download Site 
+      - via keyb: M-x customize-variable RET package-get-remote RET
+        (put in the details of remote host and directory)
 
- - Invoke Options->Manage Packages->List & Install
-      or M-x pui-list-packages RET
-   XEmacs will now first try to fetch a new version of the package
-   index from the FTP site. Depending on whether you are using
-   'mailcrypt/PGP', you will get some question about keys to fetch or
-   whether to use the index without verifying the signature. If the
-   new index was different from the one already on disk, XEmacs will
-   offer you to overwrite the old index.
+      If the package tarballs _AND_ the package-index file are in a
+      local directory, you can: M-x pui-add-install-directory RET
 
--  XEmacs will show you a buffer named "*Packages*" with an overview
-   of available and installed packages, including a short description.
-   In this buffer you can select which packages you want using the
-   mouse or using RET.
+  (2) Obtain a list of packages and display the list in a buffer named
+      "*Packages*".
+      - menu: Options -> Manage Packages -> List & Install
+      - keyb: M-x pui-list-packages RET
 
--  When you are finished choosing packages, invoke
-   'Packages->Install/Remove Select' from the menu or type 'x' to
-   begin installing packages.
+      XEmacs will now connect to the remote site and download the
+      latest package-index file.  If you see an error about the
+      package-index entries not being PGP signed, you can safely
+      ignore this because PGP has not been integrated into the XEmacs
+      package tools yet.
 
-After Installation
-------------------
+      The resulting buffer, "*Packages*" has brief instructions at the
+      end of the buffer.
+
+  (3) Choose the packages you wish to install.
+      - mouse: Click button 2 on the package name.
+      -  keyb: RET on the package name
+
+  (4) Make sure you have everything you need.
+      - menu: Packages -> Add Required
+      - keyb: r
+
+      XEmacs will now search for packages that are required by the
+      ones that you have chosen to install and offer to select
+      those packages also.
+
+      For novices and gurus alike, this step can save your bacon.
+      It's easy to forget to install a critical package.
+
+  (5) Download and install the packages.
+      - menu: Packages -> Install/Remove Selected
+      - keyb: x
+
+* After Installation
+--------------------
 
 New packages can only be used by XEmacs after a restart.
 
-Note to MULE users
-------------------
-
-Unlike all other packages the mule-base package is used at build/dump
-time. This means that you need this available before compiling XEmacs
-with MULE. Also it is a good idea to keep packages that are
-MULE-only separate by putting them in the mule-packages hierarchy.
-
-Which Packages to install?
---------------------------
+* Which Packages to install?
+----------------------------
 
 This is difficult to say. When in doubt install a package. If you
 administrate a big site it might be a good idea to just install
 edit-utils, fsf-compat, mail-lib, net-utils, os-utils, prog-modes,
 text-modes, time
 
-Unfortunately the package system currently provides neither
-dependencies nor conflicts. This will be a future enhancement. The
-above set includes most packages that are used by others.
+If you are using the XEmacs package tools, don't forget to do:
+
+	Packages -> Add Required
+
+To make sure you have everything that the packages you have chosen to
+install need.
 
 See also '.../etc/PACKAGES' for further descriptions of the individual
-packages (currently outdated).
+packages.
 
-Upgrading/Removing Packages
----------------------------
+* Upgrading/Removing Packages
+-----------------------------
 
 As the exact files and their locations contained in a package may
 change it is recommended to remove a package first before installing a
 Note that the interactive package tools included with XEmacs already do
 this for you.
 
-User Package directories
-------------------------
+* User Package directories
+--------------------------
 
 In addition to the system wide packages, each user can have his own
 packages installed in "~/.xemacs/xemacs-packages". If you want to
 install packages there using the interactive tools, you need to set
 'pui-package-install-dest-dir' to "~/.xemacs/xemacs-packages"
 
-Site lisp/Site start
---------------------
+* Site lisp/Site start
+----------------------
 
 The site-packages hierarchy replaces the old 'site-lisp' directory.
 XEmacs no longer looks into a 'site-lisp' directly by default.
 A good place to put 'site-start.el' would be in
 $prefix/lib/xemacs/site-packages/lisp/
 
-Finding the right packages
---------------------------
+* Finding the right packages
+----------------------------
 
 If you want to find out which package contains the functionality you
 are looking for, use M-x package-get-package-provider, and give it a
-symbol that is likely to be in that package.  For example, if some
-code you want to use has a (require 'thingatpt) in it, try doing
-M-x package-get-package-provider RET thingatpt , which will return
-something like: (fsf-compat "1.06").
+symbol that is likely to be in that package.  
+
+For example, if some code you want to use has a (require 'thingatpt)
+in it:
+
+	M-x package-get-package-provider RET thingatpt RET
+
+which will return something like: (fsf-compat "1.08").
-* Description of available packages by category
-===============================================
+                                                            -*- Outline -*-
+This file is in Outline mode.  It is best viewed under XEmacs.
 
-This data is up-to-date as of 10 February 1999.
+Press C-c C-o (Ctrl+c Ctrl+o) now to see a list of headings.
+  To expand a heading:  Put the cursor on the heading and press C-c C-s
+To collapse a heading:  Press C-c C-d
+
+For general XEmacs navigation tips: Press C-h t
+
+Description of available packages by category
+=============================================
+This data is up-to-date as of January 17, 2001.
 
 ** Library Packages (libs)
 ==========================
-
 These packages are required to build and support most of the rest of
 XEmacs.  By design, xemacs-base is a `regular' package.  Use restraint 
 when adding new files there as it is required by almost everything.
 
 *** Sun
-
 Support for Sparcworks.
 
 *** apel
-
 A Portable Emacs Library.  Used by XEmacs MIME support.
 
-*** edebug
-
-A Lisp debugger.
-
 *** dired
-
 The DIRectory EDitor is for manipulating, and running commands on
 files in a directory.
 
+*** edebug
+A Lisp debugger.
+
 *** efs
-
 Treat files on remote systems the same as local files.
 
+*** elib
+Portable Emacs Lisp utilities library.
+
+*** fsf-compat
+FSF Emacs compatibility files.
+
 *** mail-lib
-
 Fundamental lisp files for providing email support.
 
+*** sounds-au
+XEmacs Sun sound files.
+
+*** sounds-wav
+XEmacs Microsoft sound files.
+
 *** tooltalk
-
 Support for building with Tooltalk.
 
 *** xemacs-base
-
 Fundamental XEmacs support.  Install this unless you wish a totally
 naked XEmacs.
 
 *** xemacs-devel
-
 XEmacs Lisp developer support.  This package contains utilities for
 supporting Lisp development.  It is a single-file package so it may be 
 tailored.
 
 ** Communications Packages (comm)
 =================================
-
 These packages provide support for various communications, primarily
 email and usenet.
 
+*** bbdb
+The Big Brother Data Base
+
+*** eicq
+ICQ Client developed and tested on Linux x86; 
+only supported on that platform
+
+*** eudc
+Emacs Unified Directory Client (LDAP, PH).
+
 *** footnote
-
 Footnoting in mail message editing modes.
 
 *** gnats
-
 XEmacs bug reports.
 
 *** gnus
-
 The Gnus Newsreader and Mailreader.
 
 *** mailcrypt
-
 Support for messaging encryption with PGP.
 
+*** mew
+Messaging in an Emacs World.
+
 *** mh-e
-
 Front end support for MH.
 
 *** net-utils
-
 Miscellaneous Networking Utilities.  This is a single-file package and 
 files may be deleted at will.
 
-*** ph
-
-Emacs implementation of the ph client to CCSO/qi directory servers.
-
 *** rmail
-
 An obsolete Emacs mailer.  If you do not already use it don't start.
 
 *** supercite
-
 An Emacs citation tool.  Useful with all Emacs Mailers and Newsreaders.
 
 *** tm
-
-Emacs MIME support.
+Emacs MIME support. Not needed for Gnus >= 5.8.0
 
 *** vm
-
 An Emacs mailer.
 
 *** w3
+A Web browser.
 
-A Web browser.
+*** zenirc
+ZENIRC IRC Client.
 
 ** Games and Amusements (games)
 ===============================
+All work and no play...
 
 *** cookie
-
 Spook and Yow (Zippy quotes).
 
 *** games
-
 Tetris, Sokoban, and Snake.
 
 *** mine
-
 Minehunt.
 
 *** misc-games
-
 Other amusements and diversions.
 
 ** Mule Support (mule)
 ======================
+MULti-lingual Enhancement.  Support for world scripts such as
+Latin, Arabic, Cyrillic, Chinese, Japanese, Greek, Hebrew etc.
+To use these packages your XEmacs must be compiled with Mule
+support.
+
+*** edict
+Lisp Interface to EDICT, Kanji Dictionary.
 
 *** egg-its
-
 Wnn (4.2 and 6) support.  SJ3 support.  Must be installed prior to
 XEmacs build.
 
 *** leim
-
 Quail.  Used for everything other than English and Japanese.
 
 *** locale
-
 Used for localized menubars (French and Japanese) and localized splash
 screens (Japanese).
 
+*** lookup
+Dictionary support
+
 *** mule-base
-
 Basic Mule support.  Must be installed prior to building with Mule.
 
 *** skk
-
 Another Japanese Language Input Method.  Can be used without a
 separate process running as a dictionary server.
 
 ** Productivity Packages (oa)
 =============================
+Things to make life a little easier.
+
+*** calc
+Emacs calculator.
 
 *** calendar
-
 Calendar and diary support.
 
 *** edit-utils
-
 Single file lisp packages for various XEmacs goodies.  Load this and
 weed out the junk you don't want.
 
 *** forms
-
-Forms editing support (obsolete, use the builtin Widget instead).
+Forms editing support (obsolete, use the built-in Widget instead).
 
 *** frame-icon
-
 Provide a WM icon based on major mode.
 
 *** hm--html-menus
-
 HTML editing.
 
 *** ispell
-
 Spell-checking with ispell.
 
 *** pc
-
 PC style interface emulation.
 
 *** psgml
-
 Validated HTML/SGML editing.
 
 *** sgml
-
 SGML/Linuxdoc-SGML editing.
 
 *** slider
-
 User interface tool.
 
 *** speedbar
-
-??? Document me.
+Provides a separate frame with convenient references.
 
 *** strokes
-
 Mouse enhancement utility.
 
 *** text-modes
-
 Various single file lisp packages for editing text files.
 
 *** time
-
 Display time & date on the modeline.
 
 ** Operating System Utilities (os)
 ==================================
+Tools for working with the operating system.
+
+*** eshell
+Command shell implemented entirely in Emacs Lisp.
 
 *** eterm
-
 Terminal emulator.
 
 *** igrep
-
 Enhanced front-end for Grep.
 
 *** ilisp
-
 Front-end for Inferior Lisp.
 
 *** os-utils
-
 Miscellaneous single-file O/S utilities, for printing, archiving,
 compression, remote shells, etc.
 
+*** pcomplete
+Provides programmatic completion.
+
+*** ps-print-nomule
+Old, but no-Mule safe ps-print.
+
 *** view-process
-
 A Unix process browsing tool.
 
 ** Program Editing Support (prog)
 =================================
+XEmacs supports a multitude of programming languages.  These
+packages will help your coding.
 
 *** ada
-
 Ada language support.
 
 *** c-support
-
 Basic single-file add-ons for editing C code.
 
 *** cc-mode
-
 C, C++ and Java language support.
 
 *** debug
-
 GUD, gdb, dbx debugging support.
 
 *** ediff
-
 Interface over patch.
 
 *** emerge
-
 Another interface over patch.
 
+*** idlwave
+Editing and Shell mode for the Interactive Data Language.
+
+*** jde
+Java language and development support.
+
 *** pcl-cvs
-
 CVS frontend.
 
 *** prog-modes
-
 Miscellaneous single-file lisp files for various programming languages.
 
 *** scheme
-
 Front-end support for Inferior Scheme.
 
+*** semantic
+Semantic bovinator.
+
 *** sh-script
-
 Support for editing shell scripts.
 
 *** vc
-
 Version Control for Free systems.
 
 *** vc-cc
-
-Version Control for ClearCase.  This package must be installed prior
-to building XEmacs [broken as of XEmacs 20.5-beta19].
+Version Control for ClearCase.  This package will shortly be
+replaced with clearcase.el
 
 *** vhdl
-
 Support for VHDL.
 
 ** Word Processing (wp)
 =======================
+Working with text.
 
 *** auctex
-
 Basic TeX/LaTeX support.
 
 *** crisp
-
 Crisp/Brief emulation.
 
 *** edt
-
 DEC EDIT/EDT emulation.
 
+*** reftex
+Emacs support for LaTeX cross-references, citations.
+
 *** texinfo
-
 XEmacs TeXinfo support.
 
 *** textools
-
 Single-file TeX support.
 
 *** tpu
-
 DEC EDIT/TPU support.
 
 *** viper
-
 VI emulation support.

lib-src/ChangeLog

+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
+2001-01-23  Jan Vroonhof  <jan@xemacs.org>
+
+	* gnuserv.c: Add version number to object file.
+
+2001-01-20  Klaus Frank <klausf@i3.informatik.rwth-aachen.de>
+
+	* gnuserv.c (permitted): Completed the checks of the authentication
+	data length, replaced memcmp() by constant-time comparision.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.

lib-src/gnuclient.c

  * ../etc/gnuserv.README relative to the directory containing this file)
  */
 
-#if 0
-/* Hand-munged RCS header */
-static char rcsid [] = "!Header: gnuclient.c,v 2.2 95/12/12 01:39:21 wing nene !";
-#endif
+#include "gnuserv.h"
 
-#include "gnuserv.h"
+char gnuserv_version[] = "gnuclient version " GNUSERV_VERSION;
+
 #include "getopt.h"
 
 #include <stdio.h>

lib-src/gnuserv.c

  * ../etc/gnuserv.README relative to the directory containing this file)
  */
 
-#if 0
-static char rcsid [] = "!Header: gnuserv.c,v 2.1 95/02/16 11:58:27 arup alpha !";
-#endif
+#include "gnuserv.h"
 
-#include "gnuserv.h"
+char gnuserv_version[] = "gnuserv version" GNUSERV_VERSION;
+
 
 #ifdef USE_LITOUT
 #ifdef linux
   char auth_protocol[128];
   char buf[1024];
   int  auth_data_len;
+  int  auth_data_pos;
+  int  auth_mismatches;
 
   if (fd > 0)
     {
 
 	  auth_data_len = atoi(buf);
 
+	  if (auth_data_len <= 0 || auth_data_len > sizeof(buf))
+	      {
+		return FALSE;
+	      }
+
 	  if (timed_read(fd, buf, auth_data_len, AUTH_TIMEOUT, 0) != auth_data_len)
 	    return FALSE;
 
 #ifdef AUTH_MAGIC_COOKIE
-	  if (server_xauth && server_xauth->data &&
-	      !memcmp(buf, server_xauth->data, auth_data_len))
-	    {
+	  if (server_xauth && server_xauth->data)
+	  {
+	    /* Do a compare without comprising info about
+	       the size of the cookie */
+	    auth_mismatches =
+	      ( auth_data_len ^
+		server_xauth->data_length );
+
+	    for(auth_data_pos=0; auth_data_pos < auth_data_len; ++auth_data_pos)
+	      auth_mismatches |=
+		( buf[auth_data_pos] ^
+		  server_xauth->data[auth_data_pos % server_xauth->data_length]);
+
+	    if (auth_mismatches == 0)
 	      return TRUE;
-	    }
+	    
+	    for(;rand() % 1000;);
+	  }
+
 #else
 	  printf ("client tried Xauth, but server is not compiled with Xauth\n");
 #endif

lib-src/gnuserv.h

  * ../etc/gnuserv.README relative to the directory containing this file)
  */
 
-#if 0
-static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup alpha !";
-#endif
+#define GNUSERV_VERSION "3.12"
 
 #define USE_TMPDIR
 
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
+2001-01-20  Klaus Frank <klausf@i3.informatik.rwth-aachen.de>
+
+	* gnuserv.el (gnuserv-process-filter): Robuster handling of error
+	messages from gnuserv.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
 		obarray (lambda (symbol)
 			  (and (boundp symbol)
 			       (or (get symbol 'custom-type)
-				   (user-variable-p symbol)))) t))
+				   (user-variable-p symbol)))) 
+                t nil nil (and v (symbol-name v))))
      (list (if (equal val "")
 	       (if (symbolp v) v nil)
 	     (intern val)))))
 ;;; gnuserv.el --- Lisp interface code between Emacs and gnuserv
 ;; Copyright (C) 1989-1997 Free Software Foundation, Inc.
 
-;; Version: 3.11
+;; Version: 3.12
 ;; Author: Andy Norman (ange@hplb.hpl.hp.com), originally based on server.el
 ;;         Hrvoje Niksic <hniksic@xemacs.org>
 ;; Maintainer: Jan Vroonhof <vroonhof@math.ethz.ch>,
   "Process gnuserv client requests to execute Emacs commands."
   (setq gnuserv-string (concat gnuserv-string string))
   ;; C-d means end of request.
-  (when (string-match "\C-d\\'" gnuserv-string)
-    (cond ((string-match "^[0-9]+" gnuserv-string) ; client request id
+  (when (string-match "\C-d\n?\\'" gnuserv-string)
+    (cond ((string-match "\\`[0-9]+" gnuserv-string) ; client request id
 	   (let ((header (read-from-string gnuserv-string)))
 	     ;; Set the client we are talking to.
 	     (setq gnuserv-current-client (car header))
 		     (signal 'quit nil)))
 	     (setq gnuserv-string "")))
 	  (t
-	   (error "%s: invalid response from gnuserv" gnuserv-string)
-	   (setq gnuserv-string "")))))
+	   (let ((response (car (split-string gnuserv-string "\C-d"))))
+	     (setq gnuserv-string "")
+	     (error "%s: invalid response from gnuserv" response))))))
 
 ;; This function is somewhat of a misnomer.  Actually, we write to the
 ;; server (using `process-send-string' to gnuserv-process), which
 
 ;; This is a grody hack of the same genotype as `advertised-undo'; if the
 ;; bindings of Backspace and C-h are the same, we want the menubar to claim
-;; that `info' in invoked with `C-h i', not `BS i'.
+;; that `info' is invoked with `C-h i', not `BS i'.
 
 (defun deprecated-help-command ()
   (interactive)
 	 val)
      (setq val (read-command
 		(if fn (format "Where is command (default %s): " fn)
-		  "Where is command: ")))
+		  "Where is command: ")
+                (and fn (symbol-name fn))))
      (list (if (equal (symbol-name val) "")
 	       fn val)
 	   current-prefix-arg)))
 				    (if fn
 					(format " (default %s)" fn)
 				      ""))
-			    obarray 'fboundp t))
+			    obarray 'fboundp t
+                            nil nil (and fn (symbol-name fn))))
 		 (list (if (equal val "")
 			   fn (intern val)))))
   (save-window-excursion
 		     ;; rewritten for I18N3 snarfing
 		     (read-from-minibuffer
 		      (format "List lines matching regexp (default `%s'): "
-			      default) nil nil nil 'regexp-history)
+			      default) nil nil nil 'regexp-history nil
+                              default)
 		   (read-from-minibuffer
 		    "List lines matching regexp: "
 		    nil nil nil
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
+2001-01-27  Martin Buchholz  <martin@xemacs.org>
+
+	* lispref/variables.texi (max-specpdl-size): Correct default value.
+	* lispref/eval.texi (max-lisp-eval-depth): Correct default value.
+
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.

man/lispref/extents.texi

 When a string is created using @code{buffer-substring} or
 @code{buffer-string}, any duplicable extents in the region corresponding
 to the string will be copied into the string (@pxref{Buffer
-Contents}).  When the string in inserted into a buffer using
+Contents}).  When the string is inserted into a buffer using
 @code{insert}, @code{insert-before-markers}, @code{insert-buffer} or
 @code{insert-buffer-substring}, the extents in the string will be copied
 back into the buffer (@pxref{Insertion}).  The extents in a string can,

netinstall/ChangeLog

+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
+2001-01-21  Andy Piper  <andy@xemacs.org>
+
+	* Makefile.in.in (%.o): use CXX to compile
+
+	* res.rc: beautify download status and install status.
+
+	* nio-ftp.cc: use xemacs-setup user for identity.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
 
 	* all: port from cygwin setup.
 
-%%% $Id: ChangeLog,v 1.1.2.12 2001/01/20 07:42:55 martinb Exp $
-$Revision: 1.1.2.12 $
+%%% $Id: ChangeLog,v 1.1.2.15 2001/01/28 06:10:32 martinb Exp $
+$Revision: 1.1.2.15 $

netinstall/Makefile.in.in

 	$(CC) $(MINGW_CFLAGS) -c -o $@ ${srcdir}/$<
 
 %.o: %.cc
-	$(CC) $(MINGW_CXXFLAGS) -c -o $@ ${srcdir}/$<
+	$(CXX) $(MINGW_CXXFLAGS) -c -o $@ ${srcdir}/$<
 
 iniparse.c iniparse.h : iniparse.y
 	bison -d -o iniparse.c $(srcdir)/iniparse.y

netinstall/nio-ftp.cc

       code = ftp_line (c);
       if (code == 331)
 	{
-	  c->printf ("PASS cygwin-setup@\r\n");
+	  c->printf ("PASS xenacs-setup@\r\n");
 	  code = ftp_line (c);
 	}
 

netinstall/res.rc

     CONTROL         "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62
 END
 
-IDD_NET DIALOGEX 0, 0, 311, 201
+IDD_NET DIALOG 0, 0, 311, 201
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "XEmacs Setup"
 FONT 8, "MS Sans Serif"
     CONTROL         "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62
 END
 
-IDD_DLSTATUS DIALOG DISCARDABLE  0, 0, 215, 95
+IDD_DLSTATUS DIALOG DISCARDABLE  0, 0, 311, 201
 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | 
     WS_CAPTION | WS_SYSMENU
 CAPTION "XEmacs Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
-    LTEXT           "Downloading...",IDC_STATIC,55,15,135,8
-    LTEXT           "(URL)",IDC_DLS_URL,55,30,150,8
-    LTEXT           "(RATE)",IDC_DLS_RATE,55,45,155,8
+    PUSHBUTTON      "Cancel",IDCANCEL,256,176,45,15
+    LTEXT           "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP
+    LTEXT           "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP
+    LTEXT           "Downloading Packages",IDC_STATIC,112,10,170,17
+    LTEXT           "(URL)",IDC_DLS_URL,112,26,170,11
+    LTEXT           "(RATE)",IDC_DLS_RATE,112,41,166,11
     CONTROL         "Progress1",IDC_DLS_PROGRESS,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,60,155,10
-    ICON            IDI_XEMACS,IDC_STATIC,5,5,20,20
+                    WS_BORDER,123,143,165,10
+    GROUPBOX        "Progress",IDC_STATIC,112,130,186,31
+    CONTROL         "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62
 END
 
-IDD_INSTATUS DIALOG DISCARDABLE  0, 0, 215, 95
+IDD_INSTATUS DIALOG DISCARDABLE  0, 0, 311, 201
 STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | 
     WS_CAPTION | WS_SYSMENU
 CAPTION "XEmacs Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
-    LTEXT           "Installing...",IDC_INS_ACTION,55,5,135,8
-    LTEXT           "(PKG)",IDC_INS_PKG,55,15,150,8
-    LTEXT           "(FILE)",IDC_INS_FILE,55,25,155,8
+    PUSHBUTTON      "Cancel",IDCANCEL,256,176,45,15
+    LTEXT           "",IDC_STATIC,10,10,87,151,SS_SUNKEN | NOT WS_GROUP
+    LTEXT           "",IDC_STATIC,10,169,291,1,SS_SUNKEN | NOT WS_GROUP
+    LTEXT           "Installing Packages",IDC_STATIC,112,10,170,17
+    LTEXT           "(PKG)",IDC_INS_PKG,112,26,170,11
+    LTEXT           "(FILE)",IDC_INS_FILE,112,41,166,11
     CONTROL         "Progress1",IDC_INS_DISKFULL,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,60,155,10
-    ICON            IDI_XEMACS,IDC_STATIC,5,5,20,20
+                    WS_BORDER,123,143,165,10
     CONTROL         "Progress1",IDC_INS_IPROGRESS,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,50,155,10
+                    WS_BORDER,125,106,163,10
     CONTROL         "Progress1",IDC_INS_PPROGRESS,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,40,155,10
-    RTEXT           "Package",IDC_STATIC,5,40,45,8
-    RTEXT           "Total",IDC_STATIC,10,50,40,8
-    RTEXT           "Disk",IDC_STATIC,5,60,45,8
+                    WS_BORDER,125,67,163,10
+    GROUPBOX        "Disk",IDC_STATIC,112,130,186,31
+    GROUPBOX        "Package",IDC_STATIC,112,54,186,31
+    GROUPBOX        "Total",IDC_STATIC,112,93,186,31
+    CONTROL         "GNU",IDC_STATIC,"Static",SS_BITMAP,19,36,69,62
 END
 
 IDD_PROXY_AUTH DIALOG DISCARDABLE  0, 0, 215, 95
     PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
 END
 
-IDD_SPLASH DIALOGEX 0, 0, 311, 201
+IDD_SPLASH DIALOG 0, 0, 311, 201
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "XEmacs Setup"
 FONT 8, "MS Sans Serif"
         HORZGUIDE, 153
     END
 
+    IDD_INSTATUS, DIALOG
+    BEGIN
+        VERTGUIDE, 112
+        VERTGUIDE, 125
+        VERTGUIDE, 288
+    END
+
     IDD_PROXY_AUTH, DIALOG
     BEGIN
         BOTTOMMARGIN, 49
 IDB_CHECK_YES           BITMAP  DISCARDABLE     "check-yes.bmp"
 IDB_CHECK_NO            BITMAP  DISCARDABLE     "check-no.bmp"
 IDB_CHECK_NA            BITMAP  DISCARDABLE     "check-na.bmp"
-GNU                 BITMAP  DISCARDABLE     "gnu.bmp"
+GNU                     BITMAP  DISCARDABLE     "gnu.bmp"
 IDB_GNU                 BITMAP  DISCARDABLE     "gnu.bmp"
 
 /////////////////////////////////////////////////////////////////////////////
     IDS_ERR_OPEN_READ       "Can't open %s for reading: %s"
     IDS_ROOT_ABSOLUTE       "The install directory must be absolute, with both a drive letter and leading slash, like C:\\Cygwin"
     IDS_DOWNLOAD_COMPLETE   "Download Complete"
-    IDS_CVSID               "\n%%% $Id: res.rc,v 1.1.2.3 2000/12/27 09:35:11 andyp Exp $\n"
+    IDS_CVSID               "\n%%% $Id: res.rc,v 1.1.2.4 2001/01/24 09:18:30 andyp Exp $\n"
     IDS_NOLOGFILE           "Cannot open log file %s for writing"
     IDS_UNINSTALL_COMPLETE  "Uninstalls complete."
     IDS_WININET             "Unable to find or load the Internet Explorer 5 DLLs"
 /////////////////////////////////////////////////////////////////////////////
 
 
-/////////////////////////////////////////////////////////////////////////////
-// English (U.K.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-#endif    // English (U.K.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
 
 #ifndef APSTUDIO_INVOKED
 /////////////////////////////////////////////////////////////////////////////
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
+2001-01-26  Martin Buchholz  <martin@xemacs.org>
+
+	Port pdump to SGI alignment-sensitive environment.
+	Lisp Object sizeof methods now return aligned sizes.  Rely on that.
+	Eliminate is_lrecord since Lisp_Objects sizeof methods are now all
+	properly aligned.
+	Define and use aligned reading and writing macros.
+	Use buffered stdio instead of posix i/o for faster dumping.
+	Eliminate kludgy 256 byte space for header.
+	Read and write from dump file using structs for alignment safety.
+	* dumper.c (pdump_align_stream): New.
+	* dumper.c (PDUMP_ALIGN_OUTPUT): New.
+	* dumper.c (PDUMP_READ_ALIGNED): New.
+	* dumper.c (PDUMP_WRITE_ALIGNED): New.
+	* dumper.c (pdump_static_Lisp_Object): New struct.
+	* dumper.c (pdump_static_pointer): New struct.
+	* dumper.c (pdump_entry_list_element): Remove is_lrecord member.
+	* dumper.c (pdump_add_entry): Remove is_lrecord parameter.
+	* dumper.c (pdump_dump_data): Rely on sizeof method alignment.
+	* dumper.c (pdump_allocate_offset): Rely on sizeof method alignment.
+
+	* dumper.c (pdump_backtrace):
+	* dumper.c (pdump_get_indirect_count):
+	* dumper.c (pdump_register_object):
+	* dumper.c (pdump_register_struct):
+	* dumper.c (pdump_reloc_one):
+	* dumper.c (pdump_scan_by_alignment):
+	* dumper.c (pdump_dump_from_root_struct_ptrs):
+	* dumper.c (pdump_dump_opaques):
+	* dumper.c (pdump_dump_rtables):
+	* dumper.c (pdump_dump_from_root_objects):
+	* dumper.c (pdump):
+	* dumper.c (pdump_load_finish):
+	Use aligned reading and writing.
+
+	* dumper.c (pdump_free): Make static.
+	* dumper.c (pdump_hFile): Likewise.
+	* dumper.c (pdump_hMap): Likewise.
+
+2001-01-26  Martin Buchholz <martin@xemacs.org>
+
+	* XEmacs 21.2.43 "Terspichore" is released.
+
+2001-01-25  Martin Buchholz  <martin@xemacs.org>
+
+	Type fiddling for window_config.saved_windows_count
+	* window.c (struct window_config): 
+	Make saved_windows_count member unsigned.
+	* window.c (sizeof_window_config_for_n_windows): 
+	Make parameter unsigned.
+	* window.c (mark_window_config):
+	* window.c (window_config_equal):
+	* window.c (free_window_configuration):
+	* window.c (Fset_window_configuration):
+	* window.c (count_windows):
+	* window.c (Fcurrent_window_configuration):
+	* window.c (reinit_vars_of_window):
+	Update all callers and users.
+
+2001-01-25  Martin Buchholz  <martin@xemacs.org>
+
+	Alignment correctness for flexible arrays.
+	* lisp.h (FLEXIBLE_ARRAY_STRUCT_SIZEOF):
+	Make alignment-correct. Add interesting comments.
+	* alloc.c (size_vector):
+	* alloc.c (make_vector_internal):
+	* alloc.c (make_bit_vector_internal):
+	* alloc.c (sweep_bit_vectors_1):
+	* fns.c (size_bit_vector):
+	Update all callers of FLEXIBLE_ARRAY_STRUCT_SIZEOF to add new arg.
+	* window.c (sizeof_window_config_for_n_windows): 
+	Use FLEXIBLE_ARRAY_STRUCT_SIZEOF.
+
+2001-01-24  Martin Buchholz  <martin@xemacs.org>
+
+	* lread.c (read1): Rename `fexp', which is #defined in SGI's math.h
+
+2001-01-23  Andy Piper  <andy@xemacs.org>
+
+	* select.c (Fown_selection_internal): pass owned_p
+
+	* select-msw.c (mswindows_own_selection): New Signature.
+
+	* console.h (struct console_methods): add owned_p to
+	_own_selection.
+
+	* select-x.c (x_own_selection): pass owned_p
+	(hack_motif_clipboard_selection): use owned_p
+	(vars_of_select_x): new variable -
+	x_selection_strict_motif_ownership.
+
+2001-01-23  Martin Buchholz  <martin@xemacs.org>
+
+	* specifier.h (specifier_data_offset): Remove pointless parens.
+	* glyphs.h (IMAGE_SPECIFIER_DATA): Likewise.
+
+2001-01-24  Martin Buchholz  <martin@xemacs.org>
+
+	Make Lisp_Object sizeof methods be alignment-correct.
+	pdump must restore objects to the same alignment as the C compiler
+	assumes.  It really matters on SGIs.
+	* lstream.c (aligned_sizeof_lstream): New.
+	(sizeof_lstream): Use aligned_sizeof_lstream.
+	(Lstream_new): Likewise.
+	* opaque.c (aligned_sizeof_opaque): New.
+	(sizeof_opaque): Use aligned_sizeof_opaque.
+	(make_opaque): Likewise.
+	* specifier.c (aligned_sizeof_specifier): New.
+	(sizeof_specifier): Use aligned_sizeof_specifier.
+	(make_specifier_internal): Likewise.
+
+2001-01-23  Martin Buchholz  <martin@xemacs.org>
+
+	* lstream.h (struct lstream): Use max_align_t for trailing data.
+	* specifier.h (struct Lisp_Specifier): Likewise.
+
+2001-01-22  Martin Buchholz  <martin@xemacs.org>
+
+	* mule-ccl.c (CCL_Extension): Renamed from CCL_Extention.
+	(CCL_SUCCESS): Kludge to prevent Sun cc compiler warnings.
+	(CCL_SUSPEND): Likewise.
+	(CCL_INVALID_CMD): Likewise.
+	(CCL_CALL_FOR_MAP_INSTRUCTION): Likewise.
+	(ccl_driver): Likewise.
+	(CCL_WRITE_CHAR): Macro hygiene.
+	(CCL_WRITE_STRING): Macro hygiene.
+
+2001-01-22  Martin Buchholz  <martin@xemacs.org>
+
+	Port "portable" dumper to SunOS 4 and HP-UX.
+	* s/aix4.h (AIX4): Move MAP_FAILED definition elsewhere.
+	* emacs.c (main): PDUMP implies no RUN_TIME_REMAP.
+	* dumper.c (pdump_file_get): Define MAP_FAILED if not already defined.
+
+2001-01-22  Martin Buchholz  <martin@xemacs.org>
+
+	* lisp.h (ALIGNOF): A better definition for C++.
+
+2001-01-20  Martin Buchholz  <martin@xemacs.org>
+
+	Macro hygiene.
+	Fix printf warnings: int format, long int arg.
+	* regex.c (DECLARE_DESTINATION): Use DECLARE_NOTHING.
+	(PUSH_FAILURE_POINT): Use correct printf formats.
+	(POP_FAILURE_POINT): Use correct printf formats.  
+	Use do {...} while (0)
+
 2001-01-20  Martin Buchholz <martin@xemacs.org>
 
 	* XEmacs 21.2.42 "Poseidon" is released.
 	(fast_string_match): Ditto.
 	(search_command): Ditto.
 	(search_buffer): Separate boyer_moore.  Check whether
-	boyer_moore is poosible.
+	boyer_moore is possible.
 	(simple_search): New function.
 	(boyer_moore): Separated from search_buffer. Translate char.
 
 static size_t
 size_vector (const void *lheader)
 {
-  return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, contents,
+  return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, Lisp_Object, contents,
 				       ((Lisp_Vector *) lheader)->size);
 }
 
 make_vector_internal (size_t sizei)
 {
   /* no vector_next */
-  size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, contents, sizei);
+  size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Vector, Lisp_Object,
+					       contents, sizei);
   Lisp_Vector *p = (Lisp_Vector *) alloc_lcrecord (sizem, &lrecord_vector);
 
   p->size = sizei;
 make_bit_vector_internal (size_t sizei)
 {
   size_t num_longs = BIT_VECTOR_LONG_STORAGE (sizei);
-  size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits, num_longs);
+  size_t sizem = FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, unsigned long,
+					       bits, num_longs);
   Lisp_Bit_Vector *p = (Lisp_Bit_Vector *) allocate_lisp_storage (sizem);
   set_lheader_implementation (&p->lheader, &lrecord_bit_vector);
 
 	  total_size += len;
           total_storage +=
 	    MALLOC_OVERHEAD +
-	    FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits,
-					  BIT_VECTOR_LONG_STORAGE (len));
+	    FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, unsigned long,
+					  bits, BIT_VECTOR_LONG_STORAGE (len));
 	  num_used++;
 	  /* #### May modify next on a C_READONLY bitvector */
 	  prev = &(bit_vector_next (v));
   Lisp_Object (*own_selection_method)(Lisp_Object selection_name,
                                       Lisp_Object selection_value,
                                       Lisp_Object how_to_add,
-                                      Lisp_Object selection_type);
+                                      Lisp_Object selection_type,
+			  int owned_p);
   void (*disown_selection_method)(Lisp_Object selection_name,
                                   Lisp_Object timeval);
   Lisp_Object (*get_foreign_selection_method) (Lisp_Object selection_symbol,
 Return a new weak list object of type TYPE.
 A weak list object is an object that contains a list.  This list behaves
 like any other list except that its elements do not count towards
-garbage collection -- if the only pointer to an object in inside a weak
+garbage collection -- if the only pointer to an object is inside a weak
 list (other than pointers in similar objects such as weak hash tables),
 the object is garbage collected and automatically removed from the list.
 This is used internally, for example, to manage the list holding the
   lseek (fd, 0, SEEK_SET);
 
 #ifdef HAVE_MMAP
+/* Unix 98 requires that sys/mman.h define MAP_FAILED,
+   but many earlier implementations don't. */
+# ifndef MAP_FAILED
+#  define MAP_FAILED ((void *) -1L)
+# endif
   pdump_start = (char *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
   if (pdump_start != (char *) MAP_FAILED)
     {
       close (fd);
       return 1;
     }
-#endif
+#endif /* HAVE_MMAP */
 
   pdump_mallocadr = xmalloc (pdump_length+255);
   pdump_free = pdump_file_free;
 #endif /* _SCO_DS */
       vol_envp = environ;
     }
-#ifdef RUN_TIME_REMAP
+#if defined (RUN_TIME_REMAP) && ! defined (PDUMP)
   else
     /* obviously no-one uses this because where it was before initialized was
      *always* true */
 size_bit_vector (const void *lheader)
 {
   Lisp_Bit_Vector *v = (Lisp_Bit_Vector *) lheader;
-  return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, bits,
+  return FLEXIBLE_ARRAY_STRUCT_SIZEOF (Lisp_Bit_Vector, unsigned long, bits,
 				       BIT_VECTOR_LONG_STORAGE (bit_vector_length (v)));
 }
 
   Lisp_Object attachee_property;/* property of that face or glyph */
 };
 
-#define IMAGE_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, image))
+#define IMAGE_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, image)
 #define IMAGE_SPECIFIER_ALLOWED(g) (IMAGE_SPECIFIER_DATA (g)->allowed)
 #define IMAGE_SPECIFIER_ATTACHEE(g) (IMAGE_SPECIFIER_DATA (g)->attachee)
 #define IMAGE_SPECIFIER_ATTACHEE_PROPERTY(g) \
      "Types must be declared in declarations, not in expressions." */
 #  define ALIGNOF(type) offsetof (struct { char c; type member; }, member)
 # else
-/* The following should be completely portable, but might give values
-   that are larger than necessary.  But never larger than the maximum
-   possible alignment. */
-#  define ALIGNOF(type)				\
-((sizeof (type) % sizeof (max_align_t)) == 0 ?	\
- sizeof (max_align_t) :				\
- (sizeof (type) % sizeof (max_align_t)))
+/* C++ is annoying, but it has a big bag of tricks.
+   The following doesn't have the "inside out" declaration bug C does. */
+template<class T> struct alignment_trick { char c; T member; };
+#  define ALIGNOF(type) offsetof (alignment_trick<type>, member)
 # endif
 #endif /* ALIGNOF */
 
 
 #endif /* not MULE */
 
-/* Return the true size of a struct with a variable-length array field.  */
-#define FLEXIBLE_ARRAY_STRUCT_SIZEOF(flexible_array_structtype,		\
-				     flexible_array_field,		\
-				     flexible_array_length)		\
-  (offsetof (flexible_array_structtype, flexible_array_field) +		\
-   (offsetof (flexible_array_structtype, flexible_array_field[1]) -	\
-    offsetof (flexible_array_structtype, flexible_array_field[0])) *	\
-   (flexible_array_length))
+/* Return the true aligned size of a struct whose last member is a
+   variable-length array field.  (this is known as the "struct hack") */
+/* Implementation: in practice, structtype and fieldtype usually have
+   the same alignment, but we can't be sure.  We need to use
+   ALIGN_SIZE to be absolutely sure of getting the correct alignment.
+   To help the compiler's optimizer, we use a ternary expression that
+   only a very stupid compiler would fail to correctly simplify. */
+#define FLEXIBLE_ARRAY_STRUCT_SIZEOF(structtype,	\
+				     fieldtype,		\
+				     fieldname,		\
+				     array_length)	\
+(ALIGNOF (structtype) == ALIGNOF (fieldtype)		\
+ ? (offsetof (structtype, fieldname) +			\
+    (offsetof (structtype, fieldname[1]) -		\
+     offsetof (structtype, fieldname[0])) *		\
+    (array_length))					\
+ : (ALIGN_SIZE						\
+    ((offsetof (structtype, fieldname) +		\
+      (offsetof (structtype, fieldname[1]) -		\
+       offsetof (structtype, fieldname[0])) *		\
+      (array_length)),					\
+     ALIGNOF (structtype))))
 
 /*------------------------------ vector --------------------------------*/
 
 	  case '+':
 	  case '-':
 	    {
-	      Lisp_Object fexp, obj, tem;
+	      Lisp_Object feature_exp, obj, tem;
 	      struct gcpro gcpro1, gcpro2;
 
-	      fexp = read0(readcharfun);
+	      feature_exp = read0(readcharfun);
 	      obj = read0(readcharfun);
 
 	      /* the call to `featurep' may GC. */
-	      GCPRO2 (fexp, obj);
-	      tem = call1 (Qfeaturep, fexp);
+	      GCPRO2 (feature_exp, obj);
+	      tem = call1 (Qfeaturep, feature_exp);
 	      UNGCPRO;
 
 	      if (c == '+' &&  NILP(tem)) goto retry;
     }
 }
 
+inline static size_t
+aligned_sizeof_lstream (size_t lstream_type_specific_size)
+{
+  return ALIGN_SIZE (offsetof (Lstream, data) + lstream_type_specific_size,
+		     ALIGNOF (max_align_t));
+}
+
 static size_t
 sizeof_lstream (const void *header)
 {
-  const Lstream *lstr = (const Lstream *) header;
-  return sizeof (*lstr) + lstr->imp->size - 1;
+  return aligned_sizeof_lstream (((const Lstream *) header)->imp->size);
 }
 
 DEFINE_LRECORD_SEQUENCE_IMPLEMENTATION ("stream", lstream,
       assert (lstream_type_count < countof (lstream_types));
       lstream_types[lstream_type_count] = imp;
       Vlstream_free_list[lstream_type_count] =
-	make_lcrecord_list (sizeof (*p) + imp->size - 1,
+	make_lcrecord_list (aligned_sizeof_lstream (imp->size),
 			    &lrecord_lstream);
       lstream_type_count++;
     }
 
   p = XLSTREAM (allocate_managed_lcrecord (Vlstream_free_list[i]));
   /* Zero it out, except the header. */
-  memset ((char *) p + sizeof (p->header), 0,
-	  sizeof (*p) - sizeof (p->header) + imp->size - 1);
+  memset ((char *) p + sizeof (p->header), '\0',
+	  aligned_sizeof_lstream (imp->size) - sizeof (p->header));
   p->imp = imp;
   Lstream_set_buffering (p, LSTREAM_BLOCK_BUFFERED, 0);
   p->flags = LSTREAM_FL_IS_OPEN;
   size_t unget_buffer_ind; /* pointer to next buffer spot to write a character */
 
   size_t byte_count;
-  long flags;  /* Align pointer for 64 bit machines (kny) */
-  char data[1];
+  int flags;
+  max_align_t data[1];
 };
 
 #define LSTREAM_TYPE_P(lstr, type) \
 					  IC += 2;
 					*/
 
-#define CCL_Extention		0x1F /* Extended CCL code
+#define CCL_Extension		0x1F /* Extended CCL code
 					1:ExtendedCOMMNDRrrRRRrrrXXXXX
 					2:ARGUMENT
 					3:...
     stack_idx++;						\
     ccl_prog = called_ccl.prog;					\
     ic = CCL_HEADER_MAIN;					\
-    goto ccl_repeat;						\
+    /* The "if (1)" prevents warning				\
+       "end-of loop code not reached" */			\
+    if (1) goto ccl_repeat;					\
   } while (0)
 
 #define CCL_MapSingle		0x12 /* Map by single code conversion map
 				   r[7] = LOWER_BYTE (SJIS (Y, Z) */
 
 /* Terminate CCL program successfully.  */
-#define CCL_SUCCESS		   	\
-  do {				   	\
-    ccl->status = CCL_STAT_SUCCESS;	\
-    goto ccl_finish;		   	\
-  } while (0)
+#define CCL_SUCCESS			\
+do {					\
+  ccl->status = CCL_STAT_SUCCESS;	\
+  /* The "if (1)" inhibits the warning	\
+     "end-of loop code not reached" */	\
+  if (1) goto ccl_finish;		\
+} while (0)
 
 /* Suspend CCL program because of reading from empty input buffer or
    writing to full output buffer.  When this program is resumed, the
    same I/O command is executed.  */
-#define CCL_SUSPEND(stat)	\
-  do {				\
-    ic--;			\
-    ccl->status = stat;		\
-    goto ccl_finish;		\
-  } while (0)
+#define CCL_SUSPEND(stat)		\
+do {					\
+  ic--;					\
+  ccl->status = (stat);			\
+  /* The "if (1)" inhibits the warning	\
+     "end-of loop code not reached" */	\
+  if (1) goto ccl_finish;		\
+} while (0)
 
 /* Terminate CCL program because of invalid command.  Should not occur
    in the normal case.  */
-#define CCL_INVALID_CMD		     	\
-  do {				     	\
-    ccl->status = CCL_STAT_INVALID_CMD;	\
-    goto ccl_error_handler;	     	\
-  } while (0)
+#define CCL_INVALID_CMD			\
+do {					\
+  ccl->status = CCL_STAT_INVALID_CMD;	\
+  /* The "if (1)" inhibits the warning	\
+     "end-of loop code not reached" */	\
+  if (1) goto ccl_error_handler;	\
+} while (0)
 
 /* Encode one character CH to multibyte form and write to the current
    output buffer.  At encoding time, if CH is less than 256, CH is
       CCL_INVALID_CMD;						\
     if (conversion_mode == CCL_MODE_ENCODING)			\
       {								\
-	if (ch == '\n')						\
+	if ((ch) == '\n')					\
 	  {							\
 	    if (ccl->eol_type == CCL_CODING_EOL_CRLF)		\
 	      {							\
 	    else						\
 	      Dynarr_add (destination, '\n');			\
 	  }							\
-	else if (ch < 0x100)					\
+	else if ((ch) < 0x100)					\
 	  {							\
 	    Dynarr_add (destination, ch);			\
 	  }							\
       CCL_INVALID_CMD;						\
     else if (conversion_mode == CCL_MODE_ENCODING)		\
       {								\
-	for (i = 0; i < len; i++)				\
+	for (i = 0; i < (len); i++)				\
 	  {							\
 	    ch = ((XINT (ccl_prog[ic + (i / 3)]))		\
 		  >> ((2 - (i % 3)) * 8)) & 0xFF;		\
       }								\
     else							\
       {								\
-	for (i = 0; i < len; i++)				\
+	for (i = 0; i < (len); i++)				\
 	  {							\
 	    ch = ((XINT (ccl_prog[ic + (i / 3)]))		\
 		  >> ((2 - (i % 3)) * 8)) & 0xFF;		\
     if (!src)						\
       CCL_INVALID_CMD;					\
     if (src < src_end)					\
-      r = *src++;					\
+      (r) = *src++;					\
     else						\
       {							\
 	if (ccl->last_block)				\
 #if 0
 #define CCL_MAKE_CHAR(charset, code, c)				\
   do {								\
-    if (charset == CHARSET_ASCII)				\
-      c = code & 0xFF;						\
+    if ((charset) == CHARSET_ASCII)				\
+      (c) = (code) & 0xFF;						\
     else if (CHARSET_DEFINED_P (charset)			\
-	     && (code & 0x7F) >= 32				\
-	     && (code < 256 || ((code >> 7) & 0x7F) >= 32))	\
+	     && ((code) & 0x7F) >= 32				\
+	     && ((code) < 256 || ((code >> 7) & 0x7F) >= 32))	\
       {								\
-	int c1 = code & 0x7F, c2 = 0;				\
+	int c1 = (code) & 0x7F, c2 = 0;				\
 								\
-	if (code >= 256)					\
-	  c2 = c1, c1 = (code >> 7) & 0x7F;			\
-	c = MAKE_CHAR (charset, c1, c2);			\
+	if ((code) >= 256)					\
+	  c2 = c1, c1 = ((code) >> 7) & 0x7F;			\
+	(c) = MAKE_CHAR (charset, c1, c2);			\
       }								\
     else							\
-      c = code & 0xFF;						\
+      (c) = (code) & 0xFF;						\
   } while (0)
 #endif
 
 	    ic = jump_address;
 	  break;
 
-	case CCL_Extention:
+	case CCL_Extension:
 	  switch (EXCMD)
 	    {
 	    case CCL_ReadMultibyteChar2:
 	      if (!src)
 		CCL_INVALID_CMD;
 
-	      do {
-		if (src >= src_end)
-		  {
-		    src++;
+	      if (src >= src_end)
+		{
+		  src++;
+		  goto ccl_read_multibyte_character_suspend;
+		}
+
+	      i = *src++;
+	      if (i < 0x80)
+		{
+		  /* ASCII */
+		  reg[rrr] = i;
+		  reg[RRR] = LEADING_BYTE_ASCII;
+		}
+	      else if (i <= MAX_LEADING_BYTE_OFFICIAL_1)
+		{
+		  if (src >= src_end)
 		    goto ccl_read_multibyte_character_suspend;
-		  }
-
-		i = *src++;
-		if (i < 0x80)
-		  {
-		    /* ASCII */
-		    reg[rrr] = i;
-		    reg[RRR] = LEADING_BYTE_ASCII;
-		  }
-		else if (i <= MAX_LEADING_BYTE_OFFICIAL_1)
-		  {
-		    if (src >= src_end)
-		      goto ccl_read_multibyte_character_suspend;
-		    reg[RRR] = i;
-		    reg[rrr] = (*src++ & 0x7F);
-		  }
-		else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
-		  {
-		    if ((src + 1) >= src_end)
-		      goto ccl_read_multibyte_character_suspend;
-		    reg[RRR] = i;
-		    i = (*src++ & 0x7F);
-		    reg[rrr] = ((i << 7) | (*src & 0x7F));
-		    src++;
-		  }
-		else if (i == PRE_LEADING_BYTE_PRIVATE_1)
-		  {
-		    if ((src + 1) >= src_end)
-		      goto ccl_read_multibyte_character_suspend;
-		    reg[RRR] = *src++;
-		    reg[rrr] = (*src++ & 0x7F);
-		  }
-		else if (i == PRE_LEADING_BYTE_PRIVATE_2)
-		  {
-		    if ((src + 2) >= src_end)
-		      goto ccl_read_multibyte_character_suspend;
-		    reg[RRR] = *src++;
-		    i = (*src++ & 0x7F);
-		    reg[rrr] = ((i << 7) | (*src & 0x7F));
-		    src++;
-		  }
-		else
-		  {
-		    /* INVALID CODE.  Return a single byte character.  */
-		    reg[RRR] = LEADING_BYTE_ASCII;
-		    reg[rrr] = i;
-		  }
-		break;
-	      } while (1);
+		  reg[RRR] = i;
+		  reg[rrr] = (*src++ & 0x7F);
+		}
+	      else if (i <= MAX_LEADING_BYTE_OFFICIAL_2)
+		{
+		  if ((src + 1) >= src_end)
+		    goto ccl_read_multibyte_character_suspend;
+		  reg[RRR] = i;
+		  i = (*src++ & 0x7F);
+		  reg[rrr] = ((i << 7) | (*src & 0x7F));
+		  src++;
+		}
+	      else if (i == PRE_LEADING_BYTE_PRIVATE_1)
+		{
+		  if ((src + 1) >= src_end)
+		    goto ccl_read_multibyte_character_suspend;
+		  reg[RRR] = *src++;
+		  reg[rrr] = (*src++ & 0x7F);
+		}
+	      else if (i == PRE_LEADING_BYTE_PRIVATE_2)
+		{
+		  if ((src + 2) >= src_end)
+		    goto ccl_read_multibyte_character_suspend;
+		  reg[RRR] = *src++;
+		  i = (*src++ & 0x7F);
+		  reg[rrr] = ((i << 7) | (*src & 0x7F));
+		  src++;
+		}
+	      else
+		{
+		  /* INVALID CODE.  Return a single byte character.  */
+		  reg[RRR] = LEADING_BYTE_ASCII;
+		  reg[rrr] = i;
+		}
 	      break;
 
 	    ccl_read_multibyte_character_suspend:
   write_c_string (buf, printcharfun);
 }
 
+inline static size_t
+aligned_sizeof_opaque (size_t opaque_size)
+{
+  return ALIGN_SIZE (offsetof (Lisp_Opaque, data) + opaque_size,
+		     ALIGNOF (max_align_t));
+}
+
 static size_t
 sizeof_opaque (const void *header)
 {
-  const Lisp_Opaque *p = (const Lisp_Opaque *) header;
-  return offsetof (Lisp_Opaque, data) + p->size;
+  return aligned_sizeof_opaque (((const Lisp_Opaque *) header)->size);
 }
 
 /* Return an opaque object of size SIZE.
 make_opaque (const void *data, size_t size)
 {
   Lisp_Opaque *p = (Lisp_Opaque *)
-    alloc_lcrecord (offsetof (Lisp_Opaque, data) + size, &lrecord_opaque);
+    alloc_lcrecord (aligned_sizeof_opaque (size), &lrecord_opaque);
   p->size = size;
 
   if (data == OPAQUE_CLEAR)
    Does `return FAILURE_CODE' if runs out of memory.  */
 
 #if !defined (REGEX_MALLOC) && !defined (REL_ALLOC)
-#define DECLARE_DESTINATION char *destination;
+#define DECLARE_DESTINATION char *destination
 #else
-#define DECLARE_DESTINATION
+#define DECLARE_DESTINATION DECLARE_NOTHING
 #endif
 
 #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)	\
-  do {									\
-    DECLARE_DESTINATION							\
-    /* Must be int, so when we don't save any registers, the arithmetic	\
-       of 0 + -1 isn't done as unsigned.  */				\
-    int this_reg;							\
-    									\
-    DEBUG_STATEMENT (failure_id++);					\
-    DEBUG_STATEMENT (nfailure_points_pushed++);				\
-    DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id);		\
-    DEBUG_PRINT2 ("  Before push, next avail: %d\n", (fail_stack).avail);\
-    DEBUG_PRINT2 ("                     size: %d\n", (fail_stack).size);\
+do {									\
+  DECLARE_DESTINATION;							\
+  /* Must be int, so when we don't save any registers, the arithmetic	\
+     of 0 + -1 isn't done as unsigned.  */				\
+  int this_reg;								\
 									\
-    DEBUG_PRINT2 ("  slots needed: %d\n", NUM_FAILURE_ITEMS);		\
-    DEBUG_PRINT2 ("     available: %d\n", REMAINING_AVAIL_SLOTS);	\
+  DEBUG_STATEMENT (failure_id++);					\
+  DEBUG_STATEMENT (nfailure_points_pushed++);				\
+  DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id);		\
+  DEBUG_PRINT2 ("  Before push, next avail: %lu\n",			\
+		(unsigned long) (fail_stack).avail);			\
+  DEBUG_PRINT2 ("                     size: %lu\n",			\
+		(unsigned long) (fail_stack).size);			\
 									\
-    /* Ensure we have enough space allocated for what we will push.  */	\
-    while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS)			\
-      {									\
-        if (!DOUBLE_FAIL_STACK (fail_stack))				\
-          return failure_code;						\
+  DEBUG_PRINT2 ("  slots needed: %d\n", NUM_FAILURE_ITEMS);		\
+  DEBUG_PRINT2 ("     available: %ld\n",				\
+		(long) REMAINING_AVAIL_SLOTS);				\
 									\
-        DEBUG_PRINT2 ("\n  Doubled stack; size now: %d\n",		\
-		       (fail_stack).size);				\
-        DEBUG_PRINT2 ("  slots available: %d\n", REMAINING_AVAIL_SLOTS);\
-      }									\
+  /* Ensure we have enough space allocated for what we will push.  */	\
+  while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS)			\
+    {									\
+      if (!DOUBLE_FAIL_STACK (fail_stack))				\
+	return failure_code;						\
 									\
-    /* Push the info, starting with the registers.  */			\
-    DEBUG_PRINT1 ("\n");						\
+      DEBUG_PRINT2 ("\n  Doubled stack; size now: %lu\n",		\
+		    (unsigned long) (fail_stack).size);			\
+      DEBUG_PRINT2 ("  slots available: %ld\n",				\
+		    (long) REMAINING_AVAIL_SLOTS);			\
+    }									\
 									\
-    for (this_reg = lowest_active_reg; this_reg <= highest_active_reg;	\
-         this_reg++)							\
-      {									\
-	DEBUG_PRINT2 ("  Pushing reg: %d\n", this_reg);			\
-        DEBUG_STATEMENT (num_regs_pushed++);				\
+  /* Push the info, starting with the registers.  */			\
+  DEBUG_PRINT1 ("\n");							\
 									\
-	DEBUG_PRINT2 ("    start: 0x%lx\n", (long) regstart[this_reg]);	\
-        PUSH_FAILURE_POINTER (regstart[this_reg]);			\
-                                                                        \
-	DEBUG_PRINT2 ("    end: 0x%lx\n", (long) regend[this_reg]);	\
-        PUSH_FAILURE_POINTER (regend[this_reg]);			\
+  for (this_reg = lowest_active_reg; this_reg <= highest_active_reg;	\
+       this_reg++)							\
+    {									\
+      DEBUG_PRINT2 ("  Pushing reg: %d\n", this_reg);			\
+      DEBUG_STATEMENT (num_regs_pushed++);				\
 									\
-	DEBUG_PRINT2 ("    info: 0x%lx\n      ",			\
-		      * (long *) (&reg_info[this_reg]));		\
-        DEBUG_PRINT2 (" match_null=%d",					\
-                      REG_MATCH_NULL_STRING_P (reg_info[this_reg]));	\
-        DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg]));	\
-        DEBUG_PRINT2 (" matched_something=%d",				\
-                      MATCHED_SOMETHING (reg_info[this_reg]));		\