Mercurial > hg > xemacs-beta
diff src/lisp.h @ 853:2b6fa2618f76
[xemacs-hg @ 2002-05-28 08:44:22 by ben]
merge my stderr-proc ws
make-docfile.c: Fix places where we forget to check for EOF.
code-init.el: Don't use CRLF conversion by default on process output. CMD.EXE and
friends work both ways but Cygwin programs don't like the CRs.
code-process.el, multicast.el, process.el: Removed.
Improvements to call-process-internal:
-- allows a buffer to be specified for input and stderr output
-- use it on all systems
-- implement C-g as documented
-- clean up and comment
call-process-region uses new call-process facilities; no temp file.
remove duplicate funs in process.el.
comment exactly how coding systems work and fix various problems.
open-multicast-group now does similar coding-system frobbing to
open-network-stream.
dumped-lisp.el, faces.el, msw-faces.el: Fix some hidden errors due to code not being defined at the right time.
xemacs.mak: Add -DSTRICT.
================================================================
ALLOW SEPARATION OF STDOUT AND STDERR IN PROCESSES
================================================================
Standard output and standard error can be processed separately in
a process. Each can have its own buffer, its own mark in that buffer,
and its filter function. You can specify a separate buffer for stderr
in `start-process' to get things started, or use the new primitives:
set-process-stderr-buffer
process-stderr-buffer
process-stderr-mark
set-process-stderr-filter
process-stderr-filter
Also, process-send-region takes a 4th optional arg, a buffer.
Currently always uses a pipe() under Unix to read the error output.
(#### Would a PTY be better?)
sysdep.h, sysproc.h, unexfreebsd.c, unexsunos4.c, nt.c, emacs.c, callproc.c, symsinit.h, sysdep.c, Makefile.in.in, process-unix.c: Delete callproc.c. Move child_setup() to process-unix.c.
wait_for_termination() now only needed on a few really old systems.
console-msw.h, event-Xt.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.h, process-nt.c, process-unix.c, process.c, process.h, procimpl.h: Rewrite the process methods to handle a separate channel for
error input. Create Lstreams for reading in the error channel.
Many process methods need change. In general the changes are
fairly clear as they involve duplicating what's used for reading
the normal stdout and changing for stderr -- although tedious,
as such changes are required throughout the entire process code.
Rewrote the code that reads process output to do two loops, one
for stdout and one for stderr.
gpmevent.c, tooltalk.c: set_process_filter takes an argument for stderr.
================================================================
NEW ERROR-TRAPPING MECHANISM
================================================================
Totally rewrite error trapping code to be unified and support more
features. Basic function is call_trapping_problems(), which lets
you specify, by means of flags, what sorts of problems you want
trapped. these can include
-- quit
-- errors
-- throws past the function
-- creation of "display objects" (e.g. buffers)
-- deletion of already-existing "display objects" (e.g. buffers)
-- modification of already-existing buffers
-- entering the debugger
-- gc
-- errors->warnings (ala suspended errors)
etc. All other error funs rewritten in terms of this one.
Various older mechanisms removed or rewritten.
window.c, insdel.c, console.c, buffer.c, device.c, frame.c: When creating a display object, added call to
note_object_created(), for use with trapping_problems mechanism.
When deleting, call check_allowed_operation() and note_object
deleted().
The trapping-problems code records the objects created since the
call-trapping-problems began. Those objects can be deleted, but
none others (i.e. previously existing ones).
bytecode.c, cmdloop.c: internal_catch takes another arg.
eval.c: Add long comments describing the "five lists" used to maintain
state (backtrace, gcpro, specbind, etc.) in the Lisp engine.
backtrace.h, eval.c: Implement trapping-problems mechanism, eliminate old mechanisms or
redo in terms of new one.
frame.c, gutter.c: Flush out the concept of "critical display section", defined by
the in_display() var. Use an internal_bind() to get it reset,
rather than just doing it at end, because there may be a non-local
exit.
event-msw.c, event-stream.c, console-msw.h, device.c, dialog-msw.c, frame.c, frame.h, intl.c, toolbar.c, menubar-msw.c, redisplay.c, alloc.c, menubar-x.c: Make use of new trapping-errors stuff and rewrite code based on
old mechanisms.
glyphs-widget.c, redisplay.h: Protect calling Lisp in redisplay.
insdel.c: Protect hooks against deleting existing buffers.
frame-msw.c: Use EQ, not EQUAL in hash tables whose keys are just numbers.
Otherwise we run into stickiness in redisplay because
internal_equal() can QUIT.
================================================================
SIGNAL, C-G CHANGES
================================================================
Here we change the way that C-g interacts with event reading. The
idea is that a C-g occurring while we're reading a user event
should be read as C-g, but elsewhere should be a QUIT. The former
code did all sorts of bizarreness -- requiring that no QUIT occurs
anywhere in event-reading code (impossible to enforce given the
stuff called or Lisp code invoked), and having some weird system
involving enqueue/dequeue of a C-g and interaction with Vquit_flag
-- and it didn't work.
Now, we simply enclose all code where we want C-g read as an event
with {begin/end}_dont_check_for_quit(). This completely turns off
the mechanism that checks (and may remove or alter) C-g in the
read-ahead queues, so we just get the C-g normal.
Signal.c documents this very carefully.
cmdloop.c: Correct use of dont_check_for_quit to new scheme, remove old
out-of-date comments.
event-stream.c: Fix C-g handling to actually work.
device-x.c: Disable quit checking when err out.
signal.c: Cleanup. Add large descriptive comment.
process-unix.c, process-nt.c, sysdep.c: Use QUIT instead of REALLY_QUIT.
It's not necessary to use REALLY_QUIT and just confuses the issue.
lisp.h: Comment quit handlers.
================================================================
CONS CHANGES
================================================================
free_cons() now takes a Lisp_Object not the result of XCONS().
car and cdr have been renamed so that they don't get used directly;
go through XCAR(), XCDR() instead.
alloc.c, dired.c, editfns.c, emodules.c, fns.c, glyphs-msw.c, glyphs-x.c, glyphs.c, keymap.c, minibuf.c, search.c, eval.c, lread.c, lisp.h: Correct free_cons calling convention: now takes Lisp_Object,
not Lisp_Cons
chartab.c: Eliminate direct use of ->car, ->cdr, should be black box.
callint.c: Rewrote using EXTERNAL_LIST_LOOP to avoid use of Lisp_Cons.
================================================================
USE INTERNAL-BIND-*
================================================================
eval.c: Cleanups of these funs.
alloc.c, fileio.c, undo.c, specifier.c, text.c, profile.c, lread.c, redisplay.c, menubar-x.c, macros.c: Rewrote to use internal_bind_int() and internal_bind_lisp_object()
in place of whatever varied and cumbersome mechanisms were
formerly there.
================================================================
SPECBIND SANITY
================================================================
backtrace.h: - Improved comments
backtrace.h, bytecode.c, eval.c: Add new mechanism check_specbind_stack_sanity() for sanity
checking code each time the catchlist or specbind stack change.
Removed older prototype of same mechanism.
================================================================
MISC
================================================================
lisp.h, insdel.c, window.c, device.c, console.c, buffer.c: Fleshed out authorship.
device-msw.c: Correct bad Unicode-ization.
print.c: Be more careful when not initialized or in fatal error handling.
search.c: Eliminate running_asynch_code, an FSF holdover.
alloc.c: Added comments about gc-cons-threshold.
dialog-x.c: Use begin_gc_forbidden() around code to build up a widget value
tree, like in menubar-x.c.
gui.c: Use Qunbound not Qnil as the default for
gethash.
lisp-disunion.h, lisp-union.h: Added warnings on use of VOID_TO_LISP().
lisp.h: Use ERROR_CHECK_STRUCTURES to turn on
ERROR_CHECK_TRAPPING_PROBLEMS and ERROR_CHECK_TYPECHECK
lisp.h: Add assert_with_message.
lisp.h: Add macros for gcproing entire arrays. (You could do this before
but it required manual twiddling the gcpro structure.)
lisp.h: Add prototypes for new functions defined elsewhere.
author | ben |
---|---|
date | Tue, 28 May 2002 08:45:36 +0000 |
parents | e7ee5f8bde58 |
children | 2c12fe2da451 |
line wrap: on
line diff
--- a/src/lisp.h Sat May 25 01:55:30 2002 +0000 +++ b/src/lisp.h Tue May 28 08:45:36 2002 +0000 @@ -22,6 +22,31 @@ /* Synched up with: FSF 19.30. */ +/* Authorship: + + Based on code from pre-release FSF 19, c. 1991. + Various changes by Jamie Zawinski 1991-1994: + converting to ANSI C, splitting out function prototypes to a separate + file (later moved back for unknown reasons by Steve Baur?), debug-gcpro + stuff (now moribund). + ANSI-fication of DEFUN macros by Felix Lee, c. 1992? + NOT_REACHED, DOESNT_RETURN, PRINTF_ARGS by Richard Mlynarik, c. 1994. + Many changes over the years corresponding to Lisp_Object definition + changes, esp. by Richard Mlynarik (c. 1993) and Kyle Jones (c. 1998). + See alloc.c for more details. + Overhauled and reordered by Ben Wing, 1995-1996, and many things added: + Dynarrs, REALLOC macros, asserts, typedefs, inline header code, + first LIST_LOOP macros, CONCHECK_*, all error-checking code + (e.g. error-checking versions of XFOO macros), structure read syntax, + weak lists, lcrecord lists, reworking of quit handling, object hashing, + nested GCPRO, character objects and Ebola checking, memory usage stats, + others. + LOADHIST changes from Steve Baur, c. 1997? + Various macro-related changes by Martin Buchholz, 1998-1999: + LIST_LOOP macros greatly expanded and tortoise-hared; + RETURN_SANS_WARNINGS; reworked DEFUN macros; EXFUN macros (???). +*/ + #ifndef INCLUDED_lisp_h_ #define INCLUDED_lisp_h_ @@ -45,6 +70,21 @@ #include <sys/types.h> #include <limits.h> +/* --------------------- error-checking sublevels --------------------- */ + +/* The large categories established by configure can be subdivided into + smaller subcategories, for problems in specific modules. You can't + control this using configure, but you can manually stick in a define as + necessary. */ + +#ifdef ERROR_CHECK_STRUCTURES +/* Check for problems with the catch list and specbind stack */ +#define ERROR_CHECK_CATCH +/* Check for insufficient use of call_trapping_problems(), particularly + due to glyph-related changes causing eval or QUIT within redisplay */ +#define ERROR_CHECK_TRAPPING_PROBLEMS +#endif + /* ------------------------ definition of EMACS_INT ------------------- */ /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. @@ -895,18 +935,44 @@ void assert_failed (const char *, int, const char *); # define abort() (assert_failed (__FILE__, __LINE__, "abort()")) # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) +# define assert_with_message(x, msg) \ + ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg)) # define assert_at_line(x, file, line) \ ((x) ? (void) 0 : assert_failed (file, line, #x)) #else # ifdef DEBUG_XEMACS # define assert(x) ((x) ? (void) 0 : (void) abort ()) +# define assert_with_message(x, msg) ((x) ? (void) 0 : (void) abort ()) # define assert_at_line(x, file, line) assert (x) # else # define assert(x) ((void) 0) +# define assert_with_message(x, msg) # define assert_at_line(x, file, line) assert (x) # endif #endif +/* #### + Why the hell do we do this??????????????????????????????? */ +/*#ifdef DEBUG_XEMACS*/ +#define REGISTER +#define register +/*#else*/ +/*#define REGISTER register*/ +/*#endif*/ + + +/* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. + In particular, it must be large enough to contain a pointer. + config.h can override this, e.g. to use `long long' for bigger lisp ints. + + #### In point of fact, it would NOT be a good idea for config.h to mess + with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT + is the size of a pointer. */ + +#ifndef SIZEOF_EMACS_INT +# define SIZEOF_EMACS_INT SIZEOF_VOID_P +#endif + #if 0 #ifdef USE_ASSERTIONS /* Highly dubious kludge */ @@ -1144,10 +1210,7 @@ Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats); #endif - -/************************************************************************/ -/* typedefs */ -/************************************************************************/ +/* Counts of bytes or chars */ /* Note that the simplest typedefs are near the top of this file. */ @@ -1493,7 +1556,7 @@ struct Lisp_Cons { struct lrecord_header lheader; - Lisp_Object car, cdr; + Lisp_Object car_, cdr_; }; typedef struct Lisp_Cons Lisp_Cons; @@ -1522,8 +1585,12 @@ extern Lisp_Object Qnil; #define NILP(x) EQ (x, Qnil) -#define XCAR(a) (XCONS (a)->car) -#define XCDR(a) (XCONS (a)->cdr) +#define cons_car(a) ((a)->car_) +#define cons_cdr(a) ((a)->cdr_) +#define XCAR(a) (XCONS (a)->car_) +#define XCDR(a) (XCONS (a)->cdr_) +#define XSETCAR(a, b) (XCONS (a)->car_ = (b)) +#define XSETCDR(a, b) (XCONS (a)->cdr_ = (b)) #define LISTP(x) (CONSP(x) || NILP(x)) #define CHECK_LIST(x) do { \ @@ -2163,6 +2230,7 @@ #define BIT_VECTOR_LONG_STORAGE(len) \ (((len) + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2) + /*------------------------------ symbol --------------------------------*/ typedef struct Lisp_Symbol Lisp_Symbol; @@ -2206,6 +2274,8 @@ /*------------------------------- subr ---------------------------------*/ +/* A function that takes no arguments and returns a Lisp_Object. + We could define such types for n arguments, if needed. */ typedef Lisp_Object (*lisp_fn_t) (void); struct Lisp_Subr @@ -2693,48 +2763,72 @@ /* Checking for QUIT */ /************************************************************************/ +/* The exact workings of this mechanism are described in detail in signal.c. */ + /* Asynchronous events set something_happened, and then are processed within the QUIT macro. At this point, we are guaranteed to not be in any sensitive code. */ extern volatile int something_happened; extern int dont_check_for_quit; -int check_what_happened (void); +void check_what_happened (void); extern volatile int quit_check_signal_happened; extern volatile int quit_check_signal_tick_count; -int check_quit (void); +void check_quit (void); void signal_quit (void); +extern int dont_check_for_quit; +int begin_dont_check_for_quit (void); +int begin_do_check_for_quit (void); + +/* Nonzero if the values of `quit-flag' and `inhibit-quit' indicate + that a quit should be signalled. */ #define QUIT_FLAG_SAYS_SHOULD_QUIT \ (!NILP (Vquit_flag) && \ (NILP (Vinhibit_quit) \ || (EQ (Vquit_flag, Qcritical) && !dont_check_for_quit))) -/* Nonzero if ought to quit now. */ +/* Nonzero if ought to quit now. This is the "efficient" version, which + respects the flags set to indicate whether the full quit check should + be done. Therefore it may be inaccurate (i.e. lagging reality), esp. + when poll for quit is used. + + This is defined for code that wants to allow quitting, but needs to + do some cleanup if that happens. (You could always register the cleanup + code using record_unwind_protect(), but sometimes it makes more sense + to do it using QUITP.) To use this macro, just call it at the + appropriate time, and if its value is non-zero, do your cleanup code + and then call QUIT. + + A different version (below) is used for the actual QUIT macro. */ #define QUITP \ - ((quit_check_signal_happened ? check_quit () : 0), \ + ((quit_check_signal_happened ? check_quit () : (void) 0), \ QUIT_FLAG_SAYS_SHOULD_QUIT) -/* QUIT used to call QUITP, but there are some places where QUITP - is called directly, and check_what_happened() should only be called - when Emacs is actually ready to quit because it could do things - like switch threads. */ +/* This is the version actually called by QUIT. The difference + between it and QUITP is that it also has side effects in that it + will handle anything else that has recently signalled itself + asynchronously and wants to be handled now. Currently this + includes executing asynchronous timeouts that may have been set + from Lisp or from the poll-for-quit or poll-for-sigchld + timers. (#### It seems that, to be slightly more accurate, we + should also process poll-for-quit timers in the above version. + However, this mechanism is inherently approximate, so it really + doesn't matter much.) In the future, it might also include doing a + thread context switch. Callers of QUITP generally don't except + random side effects to happen, so we have this different + version. */ #define INTERNAL_QUITP \ - ((something_happened ? check_what_happened () : 0), \ - QUIT_FLAG_SAYS_SHOULD_QUIT) - -#define INTERNAL_REALLY_QUITP \ - (check_what_happened (), \ + ((something_happened ? check_what_happened () : (void) 0), \ QUIT_FLAG_SAYS_SHOULD_QUIT) /* Check quit-flag and quit if it is non-nil. Also do any other things - that might have gotten queued until it was safe. */ + that are triggered by asynchronous events and might want to be + handled. */ #define QUIT do { if (INTERNAL_QUITP) signal_quit (); } while (0) -#define REALLY_QUIT do { if (INTERNAL_REALLY_QUITP) signal_quit (); } while (0) - /************************************************************************/ /* hashing */ @@ -2924,6 +3018,21 @@ gcpro5.next = &gcpro4, gcpro5.var = &var5, gcpro5.nvars = 1, \ gcprolist = &gcpro5 )) +#define GCPRO1_ARRAY(array, n) ((void) ( \ + gcpro1.next = gcprolist, gcpro1.var = array, gcpro1.nvars = n, \ + gcprolist = &gcpro1 )) + +#define GCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \ + gcpro1.next = gcprolist, gcpro1.var = array1, gcpro1.nvars = n1, \ + gcpro2.next = &gcpro1, gcpro2.var = array2, gcpro2.nvars = n2, \ + gcprolist = &gcpro2 )) + +#define GCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \ + gcpro1.next = gcprolist, gcpro1.var = array1, gcpro1.nvars = n1, \ + gcpro2.next = &gcpro1, gcpro2.var = array2, gcpro2.nvars = n2, \ + gcpro3.next = &gcpro2, gcpro3.var = array3, gcpro3.nvars = n3, \ + gcprolist = &gcpro3 )) + #define UNGCPRO ((void) (gcprolist = gcpro1.next)) #define NGCPRO1(var1) ((void) ( \ @@ -2956,6 +3065,21 @@ ngcpro5.next = &ngcpro4, ngcpro5.var = &var5, ngcpro5.nvars = 1, \ gcprolist = &ngcpro5 )) +#define NGCPRO1_ARRAY(array, n) ((void) ( \ + ngcpro1.next = gcprolist, ngcpro1.var = array, ngcpro1.nvars = n, \ + gcprolist = &ngcpro1 )) + +#define NGCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \ + ngcpro1.next = gcprolist, ngcpro1.var = array1, ngcpro1.nvars = n1, \ + ngcpro2.next = &ngcpro1, ngcpro2.var = array2, ngcpro2.nvars = n2, \ + gcprolist = &ngcpro2 )) + +#define NGCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \ + ngcpro1.next = gcprolist, ngcpro1.var = array1, ngcpro1.nvars = n1, \ + ngcpro2.next = &ngcpro1, ngcpro2.var = array2, ngcpro2.nvars = n2, \ + ngcpro3.next = &ngcpro2, ngcpro3.var = array3, ngcpro3.nvars = n3, \ + gcprolist = &ngcpro3 )) + #define NUNGCPRO ((void) (gcprolist = ngcpro1.next)) #define NNGCPRO1(var1) ((void) ( \ @@ -2988,6 +3112,21 @@ nngcpro5.next = &nngcpro4, nngcpro5.var = &var5, nngcpro5.nvars = 1, \ gcprolist = &nngcpro5 )) +#define NNGCPRO1_ARRAY(array, n) ((void) ( \ + nngcpro1.next = gcprolist, nngcpro1.var = array, nngcpro1.nvars = n, \ + gcprolist = &nngcpro1 )) + +#define NNGCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \ + nngcpro1.next = gcprolist, nngcpro1.var = array1, nngcpro1.nvars = n1, \ + nngcpro2.next = &nngcpro1, nngcpro2.var = array2, nngcpro2.nvars = n2, \ + gcprolist = &nngcpro2 )) + +#define NNGCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \ + nngcpro1.next = gcprolist, nngcpro1.var = array1, nngcpro1.nvars = n1, \ + nngcpro2.next = &nngcpro1, nngcpro2.var = array2, nngcpro2.nvars = n2, \ + nngcpro3.next = &nngcpro2, nngcpro3.var = array3, nngcpro3.nvars = n3, \ + gcprolist = &nngcpro3 )) + #define NNUNGCPRO ((void) (gcprolist = nngcpro1.next)) #endif /* ! DEBUG_GCPRO */ @@ -3181,7 +3320,6 @@ DECLARE_DOESNT_RETURN (memory_full (void)); void disksave_object_finalization (void); extern int purify_flag; -extern int gc_currently_forbidden; extern EMACS_INT gc_generation_number[1]; int c_readonly (Lisp_Object); int lisp_readonly (Lisp_Object); @@ -3196,7 +3334,7 @@ Lisp_Object make_uninit_string (Bytecount); Lisp_Object make_float (double); Lisp_Object make_string_nocopy (const Intbyte *, Bytecount); -void free_cons (Lisp_Cons *); +void free_cons (Lisp_Object); void free_list (Lisp_Object); void free_alist (Lisp_Object); void mark_conses_in_list (Lisp_Object); @@ -3273,11 +3411,6 @@ DECLARE_DOESNT_RETURN (invalid_byte_code (const CIntbyte *reason, Lisp_Object frob)); -/* Defined in callproc.c */ -Intbyte *egetenv (const CIntbyte *var); -void eputenv (const CIntbyte *var, const CIntbyte *value); -extern int env_initted; - /* Defined in callint.c */ EXFUN (Fcall_interactively, 3); EXFUN (Fprefix_numeric_value, 1); @@ -3469,7 +3602,6 @@ extern int inhibit_non_essential_printing_operations; extern int preparing_for_armageddon; extern Fixnum emacs_priority; -extern int running_asynch_code; extern int suppress_early_error_handler_backtrace; void debug_break (void); int debug_can_access_memory (void *ptr, Bytecount len); @@ -3493,6 +3625,9 @@ EXFUN (Fprogn, UNEVALLED); EXFUN (Fsignal, 2); EXFUN (Fthrow, 2); +EXFUN (Fcall_with_condition_handler, MANY); +EXFUN (Ffunction_max_args, 1); +EXFUN (Ffunction_min_args, 1); DECLARE_DOESNT_RETURN (signal_error_1 (Lisp_Object, Lisp_Object)); void maybe_signal_error_1 (Lisp_Object, Lisp_Object, Lisp_Object, @@ -3652,21 +3787,116 @@ Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); Lisp_Object eval_in_buffer (struct buffer *, Lisp_Object); -Lisp_Object call0_with_handler (Lisp_Object, Lisp_Object); -Lisp_Object call1_with_handler (Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object eval_in_buffer_trapping_errors (const CIntbyte *, struct buffer *, - Lisp_Object); -Lisp_Object run_hook_trapping_errors (const CIntbyte *, Lisp_Object); -Lisp_Object safe_run_hook_trapping_errors (const CIntbyte *, Lisp_Object, int); -Lisp_Object call0_trapping_errors (const CIntbyte *, Lisp_Object); -Lisp_Object call1_trapping_errors (const CIntbyte *, Lisp_Object, Lisp_Object); -Lisp_Object call2_trapping_errors (const CIntbyte *, - Lisp_Object, Lisp_Object, Lisp_Object); -Lisp_Object call_with_suspended_errors (lisp_fn_t, volatile Lisp_Object, Lisp_Object, + +struct call_trapping_problems_result +{ + int caught_error, caught_throw; + Lisp_Object error_conditions, data; + Lisp_Object backtrace; + Lisp_Object thrown_tag; + Lisp_Object thrown_value; +}; + +#define NO_INHIBIT_ERRORS (1<<0) +#define NO_INHIBIT_THROWS (1<<1) +#define INTERNAL_INHIBIT_ERRORS (1<<0) +#define INTERNAL_INHIBIT_THROWS (1<<1) +#define INHIBIT_WARNING_ISSUE (1<<2) +#define ISSUE_WARNINGS_AT_DEBUG_LEVEL (1<<3) +#define INHIBIT_QUIT (1<<4) +#define UNINHIBIT_QUIT (1<<5) +#define INHIBIT_GC (1<<6) +#define INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION (1<<7) +#define INHIBIT_EXISTING_CODING_SYSTEM_DELETION (1<<8) +#define INHIBIT_EXISTING_CHARSET_DELETION (1<<9) +#define INHIBIT_PERMANENT_DISPLAY_OBJECT_CREATION (1<<10) +#define INHIBIT_CODING_SYSTEM_CREATION (1<<11) +#define INHIBIT_CHARSET_CREATION (1<<12) +#define INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION (1<<13) +#define INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY (1<<14) +#define INHIBIT_ENTERING_DEBUGGER (1<<15) +#define CALL_WITH_SUSPENDED_ERRORS (1<<16) + +enum check_allowed_operation +{ + OPERATION_DELETE_OBJECT, + OPERATION_CREATE_OBJECT, + OPERATION_MODIFY_BUFFER_TEXT, + OPERATION_MODIFY_OBJECT_PROPERTY, +}; + +int get_inhibit_flags (void); +void check_allowed_operation (int what, Lisp_Object obj, Lisp_Object prop); +void note_object_created (Lisp_Object obj); +void note_object_deleted (Lisp_Object obj); +Lisp_Object call_with_condition_handler (Lisp_Object (*handler) (Lisp_Object, + Lisp_Object, + Lisp_Object), + Lisp_Object handler_arg, + Lisp_Object (*fun) (Lisp_Object), + Lisp_Object arg); +Lisp_Object call_trapping_problems (Lisp_Object warning_class, + const char *warning_string, + int flags, + struct call_trapping_problems_result + *problem, + Lisp_Object (*fun) (void *), + void *arg); +Lisp_Object va_call_trapping_problems (Lisp_Object warning_class, + const char *warning_string, + int flags, + struct call_trapping_problems_result + *problem, + lisp_fn_t fun, int nargs, ...); +Lisp_Object call0_trapping_problems (const char *, Lisp_Object, int); +Lisp_Object call1_trapping_problems (const char *, Lisp_Object, Lisp_Object, + int); +Lisp_Object call2_trapping_problems (const char *, Lisp_Object, Lisp_Object, + Lisp_Object, int); +Lisp_Object call3_trapping_problems (const char *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, int); +Lisp_Object call4_trapping_problems (const char *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object, + int); +Lisp_Object call5_trapping_problems (const char *, Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, int); +Lisp_Object eval_in_buffer_trapping_problems (const char *, struct buffer *, + Lisp_Object, int); +Lisp_Object run_hook_trapping_problems (const char *, Lisp_Object, int); +Lisp_Object safe_run_hook_trapping_problems (const char *, Lisp_Object, int); +Lisp_Object run_hook_with_args_in_buffer_trapping_problems (const char + *warning_string, + struct buffer + *buf, int nargs, + Lisp_Object *args, + enum + run_hooks_condition + cond, int flags); +Lisp_Object run_hook_with_args_trapping_problems (const char *warning_string, + int nargs, + Lisp_Object *args, + enum run_hooks_condition + cond, + int flags); +Lisp_Object va_run_hook_with_args_trapping_problems (const char + *warning_string, + Lisp_Object hook_var, + int nargs, ...); +Lisp_Object va_run_hook_with_args_in_buffer_trapping_problems (const char + *warning_string, + struct buffer + *buf, + Lisp_Object + hook_var, + int nargs, ...); +Lisp_Object call_with_suspended_errors (lisp_fn_t, Lisp_Object, + Lisp_Object, Error_Behavior, int, ...); /* C Code should be using internal_catch, record_unwind_p, condition_case_1 */ Lisp_Object internal_catch (Lisp_Object, Lisp_Object (*) (Lisp_Object), - Lisp_Object, int * volatile); + Lisp_Object, int * volatile, + Lisp_Object * volatile); Lisp_Object condition_case_1 (Lisp_Object, Lisp_Object (*) (Lisp_Object), Lisp_Object, @@ -3677,6 +3907,7 @@ #define unbind_to(obj) unbind_to_1 (obj, Qnil) void specbind (Lisp_Object, Lisp_Object); int record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); +int record_unwind_protect_freeing (void *ptr); int record_unwind_protect_freeing_dynarr (void *ptr); int internal_bind_int (int *addr, int newval); int internal_bind_lisp_object (Lisp_Object *addr, Lisp_Object newval); @@ -3964,6 +4195,13 @@ void external_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object, int, Error_Behavior); int external_remprop (Lisp_Object *, Lisp_Object, int, Error_Behavior); +int internal_equal_trapping_problems (Lisp_Object warning_class, + const char *warning_string, + int flags, + struct call_trapping_problems_result *p, + int retval, + Lisp_Object obj1, Lisp_Object obj2, + int depth); int internal_equal (Lisp_Object, Lisp_Object, int); int internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth); Lisp_Object concat2 (Lisp_Object, Lisp_Object); @@ -4199,6 +4437,10 @@ DECLARE_DOESNT_RETURN (report_network_error (const char *, Lisp_Object)); extern Lisp_Object Vlisp_EXEC_SUFFIXES; +Intbyte *egetenv (const CIntbyte *var); +void eputenv (const CIntbyte *var, const CIntbyte *value); +extern int env_initted; + /* Defined in profile.c */ void mark_profiling_info (void); void profile_increase_call_count (Lisp_Object); @@ -4253,7 +4495,6 @@ /* Defined in signal.c */ void init_interrupts_late (void); -int begin_dont_check_for_quit (void); /* Defined in sound.c */ EXFUN (Fding, 3);