aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h288
1 files changed, 138 insertions, 150 deletions
diff --git a/src/lisp.h b/src/lisp.h
index b906e4a1dfd..3a473a60b48 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20#ifndef EMACS_LISP_H 20#ifndef EMACS_LISP_H
21#define EMACS_LISP_H 21#define EMACS_LISP_H
22 22
23#include <setjmp.h>
23#include <stdalign.h> 24#include <stdalign.h>
24#include <stdarg.h> 25#include <stdarg.h>
25#include <stdbool.h> 26#include <stdbool.h>
@@ -325,7 +326,7 @@ enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 1 };
325typedef EMACS_INT Lisp_Object; 326typedef EMACS_INT Lisp_Object;
326#define XLI(o) (o) 327#define XLI(o) (o)
327#define XIL(i) (i) 328#define XIL(i) (i)
328#define LISP_MAKE_RVALUE(o) (0+(o)) 329#define LISP_MAKE_RVALUE(o) (0 + (o))
329#define LISP_INITIALLY_ZERO 0 330#define LISP_INITIALLY_ZERO 0
330enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 0 }; 331enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 0 };
331#endif /* CHECK_LISP_OBJECT_TYPE */ 332#endif /* CHECK_LISP_OBJECT_TYPE */
@@ -417,9 +418,9 @@ enum lsb_bits
417#define XINT(a) (XLI (a) >> INTTYPEBITS) 418#define XINT(a) (XLI (a) >> INTTYPEBITS)
418#define XUINT(a) ((EMACS_UINT) XLI (a) >> INTTYPEBITS) 419#define XUINT(a) ((EMACS_UINT) XLI (a) >> INTTYPEBITS)
419#define make_number(N) XIL ((EMACS_INT) (N) << INTTYPEBITS) 420#define make_number(N) XIL ((EMACS_INT) (N) << INTTYPEBITS)
420#define XSET(var, type, ptr) \ 421#define make_lisp_ptr(ptr, type) \
421 (eassert (XTYPE (XIL ((intptr_t) (ptr))) == 0), /* Check alignment. */ \ 422 (eassert (XTYPE (XIL ((intptr_t) (ptr))) == 0), /* Check alignment. */ \
422 (var) = XIL ((type) | (intptr_t) (ptr))) 423 XIL ((type) | (intptr_t) (ptr)))
423 424
424#define XPNTR(a) ((intptr_t) (XLI (a) & ~TYPEMASK)) 425#define XPNTR(a) ((intptr_t) (XLI (a) & ~TYPEMASK))
425#define XUNTAG(a, type) ((intptr_t) (XLI (a) - (type))) 426#define XUNTAG(a, type) ((intptr_t) (XLI (a) - (type)))
@@ -444,13 +445,13 @@ static EMACS_INT const VALMASK
444#define XUINT(a) ((EMACS_UINT) (XLI (a) & INTMASK)) 445#define XUINT(a) ((EMACS_UINT) (XLI (a) & INTMASK))
445#define make_number(N) XIL ((EMACS_INT) (N) & INTMASK) 446#define make_number(N) XIL ((EMACS_INT) (N) & INTMASK)
446 447
447#define XSET(var, type, ptr) \ 448#define make_lisp_ptr(ptr, type) \
448 ((var) = XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ 449 (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \
449 + ((intptr_t) (ptr) & VALMASK))) 450 + ((intptr_t) (ptr) & VALMASK)))
450 451
451#if DATA_SEG_BITS 452#if DATA_SEG_BITS
452/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers 453/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
453 which were stored in a Lisp_Object */ 454 which were stored in a Lisp_Object. */
454#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS)) 455#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS))
455#else 456#else
456#define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK)) 457#define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK))
@@ -554,16 +555,16 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
554 555
555/* Construct a Lisp_Object from a value or address. */ 556/* Construct a Lisp_Object from a value or address. */
556 557
557#define XSETINT(a, b) (a) = make_number (b) 558#define XSETINT(a, b) ((a) = make_number (b))
558#define XSETCONS(a, b) XSET (a, Lisp_Cons, b) 559#define XSETCONS(a, b) ((a) = make_lisp_ptr (b, Lisp_Cons))
559#define XSETVECTOR(a, b) XSET (a, Lisp_Vectorlike, b) 560#define XSETVECTOR(a, b) ((a) = make_lisp_ptr (b, Lisp_Vectorlike))
560#define XSETSTRING(a, b) XSET (a, Lisp_String, b) 561#define XSETSTRING(a, b) ((a) = make_lisp_ptr (b, Lisp_String))
561#define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b) 562#define XSETSYMBOL(a, b) ((a) = make_lisp_ptr (b, Lisp_Symbol))
562#define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) 563#define XSETFLOAT(a, b) ((a) = make_lisp_ptr (b, Lisp_Float))
563 564
564/* Misc types. */ 565/* Misc types. */
565 566
566#define XSETMISC(a, b) XSET (a, Lisp_Misc, b) 567#define XSETMISC(a, b) ((a) = make_lisp_ptr (b, Lisp_Misc))
567#define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker) 568#define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker)
568 569
569/* Pseudovector types. */ 570/* Pseudovector types. */
@@ -909,14 +910,6 @@ enum
909 (ASCII_CHAR_P (IDX) ? CHAR_TABLE_REF_ASCII ((CT), (IDX)) \ 910 (ASCII_CHAR_P (IDX) ? CHAR_TABLE_REF_ASCII ((CT), (IDX)) \
910 : char_table_ref ((CT), (IDX))) 911 : char_table_ref ((CT), (IDX)))
911 912
912/* Almost equivalent to Faref (CT, IDX). However, if the result is
913 not a character, return IDX.
914
915 For these characters, do not check validity of CT
916 and do not follow parent. */
917#define CHAR_TABLE_TRANSLATE(CT, IDX) \
918 char_table_translate (CT, IDX)
919
920/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and 913/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
921 8-bit European characters. Do not check validity of CT. */ 914 8-bit European characters. Do not check validity of CT. */
922#define CHAR_TABLE_SET(CT, IDX, VAL) \ 915#define CHAR_TABLE_SET(CT, IDX, VAL) \
@@ -1205,9 +1198,9 @@ struct Lisp_Hash_Table
1205 struct Lisp_Hash_Table *next_weak; 1198 struct Lisp_Hash_Table *next_weak;
1206 1199
1207 /* C function to compare two keys. */ 1200 /* C function to compare two keys. */
1208 int (*cmpfn) (struct Lisp_Hash_Table *, 1201 bool (*cmpfn) (struct Lisp_Hash_Table *,
1209 Lisp_Object, EMACS_UINT, 1202 Lisp_Object, EMACS_UINT,
1210 Lisp_Object, EMACS_UINT); 1203 Lisp_Object, EMACS_UINT);
1211 1204
1212 /* C function to compute hash code. */ 1205 /* C function to compute hash code. */
1213 EMACS_UINT (*hashfn) (struct Lisp_Hash_Table *, Lisp_Object); 1206 EMACS_UINT (*hashfn) (struct Lisp_Hash_Table *, Lisp_Object);
@@ -1627,7 +1620,7 @@ typedef struct {
1627 int mouse_face_image_state; 1620 int mouse_face_image_state;
1628} Mouse_HLInfo; 1621} Mouse_HLInfo;
1629 1622
1630/* Data type checking */ 1623/* Data type checking. */
1631 1624
1632#define NILP(x) EQ (x, Qnil) 1625#define NILP(x) EQ (x, Qnil)
1633 1626
@@ -1971,7 +1964,25 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1971 static struct Lisp_Kboard_Objfwd ko_fwd; \ 1964 static struct Lisp_Kboard_Objfwd ko_fwd; \
1972 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ 1965 defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \
1973 } while (0) 1966 } while (0)
1974 1967
1968/* Save and restore the instruction and environment pointers,
1969 without affecting the signal mask. */
1970
1971#ifdef HAVE__SETJMP
1972typedef jmp_buf sys_jmp_buf;
1973# define sys_setjmp(j) _setjmp (j)
1974# define sys_longjmp(j, v) _longjmp (j, v)
1975#elif defined HAVE_SIGSETJMP
1976typedef sigjmp_buf sys_jmp_buf;
1977# define sys_setjmp(j) sigsetjmp (j, 0)
1978# define sys_longjmp(j, v) siglongjmp (j, v)
1979#else
1980/* A platform that uses neither _longjmp nor siglongjmp; assume
1981 longjmp does not affect the sigmask. */
1982typedef jmp_buf sys_jmp_buf;
1983# define sys_setjmp(j) setjmp (j)
1984# define sys_longjmp(j, v) longjmp (j, v)
1985#endif
1975 1986
1976 1987
1977/* Structure for recording Lisp call stack for backtrace purposes. */ 1988/* Structure for recording Lisp call stack for backtrace purposes. */
@@ -2000,7 +2011,7 @@ struct specbinding
2000 { 2011 {
2001 Lisp_Object symbol, old_value; 2012 Lisp_Object symbol, old_value;
2002 specbinding_func func; 2013 specbinding_func func;
2003 Lisp_Object unused; /* Dividing by 16 is faster than by 12 */ 2014 Lisp_Object unused; /* Dividing by 16 is faster than by 12. */
2004 }; 2015 };
2005 2016
2006extern struct specbinding *specpdl; 2017extern struct specbinding *specpdl;
@@ -2009,7 +2020,10 @@ extern ptrdiff_t specpdl_size;
2009 2020
2010#define SPECPDL_INDEX() (specpdl_ptr - specpdl) 2021#define SPECPDL_INDEX() (specpdl_ptr - specpdl)
2011 2022
2012/* Everything needed to describe an active condition case. */ 2023/* Everything needed to describe an active condition case.
2024
2025 Members are volatile if their values need to survive _longjmp when
2026 a 'struct handler' is a local variable. */
2013struct handler 2027struct handler
2014 { 2028 {
2015 /* The handler clauses and variable from the condition-case form. */ 2029 /* The handler clauses and variable from the condition-case form. */
@@ -2020,10 +2034,12 @@ struct handler
2020 error: handle all conditions, and errors can run the debugger 2034 error: handle all conditions, and errors can run the debugger
2021 or display a backtrace. */ 2035 or display a backtrace. */
2022 Lisp_Object handler; 2036 Lisp_Object handler;
2023 Lisp_Object var; 2037
2038 Lisp_Object volatile var;
2039
2024 /* Fsignal stores here the condition-case clause that applies, 2040 /* Fsignal stores here the condition-case clause that applies,
2025 and Fcondition_case thus knows which clause to run. */ 2041 and Fcondition_case thus knows which clause to run. */
2026 Lisp_Object chosen_clause; 2042 Lisp_Object volatile chosen_clause;
2027 2043
2028 /* Used to effect the longjump out to the handler. */ 2044 /* Used to effect the longjump out to the handler. */
2029 struct catchtag *tag; 2045 struct catchtag *tag;
@@ -2049,19 +2065,21 @@ struct handler
2049 of the catch form. 2065 of the catch form.
2050 2066
2051 All the other members are concerned with restoring the interpreter 2067 All the other members are concerned with restoring the interpreter
2052 state. */ 2068 state.
2053 2069
2070 Members are volatile if their values need to survive _longjmp when
2071 a 'struct catchtag' is a local variable. */
2054struct catchtag 2072struct catchtag
2055{ 2073{
2056 Lisp_Object tag; 2074 Lisp_Object tag;
2057 Lisp_Object val; 2075 Lisp_Object volatile val;
2058 struct catchtag *next; 2076 struct catchtag *volatile next;
2059 struct gcpro *gcpro; 2077 struct gcpro *gcpro;
2060 jmp_buf jmp; 2078 sys_jmp_buf jmp;
2061 struct backtrace *backlist; 2079 struct backtrace *backlist;
2062 struct handler *handlerlist; 2080 struct handler *handlerlist;
2063 EMACS_INT lisp_eval_depth; 2081 EMACS_INT lisp_eval_depth;
2064 ptrdiff_t pdlcount; 2082 ptrdiff_t volatile pdlcount;
2065 int poll_suppress_count; 2083 int poll_suppress_count;
2066 int interrupt_input_blocked; 2084 int interrupt_input_blocked;
2067 struct byte_stack *byte_stack; 2085 struct byte_stack *byte_stack;
@@ -2089,22 +2107,16 @@ extern char *stack_bottom;
2089 If quit-flag is set to `kill-emacs' the SIGINT handler has received 2107 If quit-flag is set to `kill-emacs' the SIGINT handler has received
2090 a request to exit Emacs when it is safe to do. */ 2108 a request to exit Emacs when it is safe to do. */
2091 2109
2092#ifdef SYNC_INPUT
2093extern void process_pending_signals (void); 2110extern void process_pending_signals (void);
2094extern int pending_signals; 2111extern int pending_signals;
2095#define ELSE_PENDING_SIGNALS \
2096 else if (pending_signals) \
2097 process_pending_signals ();
2098#else /* not SYNC_INPUT */
2099#define ELSE_PENDING_SIGNALS
2100#endif /* not SYNC_INPUT */
2101 2112
2102extern void process_quit_flag (void); 2113extern void process_quit_flag (void);
2103#define QUIT \ 2114#define QUIT \
2104 do { \ 2115 do { \
2105 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ 2116 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
2106 process_quit_flag (); \ 2117 process_quit_flag (); \
2107 ELSE_PENDING_SIGNALS \ 2118 else if (pending_signals) \
2119 process_pending_signals (); \
2108 } while (0) 2120 } while (0)
2109 2121
2110 2122
@@ -2288,7 +2300,7 @@ extern int gcpro_level;
2288 2300
2289#define UNGCPRO \ 2301#define UNGCPRO \
2290 ((--gcpro_level != gcpro1.level) \ 2302 ((--gcpro_level != gcpro1.level) \
2291 ? (abort (), 0) \ 2303 ? (emacs_abort (), 0) \
2292 : ((gcprolist = gcpro1.next), 0)) 2304 : ((gcprolist = gcpro1.next), 0))
2293 2305
2294#endif /* DEBUG_GCPRO */ 2306#endif /* DEBUG_GCPRO */
@@ -2567,8 +2579,7 @@ extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
2567 2579
2568extern Lisp_Object Qcdr; 2580extern Lisp_Object Qcdr;
2569 2581
2570extern Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; 2582extern Lisp_Object Qrange_error, Qoverflow_error;
2571extern Lisp_Object Qoverflow_error, Qunderflow_error;
2572 2583
2573extern Lisp_Object Qfloatp; 2584extern Lisp_Object Qfloatp;
2574extern Lisp_Object Qnumberp, Qnumber_or_marker_p; 2585extern Lisp_Object Qnumberp, Qnumber_or_marker_p;
@@ -2579,10 +2590,10 @@ extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
2579 2590
2580EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST; 2591EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST;
2581 2592
2582/* Defined in frame.c */ 2593/* Defined in frame.c. */
2583extern Lisp_Object Qframep; 2594extern Lisp_Object Qframep;
2584 2595
2585/* Defined in data.c */ 2596/* Defined in data.c. */
2586extern Lisp_Object indirect_function (Lisp_Object); 2597extern Lisp_Object indirect_function (Lisp_Object);
2587extern Lisp_Object find_symbol_value (Lisp_Object); 2598extern Lisp_Object find_symbol_value (Lisp_Object);
2588 2599
@@ -2629,7 +2640,7 @@ extern void swap_in_global_binding (struct Lisp_Symbol *);
2629extern void syms_of_cmds (void); 2640extern void syms_of_cmds (void);
2630extern void keys_of_cmds (void); 2641extern void keys_of_cmds (void);
2631 2642
2632/* Defined in coding.c */ 2643/* Defined in coding.c. */
2633extern Lisp_Object Qcharset; 2644extern Lisp_Object Qcharset;
2634extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, 2645extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t,
2635 ptrdiff_t, bool, bool, Lisp_Object); 2646 ptrdiff_t, bool, bool, Lisp_Object);
@@ -2637,7 +2648,7 @@ extern void init_coding (void);
2637extern void init_coding_once (void); 2648extern void init_coding_once (void);
2638extern void syms_of_coding (void); 2649extern void syms_of_coding (void);
2639 2650
2640/* Defined in character.c */ 2651/* Defined in character.c. */
2641EXFUN (Fmax_char, 0) ATTRIBUTE_CONST; 2652EXFUN (Fmax_char, 0) ATTRIBUTE_CONST;
2642extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t); 2653extern ptrdiff_t chars_in_text (const unsigned char *, ptrdiff_t);
2643extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t); 2654extern ptrdiff_t multibyte_chars_in_text (const unsigned char *, ptrdiff_t);
@@ -2645,21 +2656,21 @@ extern int multibyte_char_to_unibyte (int) ATTRIBUTE_CONST;
2645extern int multibyte_char_to_unibyte_safe (int) ATTRIBUTE_CONST; 2656extern int multibyte_char_to_unibyte_safe (int) ATTRIBUTE_CONST;
2646extern void syms_of_character (void); 2657extern void syms_of_character (void);
2647 2658
2648/* Defined in charset.c */ 2659/* Defined in charset.c. */
2649extern void init_charset (void); 2660extern void init_charset (void);
2650extern void init_charset_once (void); 2661extern void init_charset_once (void);
2651extern void syms_of_charset (void); 2662extern void syms_of_charset (void);
2652/* Structure forward declarations. */ 2663/* Structure forward declarations. */
2653struct charset; 2664struct charset;
2654 2665
2655/* Defined in composite.c */ 2666/* Defined in composite.c. */
2656extern void syms_of_composite (void); 2667extern void syms_of_composite (void);
2657 2668
2658/* Defined in syntax.c */ 2669/* Defined in syntax.c. */
2659extern void init_syntax_once (void); 2670extern void init_syntax_once (void);
2660extern void syms_of_syntax (void); 2671extern void syms_of_syntax (void);
2661 2672
2662/* Defined in fns.c */ 2673/* Defined in fns.c. */
2663extern Lisp_Object QCrehash_size, QCrehash_threshold; 2674extern Lisp_Object QCrehash_size, QCrehash_threshold;
2664enum { NEXT_ALMOST_PRIME_LIMIT = 11 }; 2675enum { NEXT_ALMOST_PRIME_LIMIT = 11 };
2665EXFUN (Fidentity, 1) ATTRIBUTE_CONST; 2676EXFUN (Fidentity, 1) ATTRIBUTE_CONST;
@@ -2693,13 +2704,12 @@ extern Lisp_Object string_to_multibyte (Lisp_Object);
2693extern Lisp_Object string_make_unibyte (Lisp_Object); 2704extern Lisp_Object string_make_unibyte (Lisp_Object);
2694extern void syms_of_fns (void); 2705extern void syms_of_fns (void);
2695 2706
2696/* Defined in floatfns.c */ 2707/* Defined in floatfns.c. */
2697extern double extract_float (Lisp_Object); 2708extern double extract_float (Lisp_Object);
2698extern void init_floatfns (void);
2699extern void syms_of_floatfns (void); 2709extern void syms_of_floatfns (void);
2700extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y); 2710extern Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y);
2701 2711
2702/* Defined in fringe.c */ 2712/* Defined in fringe.c. */
2703extern void syms_of_fringe (void); 2713extern void syms_of_fringe (void);
2704extern void init_fringe (void); 2714extern void init_fringe (void);
2705#ifdef HAVE_WINDOW_SYSTEM 2715#ifdef HAVE_WINDOW_SYSTEM
@@ -2707,13 +2717,13 @@ extern void mark_fringe_data (void);
2707extern void init_fringe_once (void); 2717extern void init_fringe_once (void);
2708#endif /* HAVE_WINDOW_SYSTEM */ 2718#endif /* HAVE_WINDOW_SYSTEM */
2709 2719
2710/* Defined in image.c */ 2720/* Defined in image.c. */
2711extern Lisp_Object QCascent, QCmargin, QCrelief; 2721extern Lisp_Object QCascent, QCmargin, QCrelief;
2712extern Lisp_Object QCconversion; 2722extern Lisp_Object QCconversion;
2713extern int x_bitmap_mask (struct frame *, ptrdiff_t); 2723extern int x_bitmap_mask (struct frame *, ptrdiff_t);
2714extern void syms_of_image (void); 2724extern void syms_of_image (void);
2715 2725
2716/* Defined in insdel.c */ 2726/* Defined in insdel.c. */
2717extern Lisp_Object Qinhibit_modification_hooks; 2727extern Lisp_Object Qinhibit_modification_hooks;
2718extern void move_gap (ptrdiff_t); 2728extern void move_gap (ptrdiff_t);
2719extern void move_gap_both (ptrdiff_t, ptrdiff_t); 2729extern void move_gap_both (ptrdiff_t, ptrdiff_t);
@@ -2759,7 +2769,7 @@ extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
2759 const char *, ptrdiff_t, ptrdiff_t, bool); 2769 const char *, ptrdiff_t, ptrdiff_t, bool);
2760extern void syms_of_insdel (void); 2770extern void syms_of_insdel (void);
2761 2771
2762/* Defined in dispnew.c */ 2772/* Defined in dispnew.c. */
2763#if (defined PROFILING \ 2773#if (defined PROFILING \
2764 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) 2774 && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
2765_Noreturn void __executable_start (void); 2775_Noreturn void __executable_start (void);
@@ -2770,7 +2780,7 @@ extern Lisp_Object sit_for (Lisp_Object, bool, int);
2770extern void init_display (void); 2780extern void init_display (void);
2771extern void syms_of_display (void); 2781extern void syms_of_display (void);
2772 2782
2773/* Defined in xdisp.c */ 2783/* Defined in xdisp.c. */
2774extern Lisp_Object Qinhibit_point_motion_hooks; 2784extern Lisp_Object Qinhibit_point_motion_hooks;
2775extern Lisp_Object Qinhibit_redisplay, Qdisplay; 2785extern Lisp_Object Qinhibit_redisplay, Qdisplay;
2776extern Lisp_Object Qmenu_bar_update_hook; 2786extern Lisp_Object Qmenu_bar_update_hook;
@@ -2821,17 +2831,15 @@ extern Lisp_Object safe_eval (Lisp_Object);
2821extern int pos_visible_p (struct window *, ptrdiff_t, int *, 2831extern int pos_visible_p (struct window *, ptrdiff_t, int *,
2822 int *, int *, int *, int *, int *); 2832 int *, int *, int *, int *, int *);
2823 2833
2824/* Defined in xsettings.c */ 2834/* Defined in xsettings.c. */
2825extern void syms_of_xsettings (void); 2835extern void syms_of_xsettings (void);
2826 2836
2827/* Defined in vm-limit.c. */ 2837/* Defined in vm-limit.c. */
2828extern void memory_warnings (void *, void (*warnfun) (const char *)); 2838extern void memory_warnings (void *, void (*warnfun) (const char *));
2829 2839
2830/* Defined in alloc.c */ 2840/* Defined in alloc.c. */
2831extern void check_pure_size (void); 2841extern void check_pure_size (void);
2832extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); 2842extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
2833extern void reset_malloc_hooks (void);
2834extern void uninterrupt_malloc (void);
2835extern void malloc_warning (const char *); 2843extern void malloc_warning (const char *);
2836extern _Noreturn void memory_full (size_t); 2844extern _Noreturn void memory_full (size_t);
2837extern _Noreturn void buffer_memory_full (ptrdiff_t); 2845extern _Noreturn void buffer_memory_full (ptrdiff_t);
@@ -2930,7 +2938,7 @@ extern void check_cons_list (void);
2930#endif 2938#endif
2931 2939
2932#ifdef REL_ALLOC 2940#ifdef REL_ALLOC
2933/* Defined in ralloc.c */ 2941/* Defined in ralloc.c. */
2934extern void *r_alloc (void **, size_t); 2942extern void *r_alloc (void **, size_t);
2935extern void r_alloc_free (void **); 2943extern void r_alloc_free (void **);
2936extern void *r_re_alloc (void **, size_t); 2944extern void *r_re_alloc (void **, size_t);
@@ -2938,7 +2946,7 @@ extern void r_alloc_reset_variable (void **, void **);
2938extern void r_alloc_inhibit_buffer_relocation (int); 2946extern void r_alloc_inhibit_buffer_relocation (int);
2939#endif 2947#endif
2940 2948
2941/* Defined in chartab.c */ 2949/* Defined in chartab.c. */
2942extern Lisp_Object copy_char_table (Lisp_Object); 2950extern Lisp_Object copy_char_table (Lisp_Object);
2943extern Lisp_Object char_table_ref (Lisp_Object, int); 2951extern Lisp_Object char_table_ref (Lisp_Object, int);
2944extern Lisp_Object char_table_ref_and_range (Lisp_Object, int, 2952extern Lisp_Object char_table_ref_and_range (Lisp_Object, int,
@@ -2956,7 +2964,7 @@ extern void map_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Ob
2956extern Lisp_Object uniprop_table (Lisp_Object); 2964extern Lisp_Object uniprop_table (Lisp_Object);
2957extern void syms_of_chartab (void); 2965extern void syms_of_chartab (void);
2958 2966
2959/* Defined in print.c */ 2967/* Defined in print.c. */
2960extern Lisp_Object Vprin1_to_string_buffer; 2968extern Lisp_Object Vprin1_to_string_buffer;
2961extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; 2969extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
2962extern Lisp_Object Qstandard_output; 2970extern Lisp_Object Qstandard_output;
@@ -2973,7 +2981,7 @@ enum FLOAT_TO_STRING_BUFSIZE { FLOAT_TO_STRING_BUFSIZE = 350 };
2973extern int float_to_string (char *, double); 2981extern int float_to_string (char *, double);
2974extern void syms_of_print (void); 2982extern void syms_of_print (void);
2975 2983
2976/* Defined in doprnt.c */ 2984/* Defined in doprnt.c. */
2977extern ptrdiff_t doprnt (char *, ptrdiff_t, const char *, const char *, 2985extern ptrdiff_t doprnt (char *, ptrdiff_t, const char *, const char *,
2978 va_list); 2986 va_list);
2979extern ptrdiff_t esprintf (char *, char const *, ...) 2987extern ptrdiff_t esprintf (char *, char const *, ...)
@@ -2988,6 +2996,7 @@ extern ptrdiff_t evxprintf (char **, ptrdiff_t *, char const *, ptrdiff_t,
2988/* Defined in lread.c. */ 2996/* Defined in lread.c. */
2989extern Lisp_Object Qvariable_documentation, Qstandard_input; 2997extern Lisp_Object Qvariable_documentation, Qstandard_input;
2990extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; 2998extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
2999extern Lisp_Object Qlexical_binding;
2991extern Lisp_Object check_obarray (Lisp_Object); 3000extern Lisp_Object check_obarray (Lisp_Object);
2992extern Lisp_Object intern_1 (const char *, ptrdiff_t); 3001extern Lisp_Object intern_1 (const char *, ptrdiff_t);
2993extern Lisp_Object intern_c_string_1 (const char *, ptrdiff_t); 3002extern Lisp_Object intern_c_string_1 (const char *, ptrdiff_t);
@@ -3021,12 +3030,11 @@ intern_c_string (const char *str)
3021 3030
3022/* Defined in eval.c. */ 3031/* Defined in eval.c. */
3023extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qmacro; 3032extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qmacro;
3024extern Lisp_Object Qinhibit_quit, Qclosure; 3033extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure;
3025extern Lisp_Object Qand_rest; 3034extern Lisp_Object Qand_rest;
3026extern Lisp_Object Vautoload_queue; 3035extern Lisp_Object Vautoload_queue;
3027extern Lisp_Object Vsignaling_function; 3036extern Lisp_Object Vsignaling_function;
3028extern Lisp_Object inhibit_lisp_code; 3037extern Lisp_Object inhibit_lisp_code;
3029extern int handling_signal;
3030#if BYTE_MARK_STACK 3038#if BYTE_MARK_STACK
3031extern struct catchtag *catchlist; 3039extern struct catchtag *catchlist;
3032extern struct handler *handlerlist; 3040extern struct handler *handlerlist;
@@ -3075,6 +3083,7 @@ extern _Noreturn void error (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
3075extern _Noreturn void verror (const char *, va_list) 3083extern _Noreturn void verror (const char *, va_list)
3076 ATTRIBUTE_FORMAT_PRINTF (1, 0); 3084 ATTRIBUTE_FORMAT_PRINTF (1, 0);
3077extern Lisp_Object un_autoload (Lisp_Object); 3085extern Lisp_Object un_autoload (Lisp_Object);
3086extern Lisp_Object call_debugger (Lisp_Object arg);
3078extern void init_eval_once (void); 3087extern void init_eval_once (void);
3079extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...); 3088extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...);
3080extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); 3089extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
@@ -3137,7 +3146,7 @@ extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
3137extern Lisp_Object build_marker (struct buffer *, ptrdiff_t, ptrdiff_t); 3146extern Lisp_Object build_marker (struct buffer *, ptrdiff_t, ptrdiff_t);
3138extern void syms_of_marker (void); 3147extern void syms_of_marker (void);
3139 3148
3140/* Defined in fileio.c */ 3149/* Defined in fileio.c. */
3141 3150
3142extern Lisp_Object Qfile_error; 3151extern Lisp_Object Qfile_error;
3143extern Lisp_Object Qfile_exists_p; 3152extern Lisp_Object Qfile_exists_p;
@@ -3145,16 +3154,16 @@ extern Lisp_Object Qfile_directory_p;
3145extern Lisp_Object Qinsert_file_contents; 3154extern Lisp_Object Qinsert_file_contents;
3146extern Lisp_Object Qfile_name_history; 3155extern Lisp_Object Qfile_name_history;
3147extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object); 3156extern Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object);
3148EXFUN (Fread_file_name, 6); /* not a normal DEFUN */ 3157EXFUN (Fread_file_name, 6); /* Not a normal DEFUN. */
3149extern Lisp_Object close_file_unwind (Lisp_Object); 3158extern Lisp_Object close_file_unwind (Lisp_Object);
3150extern Lisp_Object restore_point_unwind (Lisp_Object); 3159extern Lisp_Object restore_point_unwind (Lisp_Object);
3151extern _Noreturn void report_file_error (const char *, Lisp_Object); 3160extern _Noreturn void report_file_error (const char *, Lisp_Object);
3152extern int internal_delete_file (Lisp_Object); 3161extern void internal_delete_file (Lisp_Object);
3153extern void syms_of_fileio (void); 3162extern void syms_of_fileio (void);
3154extern Lisp_Object make_temp_name (Lisp_Object, int); 3163extern Lisp_Object make_temp_name (Lisp_Object, bool);
3155extern Lisp_Object Qdelete_file; 3164extern Lisp_Object Qdelete_file;
3156 3165
3157/* Defined in search.c */ 3166/* Defined in search.c. */
3158extern void shrink_regexp_cache (void); 3167extern void shrink_regexp_cache (void);
3159extern void restore_search_regs (void); 3168extern void restore_search_regs (void);
3160extern void record_unwind_save_match_data (void); 3169extern void record_unwind_save_match_data (void);
@@ -3227,9 +3236,7 @@ extern void cmd_error_internal (Lisp_Object, const char *);
3227extern Lisp_Object command_loop_1 (void); 3236extern Lisp_Object command_loop_1 (void);
3228extern Lisp_Object recursive_edit_1 (void); 3237extern Lisp_Object recursive_edit_1 (void);
3229extern void record_auto_save (void); 3238extern void record_auto_save (void);
3230#ifdef SIGDANGER
3231extern void force_auto_save_soon (void); 3239extern void force_auto_save_soon (void);
3232#endif
3233extern void init_keyboard (void); 3240extern void init_keyboard (void);
3234extern void syms_of_keyboard (void); 3241extern void syms_of_keyboard (void);
3235extern void keys_of_keyboard (void); 3242extern void keys_of_keyboard (void);
@@ -3257,14 +3264,12 @@ extern void syms_of_frame (void);
3257extern char **initial_argv; 3264extern char **initial_argv;
3258extern int initial_argc; 3265extern int initial_argc;
3259#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) 3266#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
3260extern int display_arg; 3267extern bool display_arg;
3261#endif 3268#endif
3262extern Lisp_Object decode_env_path (const char *, const char *); 3269extern Lisp_Object decode_env_path (const char *, const char *);
3263extern Lisp_Object empty_unibyte_string, empty_multibyte_string; 3270extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
3264extern Lisp_Object Qfile_name_handler_alist; 3271extern Lisp_Object Qfile_name_handler_alist;
3265#ifdef FLOAT_CATCH_SIGILL 3272extern _Noreturn void fatal_error_backtrace (int, int);
3266extern void fatal_error_signal (int);
3267#endif
3268extern Lisp_Object Qkill_emacs; 3273extern Lisp_Object Qkill_emacs;
3269#if HAVE_SETLOCALE 3274#if HAVE_SETLOCALE
3270void fixup_locale (void); 3275void fixup_locale (void);
@@ -3276,22 +3281,26 @@ void synchronize_system_time_locale (void);
3276#define synchronize_system_messages_locale() 3281#define synchronize_system_messages_locale()
3277#define synchronize_system_time_locale() 3282#define synchronize_system_time_locale()
3278#endif 3283#endif
3279void shut_down_emacs (int, int, Lisp_Object); 3284extern void shut_down_emacs (int, Lisp_Object);
3280/* Nonzero means don't do interactive redisplay and don't change tty modes. */
3281extern int noninteractive;
3282 3285
3283/* Nonzero means remove site-lisp directories from load-path. */ 3286/* True means don't do interactive redisplay and don't change tty modes. */
3284extern int no_site_lisp; 3287extern bool noninteractive;
3288
3289/* True means remove site-lisp directories from load-path. */
3290extern bool no_site_lisp;
3285 3291
3286/* Pipe used to send exit notification to the daemon parent at 3292/* Pipe used to send exit notification to the daemon parent at
3287 startup. */ 3293 startup. */
3288extern int daemon_pipe[2]; 3294extern int daemon_pipe[2];
3289#define IS_DAEMON (daemon_pipe[1] != 0) 3295#define IS_DAEMON (daemon_pipe[1] != 0)
3290 3296
3291/* Nonzero means don't do use window-system-specific display code. */ 3297/* True if handling a fatal error already. */
3292extern int inhibit_window_system; 3298extern bool fatal_error_in_progress;
3293/* Nonzero means that a filter or a sentinel is running. */ 3299
3294extern int running_asynch_code; 3300/* True means don't do use window-system-specific display code. */
3301extern bool inhibit_window_system;
3302/* True means that a filter or a sentinel is running. */
3303extern bool running_asynch_code;
3295 3304
3296/* Defined in process.c. */ 3305/* Defined in process.c. */
3297extern Lisp_Object QCtype, Qlocal; 3306extern Lisp_Object QCtype, Qlocal;
@@ -3329,14 +3338,14 @@ extern void init_callproc (void);
3329extern void set_initial_environment (void); 3338extern void set_initial_environment (void);
3330extern void syms_of_callproc (void); 3339extern void syms_of_callproc (void);
3331 3340
3332/* Defined in doc.c */ 3341/* Defined in doc.c. */
3333extern Lisp_Object Qfunction_documentation; 3342extern Lisp_Object Qfunction_documentation;
3334extern Lisp_Object read_doc_string (Lisp_Object); 3343extern Lisp_Object read_doc_string (Lisp_Object);
3335extern Lisp_Object get_doc_string (Lisp_Object, bool, bool); 3344extern Lisp_Object get_doc_string (Lisp_Object, bool, bool);
3336extern void syms_of_doc (void); 3345extern void syms_of_doc (void);
3337extern int read_bytecode_char (bool); 3346extern int read_bytecode_char (bool);
3338 3347
3339/* Defined in bytecode.c */ 3348/* Defined in bytecode.c. */
3340extern Lisp_Object Qbytecode; 3349extern Lisp_Object Qbytecode;
3341extern void syms_of_bytecode (void); 3350extern void syms_of_bytecode (void);
3342extern struct byte_stack *byte_stack_list; 3351extern struct byte_stack *byte_stack_list;
@@ -3347,12 +3356,12 @@ extern void unmark_byte_stack (void);
3347extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object, 3356extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object,
3348 Lisp_Object, ptrdiff_t, Lisp_Object *); 3357 Lisp_Object, ptrdiff_t, Lisp_Object *);
3349 3358
3350/* Defined in macros.c */ 3359/* Defined in macros.c. */
3351extern Lisp_Object Qexecute_kbd_macro; 3360extern Lisp_Object Qexecute_kbd_macro;
3352extern void init_macros (void); 3361extern void init_macros (void);
3353extern void syms_of_macros (void); 3362extern void syms_of_macros (void);
3354 3363
3355/* Defined in undo.c */ 3364/* Defined in undo.c. */
3356extern Lisp_Object Qapply; 3365extern Lisp_Object Qapply;
3357extern Lisp_Object Qinhibit_read_only; 3366extern Lisp_Object Qinhibit_read_only;
3358extern void truncate_undo_list (struct buffer *); 3367extern void truncate_undo_list (struct buffer *);
@@ -3365,7 +3374,7 @@ extern void record_property_change (ptrdiff_t, ptrdiff_t,
3365 Lisp_Object, Lisp_Object, 3374 Lisp_Object, Lisp_Object,
3366 Lisp_Object); 3375 Lisp_Object);
3367extern void syms_of_undo (void); 3376extern void syms_of_undo (void);
3368/* Defined in textprop.c */ 3377/* Defined in textprop.c. */
3369extern Lisp_Object Qfont, Qmouse_face; 3378extern Lisp_Object Qfont, Qmouse_face;
3370extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks; 3379extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks;
3371extern Lisp_Object Qfront_sticky, Qrear_nonsticky; 3380extern Lisp_Object Qfront_sticky, Qrear_nonsticky;
@@ -3373,19 +3382,19 @@ extern Lisp_Object Qminibuffer_prompt;
3373 3382
3374extern void report_interval_modification (Lisp_Object, Lisp_Object); 3383extern void report_interval_modification (Lisp_Object, Lisp_Object);
3375 3384
3376/* Defined in menu.c */ 3385/* Defined in menu.c. */
3377extern void syms_of_menu (void); 3386extern void syms_of_menu (void);
3378 3387
3379/* Defined in xmenu.c */ 3388/* Defined in xmenu.c. */
3380extern void syms_of_xmenu (void); 3389extern void syms_of_xmenu (void);
3381 3390
3382/* Defined in termchar.h */ 3391/* Defined in termchar.h. */
3383struct tty_display_info; 3392struct tty_display_info;
3384 3393
3385/* Defined in termhooks.h */ 3394/* Defined in termhooks.h. */
3386struct terminal; 3395struct terminal;
3387 3396
3388/* Defined in sysdep.c */ 3397/* Defined in sysdep.c. */
3389#ifndef HAVE_GET_CURRENT_DIR_NAME 3398#ifndef HAVE_GET_CURRENT_DIR_NAME
3390extern char *get_current_dir_name (void); 3399extern char *get_current_dir_name (void);
3391#endif 3400#endif
@@ -3407,6 +3416,8 @@ extern int set_window_size (int, int, int);
3407extern EMACS_INT get_random (void); 3416extern EMACS_INT get_random (void);
3408extern void seed_random (void *, ptrdiff_t); 3417extern void seed_random (void *, ptrdiff_t);
3409extern void init_random (void); 3418extern void init_random (void);
3419extern void emacs_backtrace (int);
3420extern _Noreturn void emacs_abort (void) NO_INLINE;
3410extern int emacs_open (const char *, int, int); 3421extern int emacs_open (const char *, int, int);
3411extern int emacs_close (int); 3422extern int emacs_close (int);
3412extern ptrdiff_t emacs_read (int, char *, ptrdiff_t); 3423extern ptrdiff_t emacs_read (int, char *, ptrdiff_t);
@@ -3420,45 +3431,45 @@ extern void unlock_file (Lisp_Object);
3420extern void unlock_buffer (struct buffer *); 3431extern void unlock_buffer (struct buffer *);
3421extern void syms_of_filelock (void); 3432extern void syms_of_filelock (void);
3422 3433
3423/* Defined in sound.c */ 3434/* Defined in sound.c. */
3424extern void syms_of_sound (void); 3435extern void syms_of_sound (void);
3425 3436
3426/* Defined in category.c */ 3437/* Defined in category.c. */
3427extern void init_category_once (void); 3438extern void init_category_once (void);
3428extern Lisp_Object char_category_set (int); 3439extern Lisp_Object char_category_set (int);
3429extern void syms_of_category (void); 3440extern void syms_of_category (void);
3430 3441
3431/* Defined in ccl.c */ 3442/* Defined in ccl.c. */
3432extern void syms_of_ccl (void); 3443extern void syms_of_ccl (void);
3433 3444
3434/* Defined in dired.c */ 3445/* Defined in dired.c. */
3435extern void syms_of_dired (void); 3446extern void syms_of_dired (void);
3436extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, 3447extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
3437 Lisp_Object, Lisp_Object, 3448 Lisp_Object, Lisp_Object,
3438 bool, Lisp_Object); 3449 bool, Lisp_Object);
3439 3450
3440/* Defined in term.c */ 3451/* Defined in term.c. */
3441extern int *char_ins_del_vector; 3452extern int *char_ins_del_vector;
3442extern void syms_of_term (void); 3453extern void syms_of_term (void);
3443extern _Noreturn void fatal (const char *msgid, ...) 3454extern _Noreturn void fatal (const char *msgid, ...)
3444 ATTRIBUTE_FORMAT_PRINTF (1, 2); 3455 ATTRIBUTE_FORMAT_PRINTF (1, 2);
3445 3456
3446/* Defined in terminal.c */ 3457/* Defined in terminal.c. */
3447extern void syms_of_terminal (void); 3458extern void syms_of_terminal (void);
3448 3459
3449/* Defined in font.c */ 3460/* Defined in font.c. */
3450extern void syms_of_font (void); 3461extern void syms_of_font (void);
3451extern void init_font (void); 3462extern void init_font (void);
3452 3463
3453#ifdef HAVE_WINDOW_SYSTEM 3464#ifdef HAVE_WINDOW_SYSTEM
3454/* Defined in fontset.c */ 3465/* Defined in fontset.c. */
3455extern void syms_of_fontset (void); 3466extern void syms_of_fontset (void);
3456 3467
3457/* Defined in xfns.c, w32fns.c, or macfns.c */ 3468/* Defined in xfns.c, w32fns.c, or macfns.c. */
3458extern Lisp_Object Qfont_param; 3469extern Lisp_Object Qfont_param;
3459#endif 3470#endif
3460 3471
3461/* Defined in xfaces.c */ 3472/* Defined in xfaces.c. */
3462extern Lisp_Object Qdefault, Qtool_bar, Qfringe; 3473extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
3463extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor; 3474extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
3464extern Lisp_Object Qmode_line_inactive; 3475extern Lisp_Object Qmode_line_inactive;
@@ -3466,31 +3477,34 @@ extern Lisp_Object Qface;
3466extern Lisp_Object Qnormal; 3477extern Lisp_Object Qnormal;
3467extern Lisp_Object QCfamily, QCweight, QCslant; 3478extern Lisp_Object QCfamily, QCweight, QCslant;
3468extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground; 3479extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground;
3480extern Lisp_Object Qextra_light, Qlight, Qsemi_light, Qsemi_bold;
3481extern Lisp_Object Qbold, Qextra_bold, Qultra_bold;
3482extern Lisp_Object Qoblique, Qitalic;
3469extern Lisp_Object Vface_alternative_font_family_alist; 3483extern Lisp_Object Vface_alternative_font_family_alist;
3470extern Lisp_Object Vface_alternative_font_registry_alist; 3484extern Lisp_Object Vface_alternative_font_registry_alist;
3471extern void syms_of_xfaces (void); 3485extern void syms_of_xfaces (void);
3472 3486
3473#ifdef HAVE_X_WINDOWS 3487#ifdef HAVE_X_WINDOWS
3474/* Defined in xfns.c */ 3488/* Defined in xfns.c. */
3475extern void syms_of_xfns (void); 3489extern void syms_of_xfns (void);
3476 3490
3477/* Defined in xsmfns.c */ 3491/* Defined in xsmfns.c. */
3478extern void syms_of_xsmfns (void); 3492extern void syms_of_xsmfns (void);
3479 3493
3480/* Defined in xselect.c */ 3494/* Defined in xselect.c. */
3481extern void syms_of_xselect (void); 3495extern void syms_of_xselect (void);
3482 3496
3483/* Defined in xterm.c */ 3497/* Defined in xterm.c. */
3484extern void syms_of_xterm (void); 3498extern void syms_of_xterm (void);
3485#endif /* HAVE_X_WINDOWS */ 3499#endif /* HAVE_X_WINDOWS */
3486 3500
3487#ifdef HAVE_WINDOW_SYSTEM 3501#ifdef HAVE_WINDOW_SYSTEM
3488/* Defined in xterm.c, nsterm.m, w32term.c */ 3502/* Defined in xterm.c, nsterm.m, w32term.c. */
3489extern char *x_get_keysym_name (int); 3503extern char *x_get_keysym_name (int);
3490#endif /* HAVE_WINDOW_SYSTEM */ 3504#endif /* HAVE_WINDOW_SYSTEM */
3491 3505
3492#ifdef HAVE_LIBXML2 3506#ifdef HAVE_LIBXML2
3493/* Defined in xml.c */ 3507/* Defined in xml.c. */
3494extern void syms_of_xml (void); 3508extern void syms_of_xml (void);
3495extern void xml_cleanup_parser (void); 3509extern void xml_cleanup_parser (void);
3496#endif 3510#endif
@@ -3501,20 +3515,20 @@ extern int have_menus_p (void);
3501#endif 3515#endif
3502 3516
3503#ifdef HAVE_DBUS 3517#ifdef HAVE_DBUS
3504/* Defined in dbusbind.c */ 3518/* Defined in dbusbind.c. */
3505void syms_of_dbusbind (void); 3519void syms_of_dbusbind (void);
3506#endif 3520#endif
3507 3521
3508#ifdef DOS_NT 3522#ifdef DOS_NT
3509/* Defined in msdos.c, w32.c */ 3523/* Defined in msdos.c, w32.c. */
3510extern char *emacs_root_dir (void); 3524extern char *emacs_root_dir (void);
3511#endif /* DOS_NT */ 3525#endif /* DOS_NT */
3512 3526
3513/* Nonzero means Emacs has already been initialized. 3527/* True means Emacs has already been initialized.
3514 Used during startup to detect startup of dumped Emacs. */ 3528 Used during startup to detect startup of dumped Emacs. */
3515extern int initialized; 3529extern bool initialized;
3516 3530
3517extern int immediate_quit; /* Nonzero means ^G can quit instantly */ 3531extern int immediate_quit; /* Nonzero means ^G can quit instantly. */
3518 3532
3519extern void *xmalloc (size_t); 3533extern void *xmalloc (size_t);
3520extern void *xzalloc (size_t); 3534extern void *xzalloc (size_t);
@@ -3544,36 +3558,10 @@ extern void init_system_name (void);
3544#define make_fixnum_or_float(val) \ 3558#define make_fixnum_or_float(val) \
3545 (FIXNUM_OVERFLOW_P (val) ? make_float (val) : make_number (val)) 3559 (FIXNUM_OVERFLOW_P (val) ? make_float (val) : make_number (val))
3546 3560
3547
3548/* Checks the `cycle check' variable CHECK to see if it indicates that
3549 EL is part of a cycle; CHECK must be either Qnil or a value returned
3550 by an earlier use of CYCLE_CHECK. SUSPICIOUS is the number of
3551 elements after which a cycle might be suspected; after that many
3552 elements, this macro begins consing in order to keep more precise
3553 track of elements.
3554
3555 Returns nil if a cycle was detected, otherwise a new value for CHECK
3556 that includes EL.
3557
3558 CHECK is evaluated multiple times, EL and SUSPICIOUS 0 or 1 times, so
3559 the caller should make sure that's ok. */
3560
3561#define CYCLE_CHECK(check, el, suspicious) \
3562 (NILP (check) \
3563 ? make_number (0) \
3564 : (INTEGERP (check) \
3565 ? (XFASTINT (check) < (suspicious) \
3566 ? make_number (XFASTINT (check) + 1) \
3567 : Fcons (el, Qnil)) \
3568 : (!NILP (Fmemq ((el), (check))) \
3569 ? Qnil \
3570 : Fcons ((el), (check)))))
3571
3572
3573/* SAFE_ALLOCA normally allocates memory on the stack, but if size is 3561/* SAFE_ALLOCA normally allocates memory on the stack, but if size is
3574 larger than MAX_ALLOCA, use xmalloc to avoid overflowing the stack. */ 3562 larger than MAX_ALLOCA, use xmalloc to avoid overflowing the stack. */
3575 3563
3576enum MAX_ALLOCA { MAX_ALLOCA = 16*1024 }; 3564enum MAX_ALLOCA { MAX_ALLOCA = 16 * 1024 };
3577 3565
3578extern Lisp_Object safe_alloca_unwind (Lisp_Object); 3566extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3579extern void *record_xmalloc (size_t); 3567extern void *record_xmalloc (size_t);