(read_minibuf_unwind): Clear last_overlay_modified field.
[bpt/emacs.git] / src / lisp.h
index 23410ba..a524d86 100644 (file)
@@ -1,5 +1,5 @@
 /* Fundamental definitions for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985, 1986, 1987, 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1985,86,87,93,94,95 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -15,27 +15,29 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 /* These are default choices for the types to use.  */
 #ifndef EMACS_INT
 #define EMACS_INT int
+#define BITS_PER_EMACS_INT BITS_PER_INT
 #endif
 #ifndef EMACS_UINT
 #define EMACS_UINT unsigned int
 #endif
 
-/* Define the fundamental Lisp data structures */
+/* Define the fundamental Lisp data structures */
 
-/* This is the set of Lisp data types */
+/* This is the set of Lisp data types */
 
 enum Lisp_Type
   {
-    /* Integer.  XINT(obj) is the integer value. */
+    /* Integer.  XINT (obj) is the integer value.  */
     Lisp_Int,
 
-    /* Symbol.  XSYMBOL (object) points to a struct Lisp_Symbol. */
+    /* Symbol.  XSYMBOL (object) points to a struct Lisp_Symbol.  */
     Lisp_Symbol,
 
     /* Miscellaneous.  XMISC (object) points to a union Lisp_Misc,
@@ -43,112 +45,73 @@ enum Lisp_Type
     Lisp_Misc,
 
     /* String.  XSTRING (object) points to a struct Lisp_String.
-       The length of the string, and its contents, are stored therein. */
+       The length of the string, and its contents, are stored therein.  */
     Lisp_String,
 
-    /* Vector of Lisp objects.  XVECTOR(object) points to a struct Lisp_Vector.
-       The length of the vector, and its contents, are stored therein. */
-    Lisp_Vector,
+    /* Vector of Lisp objects, or something resembling it.
+       XVECTOR (object) points to a struct Lisp_Vector, which contains
+       the size and contents.  The size field also contains the type
+       information, if it's not a real vector object.  */
+    Lisp_Vectorlike,
 
-    /* Cons.  XCONS (object) points to a struct Lisp_Cons. */
+    /* Cons.  XCONS (object) points to a struct Lisp_Cons.  */
     Lisp_Cons,
 
-    /* Byte-compiled function.  A vector of 4 to 6 elements which are the
-       arglist, bytecode-string, constant vector, stack size,
-       (optional) doc string, and (optional) interactive spec.  */
-    Lisp_Compiled,
-
-    /* Editor buffer.  XBUFFER(obj) points to a struct buffer.  */
-    Lisp_Buffer,
-
-    /* Built-in function.  XSUBR(obj) points to a struct Lisp_Subr
-       which describes how to call the function, and its documentation,
-       as well as pointing to the code. */
-    Lisp_Subr,
-
-    /* Object describing a connection to a subprocess.
-       It points to storage of type  struct Lisp_Process  */
-    Lisp_Process,
-
-#ifdef MULTI_FRAME
-    /* Pointer to a vector-like object describing a display frame
-       on which Emacs can display a window hierarchy.  We don't define
-       this unless MULTI_FRAME is defined; this helps the compiler catch
-       code that won't work on a non-MULTI_FRAME configuration.  */
-    Lisp_Frame,
-#endif
-
-    /* Used in a symbol value cell when the symbol's value is per-buffer.
-       The actual contents are a cons cell which starts a list like this:
-       (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE).
-
-       BUFFER is the last buffer for which this symbol's value was
-       made up to date.
-
-       CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's
-       local_var_alist, that being the element whose car is this
-       variable.  Or it can be a pointer to the
-       (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE),
-       if BUFFER does not have an element in its alist for this
-       variable (that is, if BUFFER sees the default value of this
-       variable).
-
-       If we want to examine or set the value and BUFFER is current,
-       we just examine or set REALVALUE. If BUFFER is not current, we
-       store the current REALVALUE value into CURRENT-ALIST-ELEMENT,
-       then find the appropriate alist element for the buffer now
-       current and set up CURRENT-ALIST-ELEMENT.  Then we set
-       REALVALUE out of that element, and store into BUFFER.
-
-       If we are setting the variable and the current buffer does not
-       have an alist entry for this variable, an alist entry is
-       created.
-
-       Note that REALVALUE can be a forwarding pointer.  Each time it
-       is examined or set, forwarding must be done.  Each time we
-       switch buffers, buffer-local variables which forward into C
-       variables are swapped immediately, so the C code can assume
-       that they are always up to date.  */
-    Lisp_Buffer_Local_Value,
-
-    /* Like Lisp_Buffer_Local_Value with one difference:
-       merely setting the variable while some buffer is current
-       does not cause that buffer to have its own local value of this variable.
-       Only make-local-variable does that.  */
-    Lisp_Some_Buffer_Local_Value,
-
-    /* Window used for Emacs display.
-       Data inside looks like a Lisp_Vector.  */
-    Lisp_Window,
-
-    /* Used by save,set,restore-window-configuration */
-    Lisp_Window_Configuration,
-
 #ifdef LISP_FLOAT_TYPE
     Lisp_Float,
 #endif /* LISP_FLOAT_TYPE */
 
-    /* The overlay type.
-       An overlay values is actually a retagged cons, the first in a
-       list of the form
-           ((START . END) nil . PLIST)
-       where START and END are markers in the overlay's buffer, and
-       PLIST is the overlay's property list.  */
-    Lisp_Overlay
+    /* This is not a type code.  It is for range checking.  */
+    Lisp_Type_Limit
   };
 
 /* This is the set of datatypes that share a common structure.
-   The first member of the structure is a type code from this set.  */
+   The first member of the structure is a type code from this set.
+   The enum values are arbitrary, but we'll use large numbers to make it
+   more likely that we'll spot the error if a random word in memory is
+   mistakenly interpreted as a Lisp_Misc.  */
 enum Lisp_Misc_Type
   {
-    Lisp_Misc_Free,
+    Lisp_Misc_Free = 0x5eab,
     Lisp_Misc_Marker,
     Lisp_Misc_Intfwd,
     Lisp_Misc_Boolfwd,
     Lisp_Misc_Objfwd,
-    Lisp_Misc_Buffer_Objfwd
+    Lisp_Misc_Buffer_Objfwd,
+    Lisp_Misc_Buffer_Local_Value,
+    Lisp_Misc_Some_Buffer_Local_Value,
+    Lisp_Misc_Overlay,
+    Lisp_Misc_Kboard_Objfwd,
+    /* Currently floats are not a misc type,
+       but let's define this in case we want to change that.  */
+    Lisp_Misc_Float,
+    /* This is not a type code.  It is for range checking.  */
+    Lisp_Misc_Limit
   };
 
+/* These values are overridden by the m- file on some machines.  */
+#ifndef VALBITS
+#define VALBITS 28
+#endif
+
+#ifndef GCTYPEBITS
+#define GCTYPEBITS 3
+#endif
+
+/* Make these values available in GDB, which sees enums but not macros.  */
+
+enum gdb_lisp_params
+{
+  gdb_valbits = VALBITS,
+  gdb_gctypebits = GCTYPEBITS,
+  gdb_emacs_intbits = sizeof (EMACS_INT) * BITS_PER_CHAR,
+#ifdef DATA_SEG_BITS
+  gdb_data_seg_bits = DATA_SEG_BITS
+#else
+  gdb_data_seg_bits = 0
+#endif
+};
+
 #ifndef NO_UNION_TYPE
 
 #ifndef WORDS_BIG_ENDIAN
@@ -159,23 +122,23 @@ typedef
 union Lisp_Object
   {
     /* Used for comparing two Lisp_Objects;
-       also, positive integers can be accessed fast this way. */
+       also, positive integers can be accessed fast this way.  */
     int i;
 
     struct
       {
-       int val: 24;
-       char type;
+       int val: VALBITS;
+       int type: GCTYPEBITS+1;
       } s;
     struct
       {
-       unsigned int val: 24;
-       char type;
+       unsigned int val: VALBITS;
+       int type: GCTYPEBITS+1;
       } u;
     struct
       {
-       unsigned int val: 24;
-       enum Lisp_Type type: 7;
+       unsigned int val: VALBITS;
+       enum Lisp_Type type: GCTYPEBITS;
        /* The markbit is not really part of the value of a Lisp_Object,
           and is always zero except during garbage collection.  */
        unsigned int markbit: 1;
@@ -189,26 +152,26 @@ typedef
 union Lisp_Object
   {
     /* Used for comparing two Lisp_Objects;
-       also, positive integers can be accessed fast this way. */
+       also, positive integers can be accessed fast this way.  */
     int i;
 
     struct
       {
-       char type;
-       int val: 24;
+       int type: GCTYPEBITS+1;
+       int val: VALBITS;
       } s;
     struct
       {
-       char type;
-       unsigned int val: 24;
+       int type: GCTYPEBITS+1;
+       unsigned int val: VALBITS;
       } u;
     struct
       {
        /* The markbit is not really part of the value of a Lisp_Object,
           and is always zero except during garbage collection.  */
        unsigned int markbit: 1;
-       enum Lisp_Type type: 7;
-       unsigned int val: 24;
+       enum Lisp_Type type: GCTYPEBITS;
+       unsigned int val: VALBITS;
       } gu;
   }
 Lisp_Object;
@@ -225,15 +188,6 @@ Lisp_Object;
 
 #define Lisp_Object EMACS_INT
 
-/* These values are overridden by the m- file on some machines.  */
-#ifndef VALBITS
-#define VALBITS 24
-#endif
-
-#ifndef GCTYPEBITS
-#define GCTYPEBITS 7
-#endif
-
 #ifndef VALMASK
 #define VALMASK ((((EMACS_INT) 1)<<VALBITS) - 1)
 #endif
@@ -252,7 +206,7 @@ Lisp_Object;
    rather than being part of a string block.  */
 
 #ifndef MARKBIT
-#define MARKBIT (1 << (VALBITS + GCTYPEBITS))
+#define MARKBIT ((int) ((unsigned int) 1 << (VALBITS + GCTYPEBITS)))
 #endif /*MARKBIT */
 
 /* In the size word of a vector, this bit means the vector has been marked.
@@ -262,15 +216,39 @@ Lisp_Object;
 #define ARRAY_MARK_FLAG ((MARKBIT >> 1) & ~MARKBIT)
 #endif /* no ARRAY_MARK_FLAG */
 
-#if ARRAY_MARK_FLAG == MARKBIT
-you lose
+/* In the size word of a struct Lisp_Vector, this bit means it's really
+   some other vector-like object.  */
+#ifndef PSEUDOVECTOR_FLAG
+#define PSEUDOVECTOR_FLAG ((ARRAY_MARK_FLAG >> 1) & ~ARRAY_MARK_FLAG)
 #endif
 
+/* In a pseudovector, the size field actually contains a word with one
+   PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
+   indicate the actual type.  */
+enum pvec_type
+{
+  PVEC_NORMAL_VECTOR = 0,
+  PVEC_PROCESS = 0x200,
+  PVEC_FRAME = 0x400,
+  PVEC_COMPILED = 0x800,
+  PVEC_WINDOW = 0x1000,
+  PVEC_WINDOW_CONFIGURATION = 0x2000,
+  PVEC_SUBR = 0x4000,
+  PVEC_CHAR_TABLE = 0x8000,
+  PVEC_BOOL_VECTOR = 0x10000,
+  PVEC_BUFFER = 0x20000,
+  PVEC_TYPE_MASK = 0x3fe00,
+  PVEC_FLAG = PSEUDOVECTOR_FLAG
+};
+
+/* For convenience, we also store the number of elements in these bits.  */
+#define PSEUDOVECTOR_SIZE_MASK 0x1ff
+
 #endif /* NO_UNION_TYPE */
 \f
 /* These macros extract various sorts of values from a Lisp_Object.
  For example, if tem is a Lisp_Object whose type is Lisp_Cons,
- XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */
+ XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons.  */
 
 #ifdef NO_UNION_TYPE
 
@@ -295,7 +273,7 @@ you lose
 /* Extract the value of a Lisp_Object as a signed integer.  */
 
 #ifndef XINT   /* Some machines need to do this differently.  */
-#define XINT(a) (((a) << (INTBITS-VALBITS)) >> (INTBITS-VALBITS))
+#define XINT(a) (((a) << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
 #endif
 
 /* Extract the value as an unsigned integer.  This is a basis
@@ -330,6 +308,11 @@ extern int pure_size;
    ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK))
 #endif
 
+/* Convert a C integer into a Lisp_Object integer.  */
+
+#define make_number(N)         \
+  ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS)
+
 /* During garbage collection, XGCTYPE must be used for extracting types
  so that the mark bit is ignored.  XMARKBIT accesses the markbit.
  Markbits are used only in particular slots of particular structure types.
@@ -340,7 +323,7 @@ extern int pure_size;
 #define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK))
 #endif
 
-#if VALBITS + GCTYPEBITS == INTBITS - 1
+#if VALBITS + GCTYPEBITS == BITS_PER_EMACS_INT - 1
 /* Make XMARKBIT faster if mark bit is sign bit.  */
 #ifndef XMARKBIT
 #define XMARKBIT(a) ((a) < 0)
@@ -378,7 +361,7 @@ extern int pure_size;
 
 #ifdef EXPLICIT_SIGN_EXTEND
 /* Make sure we sign-extend; compilers have been known to fail to do so.  */
-#define XINT(a) (((a).i << 8) >> 8)
+#define XINT(a) (((a).i << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
 #else
 #define XINT(a) ((a).s.val)
 #endif /* EXPLICIT_SIGN_EXTEND */
@@ -403,48 +386,72 @@ extern int pure_size;
 
 #endif /* NO_UNION_TYPE */
 
+/* Extract a value or address from a Lisp_Object.  */
 
 #define XCONS(a) ((struct Lisp_Cons *) XPNTR(a))
-#define XBUFFER(a) ((struct buffer *) XPNTR(a))
 #define XVECTOR(a) ((struct Lisp_Vector *) XPNTR(a))
-#define XSUBR(a) ((struct Lisp_Subr *) XPNTR(a))
 #define XSTRING(a) ((struct Lisp_String *) XPNTR(a))
 #define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a))
-#define XMISC(a)   ((union Lisp_Misc *) XPNTR(a))
-#define XWINDOW(a) ((struct window *) XPNTR(a))
-#define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
 #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a))
+
+/* Misc types.  */
+#define XMISC(a)   ((union Lisp_Misc *) XPNTR(a))
+#define XMISCTYPE(a)   (XMARKER (a)->type)
 #define XMARKER(a) (&(XMISC(a)->u_marker))
 #define XINTFWD(a) (&(XMISC(a)->u_intfwd))
 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd))
 #define XOBJFWD(a) (&(XMISC(a)->u_objfwd))
 #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd))
+#define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value))
+#define XOVERLAY(a) (&(XMISC(a)->u_overlay))
+#define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd))
+
+/* Pseudovector types.  */
+#define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
+#define XWINDOW(a) ((struct window *) XPNTR(a))
+#define XSUBR(a) ((struct Lisp_Subr *) XPNTR(a))
+#define XBUFFER(a) ((struct buffer *) XPNTR(a))
+#define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a))
+#define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a))
+
+
+/* Construct a Lisp_Object from a value or address.  */
 
 #define XSETINT(a, b) XSET (a, Lisp_Int, b)
 #define XSETCONS(a, b) XSET (a, Lisp_Cons, b)
-#define XSETBUFFER(a, b) XSET (a, Lisp_Buffer, b)
-#define XSETVECTOR(a, b) XSET (a, Lisp_Vector, b)
-#define XSETSUBR(a, b) XSET (a, Lisp_Subr, b)
+#define XSETVECTOR(a, b) XSET (a, Lisp_Vectorlike, b)
 #define XSETSTRING(a, b) XSET (a, Lisp_String, b)
 #define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b)
-#define XSETMISC(a, b) XSET (a, Lisp_Misc, b)
-#define XSETWINDOW(a, b) XSET (a, Lisp_Window, b)
-#define XSETPROCESS(a, b) XSET (a, Lisp_Process, b)
 #define XSETFLOAT(a, b) XSET (a, Lisp_Float, b)
-#define XSETWINDOW_CONFIGURATION(a, b) XSET (a, Lisp_Window_Configuration, b)
-#define XSETMARKER(a, b) (XSETMISC (a, b), XMISC (a)->type = Lisp_Misc_Marker)
+
+/* Misc types.  */
+#define XSETMISC(a, b) XSET (a, Lisp_Misc, b)
+#define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker)
+
+/* Pseudovector types.  */
+#define XSETPSEUDOVECTOR(a, b, code) \
+  (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code))
+#define XSETWINDOW_CONFIGURATION(a, b) \
+  (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION))
+#define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS))
+#define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW))
+#define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
+#define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
+#define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
+#define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE))
+#define XSETBOOL_VECTOR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BOOL_VECTOR))
 \f
 #ifdef USE_TEXT_PROPERTIES
-/* Basic data type for use of intervals.  See the macros in intervals.h */
+/* Basic data type for use of intervals.  See the macros in intervals.h */
 
 struct interval
 {
-  /* The first group of entries deal with the tree structure. */
+  /* The first group of entries deal with the tree structure.  */
 
-  unsigned int total_length;   /* Length of myself and both children. */
-  unsigned int position;       /* Cache of interval's character position  */
-  struct interval *left;       /* Intervals which precede me. */
-  struct interval *right;      /* Intervals which succeed me. */
+  unsigned int total_length;   /* Length of myself and both children.  */
+  unsigned int position;       /* Cache of interval's character position.  */
+  struct interval *left;       /* Intervals which precede me.  */
+  struct interval *right;      /* Intervals which succeed me.  */
 
   /* Parent in the tree, or the Lisp_Object containing this interval tree.
 
@@ -460,13 +467,13 @@ struct interval
 
   /* The remaining components are `properties' of the interval.
      The first four are duplicates for things which can be on the list,
-     for purposes of speed. */
+     for purposes of speed.  */
 
   unsigned char write_protect;     /* Non-zero means can't modify.  */
-  unsigned char visible;           /* Zero means don't display. */
+  unsigned char visible;           /* Zero means don't display.  */
   unsigned char front_sticky;      /* Non-zero means text inserted just
-                                      before this interval goes into it. */
-  unsigned char rear_sticky;       /* Likewise for just after it. */
+                                      before this interval goes into it.  */
+  unsigned char rear_sticky;       /* Likewise for just after it.  */
 
   /* Properties of this interval.
      The mark bit on this field says whether this particular interval
@@ -483,16 +490,16 @@ typedef struct interval *INTERVAL;
       x = wrong_type_argument (Qbuffer_or_string_p, (x)); }
 
 /* Macro used to conditionally compile intervals into certain data
-   structures.  See, e.g., struct Lisp_String below. */
+   structures.  See, e.g., struct Lisp_String below.  */
 #define DECLARE_INTERVALS INTERVAL intervals;
 
 /* Macro used to conditionally compile interval initialization into
-   certain code.  See, e.g., alloc.c. */
+   certain code.  See, e.g., alloc.c.  */
 #define INITIALIZE_INTERVAL(ptr,val) ptr->intervals = val
 
 #else  /* No text properties */
 
-/* If no intervals are used, make the above definitions go away. */
+/* If no intervals are used, make the above definitions go away.  */
 
 #define CHECK_STRING_OR_BUFFER(x, i)
 
@@ -509,6 +516,21 @@ struct Lisp_Cons
     Lisp_Object car, cdr;
   };
 
+/* Take the car or cdr of something known to be a cons cell.  */
+#define XCAR(c) (XCONS ((c))->car)
+#define XCDR(c) (XCONS ((c))->cdr)
+
+/* Take the car or cdr of something whose type is not known.  */
+#define CAR(c)                                 \
+ (CONSP ((c)) ? XCAR ((c))                     \
+  : NILP ((c)) ? Qnil                          \
+  : wrong_type_argument (Qlistp, (c)))
+
+#define CDR(c)                                 \
+ (CONSP ((c)) ? XCDR ((c))                     \
+  : NILP ((c)) ? Qnil                          \
+  : wrong_type_argument (Qlistp, (c)))
+
 /* Like a cons, but records info on where the text lives that it was read from */
 /* This is not really in use now */
 
@@ -524,10 +546,17 @@ struct Lisp_Buffer_Cons
 struct Lisp_String
   {
     EMACS_INT size;
-    DECLARE_INTERVALS          /* `data' field must be last. */
+    DECLARE_INTERVALS          /* `data' field must be last.  */
     unsigned char data[1];
   };
 
+/* If a struct is made to look like a vector, this macro returns the length
+   of the shortest vector that would hold that struct.  */
+#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector)  \
+                                         - sizeof (Lisp_Object))      \
+                        + sizeof(Lisp_Object) - 1) /* round up */     \
+                      / sizeof (Lisp_Object))
+
 struct Lisp_Vector
   {
     EMACS_INT size;
@@ -535,6 +564,59 @@ struct Lisp_Vector
     Lisp_Object contents[1];
   };
 
+/* A char table is a kind of vectorlike, with contents are like a vector
+   but with a few other slots.  For some purposes, it makes sense
+   to handle a chartable with type struct Lisp_Vector.  */
+
+/* This is the number of slots that apply to characters
+   or character sets.  */
+#define CHAR_TABLE_ORDINARY_SLOTS 256
+
+/* This is the number of slots that every char table must have.
+   This counts the ordinary slots and the parent and defalt slots.  */
+#define CHAR_TABLE_STANDARD_SLOTS (256+3)
+
+/* Return the number of "extra" slots in the char table CT.  */
+
+#define CHAR_TABLE_EXTRA_SLOTS(CT)     \
+  (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS)
+
+struct Lisp_Char_Table
+  {
+    /* This is the vector's size field, which also holds the
+       pseudovector type information.  It holds the size, too.
+       The size counts the defalt and parent slots.  */
+    EMACS_INT size;
+    struct Lisp_Vector *next;
+    Lisp_Object contents[CHAR_TABLE_ORDINARY_SLOTS];
+    /* This holds a default value,
+       which is used whenever the value for a specific character is nil.  */
+    Lisp_Object defalt;
+    /* This points to another char table, which we inherit from
+       when the value for a specific character is nil.
+       The `defalt' slot takes precedence over this.  */
+    Lisp_Object parent;
+    /* This should be a symbol which says what kind of use
+       this char-table is meant for.
+       Typically now the values can be `syntax-table' and `display-table'.  */
+    Lisp_Object purpose;
+    /* These hold additional data.  */
+    Lisp_Object extras[1];
+  };
+
+/* A boolvector is a kind of vectorlike, with contents are like a string.  */
+struct Lisp_Bool_Vector
+  {
+    /* This is the vector's size field.  It doesn't have the real size,
+       just the subtype information.  */
+    EMACS_INT vector_size;
+    struct Lisp_Vector *next;
+    /* This is the size in bits.  */
+    EMACS_INT size;
+    /* This contains the actual bits, packed into bytes.  */
+    unsigned char data[1];
+  };
+
 /* In a symbol, the markbit of the plist is used as the gc mark bit */
 
 struct Lisp_Symbol
@@ -543,11 +625,21 @@ struct Lisp_Symbol
     Lisp_Object value;
     Lisp_Object function;
     Lisp_Object plist;
+    Lisp_Object obarray;
     struct Lisp_Symbol *next;  /* -> next symbol in this obarray bucket */
   };
 
+/* This structure describes a built-in function.
+   It is generated by the DEFUN macro only.
+   defsubr makes it into a Lisp object.
+
+   This type is treated in most respects as a pseudovector,
+   but since we never dynamically allocate or free them,
+   we don't need a next-vector field.  */
+   
 struct Lisp_Subr
   {
+    EMACS_INT size;
     Lisp_Object (*function) ();
     short min_args, max_args;
     char *symbol_name;
@@ -555,21 +647,28 @@ struct Lisp_Subr
     char *doc;
   };
 \f
+/* These structures are used for various misc types.  */
+
 /* A miscellaneous object, when it's on the free list.  */
 struct Lisp_Free
   {
-    enum Lisp_Misc_Type type;  /* = Lisp_Misc_Free */
+    int type : 16;     /* = Lisp_Misc_Free */
+    int spacer : 16;
     union Lisp_Misc *chain;
   };
 
 /* In a marker, the markbit of the chain field is used as the gc mark bit */
 struct Lisp_Marker
-  {
-    enum Lisp_Misc_Type type;  /* = Lisp_Misc_Marker */
-    struct buffer *buffer;
-    Lisp_Object chain;
-    int bufpos;
-  };
+{
+  int type : 16;               /* = Lisp_Misc_Marker */
+  int spacer : 15;
+  /* 1 means normal insertion at the marker's position
+     leaves the marker after the inserted text.  */
+  unsigned int insertion_type : 1;
+  struct buffer *buffer;
+  Lisp_Object chain;
+  int bufpos;
+};
 
 /* Forwarding pointer to an int variable.
    This is allowed only in the value cell of a symbol,
@@ -577,7 +676,8 @@ struct Lisp_Marker
    specified int variable.  */
 struct Lisp_Intfwd
   {
-    enum Lisp_Misc_Type type;  /* = Lisp_Misc_Intfwd */
+    int type : 16;     /* = Lisp_Misc_Intfwd */
+    int spacer : 16;
     int *intvar;
   };
 
@@ -587,7 +687,8 @@ struct Lisp_Intfwd
    nil if it is zero.  */
 struct Lisp_Boolfwd
   {
-    enum Lisp_Misc_Type type;  /* = Lisp_Misc_Boolfwd */
+    int type : 16;     /* = Lisp_Misc_Boolfwd */
+    int spacer : 16;
     int *boolvar;
   };
 
@@ -597,7 +698,8 @@ struct Lisp_Boolfwd
    specified variable.  */
 struct Lisp_Objfwd
   {
-    enum Lisp_Misc_Type type;  /* = Lisp_Misc_Objfwd */
+    int type : 16;     /* = Lisp_Misc_Objfwd */
+    int spacer : 16;
     Lisp_Object *objvar;
   };
 
@@ -605,21 +707,95 @@ struct Lisp_Objfwd
    current buffer.  Value is byte index of slot within buffer.  */
 struct Lisp_Buffer_Objfwd
   {
-    enum Lisp_Misc_Type type;  /* = Lisp_Misc_Buffer_Objfwd */
+    int type : 16;     /* = Lisp_Misc_Buffer_Objfwd */
+    int spacer : 16;
     int offset;
   };
 
+/* Used in a symbol value cell when the symbol's value is per-buffer.
+   The actual contents resemble a cons cell which starts a list like this:
+   (REALVALUE BUFFER CURRENT-ALIST-ELEMENT . DEFAULT-VALUE).
+
+   The cons-like structure is for historical reasons; it might be better
+   to just put these elements into the struct, now.
+
+   BUFFER is the last buffer for which this symbol's value was
+   made up to date.
+
+   CURRENT-ALIST-ELEMENT is a pointer to an element of BUFFER's
+   local_var_alist, that being the element whose car is this
+   variable.  Or it can be a pointer to the
+   (CURRENT-ALIST-ELEMENT . DEFAULT-VALUE),
+   if BUFFER does not have an element in its alist for this
+   variable (that is, if BUFFER sees the default value of this
+   variable).
+
+   If we want to examine or set the value and BUFFER is current,
+   we just examine or set REALVALUE.  If BUFFER is not current, we
+   store the current REALVALUE value into CURRENT-ALIST-ELEMENT,
+   then find the appropriate alist element for the buffer now
+   current and set up CURRENT-ALIST-ELEMENT.  Then we set
+   REALVALUE out of that element, and store into BUFFER.
+
+   If we are setting the variable and the current buffer does not
+   have an alist entry for this variable, an alist entry is
+   created.
+
+   Note that REALVALUE can be a forwarding pointer.  Each time it
+   is examined or set, forwarding must be done.  Each time we
+   switch buffers, buffer-local variables which forward into C
+   variables are swapped immediately, so the C code can assume
+   that they are always up to date.
+
+   Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value
+   use the same substructure.  The difference is that with the latter,
+   merely setting the variable while some buffer is current
+   does not cause that buffer to have its own local value of this variable.
+   Only make-local-variable does that.  */
+struct Lisp_Buffer_Local_Value
+  {
+    int type : 16; /* = Lisp_Misc_Buffer_Local_Value
+                                     or Lisp_Misc_Some_Buffer_Local_Value */
+    int spacer : 16;
+    Lisp_Object car, cdr;
+  };
+
+/* In an overlay object, the mark bit of the plist is used as the GC mark.
+   START and END are markers in the overlay's buffer, and
+   PLIST is the overlay's property list.  */
+struct Lisp_Overlay
+  {
+    int type : 16;     /* = Lisp_Misc_Overlay */
+    int spacer : 16;
+    Lisp_Object start, end, plist;
+  };
+
+/* Like Lisp_Objfwd except that value lives in a slot in the
+   current kboard.  */
+struct Lisp_Kboard_Objfwd
+  {
+    int type : 16;     /* = Lisp_Misc_Kboard_Objfwd */
+    int spacer : 16;
+    int offset;
+  };
+
+
+/* To get the type field of a union Lisp_Misc, use XMISCTYPE.
+   It uses one of these struct subtypes to get the type field.  */
+
 union Lisp_Misc
   {
-    enum Lisp_Misc_Type type;
     struct Lisp_Free u_free;
     struct Lisp_Marker u_marker;
     struct Lisp_Intfwd u_intfwd;
     struct Lisp_Boolfwd u_boolfwd;
     struct Lisp_Objfwd u_objfwd;
     struct Lisp_Buffer_Objfwd u_buffer_objfwd;
+    struct Lisp_Buffer_Local_Value u_buffer_local_value;
+    struct Lisp_Overlay u_overlay;
+    struct Lisp_Kboard_Objfwd u_kboard_objfwd;
   };
-
+\f
 #ifdef LISP_FLOAT_TYPE
 /* Optional Lisp floating point type */
 struct Lisp_Float
@@ -631,7 +807,7 @@ struct Lisp_Float
 #endif /* LISP_FLOAT_TYPE */
 
 /* A character, declared with the following typedef, is a member
-   of some character set associated with the current buffer. */
+   of some character set associated with the current buffer.  */
 #ifndef _UCHAR_T  /* Protect against something in ctab.h on AIX.  */
 #define _UCHAR_T
 typedef unsigned char UCHAR;
@@ -648,14 +824,14 @@ typedef unsigned char UCHAR;
 
 /* Flag bits in a character.  These also get used in termhooks.h.
    Richard Stallman <rms@gnu.ai.mit.edu> thinks that MULE
-   (MUlti-Lingual Emacs) might need 18 bits for the character value
-   itself, so we probably shouldn't use any bits lower than 0x040000.  */
-#define CHAR_ALT   (0x040000)
-#define CHAR_SUPER (0x080000)
-#define CHAR_HYPER (0x100000)
-#define CHAR_SHIFT (0x200000)
-#define CHAR_CTL   (0x400000)
-#define CHAR_META  (0x800000)
+   (MUlti-Lingual Emacs) might need 22 bits for the character value
+   itself, so we probably shouldn't use any bits lower than 0x0400000.  */
+#define CHAR_ALT   (0x0400000)
+#define CHAR_SUPER (0x0800000)
+#define CHAR_HYPER (0x1000000)
+#define CHAR_SHIFT (0x2000000)
+#define CHAR_CTL   (0x4000000)
+#define CHAR_META  (0x8000000)
 
 #ifdef USE_X_TOOLKIT
 #ifdef NO_UNION_TYPE
@@ -730,45 +906,89 @@ typedef unsigned char UCHAR;
 
 #ifdef LISP_FLOAT_TYPE
 #define NUMBERP(x) (INTEGERP (x) || FLOATP (x))
+#define GC_NUMBERP(x) (GC_INTEGERP (x) || GC_FLOATP (x))
 #else
 #define NUMBERP(x) (INTEGERP (x))
+#define GC_NUMBERP(x) (GC_INTEGERP (x))
 #endif
+#define NATNUMP(x) (INTEGERP (x) && XINT (x) >= 0)
+#define GC_NATNUMP(x) (GC_INTEGERP (x) && XINT (x) >= 0)
 
 #define INTEGERP(x) (XTYPE ((x)) == Lisp_Int)
+#define GC_INTEGERP(x) (XGCTYPE ((x)) == Lisp_Int)
 #define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol)
+#define GC_SYMBOLP(x) (XGCTYPE ((x)) == Lisp_Symbol)
 #define MISCP(x) (XTYPE ((x)) == Lisp_Misc)
+#define GC_MISCP(x) (XGCTYPE ((x)) == Lisp_Misc)
+#define VECTORLIKEP(x) (XTYPE ((x)) == Lisp_Vectorlike)
+#define GC_VECTORLIKEP(x) (XGCTYPE ((x)) == Lisp_Vectorlike)
 #define STRINGP(x) (XTYPE ((x)) == Lisp_String)
-#define VECTORP(x) (XTYPE ((x)) == Lisp_Vector)
+#define GC_STRINGP(x) (XGCTYPE ((x)) == Lisp_String)
 #define CONSP(x) (XTYPE ((x)) == Lisp_Cons)
-#define COMPILEDP(x) (XTYPE ((x)) == Lisp_Compiled)
-#define BUFFERP(x) (XTYPE ((x)) == Lisp_Buffer)
-#define SUBRP(x) (XTYPE ((x)) == Lisp_Subr)
-#define PROCESSP(x) (XTYPE ((x)) == Lisp_Process)
-#ifdef MULTI_FRAME
-#define FRAMEP(x) (XTYPE ((x)) == Lisp_Frame)
-#else
-#ifdef HAVE_MOUSE
-/* We could use this in the !HAVE_MOUSE case also, but we prefer a compile-time
-   error message in case FRAMEP is used.  */
-#define FRAMEP(x) (EQ (x, Fselected_frame ()))
-#endif
-#endif
-#define WINDOWP(x) (XTYPE ((x)) == Lisp_Window)
-#define WINDOW_CONFIGURATIONP(x) (XTYPE ((x)) == Lisp_Window_Configuration)
+#define GC_CONSP(x) (XGCTYPE ((x)) == Lisp_Cons)
+
 #ifdef LISP_FLOAT_TYPE
 #define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
+#define GC_FLOATP(x) (XGCTYPE ((x)) == Lisp_Float)
 #else
 #define FLOATP(x) (0)
+#define GC_FLOATP(x) (0)
 #endif
-#define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay)
-#define BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Buffer_Local_Value)
-#define SOME_BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Some_Buffer_Local_Value)
-#define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker)
-#define INTFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd)
-#define BOOLFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd)
-#define OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd)
-#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd)
-
+#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
+#define GC_VECTORP(x) (GC_VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
+#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
+#define GC_OVERLAYP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
+#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
+#define GC_MARKERP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
+#define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
+#define GC_INTFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
+#define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
+#define GC_BOOLFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
+#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
+#define GC_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
+#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
+#define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
+#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
+#define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
+#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
+#define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
+#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
+#define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
+
+
+/* True if object X is a pseudovector whose code is CODE.  */
+#define PSEUDOVECTORP(x, code)                                 \
+  (VECTORLIKEP (x)                                             \
+   && (((XVECTOR (x)->size & (PSEUDOVECTOR_FLAG | (code))))    \
+       == (PSEUDOVECTOR_FLAG | (code))))
+
+/* True if object X is a pseudovector whose code is CODE.
+   This one works during GC.  */
+#define GC_PSEUDOVECTORP(x, code)                              \
+  (GC_VECTORLIKEP (x)                                          \
+   && (((XVECTOR (x)->size & (PSEUDOVECTOR_FLAG | (code))))    \
+       == (PSEUDOVECTOR_FLAG | (code))))
+
+/* Test for specific pseudovector types.  */
+#define WINDOW_CONFIGURATIONP(x) PSEUDOVECTORP (x, PVEC_WINDOW_CONFIGURATION)
+#define GC_WINDOW_CONFIGURATIONP(x) GC_PSEUDOVECTORP (x, PVEC_WINDOW_CONFIGURATION)
+#define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS)
+#define GC_PROCESSP(x) GC_PSEUDOVECTORP (x, PVEC_PROCESS)
+#define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW)
+#define GC_WINDOWP(x) GC_PSEUDOVECTORP (x, PVEC_WINDOW)
+#define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR)
+#define GC_SUBRP(x) GC_PSEUDOVECTORP (x, PVEC_SUBR)
+#define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED)
+#define GC_COMPILEDP(x) GC_PSEUDOVECTORP (x, PVEC_COMPILED)
+#define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER)
+#define GC_BUFFERP(x) GC_PSEUDOVECTORP (x, PVEC_BUFFER)
+#define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
+#define GC_CHAR_TABLE_P(x) GC_PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
+#define BOOL_VECTOR_P(x) PSEUDOVECTORP (x, PVEC_BOOL_VECTOR)
+#define GC_BOOL_VECTOR_P(x) GC_PSEUDOVECTORP (x, PVEC_BOOL_VECTOR)
+#define FRAMEP(x) PSEUDOVECTORP (x, PVEC_FRAME)
+#define GC_FRAMEP(x) GC_PSEUDOVECTORP (x, PVEC_FRAME)
+\f
 #define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
 #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))
 
@@ -784,9 +1004,18 @@ typedef unsigned char UCHAR;
 #define CHECK_SYMBOL(x, i) \
   do { if (!SYMBOLP ((x))) x = wrong_type_argument (Qsymbolp, (x)); } while (0)
 
+#define CHECK_CHAR_TABLE(x, i) \
+  do { if (!CHAR_TABLE_P ((x)))        \
+        x = wrong_type_argument (Qchar_table_p, (x)); } while (0)
+
 #define CHECK_VECTOR(x, i) \
   do { if (!VECTORP ((x))) x = wrong_type_argument (Qvectorp, (x)); } while (0)
 
+#define CHECK_VECTOR_OR_CHAR_TABLE(x, i)                               \
+  do { if (!VECTORP ((x)) && !CHAR_TABLE_P ((x)))                      \
+        x = wrong_type_argument (Qvector_or_char_table_p, (x));        \
+     } while (0)
+
 #define CHECK_BUFFER(x, i) \
   do { if (!BUFFERP ((x))) x = wrong_type_argument (Qbufferp, (x)); } while (0)
 
@@ -814,8 +1043,7 @@ typedef unsigned char UCHAR;
   do { if (!INTEGERP ((x))) x = wrong_type_argument (Qintegerp, (x)); } while (0)
 
 #define CHECK_NATNUM(x, i) \
-  do { if (!INTEGERP ((x)) || XINT ((x)) < 0)  \
-      x = wrong_type_argument (Qwholenump, (x)); } while (0)
+  do { if (!NATNUMP (x)) x = wrong_type_argument (Qwholenump, (x)); } while (0)
 
 #define CHECK_MARKER(x, i) \
   do { if (!MARKERP ((x))) x = wrong_type_argument (Qmarkerp, (x)); } while (0)
@@ -880,48 +1108,31 @@ typedef unsigned char UCHAR;
         which contains the argument values.
     UNEVALLED means pass the list of unevaluated arguments
  `prompt' says how to read arguments for an interactive call.
-    This can be zero or a C string.
-    Zero means that interactive calls are not allowed.
-    A string is interpreted in a hairy way:
-     it should contain one line for each argument to be read, terminated by \n.
-     The first character of the line controls the type of parsing:
-       s  --  read a string.
-       S  --  read a symbol.
-       k  --  read a key sequence and return it as a string.
-       a  --  read a function name (symbol) with completion.
-       C  --  read a command name (symbol) with completion.
-       v  --  read a variable name (symbol) with completion.
-       b  --  read a buffer name (a string) with completion.
-       B  --  buffer name, may be existing buffer or may not be.
-       f  --  read a file name, file must exist.
-       F  --  read a file name, file need not exist.
-       n  --  read a number.
-       c  --  read a character and return it as a number.
-       p  --  use the numeric value of the prefix argument.
-       P  --  use raw value of prefix - can be nil, -, (NUMBER) or NUMBER.
-       x  --  read a Lisp object from the minibuffer.
-       X  --  read a Lisp form from the minibuffer and use its value.
+    See the doc string for `interactive'.
     A null string means call interactively with no arguments.
- `doc' is documentation for the user.
-*/
+ `doc' is documentation for the user.  */
 
 #if !defined (__STDC__) || defined (USE_NONANSI_DEFUN)
-#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
-  Lisp_Object fnname (); \
-  struct Lisp_Subr sname = {fnname, minargs, maxargs, lname, prompt, 0}; \
+#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc)     \
+  Lisp_Object fnname ();                                               \
+  struct Lisp_Subr sname =                                             \
+    { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),    \
+      fnname, minargs, maxargs, lname, prompt, 0};                     \
   Lisp_Object fnname
 
 #else
 
 /* This version of DEFUN declares a function prototype with the right
-   arguments, so we can catch errors with maxargs at compile-time. */
-#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \
-  Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
-  struct Lisp_Subr sname = {fnname, minargs, maxargs, lname, prompt, 0}; \
+   arguments, so we can catch errors with maxargs at compile-time.  */
+#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc)     \
+  Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                          \
+  struct Lisp_Subr sname =                                             \
+    { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),    \
+      fnname, minargs, maxargs, lname, prompt, 0};                     \
   Lisp_Object fnname
 
 /* Note that the weird token-substitution semantics of ANSI C makes
-   this work for MANY and UNEVALLED. */
+   this work for MANY and UNEVALLED.  */
 #define DEFUN_ARGS_MANY                (int, Lisp_Object *)
 #define DEFUN_ARGS_UNEVALLED   (Lisp_Object)
 #define DEFUN_ARGS_0   (void)
@@ -938,7 +1149,7 @@ typedef unsigned char UCHAR;
 #endif
 
 /* defsubr (Sname);
- is how we define the symbol for function `name' at start-up time. */
+ is how we define the symbol for function `name' at start-up time.  */
 extern void defsubr ();
 
 #define MANY -2
@@ -947,6 +1158,7 @@ extern void defsubr ();
 extern void defvar_lisp ();
 extern void defvar_bool ();
 extern void defvar_int ();
+extern void defvar_kboard ();
 
 /* Macros we use to define forwarded Lisp variables.
    These are used in the syms_of_FILENAME functions.  */
@@ -957,6 +1169,10 @@ extern void defvar_int ();
 #define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname)
 #define DEFVAR_PER_BUFFER(lname, vname, type, doc)  \
  defvar_per_buffer (lname, vname, type, 0)
+#define DEFVAR_KBOARD(lname, vname, doc) \
+ defvar_kboard (lname, \
+               (int)((char *)(&current_kboard->vname) \
+                     - (char *)current_kboard))
 \f
 /* Structure for recording Lisp call stack for backtrace purposes.  */
 
@@ -1011,7 +1227,7 @@ extern Lisp_Object memory_signal_data;
    Tells GC how to save a copy of the stack.  */
 extern char *stack_bottom;
 
-/* Check quit-flag and quit if it is non-nil. */
+/* Check quit-flag and quit if it is non-nil.  */
 
 #define QUIT \
   if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
@@ -1024,52 +1240,49 @@ extern char *stack_bottom;
 /* 1 if CH is upper case.  */
 
 #define UPPERCASEP(CH) \
-  (XSTRING (current_buffer->downcase_table)->data[CH] != (CH))
+  (XCHAR_TABLE (current_buffer->downcase_table)->contents[CH] != (CH))
 
 /* 1 if CH is lower case.  */
 
 #define LOWERCASEP(CH) \
   (!UPPERCASEP (CH) \
-   && XSTRING (current_buffer->upcase_table)->data[CH] != (CH))
+   && XCHAR_TABLE (current_buffer->upcase_table)->contents[CH] != (CH))
 
 /* 1 if CH is neither upper nor lower case.  */
 
-#define NOCASEP(CH) (XSTRING (current_buffer->upcase_table)->data[CH] == (CH))
+#define NOCASEP(CH) \
+  (XCHAR_TABLE (current_buffer->upcase_table)->contents[CH] == (CH))
 
 /* Upcase a character, or make no change if that cannot be done.  */
 
 #define UPCASE(CH) \
-  (XSTRING (current_buffer->downcase_table)->data[CH] == (CH) \
+  (XCHAR_TABLE (current_buffer->downcase_table)->contents[CH] == (CH) \
    ? UPCASE1 (CH) : (CH))
 
 /* Upcase a character known to be not upper case.  */
 
-#define UPCASE1(CH) (XSTRING (current_buffer->upcase_table)->data[CH])
+#define UPCASE1(CH) (XCHAR_TABLE (current_buffer->upcase_table)->contents[CH])
 
-/* Downcase a character, or make no change if that cannot be done. */
+/* Downcase a character, or make no change if that cannot be done.  */
 
-#define DOWNCASE(CH) (XSTRING (current_buffer->downcase_table)->data[CH])
+#define DOWNCASE(CH) \
+  (XCHAR_TABLE (current_buffer->downcase_table)->contents[CH])
 
 /* Current buffer's map from characters to lower-case characters.  */
 
-#define DOWNCASE_TABLE XSTRING (current_buffer->downcase_table)->data
-
-/* Table mapping each char to the next char with the same lowercase version.
-   This mapping is a no-op only for characters that don't have case.  */
-#define UPCASE_TABLE XSTRING (current_buffer->upcase_table)->data
+#define DOWNCASE_TABLE XCHAR_TABLE (current_buffer->downcase_table)->contents
 
-extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
-extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
+extern Lisp_Object Vascii_downcase_table;
 \f
-/* number of bytes of structure consed since last GC */
+/* Number of bytes of structure consed since last GC.  */
 
 extern int consing_since_gc;
 
-/* threshold for doing another gc */
+/* Threshold for doing another gc.  */
 
 extern int gc_cons_threshold;
 
-/* Structure for recording stack slots that need marking */
+/* Structure for recording stack slots that need marking */
 
 /* This is a chain of structures, each of which points at a Lisp_Object variable
  whose value should be marked in garbage collection.
@@ -1080,7 +1293,7 @@ extern int gc_cons_threshold;
  link disappears.
 
  Every function that can call Feval must protect in this fashion all
- Lisp_Object variables whose contents will be used again. */
+ Lisp_Object variables whose contents will be used again.  */
 
 extern struct gcpro *gcprolist;
 
@@ -1121,7 +1334,7 @@ struct gcpro
   gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
   gcprolist = &gcpro5; }
 
-/* Call staticpro (&var) to protect static variable `var'. */
+/* Call staticpro (&var) to protect static variable `var'.  */
 
 void staticpro();
   
@@ -1157,6 +1370,7 @@ extern Lisp_Object Qsymbolp, Qlistp, Qconsp;
 extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
 extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qvectorp;
 extern Lisp_Object Qinteger_or_marker_p, Qnumber_or_marker_p;
+extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
 extern Lisp_Object Qboundp, Qfboundp;
 extern Lisp_Object Qbuffer_or_string_p;
 extern Lisp_Object Qcdr;
@@ -1185,8 +1399,9 @@ extern Lisp_Object indirect_function (), Findirect_function ();
 extern Lisp_Object Ffset (), Fsetplist ();
 extern Lisp_Object Fsymbol_value (), find_symbol_value (), Fset ();
 extern Lisp_Object Fdefault_value (), Fset_default (), Fdefault_boundp ();
+extern Lisp_Object Fmake_local_variable ();
 
-extern Lisp_Object Faref (), Faset (), Farray_length ();
+extern Lisp_Object Faref (), Faset ();
 
 extern Lisp_Object Fstring_to_number (), Fnumber_to_string ();
 extern Lisp_Object Feqlsign (), Fgtr (), Flss (), Fgeq (), Fleq ();
@@ -1198,12 +1413,13 @@ extern Lisp_Object Flsh (), Fash ();
 
 extern Lisp_Object Fadd1 (), Fsub1 ();
 
-extern Lisp_Object make_number ();
 extern Lisp_Object   long_to_cons ();
 extern unsigned long cons_to_long ();
 extern void args_out_of_range ();
 extern void args_out_of_range_3 ();
 extern Lisp_Object wrong_type_argument ();
+extern void store_symval_forwarding ();
+extern Lisp_Object do_symval_forwarding ();
 #ifdef LISP_FLOAT_TYPE
 extern Lisp_Object Ffloat_to_int(), Fint_to_float();
 extern double extract_float();
@@ -1211,15 +1427,21 @@ extern Lisp_Object make_float ();
 extern Lisp_Object Ffloat ();
 #endif /* LISP_FLOAT_TYPE */
 
+/* Defined in cmds.c */
+extern Lisp_Object Fend_of_line (), Fforward_char (), Fforward_line ();
+
+/* Defined in syntax.c */
+extern Lisp_Object Fforward_word ();
+
 /* Defined in fns.c */
 extern Lisp_Object Qstring_lessp;
 extern Lisp_Object Vfeatures;
 extern Lisp_Object Fidentity (), Frandom ();
-extern Lisp_Object Flength ();
+extern Lisp_Object Flength (), Fsafe_length ();
 extern Lisp_Object Fappend (), Fconcat (), Fvconcat (), Fcopy_sequence ();
 extern Lisp_Object Fsubstring ();
 extern Lisp_Object Fnth (), Fnthcdr (), Fmemq (), Fassq (), Fassoc ();
-extern Lisp_Object Fmember (), Frassq (), Fdelq (), Fsort ();
+extern Lisp_Object Felt (), Fmember (), Frassq (), Fdelq (), Fsort ();
 extern Lisp_Object Freverse (), Fnreverse (), Fget (), Fput (), Fequal ();
 extern Lisp_Object Ffillarray (), Fnconc (), Fmapcar (), Fmapconcat ();
 extern Lisp_Object Fy_or_n_p (), do_yes_or_no_p ();
@@ -1227,6 +1449,43 @@ extern Lisp_Object Ffeaturep (), Frequire () , Fprovide ();
 extern Lisp_Object concat2 (), nconc2 ();
 extern Lisp_Object assq_no_quit ();
 extern Lisp_Object Fcopy_alist ();
+extern Lisp_Object Fplist_get ();
+extern Lisp_Object Fset_char_table_parent ();
+
+/* Defined in insdel.c */
+extern void move_gap ();
+extern void make_gap ();
+extern void insert ();
+extern void insert_and_inherit ();
+extern void insert_1 ();
+extern void insert_from_string ();
+extern void insert_from_buffer ();
+extern void insert_char ();
+extern void insert_string ();
+extern void insert_before_markers ();
+extern void insert_before_markers_and_inherit ();
+extern void insert_from_string_before_markers ();
+extern void del_range ();
+extern void del_range_1 ();
+extern void modify_region ();
+extern void prepare_to_modify_buffer ();
+extern void signal_before_change ();
+extern void signal_after_change ();
+
+/* Defined in dispnew.c */
+extern Lisp_Object Fding (), Fredraw_display ();
+extern Lisp_Object Fsleep_for ();
+
+/* Defined in xdisp.c */
+extern Lisp_Object Vmessage_log_max;
+extern void message ();
+extern void message_nolog ();
+extern void message1 ();
+extern void message1_nolog ();
+extern void message2 ();
+extern void message2_nolog ();
+extern void message_dolog ();
+extern void message_log_maybe_newline ();
 
 /* Defined in alloc.c */
 extern Lisp_Object Vpurify_flag;
@@ -1238,12 +1497,16 @@ extern Lisp_Object Fpurecopy (), make_pure_string ();
 extern Lisp_Object pure_cons (), make_pure_vector ();
 extern Lisp_Object Fgarbage_collect ();
 extern Lisp_Object Fmake_byte_code ();
+extern Lisp_Object Fmake_bool_vector (), Fmake_char_table ();
+extern Lisp_Object Qchar_table_extra_slots;
+extern struct Lisp_Vector *allocate_vectorlike ();
 extern int gc_in_progress;
 
 /* Defined in print.c */
 extern Lisp_Object Vprin1_to_string_buffer;
 extern Lisp_Object Fprin1 (), Fprin1_to_string (), Fprinc ();
 extern Lisp_Object Fterpri (), Fprint ();
+extern Lisp_Object Ferror_message_string ();
 extern Lisp_Object Vstandard_output, Qstandard_output;
 extern Lisp_Object Qexternal_debugging_output;
 extern void temp_output_buffer_setup (), temp_output_buffer_show ();
@@ -1270,10 +1533,17 @@ extern Lisp_Object Vinhibit_quit, Qinhibit_quit, Vquit_flag;
 extern Lisp_Object Vmocklisp_arguments, Qmocklisp, Qmocklisp_arguments;
 extern Lisp_Object Vautoload_queue;
 extern Lisp_Object Vdebug_on_error;
-/* To run a normal hook, do
+/* To run a normal hook, use the appropriate function from the list below.
+   The calling convention:
+
    if (!NILP (Vrun_hooks))
-     call1 (Vrun_hooks, Qmy_funny_hook);  */
+     call1 (Vrun_hooks, Qmy_funny_hook);
+
+   should no longer be used.  */
 extern Lisp_Object Vrun_hooks;
+extern Lisp_Object Frun_hooks (), Frun_hook_with_args ();
+extern Lisp_Object Frun_hook_with_args_until_success ();
+extern Lisp_Object Frun_hook_with_args_until_failure ();
 extern Lisp_Object Fand (), For (), Fif (), Fprogn (), Fprog1 (), Fprog2 ();
 extern Lisp_Object Fsetq (), Fquote ();
 extern Lisp_Object Fuser_variable_p (), Finteractive_p ();
@@ -1294,6 +1564,7 @@ extern Lisp_Object internal_condition_case_1 ();
 extern Lisp_Object unbind_to ();
 extern void error ();
 extern Lisp_Object un_autoload ();
+extern Lisp_Object Ffetch_bytecode ();
 
 /* Defined in editfns.c */
 extern Lisp_Object Fgoto_char ();
@@ -1301,7 +1572,10 @@ extern Lisp_Object Fpoint_min_marker (), Fpoint_max_marker ();
 extern Lisp_Object Fpoint_min (), Fpoint_max ();
 extern Lisp_Object Fpoint (), Fpoint_marker (), Fmark_marker ();
 extern Lisp_Object Ffollowing_char (), Fprevious_char (), Fchar_after ();
-extern Lisp_Object Finsert ();
+extern Lisp_Object Finsert (), Finsert_and_inherit ();
+extern Lisp_Object Finsert_before_markers ();
+extern Lisp_Object Finsert_buffer_substring ();
+extern Lisp_Object Finsert_char ();
 extern Lisp_Object Feolp (), Feobp (), Fbolp (), Fbobp ();
 extern Lisp_Object Fformat (), format1 ();
 extern Lisp_Object make_buffer_string (), Fbuffer_substring ();
@@ -1310,14 +1584,24 @@ extern Lisp_Object Fstring_equal (), Fstring_lessp (), Fbuffer_substring_lessp (
 extern Lisp_Object save_excursion_save (), save_restriction_save ();
 extern Lisp_Object save_excursion_restore (), save_restriction_restore ();
 extern Lisp_Object Fchar_to_string ();
+extern Lisp_Object Fdelete_region (), Fnarrow_to_region (), Fwiden ();
 
 /* defined in buffer.c */
+extern Lisp_Object Foverlay_start (), Foverlay_end ();
+extern void adjust_overlays_for_insert ();
+extern void adjust_overlays_for_delete ();
+extern void fix_overlays_in_range ();
+extern int overlay_touches_p ();
 extern Lisp_Object Vbuffer_alist, Vinhibit_read_only;
 extern Lisp_Object Fget_buffer (), Fget_buffer_create (), Fset_buffer ();
 extern Lisp_Object Fbarf_if_buffer_read_only ();
 extern Lisp_Object Fcurrent_buffer (), Fswitch_to_buffer (), Fpop_to_buffer ();
 extern Lisp_Object Fother_buffer ();
 extern Lisp_Object Foverlay_get ();
+extern Lisp_Object Fbuffer_modified_p (), Fset_buffer_modified_p ();
+extern Lisp_Object Fkill_buffer (), Fkill_all_local_variables ();
+extern Lisp_Object Fbuffer_disable_undo (), Fbuffer_enable_undo ();
+extern Lisp_Object Ferase_buffer ();
 extern Lisp_Object Qoverlayp;
 extern struct buffer *all_buffers;
 
@@ -1336,11 +1620,14 @@ extern Lisp_Object Fsubstitute_in_file_name ();
 extern Lisp_Object Ffile_symlink_p ();
 extern Lisp_Object Fverify_visited_file_modtime ();
 extern Lisp_Object Ffile_exists_p ();
+extern Lisp_Object Ffile_name_absolute_p ();
 extern Lisp_Object Fdirectory_file_name ();
 extern Lisp_Object Ffile_name_directory ();
 extern Lisp_Object expand_and_dir_to_file ();
 extern Lisp_Object Ffile_accessible_directory_p ();
 extern Lisp_Object Funhandled_file_name_directory ();
+extern Lisp_Object Ffile_directory_p ();
+extern Lisp_Object Fwrite_region ();
 
 /* Defined in abbrev.c */
 
@@ -1349,6 +1636,10 @@ extern Lisp_Object Vfundamental_mode_abbrev_table;
 /* defined in search.c */
 extern Lisp_Object Fstring_match ();
 extern Lisp_Object Fscan_buffer ();
+extern void restore_match_data ();
+extern Lisp_Object Fmatch_data (), Fstore_match_data ();
+extern Lisp_Object Fmatch_beginning (), Fmatch_end ();
+extern Lisp_Object Fskip_chars_forward (), Fskip_chars_backward ();
 
 /* defined in minibuf.c */
 
@@ -1359,18 +1650,26 @@ extern Lisp_Object Fread_variable (), Fread_buffer (), Fread_key_sequence ();
 extern Lisp_Object Fread_minibuffer (), Feval_minibuffer ();
 extern Lisp_Object Fread_string (), Fread_file_name ();
 extern Lisp_Object Fread_no_blanks_input ();
+extern Lisp_Object get_minibuffer ();
 
 /* Defined in callint.c */
 
-extern Lisp_Object Vprefix_arg, Qminus, Qplus, Vcurrent_prefix_arg;
+extern Lisp_Object Qminus, Qplus, Vcurrent_prefix_arg;
 extern Lisp_Object Vcommand_history;
-extern Lisp_Object Qcall_interactively;
+extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook;
 extern Lisp_Object Fcall_interactively ();
 extern Lisp_Object Fprefix_numeric_value ();
 
 /* defined in casefiddle.c */
 
 extern Lisp_Object Fdowncase (), Fupcase (), Fcapitalize ();
+extern Lisp_Object Fupcase_region ();
+extern Lisp_Object Fupcase_initials (), Fupcase_initials_region ();
+
+/* defined in casetab.c */
+
+extern Lisp_Object Fset_case_table ();
+extern Lisp_Object Fset_standard_case_table ();
 
 /* defined in keyboard.c */
 
@@ -1378,38 +1677,53 @@ extern Lisp_Object Qdisabled;
 extern Lisp_Object Vhelp_form, Vtop_level;
 extern Lisp_Object Fdiscard_input (), Frecursive_edit ();
 extern Lisp_Object Fcommand_execute (), Finput_pending_p ();
+extern Lisp_Object menu_bar_items ();
 extern Lisp_Object Qvertical_scroll_bar;
+extern Lisp_Object Fevent_convert_list ();
+#ifdef MULTI_KBOARD
+extern void delete_kboard ();
+#endif
 
 /* defined in keymap.c */
 
 extern Lisp_Object Qkeymap, Qmenu_bar;
 extern Lisp_Object current_global_map;
+extern Lisp_Object Fdefine_key ();
 extern Lisp_Object Fkey_description (), Fsingle_key_description ();
 extern Lisp_Object Fwhere_is_internal ();
 extern Lisp_Object access_keymap (), store_in_keymap ();
-extern Lisp_Object get_keyelt (), get_keymap();
+extern Lisp_Object get_keyelt (), get_keymap (), get_keymap_1 ();
+extern void describe_map_tree ();
 
 /* defined in indent.c */
 extern Lisp_Object Fvertical_motion (), Findent_to (), Fcurrent_column ();
 
 /* defined in window.c */
 extern Lisp_Object Qwindowp, Qwindow_live_p;
+extern Lisp_Object Fselected_window ();
 extern Lisp_Object Fget_buffer_window ();
 extern Lisp_Object Fsave_window_excursion ();
 extern Lisp_Object Fset_window_configuration (), Fcurrent_window_configuration ();
 extern Lisp_Object Fcoordinates_in_window_p ();
 extern Lisp_Object Fwindow_at ();
+extern Lisp_Object Fpos_visible_in_window_p ();
 extern int window_internal_height (), window_internal_width ();
+extern Lisp_Object Frecenter ();
+extern Lisp_Object Fscroll_other_window ();
+extern Lisp_Object Fset_window_start ();
 
 /* defined in frame.c */
 extern Lisp_Object Qvisible;
+extern void store_frame_param (), store_in_alist ();
+extern Lisp_Object do_switch_frame ();
+extern Lisp_Object get_frame_param();
+extern Lisp_Object frame_buffer_predicate ();
 extern Lisp_Object Fframep ();
 extern Lisp_Object Fselect_frame ();
-extern Lisp_Object Ffocus_frame ();
-extern Lisp_Object Funfocus_frame ();
 extern Lisp_Object Fselected_frame ();
 extern Lisp_Object Fwindow_frame ();
 extern Lisp_Object Fframe_root_window ();
+extern Lisp_Object Fframe_first_window ();
 extern Lisp_Object Fframe_selected_window ();
 extern Lisp_Object Fframe_list ();
 extern Lisp_Object Fnext_frame ();
@@ -1431,9 +1745,8 @@ extern Lisp_Object Fset_frame_height ();
 extern Lisp_Object Fset_frame_width ();
 extern Lisp_Object Fset_frame_size ();
 extern Lisp_Object Fset_frame_position ();
-#ifndef HAVE_X11
-extern Lisp_Object Frubber_band_rectangle ();
-#endif /* HAVE_X11 */
+extern Lisp_Object Fraise_frame ();
+extern Lisp_Object Fredirect_frame_focus ();
 
 /* defined in emacs.c */
 extern Lisp_Object decode_env_path ();
@@ -1444,11 +1757,15 @@ void shut_down_emacs ( /* int signal, int no_x, Lisp_Object stuff */ );
 extern int noninteractive;
 /* Nonzero means don't do use window-system-specific display code */
 extern int inhibit_window_system;
+/* Nonzero means that a filter or a sentinel is running.  */
+extern int running_asynch_code;
 
 /* defined in process.c */
 extern Lisp_Object Fget_process (), Fget_buffer_process (), Fprocessp ();
 extern Lisp_Object Fprocess_status (), Fkill_process ();
 extern Lisp_Object Fprocess_send_eof ();
+extern Lisp_Object Fwaiting_for_user_input_p ();
+extern Lisp_Object Qprocessp;
 
 /* defined in callproc.c */
 extern Lisp_Object Vexec_path, Vexec_directory, Vdata_directory;
@@ -1458,6 +1775,7 @@ extern Lisp_Object Vdoc_directory;
 extern Lisp_Object Vdoc_file_name;
 extern Lisp_Object Fsubstitute_command_keys ();
 extern Lisp_Object Fdocumentation (), Fdocumentation_property ();
+extern Lisp_Object read_doc_string ();
 
 /* defined in bytecode.c */
 extern Lisp_Object Qbytecode;
@@ -1468,15 +1786,27 @@ extern Lisp_Object Qexecute_kbd_macro;
 extern Lisp_Object Fexecute_kbd_macro ();
 
 /* defined in undo.c */
+extern Lisp_Object Qinhibit_read_only;
 extern Lisp_Object Fundo_boundary ();
 extern Lisp_Object truncate_undo_list ();
 
 /* defined in textprop.c */
 extern Lisp_Object Qmodification_hooks;
+extern Lisp_Object Qrear_nonsticky, Qfont;
 extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks;
 extern Lisp_Object Fnext_property_change ();
 extern Lisp_Object Fnext_single_property_change ();
+extern Lisp_Object Fprevious_single_property_change ();
+extern Lisp_Object Fget_text_property (), Fput_text_property ();
+extern Lisp_Object Fset_text_properties ();
+extern Lisp_Object Ftext_property_not_all ();
 
+/* defined in intervals.c */
+extern Lisp_Object get_local_map ();
+
+/* defined in xmenu.c */
+extern Lisp_Object Fx_popup_menu (), Fx_popup_dialog ();
+\f
 /* Nonzero means Emacs has already been initialized.
    Used during startup to detect startup of dumped Emacs.  */
 extern int initialized;
@@ -1498,6 +1828,10 @@ extern void init_system_name ();
    in addition to a device separator.  Default the path separator
    to '/', and don't test for a device separator in IS_ANY_SEP.  */
 
+#ifdef WINDOWSNT
+extern Lisp_Object Vdirectory_sep_char;
+#endif
+
 #ifndef DIRECTORY_SEP
 #define DIRECTORY_SEP '/'
 #endif
@@ -1514,3 +1848,9 @@ extern void init_system_name ();
 #ifndef IS_ANY_SEP
 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
 #endif
+
+#ifdef SWITCH_ENUM_BUG
+#define SWITCH_ENUM_CAST(x) ((int)(x))
+#else
+#define SWITCH_ENUM_CAST(x) (x)
+#endif