Trailing whitespace deleted.
[bpt/emacs.git] / src / lisp.h
index 4b73c01..ca4811e 100644 (file)
@@ -1,5 +1,5 @@
 /* Fundamental definitions for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985,86,87,93,94,95,97,98,1999,2000, 2001
+   Copyright (C) 1985,86,87,93,94,95,97,98,1999,2000, 2001, 2002
      Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -146,6 +146,7 @@ enum Lisp_Misc_Type
     Lisp_Misc_Some_Buffer_Local_Value,
     Lisp_Misc_Overlay,
     Lisp_Misc_Kboard_Objfwd,
+    Lisp_Misc_Save_Value,
     /* Currently floats are not a misc type,
        but let's define this in case we want to change that.  */
     Lisp_Misc_Float,
@@ -235,7 +236,11 @@ LISP_MAKE_RVALUE (Lisp_Object o)
     return o;
 }
 #else
-#define LISP_MAKE_RVALUE(o) (o) /* XXX - keeps arg as rvalue.  */
+/* This isn't quite right - it keeps the argument as an lvalue.
+   Making it const via casting would help avoid code actually
+   modifying the location in question, but the casting could cover
+   other type-related bugs.  */
+#define LISP_MAKE_RVALUE(o) (o)
 #endif
 
 #endif /* NO_UNION_TYPE */
@@ -299,7 +304,7 @@ enum pvec_type
   PVEC_BUFFER = 0x20000,
   PVEC_HASH_TABLE = 0x40000,
   PVEC_TYPE_MASK = 0x7fe00
-  
+
 #if 0 /* This is used to make the value of PSEUDOVECTOR_FLAG available to
         GDB.  It doesn't work on OS Alpha.  Moved to a variable in
         emacs.c.  */
@@ -348,26 +353,6 @@ enum pvec_type
 #define XUINT(a) ((EMACS_UINT) ((a) & VALMASK))
 #endif
 
-#ifndef XPNTR
-#ifdef HAVE_SHM
-/* In this representation, data is found in two widely separated segments.  */
-extern size_t pure_size;
-#define XPNTR(a) \
-  (XUINT (a) | (XUINT (a) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS))
-#else /* not HAVE_SHM */
-#ifdef DATA_SEG_BITS
-/* This case is used for the rt-pc.
-   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(a) (XUINT (a) | DATA_SEG_BITS)
-#else
-#define XPNTR(a) XUINT (a)
-#endif
-#endif /* not HAVE_SHM */
-#endif /* no XPNTR */
-
 #ifndef XSET
 #define XSET(var, type, ptr) \
    ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK))
@@ -433,7 +418,6 @@ extern size_t pure_size;
 #endif /* EXPLICIT_SIGN_EXTEND */
 
 #define XUINT(a) ((a).u.val)
-#define XPNTR(a) ((a).u.val)
 
 #define XSET(var, vartype, ptr) \
    (((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype))))
@@ -459,6 +443,26 @@ extern Lisp_Object make_number ();
 
 #endif /* NO_UNION_TYPE */
 
+#ifndef XPNTR
+#ifdef HAVE_SHM
+/* In this representation, data is found in two widely separated segments.  */
+extern size_t pure_size;
+#define XPNTR(a) \
+  (XUINT (a) | (XUINT (a) > pure_size ? DATA_SEG_BITS : PURE_SEG_BITS))
+#else /* not HAVE_SHM */
+#ifdef DATA_SEG_BITS
+/* This case is used for the rt-pc.
+   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(a) (XUINT (a) | DATA_SEG_BITS)
+#else
+#define XPNTR(a) XUINT (a)
+#endif
+#endif /* not HAVE_SHM */
+#endif /* no XPNTR */
+
 /* Largest and smallest representable fixnum values.  These are the C
    values.  */
 
@@ -491,6 +495,7 @@ extern Lisp_Object make_number ();
 #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))
+#define XSAVE_VALUE(a) (&(XMISC(a)->u_save_value))
 
 /* Pseudovector types.  */
 
@@ -535,6 +540,20 @@ extern Lisp_Object make_number ();
 #define ASET(ARRAY, IDX, VAL)  (AREF ((ARRAY), (IDX)) = (VAL))
 #define ASIZE(ARRAY)           XVECTOR ((ARRAY))->size
 
+/* Convenience macros for dealing with Lisp strings.  */
+
+#define SREF(string, index)    (XSTRING (string)->data[index] + 0)
+#define SSET(string, index, new) (XSTRING (string)->data[index] = (new))
+#define SDATA(string)          (XSTRING (string)->data + 0)
+#define SCHARS(string)         (XSTRING (string)->size + 0)
+#define SBYTES(string)         (STRING_BYTES (XSTRING (string)) + 0)
+
+#define STRING_SET_CHARS(string, newsize) \
+    (XSTRING (string)->size = (newsize))
+
+#define STRING_COPYIN(string, index, new, count) \
+    bcopy (new, XSTRING (string)->data + index, count)
+
 \f
 /* Basic data type for use of intervals.  See the macros in intervals.h.  */
 
@@ -573,7 +592,7 @@ struct interval
      The first four are duplicates for things which can be on the list,
      for purposes of speed.  */
 
-  unsigned int write_protect : 1;    /* Non-zero means can't modify.  */
+  unsigned int write_protect : 1;   /* Non-zero means can't modify.  */
   unsigned int visible : 1;        /* Zero means don't display.  */
   unsigned int front_sticky : 1;    /* Non-zero means text inserted just
                                       before this interval goes into it.  */
@@ -621,11 +640,6 @@ struct Lisp_Cons
 #define XCDR_AS_LVALUE(c) (XCONS ((c))->cdr)
 #endif
 
-/* Okay, we're not quite ready to turn this on yet.  A few files still
-   need to be updated and tested.  */
-#undef LISP_MAKE_RVALUE
-#define LISP_MAKE_RVALUE(x) (x)
-
 /* Use these from normal code.  */
 #define XCAR(c)        LISP_MAKE_RVALUE(XCAR_AS_LVALUE(c))
 #define XCDR(c) LISP_MAKE_RVALUE(XCDR_AS_LVALUE(c))
@@ -674,8 +688,14 @@ extern int string_bytes P_ ((struct Lisp_String *));
 
 #endif /* not GC_CHECK_STRING_BYTES */
 
-/* Set the length in bytes of STR.  */
-#define SET_STRING_BYTES(STR, SIZE)  ((STR)->size_byte = (SIZE))
+/* Mark STR as a unibyte string.  */
+#define STRING_SET_UNIBYTE(STR)      (XSTRING (STR)->size_byte = -1)
+
+/* Get text properties.  */
+#define STRING_INTERVALS(STR)  (XSTRING (STR)->intervals + 0)
+
+/* Set text properties.  */
+#define STRING_SET_INTERVALS(STR, INT) (XSTRING (STR)->intervals = (INT))
 
 /* In a string or vector, the sign bit of the `size' is the gc mark bit */
 
@@ -868,9 +888,11 @@ struct Lisp_Symbol
      enum symbol_interned.  */
   unsigned interned : 2;
 
-  /* The symbol's name.  This should become a Lisp_Object
-     some day; there's no need for the Lisp_String pointer nowadays.  */
-  struct Lisp_String *name;
+  /* The symbol's name, as a Lisp string.
+
+     The name "xname" is used to intentionally break code referring to
+     the old field "name" of type pointer to struct Lisp_String.  */
+  Lisp_Object xname;
 
   /* Value of the symbol or Qunbound if unbound.  If this symbol is a
      defvaralias, `value' contains the symbol for which it is an
@@ -883,11 +905,16 @@ struct Lisp_Symbol
 
   /* The symbol's property list.  */
   Lisp_Object plist;
-    
+
   /* Next symbol in obarray bucket, if the symbol is interned.  */
   struct Lisp_Symbol *next;
 };
 
+/* Value is name of symbol.  */
+
+#define SYMBOL_NAME(sym)  \
+     LISP_MAKE_RVALUE (XSYMBOL (sym)->xname)
+
 /* Value is non-zero if SYM is an interned symbol.  */
 
 #define SYMBOL_INTERNED_P(sym)  \
@@ -921,7 +948,7 @@ struct Lisp_Symbol
        else                                                    \
         XSYMBOL (sym)->value = (val);                          \
      } while (0)
-     
+
 \f
 /***********************************************************************
                             Hash Tables
@@ -934,14 +961,14 @@ struct Lisp_Hash_Table
   /* Vector fields.  The hash table code doesn't refer to these.  */
   EMACS_INT size;
   struct Lisp_Vector *vec_next;
-  
+
   /* Function used to compare keys.  */
   Lisp_Object test;
 
   /* Nil if table is non-weak.  Otherwise a symbol describing the
      weakness of the table.  */
   Lisp_Object weak;
-  
+
   /* When the table is resized, and this is an integer, compute the
      new size by adding this to the old size.  If a float, compute the
      new size by multiplying the old size with this factor.  */
@@ -1011,6 +1038,32 @@ struct Lisp_Hash_Table
        }                                                       \
      while (0)
 
+/* Value is the key part of entry IDX in hash table H.  */
+
+#define HASH_KEY(H, IDX)   AREF ((H)->key_and_value, 2 * (IDX))
+
+/* Value is the value part of entry IDX in hash table H.  */
+
+#define HASH_VALUE(H, IDX) AREF ((H)->key_and_value, 2 * (IDX) + 1)
+
+/* Value is the index of the next entry following the one at IDX
+   in hash table H.  */
+
+#define HASH_NEXT(H, IDX)  AREF ((H)->next, (IDX))
+
+/* Value is the hash code computed for entry IDX in hash table H.  */
+
+#define HASH_HASH(H, IDX)  AREF ((H)->hash, (IDX))
+
+/* Value is the index of the element in hash table H that is the
+   start of the collision list at index IDX in the index vector of H.  */
+
+#define HASH_INDEX(H, IDX)  AREF ((H)->index, (IDX))
+
+/* Value is the size of hash table H.  */
+
+#define HASH_TABLE_SIZE(H) XVECTOR ((H)->next)->size
+
 /* Default size for hash tables if not specified.  */
 
 #define DEFAULT_HASH_SIZE 65
@@ -1068,7 +1121,7 @@ struct Lisp_Intfwd
   {
     int type : 16;     /* = Lisp_Misc_Intfwd */
     int spacer : 16;
-    int *intvar;
+    EMACS_INT *intvar;
   };
 
 /* Boolean forwarding pointer to an int variable.
@@ -1113,7 +1166,7 @@ struct Lisp_Buffer_Objfwd
    one that corresponds to the loaded binding.  To read or set the
    variable, you must first make sure the right binding is loaded;
    then you can access the value in (or through) `realvalue'.
-   
+
    `buffer' and `frame' are the buffer and frame for which the loaded
    binding was found.  If those have changed, to make sure the right
    binding is loaded it is necessary to find which binding goes with
@@ -1181,6 +1234,16 @@ struct Lisp_Kboard_Objfwd
     int offset;
   };
 
+/* Hold a C pointer for later use.
+   This type of object is used in the arg to record_unwind_protect.  */
+struct Lisp_Save_Value
+  {
+    int type : 16;     /* = Lisp_Misc_Save_Value */
+    int spacer : 16;
+    void *pointer;
+    int integer;
+  };
+
 
 /* To get the type field of a union Lisp_Misc, use XMISCTYPE.
    It uses one of these struct subtypes to get the type field.  */
@@ -1196,6 +1259,7 @@ union Lisp_Misc
     struct Lisp_Buffer_Local_Value u_buffer_local_value;
     struct Lisp_Overlay u_overlay;
     struct Lisp_Kboard_Objfwd u_kboard_objfwd;
+    struct Lisp_Save_Value u_save_value;
   };
 \f
 /* Lisp floating point type */
@@ -1543,12 +1607,12 @@ typedef unsigned char UCHAR;
 #if (!defined (__STDC__) && !defined (PROTOTYPES)) \
     || defined (USE_NONANSI_DEFUN)
 
-#define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, args)    \
+#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 args
+  Lisp_Object fnname
 
 #else
 
@@ -1587,7 +1651,7 @@ typedef unsigned char UCHAR;
       || (SYMBOLP (OBJ) && !NILP (Ffboundp (OBJ)))     \
       || COMPILEDP (OBJ)                               \
       || SUBRP (OBJ))
-     
+
 /* defsubr (Sname);
    is how we define the symbol for function `name' at start-up time.  */
 extern void defsubr P_ ((struct Lisp_Subr *));
@@ -1598,7 +1662,7 @@ extern void defsubr P_ ((struct Lisp_Subr *));
 extern void defvar_lisp P_ ((char *, Lisp_Object *));
 extern void defvar_lisp_nopro P_ ((char *, Lisp_Object *));
 extern void defvar_bool P_ ((char *, int *));
-extern void defvar_int P_ ((char *, int *));
+extern void defvar_int P_ ((char *, EMACS_INT *));
 extern void defvar_per_buffer P_ ((char *, Lisp_Object *, Lisp_Object, char *));
 extern void defvar_kboard P_ ((char *, int));
 
@@ -1632,9 +1696,9 @@ extern void defvar_kboard P_ ((char *, int));
       form.
 
    Otherwise, the element is a variable binding.
-   
+
    If the symbol field is a symbol, it is an ordinary variable binding.
-   
+
    Otherwise, it should be a structure (SYMBOL WHERE
    . CURRENT-BUFFER), which means having bound a local value while
    CURRENT-BUFFER was active.  If WHERE is nil this means we saw the
@@ -1653,14 +1717,20 @@ extern struct specbinding *specpdl;
 extern struct specbinding *specpdl_ptr;
 extern int specpdl_size;
 
-extern int max_specpdl_size;
+extern EMACS_INT max_specpdl_size;
 
-#define BINDING_STACK_SIZE()   (specpdl_ptr - specpdl)
+#define SPECPDL_INDEX()        (specpdl_ptr - specpdl)
 
 /* Everything needed to describe an active condition case.  */
 struct handler
   {
     /* The handler clauses and variable from the condition-case form.  */
+    /* For a handler set up in Lisp code, this is always a list.
+       For an internal handler set up by internal_condition_case*,
+       this can instead be the symbol t or `error'.
+       t: handle all conditions.
+       error: handle all conditions, and errors can run the debugger
+              or display a backtrace.  */
     Lisp_Object handler;
     Lisp_Object var;
     /* Fsignal stores here the condition-case clause that applies,
@@ -1763,7 +1833,7 @@ extern int consing_since_gc;
 
 /* Threshold for doing another gc.  */
 
-extern int gc_cons_threshold;
+extern EMACS_INT gc_cons_threshold;
 
 /* Structure for recording stack slots that need marking.  */
 
@@ -1783,13 +1853,13 @@ extern struct gcpro *gcprolist;
 struct gcpro
 {
   struct gcpro *next;
-  
+
   /* Address of first protected variable.  */
   volatile Lisp_Object *var;
-  
+
   /* Number of consecutive protected variables.  */
   int nvars;
-  
+
 #ifdef DEBUG_GCPRO
   int level;
 #endif
@@ -1817,15 +1887,18 @@ struct gcpro
 #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
 
 /* Do something silly with gcproN vars just so gcc shuts up.  */
+/* You get warnings from MIPSPro...  */
 
 #define GCPRO1(varname) ((void) gcpro1)
-#define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1)) 
+#define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1))
 #define GCPRO3(varname1, varname2, varname3) \
   (((void) gcpro3, (void) gcpro2, (void) gcpro1))
 #define GCPRO4(varname1, varname2, varname3, varname4) \
   (((void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1))
 #define GCPRO5(varname1, varname2, varname3, varname4, varname5) \
   (((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1))
+#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
+  (((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1))
 #define UNGCPRO ((void) 0)
 
 #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */
@@ -1862,6 +1935,15 @@ struct gcpro
   gcpro5.next = &gcpro4; gcpro5.var = &varname5; gcpro5.nvars = 1; \
   gcprolist = &gcpro5; }
 
+#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
+ {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; \
+  gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \
+  gcprolist = &gcpro6; }
+
 #define UNGCPRO (gcprolist = gcpro1.next)
 
 #else
@@ -1907,6 +1989,17 @@ extern int gcpro_level;
   gcpro5.level = gcpro_level++; \
   gcprolist = &gcpro5; }
 
+#define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \
+ {gcpro1.next = gcprolist; gcpro1.var = &varname1; gcpro1.nvars = 1; \
+  gcpro1.level = gcpro_level; \
+  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; \
+  gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \
+  gcpro6.level = gcpro_level++; \
+  gcprolist = &gcpro6; }
+
 #define UNGCPRO                                        \
  ((--gcpro_level != gcpro1.level)              \
   ? (abort (), 0)                              \
@@ -2090,8 +2183,8 @@ EXFUN (Ffind_operation_coding_system, MANY);
 EXFUN (Fupdate_coding_systems_internal, 0);
 EXFUN (Fencode_coding_string, 3);
 EXFUN (Fdecode_coding_string, 3);
-extern Lisp_Object detect_coding_system P_ ((unsigned char *, int, int, int));
-Lisp_Object code_convert_string_norecord P_ ((Lisp_Object, Lisp_Object, int));
+extern Lisp_Object detect_coding_system P_ ((const unsigned char *, int, int,
+                                            int));
 extern void init_coding P_ ((void));
 extern void init_coding_once P_ ((void));
 extern void syms_of_coding P_ ((void));
@@ -2099,13 +2192,13 @@ extern Lisp_Object code_convert_string_norecord P_ ((Lisp_Object, Lisp_Object,
                                                     int));
 
 /* Defined in charset.c */
-extern int nonascii_insert_offset;
+extern EMACS_INT nonascii_insert_offset;
 extern Lisp_Object Vnonascii_translation_table;
 EXFUN (Fchar_bytes, 1);
 EXFUN (Fchar_width, 1);
 EXFUN (Fstring, MANY);
-extern int chars_in_text P_ ((unsigned char *, int));
-extern int multibyte_chars_in_text P_ ((unsigned char *, int));
+extern int chars_in_text P_ ((const unsigned char *, int));
+extern int multibyte_chars_in_text P_ ((const unsigned char *, int));
 extern int unibyte_char_to_multibyte P_ ((int));
 extern int multibyte_char_to_unibyte P_ ((int, Lisp_Object));
 extern Lisp_Object Qcharset;
@@ -2209,6 +2302,7 @@ extern Lisp_Object string_make_unibyte P_ ((Lisp_Object));
 EXFUN (Fcopy_alist, 1);
 EXFUN (Fplist_get, 2);
 EXFUN (Fplist_put, 3);
+EXFUN (Fplist_member, 2);
 EXFUN (Fset_char_table_parent, 2);
 EXFUN (Fchar_table_extra_slot, 2);
 EXFUN (Fset_char_table_extra_slot, 3);
@@ -2235,20 +2329,20 @@ extern Lisp_Object Qinhibit_modification_hooks;
 extern void move_gap P_ ((int));
 extern void move_gap_both P_ ((int, int));
 extern void make_gap P_ ((int));
-extern int copy_text P_ ((unsigned char *, unsigned char *, int, int, int));
-extern int count_size_as_multibyte P_ ((unsigned char *, int));
-extern int count_combining_before P_ ((unsigned char *, int, int, int));
-extern int count_combining_after P_ ((unsigned char *, int, int, int));
-extern void insert P_ ((unsigned char *, int));
-extern void insert_and_inherit P_ ((unsigned char *, int));
-extern void insert_1 P_ ((unsigned char *, int, int, int, int));
-extern void insert_1_both P_ ((unsigned char *, int, int, int, int, int));
+extern int copy_text P_ ((const unsigned char *, unsigned char *, int, int, int));
+extern int count_size_as_multibyte P_ ((const unsigned char *, int));
+extern int count_combining_before P_ ((const unsigned char *, int, int, int));
+extern int count_combining_after P_ ((const unsigned char *, int, int, int));
+extern void insert P_ ((const unsigned char *, int));
+extern void insert_and_inherit P_ ((const unsigned char *, int));
+extern void insert_1 P_ ((const unsigned char *, int, int, int, int));
+extern void insert_1_both P_ ((const unsigned char *, int, int, int, int, int));
 extern void insert_from_string P_ ((Lisp_Object, int, int, int, int, int));
 extern void insert_from_buffer P_ ((struct buffer *, int, int, int));
 extern void insert_char P_ ((int));
-extern void insert_string P_ ((char *));
-extern void insert_before_markers P_ ((unsigned char *, int));
-extern void insert_before_markers_and_inherit P_ ((unsigned char *, int));
+extern void insert_string P_ ((const char *));
+extern void insert_before_markers P_ ((const unsigned char *, int));
+extern void insert_before_markers_and_inherit P_ ((const unsigned char *, int));
 extern void insert_from_string_before_markers P_ ((Lisp_Object, int, int, int, int, int));
 extern void del_range P_ ((int, int));
 extern Lisp_Object del_range_1 P_ ((int, int, int, int));
@@ -2267,6 +2361,7 @@ extern void syms_of_insdel P_ ((void));
 
 /* Defined in dispnew.c */
 extern Lisp_Object selected_frame;
+extern EMACS_INT baud_rate;
 EXFUN (Fding, 1);
 EXFUN (Fredraw_frame, 1);
 EXFUN (Fredraw_display, 0);
@@ -2275,35 +2370,35 @@ EXFUN (Fsit_for, 3);
 extern Lisp_Object sit_for P_ ((int, int, int, int, int));
 extern void init_display P_ ((void));
 extern void syms_of_display P_ ((void));
-extern void safe_bcopy P_ ((char *, char *, int));
+extern void safe_bcopy P_ ((const char *, char *, int));
 
 /* Defined in xdisp.c */
 extern Lisp_Object Qinhibit_point_motion_hooks;
 extern Lisp_Object Qinhibit_redisplay, Qdisplay;
 extern Lisp_Object Qinhibit_eval_during_redisplay;
 extern Lisp_Object Qmessage_truncate_lines;
-extern Lisp_Object Qcursor_in_non_selected_windows;
 extern Lisp_Object Vmessage_log_max;
 extern int message_enable_multibyte;
 extern Lisp_Object echo_area_buffer[2];
 extern void check_message_stack P_ ((void));
 extern void setup_echo_area_for_printing P_ ((int));
 extern int push_message P_ ((void));
-extern Lisp_Object push_message_unwind P_ ((Lisp_Object));
+extern Lisp_Object pop_message_unwind P_ ((Lisp_Object));
+extern Lisp_Object restore_message_unwind P_ ((Lisp_Object));
 extern void pop_message P_ ((void));
 extern void restore_message P_ ((void));
 extern Lisp_Object current_message P_ ((void));
-extern void set_message P_ ((char *s, Lisp_Object, int, int));
+extern void set_message P_ ((const char *s, Lisp_Object, int, int));
 extern void clear_message P_ ((int, int));
 extern void message P_ ((/* char *, ... */));
 extern void message_nolog P_ ((/* char *, ... */));
 extern void message1 P_ ((char *));
 extern void message1_nolog P_ ((char *));
-extern void message2 P_ ((char *, int, int));
-extern void message2_nolog P_ ((char *, int, int));
+extern void message2 P_ ((const char *, int, int));
+extern void message2_nolog P_ ((const char *, int, int));
 extern void message3 P_ ((Lisp_Object, int, int));
 extern void message3_nolog P_ ((Lisp_Object, int, int));
-extern void message_dolog P_ ((char *, int, int, int));
+extern void message_dolog P_ ((const char *, int, int, int));
 extern void message_with_string P_ ((char *, Lisp_Object, int));
 extern void message_log_maybe_newline P_ ((void));
 extern void update_echo_area P_ ((void));
@@ -2314,6 +2409,8 @@ extern int check_point_in_composition
 extern void redisplay_preserve_echo_area P_ ((int));
 extern void mark_window_display_accurate P_ ((Lisp_Object, int));
 extern void prepare_menu_bars P_ ((void));
+
+void set_frame_cursor_types P_ ((struct frame *, Lisp_Object));
 extern void syms_of_xdisp P_ ((void));
 extern void init_xdisp P_ ((void));
 extern Lisp_Object safe_eval P_ ((Lisp_Object));
@@ -2332,6 +2429,7 @@ extern void buffer_memory_full P_ ((void));
 extern int survives_gc_p P_ ((Lisp_Object));
 extern void mark_object P_ ((Lisp_Object *));
 extern Lisp_Object Vpurify_flag;
+extern Lisp_Object Vmemory_full;
 EXFUN (Fcons, 2);
 EXFUN (list2, 2);
 EXFUN (list3, 3);
@@ -2345,10 +2443,10 @@ EXFUN (Fvector, MANY);
 EXFUN (Fmake_symbol, 1);
 EXFUN (Fmake_marker, 0);
 EXFUN (Fmake_string, 2);
-extern Lisp_Object build_string P_ ((char *));
-extern Lisp_Object make_string P_ ((char *, int));
-extern Lisp_Object make_unibyte_string P_ ((char *, int));
-extern Lisp_Object make_multibyte_string P_ ((char *, int, int));
+extern Lisp_Object build_string P_ ((const char *));
+extern Lisp_Object make_string P_ ((const char *, int));
+extern Lisp_Object make_unibyte_string P_ ((const char *, int));
+extern Lisp_Object make_multibyte_string P_ ((const char *, int, int));
 extern Lisp_Object make_event_array P_ ((int, Lisp_Object *));
 extern Lisp_Object make_uninit_string P_ ((int));
 extern Lisp_Object make_uninit_multibyte_string P_ ((int, int));
@@ -2374,6 +2472,7 @@ extern int gc_in_progress;
 extern Lisp_Object make_float P_ ((double));
 extern void display_malloc_warning P_ ((void));
 extern int inhibit_garbage_collection P_ ((void));
+extern Lisp_Object make_save_value P_ ((void *, int));
 extern void free_marker P_ ((Lisp_Object));
 extern void free_cons P_ ((struct Lisp_Cons *));
 extern void init_alloc_once P_ ((void));
@@ -2392,14 +2491,14 @@ EXFUN (Fprint, 2);
 EXFUN (Ferror_message_string, 1);
 extern Lisp_Object Vstandard_output, Qstandard_output;
 extern Lisp_Object Qexternal_debugging_output;
-extern void temp_output_buffer_setup P_ ((char *));
+extern void temp_output_buffer_setup P_ ((const char *));
 extern int print_level, print_escape_newlines;
 extern Lisp_Object Qprint_escape_newlines;
 extern void write_string P_ ((char *, int));
 extern void write_string_1 P_ ((char *, int, Lisp_Object));
-extern void print_error_message P_ ((Lisp_Object, Lisp_Object));
+extern void print_error_message P_ ((Lisp_Object, Lisp_Object, char *, Lisp_Object));
 extern Lisp_Object internal_with_output_to_temp_buffer
-       P_ ((char *, Lisp_Object (*) (Lisp_Object), Lisp_Object));
+       P_ ((const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object));
 extern void float_to_string P_ ((unsigned char *, double));
 extern void syms_of_print P_ ((void));
 
@@ -2420,15 +2519,15 @@ EXFUN (Fread_char, 2);
 EXFUN (Fread_event, 2);
 extern Lisp_Object read_filtered_event P_ ((int, int, int, int));
 EXFUN (Feval_region, 4);
-extern Lisp_Object intern P_ ((char *));
+extern Lisp_Object intern P_ ((const char *));
 extern Lisp_Object make_symbol P_ ((char *));
-extern Lisp_Object oblookup P_ ((Lisp_Object, char *, int, int));
+extern Lisp_Object oblookup P_ ((Lisp_Object, const char *, int, int));
 #define LOADHIST_ATTACH(x) \
  if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
 extern Lisp_Object Vcurrent_load_list;
 extern Lisp_Object Vload_history, Vload_suffixes;
 extern int openp P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
-                     Lisp_Object *, int));
+                     Lisp_Object *, Lisp_Object));
 extern int isfloat_string P_ ((char *));
 extern void map_obarray P_ ((Lisp_Object, void (*) (Lisp_Object, Lisp_Object),
                             Lisp_Object));
@@ -2481,7 +2580,7 @@ EXFUN (Funwind_protect, UNEVALLED);
 EXFUN (Fcondition_case, UNEVALLED);
 EXFUN (Fsignal, 2);
 EXFUN (Fautoload, 5);
-EXFUN (Fcommandp, 1);
+EXFUN (Fcommandp, 2);
 EXFUN (Feval, 1);
 EXFUN (Fapply, MANY);
 EXFUN (Ffuncall, MANY);
@@ -2514,6 +2613,7 @@ extern void init_eval P_ ((void));
 extern void syms_of_eval P_ ((void));
 
 /* Defined in editfns.c */
+EXFUN (Fpropertize, MANY);
 EXFUN (Fcurrent_message, 0);
 EXFUN (Fgoto_char, 1);
 EXFUN (Fpoint_min_marker, 0);
@@ -2540,7 +2640,7 @@ EXFUN (Fbolp, 0);
 EXFUN (Fbobp, 0);
 EXFUN (Fformat, MANY);
 EXFUN (Fmessage, MANY);
-extern Lisp_Object format1 P_ ((/* char *, ... */));
+extern Lisp_Object format2 P_ ((char *, Lisp_Object, Lisp_Object));
 extern Lisp_Object make_buffer_string P_ ((int, int, int));
 EXFUN (Fbuffer_substring, 2);
 EXFUN (Fbuffer_string, 0);
@@ -2652,9 +2752,9 @@ EXFUN (Ffile_directory_p, 1);
 EXFUN (Fwrite_region, 7);
 EXFUN (Ffile_readable_p, 1);
 EXFUN (Ffile_executable_p, 1);
-EXFUN (Fread_file_name, 5);
+EXFUN (Fread_file_name, 6);
 extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
-extern void report_file_error P_ ((char *, Lisp_Object));
+extern void report_file_error P_ ((const char *, Lisp_Object));
 extern int internal_delete_file P_ ((Lisp_Object));
 extern void syms_of_fileio P_ ((void));
 EXFUN (Fmake_temp_name, 1);
@@ -2676,7 +2776,7 @@ EXFUN (Fmatch_beginning, 1);
 EXFUN (Fmatch_end, 1);
 EXFUN (Flooking_at, 1);
 extern int fast_string_match P_ ((Lisp_Object, Lisp_Object));
-extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, char *));
+extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *));
 extern int scan_buffer P_ ((int, int, int, int, int *, int));
 extern int scan_newline P_ ((int, int, int, int, int, int));
 extern int find_next_newline P_ ((int, int));
@@ -2697,7 +2797,7 @@ EXFUN (Feval_minibuffer, 2);
 EXFUN (Fread_string, 5);
 EXFUN (Fread_no_blanks_input, 3);
 extern Lisp_Object get_minibuffer P_ ((int));
-extern void temp_echo_area_glyphs P_ ((char *));
+extern void temp_echo_area_glyphs P_ ((const char *));
 extern void init_minibuf_once P_ ((void));
 extern void syms_of_minibuf P_ ((void));
 extern void keys_of_minibuf P_ ((void));
@@ -2768,9 +2868,9 @@ EXFUN (Fvertical_motion, 2);
 EXFUN (Findent_to, 2);
 EXFUN (Fcurrent_column, 0);
 EXFUN (Fmove_to_column, 2);
-extern int current_column P_ ((void));
+extern double current_column P_ ((void));
 extern void invalidate_current_column P_ ((void));
-extern int indented_beyond_p P_ ((int, int, int));
+extern int indented_beyond_p P_ ((int, int, double));
 extern void syms_of_indent P_ ((void));
 
 /* defined in window.c */
@@ -2918,7 +3018,7 @@ extern void unmark_byte_stack P_ ((void));
 
 /* defined in macros.c */
 extern Lisp_Object Qexecute_kbd_macro;
-EXFUN (Fexecute_kbd_macro, 2);
+EXFUN (Fexecute_kbd_macro, 3);
 extern void init_macros P_ ((void));
 extern void syms_of_macros P_ ((void));
 
@@ -2985,10 +3085,10 @@ extern int set_window_size P_ ((int, int, int));
 extern void create_process P_ ((Lisp_Object, char **, Lisp_Object));
 extern int tabs_safe_p P_ ((void));
 extern void init_baud_rate P_ ((void));
-extern int emacs_open P_ ((char *, int, int));
+extern int emacs_open P_ ((const char *, int, int));
 extern int emacs_close P_ ((int));
 extern int emacs_read P_ ((int, char *, unsigned int));
-extern int emacs_write P_ ((int, char *, unsigned int));
+extern int emacs_write P_ ((int, const char *, unsigned int));
 
 /* defined in filelock.c */
 EXFUN (Funlock_buffer, 0);
@@ -3036,10 +3136,14 @@ extern int getloadavg P_ ((double *, int));
 extern void syms_of_xfns P_ ((void));
 extern void init_xfns P_ ((void));
 extern Lisp_Object Vx_resource_name;
+extern Lisp_Object Vx_resource_class;
 EXFUN (Fxw_display_color_p, 1);
 EXFUN (Fx_file_dialog, 4);
 #endif /* HAVE_X_WINDOWS */
 
+/* Defined in xsmfns.c */
+extern void syms_of_xsmfns P_ ((void));
+
 /* Defined in xselect.c */
 extern void syms_of_xselect P_ ((void));
 
@@ -3059,7 +3163,7 @@ extern POINTER_TYPE *xmalloc P_ ((size_t));
 extern POINTER_TYPE *xrealloc P_ ((POINTER_TYPE *, size_t));
 extern void xfree P_ ((POINTER_TYPE *));
 
-extern char *xstrdup P_ ((char *));
+extern char *xstrdup P_ ((const char *));
 
 #ifndef USE_CRT_DLL
 extern char *egetenv P_ ((char *));
@@ -3101,7 +3205,7 @@ extern Lisp_Object Vdirectory_sep_char;
 
 /* Loop over Lisp list LIST.  Signal an error if LIST is not a proper
    list, or if it contains circles.
-   
+
    HARE and TORTOISE should be the names of Lisp_Object variables, and
    N should be the name of an EMACS_INT variable declared in the
    function where the macro is used.  Each nested loop should use