XEmacs 21.2.22 "Mercedes".
[chise/xemacs-chise.git.1] / src / lisp.h
index d8a1f7f..c827371 100644 (file)
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA.  */
 #define _XEMACS_LISP_H_
 
 /************************************************************************/
-/*                        general definitions                           */
+/*                       general definitions                           */
 /************************************************************************/
 
 /* We include the following generally useful header files so that you
@@ -39,10 +39,8 @@ Boston, MA 02111-1307, USA.  */
 #include <stdio.h>             /* NULL, etc. */
 #include <ctype.h>
 #include <stdarg.h>
-
-#ifdef __lucid
-# include <sysent.h>
-#endif
+#include <stddef.h>            /* offsetof */
+#include <sys/types.h>
 
 /* ---- Dynamic arrays ---- */
 
@@ -181,7 +179,7 @@ void xfree (void *);
 #   define DOESNT_RETURN void volatile
 #   define DECLARE_DOESNT_RETURN(decl) \
            extern void volatile decl __attribute__ ((noreturn))
-#   define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \
+#   define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
      /* Should be able to state multiple independent __attribute__s, but  \
         the losing syntax doesn't work that way, and screws losing cpp */ \
            extern void volatile decl \
@@ -189,13 +187,13 @@ void xfree (void *);
 #  else
 #   define DOESNT_RETURN void volatile
 #   define DECLARE_DOESNT_RETURN(decl) extern void volatile decl
-#   define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \
+#   define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
            extern void volatile decl PRINTF_ARGS(str,idx)
 #  endif /* GNUC 2.5 */
 # else
 #  define DOESNT_RETURN void
 #  define DECLARE_DOESNT_RETURN(decl) extern void decl
-#  define DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS(decl,str,idx) \
+#  define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
           extern void decl PRINTF_ARGS(str,idx)
 # endif /* GNUC */
 #endif
@@ -215,15 +213,6 @@ void xfree (void *);
 #define ALIGN_PTR(ptr, unit) \
   ((void *) ALIGN_SIZE ((long) (ptr), unit))
 
-#ifdef QUANTIFY
-#include "quantify.h"
-#define QUANTIFY_START_RECORDING quantify_start_recording_data ()
-#define QUANTIFY_STOP_RECORDING  quantify_stop_recording_data  ()
-#else /* !QUANTIFY */
-#define QUANTIFY_START_RECORDING
-#define QUANTIFY_STOP_RECORDING
-#endif /* !QUANTIFY */
-
 #ifndef DO_NOTHING
 #define DO_NOTHING do {} while (0)
 #endif
@@ -258,9 +247,36 @@ DECLARE_DOESNT_RETURN (assert_failed (CONST char *, int, CONST char *));
 /*#define REGISTER register*/
 /*#endif*/
 
+
+/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
+   In particular, it must be large enough to contain a pointer.
+   config.h can override this, e.g. to use `long long' for bigger lisp ints. */
+
+#ifndef SIZEOF_EMACS_INT
+# define SIZEOF_EMACS_INT SIZEOF_VOID_P
+#endif
+
+#ifndef EMACS_INT
+# if   SIZEOF_EMACS_INT == SIZEOF_LONG
+#  define EMACS_INT long
+# elif SIZEOF_EMACS_INT == SIZEOF_INT
+#  define EMACS_INT int
+# elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG
+#  define EMACS_INT long long
+# else
+#  error Unable to determine suitable type for EMACS_INT
+# endif
+#endif
+
+#ifndef EMACS_UINT
+# define EMACS_UINT unsigned EMACS_INT
+#endif
+
+#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR)
+
 \f
 /************************************************************************/
-/*                                typedefs                              */
+/*                               typedefs                              */
 /************************************************************************/
 
 /* We put typedefs here so that prototype declarations don't choke.
@@ -292,17 +308,17 @@ typedef int Emchar;
    buffer.h (where they rightfully belong) to avoid syntax errors
    in function prototypes. */
 
-typedef int Bufpos;
-typedef int Bytind;
-typedef int Memind;
+typedef EMACS_INT Bufpos;
+typedef EMACS_INT Bytind;
+typedef EMACS_INT Memind;
 
 /* Counts of bytes or chars */
 
-typedef int Bytecount;
-typedef int Charcount;
+typedef EMACS_INT Bytecount;
+typedef EMACS_INT Charcount;
 
 /* Length in bytes of a string in external format */
-typedef int Extcount;
+typedef EMACS_INT Extcount;
 
 typedef struct lstream Lstream;
 
@@ -333,13 +349,23 @@ typedef struct extent *EXTENT;
 struct frame;                  /* "frame.h" */
 struct window;                  /* "window.h" */
 struct Lisp_Event;              /* "events.h" */
+typedef struct Lisp_Event Lisp_Event;
 struct Lisp_Face;
+typedef struct Lisp_Face Lisp_Face;
 struct Lisp_Process;            /* "process.c" */
+typedef struct Lisp_Process Lisp_Process;
 struct stat;                    /* <sys/stat.h> */
 struct Lisp_Color_Instance;
+typedef struct Lisp_Color_Instance Lisp_Color_Instance;
 struct Lisp_Font_Instance;
+typedef struct Lisp_Font_Instance Lisp_Font_Instance;
 struct Lisp_Image_Instance;
+typedef struct Lisp_Image_Instance Lisp_Image_Instance;
+struct Lisp_Gui_Item;
+typedef struct Lisp_Gui_Item Lisp_Gui_Item;
 struct display_line;
+struct display_glyph_area;
+struct display_box;
 struct redisplay_info;
 struct window_mirror;
 struct scrollbar_instance;
@@ -467,6 +493,14 @@ enum toolbar_pos
 };
 #endif
 
+enum edge_style
+{
+  EDGE_ETCHED_IN,
+  EDGE_ETCHED_OUT,
+  EDGE_BEVEL_IN,
+  EDGE_BEVEL_OUT
+};
+
 #ifndef ERROR_CHECK_TYPECHECK
 
 typedef enum error_behavior
@@ -506,62 +540,13 @@ enum munge_me_out_the_door
 
 \f
 /************************************************************************/
-/*                   Definition of Lisp_Object data type                */
+/*                  Definition of Lisp_Object data type                */
 /************************************************************************/
 
-#ifdef USE_MINIMAL_TAGBITS
-# define LRECORD_CONS
-# define LRECORD_VECTOR
-# define LRECORD_SYMBOL
-# define LRECORD_STRING
-#endif
-
 /* Define the fundamental Lisp data structures */
 
 /* This is the set of Lisp data types */
 
-#ifndef USE_MINIMAL_TAGBITS
-
-enum Lisp_Type
-{
-  /* Integer.  XINT(obj) is the integer value. */
-  Lisp_Type_Int,
-
-  /* XRECORD_LHEADER (object) points to a struct lrecord_header
-     lheader->implementation determines the type (and GC behaviour)
-     of the object. */
-  Lisp_Type_Record,
-
-#ifndef LRECORD_CONS
-  /* Cons.  XCONS (object) points to a struct Lisp_Cons. */
-  Lisp_Type_Cons,
-#endif
-
-#ifndef LRECORD_STRING
-  /* String.  XSTRING (object) points to a struct Lisp_String.
-     The length of the string, and its contents, are stored therein. */
-  Lisp_Type_String,
-#endif
-
-#ifndef LRECORD_VECTOR
-  /* Vector of Lisp objects.  XVECTOR(object) points to a struct Lisp_Vector.
-     The length of the vector, and its contents, are stored therein. */
-  Lisp_Type_Vector,
-#endif /* !LRECORD_VECTOR */
-
-#ifndef LRECORD_SYMBOL
-  /* Symbol.  XSYMBOL (object) points to a struct Lisp_Symbol. */
-  Lisp_Type_Symbol,
-#endif /* !LRECORD_SYMBOL */
-
-  Lisp_Type_Char
-};
-
-# define POINTER_TYPE_P(type) \
-  ((type) != Lisp_Type_Int && (type) != Lisp_Type_Char)
-
-#else /* USE_MINIMAL_TAGBITS */
-
 enum Lisp_Type
 {
   Lisp_Type_Record,
@@ -572,44 +557,15 @@ enum Lisp_Type
 
 #define POINTER_TYPE_P(type) ((type) == Lisp_Type_Record)
 
-#endif /* USE_MINIMAL_TAGBITS */
-
-/* This should be the underlying type into which a Lisp_Object must fit.
-   In a strict ANSI world, this must be `int', since ANSI says you can't
-   use bitfields on any type other than `int'.  However, on a machine
-   where `int' and `long' are not the same size, this should be the
-   longer of the two.  (This also must be something into which a pointer
-   to an arbitrary object will fit, modulo any DATA_SEG_BITS cruft.)
- */
-/* ### We should be using uintptr_t and SIZEOF_VOID_P here */
-#if (LONGBITS > INTBITS)
-# define EMACS_INT long
-# define EMACS_UINT unsigned long
-# define SIZEOF_EMACS_INT SIZEOF_LONG
-#else
-# define EMACS_INT int
-# define EMACS_UINT unsigned int
-# define SIZEOF_EMACS_INT SIZEOF_INT
-#endif
-
-#define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR)
-
 /* Overridden by m/next.h */
 #ifndef ASSERT_VALID_POINTER
 # define ASSERT_VALID_POINTER(pnt) (assert ((((EMACS_UINT) pnt) & 3) == 0))
 #endif
 
-#ifdef USE_MINIMAL_TAGBITS
-# define GCMARKBITS  0
-# define GCTYPEBITS  2
-# define GCBITS      2
-# define INT_GCBITS  1
-#else
-# define GCMARKBITS  1
-# define GCTYPEBITS  3
-# define GCBITS      4
-# define INT_GCBITS  GCBITS
-#endif
+#define GCMARKBITS  0
+#define GCTYPEBITS  2
+#define GCBITS      2
+#define INT_GCBITS  1
 
 #define INT_VALBITS (BITS_PER_EMACS_INT - INT_GCBITS)
 #define VALBITS (BITS_PER_EMACS_INT - GCBITS)
@@ -621,25 +577,7 @@ enum Lisp_Type
 # include "lisp-disunion.h"
 #endif /* !USE_UNION_TYPE */
 
-#ifdef HAVE_SHM
-/* In this representation, data is found in two widely separated segments.  */
-extern int pure_size;
-# define XPNTR(x) \
-  ((void *)(XPNTRVAL(x)) | (XPNTRVAL(x) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS)))
-#else /* not HAVE_SHM */
-# ifdef DATA_SEG_BITS
-/* This case is used for the rt-pc and hp-pa.
-   In the diffs I was given, it checked for ptr = 0
-   and did not adjust it in that case.
-   But I don't think that zero should ever be found
-   in a Lisp object whose data type says it points to something.
- */
-#  define XPNTR(x) ((void *)((XPNTRVAL(x)) | DATA_SEG_BITS))
-# else /* not DATA_SEG_BITS */
-#  define XPNTR(x) ((void *) (XPNTRVAL(x)))
-# endif /* not DATA_SEG_BITS */
-#endif /* not HAVE_SHM */
-
+#define XPNTR(x) ((void *) XPNTRVAL(x))
 
 /* WARNING WARNING WARNING.  You must ensure on your own that proper
    GC protection is provided for the elements in this array. */
@@ -651,8 +589,8 @@ typedef struct
 /* Close your eyes now lest you vomit or spontaneously combust ... */
 
 #define HACKEQ_UNSAFE(obj1, obj2)                              \
-  (EQ (obj1, obj2) || (!POINTER_TYPE_P (XGCTYPE (obj1))                \
-                      && !POINTER_TYPE_P (XGCTYPE (obj2))      \
+  (EQ (obj1, obj2) || (!POINTER_TYPE_P (XTYPE (obj1))          \
+                      && !POINTER_TYPE_P (XTYPE (obj2))        \
                       && XCHAR_OR_INT (obj1) == XCHAR_OR_INT (obj2)))
 
 #ifdef DEBUG_XEMACS
@@ -669,12 +607,12 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
 
 \f
 /************************************************************************/
-/*                   Definitions of basic Lisp objects                  */
+/*                  Definitions of basic Lisp objects                  */
 /************************************************************************/
 
 #include "lrecord.h"
 
-/********** unbound ***********/
+/*********** unbound ***********/
 
 /* Qunbound is a special Lisp_Object (actually of type
    symbol-value-forward), that can never be visible to
@@ -682,7 +620,6 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
    to mean "no such value". */
 
 #define UNBOUNDP(val) EQ (val, Qunbound)
-#define GC_UNBOUNDP(val) GC_EQ (val, Qunbound)
 
 /*********** cons ***********/
 
@@ -690,11 +627,10 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
 
 struct Lisp_Cons
 {
-#ifdef LRECORD_CONS
   struct lrecord_header lheader;
-#endif
   Lisp_Object car, cdr;
 };
+typedef struct Lisp_Cons Lisp_Cons;
 
 #if 0 /* FSFmacs */
 /* Like a cons, but records info on where the text lives that it was read from */
@@ -708,38 +644,19 @@ struct Lisp_Buffer_Cons
 };
 #endif
 
-#ifdef LRECORD_CONS
-
-DECLARE_LRECORD (cons, struct Lisp_Cons);
-#define XCONS(x) XRECORD (x, cons, struct Lisp_Cons)
+DECLARE_LRECORD (cons, Lisp_Cons);
+#define XCONS(x) XRECORD (x, cons, Lisp_Cons)
 #define XSETCONS(x, p) XSETRECORD (x, p, cons)
 #define CONSP(x) RECORDP (x, cons)
-#define GC_CONSP(x) GC_RECORDP (x, cons)
 #define CHECK_CONS(x) CHECK_RECORD (x, cons)
 #define CONCHECK_CONS(x) CONCHECK_RECORD (x, cons)
 
 #define CONS_MARKED_P(c) MARKED_RECORD_HEADER_P(&((c)->lheader))
 #define MARK_CONS(c) MARK_RECORD_HEADER (&((c)->lheader))
 
-#else /* ! LRECORD_CONS */
-
-DECLARE_NONRECORD (cons, Lisp_Type_Cons, struct Lisp_Cons);
-#define XCONS(a) XNONRECORD (a, cons, Lisp_Type_Cons, struct Lisp_Cons)
-#define XSETCONS(c, p) XSETOBJ (c, Lisp_Type_Cons, p)
-#define CONSP(x) (XTYPE (x) == Lisp_Type_Cons)
-#define GC_CONSP(x) (XGCTYPE (x) == Lisp_Type_Cons)
-#define CHECK_CONS(x) CHECK_NONRECORD (x, Lisp_Type_Cons, Qconsp)
-#define CONCHECK_CONS(x) CONCHECK_NONRECORD (x, Lisp_Type_Cons, Qconsp)
-
-/* Define these because they're used in a few places, inside and
-   out of alloc.c */
-#define CONS_MARKED_P(c) XMARKBIT (c->car)
-#define MARK_CONS(c) XMARK (c->car)
-
-#endif /* ! LRECORD_CONS */
+extern Lisp_Object Qnil;
 
 #define NILP(x)  EQ (x, Qnil)
-#define GC_NILP(x)  GC_EQ (x, Qnil)
 #define XCAR(a) (XCONS (a)->car)
 #define XCDR(a) (XCONS (a)->cdr)
 #define LISTP(x) (CONSP(x) || NILP(x))
@@ -756,96 +673,311 @@ DECLARE_NONRECORD (cons, Lisp_Type_Cons, struct Lisp_Cons);
 
 /* For a list that's known to be in valid list format --
    will abort() if the list is not in valid format */
-#define LIST_LOOP(consvar, list) \
-  for (consvar = list; !NILP (consvar); consvar = XCDR (consvar))
+#define LIST_LOOP(tail, list)          \
+  for (tail = list;                    \
+       !NILP (tail);                   \
+       tail = XCDR (tail))
+
+#define LIST_LOOP_2(elt, list)         \
+  Lisp_Object tail##elt;               \
+  LIST_LOOP_3(elt, list, tail##elt)
+
+#define LIST_LOOP_3(elt, list, tail)   \
+  for (tail = list;                    \
+       NILP (tail) ?                   \
+        0 : (elt = XCAR (tail), 1);    \
+       tail = XCDR (tail))
+
+#define GET_LIST_LENGTH(list, len) do {                \
+  Lisp_Object GLL_tail;                                \
+  for (GLL_tail = list, len = 0;               \
+       !NILP (GLL_tail);                       \
+       GLL_tail = XCDR (GLL_tail), ++len)      \
+    DO_NOTHING;                                        \
+} while (0)
+
+#define GET_EXTERNAL_LIST_LENGTH(list, len)            \
+do {                                                   \
+  Lisp_Object GELL_elt, GELL_tail;                     \
+  EXTERNAL_LIST_LOOP_4 (GELL_elt, list, GELL_tail, len)        \
+    ;                                                  \
+} while (0)
 
 /* For a list that's known to be in valid list format, where we may
    be deleting the current element out of the list --
    will abort() if the list is not in valid format */
-#define LIST_LOOP_DELETING(consvar, nextconsvar, list)                 \
-  for (consvar = list;                                                 \
-       !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) : 0;                \
+#define LIST_LOOP_DELETING(consvar, nextconsvar, list)         \
+  for (consvar = list;                                         \
+       !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) :0; \
        consvar = nextconsvar)
 
+/* Delete all elements of external list LIST
+   satisfying CONDITION, an expression referring to variable ELT */
+#define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do {        \
+  Lisp_Object prev_tail_##list = Qnil;                         \
+  Lisp_Object tail_##list;                                     \
+  EMACS_INT len_##list;                                                \
+  EXTERNAL_LIST_LOOP_4 (elt, list, tail_##list, len_##list)    \
+    {                                                          \
+      if (condition)                                           \
+       {                                                       \
+         if (NILP (prev_tail_##list))                          \
+           list = XCDR (tail_##list);                          \
+         else                                                  \
+           XCDR (prev_tail_##list) = XCDR (tail_##list);       \
+          /* Keep tortoise from ever passing hare. */          \
+         len_##list = 0;                                       \
+       }                                                       \
+      else                                                     \
+       prev_tail_##list = tail_##list;                         \
+    }                                                          \
+} while (0)
+
+/* Delete all elements of true non-circular list LIST
+   satisfying CONDITION, an expression referring to variable ELT */
+#define LIST_LOOP_DELETE_IF(elt, list, condition) do {         \
+  Lisp_Object prev_tail_##list = Qnil;                         \
+  Lisp_Object tail_##list;                                     \
+  LIST_LOOP_3 (elt, list, tail_##list)                         \
+    {                                                          \
+      if (condition)                                           \
+       {                                                       \
+         if (NILP (prev_tail_##list))                          \
+           list = XCDR (tail_##list);                          \
+         else                                                  \
+           XCDR (prev_tail_##list) = XCDR (tail_##list);       \
+       }                                                       \
+      else                                                     \
+       prev_tail_##list = tail_##list;                         \
+    }                                                          \
+} while (0)
+
 /* For a list that may not be in valid list format --
    will signal an error if the list is not in valid format */
-#define EXTERNAL_LIST_LOOP(consvar, listp)                             \
-  for (consvar = listp; !NILP (consvar); consvar = XCDR (consvar))     \
-     if (!CONSP (consvar))                                             \
-       signal_simple_error ("Invalid list format", listp);             \
+#define EXTERNAL_LIST_LOOP(tail, list)                 \
+  for (tail = list; !NILP (tail); tail = XCDR (tail))  \
+     if (!CONSP (tail))                                        \
+       signal_malformed_list_error (list);             \
      else
 
-extern Lisp_Object Qnil;
 
-INLINE int TRUE_LIST_P (Lisp_Object object);
-INLINE int
-TRUE_LIST_P (Lisp_Object object)
-{
-  while (CONSP (object))
-    object = XCDR (object);
-  return NILP (object);
-}
+/* The following macros are for traversing lisp lists.
+   Signal an error if LIST is not properly acyclic and nil-terminated.
+
+   Use tortoise/hare algorithm to check for cycles, but only if it
+   looks like the list is getting too long.  Not only is the hare
+   faster than the tortoise; it even gets a head start! */
+
+/* Optimized and safe macros for looping over external lists.  */
+#define CIRCULAR_LIST_SUSPICION_LENGTH 1024
+
+#define EXTERNAL_LIST_LOOP_1(list)                                     \
+Lisp_Object ELL1_elt, ELL1_hare, ELL1_tortoise;                                \
+EMACS_INT ELL1_len;                                                            \
+EXTERNAL_LIST_LOOP_6 (ELL1_elt, list, ELL1_len, ELL1_hare,             \
+                     ELL1_tortoise, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_LIST_LOOP_2(elt, list)                                        \
+Lisp_Object hare_##elt, tortoise_##elt;                                        \
+EMACS_INT len_##elt;                                                           \
+EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt,                        \
+                     tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_LIST_LOOP_3(elt, list, tail)                          \
+Lisp_Object tortoise_##elt;                                            \
+EMACS_INT len_##elt;                                                           \
+EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, tail,                      \
+                     tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_LIST_LOOP_4(elt, list, tail, len)                     \
+Lisp_Object tortoise_##elt;                                            \
+EXTERNAL_LIST_LOOP_6 (elt, list, len, tail,                            \
+                     tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+
+#define EXTERNAL_LIST_LOOP_6(elt, list, len, hare,             \
+                             tortoise, suspicion_length)       \
+  for (tortoise = hare = list, len = 0;                                \
+                                                               \
+       (CONSP (hare) ? ((elt = XCAR (hare)), 1) :              \
+       (NILP (hare) ? 0 :                                      \
+        (signal_malformed_list_error (list), 0)));             \
+                                                               \
+       hare = XCDR (hare),                                     \
+        ((++len < suspicion_length) ?                          \
+         ((void) 0) :                                          \
+         (((len & 1) ?                                         \
+           ((void) (tortoise = XCDR (tortoise))) :             \
+           ((void) 0))                                         \
+          ,                                                    \
+          (EQ (hare, tortoise) ?                               \
+           ((void) signal_circular_list_error (list)) :        \
+           ((void) 0)))))
+
+
+
+/* Optimized and safe macros for looping over external alists. */
+#define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list)     \
+Lisp_Object hare_##elt, tortoise_##elt;                                \
+EMACS_INT len_##elt;                                           \
+EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,            \
+                      len_##elt, hare_##elt, tortoise_##elt,   \
+                      CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_ALIST_LOOP_5(elt, elt_car, elt_cdr, list, tail)       \
+Lisp_Object tortoise_##elt;                                            \
+EMACS_INT len_##elt;                                                   \
+EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,                    \
+                      len_##elt, tail, tortoise_##elt,                 \
+                      CIRCULAR_LIST_SUSPICION_LENGTH)                  \
+
+#define EXTERNAL_ALIST_LOOP_6(elt, elt_car, elt_cdr, list, tail, len)  \
+Lisp_Object tortoise_##elt;                                            \
+EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,                    \
+                      len, tail, tortoise_##elt,                       \
+                      CIRCULAR_LIST_SUSPICION_LENGTH)
+
+
+#define EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, hare,  \
+                             tortoise, suspicion_length)               \
+EXTERNAL_LIST_LOOP_6 (elt, list, len, hare, tortoise, suspicion_length)        \
+  if (CONSP (elt) ? (elt_car = XCAR (elt), elt_cdr = XCDR (elt), 0) :1)        \
+    continue;                                                          \
+  else
 
-#define CHECK_TRUE_LIST(object) do {                   \
-  if (!TRUE_LIST_P (object))                           \
-    dead_wrong_type_argument (Qtrue_list_p, object);   \
-} while (0)
+
+/* Optimized and safe macros for looping over external property lists. */
+#define EXTERNAL_PROPERTY_LIST_LOOP_3(key, value, list)                        \
+Lisp_Object key, value, hare_##key, tortoise_##key;                    \
+EMACS_INT len_##key;                                                           \
+EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len_##key, hare_##key,        \
+                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_PROPERTY_LIST_LOOP_4(key, value, list, tail)          \
+Lisp_Object key, value, tail, tortoise_##key;                          \
+EMACS_INT len_##key;                                                           \
+EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len_##key, tail,      \
+                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_PROPERTY_LIST_LOOP_5(key, value, list, tail, len)     \
+Lisp_Object key, value, tail, tortoise_##key;                          \
+EMACS_INT len;                                                         \
+EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail,            \
+                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+
+#define EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, hare,     \
+                             tortoise, suspicion_length)               \
+  for (tortoise = hare = list, len = 0;                                        \
+                                                                       \
+       ((CONSP (hare) &&                                               \
+        (key = XCAR (hare),                                            \
+         hare = XCDR (hare),                                           \
+         CONSP (hare))) ?                                              \
+       (value = XCAR (hare), 1) :                                      \
+       (NILP (hare) ? 0 :                                              \
+        (signal_malformed_property_list_error (list), 0)));            \
+                                                                       \
+       hare = XCDR (hare),                                             \
+        ((++len < suspicion_length) ?                                  \
+         ((void) 0) :                                                  \
+         (((len & 1) ?                                                 \
+           ((void) (tortoise = XCDR (XCDR (tortoise)))) :              \
+           ((void) 0))                                                 \
+          ,                                                            \
+          (EQ (hare, tortoise) ?                                       \
+           ((void) signal_circular_property_list_error (list)) :       \
+           ((void) 0)))))
 
 /* For a property list (alternating keywords/values) that may not be
    in valid list format -- will signal an error if the list is not in
    valid format.  CONSVAR is used to keep track of the iterations
-   without modifying LISTP.
+   without modifying PLIST.
 
    We have to be tricky to still keep the same C format.*/
-#define EXTERNAL_PROPERTY_LIST_LOOP(consvar, keyword, value, listp)    \
-  for (consvar = listp;                                                        \
-       (CONSP (consvar) && CONSP (XCDR (consvar)) ?                    \
-       (keyword = XCAR (consvar), value = XCAR (XCDR (consvar))) :     \
-       (keyword = Qunbound, value = Qunbound)),                        \
-       !NILP (consvar);                                                        \
-       consvar = XCDR (XCDR (consvar)))                                        \
-    if (UNBOUNDP (keyword))                                            \
-      signal_simple_error ("Invalid property list format", listp);     \
+#define EXTERNAL_PROPERTY_LIST_LOOP(tail, key, value, plist)   \
+  for (tail = plist;                                           \
+       (CONSP (tail) && CONSP (XCDR (tail)) ?                  \
+       (key = XCAR (tail), value = XCAR (XCDR (tail))) :       \
+       (key = Qunbound,    value = Qunbound)),                 \
+       !NILP (tail);                                           \
+       tail = XCDR (XCDR (tail)))                              \
+    if (UNBOUNDP (key))                                                \
+      Fsignal (Qmalformed_property_list, list1 (plist));       \
     else
 
-/*********** string ***********/
+#define PROPERTY_LIST_LOOP(tail, key, value, plist)    \
+  for (tail = plist;                                   \
+       NILP (tail) ? 0 :                               \
+        (key   = XCAR (tail), tail = XCDR (tail),      \
+         value = XCAR (tail), tail = XCDR (tail), 1);  \
+       )
 
-/* In a string or vector, the sign bit of the `size' is the gc mark bit */
+/* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */
+INLINE int TRUE_LIST_P (Lisp_Object object);
+INLINE int
+TRUE_LIST_P (Lisp_Object object)
+{
+  Lisp_Object hare, tortoise;
+  EMACS_INT len;
+
+  for (hare = tortoise = object, len = 0;
+       CONSP (hare);
+       hare = XCDR (hare), len++)
+    {
+      if (len < CIRCULAR_LIST_SUSPICION_LENGTH)
+       continue;
+
+      if (len & 1)
+       tortoise = XCDR (tortoise);
+      else if (EQ (hare, tortoise))
+       return 0;
+    }
+
+  return NILP (hare);
+}
+
+/* Signal an error if LIST is not properly acyclic and nil-terminated. */
+#define CHECK_TRUE_LIST(list) do {                     \
+  Lisp_Object CTL_list = (list);                       \
+  Lisp_Object CTL_hare, CTL_tortoise;                  \
+  EMACS_INT CTL_len;                                           \
+                                                       \
+  for (CTL_hare = CTL_tortoise = CTL_list, CTL_len = 0;        \
+       CONSP (CTL_hare);                               \
+       CTL_hare = XCDR (CTL_hare), CTL_len++)          \
+    {                                                  \
+      if (CTL_len < CIRCULAR_LIST_SUSPICION_LENGTH)    \
+       continue;                                       \
+                                                       \
+      if (CTL_len & 1)                                 \
+       CTL_tortoise = XCDR (CTL_tortoise);             \
+      else if (EQ (CTL_hare, CTL_tortoise))            \
+       Fsignal (Qcircular_list, list1 (CTL_list));     \
+    }                                                  \
+                                                       \
+  if (! NILP (CTL_hare))                               \
+    signal_malformed_list_error (CTL_list);            \
+} while (0)
+
+/*********** string ***********/
 
-/* (The size and data fields have underscores prepended to catch old
-   code that attempts to reference the fields directly) */
 struct Lisp_String
 {
-#ifdef LRECORD_STRING
   struct lrecord_header lheader;
-#endif
-  Bytecount _size;
-  Bufbyte *_data;
+  Bytecount size;
+  Bufbyte *data;
   Lisp_Object plist;
 };
+typedef struct Lisp_String Lisp_String;
 
-#ifdef LRECORD_STRING
-
-DECLARE_LRECORD (string, struct Lisp_String);
-#define XSTRING(x) XRECORD (x, string, struct Lisp_String)
+DECLARE_LRECORD (string, Lisp_String);
+#define XSTRING(x) XRECORD (x, string, Lisp_String)
 #define XSETSTRING(x, p) XSETRECORD (x, p, string)
 #define STRINGP(x) RECORDP (x, string)
-#define GC_STRINGP(x) GC_RECORDP (x, string)
 #define CHECK_STRING(x) CHECK_RECORD (x, string)
 #define CONCHECK_STRING(x) CONCHECK_RECORD (x, string)
 
-#else /* ! LRECORD_STRING */
-
-DECLARE_NONRECORD (string, Lisp_Type_String, struct Lisp_String);
-#define XSTRING(x) XNONRECORD (x, string, Lisp_Type_String, struct Lisp_String)
-#define XSETSTRING(x, p) XSETOBJ (x, Lisp_Type_String, p)
-#define STRINGP(x) (XTYPE (x) == Lisp_Type_String)
-#define GC_STRINGP(x) (XGCTYPE (x) == Lisp_Type_String)
-#define CHECK_STRING(x) CHECK_NONRECORD (x, Lisp_Type_String, Qstringp)
-#define CONCHECK_STRING(x) CONCHECK_NONRECORD (x, Lisp_Type_String, Qstringp)
-
-#endif /* ! LRECORD_STRING */
-
 #ifdef MULE
 
 Charcount bytecount_to_charcount (CONST Bufbyte *ptr, Bytecount len);
@@ -858,32 +990,32 @@ Bytecount charcount_to_bytecount (CONST Bufbyte *ptr, Charcount len);
 
 #endif /* not MULE */
 
-#define string_length(s) ((s)->_size)
+#define string_length(s) ((s)->size)
 #define XSTRING_LENGTH(s) string_length (XSTRING (s))
 #define XSTRING_CHAR_LENGTH(s) string_char_length (XSTRING (s))
-#define string_data(s) ((s)->_data + 0)
+#define string_data(s) ((s)->data + 0)
 #define XSTRING_DATA(s) string_data (XSTRING (s))
-#define string_byte(s, i) ((s)->_data[i] + 0)
+#define string_byte(s, i) ((s)->data[i] + 0)
 #define XSTRING_BYTE(s, i) string_byte (XSTRING (s), i)
-#define string_byte_addr(s, i) (&((s)->_data[i]))
-#define set_string_length(s, len) ((void) ((s)->_size = (len)))
-#define set_string_data(s, ptr) ((void) ((s)->_data = (ptr)))
-#define set_string_byte(s, i, c) ((void) ((s)->_data[i] = (c)))
+#define string_byte_addr(s, i) (&((s)->data[i]))
+#define set_string_length(s, len) ((void) ((s)->size = (len)))
+#define set_string_data(s, ptr) ((void) ((s)->data = (ptr)))
+#define set_string_byte(s, i, c) ((void) ((s)->data[i] = (c)))
 
-void resize_string (struct Lisp_String *s, Bytecount pos, Bytecount delta);
+void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta);
 
 #ifdef MULE
 
-INLINE Charcount string_char_length (struct Lisp_String *s);
+INLINE Charcount string_char_length (Lisp_String *s);
 INLINE Charcount
-string_char_length (struct Lisp_String *s)
+string_char_length (Lisp_String *s)
 {
   return bytecount_to_charcount (string_data (s), string_length (s));
 }
 
 # define string_char(s, i) charptr_emchar_n (string_data (s), i)
 # define string_char_addr(s, i) charptr_n_addr (string_data (s), i)
-void set_string_char (struct Lisp_String *s, Charcount i, Emchar c);
+void set_string_char (Lisp_String *s, Charcount i, Emchar c);
 
 #else /* not MULE */
 
@@ -898,45 +1030,26 @@ void set_string_char (struct Lisp_String *s, Charcount i, Emchar c);
 
 struct Lisp_Vector
 {
-#ifdef LRECORD_VECTOR
   struct lcrecord_header header;
-#endif
   long size;
   /* next is now chained through v->contents[size], terminated by Qzero.
      This means that pure vectors don't need a "next" */
   /* struct Lisp_Vector *next; */
   Lisp_Object contents[1];
 };
+typedef struct Lisp_Vector Lisp_Vector;
 
-#ifdef LRECORD_VECTOR
-
-DECLARE_LRECORD (vector, struct Lisp_Vector);
-#define XVECTOR(x) XRECORD (x, vector, struct Lisp_Vector)
+DECLARE_LRECORD (vector, Lisp_Vector);
+#define XVECTOR(x) XRECORD (x, vector, Lisp_Vector)
 #define XSETVECTOR(x, p) XSETRECORD (x, p, vector)
 #define VECTORP(x) RECORDP (x, vector)
-#define GC_VECTORP(x) GC_RECORDP (x, vector)
 #define CHECK_VECTOR(x) CHECK_RECORD (x, vector)
 #define CONCHECK_VECTOR(x) CONCHECK_RECORD (x, vector)
 
-#else
-
-DECLARE_NONRECORD (vector, Lisp_Type_Vector, struct Lisp_Vector);
-#define XVECTOR(x) XNONRECORD (x, vector, Lisp_Type_Vector, struct Lisp_Vector)
-#define XSETVECTOR(x, p) XSETOBJ (x, Lisp_Type_Vector, p)
-#define VECTORP(x) (XTYPE (x) == Lisp_Type_Vector)
-#define GC_VECTORP(x) (XGCTYPE (x) == Lisp_Type_Vector)
-#define CHECK_VECTOR(x) CHECK_NONRECORD (x, Lisp_Type_Vector, Qvectorp)
-#define CONCHECK_VECTOR(x) CONCHECK_NONRECORD (x, Lisp_Type_Vector, Qvectorp)
-
-#endif
-
 #define vector_length(v) ((v)->size)
 #define XVECTOR_LENGTH(s) vector_length (XVECTOR (s))
 #define vector_data(v) ((v)->contents)
 #define XVECTOR_DATA(s) vector_data (XVECTOR (s))
-#ifndef LRECORD_VECTOR
-# define vector_next(v) ((v)->contents[(v)->size])
-#endif
 
 /*********** bit vector ***********/
 
@@ -959,20 +1072,19 @@ struct Lisp_Bit_Vector
 {
   struct lrecord_header lheader;
   Lisp_Object next;
-  long size;
-  unsigned int bits[1];
+  size_t size;
+  unsigned long bits[1];
 };
+typedef struct Lisp_Bit_Vector Lisp_Bit_Vector;
 
-DECLARE_LRECORD (bit_vector, struct Lisp_Bit_Vector);
-#define XBIT_VECTOR(x) XRECORD (x, bit_vector, struct Lisp_Bit_Vector)
+DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector);
+#define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector)
 #define XSETBIT_VECTOR(x, p) XSETRECORD (x, p, bit_vector)
 #define BIT_VECTORP(x) RECORDP (x, bit_vector)
-#define GC_BIT_VECTORP(x) GC_RECORDP (x, bit_vector)
 #define CHECK_BIT_VECTOR(x) CHECK_RECORD (x, bit_vector)
 #define CONCHECK_BIT_VECTOR(x) CONCHECK_RECORD (x, bit_vector)
 
 #define BITP(x) (INTP (x) && (XINT (x) == 0 || XINT (x) == 1))
-#define GC_BITP(x) (GC_INTP (x) && (XINT (x) == 0 || XINT (x) == 1))
 
 #define CHECK_BIT(x) do {              \
   if (!BITP (x))                       \
@@ -987,76 +1099,57 @@ DECLARE_LRECORD (bit_vector, struct Lisp_Bit_Vector);
 #define bit_vector_length(v) ((v)->size)
 #define bit_vector_next(v) ((v)->next)
 
-INLINE int bit_vector_bit (struct Lisp_Bit_Vector *v, int i);
+INLINE int bit_vector_bit (Lisp_Bit_Vector *v, size_t n);
 INLINE int
-bit_vector_bit (struct Lisp_Bit_Vector *v, int i)
+bit_vector_bit (Lisp_Bit_Vector *v, size_t n)
 {
-  unsigned int ui = (unsigned int) i;
-
-  return (((v)->bits[ui >> LONGBITS_LOG2] >> (ui & (LONGBITS_POWER_OF_2 - 1)))
+  return ((v->bits[n >> LONGBITS_LOG2] >> (n & (LONGBITS_POWER_OF_2 - 1)))
          & 1);
 }
 
-INLINE void set_bit_vector_bit (struct Lisp_Bit_Vector *v, int i, int value);
+INLINE void set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value);
 INLINE void
-set_bit_vector_bit (struct Lisp_Bit_Vector *v, int i, int value)
+set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value)
 {
-  unsigned int ui = (unsigned int) i;
   if (value)
-    (v)->bits[ui >> LONGBITS_LOG2] |= (1 << (ui & (LONGBITS_POWER_OF_2 - 1)));
+    v->bits[n >> LONGBITS_LOG2] |= (1UL << (n & (LONGBITS_POWER_OF_2 - 1)));
   else
-    (v)->bits[ui >> LONGBITS_LOG2] &= ~(1 << (ui & (LONGBITS_POWER_OF_2 - 1)));
+    v->bits[n >> LONGBITS_LOG2] &= ~(1UL << (n & (LONGBITS_POWER_OF_2 - 1)));
 }
 
 /* Number of longs required to hold LEN bits */
 #define BIT_VECTOR_LONG_STORAGE(len) \
-  ((len + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2)
+  (((len) + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2)
 
 
 /*********** symbol ***********/
 
-/* In a symbol, the markbit of the plist is used as the gc mark bit */
-
 struct Lisp_Symbol
 {
-#ifdef LRECORD_SYMBOL
   struct lrecord_header lheader;
-#endif
   /* next symbol in this obarray bucket */
   struct Lisp_Symbol *next;
   struct Lisp_String *name;
   Lisp_Object value;
   Lisp_Object function;
-  /* non-nil if the symbol is interned in Vobarray */
-  Lisp_Object obarray;
   Lisp_Object plist;
 };
+typedef struct Lisp_Symbol Lisp_Symbol;
 
-#define SYMBOL_IS_KEYWORD(sym) (string_byte (XSYMBOL(sym)->name, 0) == ':')
+#define SYMBOL_IS_KEYWORD(sym)                                         \
+  ((string_byte (symbol_name (XSYMBOL (sym)), 0) == ':')               \
+   && EQ (sym, oblookup (Vobarray,                                     \
+                        string_data (symbol_name (XSYMBOL (sym))),     \
+                        string_length (symbol_name (XSYMBOL (sym))))))
 #define KEYWORDP(obj) (SYMBOLP (obj) && SYMBOL_IS_KEYWORD (obj))
 
-#ifdef LRECORD_SYMBOL
-
-DECLARE_LRECORD (symbol, struct Lisp_Symbol);
-#define XSYMBOL(x) XRECORD (x, symbol, struct Lisp_Symbol)
+DECLARE_LRECORD (symbol, Lisp_Symbol);
+#define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol)
 #define XSETSYMBOL(x, p) XSETRECORD (x, p, symbol)
 #define SYMBOLP(x) RECORDP (x, symbol)
-#define GC_SYMBOLP(x) GC_RECORDP (x, symbol)
 #define CHECK_SYMBOL(x) CHECK_RECORD (x, symbol)
 #define CONCHECK_SYMBOL(x) CONCHECK_RECORD (x, symbol)
 
-#else
-
-DECLARE_NONRECORD (symbol, Lisp_Type_Symbol, struct Lisp_Symbol);
-#define XSYMBOL(x) XNONRECORD (x, symbol, Lisp_Type_Symbol, struct Lisp_Symbol)
-#define XSETSYMBOL(s, p) XSETOBJ ((s), Lisp_Type_Symbol, (p))
-#define SYMBOLP(x) (XTYPE (x) == Lisp_Type_Symbol)
-#define GC_SYMBOLP(x) (XGCTYPE (x) == Lisp_Type_Symbol)
-#define CHECK_SYMBOL(x) CHECK_NONRECORD (x, Lisp_Type_Symbol, Qsymbolp)
-#define CONCHECK_SYMBOL(x) CONCHECK_NONRECORD (x, Lisp_Type_Symbol, Qsymbolp)
-
-#endif
-
 #define symbol_next(s) ((s)->next)
 #define symbol_name(s) ((s)->name)
 #define symbol_value(s) ((s)->value)
@@ -1076,12 +1169,12 @@ struct Lisp_Subr
   CONST char *name;
   lisp_fn_t subr_fn;
 };
+typedef struct Lisp_Subr Lisp_Subr;
 
-DECLARE_LRECORD (subr, struct Lisp_Subr);
-#define XSUBR(x) XRECORD (x, subr, struct Lisp_Subr)
+DECLARE_LRECORD (subr, Lisp_Subr);
+#define XSUBR(x) XRECORD (x, subr, Lisp_Subr)
 #define XSETSUBR(x, p) XSETRECORD (x, p, subr)
 #define SUBRP(x) RECORDP (x, subr)
-#define GC_SUBRP(x) GC_RECORDP (x, subr)
 #define CHECK_SUBR(x) CHECK_RECORD (x, subr)
 #define CONCHECK_SUBR(x) CONCHECK_RECORD (x, subr)
 
@@ -1098,12 +1191,12 @@ struct Lisp_Marker
   Memind memind;
   char insertion_type;
 };
+typedef struct Lisp_Marker Lisp_Marker;
 
-DECLARE_LRECORD (marker, struct Lisp_Marker);
-#define XMARKER(x) XRECORD (x, marker, struct Lisp_Marker)
+DECLARE_LRECORD (marker, Lisp_Marker);
+#define XMARKER(x) XRECORD (x, marker, Lisp_Marker)
 #define XSETMARKER(x, p) XSETRECORD (x, p, marker)
 #define MARKERP(x) RECORDP (x, marker)
-#define GC_MARKERP(x) GC_RECORDP (x, marker)
 #define CHECK_MARKER(x) CHECK_RECORD (x, marker)
 #define CONCHECK_MARKER(x) CONCHECK_RECORD (x, marker)
 
@@ -1116,7 +1209,6 @@ DECLARE_LRECORD (marker, struct Lisp_Marker);
 /*********** char ***********/
 
 #define CHARP(x) (XTYPE (x) == Lisp_Type_Char)
-#define GC_CHARP(x) (XGCTYPE (x) == Lisp_Type_Char)
 
 #ifdef ERROR_CHECK_TYPECHECK
 
@@ -1142,7 +1234,7 @@ XCHAR (Lisp_Object obj)
 
 #ifdef LISP_FLOAT_TYPE
 
-/* Note: the 'unused__next__' field exists only to ensure that the
+/* Note: the 'unused_next_' field exists only to ensure that the
    `next' pointer fits within the structure, for the purposes of the
    free list.  This makes a difference in the unlikely case of
    sizeof(double) being smaller than sizeof(void *). */
@@ -1150,18 +1242,19 @@ XCHAR (Lisp_Object obj)
 struct Lisp_Float
 {
   struct lrecord_header lheader;
-  union { double d; struct Lisp_Float *unused__next__; } data;
+  union { double d; struct Lisp_Float *unused_next_; } data;
 };
+typedef struct Lisp_Float Lisp_Float;
 
-DECLARE_LRECORD (float, struct Lisp_Float);
-#define XFLOAT(x) XRECORD (x, float, struct Lisp_Float)
+DECLARE_LRECORD (float, Lisp_Float);
+#define XFLOAT(x) XRECORD (x, float, Lisp_Float)
 #define XSETFLOAT(x, p) XSETRECORD (x, p, float)
 #define FLOATP(x) RECORDP (x, float)
-#define GC_FLOATP(x) GC_RECORDP (x, float)
 #define CHECK_FLOAT(x) CHECK_RECORD (x, float)
 #define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float)
 
 #define float_data(f) ((f)->data.d)
+#define XFLOAT_DATA(x) float_data (XFLOAT (x))
 
 #define XFLOATINT(n) extract_float (n)
 
@@ -1175,58 +1268,26 @@ DECLARE_LRECORD (float, struct Lisp_Float);
     x = wrong_type_argument (Qnumberp, x);     \
 } while (0)
 
-/* These are always continuable because they change their arguments
-   even when no error is signalled. */
-
-#define CHECK_INT_OR_FLOAT_COERCE_MARKER(x) do {       \
-  if (INT_OR_FLOATP (x))                               \
-    ;                                                  \
-  else if (MARKERP (x))                                        \
-    x = make_int (marker_position (x));                        \
-  else                                                 \
-    x = wrong_type_argument (Qnumber_or_marker_p, x);  \
-} while (0)
-
-#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER(x) do {       \
-  if (INT_OR_FLOATP (x))                                       \
-    ;                                                          \
-  else if (CHARP (x))                                          \
-    x = make_int (XCHAR (x));                                  \
-  else if (MARKERP (x))                                                \
-    x = make_int (marker_position (x));                                \
-  else                                                         \
-    x = wrong_type_argument (Qnumber_char_or_marker_p, x);     \
-} while (0)
-
 # define INT_OR_FLOATP(x) (INTP (x) || FLOATP (x))
-# define GC_INT_OR_FLOATP(x) (GC_INTP (x) || GC_FLOATP (x))
 
 #else /* not LISP_FLOAT_TYPE */
 
 #define XFLOAT(x) --- error!  No float support. ---
 #define XSETFLOAT(x, p) --- error!  No float support. ---
 #define FLOATP(x) 0
-#define GC_FLOATP(x) 0
 #define CHECK_FLOAT(x) --- error!  No float support. ---
 #define CONCHECK_FLOAT(x) --- error!  No float support. ---
 
 #define XFLOATINT(n) XINT(n)
 #define CHECK_INT_OR_FLOAT CHECK_INT
 #define CONCHECK_INT_OR_FLOAT CONCHECK_INT
-#define CHECK_INT_OR_FLOAT_COERCE_MARKER CHECK_INT_COERCE_MARKER
-#define CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER \
-     CHECK_INT_COERCE_CHAR_OR_MARKER
-#define INT_OR_FLOATP(x) (INTP (x))
-# define GC_INT_OR_FLOATP(x) (GC_INTP (x))
+#define INT_OR_FLOATP(x) INTP (x)
 
 #endif /* not LISP_FLOAT_TYPE */
 
 /*********** int ***********/
 
-#define GC_INTP(x) INTP (x)
-
 #define ZEROP(x) EQ (x, Qzero)
-#define GC_ZEROP(x) GC_EQ (x, Qzero)
 
 #ifdef ERROR_CHECK_TYPECHECK
 
@@ -1264,7 +1325,6 @@ XCHAR_OR_INT (Lisp_Object obj)
 } while (0)
 
 #define NATNUMP(x) (INTP (x) && XINT (x) >= 0)
-#define GC_NATNUMP(x) (GC_INTP (x) && XINT (x) >= 0)
 
 #define CHECK_NATNUM(x) do {                   \
   if (!NATNUMP (x))                            \
@@ -1306,10 +1366,17 @@ XCHAR_OR_INT (Lisp_Object obj)
     x = wrong_type_argument (Qinteger_char_or_marker_p, x);    \
 } while (0)
 
-/*********** pure space ***********/
 
-#define CHECK_IMPURE(obj)                                      \
-  do { if (purified (obj)) pure_write_error (obj); } while (0)
+/*********** readonly objects ***********/
+    
+#define CHECK_C_WRITEABLE(obj)                                 \
+  do { if (c_readonly (obj)) c_write_error (obj); } while (0)
+
+#define CHECK_LISP_WRITEABLE(obj)                                      \
+  do { if (lisp_readonly (obj)) lisp_write_error (obj); } while (0)
+
+#define C_READONLY(obj) (C_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
+#define LISP_READONLY(obj) (LISP_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
 
 /*********** structures ***********/
 
@@ -1379,7 +1446,6 @@ DECLARE_LRECORD (weak_list, struct weak_list);
 #define XWEAK_LIST(x) XRECORD (x, weak_list, struct weak_list)
 #define XSETWEAK_LIST(x, p) XSETRECORD (x, p, weak_list)
 #define WEAK_LISTP(x) RECORDP (x, weak_list)
-#define GC_WEAK_LISTP(x) GC_RECORDP (x, weak_list)
 #define CHECK_WEAK_LIST(x) CHECK_RECORD (x, weak_list)
 #define CONCHECK_WEAK_LIST(x) CONCHECK_RECORD (x, weak_list)
 
@@ -1388,9 +1454,8 @@ DECLARE_LRECORD (weak_list, struct weak_list);
 
 Lisp_Object make_weak_list (enum weak_list_type type);
 /* The following two are only called by the garbage collector */
-int finish_marking_weak_lists (int (*obj_marked_p) (Lisp_Object),
-                              void (*markobj) (Lisp_Object));
-void prune_weak_lists (int (*obj_marked_p) (Lisp_Object));
+int finish_marking_weak_lists (void);
+void prune_weak_lists (void);
 
 /*********** lcrecord lists ***********/
 
@@ -1406,7 +1471,6 @@ DECLARE_LRECORD (lcrecord_list, struct lcrecord_list);
 #define XLCRECORD_LIST(x) XRECORD (x, lcrecord_list, struct lcrecord_list)
 #define XSETLCRECORD_LIST(x, p) XSETRECORD (x, p, lcrecord_list)
 #define LCRECORD_LISTP(x) RECORDP (x, lcrecord_list)
-#define GC_LCRECORD_LISTP(x) GC_RECORDP (x, lcrecord_list)
 /* #define CHECK_LCRECORD_LIST(x) CHECK_RECORD (x, lcrecord_list)
    Lcrecord lists should never escape to the Lisp level, so
    functions should not be doing this. */
@@ -1419,7 +1483,7 @@ void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord);
 
 \f
 /************************************************************************/
-/*         Definitions of primitive Lisp functions and variables        */
+/*        Definitions of primitive Lisp functions and variables        */
 /************************************************************************/
 
 
@@ -1430,8 +1494,8 @@ void free_managed_lcrecord (Lisp_Object lcrecord_list, Lisp_Object lcrecord);
     valid in a C identifier, with an "F" prepended.
     The name of the C constant structure that records information
     on this function for internal use is "S" concatenated with Fname.
- `minargs' should be a number, the minimum number of arguments allowed.
- `maxargs' should be a number, the maximum number of arguments allowed,
+ `min_args' should be a number, the minimum number of arguments allowed.
+ `max_args' should be a number, the maximum number of arguments allowed,
     or else MANY or UNEVALLED.
     MANY means pass a vector of evaluated arguments,
         in the form of an integer number-of-arguments
@@ -1462,7 +1526,7 @@ Lisp_Object,Lisp_Object
 Lisp_Object,Lisp_Object,Lisp_Object
 #define EXFUN_MANY int, Lisp_Object*
 #define EXFUN_UNEVALLED Lisp_Object
-#define EXFUN(sym, maxargs) Lisp_Object sym (EXFUN_##maxargs)
+#define EXFUN(sym, max_args) Lisp_Object sym (EXFUN_##max_args)
 
 #define SUBR_MAX_ARGS 8
 #define MANY -2
@@ -1471,20 +1535,16 @@ Lisp_Object,Lisp_Object,Lisp_Object
 /* Can't be const, because then subr->doc is read-only and
    Snarf_documentation chokes */
 
-#ifdef USE_INDEXED_LRECORD_IMPLEMENTATION
-# define subr_lheader_initializer { 0, 0, 0 }
-#else
-# define subr_lheader_initializer { lrecord_subr }
-#endif
+#define subr_lheader_initializer { 0, 0, 0, 0 }
 
-#define DEFUN(lname, Fname, minargs, maxargs, prompt, arglist)         \
-  Lisp_Object Fname (EXFUN_##maxargs);                                 \
+#define DEFUN(lname, Fname, min_args, max_args, prompt, arglist)       \
+  Lisp_Object Fname (EXFUN_##max_args);                                        \
   static struct Lisp_Subr S##Fname = { subr_lheader_initializer,       \
-       minargs, maxargs, prompt, 0, lname, (lisp_fn_t) Fname };        \
-  Lisp_Object Fname (DEFUN_##maxargs arglist)
+       min_args, max_args, prompt, 0, lname, (lisp_fn_t) Fname };      \
+  Lisp_Object Fname (DEFUN_##max_args arglist)
 
 /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
-   prototype that matches maxargs, and add the obligatory
+   prototype that matches max_args, and add the obligatory
    `Lisp_Object' type declaration to the formal C arguments.  */
 
 #define DEFUN_MANY(named_int, named_Lisp_Object) named_int, named_Lisp_Object
@@ -1499,18 +1559,27 @@ Lisp_Object,Lisp_Object,Lisp_Object
 #define DEFUN_7(a,b,c,d,e,f,g)  DEFUN_6(a,b,c,d,e,f),  Lisp_Object g
 #define DEFUN_8(a,b,c,d,e,f,g,h) DEFUN_7(a,b,c,d,e,f,g),Lisp_Object h
 
-/* WARNING: If you add defines here for higher values of maxargs,
-   make sure to also fix the clauses in inline_funcall_fn(),
+/* WARNING: If you add defines here for higher values of max_args,
+   make sure to also fix the clauses in PRIMITIVE_FUNCALL(),
    and change the define of SUBR_MAX_ARGS above.  */
 
 #include "symeval.h"
 
-/* Depth of special binding/unwind-protect stack.  Use as arg to `unbind_to' */
-int specpdl_depth (void);
+/* `specpdl' is the special binding/unwind-protect stack.
+
+   Knuth says (see the Jargon File):
+   At MIT, `pdl' [abbreviation for `Push Down List'] used to
+   be a more common synonym for `stack'.
+   Everywhere else `stack' seems to be the preferred term.
+
+   specpdl_depth is the current depth of `specpdl'.
+   Save this for use later as arg to `unbind_to'.  */
+extern int specpdl_depth_counter;
+#define specpdl_depth() specpdl_depth_counter
 
 \f
 /************************************************************************/
-/*                         Checking for QUIT                            */
+/*                        Checking for QUIT                            */
 /************************************************************************/
 
 /* Asynchronous events set something_happened, and then are processed
@@ -1554,7 +1623,7 @@ void signal_quit (void);
 
 \f
 /************************************************************************/
-/*                               hashing                                */
+/*                              hashing                                */
 /************************************************************************/
 
 /* #### for a 64-bit machine, we should substitute a prime just over 2^32 */
@@ -1568,8 +1637,6 @@ void signal_quit (void);
 #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))
 
-/* Enough already! */
-
 #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj))
 unsigned long string_hash (CONST void *xv);
 unsigned long memory_hash (CONST void *xv, size_t size);
@@ -1578,7 +1645,7 @@ unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth);
 
 \f
 /************************************************************************/
-/*                       String translation                             */
+/*                      String translation                             */
 /************************************************************************/
 
 #ifdef I18N3
@@ -1606,7 +1673,7 @@ char *bindtextdomain (CONST char *, CONST char *);
 
 \f
 /************************************************************************/
-/*                   Garbage collection / GC-protection                 */
+/*                  Garbage collection / GC-protection                 */
 /************************************************************************/
 
 /* number of bytes of structure consed since last GC */
@@ -1703,106 +1770,106 @@ void debug_ungcpro(char *, int, struct gcpro *);
 #define NNGCPRO5(v1,v2,v3,v4,v5) \
  debug_gcpro5 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,\
               &nngcpro5,&v1,&v2,&v3,&v4,&v5)
-#define NUNNGCPRO \
+#define NNUNGCPRO \
  debug_ungcpro(__FILE__, __LINE__,&nngcpro1)
 
 #else /* ! DEBUG_GCPRO */
 
-#define GCPRO1(varname) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \
-  gcprolist = &gcpro1; }
-
-#define GCPRO2(varname1, varname2) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
-  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
-  gcprolist = &gcpro2; }
-
-#define GCPRO3(varname1, varname2, varname3) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
-  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
-  gcpro3.next = &gcpro2;   gcpro3.var = &varname3; gcpro3.nvars = 1; \
-  gcprolist = &gcpro3; }
-
-#define GCPRO4(varname1, varname2, varname3, varname4) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
-  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
-  gcpro3.next = &gcpro2;   gcpro3.var = &varname3; gcpro3.nvars = 1; \
-  gcpro4.next = &gcpro3;   gcpro4.var = &varname4; gcpro4.nvars = 1; \
-  gcprolist = &gcpro4; }
-
-#define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
- {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
-  gcpro2.next = &gcpro1;   gcpro2.var = &varname2; gcpro2.nvars = 1; \
-  gcpro3.next = &gcpro2;   gcpro3.var = &varname3; gcpro3.nvars = 1; \
-  gcpro4.next = &gcpro3;   gcpro4.var = &varname4; gcpro4.nvars = 1; \
-  gcpro5.next = &gcpro4;   gcpro5.var = &varname5; gcpro5.nvars = 1; \
-  gcprolist = &gcpro5; }
-
-#define UNGCPRO (gcprolist = gcpro1.next)
-
-#define NGCPRO1(varname) \
- {ngcpro1.next = gcprolist; ngcpro1.var = &varname; ngcpro1.nvars = 1; \
-  gcprolist = &ngcpro1; }
-
-#define NGCPRO2(varname1, varname2) \
- {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
-  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
-  gcprolist = &ngcpro2; }
-
-#define NGCPRO3(varname1, varname2, varname3) \
- {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
-  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
-  ngcpro3.next = &ngcpro2;  ngcpro3.var = &varname3; ngcpro3.nvars = 1; \
-  gcprolist = &ngcpro3; }
-
-#define NGCPRO4(varname1, varname2, varname3, varname4) \
- {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
-  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
-  ngcpro3.next = &ngcpro2;  ngcpro3.var = &varname3; ngcpro3.nvars = 1; \
-  ngcpro4.next = &ngcpro3;  ngcpro4.var = &varname4; ngcpro4.nvars = 1; \
-  gcprolist = &ngcpro4; }
-
-#define NGCPRO5(varname1, varname2, varname3, varname4, varname5) \
- {ngcpro1.next = gcprolist; ngcpro1.var = &varname1; ngcpro1.nvars = 1; \
-  ngcpro2.next = &ngcpro1;  ngcpro2.var = &varname2; ngcpro2.nvars = 1; \
-  ngcpro3.next = &ngcpro2;  ngcpro3.var = &varname3; ngcpro3.nvars = 1; \
-  ngcpro4.next = &ngcpro3;  ngcpro4.var = &varname4; ngcpro4.nvars = 1; \
-  ngcpro5.next = &ngcpro4;  ngcpro5.var = &varname5; ngcpro5.nvars = 1; \
-  gcprolist = &ngcpro5; }
-
-#define NUNGCPRO (gcprolist = ngcpro1.next)
-
-#define NNGCPRO1(varname) \
- {nngcpro1.next = gcprolist; nngcpro1.var = &varname; nngcpro1.nvars = 1; \
-  gcprolist = &nngcpro1; }
-
-#define NNGCPRO2(varname1, varname2) \
- {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
-  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
-  gcprolist = &nngcpro2; }
-
-#define NNGCPRO3(varname1, varname2, varname3) \
- {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
-  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
-  nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \
-  gcprolist = &nngcpro3; }
-
-#define NNGCPRO4(varname1, varname2, varname3, varname4) \
- {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
-  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
-  nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \
-  nngcpro4.next = &nngcpro3; nngcpro4.var = &varname4; nngcpro4.nvars = 1; \
-  gcprolist = &nngcpro4; }
-
-#define NNGCPRO5(varname1, varname2, varname3, varname4, varname5) \
- {nngcpro1.next = gcprolist; nngcpro1.var = &varname1; nngcpro1.nvars = 1; \
-  nngcpro2.next = &nngcpro1; nngcpro2.var = &varname2; nngcpro2.nvars = 1; \
-  nngcpro3.next = &nngcpro2; nngcpro3.var = &varname3; nngcpro3.nvars = 1; \
-  nngcpro4.next = &nngcpro3; nngcpro4.var = &varname4; nngcpro4.nvars = 1; \
-  nngcpro5.next = &nngcpro4; nngcpro5.var = &varname5; nngcpro5.nvars = 1; \
-  gcprolist = &nngcpro5; }
-
-#define NNUNGCPRO (gcprolist = nngcpro1.next)
+#define GCPRO1(var1) ((void) (                                         \
+  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
+  gcprolist = &gcpro1 ))
+
+#define GCPRO2(var1, var2) ((void) (                                   \
+  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
+  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
+  gcprolist = &gcpro2 ))
+
+#define GCPRO3(var1, var2, var3) ((void) (                             \
+  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
+  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
+  gcpro3.next = &gcpro2,   gcpro3.var = &var3, gcpro3.nvars = 1,       \
+  gcprolist = &gcpro3 ))
+
+#define GCPRO4(var1, var2, var3, var4) ((void) (                       \
+  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
+  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
+  gcpro3.next = &gcpro2,   gcpro3.var = &var3, gcpro3.nvars = 1,       \
+  gcpro4.next = &gcpro3,   gcpro4.var = &var4, gcpro4.nvars = 1,       \
+  gcprolist = &gcpro4 ))
+
+#define GCPRO5(var1, var2, var3, var4, var5) ((void) (                 \
+  gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1,       \
+  gcpro2.next = &gcpro1,   gcpro2.var = &var2, gcpro2.nvars = 1,       \
+  gcpro3.next = &gcpro2,   gcpro3.var = &var3, gcpro3.nvars = 1,       \
+  gcpro4.next = &gcpro3,   gcpro4.var = &var4, gcpro4.nvars = 1,       \
+  gcpro5.next = &gcpro4,   gcpro5.var = &var5, gcpro5.nvars = 1,       \
+  gcprolist = &gcpro5 ))
+
+#define UNGCPRO ((void) (gcprolist = gcpro1.next))
+
+#define NGCPRO1(var1) ((void) (                                                \
+  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
+  gcprolist = &ngcpro1 ))
+
+#define NGCPRO2(var1, var2) ((void) (                                  \
+  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
+  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
+  gcprolist = &ngcpro2 ))
+
+#define NGCPRO3(var1, var2, var3) ((void) (                            \
+  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
+  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
+  ngcpro3.next = &ngcpro2,  ngcpro3.var = &var3, ngcpro3.nvars = 1,    \
+  gcprolist = &ngcpro3 ))
+
+#define NGCPRO4(var1, var2, var3, var4) ((void) (                      \
+  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
+  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
+  ngcpro3.next = &ngcpro2,  ngcpro3.var = &var3, ngcpro3.nvars = 1,    \
+  ngcpro4.next = &ngcpro3,  ngcpro4.var = &var4, ngcpro4.nvars = 1,    \
+  gcprolist = &ngcpro4 ))
+
+#define NGCPRO5(var1, var2, var3, var4, var5) ((void) (                        \
+  ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1,    \
+  ngcpro2.next = &ngcpro1,  ngcpro2.var = &var2, ngcpro2.nvars = 1,    \
+  ngcpro3.next = &ngcpro2,  ngcpro3.var = &var3, ngcpro3.nvars = 1,    \
+  ngcpro4.next = &ngcpro3,  ngcpro4.var = &var4, ngcpro4.nvars = 1,    \
+  ngcpro5.next = &ngcpro4,  ngcpro5.var = &var5, ngcpro5.nvars = 1,    \
+  gcprolist = &ngcpro5 ))
+
+#define NUNGCPRO ((void) (gcprolist = ngcpro1.next))
+
+#define NNGCPRO1(var1) ((void) (                                       \
+  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
+  gcprolist = &nngcpro1 ))
+
+#define NNGCPRO2(var1, var2) ((void) (                                 \
+  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
+  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
+  gcprolist = &nngcpro2 ))
+
+#define NNGCPRO3(var1, var2, var3) ((void) (                           \
+  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
+  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
+  nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
+  gcprolist = &nngcpro3 ))
+
+#define NNGCPRO4(var1, var2, var3, var4)  ((void) (                    \
+  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
+  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
+  nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
+  nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \
+  gcprolist = &nngcpro4 ))
+
+#define NNGCPRO5(var1, var2, var3, var4, var5) ((void) (               \
+  nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
+  nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
+  nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
+  nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \
+  nngcpro5.next = &nngcpro4, nngcpro5.var = &var5, nngcpro5.nvars = 1, \
+  gcprolist = &nngcpro5 ))
+
+#define NNUNGCPRO ((void) (gcprolist = nngcpro1.next))
 
 #endif /* ! DEBUG_GCPRO */
 
@@ -1810,10 +1877,10 @@ void debug_ungcpro(char *, int, struct gcpro *);
 /* "end-of-loop code not reached" */
 /* "statement not reached */
 #ifdef __SUNPRO_C
-#define RETURN__ if (1) return
+#define RETURN_SANS_WARNINGS if (1) return
 #define RETURN_NOT_REACHED(value)
 #else
-#define RETURN__ return
+#define RETURN_SANS_WARNINGS return
 #define RETURN_NOT_REACHED(value) return value;
 #endif
 
@@ -1822,7 +1889,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
 {                                      \
   Lisp_Object ret_ungc_val = (expr);   \
   UNGCPRO;                             \
-  RETURN__ ret_ungc_val;               \
+  RETURN_SANS_WARNINGS ret_ungc_val;   \
 } while (0)
 
 /* Evaluate expr, NUNGCPRO, UNGCPRO, and then return the value of expr.  */
@@ -1831,7 +1898,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
   Lisp_Object ret_ungc_val = (expr);   \
   NUNGCPRO;                            \
   UNGCPRO;                             \
-  RETURN__ ret_ungc_val;               \
+  RETURN_SANS_WARNINGS ret_ungc_val;   \
 } while (0)
 
 /* Evaluate expr, NNUNGCPRO, NUNGCPRO, UNGCPRO, and then return the
@@ -1842,7 +1909,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
   NNUNGCPRO;                           \
   NUNGCPRO;                            \
   UNGCPRO;                             \
-  RETURN__ ret_ungc_val;               \
+  RETURN_SANS_WARNINGS ret_ungc_val;   \
 } while (0)
 
 /* Evaluate expr, return it if it's not Qunbound. */
@@ -1850,12 +1917,27 @@ void debug_ungcpro(char *, int, struct gcpro *);
 {                                      \
   Lisp_Object ret_nunb_val = (expr);   \
   if (!UNBOUNDP (ret_nunb_val))                \
-    RETURN__ ret_nunb_val;             \
+    RETURN_SANS_WARNINGS ret_nunb_val; \
 } while (0)
 
 /* Call staticpro (&var) to protect static variable `var'. */
 void staticpro (Lisp_Object *);
 
+/* Call staticpro_nodump (&var) to protect static variable `var'. */
+/* var will not be saved at dump time */
+void staticpro_nodump (Lisp_Object *);
+
+/* Call dumpstruct(&var, &desc) to dump the structure pointed to by `var'. */
+void dumpstruct (void *, const struct struct_description *);
+
+/* Call pdump_wire(&var) to ensure that var is properly updated after pdump. */
+void pdump_wire (Lisp_Object *);
+
+/* Call pdump_wire(&var) to ensure that var  is properly updated after
+   pdump.  var  must point to  a linked list  of  objects out of which
+   some may not be dumped */
+void pdump_wire_list (Lisp_Object *);
+
 /* Nonzero means Emacs has already been initialized.
    Used during startup to detect startup of dumped Emacs.  */
 extern int initialized;
@@ -1895,17 +1977,17 @@ struct overhead_stats
 #define DIRECTORY_SEP '/'
 #endif
 #ifndef IS_DIRECTORY_SEP
-#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
+#define IS_DIRECTORY_SEP(c) ((c) == DIRECTORY_SEP)
 #endif
 #ifndef IS_DEVICE_SEP
 #ifndef DEVICE_SEP
-#define IS_DEVICE_SEP(_c_) 0
+#define IS_DEVICE_SEP(c) 0
 #else
-#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
+#define IS_DEVICE_SEP(c) ((c) == DEVICE_SEP)
 #endif
 #endif
 #ifndef IS_ANY_SEP
-#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
+#define IS_ANY_SEP(c) IS_DIRECTORY_SEP (c)
 #endif
 
 #ifdef HAVE_INTTYPES_H
@@ -1928,12 +2010,12 @@ typedef unsigned long uintptr_t;
 /* Defined in alloc.c */
 void release_breathing_space (void);
 Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object);
-Lisp_Object make_vector (EMACS_INT, Lisp_Object);
+Lisp_Object make_vector (size_t, Lisp_Object);
 Lisp_Object vector1 (Lisp_Object);
 Lisp_Object vector2 (Lisp_Object, Lisp_Object);
 Lisp_Object vector3 (Lisp_Object, Lisp_Object, Lisp_Object);
-Lisp_Object make_bit_vector (EMACS_INT, Lisp_Object);
-Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, EMACS_INT);
+Lisp_Object make_bit_vector (size_t, Lisp_Object);
+Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, size_t);
 Lisp_Object noseeum_make_marker (void);
 void garbage_collect_1 (void);
 Lisp_Object acons (Lisp_Object, Lisp_Object, Lisp_Object);
@@ -1952,7 +2034,8 @@ extern int purify_flag;
 extern int gc_currently_forbidden;
 Lisp_Object restore_gc_inhibit (Lisp_Object);
 extern EMACS_INT gc_generation_number[1];
-int purified (Lisp_Object);
+int c_readonly (Lisp_Object);
+int lisp_readonly (Lisp_Object);
 Lisp_Object build_string (CONST char *);
 Lisp_Object build_ext_string (CONST char *, enum external_data_format);
 Lisp_Object build_translated_string (CONST char *);
@@ -1961,24 +2044,29 @@ Lisp_Object make_ext_string (CONST Extbyte *, EMACS_INT,
                             enum external_data_format);
 Lisp_Object make_uninit_string (Bytecount);
 Lisp_Object make_float (double);
-size_t purespace_usage (void);
-void report_pure_usage (int, int);
-Lisp_Object make_pure_string (CONST Bufbyte *, Bytecount, Lisp_Object, int);
-Lisp_Object make_pure_pname (CONST Bufbyte *, Bytecount, int);
-Lisp_Object pure_cons (Lisp_Object, Lisp_Object);
-Lisp_Object pure_list (int, Lisp_Object *);
-Lisp_Object make_pure_vector (size_t, Lisp_Object);
-void free_cons (struct Lisp_Cons *);
+Lisp_Object make_string_nocopy (CONST Bufbyte *, Bytecount);
+void free_cons (Lisp_Cons *);
 void free_list (Lisp_Object);
 void free_alist (Lisp_Object);
 void mark_conses_in_list (Lisp_Object);
-void free_marker (struct Lisp_Marker *);
+void free_marker (Lisp_Marker *);
 int object_dead_p (Lisp_Object);
+void mark_object (Lisp_Object obj);
+int marked_p (Lisp_Object obj);
 
 #ifdef MEMORY_USAGE_STATS
 size_t malloced_storage_size (void *, size_t, struct overhead_stats *);
 size_t fixed_type_block_overhead (size_t);
 #endif
+#ifdef PDUMP
+void pdump (void);
+int pdump_load (void);
+
+extern char *pdump_start, *pdump_end;
+#define DUMPEDP(adr) ((((char *)(adr)) < pdump_end) && (((char *)(adr)) >= pdump_start))
+#else
+#define DUMPEDP(adr) 0
+#endif
 
 /* Defined in buffer.c */
 Lisp_Object make_buffer (struct buffer *);
@@ -1994,13 +2082,14 @@ char *egetenv (CONST char *);
 void stuff_buffered_input (Lisp_Object);
 
 /* Defined in data.c */
-DECLARE_DOESNT_RETURN (pure_write_error (Lisp_Object));
+DECLARE_DOESNT_RETURN (c_write_error (Lisp_Object));
+DECLARE_DOESNT_RETURN (lisp_write_error (Lisp_Object));
 DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object));
 DECLARE_DOESNT_RETURN (args_out_of_range_3 (Lisp_Object, Lisp_Object,
                                            Lisp_Object));
 Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object);
 DECLARE_DOESNT_RETURN (dead_wrong_type_argument (Lisp_Object, Lisp_Object));
-void check_int_range (int, int, int);
+void check_int_range (EMACS_INT, EMACS_INT, EMACS_INT);
 
 enum arith_comparison {
   arith_equal,
@@ -2043,11 +2132,12 @@ Lisp_Object emacs_doprnt_string_lisp_2 (CONST Bufbyte *, Lisp_Object,
 /* Defined in editfns.c */
 void uncache_home_directory (void);
 char *get_home_directory (void);
-char *user_login_name (int *);
+char *user_login_name (uid_t *);
 Bufpos bufpos_clip_to_bounds (Bufpos, Bufpos, Bufpos);
 Bytind bytind_clip_to_bounds (Bytind, Bytind, Bytind);
 void buffer_insert1 (struct buffer *, Lisp_Object);
-Lisp_Object make_string_from_buffer (struct buffer *, int, int);
+Lisp_Object make_string_from_buffer (struct buffer *, Bufpos, Charcount);
+Lisp_Object make_string_from_buffer_no_extents (struct buffer *, Bufpos, Charcount);
 Lisp_Object save_excursion_save (void);
 Lisp_Object save_restriction_save (void);
 Lisp_Object save_excursion_restore (Lisp_Object);
@@ -2057,7 +2147,7 @@ Lisp_Object save_restriction_restore (Lisp_Object);
 Lisp_Object save_current_buffer_restore (Lisp_Object);
 
 /* Defined in emacs.c */
-DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (fatal (CONST char *,
+DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (CONST char *,
                                                           ...), 1, 2);
 int stderr_out (CONST char *, ...) PRINTF_ARGS (1, 2);
 int stdout_out (CONST char *, ...) PRINTF_ARGS (1, 2);
@@ -2079,7 +2169,7 @@ DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, Lisp_Object));
 void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior);
 Lisp_Object maybe_signal_continuable_error (Lisp_Object, Lisp_Object,
                                            Lisp_Object, Error_behavior);
-DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error (CONST char *,
+DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error (CONST char *,
                                                           ...), 1, 2);
 void maybe_error (Lisp_Object, Error_behavior, CONST char *,
                  ...) PRINTF_ARGS (3, 4);
@@ -2092,7 +2182,7 @@ void maybe_signal_simple_error (CONST char *, Lisp_Object,
 Lisp_Object signal_simple_continuable_error (CONST char *, Lisp_Object);
 Lisp_Object maybe_signal_simple_continuable_error (CONST char *, Lisp_Object,
                                                   Lisp_Object, Error_behavior);
-DECLARE_DOESNT_RETURN_GCC__ATTRIBUTE__SYNTAX_SUCKS (error_with_frob
+DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error_with_frob
                                                    (Lisp_Object, CONST char *,
                                                     ...), 2, 3);
 void maybe_error_with_frob (Lisp_Object, Lisp_Object, Error_behavior,
@@ -2110,7 +2200,11 @@ Lisp_Object signal_simple_continuable_error_2 (CONST char *,
 Lisp_Object maybe_signal_simple_continuable_error_2 (CONST char *, Lisp_Object,
                                                     Lisp_Object, Lisp_Object,
                                                     Error_behavior);
-Lisp_Object funcall_recording_as (Lisp_Object, int, Lisp_Object *);
+void signal_malformed_list_error (Lisp_Object);
+void signal_malformed_property_list_error (Lisp_Object);
+void signal_circular_list_error (Lisp_Object);
+void signal_circular_property_list_error (Lisp_Object);
+void signal_void_function_error (Lisp_Object);
 Lisp_Object run_hook_with_args_in_buffer (struct buffer *, int, Lisp_Object *,
                                          enum run_hooks_condition);
 Lisp_Object run_hook_with_args (int, Lisp_Object *, enum run_hooks_condition);
@@ -2194,7 +2288,7 @@ void signal_special_Xt_user_event (Lisp_Object, Lisp_Object, Lisp_Object);
 /* Defined in events.c */
 void clear_event_resource (void);
 Lisp_Object allocate_event (void);
-int event_to_character (struct Lisp_Event *, int, int, int);
+int event_to_character (Lisp_Event *, int, int, int);
 
 /* Defined in fileio.c */
 void record_auto_save (void);
@@ -2216,8 +2310,8 @@ void maybe_signal_double_file_error_2 (CONST char *, CONST char *,
                                       Error_behavior);
 Lisp_Object lisp_strerror (int);
 Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object);
-int read_allowing_quit (int, void *, size_t);
-int write_allowing_quit (int, CONST void *, size_t);
+ssize_t read_allowing_quit (int, void *, size_t);
+ssize_t write_allowing_quit (int, CONST void *, size_t);
 int internal_delete_file (Lisp_Object);
 
 /* Defined in filelock.c */
@@ -2248,7 +2342,6 @@ Lisp_Object remassoc_no_quit (Lisp_Object, Lisp_Object);
 Lisp_Object remassq_no_quit (Lisp_Object, Lisp_Object);
 Lisp_Object remrassq_no_quit (Lisp_Object, Lisp_Object);
 
-void pure_put (Lisp_Object, Lisp_Object, Lisp_Object);
 int plists_differ (Lisp_Object, Lisp_Object, int, int, int);
 Lisp_Object internal_plist_get (Lisp_Object, Lisp_Object);
 void internal_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object);
@@ -2264,6 +2357,7 @@ 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 bytecode_nconc2 (Lisp_Object *);
 void check_losing_bytecode (CONST char *, Lisp_Object);
 
 /* Defined in getloadavg.c */
@@ -2276,6 +2370,7 @@ Lisp_Object encode_error_behavior_flag (Error_behavior);
 /* Defined in indent.c */
 int bi_spaces_at_point (struct buffer *, Bytind);
 int column_at_point (struct buffer *, Bufpos, int);
+int string_column_at_point (struct Lisp_String *, Bufpos, int);
 int current_column (struct buffer *);
 void invalidate_current_column (void);
 Bufpos vmotion (struct window *, Bufpos, int, int *);
@@ -2287,7 +2382,8 @@ void where_is_to_char (Lisp_Object, char *);
 /* Defined in lread.c */
 void ebolify_bytecode_constants (Lisp_Object);
 void close_load_descs (void);
-int locate_file (Lisp_Object, Lisp_Object, CONST char *, Lisp_Object *, int);
+int locate_file (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object *, int);
+EXFUN (Flocate_file_clear_hashing, 1);
 int isfloat_string (CONST char *);
 
 /* Well, I've decided to enable this. -- ben */
@@ -2353,7 +2449,7 @@ void write_string_to_stdio_stream (FILE *, struct console *,
                                   enum external_data_format);
 void debug_print (Lisp_Object);
 void debug_short_backtrace (int);
-void temp_output_buffer_setup (CONST char *);
+void temp_output_buffer_setup (Lisp_Object);
 void temp_output_buffer_show (Lisp_Object, Lisp_Object);
 /* NOTE: Do not call this with the data of a Lisp_String.  Use princ.
  * Note: stream should be defaulted before calling
@@ -2368,17 +2464,16 @@ void long_to_string (char *, long);
 void print_internal (Lisp_Object, Lisp_Object, int);
 void print_symbol (Lisp_Object, Lisp_Object, int);
 void print_float (Lisp_Object, Lisp_Object, int);
-void print_compiled_function (Lisp_Object, Lisp_Object, int);
 extern int print_escape_newlines;
 extern int print_readably;
-Lisp_Object internal_with_output_to_temp_buffer (CONST char *,
+Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object,
                                                 Lisp_Object (*) (Lisp_Object),
                                                 Lisp_Object, Lisp_Object);
 void float_to_string (char *, double);
 void internal_object_printer (Lisp_Object, Lisp_Object, int);
 
 /* Defined in profile.c */
-void mark_profiling_info (void (*) (Lisp_Object));
+void mark_profiling_info (void);
 void profile_increase_call_count (Lisp_Object);
 extern int profiling_active;
 extern int profiling_redisplay_flag;
@@ -2400,6 +2495,7 @@ Bufpos scan_buffer (struct buffer *, Emchar, Bufpos, Bufpos, EMACS_INT, EMACS_IN
 Bufpos find_next_newline (struct buffer *, Bufpos, int);
 Bufpos find_next_newline_no_quit (struct buffer *, Bufpos, int);
 Bytind bi_find_next_newline_no_quit (struct buffer *, Bytind, int);
+Bytind bi_find_next_emchar_in_string (struct Lisp_String*, Emchar, Bytind, EMACS_INT);
 Bufpos find_before_next_newline (struct buffer *, Bufpos, Bufpos, int);
 struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *,
                                           char *, int, Error_behavior);
@@ -2436,9 +2532,12 @@ int symbol_value_buffer_local_info (Lisp_Object, struct buffer *);
 Lisp_Object find_symbol_value (Lisp_Object);
 Lisp_Object find_symbol_value_quickly (Lisp_Object, int);
 Lisp_Object top_level_value (Lisp_Object);
+void reject_constant_symbols (Lisp_Object sym, Lisp_Object newval,
+                             int function_p,
+                             Lisp_Object follow_past_lisp_magic);
 
 /* Defined in syntax.c */
-int scan_words (struct buffer *, int, int);
+Bufpos scan_words (struct buffer *, Bufpos, int);
 
 /* Defined in undo.c */
 Lisp_Object truncate_undo_list (Lisp_Object, int, int);
@@ -2491,7 +2590,6 @@ EXFUN (Fchar_after, 2);
 EXFUN (Fchar_to_string, 1);
 EXFUN (Fcheck_valid_plist, 1);
 EXFUN (Fclear_range_table, 1);
-EXFUN (Fclrhash, 1);
 EXFUN (Fcoding_category_list, 0);
 EXFUN (Fcoding_category_system, 1);
 EXFUN (Fcoding_priority_list, 0);
@@ -2504,12 +2602,12 @@ EXFUN (Fcoding_system_property, 2);
 EXFUN (Fcoding_system_type, 1);
 EXFUN (Fcommand_execute, 3);
 EXFUN (Fcommandp, 1);
-EXFUN (Fcompiled_function_domain, 1);
 EXFUN (Fconcat, MANY);
 EXFUN (Fcons, 2);
 EXFUN (Fcopy_alist, 1);
 EXFUN (Fcopy_coding_system, 2);
 EXFUN (Fcopy_event, 2);
+EXFUN (Fcopy_list, 1);
 EXFUN (Fcopy_marker, 2);
 EXFUN (Fcopy_sequence, 1);
 EXFUN (Fcopy_tree, 2);
@@ -2521,6 +2619,7 @@ EXFUN (Fdefault_boundp, 1);
 EXFUN (Fdefault_value, 1);
 EXFUN (Fdefine_key, 3);
 EXFUN (Fdelete_region, 3);
+EXFUN (Fdelete_process, 1);
 EXFUN (Fdelq, 2);
 EXFUN (Fdestructive_alist_to_plist, 1);
 EXFUN (Fdetect_coding_region, 3);
@@ -2576,11 +2675,9 @@ EXFUN (Fget_buffer_process, 1);
 EXFUN (Fget_coding_system, 1);
 EXFUN (Fget_process, 1);
 EXFUN (Fget_range_table, 3);
-EXFUN (Fgethash, 3);
 EXFUN (Fgettext, 1);
 EXFUN (Fgoto_char, 2);
 EXFUN (Fgtr, MANY);
-EXFUN (Fhashtablep, 1);
 EXFUN (Findent_to, 3);
 EXFUN (Findirect_function, 1);
 EXFUN (Finsert, MANY);
@@ -2599,11 +2696,14 @@ EXFUN (Flength, 1);
 EXFUN (Fleq, MANY);
 EXFUN (Flist, MANY);
 EXFUN (Flistp, 1);
+#ifdef HAVE_SHLIB
+EXFUN (Flist_modules, 0);
+EXFUN (Fload_module, 3);
+#endif
 EXFUN (Flss, MANY);
 EXFUN (Fmake_byte_code, MANY);
 EXFUN (Fmake_coding_system, 4);
 EXFUN (Fmake_glyph_internal, 1);
-EXFUN (Fmake_hashtable, 2);
 EXFUN (Fmake_list, 2);
 EXFUN (Fmake_marker, 0);
 EXFUN (Fmake_range_table, 0);
@@ -2632,6 +2732,7 @@ EXFUN (Fold_equal, 2);
 EXFUN (Fold_member, 2);
 EXFUN (Fold_memq, 2);
 EXFUN (Fplist_get, 3);
+EXFUN (Fplist_member, 2);
 EXFUN (Fplist_put, 3);
 EXFUN (Fplus, MANY);
 EXFUN (Fpoint, 1);
@@ -2647,11 +2748,9 @@ EXFUN (Fprint, 2);
 EXFUN (Fprocess_status, 1);
 EXFUN (Fprogn, UNEVALLED);
 EXFUN (Fprovide, 1);
-EXFUN (Fpurecopy, 1);
 EXFUN (Fput, 3);
 EXFUN (Fput_range_table, 4);
 EXFUN (Fput_text_property, 5);
-EXFUN (Fputhash, 3);
 EXFUN (Fquo, MANY);
 EXFUN (Frassq, 2);
 EXFUN (Fread, 1);
@@ -2689,6 +2788,7 @@ EXFUN (Fsymbol_function, 1);
 EXFUN (Fsymbol_name, 1);
 EXFUN (Fsymbol_plist, 1);
 EXFUN (Fsymbol_value, 1);
+EXFUN (Fsystem_name, 0);
 EXFUN (Fthrow, 2);
 EXFUN (Ftimes, MANY);
 EXFUN (Ftruncate, 1);
@@ -2712,14 +2812,15 @@ extern Lisp_Object Qafter, Qall, Qand;
 extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload;
 extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore;
 extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary, Qbitmap, Qbitp, Qblinking;
-extern Lisp_Object Qboolean, Qbottom, Qbuffer, Qbuffer_file_coding_system;
+extern Lisp_Object Qboolean, Qbottom, Qbuffer;
 extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only, Qbutton;
 extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory;
 extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qccl, Qcdr;
 extern Lisp_Object Qchannel, Qchar, Qchar_or_string_p, Qcharacter, Qcharacterp;
 extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3;
-extern Lisp_Object Qcircular_property_list, Qcoding_system_error;
-extern Lisp_Object Qcoding_system_p, Qcolor, Qcolor_pixmap_image_instance_p;
+extern Lisp_Object Qcenter, Qcircular_list, Qcircular_property_list;
+extern Lisp_Object Qcoding_system_error;
+extern Lisp_Object Qcolor, Qcolor_pixmap_image_instance_p;
 extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case;
 extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcr, Qcritical;
 extern Lisp_Object Qcrlf, Qctext, Qcurrent_menubar, Qcursor;
@@ -2735,26 +2836,27 @@ extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep, Qfile_error;
 extern Lisp_Object Qfont, Qforce_g0_on_output, Qforce_g1_on_output;
 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground;
 extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfunction, Qgap_overhead;
-extern Lisp_Object Qgeneric, Qgeometry, Qglobal, Qheight, Qhighlight, Qicon;
+extern Lisp_Object Qgeneric, Qgeometry, Qglobal, Qheight, Qhighlight, Qhorizontal, Qicon;
 extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qimage, Qinfo, Qinherit;
 extern Lisp_Object Qinhibit_quit, Qinhibit_read_only;
 extern Lisp_Object Qinput_charset_conversion, Qinteger;
 extern Lisp_Object Qinteger_char_or_marker_p, Qinteger_or_char_p;
 extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive, Qinternal;
 extern Lisp_Object Qinvalid_function, Qinvalid_read_syntax, Qio_error;
-extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeymap, Qlambda, Qleft, Qlf;
+extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeymap, Qlambda, Qlayout, Qleft, Qlf;
 extern Lisp_Object Qlist, Qlistp, Qload, Qlock_shift, Qmacro, Qmagic;
-extern Lisp_Object Qmalformed_property_list, Qmalloc_overhead, Qmark, Qmarkers;
+extern Lisp_Object Qmalformed_list, Qmalformed_property_list;
+extern Lisp_Object Qmalloc_overhead, Qmark, Qmarkers;
 extern Lisp_Object Qmax, Qmemory, Qmessage, Qminus, Qmnemonic, Qmodifiers;
 extern Lisp_Object Qmono_pixmap_image_instance_p, Qmotion;
 extern Lisp_Object Qmouse_leave_buffer_hook, Qmswindows, Qname, Qnas, Qnatnump;
-extern Lisp_Object Qnil, Qno_ascii_cntl, Qno_ascii_eol, Qno_catch;
+extern Lisp_Object Qno_ascii_cntl, Qno_ascii_eol, Qno_catch;
 extern Lisp_Object Qno_conversion, Qno_iso6429, Qnone, Qnot, Qnothing;
 extern Lisp_Object Qnothing_image_instance_p, Qnotice;
-extern Lisp_Object Qnumber_char_or_marker_p, Qnumber_or_marker_p, Qnumberp;
+extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp;
 extern Lisp_Object Qobject, Qold_assoc, Qold_delete, Qold_delq, Qold_rassoc;
 extern Lisp_Object Qold_rassq, Qonly, Qor, Qother, Qoutput_charset_conversion;
-extern Lisp_Object Qoverflow_error, Qpath, Qpoint, Qpointer, Qpointer_glyph_p;
+extern Lisp_Object Qoverflow_error, Qpoint, Qpointer, Qpointer_glyph_p;
 extern Lisp_Object Qpointer_image_instance_p, Qpost_read_conversion;
 extern Lisp_Object Qpre_write_conversion, Qprint, Qprint_length;
 extern Lisp_Object Qprint_string_length, Qprocess, Qprogn, Qprovide, Qquit;
@@ -2762,19 +2864,19 @@ extern Lisp_Object Qquote, Qrange_error, Qrassoc, Qrassq, Qread_char;
 extern Lisp_Object Qread_from_minibuffer, Qreally_early_error_handler;
 extern Lisp_Object Qregion_beginning, Qregion_end, Qrequire, Qresource;
 extern Lisp_Object Qreturn, Qreverse, Qright, Qrun_hooks, Qsans_modifiers;
-extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qself_insert_command;
+extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qselected, Qself_insert_command;
 extern Lisp_Object Qsequencep, Qsetting_constant, Qseven, Qshift_jis, Qshort;
 extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace;
 extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open;
-extern Lisp_Object Qstream, Qstring, Qstring_lessp;
+extern Lisp_Object Qstream, Qstring, Qstring_lessp, Qsubwindow;
 extern Lisp_Object Qsubwindow_image_instance_p, Qsymbol, Qsyntax, Qt, Qtest;
 extern Lisp_Object Qtext, Qtext_image_instance_p, Qtimeout, Qtimestamp;
 extern Lisp_Object Qtoolbar, Qtop, Qtop_level, Qtrue_list_p, Qtty, Qtype;
 extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error;
 extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories;
 extern Lisp_Object Qvalue_assoc, Qvalues;
-extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvector;
-extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwindow;
+extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvertical;
+extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning, Qwidth, Qwidget, Qwindow;
 extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments;
 extern Lisp_Object Qwrong_type_argument, Qx, Qy, Qyes_or_no_p;
 extern Lisp_Object Vactivate_menubar_hook, Vascii_canon_table;
@@ -2783,8 +2885,9 @@ extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vbinary_process_input;
 extern Lisp_Object Vbinary_process_output, Vblank_menubar;
 extern Lisp_Object Vcharset_ascii, Vcharset_composite, Vcharset_control_1;
 extern Lisp_Object Vcoding_system_for_read, Vcoding_system_for_write;
-extern Lisp_Object Vcoding_system_hashtable, Vcommand_history;
+extern Lisp_Object Vcoding_system_hash_table, Vcommand_history;
 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_mouse_event, Vcurrent_prefix_arg, Vdata_directory;
@@ -2802,16 +2905,18 @@ extern Lisp_Object Vload_path, Vmark_even_if_inactive, Vmenubar_configuration;
 extern Lisp_Object Vminibuf_preprompt, Vminibuf_prompt, Vminibuffer_zero;
 extern Lisp_Object Vmirror_ascii_canon_table, Vmirror_ascii_downcase_table;
 extern Lisp_Object Vmirror_ascii_eqv_table, Vmirror_ascii_upcase_table;
-extern Lisp_Object Vmswindows_downcase_file_names;
+extern Lisp_Object Vmodule_directory, Vmswindows_downcase_file_names;
 extern Lisp_Object Vmswindows_get_true_file_attributes, Vobarray;
 extern Lisp_Object Vprint_length, Vprint_level, Vprocess_environment;
-extern Lisp_Object Vpure_uninterned_symbol_table, Vquit_flag;
+extern Lisp_Object Vquit_flag;
 extern Lisp_Object Vrecent_keys_ring, Vshell_file_name, Vsite_directory;
+extern Lisp_Object Vsite_module_directory;
 extern Lisp_Object Vstandard_input, Vstandard_output, Vstdio_str;
 extern Lisp_Object Vsynchronous_sounds, Vsystem_name, Vterminal_coding_system;
 extern Lisp_Object Vthis_command_keys, Vunread_command_event;
 extern Lisp_Object Vwin32_generate_fake_inodes, Vwin32_pipe_read_delay;
 extern Lisp_Object Vx_initial_argv_list;
 
+extern Lisp_Object Qmakunbound, Qset;
 
 #endif /* _XEMACS_LISP_H_ */