]> code.delx.au - gnu-emacs/blobdiff - src/lisp.h
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-78
[gnu-emacs] / src / lisp.h
index 780ee76c271c7d7dc2425c07055671bbc324e145..3f49ac546ccad726a45026aaafa1670747af6848 100644 (file)
@@ -35,6 +35,22 @@ Boston, MA 02111-1307, USA.  */
    be compared to the sizes recorded in Lisp strings.  */
 
 #define GC_CHECK_STRING_BYTES 1
+
+/* Define this to check for short string overrun.  */
+
+#define GC_CHECK_STRING_OVERRUN 1
+
+/* Define this to check the string free list.  */
+
+#define GC_CHECK_STRING_FREE_LIST 1
+
+/* Define this to check for malloc buffer overrun.  */
+
+#define XMALLOC_OVERRUN_CHECK 1
+
+/* Define this to check for errors in cons list.  */
+/* #define GC_CHECK_CONS_LIST 1 */
+
 #endif /* 0 */
 
 
@@ -305,11 +321,13 @@ enum pvec_type
 /* First, try and define DECL_ALIGN(type,var) which declares a static
    variable VAR of type TYPE with the added requirement that it be
    TYPEBITS-aligned. */
-#ifndef DECL_ALIGN
+#ifndef NO_DECL_ALIGN
+# ifndef DECL_ALIGN
 /* What compiler directive should we use for non-gcc compilers?  -stef  */
-# if defined (__GNUC__)
-#  define DECL_ALIGN(type, var) \
-    type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
+#  if defined (__GNUC__)
+#   define DECL_ALIGN(type, var) \
+     type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
+#  endif
 # endif
 #endif
 
@@ -324,7 +342,7 @@ enum pvec_type
 # endif
 #endif
 
-/* Just remove the alignment annotation if we don't use it.  */
+/* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op.  */
 #ifndef DECL_ALIGN
 # ifdef USE_LSB_TAG
 #  error "USE_LSB_TAG used without defining DECL_ALIGN"
@@ -1378,7 +1396,7 @@ typedef unsigned char UCHAR;
 \f
 /* Data type checking */
 
-#define NILP(x)  (XFASTINT (x) == XFASTINT (Qnil))
+#define NILP(x)  EQ (x, Qnil)
 #define GC_NILP(x) GC_EQ (x, Qnil)
 
 #define NUMBERP(x) (INTEGERP (x) || FLOATP (x))
@@ -1768,11 +1786,15 @@ extern char *stack_bottom;
 #ifdef SYNC_INPUT
 extern void handle_async_input P_ ((void));
 extern int interrupt_input_pending;
+
 #define QUIT                                           \
   do {                                                 \
     if (!NILP (Vquit_flag) && NILP (Vinhibit_quit))    \
       {                                                        \
+        Lisp_Object flag = Vquit_flag;                 \
        Vquit_flag = Qnil;                              \
+       if (EQ (Vthrow_on_input, flag))                 \
+         Fthrow (Vthrow_on_input, Qnil);               \
        Fsignal (Qquit, Qnil);                          \
       }                                                        \
     else if (interrupt_input_pending)                  \
@@ -1785,7 +1807,10 @@ extern int interrupt_input_pending;
   do {                                                 \
     if (!NILP (Vquit_flag) && NILP (Vinhibit_quit))    \
       {                                                        \
+        Lisp_Object flag = Vquit_flag;                 \
        Vquit_flag = Qnil;                              \
+       if (EQ (Vthrow_on_input, flag))                 \
+         Fthrow (Vthrow_on_input, Qnil);               \
        Fsignal (Qquit, Qnil);                          \
       }                                                        \
   } while (0)
@@ -2302,6 +2327,7 @@ EXFUN (Felt, 2);
 EXFUN (Fmember, 2);
 EXFUN (Frassq, 2);
 EXFUN (Fdelq, 2);
+EXFUN (Fdelete, 2);
 EXFUN (Fsort, 2);
 EXFUN (Freverse, 1);
 EXFUN (Fnreverse, 1);
@@ -2324,9 +2350,11 @@ extern void clear_string_char_byte_cache P_ ((void));
 extern int string_char_to_byte P_ ((Lisp_Object, int));
 extern int string_byte_to_char P_ ((Lisp_Object, int));
 extern Lisp_Object string_make_multibyte P_ ((Lisp_Object));
+extern Lisp_Object string_to_multibyte P_ ((Lisp_Object));
 extern Lisp_Object string_make_unibyte P_ ((Lisp_Object));
 EXFUN (Fcopy_alist, 1);
 EXFUN (Fplist_get, 2);
+EXFUN (Fsafe_plist_get, 2);
 EXFUN (Fplist_put, 3);
 EXFUN (Fplist_member, 2);
 EXFUN (Frassoc, 2);
@@ -2386,6 +2414,7 @@ extern void adjust_after_replace P_ ((int, int, Lisp_Object, int, int));
 extern void adjust_after_replace_noundo P_ ((int, int, int, int, int, int));
 extern void adjust_after_insert P_ ((int, int, int, int, int));
 extern void replace_range P_ ((int, int, Lisp_Object, int, int, int));
+extern void replace_range_2 P_ ((int, int, int, int, char *, int, int, int));
 extern void syms_of_insdel P_ ((void));
 
 /* Defined in dispnew.c */
@@ -2452,6 +2481,7 @@ extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ()));
 /* Defined in alloc.c */
 extern void check_pure_size P_ ((void));
 extern void allocate_string_data P_ ((struct Lisp_String *, int, int));
+extern void reset_malloc_hooks P_ ((void));
 extern void uninterrupt_malloc P_ ((void));
 extern void malloc_warning P_ ((char *));
 extern void memory_full P_ ((void));
@@ -2833,6 +2863,7 @@ 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, const char *));
+extern int fast_string_match_ignore_case P_ ((Lisp_Object, Lisp_Object));
 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));
@@ -2845,7 +2876,7 @@ extern void syms_of_search P_ ((void));
 extern Lisp_Object last_minibuf_string;
 extern void choose_minibuf_frame P_ ((void));
 EXFUN (Fcompleting_read, 8);
-EXFUN (Fread_from_minibuffer, 7);
+EXFUN (Fread_from_minibuffer, 8);
 EXFUN (Fread_variable, 2);
 EXFUN (Fread_buffer, 3);
 EXFUN (Fread_minibuffer, 2);
@@ -2893,6 +2924,7 @@ extern struct kboard *echo_kboard;
 extern void cancel_echoing P_ ((void));
 extern Lisp_Object Qdisabled, QCfilter;
 extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level;
+extern Lisp_Object Vthrow_on_input;
 extern int input_pending;
 EXFUN (Fdiscard_input, 0);
 EXFUN (Frecursive_edit, 0);
@@ -3005,7 +3037,10 @@ EXFUN (Fprocess_send_eof, 1);
 EXFUN (Fwaiting_for_user_input_p, 0);
 extern Lisp_Object Qprocessp;
 extern void kill_buffer_processes P_ ((Lisp_Object));
-extern int wait_reading_process_input P_ ((int, int, Lisp_Object, int));
+extern int wait_reading_process_output P_ ((int, int, int, int,
+                                           Lisp_Object,
+                                           struct Lisp_Process *,
+                                           int));
 extern void deactivate_process P_ ((Lisp_Object));
 extern void add_keyboard_wait_descriptor P_ ((int));
 extern void delete_keyboard_wait_descriptor P_ ((int));
@@ -3161,7 +3196,7 @@ extern void syms_of_xfns P_ ((void));
 #ifdef HAVE_WINDOW_SYSTEM
 /* Defined in xfns.c, w32fns.c, or macfns.c */
 EXFUN (Fxw_display_color_p, 1);
-EXFUN (Fx_file_dialog, 4);
+EXFUN (Fx_file_dialog, 5);
 #endif /* HAVE_WINDOW_SYSTEM */
 
 /* Defined in xsmfns.c */
@@ -3175,6 +3210,11 @@ extern void syms_of_xterm P_ ((void));
 
 /* Defined in getloadavg.c */
 extern int getloadavg P_ ((double [], int));
+
+#ifdef MSDOS
+/* Defined in msdos.c */
+EXFUN (Fmsdos_downcase_filename, 1);
+#endif
 \f
 /* Nonzero means Emacs has already been initialized.
    Used during startup to detect startup of dumped Emacs.  */
@@ -3303,7 +3343,7 @@ extern Lisp_Object Vdirectory_sep_char;
 extern Lisp_Object safe_alloca_unwind (Lisp_Object);
 
 #define USE_SAFE_ALLOCA                        \
-  int sa_count = SPECPDL_INDEX ()
+  int sa_count = SPECPDL_INDEX (), sa_must_free = 0
 
 /* SAFE_ALLOCA allocates a simple buffer.  */
 
@@ -3314,6 +3354,7 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
     else                                                 \
       {                                                          \
        buf = (type) xmalloc (size);                      \
+       sa_must_free++;                                   \
        record_unwind_protect (safe_alloca_unwind,        \
                               make_save_value (buf, 0)); \
       }                                                          \
@@ -3321,10 +3362,12 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
 
 /* SAFE_FREE frees xmalloced memory and enables GC as needed.  */
 
-#define SAFE_FREE(size)                        \
+#define SAFE_FREE()                    \
   do {                                 \
-    if ((size) >= MAX_ALLOCA)          \
+    if (sa_must_free) {                        \
+      sa_must_free = 0;                        \
       unbind_to (sa_count, Qnil);      \
+    }                                  \
   } while (0)
 
 
@@ -3341,17 +3384,11 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object);
        buf = (Lisp_Object *) xmalloc (size_);            \
        arg_ = make_save_value (buf, nelt);               \
        XSAVE_VALUE (arg_)->dogc = 1;                     \
+       sa_must_free++;                                   \
        record_unwind_protect (safe_alloca_unwind, arg_); \
       }                                                          \
   } while (0)
 
-#define SAFE_FREE_LISP(nelt)                           \
-  do {                                                 \
-    if (((nelt) * sizeof (Lisp_Object)) >= MAX_ALLOCA) \
-      unbind_to (sa_count, Qnil);                      \
-  } while (0)
-
-
 
 #endif /* EMACS_LISP_H */