annotate src/backtrace.h @ 814:a634e3b7acc8

[xemacs-hg @ 2002-04-14 12:41:59 by ben] latest changes TODO.ben-mule-21-5: Update. make-docfile.c: Add basic support for handling ISO 2022 doc strings -- we parse the basic charset designation sequences so we know whether we're in ASCII and have to pay attention to end quotes and such. Reformat code according to coding standards. abbrev.el: Add `global-abbrev-mode', which turns on or off abbrev-mode in all buffers. Added `defining-abbrev-turns-on-abbrev-mode' -- if non-nil, defining an abbrev through an interactive function will automatically turn on abbrev-mode, either globally or locally depending on the command. This is the "what you'd expect" behavior. indent.el: general function for indenting a balanced expression in a mode-correct way. Works similar to indent-region in that a mode can specify a specific command to do the whole operation; if not, figure out the region using forward-sexp and indent each line using indent-according-to-mode. keydefs.el: Removed. Modify M-C-backslash to do indent-region-or-balanced-expression. Make S-Tab just insert a TAB char, like it's meant to do. make-docfile.el: Now that we're using the call-process-in-lisp, we need to load an extra file win32-native.el because we're running a bare temacs. menubar-items.el: Totally redo the Cmds menu so that most used commands appear directly on the menu and less used commands appear in submenus. The old way may have been very pretty, but rather impractical. process.el: Under Windows, don't ever use old-call-process-internal, even in batch mode. We can do processes in batch mode. subr.el: Someone recoded truncate-string-to-width, saying "the FSF version is too complicated and does lots of hard-to-understand stuff" but the resulting recoded version was *totally* wrong! it misunderstood the basic point of this function, which is work in *columns* not chars. i dumped ours and copied the version from FSF 21.1. Also added truncate-string-with-continuation-dots, since this idiom is used often. config.inc.samp, xemacs.mak: Separate out debug and optimize flags. Remove all vestiges of USE_MINIMAL_TAGBITS, USE_INDEXED_LRECORD_IMPLEMENTATION, and GUNG_HO, since those ifdefs have long been removed. Make error-checking support actually work. Some rearrangement of config.inc.samp to make it more logical. Remove callproc.c and ntproc.c from xemacs.mak, no longer used. Make pdump the default. lisp.h: Add support for strong type-checking of Bytecount, Bytebpos, Charcount, Charbpos, and others, by making them classes, overloading the operators to provide integer-like operation and carefully controlling what operations are allowed. Not currently enabled in C++ builds because there are still a number of compile errors, and it won't really work till we merge in my "8-bit-Mule" workspace, in which I make use of the new types Charxpos, Bytexpos, Memxpos, representing a "position" either in a buffer or a string. (This is especially important in the extent code.) abbrev.c, alloc.c, eval.c, buffer.c, buffer.h, editfns.c, fns.c, text.h: Warning fixes, some of them related to new C++ strict type checking of Bytecount, Charbpos, etc. dired.c: Caught an actual error due to strong type checking -- char len being passed when should be byte len. alloc.c, backtrace.h, bytecode.c, bytecode.h, eval.c, sysdep.c: Further optimize Ffuncall: -- process arg list at compiled-function creation time, converting into an array for extra-quick access at funcall time. -- rewrite funcall_compiled_function to use it, and inline this function. -- change the order of check for magic stuff in SPECBIND_FAST_UNSAFE to be faster. -- move the check for need to garbage collect into the allocation code, so only a single flag needs to be checked in funcall. buffer.c, symbols.c: add debug funs to check on mule optimization info in buffers and strings. eval.c, emacs.c, text.c, regex.c, scrollbar-msw.c, search.c: Fix evil crashes due to eistrings not properly reinitialized under pdump. Redo a bit some of the init routines; convert some complex_vars_of() into simple vars_of(), because they didn't need complex processing. callproc.c, emacs.c, event-stream.c, nt.c, process.c, process.h, sysdep.c, sysdep.h, syssignal.h, syswindows.h, ntproc.c: Delete. Hallelujah, praise the Lord, there is no god but Allah!!! fix so that processes can be invoked in bare temacs -- thereby eliminating any need for callproc.c. (currently only eliminated under NT.) remove all crufty and unnecessary old process code in ntproc.c and elsewhere. move non-callproc-specific stuff (mostly environment) into process.c, so callproc.c can be left out under NT. console-tty.c, doc.c, file-coding.c, file-coding.h, lstream.c, lstream.h: fix doc string handling so it works with Japanese, etc docs. change handling of "character mode" so callers don't have to manually set it (quite error-prone). event-msw.c: spacing fixes. lread.c: eliminate unused crufty vintage-19 "FSF defun hack" code. lrecord.h: improve pdump description docs. buffer.c, ntheap.c, unexnt.c, win32.c, emacs.c: Mule-ize some unexec and startup code. It was pseudo-Mule-ized before by simply always calling the ...A versions of functions, but that won't cut it -- eventually we want to be able to run properly even if XEmacs has been installed in a Japanese directory. (The current problem is the timing of the loading of the Unicode tables; this will eventually be fixed.) Go through and fix various other places where the code was not Mule-clean. Provide a function mswindows_get_module_file_name() to get our own name without resort to PATH_MAX and such. Add a big comment in main() about the problem with Unicode table load timing that I just alluded to. emacs.c: When error-checking is enabled (interpreted as "user is developing XEmacs"), don't ask user to "pause to read messages" when a fatal error has occurred, because it will wedge if we are in an inner modal loop (typically when a menu is popped up) and make us unable to get a useful stack trace in the debugger. text.c: Correct update_entirely_ascii_p_flag to actually work. lisp.h, symsinit.h: declarations for above changes.
author ben
date Sun, 14 Apr 2002 12:43:31 +0000
parents a5954632b187
children 2b6fa2618f76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* The lisp stack.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 /* Synched up with: FSF 19.30. Contained redundantly in various C files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 in FSFmacs. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 /* Authorship:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 FSF: Original version; a long time ago.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 XEmacs: split out of some C files. (For some obscure reason, a header
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 file couldn't be used in FSF Emacs, but XEmacs doesn't have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 that problem.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 Mly (probably) or JWZ: Some changes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
33 #ifndef INCLUDED_backtrace_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
34 #define INCLUDED_backtrace_h_
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 #include <setjmp.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 /* These definitions are used in eval.c and alloc.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 struct backtrace
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 struct backtrace *next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 Lisp_Object *function;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 Lisp_Object *args; /* Points to vector of args. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 int nargs; /* Length of vector.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 If nargs is UNEVALLED, args points to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 slot holding list of unevalled args */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 int pdlcount; /* specpdl_depth () when invoked */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 char evalargs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 /* Nonzero means call value of debugger when done with this operation. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 char debug_on_exit;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 /* This structure helps implement the `catch' and `throw' control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 structure. A struct catchtag contains all the information needed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 to restore the state of the interpreter after a non-local jump.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 Handlers for error conditions (represented by `struct handler'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 structures) just point to a catch tag to do the cleanup required
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 for their jumps.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 catchtag structures are chained together in the C calling stack;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 the `next' member points to the next outer catchtag.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 A call like (throw TAG VAL) searches for a catchtag whose `tag'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 member is TAG, and then unbinds to it. The `val' member is used to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 hold VAL while the stack is unwound; `val' is returned as the value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 of the catch form.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 All the other members are concerned with restoring the interpreter
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 state. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 struct catchtag
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 Lisp_Object tag;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 struct catchtag *next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 struct gcpro *gcpro;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 JMP_BUF jmp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 struct backtrace *backlist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 #if 0 /* FSFmacs */
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 440
diff changeset
82 /* FSF uses a separate handler stack to hold condition-cases,
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 440
diff changeset
83 where we use Vcondition_handlers. We should switch to their
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 440
diff changeset
84 system becaue it avoids the need to mess around with consing
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 440
diff changeset
85 up stuff and then dangerously freeing it. See comment in
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 440
diff changeset
86 condition_case_unwind(). */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 struct handler *handlerlist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 int lisp_eval_depth;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 int pdlcount;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 #if 0 /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 /* This is the equivalent of async_timer_suppress_count.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 We probably don't have to bother with this. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 int poll_suppress_count;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 /* Dynamic-binding-o-rama */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 /* Structure for recording Lisp call stack for backtrace purposes. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 /* The special binding stack holds the outer values of variables while
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 they are bound by a function application or a let form, stores the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 code to be executed for Lisp unwind-protect forms, and stores the C
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 functions to be called for record_unwind_protect.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 If func is non-zero, undoing this binding applies func to old_value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 This implements record_unwind_protect.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 If func is zero and symbol is nil, undoing this binding evaluates
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 the list of forms in old_value; this implements Lisp's unwind-protect
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 form.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 Otherwise, undoing this binding stores old_value as symbol's value; this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 undoes the bindings made by a let form or function call. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 struct specbinding
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 Lisp_Object symbol;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 Lisp_Object old_value;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 Lisp_Object (*func) (Lisp_Object); /* for unwind-protect */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 #if 0 /* FSFmacs */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 /* #### */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 /* Everything needed to describe an active condition case. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 struct handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 /* The handler clauses and variable from the condition-case form. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 Lisp_Object handler;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 Lisp_Object var;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 /* Fsignal stores here the condition-case clause that applies,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 and Fcondition_case thus knows which clause to run. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 Lisp_Object chosen_clause;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 /* Used to effect the longjmp() out to the handler. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 struct catchtag *tag;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 /* The next enclosing handler. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 struct handler *next;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 extern struct handler *handlerlist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 /* These are extern because GC needs to mark them */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 extern struct specbinding *specpdl;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 extern struct specbinding *specpdl_ptr;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 extern struct catchtag *catchlist;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 extern struct backtrace *backtrace_list;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
151 /* Most callers should simply use specbind() and unbind_to_1(), but if
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 speed is REALLY IMPORTANT, you can use the faster macros below */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 void specbind_magic (Lisp_Object, Lisp_Object);
647
b39c14581166 [xemacs-hg @ 2001-08-13 04:45:47 by ben]
ben
parents: 617
diff changeset
154 void grow_specpdl (EMACS_INT reserved);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 void unbind_to_hairy (int);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 extern int specpdl_size;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 /* Inline version of specbind().
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 Use this instead of specbind() if speed is sufficiently important
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 to save the overhead of even a single function call. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 #define SPECBIND(symbol_object, value_object) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 Lisp_Object SB_symbol = (symbol_object); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 Lisp_Object SB_newval = (value_object); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 Lisp_Object SB_oldval; \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
165 Lisp_Symbol *SB_sym; \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 SPECPDL_RESERVE (1); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 CHECK_SYMBOL (SB_symbol); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 SB_sym = XSYMBOL (SB_symbol); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 SB_oldval = SB_sym->value; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 if (!SYMBOL_VALUE_MAGIC_P (SB_oldval) || UNBOUNDP (SB_oldval)) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 { \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
175 /* #### the following test will go away when we have a constant \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 symbol magic object */ \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 if (EQ (SB_symbol, Qnil) || \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 EQ (SB_symbol, Qt) || \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 SYMBOL_IS_KEYWORD (SB_symbol)) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 reject_constant_symbols (SB_symbol, SB_newval, 0, \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 UNBOUNDP (SB_newval) ? \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 Qmakunbound : Qset); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 specpdl_ptr->symbol = SB_symbol; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 specpdl_ptr->old_value = SB_oldval; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 specpdl_ptr->func = 0; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 specpdl_ptr++; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 specpdl_depth_counter++; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 SB_sym->value = (SB_newval); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 else \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 specbind_magic (SB_symbol, SB_newval); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 /* An even faster, but less safe inline version of specbind().
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 Caller guarantees that:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 - SYMBOL is a non-constant symbol (i.e. not Qnil, Qt, or keyword).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 - specpdl_depth_counter >= specpdl_size.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 Else we crash. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 #define SPECBIND_FAST_UNSAFE(symbol_object, value_object) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 Lisp_Object SFU_symbol = (symbol_object); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 Lisp_Object SFU_newval = (value_object); \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
204 Lisp_Symbol *SFU_sym = XSYMBOL (SFU_symbol); \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 Lisp_Object SFU_oldval = SFU_sym->value; \
814
a634e3b7acc8 [xemacs-hg @ 2002-04-14 12:41:59 by ben]
ben
parents: 800
diff changeset
206 /* Most of the time, will be previously unbound. #### With a bit of \
a634e3b7acc8 [xemacs-hg @ 2002-04-14 12:41:59 by ben]
ben
parents: 800
diff changeset
207 rearranging, this could be reduced to only one check. */ \
a634e3b7acc8 [xemacs-hg @ 2002-04-14 12:41:59 by ben]
ben
parents: 800
diff changeset
208 if (UNBOUNDP (SFU_oldval) || !SYMBOL_VALUE_MAGIC_P (SFU_oldval)) \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 specpdl_ptr->symbol = SFU_symbol; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 specpdl_ptr->old_value = SFU_oldval; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 specpdl_ptr->func = 0; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 specpdl_ptr++; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 specpdl_depth_counter++; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 SFU_sym->value = (SFU_newval); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 else \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 specbind_magic (SFU_symbol, SFU_newval); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 /* Request enough room for SIZE future entries on special binding stack */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 #define SPECPDL_RESERVE(size) do { \
647
b39c14581166 [xemacs-hg @ 2001-08-13 04:45:47 by ben]
ben
parents: 617
diff changeset
223 EMACS_INT SR_size = (size); \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 if (specpdl_depth() + SR_size >= specpdl_size) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 grow_specpdl (SR_size); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
228 /* Inline version of unbind_to_1().
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
229 [[Use this instead of unbind_to_1() if speed is sufficiently important
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
230 to save the overhead of even a single function call.]]
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
231 This is bogus pseudo-optimization. --ben
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
233 Most of the time, unbind_to_1() is called only on ordinary
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 variables, so optimize for that. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 #define UNBIND_TO_GCPRO(count, value) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 int UNBIND_TO_count = (count); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 while (specpdl_depth_counter != UNBIND_TO_count) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 { \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
239 Lisp_Symbol *sym; \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 --specpdl_ptr; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 --specpdl_depth_counter; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 if (specpdl_ptr->func != 0 || \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 ((sym = XSYMBOL (specpdl_ptr->symbol)), \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 SYMBOL_VALUE_MAGIC_P (sym->value))) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 struct gcpro gcpro1; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 GCPRO1 (value); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 unbind_to_hairy (UNBIND_TO_count); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 UNGCPRO; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 sym->value = specpdl_ptr->old_value; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
258 /* A slightly faster inline version of unbind_to_1,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 that doesn't offer GCPROing services. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 #define UNBIND_TO(count) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 int UNBIND_TO_count = (count); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 while (specpdl_depth_counter != UNBIND_TO_count) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 { \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
264 Lisp_Symbol *sym; \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 --specpdl_ptr; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 --specpdl_depth_counter; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 if (specpdl_ptr->func != 0 || \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 ((sym = XSYMBOL (specpdl_ptr->symbol)), \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 SYMBOL_VALUE_MAGIC_P (sym->value))) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 unbind_to_hairy (UNBIND_TO_count); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 sym->value = specpdl_ptr->old_value; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279
800
a5954632b187 [xemacs-hg @ 2002-03-31 08:27:14 by ben]
ben
parents: 771
diff changeset
280 #ifdef ERROR_CHECK_STRUCTURES
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 #define CHECK_SPECBIND_VARIABLE assert (specpdl_ptr->func == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 #define CHECK_SPECBIND_VARIABLE DO_NOTHING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 /* Unused. It's too hard to guarantee that the current bindings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 contain only variables. */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 647
diff changeset
289 /* Another inline version of unbind_to_1(). VALUE is GC-protected.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 Caller guarantees that:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 - all of the elements on the binding stack are variable bindings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 Else we crash. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 #define UNBIND_TO_GCPRO_VARIABLES_ONLY(count, value) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 int UNBIND_TO_count = (count); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 while (specpdl_depth_counter != UNBIND_TO_count) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 { \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
297 Lisp_Symbol *sym; \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 --specpdl_ptr; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 --specpdl_depth_counter; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 CHECK_SPECBIND_VARIABLE; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 sym = XSYMBOL (specpdl_ptr->symbol); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 if (!SYMBOL_VALUE_MAGIC_P (sym->value)) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 sym->value = specpdl_ptr->old_value; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 else \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 struct gcpro gcpro1; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 GCPRO1 (value); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 unbind_to_hairy (UNBIND_TO_count); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 UNGCPRO; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 break; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 } \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 #endif /* unused */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 /* A faster, but less safe inline version of Fset().
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 Caller guarantees that:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 - SYMBOL is a non-constant symbol (i.e. not Qnil, Qt, or keyword).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 Else we crash. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 #define FSET_FAST_UNSAFE(sym, newval) do { \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 Lisp_Object FFU_sym = (sym); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 Lisp_Object FFU_newval = (newval); \
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
324 Lisp_Symbol *FFU_symbol = XSYMBOL (FFU_sym); \
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 Lisp_Object FFU_oldval = FFU_symbol->value; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 if (!SYMBOL_VALUE_MAGIC_P (FFU_oldval) || UNBOUNDP (FFU_oldval)) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 FFU_symbol->value = FFU_newval; \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 else \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 Fset (FFU_sym, FFU_newval); \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 } while (0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
332 #endif /* INCLUDED_backtrace_h_ */