428
|
1 /* Fundamental definitions for XEmacs Lisp interpreter.
|
|
2 Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1993-1996 Richard Mlynarik.
|
1292
|
4 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing.
|
428
|
5
|
|
6 This file is part of XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: FSF 19.30. */
|
|
24
|
853
|
25 /* Authorship:
|
|
26
|
|
27 Based on code from pre-release FSF 19, c. 1991.
|
|
28 Various changes by Jamie Zawinski 1991-1994:
|
|
29 converting to ANSI C, splitting out function prototypes to a separate
|
|
30 file (later moved back for unknown reasons by Steve Baur?), debug-gcpro
|
|
31 stuff (now moribund).
|
|
32 ANSI-fication of DEFUN macros by Felix Lee, c. 1992?
|
|
33 NOT_REACHED, DOESNT_RETURN, PRINTF_ARGS by Richard Mlynarik, c. 1994.
|
|
34 Many changes over the years corresponding to Lisp_Object definition
|
|
35 changes, esp. by Richard Mlynarik (c. 1993) and Kyle Jones (c. 1998).
|
|
36 See alloc.c for more details.
|
|
37 Overhauled and reordered by Ben Wing, 1995-1996, and many things added:
|
|
38 Dynarrs, REALLOC macros, asserts, typedefs, inline header code,
|
|
39 first LIST_LOOP macros, CONCHECK_*, all error-checking code
|
|
40 (e.g. error-checking versions of XFOO macros), structure read syntax,
|
|
41 weak lists, lcrecord lists, reworking of quit handling, object hashing,
|
|
42 nested GCPRO, character objects and Ebola checking, memory usage stats,
|
|
43 others.
|
|
44 LOADHIST changes from Steve Baur, c. 1997?
|
|
45 Various macro-related changes by Martin Buchholz, 1998-1999:
|
|
46 LIST_LOOP macros greatly expanded and tortoise-hared;
|
|
47 RETURN_SANS_WARNINGS; reworked DEFUN macros; EXFUN macros (???).
|
|
48 */
|
|
49
|
440
|
50 #ifndef INCLUDED_lisp_h_
|
|
51 #define INCLUDED_lisp_h_
|
428
|
52
|
|
53 /************************************************************************/
|
|
54 /* general definitions */
|
|
55 /************************************************************************/
|
|
56
|
1318
|
57 /* -------------------------- include files --------------------- */
|
442
|
58
|
428
|
59 /* We include the following generally useful header files so that you
|
|
60 don't have to worry about prototypes when using the standard C
|
|
61 library functions and macros. These files shouldn't be excessively
|
|
62 large so they shouldn't cause that much of a slowdown. */
|
|
63
|
|
64 #include <stdlib.h>
|
|
65 #include <string.h> /* primarily for memcpy, etc. */
|
|
66 #include <stdio.h> /* NULL, etc. */
|
|
67 #include <ctype.h>
|
|
68 #include <stdarg.h>
|
|
69 #include <stddef.h> /* offsetof */
|
|
70 #include <sys/types.h>
|
442
|
71 #include <limits.h>
|
|
72
|
1318
|
73 /* -------------------------- error-checking ------------------------ */
|
853
|
74
|
|
75 /* The large categories established by configure can be subdivided into
|
|
76 smaller subcategories, for problems in specific modules. You can't
|
|
77 control this using configure, but you can manually stick in a define as
|
|
78 necessary. */
|
|
79
|
|
80 #ifdef ERROR_CHECK_STRUCTURES
|
|
81 /* Check for problems with the catch list and specbind stack */
|
|
82 #define ERROR_CHECK_CATCH
|
|
83 /* Check for insufficient use of call_trapping_problems(), particularly
|
|
84 due to glyph-related changes causing eval or QUIT within redisplay */
|
|
85 #define ERROR_CHECK_TRAPPING_PROBLEMS
|
|
86 #endif
|
|
87
|
1318
|
88 #ifdef ERROR_CHECK_TYPES
|
|
89 #define type_checking_assert(assertion) assert (assertion)
|
|
90 #define type_checking_assert_at_line(assertion, file, line) \
|
|
91 assert_at_line (assertion, file, line)
|
|
92 #define type_checking_assert_with_message(assertion, msg) \
|
|
93 assert_with_message (assertion, msg)
|
|
94 #else
|
|
95 #define type_checking_assert(assertion)
|
|
96 #define type_checking_assert_at_line(assertion, file, line)
|
|
97 #define type_checking_assert_with_message(assertion, msg)
|
|
98 #endif
|
|
99 #ifdef ERROR_CHECK_GC
|
|
100 #define gc_checking_assert(assertion) assert (assertion)
|
|
101 #define gc_checking_assert_at_line(assertion, file, line) \
|
|
102 assert_at_line (assertion, file, line)
|
|
103 #define gc_checking_assert_with_message(assertion, msg) \
|
|
104 assert_with_message (assertion, msg)
|
|
105 #else
|
|
106 #define gc_checking_assert(assertion)
|
|
107 #define gc_checking_assert_at_line(assertion, file, line)
|
|
108 #define gc_checking_assert_with_message(assertion, msg)
|
|
109 #endif
|
|
110 #ifdef ERROR_CHECK_TEXT
|
|
111 #define text_checking_assert(assertion) assert (assertion)
|
|
112 #define text_checking_assert_at_line(assertion, file, line) \
|
|
113 assert_at_line (assertion, file, line)
|
|
114 #define text_checking_assert_with_message(assertion, msg) \
|
|
115 assert_with_message (assertion, msg)
|
|
116 #else
|
|
117 #define text_checking_assert(assertion)
|
|
118 #define text_checking_assert_at_line(assertion, file, line)
|
|
119 #define text_checking_assert_with_message(assertion, msg)
|
|
120 #endif
|
|
121 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS
|
|
122 #define trapping_problems_checking_assert(assertion) assert (assertion)
|
|
123 #define trapping_problems_checking_assert_at_line(assertion, file, line) \
|
|
124 assert_at_line (assertion, file, line)
|
|
125 #define trapping_problems_checking_assert_with_message(assertion, msg) \
|
|
126 assert_with_message (assertion, msg)
|
|
127 #else
|
|
128 #define trapping_problems_checking_assert(assertion)
|
|
129 #define trapping_problems_checking_assert_at_line(assertion, file, line)
|
|
130 #define trapping_problems_checking_assert_with_message(assertion, msg)
|
|
131 #endif
|
|
132
|
647
|
133 /* ------------------------ definition of EMACS_INT ------------------- */
|
|
134
|
|
135 /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
|
|
136 In particular, it must be large enough to contain a pointer.
|
|
137 config.h can override this, e.g. to use `long long' for bigger lisp ints.
|
|
138
|
|
139 #### In point of fact, it would NOT be a good idea for config.h to mess
|
|
140 with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT
|
|
141 is the size of a pointer. */
|
|
142
|
|
143 #ifndef SIZEOF_EMACS_INT
|
|
144 # define SIZEOF_EMACS_INT SIZEOF_VOID_P
|
|
145 #endif
|
|
146
|
|
147 #ifndef EMACS_INT
|
|
148 # if SIZEOF_EMACS_INT == SIZEOF_LONG
|
|
149 # define EMACS_INT long
|
|
150 # elif SIZEOF_EMACS_INT == SIZEOF_INT
|
|
151 # define EMACS_INT int
|
|
152 # elif SIZEOF_EMACS_INT == SIZEOF_LONG_LONG
|
|
153 # define EMACS_INT long long
|
|
154 # else
|
|
155 # error Unable to determine suitable type for EMACS_INT
|
|
156 # endif
|
|
157 #endif
|
|
158
|
|
159 #ifndef EMACS_UINT
|
|
160 # define EMACS_UINT unsigned EMACS_INT
|
|
161 #endif
|
|
162
|
|
163 #define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR)
|
|
164
|
826
|
165 #if SIZEOF_SHORT == 2
|
|
166 #define INT_16_BIT short
|
|
167 #define UINT_16_BIT unsigned short
|
|
168 #elif SIZEOF_INT == 2
|
|
169 /* Bwa ha ha. As if XEmacs could actually support such systems. */
|
|
170 #define INT_16_BIT int
|
|
171 #define UINT_16_BIT unsigned int
|
|
172 #else
|
|
173 #error Unable to find a 16-bit integral type
|
|
174 #endif
|
|
175
|
|
176 #if SIZEOF_INT == 4
|
|
177 #define INT_32_BIT int
|
|
178 #define UINT_32_BIT unsigned int
|
|
179 #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##U
|
|
180 #elif SIZEOF_LONG == 4
|
|
181 /* Bwa ha ha again. */
|
|
182 #define INT_32_BIT long
|
|
183 #define UINT_32_BIT unsigned long
|
|
184 #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##UL
|
|
185 #elif SIZEOF_SHORT == 4
|
|
186 /* And again. */
|
|
187 #define INT_32_BIT short
|
|
188 #define UINT_32_BIT unsigned short
|
|
189 #define MAKE_32_BIT_UNSIGNED_CONSTANT(num) num##U
|
1429
|
190 #elif 1 /* Unable to find a 32-bit integral type! */
|
826
|
191 #error What kind of strange-ass system are you running on?
|
|
192 #endif
|
|
193
|
|
194 #if SIZEOF_LONG == 8
|
|
195 #define INT_64_BIT long
|
|
196 #define UINT_64_BIT unsigned long
|
|
197 #define MAKE_64_BIT_UNSIGNED_CONSTANT(num) num##UL
|
|
198 #elif SIZEOF_LONG_LONG == 8
|
|
199 #define INT_64_BIT long long
|
|
200 #define UINT_64_BIT unsigned long long
|
|
201 #define MAKE_64_BIT_UNSIGNED_CONSTANT(num) num##ULL
|
|
202 /* No error otherwise; just leave undefined */
|
|
203 #endif
|
|
204
|
|
205 #if SIZEOF_LONG_LONG == 16
|
|
206 #define INT_128_BIT long long
|
|
207 #define UINT_128_BIT unsigned long long
|
|
208 #define MAKE_128_BIT_UNSIGNED_CONSTANT(num) num##ULL
|
|
209 /* No error otherwise; just leave undefined */
|
|
210 #endif
|
|
211
|
|
212 /* #### Fill this in for other systems */
|
|
213 #if defined (INT_64_BIT) && !(defined (i386) || defined (__i386__))
|
|
214 #define EFFICIENT_INT_64_BIT INT_64_BIT
|
|
215 #define EFFICIENT_UINT_64_BIT UINT_64_BIT
|
|
216 #endif
|
|
217
|
|
218 #if defined (INT_128_BIT)
|
|
219 #define EFFICIENT_INT_128_BIT INT_128_BIT
|
|
220 #define EFFICIENT_UINT_128_BIT UINT_128_BIT
|
|
221 #endif
|
|
222
|
647
|
223 /* ------------------------ basic char/int typedefs ------------------- */
|
|
224
|
|
225 /* The definitions we put here use typedefs to attribute specific meaning
|
|
226 to types that by themselves are pretty general. Stuff pointed to by a
|
|
227 char * or unsigned char * will nearly always be one of four types:
|
|
228 a) pointer to internally-formatted text; b) pointer to text in some
|
|
229 external format, which can be defined as all formats other than the
|
|
230 internal one; c) pure ASCII text; d) binary data that is not meant to
|
|
231 be interpreted as text. [A fifth possible type "e) a general pointer
|
|
232 to memory" should be replaced with void *.] Using these more specific
|
|
233 types rather than the general ones helps avoid the confusions that
|
|
234 occur when the semantics of a char * argument being studied are unclear.
|
|
235
|
|
236 Note that these typedefs are purely for documentation purposes; from
|
|
237 the C code's perspective, they are exactly equivalent to `char *',
|
|
238 `unsigned char *', etc., so you can freely use them with library
|
|
239 functions declared as such. */
|
|
240
|
|
241 /* The data representing the text in a buffer is logically a set
|
867
|
242 of Ibytes, declared as follows. */
|
|
243
|
|
244 typedef unsigned char Ibyte;
|
647
|
245
|
|
246 /* The following should be used when you are working with internal data
|
|
247 but for whatever reason need to have it declared a "char *". Examples
|
|
248 are function arguments whose values are most commonly literal strings,
|
|
249 or where you have to apply a stdlib string function to internal data.
|
|
250
|
867
|
251 In general, you should avoid this where possible and use Ibyte instead,
|
647
|
252 for consistency. For example, the new Mule workspace contains
|
867
|
253 Ibyte versions of the stdlib string functions. */
|
|
254
|
|
255 typedef char CIbyte;
|
647
|
256
|
|
257 /* The data representing a string in "external" format (binary or any
|
|
258 external encoding) is logically a set of Extbytes, declared as
|
|
259 follows. Extbyte is guaranteed to be just a char, so for example
|
|
260 strlen (Extbyte *) is OK. Extbyte is only a documentation device
|
|
261 for referring to external text. */
|
|
262
|
|
263 typedef char Extbyte;
|
771
|
264 typedef unsigned char UExtbyte;
|
647
|
265
|
|
266 /* A byte in a string in binary format: */
|
|
267 typedef char Char_Binary;
|
|
268 typedef signed char SChar_Binary;
|
|
269 typedef unsigned char UChar_Binary;
|
|
270
|
|
271 /* A byte in a string in entirely US-ASCII format: (Nothing outside
|
|
272 the range 00 - 7F) */
|
|
273
|
|
274 typedef char Char_ASCII;
|
|
275 typedef unsigned char UChar_ASCII;
|
|
276
|
826
|
277 /* To the user, a buffer is made up of characters. In the non-Mule world,
|
867
|
278 characters and Ibytes are equivalent, restricted to the range 0 - 255.
|
826
|
279 In the Mule world, many more characters are possible (19 bits worth,
|
867
|
280 more or less), and a character requires (typically) 1 to 4 Ibytes for
|
826
|
281 its representation in a buffer or string. Note that the representation
|
|
282 of a character by itself, in a variable, is very different from its
|
|
283 representation in a string of text (in a buffer or Lisp string).
|
|
284
|
|
285 Under Mule, text can be represented in more than one way. The "default"
|
|
286 format is variable-width (1 to 4 bytes) and compatible with ASCII --
|
|
287 ASCII chars are stored in one byte, as themselves, and all other chars
|
|
288 use only high bytes. The default format is currently the only format
|
|
289 used for text stored anywhere but in a buffer. In a buffer, other
|
|
290 formats -- fixed-width formats (1, 2, or 4 bytes) -- are possible, for
|
|
291 speed.
|
|
292
|
|
293 See text.c/text.h for a detailed discussion of all of this. */
|
|
294
|
|
295 /* A character, as represented on its own. */
|
647
|
296
|
867
|
297 typedef int Ichar;
|
647
|
298
|
826
|
299 /* The "raw value" of a character as stored in the buffer. In the default
|
|
300 format, this is just the same as the character. In fixed-width formats,
|
|
301 this is the actual value in the buffer, which will be limited to the
|
|
302 range as established by the format. This is used when searching for a
|
|
303 character in a buffer -- it's faster to convert the character to the raw
|
|
304 value and look for that, than repeatedly convert each raw value in the
|
|
305 buffer into a character. */
|
|
306
|
867
|
307 typedef int Raw_Ichar;
|
826
|
308
|
|
309
|
|
310 #if !defined (__cplusplus) || !defined (CPLUSPLUS_INTEGRAL_CLASSES_NOT_YET)
|
|
311
|
|
312 /* Counts of bytes or chars */
|
|
313
|
|
314 typedef EMACS_INT Bytecount;
|
|
315 typedef EMACS_INT Charcount;
|
|
316
|
647
|
317 /* Different ways of referring to a position in a buffer. We use
|
|
318 the typedefs in preference to 'EMACS_INT' to make it clearer what
|
826
|
319 sort of position is being used. See text.c for a description
|
|
320 of the different positions.
|
|
321
|
|
322 Note that buffer positions are 1-based, and there's a gap in the middle
|
|
323 of a buffer; that's why we have separate typedefs. For Lisp strings and
|
|
324 other strings of text, we just use Bytecount and Charcount. */
|
800
|
325
|
665
|
326 typedef EMACS_INT Charbpos;
|
|
327 typedef EMACS_INT Bytebpos;
|
|
328 typedef EMACS_INT Membpos;
|
647
|
329
|
826
|
330 /* Different ways of referring to a position that can be either in a buffer
|
|
331 or string; used when passing around an object that can be either a
|
|
332 buffer or string, and an associated position. Conceptually, they
|
|
333 resolve as follows:
|
|
334
|
|
335 Typedef Buffer String
|
|
336 ------------------------------------------------------
|
|
337 Charxpos Charbpos Charcount
|
|
338 Bytexpos Bytebpos Bytecount
|
|
339 Memxpos Membpos Bytecount
|
|
340
|
|
341 */
|
|
342
|
814
|
343 typedef EMACS_INT Charxpos;
|
|
344 typedef EMACS_INT Bytexpos;
|
|
345 typedef EMACS_INT Memxpos;
|
|
346
|
|
347 #else /* __cplusplus */
|
|
348
|
|
349 /* Implement strong type-checking of the above integral types by declaring
|
|
350 them to be classes and using operator overloading. Unfortunately this
|
|
351 is a huge pain in the ass because C++ doesn't strongly distinguish
|
|
352 "bool" and "size_t" from int. The problem is especially bad with "bool"
|
|
353 -- if you want to be able to say 'if (len--)' where len is e.g. a
|
|
354 Bytecount, you need to declare a conversion operator to bool(); and
|
|
355 since bool is just an alias for int, you suddenly get tons and tons of
|
|
356 ambiguities, which need to be resolved by lots of laborious declarations
|
|
357 for every single possible type combination. Hence the multitude of
|
|
358 declarations in DECLARE_INTCLASS_ARITH_COMPARE(). The bool/int
|
|
359 equivalence also means that we have to forcibly block the combinations
|
|
360 we don't want by creating overloaded versions of them and declaring them
|
|
361 private. */
|
|
362
|
|
363 #undef this
|
|
364
|
|
365 class Bytecount;
|
|
366 class Bytebpos;
|
|
367 class Bytexpos;
|
|
368 class Charcount;
|
|
369 class Charbpos;
|
|
370 class Charxpos;
|
|
371 class Membpos;
|
|
372 class Memxpos;
|
|
373
|
|
374 /* Declare the arithmetic and comparison operations for an integral class,
|
|
375 i.e. one of the above classes. If this is a "position" class, where the
|
|
376 difference between two positions is a different class (a "count" class),
|
|
377 then use POSCL for the position class and COUNTCL for the count class.
|
|
378 If this is a simple class, where all operations yield the same class,
|
|
379 substitute the same class for POSCL and COUNTCL. */
|
|
380
|
|
381 #define DECLARE_INTCLASS_ARITH_COMPARE(poscl, countcl) \
|
|
382 poscl operator += (const countcl& l) { data += l.data; return *this; } \
|
|
383 poscl operator -= (const countcl& l) { data -= l.data; return *this; } \
|
|
384 poscl operator + (const countcl& l) const { return poscl (data + l.data); } \
|
|
385 poscl operator - (const countcl& l) const { return poscl (data - l.data); } \
|
|
386 poscl operator += (const int& l) { data += l; return *this; } \
|
|
387 poscl operator -= (const int& l) { data -= l; return *this; } \
|
|
388 poscl operator + (const int& l) const { return poscl (data + l); } \
|
|
389 poscl operator - (const int& l) const { return poscl (data - l); } \
|
|
390 poscl operator += (const unsigned int& l) { data += l; return *this; } \
|
|
391 poscl operator -= (const unsigned int& l) { data -= l; return *this; } \
|
|
392 poscl operator + (const unsigned int& l) const \
|
|
393 { return poscl (data + l); } \
|
|
394 poscl operator - (const unsigned int& l) const \
|
|
395 { return poscl (data - l); } \
|
|
396 poscl operator += (const long& l) { data += l; return *this; } \
|
|
397 poscl operator -= (const long& l) { data -= l; return *this; } \
|
|
398 poscl operator + (const long& l) const { return poscl (data + l); } \
|
|
399 poscl operator - (const long& l) const { return poscl (data - l); } \
|
|
400 poscl operator += (const unsigned long& l) { data += l; return *this; } \
|
|
401 poscl operator -= (const unsigned long& l) { data -= l; return *this; } \
|
|
402 poscl operator + (const unsigned long& l) const \
|
|
403 { return poscl (data + l); } \
|
|
404 poscl operator - (const unsigned long& l) const \
|
|
405 { return poscl (data - l); } \
|
|
406 poscl operator += (const short& l) { data += l; return *this; } \
|
|
407 poscl operator -= (const short& l) { data -= l; return *this; } \
|
|
408 poscl operator + (const short& l) const { return poscl (data + l); } \
|
|
409 poscl operator - (const short& l) const { return poscl (data - l); } \
|
|
410 poscl operator += (const unsigned short& l) { data += l; return *this; } \
|
|
411 poscl operator -= (const unsigned short& l) { data -= l; return *this; } \
|
|
412 poscl operator + (const unsigned short& l) const \
|
|
413 { return poscl (data + l); } \
|
|
414 poscl operator - (const unsigned short& l) const \
|
|
415 { return poscl (data - l); } \
|
|
416 \
|
|
417 poscl operator *= (const countcl& l) { data *= l.data; return *this; } \
|
|
418 poscl operator /= (const countcl& l) { data /= l.data; return *this; } \
|
|
419 poscl operator * (const countcl& l) const { return poscl (data * l.data); } \
|
|
420 poscl operator / (const countcl& l) const { return poscl (data / l.data); } \
|
|
421 poscl operator *= (const int& l) { data *= l; return *this; } \
|
|
422 poscl operator /= (const int& l) { data /= l; return *this; } \
|
|
423 poscl operator * (const int& l) const { return poscl (data * l); } \
|
|
424 poscl operator / (const int& l) const { return poscl (data / l); } \
|
|
425 poscl operator *= (const unsigned int& l) { data *= l; return *this; } \
|
|
426 poscl operator /= (const unsigned int& l) { data /= l; return *this; } \
|
|
427 poscl operator * (const unsigned int& l) const { return poscl (data * l); } \
|
|
428 poscl operator / (const unsigned int& l) const { return poscl (data / l); } \
|
|
429 poscl operator *= (const long& l) { data *= l; return *this; } \
|
|
430 poscl operator /= (const long& l) { data /= l; return *this; } \
|
|
431 poscl operator * (const long& l) const { return poscl (data * l); } \
|
|
432 poscl operator / (const long& l) const { return poscl (data / l); } \
|
|
433 poscl operator *= (const unsigned long& l) { data *= l; return *this; } \
|
|
434 poscl operator /= (const unsigned long& l) { data /= l; return *this; } \
|
|
435 poscl operator * (const unsigned long& l) const \
|
|
436 { return poscl (data * l); } \
|
|
437 poscl operator / (const unsigned long& l) const \
|
|
438 { return poscl (data / l); } \
|
|
439 poscl operator *= (const short& l) { data *= l; return *this; } \
|
|
440 poscl operator /= (const short& l) { data /= l; return *this; } \
|
|
441 poscl operator * (const short& l) const { return poscl (data * l); } \
|
|
442 poscl operator / (const short& l) const { return poscl (data / l); } \
|
|
443 poscl operator *= (const unsigned short& l) { data *= l; return *this; } \
|
|
444 poscl operator /= (const unsigned short& l) { data /= l; return *this; } \
|
|
445 poscl operator * (const unsigned short& l) const \
|
|
446 { return poscl (data * l); } \
|
|
447 poscl operator / (const unsigned short& l) const \
|
|
448 { return poscl (data / l); } \
|
|
449 \
|
|
450 poscl operator &= (const countcl& l) { data &= l.data; return *this; } \
|
|
451 poscl operator |= (const countcl& l) { data |= l.data; return *this; } \
|
|
452 poscl operator & (const countcl& l) const { return poscl (data & l.data); } \
|
|
453 poscl operator | (const countcl& l) const { return poscl (data | l.data); } \
|
|
454 poscl operator &= (const int& l) { data &= l; return *this; } \
|
|
455 poscl operator |= (const int& l) { data |= l; return *this; } \
|
|
456 poscl operator & (const int& l) const { return poscl (data & l); } \
|
|
457 poscl operator | (const int& l) const { return poscl (data | l); } \
|
|
458 poscl operator &= (const unsigned int& l) { data &= l; return *this; } \
|
|
459 poscl operator |= (const unsigned int& l) { data |= l; return *this; } \
|
|
460 poscl operator & (const unsigned int& l) const { return poscl (data & l); } \
|
|
461 poscl operator | (const unsigned int& l) const { return poscl (data | l); } \
|
|
462 poscl operator &= (const long& l) { data &= l; return *this; } \
|
|
463 poscl operator |= (const long& l) { data |= l; return *this; } \
|
|
464 poscl operator & (const long& l) const { return poscl (data & l); } \
|
|
465 poscl operator | (const long& l) const { return poscl (data | l); } \
|
|
466 poscl operator &= (const unsigned long& l) { data &= l; return *this; } \
|
|
467 poscl operator |= (const unsigned long& l) { data |= l; return *this; } \
|
|
468 poscl operator & (const unsigned long& l) const \
|
|
469 { return poscl (data & l); } \
|
|
470 poscl operator | (const unsigned long& l) const \
|
|
471 { return poscl (data | l); } \
|
|
472 poscl operator &= (const short& l) { data &= l; return *this; } \
|
|
473 poscl operator |= (const short& l) { data |= l; return *this; } \
|
|
474 poscl operator & (const short& l) const { return poscl (data & l); } \
|
|
475 poscl operator | (const short& l) const { return poscl (data | l); } \
|
|
476 poscl operator &= (const unsigned short& l) { data &= l; return *this; } \
|
|
477 poscl operator |= (const unsigned short& l) { data |= l; return *this; } \
|
|
478 poscl operator & (const unsigned short& l) const \
|
|
479 { return poscl (data & l); } \
|
|
480 poscl operator | (const unsigned short& l) const \
|
|
481 { return poscl (data | l); } \
|
|
482 \
|
|
483 poscl operator - () { return poscl (-data); } \
|
|
484 poscl operator-- () { data--; return *this; } \
|
|
485 poscl operator-- (int) { data--; return poscl (data + 1); } \
|
|
486 poscl operator++ () { data++; return *this; } \
|
|
487 poscl operator++ (int) { data++; return poscl (data - 1); } \
|
|
488 \
|
|
489 bool operator < (const poscl& l) const { return data < l.data; } \
|
|
490 bool operator <= (const poscl& l) const { return data <= l.data; } \
|
|
491 bool operator > (const poscl& l) const { return data > l.data; } \
|
|
492 bool operator >= (const poscl& l) const { return data >= l.data; } \
|
|
493 bool operator == (const poscl& l) const { return data == l.data; } \
|
|
494 bool operator != (const poscl& l) const { return data != l.data; } \
|
|
495 bool operator < (const int& l) const { return data < (EMACS_INT) l; } \
|
|
496 bool operator <= (const int& l) const { return data <= (EMACS_INT) l; } \
|
|
497 bool operator > (const int& l) const { return data > (EMACS_INT) l; } \
|
|
498 bool operator >= (const int& l) const { return data >= (EMACS_INT) l; } \
|
|
499 bool operator == (const int& l) const { return data == (EMACS_INT) l; } \
|
|
500 bool operator != (const int& l) const { return data != (EMACS_INT) l; } \
|
|
501 bool operator < (const unsigned int& l) const \
|
|
502 { return data < (EMACS_INT) l; } \
|
|
503 bool operator <= (const unsigned int& l) const \
|
|
504 { return data <= (EMACS_INT) l; } \
|
|
505 bool operator > (const unsigned int& l) const \
|
|
506 { return data > (EMACS_INT) l; } \
|
|
507 bool operator >= (const unsigned int& l) const \
|
|
508 { return data >= (EMACS_INT) l; } \
|
|
509 bool operator == (const unsigned int& l) const \
|
|
510 { return data == (EMACS_INT) l; } \
|
|
511 bool operator != (const unsigned int& l) const \
|
|
512 { return data != (EMACS_INT) l; } \
|
|
513 bool operator < (const long& l) const { return data < (EMACS_INT) l; } \
|
|
514 bool operator <= (const long& l) const { return data <= (EMACS_INT) l; } \
|
|
515 bool operator > (const long& l) const { return data > (EMACS_INT) l; } \
|
|
516 bool operator >= (const long& l) const { return data >= (EMACS_INT) l; } \
|
|
517 bool operator == (const long& l) const { return data == (EMACS_INT) l; } \
|
|
518 bool operator != (const long& l) const { return data != (EMACS_INT) l; } \
|
|
519 bool operator < (const unsigned long& l) const \
|
|
520 { return data < (EMACS_INT) l; } \
|
|
521 bool operator <= (const unsigned long& l) const \
|
|
522 { return data <= (EMACS_INT) l; } \
|
|
523 bool operator > (const unsigned long& l) const \
|
|
524 { return data > (EMACS_INT) l; } \
|
|
525 bool operator >= (const unsigned long& l) const \
|
|
526 { return data >= (EMACS_INT) l; } \
|
|
527 bool operator == (const unsigned long& l) const \
|
|
528 { return data == (EMACS_INT) l; } \
|
|
529 bool operator != (const unsigned long& l) const \
|
|
530 { return data != (EMACS_INT) l; } \
|
|
531 bool operator < (const short& l) const { return data < (EMACS_INT) l; } \
|
|
532 bool operator <= (const short& l) const { return data <= (EMACS_INT) l; } \
|
|
533 bool operator > (const short& l) const { return data > (EMACS_INT) l; } \
|
|
534 bool operator >= (const short& l) const { return data >= (EMACS_INT) l; } \
|
|
535 bool operator == (const short& l) const { return data == (EMACS_INT) l; } \
|
|
536 bool operator != (const short& l) const { return data != (EMACS_INT) l; } \
|
|
537 bool operator < (const unsigned short& l) const \
|
|
538 { return data < (EMACS_INT) l; } \
|
|
539 bool operator <= (const unsigned short& l) const \
|
|
540 { return data <= (EMACS_INT) l; } \
|
|
541 bool operator > (const unsigned short& l) const \
|
|
542 { return data > (EMACS_INT) l; } \
|
|
543 bool operator >= (const unsigned short& l) const \
|
|
544 { return data >= (EMACS_INT) l; } \
|
|
545 bool operator == (const unsigned short& l) const \
|
|
546 { return data == (EMACS_INT) l; } \
|
|
547 bool operator != (const unsigned short& l) const \
|
|
548 { return data != (EMACS_INT) l; } \
|
|
549 bool operator ! () const { return !data; }
|
|
550
|
|
551 /* Declare the "bad" or disallowed arithmetic and comparion operations
|
|
552 between class GOOD and class BAD. Meant to go inside the private
|
|
553 section of class GOOD. */
|
|
554
|
|
555 #define DECLARE_BAD_INTCLASS_ARITH_COMPARE(good, bad) \
|
|
556 good operator += (const bad& l) { return badret; } \
|
|
557 good operator -= (const bad& l) { return badret; } \
|
|
558 good operator *= (const bad& l) { return badret; } \
|
|
559 good operator /= (const bad& l) { return badret; } \
|
|
560 good operator + (const bad& l) { return badret; } \
|
|
561 good operator - (const bad& l) { return badret; } \
|
|
562 good operator * (const bad& l) { return badret; } \
|
|
563 good operator / (const bad& l) { return badret; } \
|
|
564 \
|
|
565 bool operator < (const bad& l) { return 0; } \
|
|
566 bool operator <= (const bad& l) { return 0; } \
|
|
567 bool operator > (const bad& l) { return 0; } \
|
|
568 bool operator >= (const bad& l) { return 0; } \
|
|
569 bool operator == (const bad& l) { return 0; } \
|
|
570 bool operator != (const bad& l) { return 0; }
|
|
571
|
|
572 /* Declare the "bad" or disallowed arithmetic operations between class GOOD
|
|
573 and another of the same class, for a position class. Meant to go inside
|
|
574 the private section of class GOOD. */
|
|
575
|
|
576 #define DECLARE_BAD_POS_CLASS_ARITH(good) \
|
|
577 good operator += (const good& l) { return badret; } \
|
|
578 good operator -= (const good& l) { return badret; } \
|
|
579 good operator *= (const good& l) { return badret; } \
|
|
580 good operator /= (const good& l) { return badret; } \
|
|
581 good operator + (const good& l) { return badret; } \
|
|
582 good operator * (const good& l) { return badret; } \
|
|
583 good operator / (const good& l) { return badret; }
|
|
584
|
|
585 /* Basic declaration at the top of all integral classes. Don't call
|
|
586 directly, use one of the more specific versions below. */
|
|
587
|
|
588 #define DECLARE_INTCLASS(cl) \
|
|
589 public: \
|
|
590 EMACS_INT data; \
|
|
591 cl () { data = 0xCDCDCDCD; } \
|
|
592 cl (int i) { data = i; } \
|
|
593 cl (unsigned int i) { data = i; } \
|
|
594 cl (long i) { data = i; } \
|
|
595 cl (unsigned long i) { data = i; } \
|
|
596 cl (short i) { data = i; } \
|
|
597 cl (unsigned short i) { data = i; } \
|
|
598 operator EMACS_INT () const { return data; }
|
|
599
|
|
600 /* Basic declaration at the top of all count classes. */
|
|
601
|
|
602 #define DECLARE_COUNT_CLASS(cl) \
|
|
603 DECLARE_INTCLASS (cl) \
|
|
604 DECLARE_INTCLASS_ARITH_COMPARE (cl, cl) \
|
|
605 private: \
|
|
606 static cl badret;
|
|
607
|
|
608 /* Basic declaration at the bottom of the prelude of all position classes.
|
|
609 Don't call directly. */
|
|
610
|
|
611 #define DECLARE_POS_CLASS_SECOND_HALF(cl, countcl) \
|
|
612 DECLARE_INTCLASS_ARITH_COMPARE (cl, countcl) \
|
|
613 countcl operator - (const cl& l) const { return countcl (data - l.data); } \
|
|
614 private: \
|
|
615 static cl badret; \
|
|
616 DECLARE_BAD_POS_INTCLASS_ARITH (cl)
|
|
617
|
|
618 /* Basic declaration at the top of all buffer position classes. */
|
|
619
|
|
620 #define DECLARE_BPOS_CLASS(cl, countcl) \
|
|
621 DECLARE_INTCLASS (cl) \
|
|
622 DECLARE_POS_CLASS_SECOND_HALF (cl, countcl)
|
|
623
|
|
624 /* Basic declaration at the top of all X-position classes (that can refer
|
|
625 to buffers or strings). CL1 and CL2 are the equivalent more specific
|
1318
|
626 classes referring only to buffers or strings, respectively. */
|
814
|
627
|
|
628 #define DECLARE_XPOS_CLASS(cl, countcl, cl1, cl2) \
|
|
629 DECLARE_INTCLASS (cl) \
|
|
630 cl (const cl1& x) { data = x.data; } \
|
|
631 cl (const cl2& x) { data = x.data; } \
|
|
632 operator cl1 () const { return cl1 (data); } \
|
|
633 operator cl2 () const { return cl2 (data); } \
|
|
634 DECLARE_POS_CLASS_SECOND_HALF (cl, countcl)
|
|
635
|
|
636 /* Declare the "bad" or disallowed arithmetic and comparion operations
|
|
637 between class CHARCL (a character class) and various non-character
|
|
638 classes. Meant to go inside the private section of class GOOD. */
|
|
639
|
|
640 #define DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE(charcl) \
|
|
641 DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Bytecount) \
|
|
642 DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Bytebpos) \
|
|
643 DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Bytexpos) \
|
|
644 DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Membpos) \
|
|
645 DECLARE_BAD_INTCLASS_ARITH_COMPARE (charcl, Memxpos)
|
|
646
|
|
647 /* Declare the "bad" or disallowed arithmetic and comparion operations
|
|
648 between class BYTECL (a byte class) and various non-byte classes.
|
|
649 Meant to go inside the private section of class GOOD. */
|
|
650
|
|
651 #define DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE(bytecl) \
|
|
652 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charcount) \
|
|
653 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charbpos) \
|
|
654 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charxpos) \
|
|
655 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Membpos) \
|
|
656 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Memxpos)
|
|
657
|
|
658 /* Declare the "bad" or disallowed arithmetic and comparion operations
|
|
659 between class BYTECL (a mem class) and various non-mem classes.
|
|
660 Meant to go inside the private section of class GOOD. */
|
|
661
|
|
662 #define DECLARE_BAD_MEM_INTCLASS_ARITH_COMPARE(bytecl) \
|
|
663 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charcount) \
|
|
664 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charbpos) \
|
|
665 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Charxpos) \
|
|
666 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Bytebpos) \
|
|
667 DECLARE_BAD_INTCLASS_ARITH_COMPARE (bytecl, Bytexpos)
|
|
668
|
|
669 class Charcount
|
|
670 {
|
|
671 DECLARE_COUNT_CLASS (Charcount)
|
|
672 DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE (Charcount)
|
|
673 };
|
|
674
|
|
675 class Charbpos
|
|
676 {
|
|
677 DECLARE_BPOS_CLASS (Charbpos, Charcount)
|
|
678 DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE (Charbpos)
|
|
679 };
|
|
680
|
|
681 class Charxpos
|
|
682 {
|
|
683 DECLARE_XPOS_CLASS (Charxpos, Charcount, Charbpos, Charcount)
|
|
684 DECLARE_BAD_CHAR_INTCLASS_ARITH_COMPARE (Charxpos)
|
|
685 };
|
|
686
|
|
687 class Bytecount
|
|
688 {
|
|
689 DECLARE_COUNT_CLASS (Bytecount)
|
|
690 DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE (Bytecount)
|
|
691 };
|
|
692
|
|
693 class Bytebpos
|
|
694 {
|
|
695 DECLARE_BPOS_CLASS (Bytebpos, Bytecount)
|
|
696 DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE (Bytebpos)
|
|
697 };
|
|
698
|
|
699 class Bytexpos
|
|
700 {
|
|
701 DECLARE_XPOS_CLASS (Bytexpos, Bytecount, Bytebpos, Bytecount)
|
|
702 DECLARE_BAD_BYTE_INTCLASS_ARITH_COMPARE (Bytexpos)
|
|
703 };
|
|
704
|
|
705 class Membpos
|
|
706 {
|
|
707 DECLARE_BPOS_CLASS (Membpos, Bytecount)
|
|
708 DECLARE_BAD_MEM_INTCLASS_ARITH_COMPARE (Membpos)
|
|
709 };
|
|
710
|
|
711 class Memxpos
|
|
712 {
|
|
713 DECLARE_XPOS_CLASS (Memxpos, Bytecount, Membpos, Bytecount)
|
|
714 DECLARE_BAD_MEM_INTCLASS_ARITH_COMPARE (Memxpos)
|
|
715 };
|
|
716
|
826
|
717 #define DECLARE_POINTER_TYPE_ARITH_COUNT(pointer, countcl) \
|
|
718 inline pointer operator += (const pointer & x, const countcl& y) \
|
|
719 { x += y.data; return x; } \
|
|
720 inline pointer operator -= (const pointer & x, const countcl& y) \
|
|
721 { x -= y.data; return x; } \
|
|
722 inline pointer operator + (const pointer x, const countcl& y) \
|
|
723 { return x + y.data; } \
|
|
724 inline pointer operator - (const pointer x, const countcl& y) \
|
814
|
725 { return x - y.data; }
|
|
726
|
|
727 #define DECLARE_INTEGRAL_TYPE_ARITH_COUNT(integral, countcl) \
|
|
728 inline integral operator += (integral & x, const countcl& y) \
|
|
729 { x += y.data; return x; } \
|
|
730 inline integral operator -= (integral & x, const countcl& y) \
|
|
731 { x -= y.data; return x; } \
|
|
732 inline countcl operator + (integral x, const countcl& y) \
|
|
733 { return countcl (x + y.data); } \
|
|
734 inline countcl operator - (integral x, const countcl& y) \
|
|
735 { return countcl (x - y.data); }
|
|
736
|
|
737 #define DECLARE_INTEGRAL_TYPE_COMPARE(integral, cl) \
|
|
738 inline bool operator < (integral x, const cl& y) \
|
|
739 { return (EMACS_INT) x < y.data; } \
|
|
740 inline bool operator <= (integral x, const cl& y) \
|
|
741 { return (EMACS_INT) x <= y.data; } \
|
|
742 inline bool operator > (integral x, const cl& y) \
|
|
743 { return (EMACS_INT) x > y.data; } \
|
|
744 inline bool operator >= (integral x, const cl& y) \
|
|
745 { return (EMACS_INT) x >= y.data; } \
|
|
746 inline bool operator == (integral x, const cl& y) \
|
|
747 { return (EMACS_INT) x == y.data; } \
|
|
748 inline bool operator != (integral x, const cl& y) \
|
|
749 { return (EMACS_INT) x != y.data; }
|
|
750
|
|
751 #if 0
|
|
752 /* Unfortunately C++ doesn't let you overload the ?: operator, so we have
|
|
753 to manually deal with ambiguities using casting */
|
|
754 #define DECLARE_INTEGRAL_TYPE_TRISTATE(integral, cl) \
|
|
755 inline cl operator ?: (bool b, integral x, const cl& y) \
|
|
756 { return b ? cl (x) : y; } \
|
|
757 inline cl operator ?: (bool b, const cl& x, integral y) \
|
|
758 { return b ? x : cl (y); }
|
|
759 #endif /* 0 */
|
|
760
|
867
|
761 /* DECLARE_POINTER_TYPE_ARITH_COUNT (const Ibyte *, Bytecount);
|
826
|
762 DECLARE_POINTER_TYPE_ARITH_COUNT (const Extbyte *, Bytecount); */
|
867
|
763 DECLARE_POINTER_TYPE_ARITH_COUNT (Ibyte *, Bytecount);
|
814
|
764 DECLARE_POINTER_TYPE_ARITH_COUNT (Extbyte *, Bytecount);
|
|
765
|
|
766 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (int, Bytecount);
|
|
767 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (int, Charcount);
|
|
768 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned int, Bytecount);
|
|
769 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned int, Charcount);
|
|
770 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (long, Bytecount);
|
|
771 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (long, Charcount);
|
|
772 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned long, Bytecount);
|
|
773 DECLARE_INTEGRAL_TYPE_ARITH_COUNT (unsigned long, Charcount);
|
|
774
|
|
775 DECLARE_INTEGRAL_TYPE_COMPARE (int, Bytecount);
|
|
776 DECLARE_INTEGRAL_TYPE_COMPARE (int, Charcount);
|
|
777 DECLARE_INTEGRAL_TYPE_COMPARE (unsigned int, Bytecount);
|
|
778 DECLARE_INTEGRAL_TYPE_COMPARE (unsigned int, Charcount);
|
|
779 DECLARE_INTEGRAL_TYPE_COMPARE (long, Bytecount);
|
|
780 DECLARE_INTEGRAL_TYPE_COMPARE (long, Charcount);
|
|
781 DECLARE_INTEGRAL_TYPE_COMPARE (unsigned long, Bytecount);
|
|
782 DECLARE_INTEGRAL_TYPE_COMPARE (unsigned long, Charcount);
|
|
783
|
|
784 #if 0 /* doesn't work */
|
867
|
785 inline Bytecount operator - (const Ibyte *x, const Ibyte *y) \
|
814
|
786 { return Bytecount (x - y); }
|
|
787 #endif
|
|
788
|
|
789 #define this c_this
|
|
790
|
|
791 #endif /* __cplusplus */
|
|
792
|
665
|
793 /* Counts of elements */
|
|
794 typedef EMACS_INT Elemcount;
|
|
795 /* Hash codes */
|
|
796 typedef unsigned long Hashcode;
|
647
|
797
|
771
|
798 #ifdef HAVE_INTTYPES_H
|
|
799 #include <inttypes.h>
|
1444
|
800 #elif defined(HAVE_INTPTR_T_IN_SYS_TYPES_H)
|
|
801 /* included elsewhere */
|
771
|
802 #elif SIZEOF_VOID_P == SIZEOF_INT
|
|
803 typedef int intptr_t;
|
|
804 typedef unsigned int uintptr_t;
|
|
805 #elif SIZEOF_VOID_P == SIZEOF_LONG
|
|
806 typedef long intptr_t;
|
|
807 typedef unsigned long uintptr_t;
|
|
808 #elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG
|
|
809 typedef long long intptr_t;
|
|
810 typedef unsigned long long uintptr_t;
|
|
811 #else
|
|
812 /* Just pray. May break, may not. */
|
|
813 typedef long intptr_t;
|
|
814 typedef unsigned long uintptr_t;
|
|
815 #endif
|
|
816
|
793
|
817 /* ------------------------ basic compiler defines ------------------- */
|
428
|
818
|
|
819 /* Also define min() and max(). (Some compilers put them in strange
|
|
820 places that won't be referenced by the above include files, such
|
|
821 as 'macros.h' under Solaris.) */
|
|
822
|
|
823 #ifndef min
|
|
824 #define min(a,b) (((a) <= (b)) ? (a) : (b))
|
|
825 #endif
|
|
826 #ifndef max
|
|
827 #define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
828 #endif
|
|
829
|
1111
|
830 /* Sim, senhor, prefiro toma-lo no cu.
|
|
831
|
|
832 Regular C complains about possible clobbering of local vars NOT declared
|
|
833 as volatile if there's a longjmp() in a function. C++ complains if such
|
|
834 vars ARE volatile; or more correctly, sans volatile no problem even when
|
|
835 you longjmp, avec volatile you get unfixable compile errors like
|
|
836
|
|
837 /src/xemacs/lilfix/src/process-unix.c: In function `void
|
|
838 unix_send_process(Lisp_Object, lstream*)':
|
|
839 /src/xemacs/lilfix/src/process-unix.c:1577: no matching function for call to `
|
|
840 Lisp_Object::Lisp_Object(volatile Lisp_Object&)'
|
|
841 /src/xemacs/lilfix/src/lisp-union.h:32: candidates are:
|
|
842 Lisp_Object::Lisp_Object(const Lisp_Object&)
|
|
843 */
|
|
844
|
|
845 #ifdef __cplusplus
|
|
846 #define VOLATILE_IF_NOT_CPP
|
|
847 #else
|
|
848 #define VOLATILE_IF_NOT_CPP volatile
|
|
849 #endif
|
|
850
|
428
|
851 #ifndef PRINTF_ARGS
|
|
852 # if defined (__GNUC__) && (__GNUC__ >= 2)
|
|
853 # define PRINTF_ARGS(string_index,first_to_check) \
|
|
854 __attribute__ ((format (printf, string_index, first_to_check)))
|
|
855 # else
|
|
856 # define PRINTF_ARGS(string_index,first_to_check)
|
|
857 # endif /* GNUC */
|
|
858 #endif
|
|
859
|
|
860 #ifndef DOESNT_RETURN
|
|
861 # if defined __GNUC__
|
|
862 # if ((__GNUC__ > 2) || (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))
|
1315
|
863 # if __GNUC__ < 3
|
|
864 /* GCC 3.2 -O3 issues complaints in Fcommand_loop_1 about no return
|
|
865 statement if we have this definition */
|
|
866 # define RETURN_NOT_REACHED(value) DO_NOTHING
|
|
867 # endif
|
442
|
868 # define DOESNT_RETURN void
|
428
|
869 # define DECLARE_DOESNT_RETURN(decl) \
|
442
|
870 extern void decl __attribute__ ((noreturn))
|
428
|
871 # define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
|
|
872 /* Should be able to state multiple independent __attribute__s, but \
|
|
873 the losing syntax doesn't work that way, and screws losing cpp */ \
|
442
|
874 extern void decl \
|
428
|
875 __attribute__ ((noreturn, format (printf, str, idx)))
|
|
876 # else
|
|
877 # define DOESNT_RETURN void volatile
|
|
878 # define DECLARE_DOESNT_RETURN(decl) extern void volatile decl
|
|
879 # define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
|
|
880 extern void volatile decl PRINTF_ARGS(str,idx)
|
|
881 # endif /* GNUC 2.5 */
|
|
882 # else
|
|
883 # define DOESNT_RETURN void
|
|
884 # define DECLARE_DOESNT_RETURN(decl) extern void decl
|
|
885 # define DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS(decl,str,idx) \
|
|
886 extern void decl PRINTF_ARGS(str,idx)
|
|
887 # endif /* GNUC */
|
|
888 #endif
|
|
889
|
771
|
890 /* Another try to fix SunPro C compiler warnings */
|
|
891 /* "end-of-loop code not reached" */
|
|
892 /* "statement not reached */
|
|
893 #if defined __SUNPRO_C || defined __USLC__
|
|
894 #define RETURN_SANS_WARNINGS if (1) return
|
1204
|
895 #define RETURN_NOT_REACHED(value) DO_NOTHING
|
|
896 #endif
|
|
897
|
|
898 /* More ways to shut up compiler. This works in Fcommand_loop_1(),
|
|
899 where there's an infinite loop in a function returning a Lisp object.
|
|
900 */
|
|
901 #if defined (_MSC_VER) || defined (__SUNPRO_C) || defined (__SUNPRO_CC) || \
|
|
902 (defined (DEC_ALPHA) && defined (OSF1))
|
|
903 #define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS if (0) return Qnil
|
|
904 #else
|
|
905 #define DO_NOTHING_DISABLING_NO_RETURN_WARNINGS DO_NOTHING
|
801
|
906 #endif
|
|
907
|
|
908 #ifndef RETURN_NOT_REACHED
|
1204
|
909 #define RETURN_NOT_REACHED(value) return (value)
|
801
|
910 #endif
|
|
911
|
|
912 #ifndef RETURN_SANS_WARNINGS
|
771
|
913 #define RETURN_SANS_WARNINGS return
|
|
914 #endif
|
|
915
|
793
|
916 #ifndef DO_NOTHING
|
|
917 #define DO_NOTHING do {} while (0)
|
|
918 #endif
|
|
919
|
|
920 #ifndef DECLARE_NOTHING
|
|
921 #define DECLARE_NOTHING struct nosuchstruct
|
|
922 #endif
|
|
923
|
|
924 /*#ifdef DEBUG_XEMACS*/
|
|
925 #define REGISTER
|
|
926 #define register
|
|
927 /*#else*/
|
|
928 /*#define REGISTER register*/
|
|
929 /*#endif*/
|
|
930
|
1632
|
931 #if defined(HAVE_MS_WINDOWS) && defined(HAVE_SHLIB)
|
|
932 # ifdef EMACS_MODULE
|
|
933 # define MODULE_API __declspec(dllimport)
|
|
934 # else
|
|
935 # define MODULE_API __declspec(dllexport)
|
|
936 # endif
|
|
937 #else
|
|
938 # define MODULE_API
|
|
939 #endif
|
|
940
|
793
|
941 /* ------------------------ alignment definitions ------------------- */
|
|
942
|
454
|
943 /* No type has a greater alignment requirement than max_align_t.
|
|
944 (except perhaps for types we don't use, like long double) */
|
|
945 typedef union
|
|
946 {
|
|
947 struct { long l; } l;
|
|
948 struct { void *p; } p;
|
|
949 struct { void (*f)(void); } f;
|
|
950 struct { double d; } d;
|
|
951 } max_align_t;
|
|
952
|
771
|
953 /* ALIGNOF returns the required alignment of a type -- i.e. a value such
|
|
954 that data of this type must begin at a memory address which is a
|
|
955 multiple of that value. For simple types, this is often the same size
|
|
956 as the type itself. */
|
|
957
|
428
|
958 #ifndef ALIGNOF
|
|
959 # if defined (__GNUC__) && (__GNUC__ >= 2)
|
454
|
960 /* gcc has an extension that gives us exactly what we want. */
|
|
961 # define ALIGNOF(type) __alignof__ (type)
|
|
962 # elif ! defined (__cplusplus)
|
|
963 /* The following is mostly portable, except that:
|
|
964 - it doesn't work for inside out declarations like void (*) (void).
|
|
965 (so just call ALIGNOF with a typedef'ed name)
|
|
966 - it doesn't work with C++. The C++ committee has decided,
|
|
967 in its infinite wisdom, that:
|
|
968 "Types must be declared in declarations, not in expressions." */
|
|
969 # define ALIGNOF(type) offsetof (struct { char c; type member; }, member)
|
428
|
970 # else
|
456
|
971 /* C++ is annoying, but it has a big bag of tricks.
|
|
972 The following doesn't have the "inside out" declaration bug C does. */
|
458
|
973 template<typename T> struct alignment_trick { char c; T member; };
|
456
|
974 # define ALIGNOF(type) offsetof (alignment_trick<type>, member)
|
428
|
975 # endif
|
454
|
976 #endif /* ALIGNOF */
|
428
|
977
|
771
|
978 /* ALIGN_SIZE returns the smallest size greater than or equal to LEN which
|
|
979 is a multiple of UNIT. This can be used to assure that data that
|
|
980 follows a block of the returned size is of correct alignment for a type
|
|
981 whose alignment (as returned by ALIGNOF) is UNIT (provided that the
|
|
982 block itself is correctly aligned for this type; memory returned by
|
|
983 malloc() is guaranteed to be correctly aligned for all types). */
|
|
984
|
428
|
985 #define ALIGN_SIZE(len, unit) \
|
|
986 ((((len) + (unit) - 1) / (unit)) * (unit))
|
|
987
|
826
|
988 /* ALIGN_FOR_TYPE returns the smallest size greater than or equal to LEN
|
|
989 which is aligned for the given type. This can be used to assure that
|
|
990 data that follows a block of the returned size is of correct alignment
|
|
991 for the type (provided that the block itself is correctly aligned for
|
|
992 this type; memory returned by malloc() is guaranteed to be correctly
|
|
993 aligned for all types). */
|
|
994
|
|
995 #define ALIGN_FOR_TYPE(len, type) ALIGN_SIZE (len, ALIGNOF (type))
|
|
996
|
771
|
997 /* MAX_ALIGN_SIZE returns the smallest size greater than or equal to LEN
|
|
998 which guarantees that data following a block of such size is correctly
|
|
999 aligned for all types (provided that the block itself is so aligned,
|
|
1000 which is the case for memory returned by malloc()). */
|
|
1001
|
826
|
1002 #define MAX_ALIGN_SIZE(len) ALIGN_FOR_TYPE (len, max_align_t)
|
|
1003
|
|
1004 /* ALIGN_PTR returns the smallest pointer >= PTR which is aligned for
|
|
1005 data of TYPE. */
|
|
1006 #define ALIGN_PTR(ptr, type) ((void *) ALIGN_FOR_TYPE ((size_t) (ptr), type))
|
428
|
1007
|
1650
|
1008 #ifdef __cplusplus
|
|
1009 extern "C" {
|
|
1010 #endif
|
|
1011
|
793
|
1012 /* ------------------------ assertions ------------------- */
|
428
|
1013
|
|
1014 /* We define assert iff USE_ASSERTIONS or DEBUG_XEMACS is defined.
|
|
1015 Otherwise we define it to be empty. Quantify has shown that the
|
|
1016 time the assert checks take is measurable so let's not include them
|
771
|
1017 in production binaries.
|
|
1018
|
788
|
1019 If ASSERTIONS_DONT_ABORT defined, we will continue after assertion
|
|
1020 failures.
|
|
1021
|
|
1022 assert_at_line() is used for asserts inside of inline functions called
|
|
1023 from error-checking macros. If we're not tricky, we just get the file
|
|
1024 and line of the inline function, which is not very useful. */
|
428
|
1025
|
|
1026 #ifdef USE_ASSERTIONS
|
|
1027 /* Highly dubious kludge */
|
|
1028 /* (thanks, Jamie, I feel better now -- ben) */
|
1632
|
1029 MODULE_API void assert_failed (const char *, int, const char *);
|
428
|
1030 # define abort() (assert_failed (__FILE__, __LINE__, "abort()"))
|
|
1031 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x))
|
853
|
1032 # define assert_with_message(x, msg) \
|
|
1033 ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg))
|
788
|
1034 # define assert_at_line(x, file, line) \
|
|
1035 ((x) ? (void) 0 : assert_failed (file, line, #x))
|
428
|
1036 #else
|
|
1037 # ifdef DEBUG_XEMACS
|
|
1038 # define assert(x) ((x) ? (void) 0 : (void) abort ())
|
853
|
1039 # define assert_with_message(x, msg) ((x) ? (void) 0 : (void) abort ())
|
788
|
1040 # define assert_at_line(x, file, line) assert (x)
|
428
|
1041 # else
|
771
|
1042 # define assert(x) ((void) 0)
|
853
|
1043 # define assert_with_message(x, msg)
|
788
|
1044 # define assert_at_line(x, file, line) assert (x)
|
428
|
1045 # endif
|
|
1046 #endif
|
|
1047
|
853
|
1048 /* ####
|
|
1049 Why the hell do we do this??????????????????????????????? */
|
|
1050 /*#ifdef DEBUG_XEMACS*/
|
|
1051 #define REGISTER
|
|
1052 #define register
|
|
1053 /*#else*/
|
|
1054 /*#define REGISTER register*/
|
|
1055 /*#endif*/
|
|
1056
|
|
1057
|
|
1058 /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
|
|
1059 In particular, it must be large enough to contain a pointer.
|
|
1060 config.h can override this, e.g. to use `long long' for bigger lisp ints.
|
|
1061
|
|
1062 #### In point of fact, it would NOT be a good idea for config.h to mess
|
|
1063 with EMACS_INT. A lot of code makes the basic assumption that EMACS_INT
|
|
1064 is the size of a pointer. */
|
|
1065
|
|
1066 #ifndef SIZEOF_EMACS_INT
|
|
1067 # define SIZEOF_EMACS_INT SIZEOF_VOID_P
|
|
1068 #endif
|
|
1069
|
771
|
1070 #if 0
|
|
1071 #ifdef USE_ASSERTIONS
|
|
1072 /* Highly dubious kludge */
|
|
1073 /* (thanks, Jamie, I feel better now -- ben) */
|
|
1074 void assert_failed (const char *, int, const char *);
|
|
1075 # define abort() (assert_failed (__FILE__, __LINE__, "abort()"))
|
|
1076 # define assert(x) ((x) ? 1 : (assert_failed (__FILE__, __LINE__, #x), 0))
|
|
1077 #else
|
|
1078 # ifdef DEBUG_XEMACS
|
|
1079 # define assert(x) ((x) ? 1 : ((void) abort (), 0))
|
|
1080 # else
|
|
1081 # define assert(x) (1)
|
|
1082 # endif
|
|
1083 #endif
|
|
1084 #endif /* 0 */
|
|
1085
|
793
|
1086 /* ------------------------ simple memory allocation ------------------- */
|
|
1087
|
|
1088 /* Memory allocation */
|
|
1089 void malloc_warning (const char *);
|
1632
|
1090 MODULE_API void *xmalloc (Bytecount size);
|
|
1091 MODULE_API void *xmalloc_and_zero (Bytecount size);
|
|
1092 MODULE_API void *xrealloc (void *, Bytecount size);
|
|
1093 MODULE_API char *xstrdup (const char *);
|
793
|
1094 /* generally useful */
|
|
1095 #define countof(x) ((int) (sizeof(x)/sizeof((x)[0])))
|
|
1096 #define xnew(type) ((type *) xmalloc (sizeof (type)))
|
|
1097 #define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type)))
|
|
1098 #define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type)))
|
|
1099 #define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue)))
|
|
1100 #define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type)))
|
|
1101 #define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type))))
|
851
|
1102 #define alloca_new(type) ((type *) ALLOCA (sizeof (type)))
|
|
1103 #define alloca_array(type, len) ((type *) ALLOCA ((len) * sizeof (type)))
|
|
1104
|
1632
|
1105 MODULE_API void *xemacs_c_alloca (unsigned int size);
|
|
1106
|
|
1107 MODULE_API int record_unwind_protect_freeing (void *ptr);
|
851
|
1108
|
|
1109 DECLARE_INLINE_HEADER (
|
|
1110 void *
|
|
1111 xmalloc_and_record_unwind (Bytecount size)
|
|
1112 )
|
|
1113 {
|
|
1114 void *ptr = xmalloc (size);
|
|
1115 record_unwind_protect_freeing (ptr);
|
|
1116 return ptr;
|
|
1117 }
|
|
1118
|
|
1119 /* Stack allocation.
|
|
1120
|
|
1121 Allocating excessively large blocks on the stack can cause crashes.
|
|
1122 We provide MALLOC_OR_ALLOCA() below for places where it's likely that
|
|
1123 large amounts will be allocated; it mallocs the block if it's too big.
|
|
1124 Unfortunately, that requires a call to unbind_to() at the end of the
|
|
1125 function, and it's not feasible to rewrite all calls to alloca() this
|
|
1126 way.
|
|
1127
|
|
1128 Instead, we use the portable C alloca() substitute in alloca.c above a
|
|
1129 certain size. This actually uses malloc(), but checks the current stack
|
|
1130 pointer to see if data from previous alloca() calls needs to be freed.
|
|
1131 However, this can lead to large heap sizes -- especially since cleanup
|
|
1132 can only happen in a parent function, and will never happen if (as will
|
|
1133 often be the case) it's the same function in the same place in the code
|
|
1134 that keeps tripping the alloca() limit.
|
|
1135
|
|
1136 So we set up a system to periodically force cleanup. Currently we
|
|
1137 do cleanup:
|
|
1138
|
|
1139 -- Only when there's C alloca() data, and then
|
|
1140 -- Every stack alloca() or allocation of Lisp data, every call to
|
|
1141 next_event_internal() [typically near the top of the stack],
|
|
1142 or every 10th funcall
|
|
1143
|
|
1144 This should not be a big penalty because
|
|
1145
|
|
1146 (a) If there are few C alloca() chunks, checking them will be fast
|
|
1147 (b) If not, we've allocated a huge amount of heap space (remember, each
|
|
1148 chunk represents > 256K of heap), and we really want them gone
|
|
1149 */
|
|
1150
|
|
1151 /* We use a larger maximum when the choice is alloca() vs. the C alloca()
|
|
1152 substitute than when the choice is vs. malloc(), because in the former
|
|
1153 case, our alternative choice is less palatable because the memory may
|
|
1154 not be freed for awhile. */
|
|
1155
|
|
1156 #define MAX_ALLOCA_VS_C_ALLOCA 262144
|
|
1157 #define MAX_ALLOCA_VS_MALLOC 65536
|
|
1158
|
|
1159 #define MAX_FUNCALLS_BETWEEN_ALLOCA_CLEANUP 10
|
|
1160
|
1632
|
1161 extern MODULE_API Bytecount __temp_alloca_size__;
|
851
|
1162 extern Bytecount funcall_alloca_count;
|
|
1163
|
1333
|
1164 #ifdef ERROR_CHECK_MALLOC
|
1632
|
1165 extern MODULE_API int regex_malloc_disallowed;
|
1333
|
1166 #define REGEX_MALLOC_CHECK() assert (!regex_malloc_disallowed)
|
|
1167 #else
|
|
1168 #define REGEX_MALLOC_CHECK() ((void) 0)
|
|
1169 #endif
|
|
1170
|
851
|
1171 /* Do stack or heap alloca() depending on size.
|
|
1172
|
|
1173 NOTE: The use of a global temporary like this is unsafe if ALLOCA() occurs
|
|
1174 twice anywhere in the same expression; but that seems highly unlikely. The
|
|
1175 alternative is to force all callers to declare a local temporary if the
|
|
1176 expression has side effects -- something easy to forget. */
|
|
1177
|
|
1178 #define ALLOCA(size) \
|
1333
|
1179 (REGEX_MALLOC_CHECK (), \
|
|
1180 __temp_alloca_size__ = (size), \
|
851
|
1181 __temp_alloca_size__ > MAX_ALLOCA_VS_C_ALLOCA ? \
|
|
1182 xemacs_c_alloca (__temp_alloca_size__) : \
|
|
1183 (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \
|
|
1184 alloca (__temp_alloca_size__)))
|
|
1185
|
1318
|
1186 /* Version of ALLOCA() that is guaranteed to work inside of function calls
|
|
1187 (i.e., we call the C alloca if regular alloca() is broken inside of
|
|
1188 function calls). */
|
|
1189 #ifdef BROKEN_ALLOCA_IN_FUNCTION_CALLS
|
|
1190 #define ALLOCA_FUNCALL_OK(size) xemacs_c_alloca (size)
|
|
1191 #else
|
|
1192 #define ALLOCA_FUNCALL_OK(size) ALLOCA (size)
|
|
1193 #endif
|
|
1194
|
851
|
1195 /* WARNING: If you use this, you must unbind_to() at the end of your
|
|
1196 function! */
|
|
1197
|
|
1198 #define MALLOC_OR_ALLOCA(size) \
|
1333
|
1199 (REGEX_MALLOC_CHECK (), \
|
|
1200 __temp_alloca_size__ = (size), \
|
851
|
1201 __temp_alloca_size__ > MAX_ALLOCA_VS_MALLOC ? \
|
|
1202 xmalloc_and_record_unwind (__temp_alloca_size__) : \
|
|
1203 (need_to_check_c_alloca ? xemacs_c_alloca (0) : 0, \
|
|
1204 alloca (__temp_alloca_size__)))
|
793
|
1205
|
|
1206 /* also generally useful if you want to avoid arbitrary size limits
|
|
1207 but don't need a full dynamic array. Assumes that BASEVAR points
|
|
1208 to a malloced array of TYPE objects (or possibly a NULL pointer,
|
|
1209 if SIZEVAR is 0), with the total size stored in SIZEVAR. This
|
|
1210 macro will realloc BASEVAR as necessary so that it can hold at
|
|
1211 least NEEDED_SIZE objects. The reallocing is done by doubling,
|
|
1212 which ensures constant amortized time per element. */
|
|
1213 #define DO_REALLOC(basevar, sizevar, needed_size, type) do { \
|
|
1214 Bytecount do_realloc_needed_size = (needed_size); \
|
1333
|
1215 REGEX_MALLOC_CHECK (); \
|
793
|
1216 if ((sizevar) < do_realloc_needed_size) \
|
|
1217 { \
|
|
1218 if ((sizevar) < 32) \
|
|
1219 (sizevar) = 32; \
|
|
1220 while ((sizevar) < do_realloc_needed_size) \
|
|
1221 (sizevar) *= 2; \
|
|
1222 XREALLOC_ARRAY (basevar, type, (sizevar)); \
|
|
1223 } \
|
|
1224 } while (0)
|
|
1225
|
|
1226 #ifdef ERROR_CHECK_MALLOC
|
1632
|
1227 MODULE_API void xfree_1 (void *);
|
793
|
1228 #define xfree(lvalue) do \
|
|
1229 { \
|
|
1230 void **xfree_ptr = (void **) &(lvalue); \
|
|
1231 xfree_1 (*xfree_ptr); \
|
|
1232 *xfree_ptr = (void *) 0xDEADBEEF; \
|
|
1233 } while (0)
|
|
1234 #else
|
1632
|
1235 MODULE_API void xfree (void *);
|
793
|
1236 #endif /* ERROR_CHECK_MALLOC */
|
|
1237
|
|
1238 /* ------------------------ dynamic arrays ------------------- */
|
|
1239
|
1318
|
1240 #ifdef ERROR_CHECK_STRUCTURES
|
|
1241 #define Dynarr_declare(type) \
|
|
1242 type *base; \
|
|
1243 int locked; \
|
|
1244 int elsize; \
|
|
1245 int cur; \
|
|
1246 int largest; \
|
|
1247 int max
|
|
1248 #else
|
793
|
1249 #define Dynarr_declare(type) \
|
|
1250 type *base; \
|
|
1251 int elsize; \
|
|
1252 int cur; \
|
|
1253 int largest; \
|
|
1254 int max
|
1318
|
1255 #endif /* ERROR_CHECK_STRUCTURES */
|
793
|
1256
|
|
1257 typedef struct dynarr
|
|
1258 {
|
|
1259 Dynarr_declare (void);
|
|
1260 } Dynarr;
|
|
1261
|
1632
|
1262 MODULE_API void *Dynarr_newf (int elsize);
|
|
1263 MODULE_API void Dynarr_resize (void *dy, int size);
|
|
1264 MODULE_API void Dynarr_insert_many (void *d, const void *el, int len, int start);
|
|
1265 MODULE_API void Dynarr_delete_many (void *d, int start, int len);
|
|
1266 MODULE_API void Dynarr_free (void *d);
|
793
|
1267
|
|
1268 #define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
|
|
1269 #define Dynarr_new2(dynarr_type, type) \
|
|
1270 ((dynarr_type *) Dynarr_newf (sizeof (type)))
|
|
1271 #define Dynarr_at(d, pos) ((d)->base[pos])
|
|
1272 #define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
|
|
1273 #define Dynarr_begin(d) Dynarr_atp (d, 0)
|
819
|
1274 #define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d) - 1)
|
793
|
1275 #define Dynarr_sizeof(d) ((d)->cur * (d)->elsize)
|
|
1276
|
800
|
1277 #ifdef ERROR_CHECK_STRUCTURES
|
793
|
1278 DECLARE_INLINE_HEADER (
|
|
1279 Dynarr *
|
|
1280 Dynarr_verify_1 (void *d, const char *file, int line)
|
|
1281 )
|
|
1282 {
|
|
1283 Dynarr *dy = (Dynarr *) d;
|
|
1284 assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest &&
|
|
1285 dy->largest <= dy->max, file, line);
|
|
1286 return dy;
|
|
1287 }
|
|
1288
|
1318
|
1289 DECLARE_INLINE_HEADER (
|
|
1290 Dynarr *
|
|
1291 Dynarr_verify_mod_1 (void *d, const char *file, int line)
|
|
1292 )
|
|
1293 {
|
|
1294 Dynarr *dy = (Dynarr *) d;
|
|
1295 assert_at_line (!dy->locked, file, line);
|
|
1296 assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest &&
|
|
1297 dy->largest <= dy->max, file, line);
|
|
1298 return dy;
|
|
1299 }
|
|
1300
|
793
|
1301 #define Dynarr_verify(d) Dynarr_verify_1 (d, __FILE__, __LINE__)
|
1318
|
1302 #define Dynarr_verify_mod(d) Dynarr_verify_mod_1 (d, __FILE__, __LINE__)
|
|
1303 #define Dynarr_lock(d) (Dynarr_verify_mod (d)->locked = 1)
|
|
1304 #define Dynarr_unlock(d) ((d)->locked = 0)
|
793
|
1305 #else
|
|
1306 #define Dynarr_verify(d) (d)
|
1318
|
1307 #define Dynarr_verify_mod(d) (d)
|
|
1308 #define Dynarr_lock(d)
|
|
1309 #define Dynarr_unlock(d)
|
800
|
1310 #endif /* ERROR_CHECK_STRUCTURES */
|
793
|
1311
|
|
1312 #define Dynarr_length(d) (Dynarr_verify (d)->cur)
|
|
1313 #define Dynarr_largest(d) (Dynarr_verify (d)->largest)
|
1318
|
1314 #define Dynarr_reset(d) (Dynarr_verify_mod (d)->cur = 0)
|
793
|
1315 #define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur)
|
|
1316 #define Dynarr_insert_many_at_start(d, el, len) \
|
|
1317 Dynarr_insert_many (d, el, len, 0)
|
|
1318 #define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1)
|
1318
|
1319 #define Dynarr_add_lisp_string(d, s, codesys) \
|
|
1320 do { \
|
|
1321 Lisp_Object dyna_ls_s = (s); \
|
|
1322 Lisp_Object dyna_ls_cs = (codesys); \
|
|
1323 Extbyte *dyna_ls_eb; \
|
|
1324 Bytecount dyna_ls_bc; \
|
|
1325 \
|
|
1326 LISP_STRING_TO_SIZED_EXTERNAL (dyna_ls_s, dyna_ls_eb, \
|
|
1327 dyna_ls_bc, dyna_ls_cs); \
|
|
1328 Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc); \
|
793
|
1329 } while (0)
|
|
1330
|
1318
|
1331 #define Dynarr_add(d, el) ( \
|
|
1332 Dynarr_verify_mod (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : \
|
|
1333 (void) 0, \
|
|
1334 ((d)->base)[(d)->cur++] = (el), \
|
793
|
1335 (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0)
|
|
1336
|
|
1337 /* The following defines will get you into real trouble if you aren't
|
|
1338 careful. But they can save a lot of execution time when used wisely. */
|
1318
|
1339 #define Dynarr_increment(d) (Dynarr_verify_mod (d)->cur++)
|
|
1340 #define Dynarr_set_size(d, n) (Dynarr_verify_mod (d)->cur = n)
|
|
1341
|
|
1342 #define Dynarr_pop(d) \
|
|
1343 (assert ((d)->cur > 0), Dynarr_verify_mod (d)->cur--, \
|
|
1344 Dynarr_at (d, (d)->cur))
|
|
1345 #define Dynarr_delete(d, i) Dynarr_delete_many (d, i, 1)
|
793
|
1346 #define Dynarr_delete_by_pointer(d, p) \
|
|
1347 Dynarr_delete_many (d, (p) - ((d)->base), 1)
|
|
1348
|
1318
|
1349 #define Dynarr_delete_object(d, el) \
|
|
1350 do \
|
|
1351 { \
|
|
1352 REGISTER int i; \
|
|
1353 for (i = Dynarr_length (d) - 1; i >= 0; i--) \
|
|
1354 { \
|
|
1355 if (el == Dynarr_at (d, i)) \
|
|
1356 Dynarr_delete_many (d, i, 1); \
|
|
1357 } \
|
996
|
1358 } while (0)
|
|
1359
|
793
|
1360 #ifdef MEMORY_USAGE_STATS
|
|
1361 struct overhead_stats;
|
|
1362 Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
|
|
1363 #endif
|
428
|
1364
|
853
|
1365 /* Counts of bytes or chars */
|
428
|
1366
|
647
|
1367 /* Note that the simplest typedefs are near the top of this file. */
|
|
1368
|
428
|
1369 /* We put typedefs here so that prototype declarations don't choke.
|
|
1370 Note that we don't actually declare the structures here (except
|
|
1371 maybe for simple structures like Dynarrs); that keeps them private
|
|
1372 to the routines that actually use them. */
|
|
1373
|
771
|
1374 /* ------------------------------- */
|
|
1375 /* Error_Behavior typedefs */
|
|
1376 /* ------------------------------- */
|
|
1377
|
800
|
1378 #ifndef ERROR_CHECK_TYPES
|
771
|
1379
|
|
1380 typedef enum error_behavior
|
428
|
1381 {
|
771
|
1382 ERROR_ME,
|
|
1383 ERROR_ME_NOT,
|
793
|
1384 ERROR_ME_WARN,
|
|
1385 ERROR_ME_DEBUG_WARN
|
771
|
1386 } Error_Behavior;
|
|
1387
|
|
1388 #define ERRB_EQ(a, b) ((a) == (b))
|
|
1389
|
|
1390 #else
|
|
1391
|
|
1392 /* By defining it like this, we provide strict type-checking
|
|
1393 for code that lazily uses ints. */
|
|
1394
|
|
1395 typedef struct _error_behavior_struct_
|
428
|
1396 {
|
771
|
1397 int really_unlikely_name_to_have_accidentally_in_a_non_errb_structure;
|
|
1398 } Error_Behavior;
|
|
1399
|
|
1400 extern Error_Behavior ERROR_ME;
|
|
1401 extern Error_Behavior ERROR_ME_NOT;
|
|
1402 extern Error_Behavior ERROR_ME_WARN;
|
793
|
1403 extern Error_Behavior ERROR_ME_DEBUG_WARN;
|
771
|
1404
|
|
1405 #define ERRB_EQ(a, b) \
|
|
1406 ((a).really_unlikely_name_to_have_accidentally_in_a_non_errb_structure == \
|
|
1407 (b).really_unlikely_name_to_have_accidentally_in_a_non_errb_structure)
|
|
1408
|
|
1409 #endif
|
|
1410
|
|
1411 /* ------------------------------- */
|
|
1412 /* Empty structures and typedefs */
|
|
1413 /* ------------------------------- */
|
428
|
1414
|
|
1415 struct buffer; /* "buffer.h" */
|
|
1416 struct console; /* "console.h" */
|
|
1417 struct device; /* "device.h" */
|
|
1418 struct extent_fragment;
|
|
1419 struct extent;
|
|
1420 struct frame; /* "frame.h" */
|
|
1421 struct window; /* "window.h" */
|
771
|
1422 struct utimbuf; /* "systime.h" or <utime.h> */
|
428
|
1423 struct display_line;
|
|
1424 struct display_glyph_area;
|
|
1425 struct display_box;
|
|
1426 struct redisplay_info;
|
|
1427 struct window_mirror;
|
|
1428 struct scrollbar_instance;
|
|
1429 struct font_metric_info;
|
|
1430 struct face_cachel;
|
|
1431 struct console_type_entry;
|
|
1432
|
771
|
1433 /* This is shared by process.h, events.h and others in future.
|
|
1434 See events.h for description */
|
|
1435 typedef unsigned int USID;
|
|
1436 typedef int face_index;
|
|
1437 typedef int glyph_index;
|
872
|
1438 typedef struct lstream Lstream; /* lstream-impl.h */
|
|
1439 typedef struct extent *EXTENT; /* extents-impl.h */
|
771
|
1440 typedef struct Lisp_Event Lisp_Event; /* "events.h" */
|
872
|
1441 typedef struct Lisp_Face Lisp_Face; /* "faces-impl.h" */
|
771
|
1442 typedef struct Lisp_Process Lisp_Process; /* "procimpl.h" */
|
872
|
1443 typedef struct Lisp_Color_Instance Lisp_Color_Instance; /* objects-impl.h */
|
|
1444 typedef struct Lisp_Font_Instance Lisp_Font_Instance; /* objects-impl.h */
|
|
1445 typedef struct Lisp_Image_Instance Lisp_Image_Instance; /* glyphs-impl.h */
|
771
|
1446 typedef struct Lisp_Gui_Item Lisp_Gui_Item;
|
|
1447
|
|
1448 /* ------------------------------- */
|
|
1449 /* Dynarr typedefs */
|
|
1450 /* ------------------------------- */
|
|
1451
|
|
1452 /* Dynarr typedefs -- basic types first */
|
|
1453
|
428
|
1454 typedef struct
|
|
1455 {
|
867
|
1456 Dynarr_declare (Ibyte);
|
|
1457 } Ibyte_dynarr;
|
428
|
1458
|
|
1459 typedef struct
|
|
1460 {
|
|
1461 Dynarr_declare (Extbyte);
|
|
1462 } Extbyte_dynarr;
|
|
1463
|
|
1464 typedef struct
|
|
1465 {
|
867
|
1466 Dynarr_declare (Ichar);
|
|
1467 } Ichar_dynarr;
|
428
|
1468
|
|
1469 typedef struct
|
|
1470 {
|
|
1471 Dynarr_declare (char);
|
|
1472 } char_dynarr;
|
|
1473
|
771
|
1474 typedef struct
|
|
1475 {
|
|
1476 Dynarr_declare (char *);
|
|
1477 } char_ptr_dynarr;
|
|
1478
|
428
|
1479 typedef unsigned char unsigned_char;
|
|
1480 typedef struct
|
|
1481 {
|
|
1482 Dynarr_declare (unsigned char);
|
|
1483 } unsigned_char_dynarr;
|
|
1484
|
|
1485 typedef unsigned long unsigned_long;
|
|
1486 typedef struct
|
|
1487 {
|
|
1488 Dynarr_declare (unsigned long);
|
|
1489 } unsigned_long_dynarr;
|
|
1490
|
|
1491 typedef struct
|
|
1492 {
|
|
1493 Dynarr_declare (int);
|
|
1494 } int_dynarr;
|
|
1495
|
|
1496 typedef struct
|
|
1497 {
|
665
|
1498 Dynarr_declare (Charbpos);
|
|
1499 } Charbpos_dynarr;
|
428
|
1500
|
|
1501 typedef struct
|
|
1502 {
|
665
|
1503 Dynarr_declare (Bytebpos);
|
|
1504 } Bytebpos_dynarr;
|
428
|
1505
|
|
1506 typedef struct
|
|
1507 {
|
|
1508 Dynarr_declare (Charcount);
|
|
1509 } Charcount_dynarr;
|
|
1510
|
|
1511 typedef struct
|
|
1512 {
|
|
1513 Dynarr_declare (Bytecount);
|
|
1514 } Bytecount_dynarr;
|
|
1515
|
771
|
1516 /* Dynarr typedefs -- more complex types */
|
|
1517
|
|
1518 typedef struct
|
|
1519 {
|
|
1520 Dynarr_declare (struct face_cachel);
|
|
1521 } face_cachel_dynarr;
|
|
1522
|
|
1523 typedef struct
|
|
1524 {
|
|
1525 Dynarr_declare (struct glyph_cachel);
|
|
1526 } glyph_cachel_dynarr;
|
|
1527
|
428
|
1528 typedef struct
|
|
1529 {
|
|
1530 Dynarr_declare (struct console_type_entry);
|
|
1531 } console_type_entry_dynarr;
|
|
1532
|
771
|
1533 /* ------------------------------- */
|
|
1534 /* enum typedefs */
|
|
1535 /* ------------------------------- */
|
|
1536
|
428
|
1537 enum run_hooks_condition
|
|
1538 {
|
|
1539 RUN_HOOKS_TO_COMPLETION,
|
|
1540 RUN_HOOKS_UNTIL_SUCCESS,
|
|
1541 RUN_HOOKS_UNTIL_FAILURE
|
|
1542 };
|
|
1543
|
|
1544 #ifdef HAVE_TOOLBARS
|
|
1545 enum toolbar_pos
|
|
1546 {
|
|
1547 TOP_TOOLBAR,
|
|
1548 BOTTOM_TOOLBAR,
|
|
1549 LEFT_TOOLBAR,
|
|
1550 RIGHT_TOOLBAR
|
|
1551 };
|
|
1552 #endif
|
|
1553
|
|
1554 enum edge_style
|
|
1555 {
|
|
1556 EDGE_ETCHED_IN,
|
|
1557 EDGE_ETCHED_OUT,
|
|
1558 EDGE_BEVEL_IN,
|
|
1559 EDGE_BEVEL_OUT
|
|
1560 };
|
|
1561
|
|
1562 enum munge_me_out_the_door
|
|
1563 {
|
|
1564 MUNGE_ME_FUNCTION_KEY,
|
|
1565 MUNGE_ME_KEY_TRANSLATION
|
|
1566 };
|
|
1567
|
771
|
1568 /* ------------------------------- */
|
|
1569 /* misc */
|
|
1570 /* ------------------------------- */
|
|
1571
|
|
1572 #ifdef MEMORY_USAGE_STATS
|
|
1573
|
|
1574 /* This structure is used to keep statistics on the amount of memory
|
|
1575 in use.
|
|
1576
|
|
1577 WAS_REQUESTED stores the actual amount of memory that was requested
|
|
1578 of the allocation function. The *_OVERHEAD fields store the
|
|
1579 additional amount of memory that was grabbed by the functions to
|
|
1580 facilitate allocation, reallocation, etc. MALLOC_OVERHEAD is for
|
|
1581 memory allocated with malloc(); DYNARR_OVERHEAD is for dynamic
|
|
1582 arrays; GAP_OVERHEAD is for gap arrays. Note that for (e.g.)
|
|
1583 dynamic arrays, there is both MALLOC_OVERHEAD and DYNARR_OVERHEAD
|
|
1584 memory: The dynamic array allocates memory above and beyond what
|
|
1585 was asked of it, and when it in turns allocates memory using
|
|
1586 malloc(), malloc() allocates memory beyond what it was asked
|
|
1587 to allocate.
|
|
1588
|
|
1589 Functions that accept a structure of this sort do not initialize
|
|
1590 the fields to 0, and add any existing values to whatever was there
|
|
1591 before; this way, you can get a cumulative effect. */
|
|
1592
|
|
1593 struct overhead_stats
|
|
1594 {
|
|
1595 int was_requested;
|
|
1596 int malloc_overhead;
|
|
1597 int dynarr_overhead;
|
|
1598 int gap_overhead;
|
|
1599 };
|
|
1600
|
|
1601 #endif /* MEMORY_USAGE_STATS */
|
|
1602
|
428
|
1603
|
|
1604 /************************************************************************/
|
|
1605 /* Definition of Lisp_Object data type */
|
|
1606 /************************************************************************/
|
|
1607
|
|
1608 /* Define the fundamental Lisp data structures */
|
|
1609
|
|
1610 /* This is the set of Lisp data types */
|
|
1611
|
|
1612 enum Lisp_Type
|
|
1613 {
|
|
1614 Lisp_Type_Record,
|
|
1615 Lisp_Type_Int_Even,
|
|
1616 Lisp_Type_Char,
|
|
1617 Lisp_Type_Int_Odd
|
|
1618 };
|
|
1619
|
|
1620 #define POINTER_TYPE_P(type) ((type) == Lisp_Type_Record)
|
|
1621
|
|
1622 /* Overridden by m/next.h */
|
|
1623 #ifndef ASSERT_VALID_POINTER
|
|
1624 # define ASSERT_VALID_POINTER(pnt) (assert ((((EMACS_UINT) pnt) & 3) == 0))
|
|
1625 #endif
|
|
1626
|
|
1627 #define GCMARKBITS 0
|
|
1628 #define GCTYPEBITS 2
|
|
1629 #define GCBITS 2
|
|
1630 #define INT_GCBITS 1
|
|
1631
|
|
1632 #define INT_VALBITS (BITS_PER_EMACS_INT - INT_GCBITS)
|
|
1633 #define VALBITS (BITS_PER_EMACS_INT - GCBITS)
|
542
|
1634 #define EMACS_INT_MAX ((EMACS_INT) ((1UL << (INT_VALBITS - 1)) -1UL))
|
442
|
1635 #define EMACS_INT_MIN (-(EMACS_INT_MAX) - 1)
|
802
|
1636 /* WARNING: evaluates its arg twice. */
|
|
1637 #define NUMBER_FITS_IN_AN_EMACS_INT(num) \
|
|
1638 ((num) <= EMACS_INT_MAX && (num) >= EMACS_INT_MIN)
|
428
|
1639
|
|
1640 #ifdef USE_UNION_TYPE
|
|
1641 # include "lisp-union.h"
|
|
1642 #else /* !USE_UNION_TYPE */
|
|
1643 # include "lisp-disunion.h"
|
|
1644 #endif /* !USE_UNION_TYPE */
|
|
1645
|
|
1646 #define XPNTR(x) ((void *) XPNTRVAL(x))
|
|
1647
|
|
1648 /* WARNING WARNING WARNING. You must ensure on your own that proper
|
|
1649 GC protection is provided for the elements in this array. */
|
|
1650 typedef struct
|
|
1651 {
|
|
1652 Dynarr_declare (Lisp_Object);
|
|
1653 } Lisp_Object_dynarr;
|
|
1654
|
452
|
1655 typedef struct
|
|
1656 {
|
|
1657 Dynarr_declare (Lisp_Object *);
|
|
1658 } Lisp_Object_ptr_dynarr;
|
|
1659
|
428
|
1660 /* Close your eyes now lest you vomit or spontaneously combust ... */
|
|
1661
|
|
1662 #define HACKEQ_UNSAFE(obj1, obj2) \
|
|
1663 (EQ (obj1, obj2) || (!POINTER_TYPE_P (XTYPE (obj1)) \
|
|
1664 && !POINTER_TYPE_P (XTYPE (obj2)) \
|
|
1665 && XCHAR_OR_INT (obj1) == XCHAR_OR_INT (obj2)))
|
|
1666
|
|
1667 #ifdef DEBUG_XEMACS
|
1632
|
1668 extern MODULE_API int debug_issue_ebola_notices;
|
|
1669 MODULE_API int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
|
428
|
1670 #define EQ_WITH_EBOLA_NOTICE(obj1, obj2) \
|
|
1671 (debug_issue_ebola_notices ? eq_with_ebola_notice (obj1, obj2) \
|
|
1672 : EQ (obj1, obj2))
|
|
1673 #else
|
|
1674 #define EQ_WITH_EBOLA_NOTICE(obj1, obj2) EQ (obj1, obj2)
|
|
1675 #endif
|
|
1676
|
|
1677 /* OK, you can open them again */
|
|
1678
|
1650
|
1679 #ifdef __cplusplus
|
|
1680 }
|
|
1681 #endif
|
|
1682
|
428
|
1683 /************************************************************************/
|
442
|
1684 /** Definitions of basic Lisp objects **/
|
428
|
1685 /************************************************************************/
|
|
1686
|
|
1687 #include "lrecord.h"
|
|
1688
|
1650
|
1689 #ifdef __cplusplus
|
|
1690 extern "C" {
|
|
1691 #endif
|
|
1692
|
442
|
1693 /*------------------------------ unbound -------------------------------*/
|
428
|
1694
|
|
1695 /* Qunbound is a special Lisp_Object (actually of type
|
|
1696 symbol-value-forward), that can never be visible to
|
|
1697 the Lisp caller and thus can be used in the C code
|
|
1698 to mean "no such value". */
|
|
1699
|
|
1700 #define UNBOUNDP(val) EQ (val, Qunbound)
|
|
1701
|
771
|
1702 /* Evaluate expr, return it if it's not Qunbound. */
|
|
1703 #define RETURN_IF_NOT_UNBOUND(expr) do \
|
|
1704 { \
|
|
1705 Lisp_Object ret_nunb_val = (expr); \
|
|
1706 if (!UNBOUNDP (ret_nunb_val)) \
|
|
1707 RETURN_SANS_WARNINGS ret_nunb_val; \
|
|
1708 } while (0)
|
|
1709
|
442
|
1710 /*------------------------------- cons ---------------------------------*/
|
428
|
1711
|
|
1712 /* In a cons, the markbit of the car is the gc mark bit */
|
|
1713
|
|
1714 struct Lisp_Cons
|
|
1715 {
|
|
1716 struct lrecord_header lheader;
|
853
|
1717 Lisp_Object car_, cdr_;
|
428
|
1718 };
|
|
1719 typedef struct Lisp_Cons Lisp_Cons;
|
|
1720
|
|
1721 #if 0 /* FSFmacs */
|
|
1722 /* Like a cons, but records info on where the text lives that it was read from */
|
|
1723 /* This is not really in use now */
|
|
1724
|
|
1725 struct Lisp_Buffer_Cons
|
|
1726 {
|
|
1727 Lisp_Object car, cdr;
|
|
1728 struct buffer *buffer;
|
665
|
1729 int charbpos;
|
428
|
1730 };
|
|
1731 #endif
|
|
1732
|
1632
|
1733 DECLARE_MODULE_API_LRECORD (cons, Lisp_Cons);
|
428
|
1734 #define XCONS(x) XRECORD (x, cons, Lisp_Cons)
|
617
|
1735 #define wrap_cons(p) wrap_record (p, cons)
|
428
|
1736 #define CONSP(x) RECORDP (x, cons)
|
|
1737 #define CHECK_CONS(x) CHECK_RECORD (x, cons)
|
|
1738 #define CONCHECK_CONS(x) CONCHECK_RECORD (x, cons)
|
|
1739
|
|
1740 #define CONS_MARKED_P(c) MARKED_RECORD_HEADER_P(&((c)->lheader))
|
|
1741 #define MARK_CONS(c) MARK_RECORD_HEADER (&((c)->lheader))
|
|
1742
|
1632
|
1743 extern MODULE_API Lisp_Object Qnil;
|
428
|
1744
|
|
1745 #define NILP(x) EQ (x, Qnil)
|
853
|
1746 #define cons_car(a) ((a)->car_)
|
|
1747 #define cons_cdr(a) ((a)->cdr_)
|
|
1748 #define XCAR(a) (XCONS (a)->car_)
|
|
1749 #define XCDR(a) (XCONS (a)->cdr_)
|
1318
|
1750 #define XCADR(a) (XCAR (XCDR (a)))
|
|
1751 #define XCDDR(a) (XCDR (XCDR (a)))
|
|
1752 #define XCADDR(a) (XCAR (XCDDR (a)))
|
|
1753 #define XCDDDR(a) (XCDR (XCDDR (a)))
|
|
1754 #define XCADDDR(a) (XCAR (XCDDDR (a)))
|
|
1755 #define XCDDDDR(a) (XCDR (XCDDDR (a)))
|
|
1756 #define XCADDDDR(a) (XCAR (XCDDDDR (a)))
|
|
1757 #define XCDDDDDR(a) (XCDR (XCDDDDR (a)))
|
|
1758 #define XCADDDDDR(a) (XCAR (XCDDDDDR (a)))
|
|
1759 #define XCDDDDDDR(a) (XCDR (XCDDDDDR (a)))
|
|
1760 #define X1ST(a) XCAR (a)
|
|
1761 #define X2ND(a) XCADR (a)
|
|
1762 #define X3RD(a) XCADDR (a)
|
|
1763 #define X4TH(a) XCADDDR (a)
|
|
1764 #define X5TH(a) XCADDDDR (a)
|
|
1765 #define X6TH(a) XCADDDDDR (a)
|
|
1766
|
853
|
1767 #define XSETCAR(a, b) (XCONS (a)->car_ = (b))
|
|
1768 #define XSETCDR(a, b) (XCONS (a)->cdr_ = (b))
|
428
|
1769 #define LISTP(x) (CONSP(x) || NILP(x))
|
|
1770
|
|
1771 #define CHECK_LIST(x) do { \
|
|
1772 if (!LISTP (x)) \
|
|
1773 dead_wrong_type_argument (Qlistp, x); \
|
|
1774 } while (0)
|
|
1775
|
|
1776 #define CONCHECK_LIST(x) do { \
|
|
1777 if (!LISTP (x)) \
|
|
1778 x = wrong_type_argument (Qlistp, x); \
|
|
1779 } while (0)
|
|
1780
|
442
|
1781 /*---------------------- list traversal macros -------------------------*/
|
|
1782
|
|
1783 /* Note: These macros are for traversing through a list in some format,
|
|
1784 and executing code that you specify on each member of the list.
|
|
1785
|
|
1786 There are two kinds of macros, those requiring surrounding braces, and
|
|
1787 those not requiring this. Which type of macro will be indicated.
|
|
1788 The general format for using a brace-requiring macro is
|
|
1789
|
|
1790 {
|
|
1791 LIST_LOOP_3 (elt, list, tail)
|
|
1792 execute_code_here;
|
|
1793 }
|
|
1794
|
|
1795 or
|
|
1796
|
|
1797 {
|
|
1798 LIST_LOOP_3 (elt, list, tail)
|
|
1799 {
|
|
1800 execute_code_here;
|
|
1801 }
|
|
1802 }
|
|
1803
|
|
1804 You can put variable declarations between the brace and beginning of
|
|
1805 macro, but NOTHING ELSE.
|
|
1806
|
|
1807 The brace-requiring macros typically declare themselves any arguments
|
|
1808 that are initialized and iterated by the macros. If for some reason
|
|
1809 you need to declare these arguments yourself (e.g. to do something on
|
|
1810 them before the iteration starts, use the _NO_DECLARE versions of the
|
|
1811 macros.)
|
|
1812 */
|
|
1813
|
|
1814 /* There are two basic kinds of macros: those that handle "internal" lists
|
|
1815 that are known to be correctly structured (i.e. first element is a cons
|
|
1816 or nil, and the car of each cons is also a cons or nil, and there are
|
|
1817 no circularities), and those that handle "external" lists, where the
|
|
1818 list may have any sort of invalid formation. This is reflected in
|
|
1819 the names: those with "EXTERNAL_" work with external lists, and those
|
|
1820 without this prefix work with internal lists. The internal-list
|
|
1821 macros will hit an assertion failure if the structure is ill-formed;
|
|
1822 the external-list macros will signal an error in this case, either a
|
|
1823 malformed-list error or a circular-list error.
|
|
1824
|
|
1825 Note also that the simplest external list iterator, EXTERNAL_LIST_LOOP,
|
|
1826 does *NOT* check for circularities. Therefore, make sure you call
|
|
1827 QUIT each iteration or so. However, it's probably easier just to use
|
|
1828 EXTERNAL_LIST_LOOP_2, which is easier to use in any case.
|
|
1829 */
|
|
1830
|
|
1831 /* LIST_LOOP and EXTERNAL_LIST_LOOP are the simplest macros. They don't
|
|
1832 require brace surrounding, and iterate through a list, which may or may
|
|
1833 not known to be syntactically correct. EXTERNAL_LIST_LOOP is for those
|
|
1834 not known to be correct, and it detects and signals a malformed list
|
|
1835 error when encountering a problem. Circularities, however, are not
|
|
1836 handled, and cause looping forever, so make sure to include a QUIT.
|
|
1837 These functions also accept two args, TAIL (set progressively to each
|
|
1838 cons starting with the first), and LIST, the list to iterate over.
|
|
1839 TAIL needs to be defined by the program.
|
|
1840
|
|
1841 In each iteration, you can retrieve the current list item using XCAR
|
|
1842 (tail), or destructively modify the list using XSETCAR (tail,
|
|
1843 ...). */
|
|
1844
|
428
|
1845 #define LIST_LOOP(tail, list) \
|
|
1846 for (tail = list; \
|
|
1847 !NILP (tail); \
|
|
1848 tail = XCDR (tail))
|
|
1849
|
|
1850 #define EXTERNAL_LIST_LOOP(tail, list) \
|
|
1851 for (tail = list; !NILP (tail); tail = XCDR (tail)) \
|
|
1852 if (!CONSP (tail)) \
|
|
1853 signal_malformed_list_error (list); \
|
|
1854 else
|
|
1855
|
442
|
1856 /* The following macros are the "core" macros for list traversal.
|
|
1857
|
|
1858 *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
|
|
1859
|
|
1860 LIST_LOOP_2 and EXTERNAL_LIST_LOOP_2 are the standard, most-often used
|
|
1861 macros. They take two arguments, an element variable ELT and the list
|
|
1862 LIST. ELT is automatically declared, and set to each element in turn
|
|
1863 from LIST.
|
|
1864
|
|
1865 LIST_LOOP_3 and EXTERNAL_LIST_LOOP_3 are the same, but they have a third
|
|
1866 argument TAIL, another automatically-declared variable. At each iteration,
|
|
1867 this one points to the cons cell for which ELT is the car.
|
|
1868
|
|
1869 EXTERNAL_LIST_LOOP_4 is like EXTERNAL_LIST_LOOP_3 but takes an additional
|
|
1870 LEN argument, again automatically declared, which counts the number of
|
|
1871 iterations gone by. It is 0 during the first iteration.
|
|
1872
|
|
1873 EXTERNAL_LIST_LOOP_4_NO_DECLARE is like EXTERNAL_LIST_LOOP_4 but none
|
|
1874 of the variables are automatically declared, and so you need to declare
|
|
1875 them yourself. (ELT and TAIL are Lisp_Objects, and LEN is an EMACS_INT.)
|
|
1876 */
|
|
1877
|
|
1878 #define LIST_LOOP_2(elt, list) \
|
|
1879 LIST_LOOP_3(elt, list, unused_tail_##elt)
|
|
1880
|
|
1881 #define LIST_LOOP_3(elt, list, tail) \
|
|
1882 Lisp_Object elt, tail; \
|
|
1883 for (tail = list; \
|
|
1884 NILP (tail) ? \
|
|
1885 0 : (elt = XCAR (tail), 1); \
|
|
1886 tail = XCDR (tail))
|
428
|
1887
|
|
1888 /* The following macros are for traversing lisp lists.
|
|
1889 Signal an error if LIST is not properly acyclic and nil-terminated.
|
|
1890
|
|
1891 Use tortoise/hare algorithm to check for cycles, but only if it
|
|
1892 looks like the list is getting too long. Not only is the hare
|
|
1893 faster than the tortoise; it even gets a head start! */
|
|
1894
|
|
1895 /* Optimized and safe macros for looping over external lists. */
|
|
1896 #define CIRCULAR_LIST_SUSPICION_LENGTH 1024
|
|
1897
|
|
1898 #define EXTERNAL_LIST_LOOP_1(list) \
|
|
1899 Lisp_Object ELL1_elt, ELL1_hare, ELL1_tortoise; \
|
442
|
1900 EMACS_INT ELL1_len; \
|
|
1901 PRIVATE_EXTERNAL_LIST_LOOP_6 (ELL1_elt, list, ELL1_len, ELL1_hare, \
|
428
|
1902 ELL1_tortoise, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
1903
|
|
1904 #define EXTERNAL_LIST_LOOP_2(elt, list) \
|
442
|
1905 Lisp_Object elt, hare_##elt, tortoise_##elt; \
|
|
1906 EMACS_INT len_##elt; \
|
|
1907 PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt, \
|
428
|
1908 tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
1909
|
|
1910 #define EXTERNAL_LIST_LOOP_3(elt, list, tail) \
|
442
|
1911 Lisp_Object elt, tail, tortoise_##elt; \
|
|
1912 EMACS_INT len_##elt; \
|
|
1913 PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, tail, \
|
|
1914 tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
1915
|
|
1916 #define EXTERNAL_LIST_LOOP_4_NO_DECLARE(elt, list, tail, len) \
|
428
|
1917 Lisp_Object tortoise_##elt; \
|
442
|
1918 PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail, \
|
428
|
1919 tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
1920
|
|
1921 #define EXTERNAL_LIST_LOOP_4(elt, list, tail, len) \
|
442
|
1922 Lisp_Object elt, tail, tortoise_##elt; \
|
|
1923 EMACS_INT len; \
|
|
1924 PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail, \
|
428
|
1925 tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
1926
|
|
1927
|
444
|
1928 #define PRIVATE_EXTERNAL_LIST_LOOP_6(elt, list, len, hare, \
|
|
1929 tortoise, suspicion_length) \
|
|
1930 for (tortoise = hare = list, len = 0; \
|
|
1931 \
|
|
1932 (CONSP (hare) ? ((elt = XCAR (hare)), 1) : \
|
|
1933 (NILP (hare) ? 0 : \
|
|
1934 (signal_malformed_list_error (list), 0))); \
|
|
1935 \
|
|
1936 hare = XCDR (hare), \
|
|
1937 (void) \
|
|
1938 ((++len > suspicion_length) \
|
|
1939 && \
|
|
1940 ((((len & 1) != 0) && (tortoise = XCDR (tortoise), 0)), \
|
|
1941 (EQ (hare, tortoise) && (signal_circular_list_error (list), 0)))))
|
428
|
1942
|
442
|
1943 /* GET_LIST_LENGTH and GET_EXTERNAL_LIST_LENGTH:
|
|
1944
|
|
1945 These two macros return the length of LIST (either an internal or external
|
|
1946 list, according to which macro is used), stored into LEN (which must
|
|
1947 be declared by the caller). Circularities are trapped in external lists
|
|
1948 (and cause errors). Neither macro need be declared inside brackets. */
|
|
1949
|
|
1950 #define GET_LIST_LENGTH(list, len) do { \
|
|
1951 Lisp_Object GLL_tail; \
|
|
1952 for (GLL_tail = list, len = 0; \
|
|
1953 !NILP (GLL_tail); \
|
|
1954 GLL_tail = XCDR (GLL_tail), ++len) \
|
|
1955 DO_NOTHING; \
|
|
1956 } while (0)
|
|
1957
|
|
1958 #define GET_EXTERNAL_LIST_LENGTH(list, len) \
|
|
1959 do { \
|
|
1960 Lisp_Object GELL_elt, GELL_tail; \
|
|
1961 EXTERNAL_LIST_LOOP_4_NO_DECLARE (GELL_elt, list, GELL_tail, len) \
|
|
1962 ; \
|
|
1963 } while (0)
|
|
1964
|
|
1965 /* For a list that's known to be in valid list format, where we may
|
|
1966 be deleting the current element out of the list --
|
|
1967 will abort() if the list is not in valid format */
|
|
1968 #define LIST_LOOP_DELETING(consvar, nextconsvar, list) \
|
|
1969 for (consvar = list; \
|
|
1970 !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) :0; \
|
|
1971 consvar = nextconsvar)
|
|
1972
|
|
1973 /* LIST_LOOP_DELETE_IF and EXTERNAL_LIST_LOOP_DELETE_IF:
|
|
1974
|
|
1975 These two macros delete all elements of LIST (either an internal or
|
|
1976 external list, according to which macro is used) satisfying
|
|
1977 CONDITION, a C expression referring to variable ELT. ELT is
|
|
1978 automatically declared. Circularities are trapped in external
|
|
1979 lists (and cause errors). Neither macro need be declared inside
|
|
1980 brackets. */
|
|
1981
|
|
1982 #define LIST_LOOP_DELETE_IF(elt, list, condition) do { \
|
|
1983 /* Do not use ##list when creating new variables because \
|
|
1984 that may not be just a variable name. */ \
|
|
1985 Lisp_Object prev_tail_##elt = Qnil; \
|
|
1986 LIST_LOOP_3 (elt, list, tail_##elt) \
|
|
1987 { \
|
|
1988 if (condition) \
|
|
1989 { \
|
|
1990 if (NILP (prev_tail_##elt)) \
|
|
1991 list = XCDR (tail_##elt); \
|
|
1992 else \
|
|
1993 XCDR (prev_tail_##elt) = XCDR (tail_##elt); \
|
|
1994 } \
|
|
1995 else \
|
|
1996 prev_tail_##elt = tail_##elt; \
|
|
1997 } \
|
|
1998 } while (0)
|
|
1999
|
|
2000 #define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do { \
|
|
2001 Lisp_Object prev_tail_##elt = Qnil; \
|
|
2002 EXTERNAL_LIST_LOOP_4 (elt, list, tail_##elt, len_##elt) \
|
|
2003 { \
|
|
2004 if (condition) \
|
|
2005 { \
|
|
2006 if (NILP (prev_tail_##elt)) \
|
|
2007 list = XCDR (tail_##elt); \
|
|
2008 else \
|
|
2009 XCDR (prev_tail_##elt) = XCDR (tail_##elt); \
|
|
2010 /* Keep tortoise from ever passing hare. */ \
|
|
2011 len_##elt = 0; \
|
|
2012 } \
|
|
2013 else \
|
|
2014 prev_tail_##elt = tail_##elt; \
|
|
2015 } \
|
|
2016 } while (0)
|
|
2017
|
|
2018
|
1204
|
2019 /* Macros for looping over internal alists.
|
|
2020
|
|
2021 *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
|
|
2022
|
|
2023 ALIST_LOOP_3 loops over an alist, at each iteration setting CAR and CDR
|
|
2024 to the car and cdr of the acons. CAR and CDR are automatically
|
|
2025 declared.
|
|
2026
|
|
2027 ALIST_LOOP_4 is similar to ALIST_LOOP_3 but contains an additional
|
|
2028 variable ACONS at the beginning for access to the acons itself.All of
|
|
2029 the variables ACONS, CAR and CDR are automatically declared.
|
|
2030 */
|
|
2031
|
|
2032 #define ALIST_LOOP_3(car, cdr, alist) \
|
|
2033 Lisp_Object _al3_acons_##car, car, cdr, _al3_tail_##car; \
|
|
2034 for (_al3_tail_##car = alist; \
|
|
2035 NILP (_al3_tail_##car) ? \
|
|
2036 0 : (_al3_acons_##car = XCAR (_al3_tail_##car), \
|
|
2037 car = XCAR (_al3_acons_##car), \
|
|
2038 cdr = XCDR (_al3_acons_##car), 1); \
|
|
2039 _al3_tail_##car = XCDR (_al3_tail_##car))
|
|
2040
|
|
2041 #define ALIST_LOOP_4(acons, car, cdr, list) \
|
|
2042 Lisp_Object acons, car, cdr, _al4_tail_##car; \
|
|
2043 for (_al4_tail_##car = list; \
|
|
2044 NILP (_al4_tail_##car) ? \
|
|
2045 0 : (elt = XCAR (_al4_tail_##car), car = XCAR (elt), \
|
|
2046 cdr = XCDR (elt), 1); \
|
|
2047 _al4_tail_##car = XCDR (tail))
|
|
2048
|
442
|
2049 /* Macros for looping over external alists.
|
|
2050
|
|
2051 *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
|
|
2052
|
|
2053 EXTERNAL_ALIST_LOOP_4 is similar to EXTERNAL_LIST_LOOP_2, but it
|
|
2054 assumes the elements are aconses (the elements in an alist) and
|
|
2055 sets two additional argument variables ELT_CAR and ELT_CDR to the
|
|
2056 car and cdr of the acons. All of the variables ELT, ELT_CAR and
|
|
2057 ELT_CDR are automatically declared.
|
|
2058
|
|
2059 EXTERNAL_ALIST_LOOP_5 adds a TAIL argument to EXTERNAL_ALIST_LOOP_4,
|
|
2060 just like EXTERNAL_LIST_LOOP_3 does, and again TAIL is automatically
|
|
2061 declared.
|
|
2062
|
|
2063 EXTERNAL_ALIST_LOOP_6 adds a LEN argument to EXTERNAL_ALIST_LOOP_5,
|
|
2064 just like EXTERNAL_LIST_LOOP_4 does, and again LEN is automatically
|
|
2065 declared.
|
|
2066
|
|
2067 EXTERNAL_ALIST_LOOP_6_NO_DECLARE does not declare any of its arguments,
|
|
2068 just like EXTERNAL_LIST_LOOP_4_NO_DECLARE, and so these must be declared
|
|
2069 manually.
|
|
2070 */
|
428
|
2071
|
|
2072 /* Optimized and safe macros for looping over external alists. */
|
|
2073 #define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list) \
|
442
|
2074 Lisp_Object elt, elt_car, elt_cdr; \
|
428
|
2075 Lisp_Object hare_##elt, tortoise_##elt; \
|
|
2076 EMACS_INT len_##elt; \
|
442
|
2077 PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \
|
428
|
2078 len_##elt, hare_##elt, tortoise_##elt, \
|
|
2079 CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2080
|
|
2081 #define EXTERNAL_ALIST_LOOP_5(elt, elt_car, elt_cdr, list, tail) \
|
442
|
2082 Lisp_Object elt, elt_car, elt_cdr, tail; \
|
428
|
2083 Lisp_Object tortoise_##elt; \
|
|
2084 EMACS_INT len_##elt; \
|
442
|
2085 PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \
|
428
|
2086 len_##elt, tail, tortoise_##elt, \
|
|
2087 CIRCULAR_LIST_SUSPICION_LENGTH) \
|
|
2088
|
|
2089 #define EXTERNAL_ALIST_LOOP_6(elt, elt_car, elt_cdr, list, tail, len) \
|
442
|
2090 Lisp_Object elt, elt_car, elt_cdr, tail; \
|
|
2091 EMACS_INT len; \
|
428
|
2092 Lisp_Object tortoise_##elt; \
|
442
|
2093 PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \
|
428
|
2094 len, tail, tortoise_##elt, \
|
|
2095 CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2096
|
442
|
2097 #define EXTERNAL_ALIST_LOOP_6_NO_DECLARE(elt, elt_car, elt_cdr, list, \
|
|
2098 tail, len) \
|
|
2099 Lisp_Object tortoise_##elt; \
|
|
2100 PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list, \
|
|
2101 len, tail, tortoise_##elt, \
|
|
2102 CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2103
|
|
2104
|
|
2105 #define PRIVATE_EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, \
|
|
2106 hare, tortoise, suspicion_length) \
|
|
2107 PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, hare, tortoise, \
|
|
2108 suspicion_length) \
|
428
|
2109 if (CONSP (elt) ? (elt_car = XCAR (elt), elt_cdr = XCDR (elt), 0) :1) \
|
|
2110 continue; \
|
|
2111 else
|
|
2112
|
442
|
2113 /* Macros for looping over external property lists.
|
|
2114
|
|
2115 *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
|
|
2116
|
|
2117 EXTERNAL_PROPERTY_LIST_LOOP_3 maps over an external list assumed to
|
|
2118 be a property list, consisting of alternating pairs of keys
|
|
2119 (typically symbols or keywords) and values. Each iteration
|
|
2120 processes one such pair out of LIST, assigning the two elements to
|
|
2121 KEY and VALUE respectively. Malformed lists and circularities are
|
|
2122 trapped as usual, and in addition, property lists with an odd number
|
|
2123 of elements also signal an error.
|
|
2124
|
|
2125 EXTERNAL_PROPERTY_LIST_LOOP_4 adds a TAIL argument to
|
|
2126 EXTERNAL_PROPERTY_LIST_LOOP_3, just like EXTERNAL_LIST_LOOP_3 does,
|
|
2127 and again TAIL is automatically declared.
|
|
2128
|
|
2129 EXTERNAL_PROPERTY_LIST_LOOP_5 adds a LEN argument to
|
|
2130 EXTERNAL_PROPERTY_LIST_LOOP_4, just like EXTERNAL_LIST_LOOP_4 does,
|
|
2131 and again LEN is automatically declared. Note that in this case,
|
|
2132 LEN counts the iterations, NOT the total number of list elements
|
|
2133 processed, which is 2 * LEN.
|
|
2134
|
|
2135 EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE does not declare any of its
|
|
2136 arguments, just like EXTERNAL_LIST_LOOP_4_NO_DECLARE, and so these
|
|
2137 must be declared manually. */
|
428
|
2138
|
|
2139 /* Optimized and safe macros for looping over external property lists. */
|
|
2140 #define EXTERNAL_PROPERTY_LIST_LOOP_3(key, value, list) \
|
|
2141 Lisp_Object key, value, hare_##key, tortoise_##key; \
|
442
|
2142 EMACS_INT len_##key; \
|
428
|
2143 EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len_##key, hare_##key, \
|
|
2144 tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2145
|
|
2146 #define EXTERNAL_PROPERTY_LIST_LOOP_4(key, value, list, tail) \
|
|
2147 Lisp_Object key, value, tail, tortoise_##key; \
|
442
|
2148 EMACS_INT len_##key; \
|
428
|
2149 EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len_##key, tail, \
|
|
2150 tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2151
|
|
2152 #define EXTERNAL_PROPERTY_LIST_LOOP_5(key, value, list, tail, len) \
|
|
2153 Lisp_Object key, value, tail, tortoise_##key; \
|
|
2154 EMACS_INT len; \
|
|
2155 EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail, \
|
|
2156 tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2157
|
442
|
2158 #define EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE(key, value, list, \
|
|
2159 tail, len) \
|
|
2160 Lisp_Object tortoise_##key; \
|
|
2161 EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail, \
|
|
2162 tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2163
|
428
|
2164
|
|
2165 #define EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, hare, \
|
|
2166 tortoise, suspicion_length) \
|
|
2167 for (tortoise = hare = list, len = 0; \
|
|
2168 \
|
|
2169 ((CONSP (hare) && \
|
|
2170 (key = XCAR (hare), \
|
|
2171 hare = XCDR (hare), \
|
442
|
2172 (CONSP (hare) ? 1 : \
|
|
2173 (signal_malformed_property_list_error (list), 0)))) ? \
|
428
|
2174 (value = XCAR (hare), 1) : \
|
|
2175 (NILP (hare) ? 0 : \
|
|
2176 (signal_malformed_property_list_error (list), 0))); \
|
|
2177 \
|
|
2178 hare = XCDR (hare), \
|
|
2179 ((++len < suspicion_length) ? \
|
|
2180 ((void) 0) : \
|
|
2181 (((len & 1) ? \
|
|
2182 ((void) (tortoise = XCDR (XCDR (tortoise)))) : \
|
|
2183 ((void) 0)) \
|
|
2184 , \
|
|
2185 (EQ (hare, tortoise) ? \
|
|
2186 ((void) signal_circular_property_list_error (list)) : \
|
|
2187 ((void) 0)))))
|
|
2188
|
|
2189 /* For a property list (alternating keywords/values) that may not be
|
|
2190 in valid list format -- will signal an error if the list is not in
|
|
2191 valid format. CONSVAR is used to keep track of the iterations
|
|
2192 without modifying PLIST.
|
|
2193
|
|
2194 We have to be tricky to still keep the same C format.*/
|
|
2195 #define EXTERNAL_PROPERTY_LIST_LOOP(tail, key, value, plist) \
|
|
2196 for (tail = plist; \
|
|
2197 (CONSP (tail) && CONSP (XCDR (tail)) ? \
|
|
2198 (key = XCAR (tail), value = XCAR (XCDR (tail))) : \
|
|
2199 (key = Qunbound, value = Qunbound)), \
|
|
2200 !NILP (tail); \
|
|
2201 tail = XCDR (XCDR (tail))) \
|
|
2202 if (UNBOUNDP (key)) \
|
|
2203 Fsignal (Qmalformed_property_list, list1 (plist)); \
|
|
2204 else
|
|
2205
|
|
2206 #define PROPERTY_LIST_LOOP(tail, key, value, plist) \
|
|
2207 for (tail = plist; \
|
|
2208 NILP (tail) ? 0 : \
|
|
2209 (key = XCAR (tail), tail = XCDR (tail), \
|
|
2210 value = XCAR (tail), tail = XCDR (tail), 1); \
|
|
2211 )
|
|
2212
|
|
2213 /* Return 1 if LIST is properly acyclic and nil-terminated, else 0. */
|
826
|
2214 DECLARE_INLINE_HEADER (
|
|
2215 int
|
428
|
2216 TRUE_LIST_P (Lisp_Object object)
|
826
|
2217 )
|
428
|
2218 {
|
|
2219 Lisp_Object hare, tortoise;
|
|
2220 EMACS_INT len;
|
|
2221
|
|
2222 for (hare = tortoise = object, len = 0;
|
|
2223 CONSP (hare);
|
|
2224 hare = XCDR (hare), len++)
|
|
2225 {
|
|
2226 if (len < CIRCULAR_LIST_SUSPICION_LENGTH)
|
|
2227 continue;
|
|
2228
|
|
2229 if (len & 1)
|
|
2230 tortoise = XCDR (tortoise);
|
|
2231 else if (EQ (hare, tortoise))
|
|
2232 return 0;
|
|
2233 }
|
|
2234
|
|
2235 return NILP (hare);
|
|
2236 }
|
|
2237
|
|
2238 /* Signal an error if LIST is not properly acyclic and nil-terminated. */
|
|
2239 #define CHECK_TRUE_LIST(list) do { \
|
|
2240 Lisp_Object CTL_list = (list); \
|
|
2241 Lisp_Object CTL_hare, CTL_tortoise; \
|
436
|
2242 EMACS_INT CTL_len; \
|
428
|
2243 \
|
|
2244 for (CTL_hare = CTL_tortoise = CTL_list, CTL_len = 0; \
|
|
2245 CONSP (CTL_hare); \
|
|
2246 CTL_hare = XCDR (CTL_hare), CTL_len++) \
|
|
2247 { \
|
|
2248 if (CTL_len < CIRCULAR_LIST_SUSPICION_LENGTH) \
|
|
2249 continue; \
|
|
2250 \
|
|
2251 if (CTL_len & 1) \
|
|
2252 CTL_tortoise = XCDR (CTL_tortoise); \
|
|
2253 else if (EQ (CTL_hare, CTL_tortoise)) \
|
|
2254 Fsignal (Qcircular_list, list1 (CTL_list)); \
|
|
2255 } \
|
|
2256 \
|
|
2257 if (! NILP (CTL_hare)) \
|
|
2258 signal_malformed_list_error (CTL_list); \
|
|
2259 } while (0)
|
|
2260
|
442
|
2261 /*------------------------------ string --------------------------------*/
|
428
|
2262
|
|
2263 struct Lisp_String
|
|
2264 {
|
771
|
2265 union
|
|
2266 {
|
|
2267 struct lrecord_header lheader;
|
|
2268 struct
|
|
2269 {
|
|
2270 /* WARNING: Everything before ascii_begin must agree exactly with
|
|
2271 struct lrecord_header */
|
|
2272 unsigned int type :8;
|
|
2273 unsigned int mark :1;
|
|
2274 unsigned int c_readonly :1;
|
|
2275 unsigned int lisp_readonly :1;
|
|
2276 /* Number of chars at beginning of string that are one byte in length
|
826
|
2277 (byte_ascii_p) */
|
771
|
2278 unsigned int ascii_begin :21;
|
|
2279 } v;
|
|
2280 } u;
|
793
|
2281 Bytecount size_;
|
867
|
2282 Ibyte *data_;
|
428
|
2283 Lisp_Object plist;
|
|
2284 };
|
|
2285 typedef struct Lisp_String Lisp_String;
|
|
2286
|
851
|
2287 #define MAX_STRING_ASCII_BEGIN ((1 << 21) - 1)
|
771
|
2288
|
1632
|
2289 DECLARE_MODULE_API_LRECORD (string, Lisp_String);
|
428
|
2290 #define XSTRING(x) XRECORD (x, string, Lisp_String)
|
617
|
2291 #define wrap_string(p) wrap_record (p, string)
|
428
|
2292 #define STRINGP(x) RECORDP (x, string)
|
|
2293 #define CHECK_STRING(x) CHECK_RECORD (x, string)
|
|
2294 #define CONCHECK_STRING(x) CONCHECK_RECORD (x, string)
|
|
2295
|
826
|
2296 /* Most basic macros for strings -- basically just accessing or setting
|
|
2297 fields -- are here. Everything else is in text.h, since they depend on
|
|
2298 stuff there. */
|
428
|
2299
|
793
|
2300 /* Operations on Lisp_String *'s; only ones left */
|
826
|
2301 #define set_lispstringp_length(s, len) ((void) ((s)->size_ = (len)))
|
|
2302 #define set_lispstringp_data(s, ptr) ((void) ((s)->data_ = (ptr)))
|
|
2303
|
|
2304 /* Operations on strings as Lisp_Objects. Don't manipulate Lisp_String *'s
|
|
2305 in any new code. */
|
793
|
2306 #define XSTRING_LENGTH(s) (XSTRING (s)->size_)
|
|
2307 #define XSTRING_PLIST(s) (XSTRING (s)->plist)
|
|
2308 #define XSTRING_DATA(s) (XSTRING (s)->data_ + 0)
|
|
2309 #define XSTRING_ASCII_BEGIN(s) (XSTRING (s)->u.v.ascii_begin + 0)
|
826
|
2310 #define XSET_STRING_LENGTH(s, ptr) set_lispstringp_length (XSTRING (s), ptr)
|
|
2311 #define XSET_STRING_DATA(s, ptr) set_lispstringp_data (XSTRING (s), ptr)
|
771
|
2312 /* WARNING: If you modify an existing string, you must call
|
|
2313 bump_string_modiff() afterwards. */
|
793
|
2314 #define XSET_STRING_ASCII_BEGIN(s, val) \
|
|
2315 ((void) (XSTRING (s)->u.v.ascii_begin = (val)))
|
826
|
2316 #define XSTRING_FORMAT(s) FORMAT_DEFAULT
|
428
|
2317
|
456
|
2318 /* Return the true aligned size of a struct whose last member is a
|
|
2319 variable-length array field. (this is known as the "struct hack") */
|
|
2320 /* Implementation: in practice, structtype and fieldtype usually have
|
|
2321 the same alignment, but we can't be sure. We need to use
|
|
2322 ALIGN_SIZE to be absolutely sure of getting the correct alignment.
|
|
2323 To help the compiler's optimizer, we use a ternary expression that
|
|
2324 only a very stupid compiler would fail to correctly simplify. */
|
|
2325 #define FLEXIBLE_ARRAY_STRUCT_SIZEOF(structtype, \
|
|
2326 fieldtype, \
|
|
2327 fieldname, \
|
|
2328 array_length) \
|
|
2329 (ALIGNOF (structtype) == ALIGNOF (fieldtype) \
|
|
2330 ? (offsetof (structtype, fieldname) + \
|
|
2331 (offsetof (structtype, fieldname[1]) - \
|
|
2332 offsetof (structtype, fieldname[0])) * \
|
|
2333 (array_length)) \
|
826
|
2334 : (ALIGN_FOR_TYPE \
|
456
|
2335 ((offsetof (structtype, fieldname) + \
|
|
2336 (offsetof (structtype, fieldname[1]) - \
|
|
2337 offsetof (structtype, fieldname[0])) * \
|
|
2338 (array_length)), \
|
826
|
2339 structtype)))
|
442
|
2340
|
|
2341 /*------------------------------ vector --------------------------------*/
|
428
|
2342
|
|
2343 struct Lisp_Vector
|
|
2344 {
|
|
2345 struct lcrecord_header header;
|
|
2346 long size;
|
|
2347 Lisp_Object contents[1];
|
|
2348 };
|
|
2349 typedef struct Lisp_Vector Lisp_Vector;
|
|
2350
|
|
2351 DECLARE_LRECORD (vector, Lisp_Vector);
|
|
2352 #define XVECTOR(x) XRECORD (x, vector, Lisp_Vector)
|
617
|
2353 #define wrap_vector(p) wrap_record (p, vector)
|
428
|
2354 #define VECTORP(x) RECORDP (x, vector)
|
|
2355 #define CHECK_VECTOR(x) CHECK_RECORD (x, vector)
|
|
2356 #define CONCHECK_VECTOR(x) CONCHECK_RECORD (x, vector)
|
|
2357
|
|
2358 #define vector_length(v) ((v)->size)
|
|
2359 #define XVECTOR_LENGTH(s) vector_length (XVECTOR (s))
|
|
2360 #define vector_data(v) ((v)->contents)
|
|
2361 #define XVECTOR_DATA(s) vector_data (XVECTOR (s))
|
|
2362
|
442
|
2363 /*---------------------------- bit vectors -----------------------------*/
|
428
|
2364
|
|
2365 #if (LONGBITS < 16)
|
|
2366 #error What the hell?!
|
|
2367 #elif (LONGBITS < 32)
|
|
2368 # define LONGBITS_LOG2 4
|
|
2369 # define LONGBITS_POWER_OF_2 16
|
|
2370 #elif (LONGBITS < 64)
|
|
2371 # define LONGBITS_LOG2 5
|
|
2372 # define LONGBITS_POWER_OF_2 32
|
|
2373 #elif (LONGBITS < 128)
|
|
2374 # define LONGBITS_LOG2 6
|
|
2375 # define LONGBITS_POWER_OF_2 64
|
|
2376 #else
|
|
2377 #error You really have 128-bit integers?!
|
|
2378 #endif
|
|
2379
|
|
2380 struct Lisp_Bit_Vector
|
|
2381 {
|
1204
|
2382 struct lcrecord_header lheader;
|
665
|
2383 Elemcount size;
|
428
|
2384 unsigned long bits[1];
|
|
2385 };
|
|
2386 typedef struct Lisp_Bit_Vector Lisp_Bit_Vector;
|
|
2387
|
|
2388 DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector);
|
|
2389 #define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector)
|
617
|
2390 #define wrap_bit_vector(p) wrap_record (p, bit_vector)
|
428
|
2391 #define BIT_VECTORP(x) RECORDP (x, bit_vector)
|
|
2392 #define CHECK_BIT_VECTOR(x) CHECK_RECORD (x, bit_vector)
|
|
2393 #define CONCHECK_BIT_VECTOR(x) CONCHECK_RECORD (x, bit_vector)
|
|
2394
|
|
2395 #define BITP(x) (INTP (x) && (XINT (x) == 0 || XINT (x) == 1))
|
|
2396
|
|
2397 #define CHECK_BIT(x) do { \
|
|
2398 if (!BITP (x)) \
|
|
2399 dead_wrong_type_argument (Qbitp, x);\
|
|
2400 } while (0)
|
|
2401
|
|
2402 #define CONCHECK_BIT(x) do { \
|
|
2403 if (!BITP (x)) \
|
|
2404 x = wrong_type_argument (Qbitp, x); \
|
|
2405 } while (0)
|
|
2406
|
|
2407 #define bit_vector_length(v) ((v)->size)
|
|
2408
|
826
|
2409 DECLARE_INLINE_HEADER (
|
|
2410 int
|
665
|
2411 bit_vector_bit (Lisp_Bit_Vector *v, Elemcount n)
|
826
|
2412 )
|
428
|
2413 {
|
|
2414 return ((v->bits[n >> LONGBITS_LOG2] >> (n & (LONGBITS_POWER_OF_2 - 1)))
|
|
2415 & 1);
|
|
2416 }
|
|
2417
|
826
|
2418 DECLARE_INLINE_HEADER (
|
|
2419 void
|
665
|
2420 set_bit_vector_bit (Lisp_Bit_Vector *v, Elemcount n, int value)
|
826
|
2421 )
|
428
|
2422 {
|
|
2423 if (value)
|
|
2424 v->bits[n >> LONGBITS_LOG2] |= (1UL << (n & (LONGBITS_POWER_OF_2 - 1)));
|
|
2425 else
|
|
2426 v->bits[n >> LONGBITS_LOG2] &= ~(1UL << (n & (LONGBITS_POWER_OF_2 - 1)));
|
|
2427 }
|
|
2428
|
|
2429 /* Number of longs required to hold LEN bits */
|
|
2430 #define BIT_VECTOR_LONG_STORAGE(len) \
|
|
2431 (((len) + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2)
|
|
2432
|
853
|
2433
|
442
|
2434 /*------------------------------ symbol --------------------------------*/
|
428
|
2435
|
440
|
2436 typedef struct Lisp_Symbol Lisp_Symbol;
|
428
|
2437 struct Lisp_Symbol
|
|
2438 {
|
|
2439 struct lrecord_header lheader;
|
|
2440 /* next symbol in this obarray bucket */
|
440
|
2441 Lisp_Symbol *next;
|
793
|
2442 Lisp_Object name;
|
428
|
2443 Lisp_Object value;
|
|
2444 Lisp_Object function;
|
|
2445 Lisp_Object plist;
|
|
2446 };
|
|
2447
|
|
2448 #define SYMBOL_IS_KEYWORD(sym) \
|
826
|
2449 ((string_byte (symbol_name (XSYMBOL (sym)), 0) == ':') \
|
428
|
2450 && EQ (sym, oblookup (Vobarray, \
|
793
|
2451 XSTRING_DATA (symbol_name (XSYMBOL (sym))), \
|
|
2452 XSTRING_LENGTH (symbol_name (XSYMBOL (sym))))))
|
428
|
2453 #define KEYWORDP(obj) (SYMBOLP (obj) && SYMBOL_IS_KEYWORD (obj))
|
|
2454
|
1632
|
2455 DECLARE_MODULE_API_LRECORD (symbol, Lisp_Symbol);
|
428
|
2456 #define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol)
|
617
|
2457 #define wrap_symbol(p) wrap_record (p, symbol)
|
428
|
2458 #define SYMBOLP(x) RECORDP (x, symbol)
|
|
2459 #define CHECK_SYMBOL(x) CHECK_RECORD (x, symbol)
|
|
2460 #define CONCHECK_SYMBOL(x) CONCHECK_RECORD (x, symbol)
|
|
2461
|
|
2462 #define symbol_next(s) ((s)->next)
|
|
2463 #define symbol_name(s) ((s)->name)
|
|
2464 #define symbol_value(s) ((s)->value)
|
|
2465 #define symbol_function(s) ((s)->function)
|
|
2466 #define symbol_plist(s) ((s)->plist)
|
|
2467
|
793
|
2468 #define XSYMBOL_NEXT(s) (XSYMBOL (s)->next)
|
|
2469 #define XSYMBOL_NAME(s) (XSYMBOL (s)->name)
|
|
2470 #define XSYMBOL_VALUE(s) (XSYMBOL (s)->value)
|
|
2471 #define XSYMBOL_FUNCTION(s) (XSYMBOL (s)->function)
|
|
2472 #define XSYMBOL_PLIST(s) (XSYMBOL (s)->plist)
|
|
2473
|
|
2474
|
442
|
2475 /*------------------------------- subr ---------------------------------*/
|
428
|
2476
|
853
|
2477 /* A function that takes no arguments and returns a Lisp_Object.
|
|
2478 We could define such types for n arguments, if needed. */
|
428
|
2479 typedef Lisp_Object (*lisp_fn_t) (void);
|
|
2480
|
|
2481 struct Lisp_Subr
|
|
2482 {
|
|
2483 struct lrecord_header lheader;
|
442
|
2484 short min_args;
|
|
2485 short max_args;
|
|
2486 const char *prompt;
|
|
2487 const char *doc;
|
|
2488 const char *name;
|
428
|
2489 lisp_fn_t subr_fn;
|
|
2490 };
|
|
2491 typedef struct Lisp_Subr Lisp_Subr;
|
|
2492
|
|
2493 DECLARE_LRECORD (subr, Lisp_Subr);
|
|
2494 #define XSUBR(x) XRECORD (x, subr, Lisp_Subr)
|
617
|
2495 #define wrap_subr(p) wrap_record (p, subr)
|
428
|
2496 #define SUBRP(x) RECORDP (x, subr)
|
|
2497 #define CHECK_SUBR(x) CHECK_RECORD (x, subr)
|
|
2498 #define CONCHECK_SUBR(x) CONCHECK_RECORD (x, subr)
|
|
2499
|
436
|
2500 #define subr_function(subr) ((subr)->subr_fn)
|
|
2501 #define SUBR_FUNCTION(subr,max_args) \
|
|
2502 ((Lisp_Object (*) (EXFUN_##max_args)) (subr)->subr_fn)
|
|
2503 #define subr_name(subr) ((subr)->name)
|
428
|
2504
|
442
|
2505 /*------------------------------ marker --------------------------------*/
|
|
2506
|
428
|
2507
|
440
|
2508 typedef struct Lisp_Marker Lisp_Marker;
|
428
|
2509 struct Lisp_Marker
|
|
2510 {
|
|
2511 struct lrecord_header lheader;
|
440
|
2512 Lisp_Marker *next;
|
|
2513 Lisp_Marker *prev;
|
428
|
2514 struct buffer *buffer;
|
665
|
2515 Membpos membpos;
|
428
|
2516 char insertion_type;
|
|
2517 };
|
|
2518
|
1632
|
2519 DECLARE_MODULE_API_LRECORD (marker, Lisp_Marker);
|
428
|
2520 #define XMARKER(x) XRECORD (x, marker, Lisp_Marker)
|
617
|
2521 #define wrap_marker(p) wrap_record (p, marker)
|
428
|
2522 #define MARKERP(x) RECORDP (x, marker)
|
|
2523 #define CHECK_MARKER(x) CHECK_RECORD (x, marker)
|
|
2524 #define CONCHECK_MARKER(x) CONCHECK_RECORD (x, marker)
|
|
2525
|
|
2526 /* The second check was looking for GCed markers still in use */
|
|
2527 /* if (INTP (XMARKER (x)->lheader.next.v)) abort (); */
|
|
2528
|
|
2529 #define marker_next(m) ((m)->next)
|
|
2530 #define marker_prev(m) ((m)->prev)
|
|
2531
|
442
|
2532 /*------------------------------- char ---------------------------------*/
|
428
|
2533
|
|
2534 #define CHARP(x) (XTYPE (x) == Lisp_Type_Char)
|
|
2535
|
800
|
2536 #ifdef ERROR_CHECK_TYPES
|
428
|
2537
|
826
|
2538 DECLARE_INLINE_HEADER (
|
867
|
2539 Ichar
|
788
|
2540 XCHAR_1 (Lisp_Object obj, const char *file, int line)
|
826
|
2541 )
|
428
|
2542 {
|
788
|
2543 assert_at_line (CHARP (obj), file, line);
|
428
|
2544 return XCHARVAL (obj);
|
|
2545 }
|
|
2546
|
788
|
2547 #define XCHAR(x) XCHAR_1 (x, __FILE__, __LINE__)
|
|
2548
|
|
2549 #else /* no error checking */
|
|
2550
|
867
|
2551 #define XCHAR(x) ((Ichar) XCHARVAL (x))
|
788
|
2552
|
|
2553 #endif /* no error checking */
|
428
|
2554
|
|
2555 #define CHECK_CHAR(x) CHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp)
|
|
2556 #define CONCHECK_CHAR(x) CONCHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp)
|
|
2557
|
|
2558
|
442
|
2559 /*------------------------------ float ---------------------------------*/
|
428
|
2560
|
|
2561 /* Note: the 'unused_next_' field exists only to ensure that the
|
|
2562 `next' pointer fits within the structure, for the purposes of the
|
|
2563 free list. This makes a difference in the unlikely case of
|
|
2564 sizeof(double) being smaller than sizeof(void *). */
|
|
2565
|
|
2566 struct Lisp_Float
|
|
2567 {
|
|
2568 struct lrecord_header lheader;
|
|
2569 union { double d; struct Lisp_Float *unused_next_; } data;
|
|
2570 };
|
|
2571 typedef struct Lisp_Float Lisp_Float;
|
|
2572
|
|
2573 DECLARE_LRECORD (float, Lisp_Float);
|
|
2574 #define XFLOAT(x) XRECORD (x, float, Lisp_Float)
|
617
|
2575 #define wrap_float(p) wrap_record (p, float)
|
428
|
2576 #define FLOATP(x) RECORDP (x, float)
|
|
2577 #define CHECK_FLOAT(x) CHECK_RECORD (x, float)
|
|
2578 #define CONCHECK_FLOAT(x) CONCHECK_RECORD (x, float)
|
|
2579
|
|
2580 #define float_data(f) ((f)->data.d)
|
|
2581 #define XFLOAT_DATA(x) float_data (XFLOAT (x))
|
|
2582
|
|
2583 #define XFLOATINT(n) extract_float (n)
|
|
2584
|
|
2585 #define CHECK_INT_OR_FLOAT(x) do { \
|
|
2586 if (!INT_OR_FLOATP (x)) \
|
|
2587 dead_wrong_type_argument (Qnumberp, x); \
|
|
2588 } while (0)
|
|
2589
|
|
2590 #define CONCHECK_INT_OR_FLOAT(x) do { \
|
|
2591 if (!INT_OR_FLOATP (x)) \
|
|
2592 x = wrong_type_argument (Qnumberp, x); \
|
|
2593 } while (0)
|
|
2594
|
|
2595 # define INT_OR_FLOATP(x) (INTP (x) || FLOATP (x))
|
|
2596
|
442
|
2597 /*-------------------------------- int ---------------------------------*/
|
428
|
2598
|
|
2599 #define ZEROP(x) EQ (x, Qzero)
|
|
2600
|
800
|
2601 #ifdef ERROR_CHECK_TYPES
|
428
|
2602
|
788
|
2603 #define XCHAR_OR_INT(x) XCHAR_OR_INT_1 (x, __FILE__, __LINE__)
|
|
2604 #define XINT(x) XINT_1 (x, __FILE__, __LINE__)
|
|
2605
|
826
|
2606 DECLARE_INLINE_HEADER (
|
|
2607 EMACS_INT
|
788
|
2608 XINT_1 (Lisp_Object obj, const char *file, int line)
|
826
|
2609 )
|
428
|
2610 {
|
788
|
2611 assert_at_line (INTP (obj), file, line);
|
428
|
2612 return XREALINT (obj);
|
|
2613 }
|
|
2614
|
826
|
2615 DECLARE_INLINE_HEADER (
|
|
2616 EMACS_INT
|
788
|
2617 XCHAR_OR_INT_1 (Lisp_Object obj, const char *file, int line)
|
826
|
2618 )
|
428
|
2619 {
|
788
|
2620 assert_at_line (INTP (obj) || CHARP (obj), file, line);
|
428
|
2621 return CHARP (obj) ? XCHAR (obj) : XINT (obj);
|
|
2622 }
|
|
2623
|
|
2624 #else /* no error checking */
|
|
2625
|
|
2626 #define XINT(obj) XREALINT (obj)
|
|
2627 #define XCHAR_OR_INT(obj) (CHARP (obj) ? XCHAR (obj) : XINT (obj))
|
|
2628
|
|
2629 #endif /* no error checking */
|
|
2630
|
|
2631 #define CHECK_INT(x) do { \
|
|
2632 if (!INTP (x)) \
|
|
2633 dead_wrong_type_argument (Qintegerp, x); \
|
|
2634 } while (0)
|
|
2635
|
|
2636 #define CONCHECK_INT(x) do { \
|
|
2637 if (!INTP (x)) \
|
|
2638 x = wrong_type_argument (Qintegerp, x); \
|
|
2639 } while (0)
|
|
2640
|
|
2641 #define NATNUMP(x) (INTP (x) && XINT (x) >= 0)
|
|
2642
|
|
2643 #define CHECK_NATNUM(x) do { \
|
|
2644 if (!NATNUMP (x)) \
|
|
2645 dead_wrong_type_argument (Qnatnump, x); \
|
|
2646 } while (0)
|
|
2647
|
|
2648 #define CONCHECK_NATNUM(x) do { \
|
|
2649 if (!NATNUMP (x)) \
|
|
2650 x = wrong_type_argument (Qnatnump, x); \
|
|
2651 } while (0)
|
|
2652
|
|
2653 /* next three always continuable because they coerce their arguments. */
|
|
2654 #define CHECK_INT_COERCE_CHAR(x) do { \
|
|
2655 if (INTP (x)) \
|
|
2656 ; \
|
|
2657 else if (CHARP (x)) \
|
|
2658 x = make_int (XCHAR (x)); \
|
|
2659 else \
|
|
2660 x = wrong_type_argument (Qinteger_or_char_p, x); \
|
|
2661 } while (0)
|
|
2662
|
|
2663 #define CHECK_INT_COERCE_MARKER(x) do { \
|
|
2664 if (INTP (x)) \
|
|
2665 ; \
|
|
2666 else if (MARKERP (x)) \
|
|
2667 x = make_int (marker_position (x)); \
|
|
2668 else \
|
|
2669 x = wrong_type_argument (Qinteger_or_marker_p, x); \
|
|
2670 } while (0)
|
|
2671
|
|
2672 #define CHECK_INT_COERCE_CHAR_OR_MARKER(x) do { \
|
|
2673 if (INTP (x)) \
|
|
2674 ; \
|
|
2675 else if (CHARP (x)) \
|
|
2676 x = make_int (XCHAR (x)); \
|
|
2677 else if (MARKERP (x)) \
|
|
2678 x = make_int (marker_position (x)); \
|
|
2679 else \
|
|
2680 x = wrong_type_argument (Qinteger_char_or_marker_p, x); \
|
|
2681 } while (0)
|
|
2682
|
|
2683
|
442
|
2684 /*--------------------------- readonly objects -------------------------*/
|
440
|
2685
|
428
|
2686 #define CHECK_C_WRITEABLE(obj) \
|
|
2687 do { if (c_readonly (obj)) c_write_error (obj); } while (0)
|
|
2688
|
|
2689 #define CHECK_LISP_WRITEABLE(obj) \
|
|
2690 do { if (lisp_readonly (obj)) lisp_write_error (obj); } while (0)
|
|
2691
|
|
2692 #define C_READONLY(obj) (C_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
|
|
2693 #define LISP_READONLY(obj) (LISP_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
|
|
2694
|
980
|
2695 /*----------------------------- structures ----------------------------*/
|
428
|
2696
|
|
2697 typedef struct structure_keyword_entry structure_keyword_entry;
|
|
2698 struct structure_keyword_entry
|
|
2699 {
|
|
2700 Lisp_Object keyword;
|
|
2701 int (*validate) (Lisp_Object keyword, Lisp_Object value,
|
578
|
2702 Error_Behavior errb);
|
428
|
2703 };
|
|
2704
|
|
2705 typedef struct
|
|
2706 {
|
|
2707 Dynarr_declare (structure_keyword_entry);
|
|
2708 } structure_keyword_entry_dynarr;
|
|
2709
|
|
2710 typedef struct structure_type structure_type;
|
|
2711 struct structure_type
|
|
2712 {
|
|
2713 Lisp_Object type;
|
|
2714 structure_keyword_entry_dynarr *keywords;
|
578
|
2715 int (*validate) (Lisp_Object data, Error_Behavior errb);
|
428
|
2716 Lisp_Object (*instantiate) (Lisp_Object data);
|
|
2717 };
|
|
2718
|
|
2719 typedef struct
|
|
2720 {
|
|
2721 Dynarr_declare (structure_type);
|
|
2722 } structure_type_dynarr;
|
|
2723
|
|
2724 struct structure_type *define_structure_type (Lisp_Object type,
|
|
2725 int (*validate)
|
|
2726 (Lisp_Object data,
|
578
|
2727 Error_Behavior errb),
|
428
|
2728 Lisp_Object (*instantiate)
|
|
2729 (Lisp_Object data));
|
|
2730 void define_structure_type_keyword (struct structure_type *st,
|
|
2731 Lisp_Object keyword,
|
|
2732 int (*validate) (Lisp_Object keyword,
|
|
2733 Lisp_Object value,
|
578
|
2734 Error_Behavior errb));
|
428
|
2735
|
858
|
2736 /*---------------------------- weak boxes ------------------------------*/
|
|
2737
|
|
2738 struct weak_box
|
|
2739 {
|
|
2740 struct lcrecord_header header;
|
|
2741 Lisp_Object value;
|
|
2742
|
|
2743 Lisp_Object next_weak_box; /* don't mark through this! */
|
|
2744 };
|
|
2745
|
|
2746 void prune_weak_boxes (void);
|
|
2747 Lisp_Object make_weak_box (Lisp_Object value);
|
|
2748 Lisp_Object weak_box_ref (Lisp_Object value);
|
|
2749
|
|
2750 DECLARE_LRECORD (weak_box, struct weak_box);
|
|
2751 #define XWEAK_BOX(x) XRECORD (x, weak_box, struct weak_box)
|
|
2752 #define XSET_WEAK_BOX(x, v) (XWEAK_BOX (x)->value = (v))
|
|
2753 #define wrap_weak_box(p) wrap_record (p, weak_box)
|
|
2754 #define WEAK_BOXP(x) RECORDP (x, weak_box)
|
|
2755 #define CHECK_WEAK_BOX(x) CHECK_RECORD (x, weak_box)
|
|
2756 #define CONCHECK_WEAK_BOX(x) CONCHECK_RECORD (x, weak_box)
|
|
2757
|
888
|
2758 /*--------------------------- ephemerons ----------------------------*/
|
|
2759
|
|
2760 struct ephemeron
|
|
2761 {
|
|
2762 struct lcrecord_header header;
|
|
2763
|
|
2764 Lisp_Object key;
|
|
2765
|
|
2766 /* This field holds a pair. The cdr of this cons points to the next
|
|
2767 ephemeron in Vall_ephemerons. The car points to another pair
|
|
2768 whose car is the value and whose cdr is the finalizer.
|
|
2769
|
|
2770 This representation makes it very easy to unlink an ephemeron
|
|
2771 from Vall_ephemerons and chain it into
|
|
2772 Vall_ephemerons_to_finalize. */
|
|
2773
|
|
2774 Lisp_Object cons_chain;
|
|
2775
|
|
2776 Lisp_Object value;
|
|
2777 };
|
|
2778
|
|
2779 void prune_ephemerons (void);
|
|
2780 Lisp_Object ephemeron_value(Lisp_Object ephi);
|
1590
|
2781 void init_marking_ephemerons(void);
|
|
2782 int continue_marking_ephemerons(void);
|
888
|
2783 int finish_marking_ephemerons(void);
|
|
2784 Lisp_Object zap_finalize_list(void);
|
|
2785 Lisp_Object make_ephemeron(Lisp_Object key, Lisp_Object value, Lisp_Object finalizer);
|
|
2786
|
|
2787 DECLARE_LRECORD(ephemeron, struct ephemeron);
|
|
2788 #define XEPHEMERON(x) XRECORD (x, ephemeron, struct ephemeron)
|
|
2789 #define XEPHEMERON_REF(x) (XEPHEMERON (x)->value)
|
|
2790 #define XEPHEMERON_NEXT(x) (XCDR (XEPHEMERON(x)->cons_chain))
|
|
2791 #define XEPHEMERON_FINALIZER(x) (XCDR (XCAR (XEPHEMERON (x)->cons_chain)))
|
|
2792 #define XSET_EPHEMERON_NEXT(x, n) (XSETCDR (XEPHEMERON(x)->cons_chain, n))
|
|
2793 #define XSET_EPHEMERON_VALUE(x, v) (XEPHEMERON(x)->value = (v))
|
|
2794 #define XSET_EPHEMERON_KEY(x, k) (XEPHEMERON(x)->key = (k))
|
|
2795 #define wrap_ephemeron(p) wrap_record (p, ephemeron)
|
|
2796 #define EPHEMERONP(x) RECORDP (x, ephemeron)
|
|
2797 #define CHECK_EPHEMERON(x) CHECK_RECORD (x, ephemeron)
|
|
2798 #define CONCHECK_EPHEMERON(x) CONCHECK_RECORD (x, ephemeron)
|
|
2799
|
858
|
2800
|
442
|
2801 /*---------------------------- weak lists ------------------------------*/
|
428
|
2802
|
|
2803 enum weak_list_type
|
|
2804 {
|
|
2805 /* element disappears if it's unmarked. */
|
|
2806 WEAK_LIST_SIMPLE,
|
|
2807 /* element disappears if it's a cons and either its car or
|
|
2808 cdr is unmarked. */
|
|
2809 WEAK_LIST_ASSOC,
|
|
2810 /* element disappears if it's a cons and its car is unmarked. */
|
|
2811 WEAK_LIST_KEY_ASSOC,
|
|
2812 /* element disappears if it's a cons and its cdr is unmarked. */
|
442
|
2813 WEAK_LIST_VALUE_ASSOC,
|
|
2814 /* element disappears if it's a cons and neither its car nor
|
|
2815 its cdr is marked. */
|
|
2816 WEAK_LIST_FULL_ASSOC
|
428
|
2817 };
|
|
2818
|
|
2819 struct weak_list
|
|
2820 {
|
|
2821 struct lcrecord_header header;
|
|
2822 Lisp_Object list; /* don't mark through this! */
|
|
2823 enum weak_list_type type;
|
|
2824 Lisp_Object next_weak; /* don't mark through this! */
|
|
2825 };
|
|
2826
|
|
2827 DECLARE_LRECORD (weak_list, struct weak_list);
|
|
2828 #define XWEAK_LIST(x) XRECORD (x, weak_list, struct weak_list)
|
617
|
2829 #define wrap_weak_list(p) wrap_record (p, weak_list)
|
428
|
2830 #define WEAK_LISTP(x) RECORDP (x, weak_list)
|
|
2831 #define CHECK_WEAK_LIST(x) CHECK_RECORD (x, weak_list)
|
|
2832 #define CONCHECK_WEAK_LIST(x) CONCHECK_RECORD (x, weak_list)
|
|
2833
|
|
2834 #define weak_list_list(w) ((w)->list)
|
|
2835 #define XWEAK_LIST_LIST(w) (XWEAK_LIST (w)->list)
|
|
2836
|
|
2837 Lisp_Object make_weak_list (enum weak_list_type type);
|
|
2838 /* The following two are only called by the garbage collector */
|
|
2839 int finish_marking_weak_lists (void);
|
|
2840 void prune_weak_lists (void);
|
|
2841
|
1650
|
2842 #ifdef __cplusplus
|
|
2843 }
|
|
2844 #endif
|
428
|
2845
|
|
2846 /************************************************************************/
|
771
|
2847 /* Definitions related to the format of text and of characters */
|
|
2848 /************************************************************************/
|
|
2849
|
|
2850 /* Note:
|
|
2851
|
|
2852 "internally formatted text" and the term "internal format" in
|
|
2853 general are likely to refer to the format of text in buffers and
|
|
2854 strings; "externally formatted text" and the term "external format"
|
|
2855 refer to any text format used in the O.S. or elsewhere outside of
|
|
2856 XEmacs. The format of text and of a character are related and
|
|
2857 there must be a one-to-one relationship (hopefully through a
|
|
2858 relatively simple algorithmic means of conversion) between a string
|
|
2859 of text and an equivalent array of characters, but the conversion
|
|
2860 between the two is NOT necessarily trivial.
|
|
2861
|
|
2862 In a non-Mule XEmacs, allowed characters are numbered 0 through
|
|
2863 255, where no fixed meaning is assigned to them, but (when
|
|
2864 representing text, rather than bytes in a binary file) in practice
|
|
2865 the lower half represents ASCII and the upper half some other 8-bit
|
|
2866 character set (chosen by setting the font, case tables, syntax
|
|
2867 tables, etc. appropriately for the character set through ad-hoc
|
|
2868 means such as the `iso-8859-1' file and the
|
|
2869 `standard-display-european' function).
|
|
2870
|
|
2871 #### Finish this.
|
|
2872
|
|
2873 */
|
|
2874 #include "text.h"
|
|
2875
|
|
2876
|
|
2877 /************************************************************************/
|
428
|
2878 /* Definitions of primitive Lisp functions and variables */
|
|
2879 /************************************************************************/
|
|
2880
|
|
2881
|
|
2882 /* DEFUN - Define a built-in Lisp-visible C function or `subr'.
|
|
2883 `lname' should be the name to give the function in Lisp,
|
|
2884 as a null-terminated C string.
|
|
2885 `Fname' should be the C equivalent of `lname', using only characters
|
|
2886 valid in a C identifier, with an "F" prepended.
|
|
2887 The name of the C constant structure that records information
|
|
2888 on this function for internal use is "S" concatenated with Fname.
|
|
2889 `min_args' should be a number, the minimum number of arguments allowed.
|
|
2890 `max_args' should be a number, the maximum number of arguments allowed,
|
|
2891 or else MANY or UNEVALLED.
|
|
2892 MANY means pass a vector of evaluated arguments,
|
|
2893 in the form of an integer number-of-arguments
|
|
2894 followed by the address of a vector of Lisp_Objects
|
|
2895 which contains the argument values.
|
|
2896 UNEVALLED means pass the list of unevaluated arguments.
|
|
2897 `prompt' says how to read arguments for an interactive call.
|
|
2898 See the doc string for `interactive'.
|
|
2899 A null string means call interactively with no arguments.
|
|
2900 `arglist' are the comma-separated arguments (always Lisp_Objects) for
|
|
2901 the function.
|
|
2902 The docstring for the function is placed as a "C" comment between
|
|
2903 the prompt and the `args' argument. make-docfile reads the
|
|
2904 comment and creates the DOC file from it.
|
|
2905 */
|
|
2906
|
|
2907 #define EXFUN_0 void
|
|
2908 #define EXFUN_1 Lisp_Object
|
|
2909 #define EXFUN_2 Lisp_Object,Lisp_Object
|
|
2910 #define EXFUN_3 Lisp_Object,Lisp_Object,Lisp_Object
|
|
2911 #define EXFUN_4 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object
|
|
2912 #define EXFUN_5 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object
|
|
2913 #define EXFUN_6 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object, \
|
|
2914 Lisp_Object
|
|
2915 #define EXFUN_7 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object, \
|
|
2916 Lisp_Object,Lisp_Object
|
|
2917 #define EXFUN_8 Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object,Lisp_Object, \
|
|
2918 Lisp_Object,Lisp_Object,Lisp_Object
|
|
2919 #define EXFUN_MANY int, Lisp_Object*
|
|
2920 #define EXFUN_UNEVALLED Lisp_Object
|
|
2921 #define EXFUN(sym, max_args) Lisp_Object sym (EXFUN_##max_args)
|
|
2922
|
|
2923 #define SUBR_MAX_ARGS 8
|
|
2924 #define MANY -2
|
|
2925 #define UNEVALLED -1
|
|
2926
|
|
2927 /* Can't be const, because then subr->doc is read-only and
|
|
2928 Snarf_documentation chokes */
|
|
2929
|
|
2930 #define DEFUN(lname, Fname, min_args, max_args, prompt, arglist) \
|
|
2931 Lisp_Object Fname (EXFUN_##max_args); \
|
442
|
2932 static struct Lisp_Subr S##Fname = \
|
|
2933 { \
|
|
2934 { /* struct lrecord_header */ \
|
|
2935 lrecord_type_subr, /* lrecord_type_index */ \
|
|
2936 1, /* mark bit */ \
|
|
2937 1, /* c_readonly bit */ \
|
1111
|
2938 1, /* lisp_readonly bit */ \
|
|
2939 0 /* unused */ \
|
442
|
2940 }, \
|
|
2941 min_args, \
|
|
2942 max_args, \
|
|
2943 prompt, \
|
|
2944 0, /* doc string */ \
|
|
2945 lname, \
|
|
2946 (lisp_fn_t) Fname \
|
|
2947 }; \
|
428
|
2948 Lisp_Object Fname (DEFUN_##max_args arglist)
|
|
2949
|
|
2950 /* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
|
|
2951 prototype that matches max_args, and add the obligatory
|
|
2952 `Lisp_Object' type declaration to the formal C arguments. */
|
|
2953
|
|
2954 #define DEFUN_MANY(named_int, named_Lisp_Object) named_int, named_Lisp_Object
|
|
2955 #define DEFUN_UNEVALLED(args) Lisp_Object args
|
|
2956 #define DEFUN_0() void
|
|
2957 #define DEFUN_1(a) Lisp_Object a
|
|
2958 #define DEFUN_2(a,b) DEFUN_1(a), Lisp_Object b
|
|
2959 #define DEFUN_3(a,b,c) DEFUN_2(a,b), Lisp_Object c
|
|
2960 #define DEFUN_4(a,b,c,d) DEFUN_3(a,b,c), Lisp_Object d
|
|
2961 #define DEFUN_5(a,b,c,d,e) DEFUN_4(a,b,c,d), Lisp_Object e
|
|
2962 #define DEFUN_6(a,b,c,d,e,f) DEFUN_5(a,b,c,d,e), Lisp_Object f
|
|
2963 #define DEFUN_7(a,b,c,d,e,f,g) DEFUN_6(a,b,c,d,e,f), Lisp_Object g
|
|
2964 #define DEFUN_8(a,b,c,d,e,f,g,h) DEFUN_7(a,b,c,d,e,f,g),Lisp_Object h
|
|
2965
|
|
2966 /* WARNING: If you add defines here for higher values of max_args,
|
|
2967 make sure to also fix the clauses in PRIMITIVE_FUNCALL(),
|
|
2968 and change the define of SUBR_MAX_ARGS above. */
|
|
2969
|
|
2970 #include "symeval.h"
|
|
2971
|
1650
|
2972 #ifdef __cplusplus
|
|
2973 extern "C" {
|
|
2974 #endif
|
|
2975
|
428
|
2976 /* `specpdl' is the special binding/unwind-protect stack.
|
|
2977
|
|
2978 Knuth says (see the Jargon File):
|
|
2979 At MIT, `pdl' [abbreviation for `Push Down List'] used to
|
|
2980 be a more common synonym for `stack'.
|
|
2981 Everywhere else `stack' seems to be the preferred term.
|
|
2982
|
|
2983 specpdl_depth is the current depth of `specpdl'.
|
771
|
2984 Save this for use later as arg to `unbind_to_1'. */
|
1632
|
2985 extern MODULE_API int specpdl_depth_counter;
|
428
|
2986 #define specpdl_depth() specpdl_depth_counter
|
|
2987
|
442
|
2988
|
|
2989 #define CHECK_FUNCTION(fun) do { \
|
|
2990 while (NILP (Ffunctionp (fun))) \
|
|
2991 signal_invalid_function_error (fun); \
|
|
2992 } while (0)
|
|
2993
|
428
|
2994
|
|
2995 /************************************************************************/
|
|
2996 /* Checking for QUIT */
|
|
2997 /************************************************************************/
|
|
2998
|
1123
|
2999 /* NOTE NOTE NOTE: Invoking QUIT can cause random Lisp code to be executed!
|
|
3000 This can happen in numerous ways. For example, on many platforms, QUIT
|
|
3001 needs to drain the event queue to see whether there's a C-g in the works.
|
|
3002 A side effect of this is that, if there's a menu-press event, menu filters
|
|
3003 (i.e. Lisp code) will be invoked. Lisp code could also happen if there's
|
|
3004 an asynchronous timeout, or if the debugger is invoked as a result of
|
|
3005 debug-on-quit and the user returns by hitting `r', etc. etc.
|
|
3006
|
|
3007 However, GC CANNOT HAPPEN. It is forbidden everywhere within the QUIT-
|
|
3008 processing code, because most callers cannot tolerate GC during QUIT
|
|
3009 since it's just too prevalent. */
|
|
3010
|
853
|
3011 /* The exact workings of this mechanism are described in detail in signal.c. */
|
|
3012
|
428
|
3013 /* Asynchronous events set something_happened, and then are processed
|
|
3014 within the QUIT macro. At this point, we are guaranteed to not be in
|
|
3015 any sensitive code. */
|
|
3016
|
1632
|
3017 extern MODULE_API volatile int something_happened;
|
|
3018 extern MODULE_API int dont_check_for_quit;
|
|
3019 MODULE_API void check_what_happened (void);
|
|
3020
|
|
3021 extern MODULE_API volatile int quit_check_signal_happened;
|
428
|
3022 extern volatile int quit_check_signal_tick_count;
|
1632
|
3023 MODULE_API void check_quit (void);
|
|
3024
|
|
3025 MODULE_API void signal_quit (void);
|
428
|
3026
|
853
|
3027 int begin_dont_check_for_quit (void);
|
|
3028 int begin_do_check_for_quit (void);
|
|
3029
|
|
3030 /* Nonzero if the values of `quit-flag' and `inhibit-quit' indicate
|
|
3031 that a quit should be signalled. */
|
771
|
3032 #define QUIT_FLAG_SAYS_SHOULD_QUIT \
|
|
3033 (!NILP (Vquit_flag) && \
|
|
3034 (NILP (Vinhibit_quit) \
|
|
3035 || (EQ (Vquit_flag, Qcritical) && !dont_check_for_quit)))
|
|
3036
|
853
|
3037 /* Nonzero if ought to quit now. This is the "efficient" version, which
|
|
3038 respects the flags set to indicate whether the full quit check should
|
|
3039 be done. Therefore it may be inaccurate (i.e. lagging reality), esp.
|
|
3040 when poll for quit is used.
|
|
3041
|
|
3042 This is defined for code that wants to allow quitting, but needs to
|
|
3043 do some cleanup if that happens. (You could always register the cleanup
|
|
3044 code using record_unwind_protect(), but sometimes it makes more sense
|
|
3045 to do it using QUITP.) To use this macro, just call it at the
|
|
3046 appropriate time, and if its value is non-zero, do your cleanup code
|
|
3047 and then call QUIT.
|
|
3048
|
|
3049 A different version (below) is used for the actual QUIT macro. */
|
428
|
3050 #define QUITP \
|
853
|
3051 ((quit_check_signal_happened ? check_quit () : (void) 0), \
|
771
|
3052 QUIT_FLAG_SAYS_SHOULD_QUIT)
|
428
|
3053
|
853
|
3054 /* This is the version actually called by QUIT. The difference
|
|
3055 between it and QUITP is that it also has side effects in that it
|
|
3056 will handle anything else that has recently signalled itself
|
|
3057 asynchronously and wants to be handled now. Currently this
|
|
3058 includes executing asynchronous timeouts that may have been set
|
|
3059 from Lisp or from the poll-for-quit or poll-for-sigchld
|
|
3060 timers. (#### It seems that, to be slightly more accurate, we
|
|
3061 should also process poll-for-quit timers in the above version.
|
|
3062 However, this mechanism is inherently approximate, so it really
|
|
3063 doesn't matter much.) In the future, it might also include doing a
|
|
3064 thread context switch. Callers of QUITP generally don't except
|
1123
|
3065 random side effects to happen (#### unfortunately, random side effects
|
|
3066 can happen anyway, e.g. through menu filters -- see comment above),
|
|
3067 so we have this different version. */
|
428
|
3068 #define INTERNAL_QUITP \
|
853
|
3069 ((something_happened ? check_what_happened () : (void) 0), \
|
771
|
3070 QUIT_FLAG_SAYS_SHOULD_QUIT)
|
428
|
3071
|
|
3072 /* Check quit-flag and quit if it is non-nil. Also do any other things
|
853
|
3073 that are triggered by asynchronous events and might want to be
|
|
3074 handled. */
|
428
|
3075 #define QUIT do { if (INTERNAL_QUITP) signal_quit (); } while (0)
|
|
3076
|
|
3077
|
|
3078 /************************************************************************/
|
|
3079 /* hashing */
|
|
3080 /************************************************************************/
|
|
3081
|
|
3082 /* #### for a 64-bit machine, we should substitute a prime just over 2^32 */
|
|
3083 #define GOOD_HASH 65599 /* prime number just over 2^16; Dragon book, p. 435 */
|
|
3084 #define HASH2(a,b) (GOOD_HASH * (a) + (b))
|
|
3085 #define HASH3(a,b,c) (GOOD_HASH * HASH2 (a,b) + (c))
|
|
3086 #define HASH4(a,b,c,d) (GOOD_HASH * HASH3 (a,b,c) + (d))
|
|
3087 #define HASH5(a,b,c,d,e) (GOOD_HASH * HASH4 (a,b,c,d) + (e))
|
|
3088 #define HASH6(a,b,c,d,e,f) (GOOD_HASH * HASH5 (a,b,c,d,e) + (f))
|
|
3089 #define HASH7(a,b,c,d,e,f,g) (GOOD_HASH * HASH6 (a,b,c,d,e,f) + (g))
|
|
3090 #define HASH8(a,b,c,d,e,f,g,h) (GOOD_HASH * HASH7 (a,b,c,d,e,f,g) + (h))
|
|
3091 #define HASH9(a,b,c,d,e,f,g,h,i) (GOOD_HASH * HASH8 (a,b,c,d,e,f,g,h) + (i))
|
|
3092
|
|
3093 #define LISP_HASH(obj) ((unsigned long) LISP_TO_VOID (obj))
|
442
|
3094 unsigned long string_hash (const char *xv);
|
665
|
3095 unsigned long memory_hash (const void *xv, Bytecount size);
|
428
|
3096 unsigned long internal_hash (Lisp_Object obj, int depth);
|
|
3097 unsigned long internal_array_hash (Lisp_Object *arr, int size, int depth);
|
|
3098
|
|
3099
|
|
3100 /************************************************************************/
|
|
3101 /* String translation */
|
|
3102 /************************************************************************/
|
|
3103
|
771
|
3104 /* When support for message translation exists, GETTEXT() translates a
|
|
3105 string from English into the language defined by
|
|
3106 `current-language-environment'. This is done by looking the string
|
|
3107 up in a large predefined table; if no translation is found, the
|
|
3108 original string is returned, and the failure is possibly logged so
|
|
3109 that the translation can later be entered into the table.
|
|
3110
|
|
3111 In addition to this, there is a mechanism to snarf message strings
|
|
3112 out of the source code so that they can be entered into the tables.
|
|
3113 This is what make-msgfile.lex does.
|
|
3114
|
|
3115 Handling `format' strings is more difficult: The format string
|
|
3116 should get translated, but not under all circumstances. When the
|
|
3117 format string is a Lisp string, what should happen is that
|
|
3118 Fformat() should format the untranslated args[0] and return that,
|
|
3119 and also call Fgettext() on args[0] and, if that is different,
|
|
3120 format it and store it in the `string-translatable' property of the
|
|
3121 returned string. See Fgettext().
|
|
3122
|
|
3123 CGETTEXT() is the same as GETTEXT() but works with char * strings
|
867
|
3124 instead of Ibyte * strings.
|
771
|
3125
|
|
3126 build_msg_string() is a shorthand for build_string (GETTEXT (x)).
|
|
3127 build_msg_intstring() is a shorthand for build_intstring (GETTEXT (x)).
|
|
3128 */
|
|
3129
|
|
3130 #define GETTEXT(x) (x)
|
|
3131 #define CGETTEXT(x) (x)
|
|
3132 #define LISP_GETTEXT(x) (x)
|
428
|
3133
|
|
3134 /* DEFER_GETTEXT is used to identify strings which are translated when
|
|
3135 they are referenced instead of when they are defined.
|
|
3136 These include Qerror_messages and initialized arrays of strings.
|
|
3137 */
|
|
3138 #define DEFER_GETTEXT(x) (x)
|
|
3139
|
|
3140
|
|
3141 /************************************************************************/
|
|
3142 /* Garbage collection / GC-protection */
|
|
3143 /************************************************************************/
|
|
3144
|
|
3145 /* Structure for recording stack slots that need marking */
|
|
3146
|
|
3147 /* This is a chain of structures, each of which points at a Lisp_Object
|
|
3148 variable whose value should be marked in garbage collection.
|
|
3149 Normally every link of the chain is an automatic variable of a function,
|
|
3150 and its `val' points to some argument or local variable of the function.
|
|
3151 On exit to the function, the chain is set back to the value it had on
|
|
3152 entry. This way, no link remains in the chain when the stack frame
|
|
3153 containing the link disappears.
|
|
3154
|
|
3155 Every function that can call Feval must protect in this fashion all
|
|
3156 Lisp_Object variables whose contents will be used again. */
|
|
3157
|
1632
|
3158 extern MODULE_API struct gcpro *gcprolist;
|
428
|
3159
|
1650
|
3160 #ifdef __cplusplus
|
|
3161 }
|
|
3162 #endif
|
|
3163
|
1204
|
3164 /* #### Catching insufficient gcpro:
|
|
3165
|
|
3166 The C++ code below catches GCPRO without UNGCPRO or vice-versa.
|
|
3167 Catching cases where there's no GCPRO or UNGCPRO but should be, however,
|
|
3168 is much harder, but could be done:
|
|
3169
|
|
3170 1. Lisp_Object becomes a real object. Its creator and destructor need to
|
|
3171 figure out whether the object is on the stack (by looking at the range
|
|
3172 that `this' is within), and if so, add the pointer to a list of all
|
|
3173 stack-based Lisp_Objects.
|
|
3174
|
|
3175 2. The assignment method needs to do reference-counting on actual Lisp
|
|
3176 objects -- in particular, we need to know if there are any references
|
|
3177 to a Lisp object that are *NOT* from stack-based Lisp_Objects.
|
|
3178
|
|
3179 3. When we get to a point in the code where we might garbage collect --
|
|
3180 i.e. Ffuncall(), Feval(), or Fgarbage_collect() is called -- we look
|
|
3181 at our list of stack-based Lisp_Objects, and if there are any that
|
|
3182 point to Lisp objects with no non-stack references, see if there are
|
|
3183 any gcpros pointing to the object, and if not, set a flag indicating
|
|
3184 that the object is "destroyed". (Don't abort yet because the function
|
|
3185 might not use the object any more.)
|
|
3186
|
|
3187 4. When we detag a pointer using XFOO(), abort if its "destroyed" flag
|
|
3188 is set.
|
|
3189
|
|
3190 --ben
|
|
3191 */
|
|
3192
|
428
|
3193 struct gcpro
|
|
3194 {
|
|
3195 struct gcpro *next;
|
771
|
3196 const Lisp_Object *var; /* Address of first protected variable */
|
428
|
3197 int nvars; /* Number of consecutive protected variables */
|
1204
|
3198 #if defined (__cplusplus) && defined (ERROR_CHECK_GC)
|
|
3199 /* Try to catch GCPRO without UNGCPRO, or vice-versa. G++ complains (at
|
|
3200 least with sufficient numbers of warnings enabled, i.e. -Weffc++) if a
|
|
3201 copy constructor or assignment operator is not defined. */
|
|
3202 gcpro () : next (0), var (0), nvars (0) { }
|
|
3203 gcpro (const gcpro& g) : next (g.next), var (g.var), nvars (g.nvars) { }
|
|
3204 gcpro& operator= (const gcpro& g) { next = g.next; var = g.var;
|
|
3205 nvars = g.nvars;
|
|
3206 #undef this
|
|
3207 return *this;}
|
|
3208 #define this c_this
|
|
3209 ~gcpro () { assert (!next); }
|
|
3210 #endif /* defined (__cplusplus) && defined (ERROR_CHECK_GC) */
|
428
|
3211 };
|
|
3212
|
|
3213 /* Normally, you declare variables gcpro1, gcpro2, ... and use the
|
|
3214 GCPROn() macros. However, if you need to have nested gcpro's,
|
|
3215 declare ngcpro1, ngcpro2, ... and use NGCPROn(). If you need
|
|
3216 to nest another level, use nngcpro1, nngcpro2, ... and use
|
|
3217 NNGCPROn(). If you need to nest yet another level, create
|
|
3218 the appropriate macros. */
|
|
3219
|
1123
|
3220 /* NOTE: About comments like "This function does not GC": These are there to
|
|
3221 try to track whether GCPROing is necessary. Strictly speaking, some
|
|
3222 functions that say this might actually GC, but only when it is never
|
|
3223 possible to return (more specifically, in the process of signalling an
|
|
3224 error, the debugger may be invoked, and could GC). For GCPRO purposes,
|
|
3225 you only have to worry about functions that can GC and then return.
|
|
3226 The QUIT macro cannot GC any more, although this wasn't true at some point,
|
|
3227 and so some "This function can GC" comments may be inaccurate.
|
|
3228 */
|
|
3229
|
1650
|
3230 #ifdef __cplusplus
|
|
3231 extern "C" {
|
|
3232 #endif
|
|
3233
|
428
|
3234 #ifdef DEBUG_GCPRO
|
|
3235
|
1632
|
3236 MODULE_API void debug_gcpro1 (char *, int, struct gcpro *, Lisp_Object *);
|
|
3237 MODULE_API void debug_gcpro2 (char *, int, struct gcpro *, struct gcpro *,
|
|
3238 Lisp_Object *, Lisp_Object *);
|
|
3239 MODULE_API void debug_gcpro3 (char *, int, struct gcpro *, struct gcpro *,
|
|
3240 struct gcpro *, Lisp_Object *, Lisp_Object *,
|
|
3241 Lisp_Object *);
|
|
3242 MODULE_API void debug_gcpro4 (char *, int, struct gcpro *, struct gcpro *,
|
|
3243 struct gcpro *, struct gcpro *, Lisp_Object *,
|
|
3244 Lisp_Object *, Lisp_Object *, Lisp_Object *);
|
|
3245 MODULE_API void debug_gcpro5 (char *, int, struct gcpro *, struct gcpro *,
|
|
3246 struct gcpro *, struct gcpro *, struct gcpro *,
|
|
3247 Lisp_Object *, Lisp_Object *, Lisp_Object *,
|
|
3248 Lisp_Object *, Lisp_Object *);
|
|
3249 MODULE_API void debug_ungcpro(char *, int, struct gcpro *);
|
428
|
3250
|
|
3251 #define GCPRO1(v) \
|
|
3252 debug_gcpro1 (__FILE__, __LINE__,&gcpro1,&v)
|
|
3253 #define GCPRO2(v1,v2) \
|
|
3254 debug_gcpro2 (__FILE__, __LINE__,&gcpro1,&gcpro2,&v1,&v2)
|
|
3255 #define GCPRO3(v1,v2,v3) \
|
|
3256 debug_gcpro3 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&v1,&v2,&v3)
|
|
3257 #define GCPRO4(v1,v2,v3,v4) \
|
|
3258 debug_gcpro4 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,\
|
|
3259 &v1,&v2,&v3,&v4)
|
|
3260 #define GCPRO5(v1,v2,v3,v4,v5) \
|
|
3261 debug_gcpro5 (__FILE__, __LINE__,&gcpro1,&gcpro2,&gcpro3,&gcpro4,&gcpro5,\
|
|
3262 &v1,&v2,&v3,&v4,&v5)
|
|
3263 #define UNGCPRO \
|
|
3264 debug_ungcpro(__FILE__, __LINE__,&gcpro1)
|
|
3265
|
|
3266 #define NGCPRO1(v) \
|
|
3267 debug_gcpro1 (__FILE__, __LINE__,&ngcpro1,&v)
|
|
3268 #define NGCPRO2(v1,v2) \
|
|
3269 debug_gcpro2 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&v1,&v2)
|
|
3270 #define NGCPRO3(v1,v2,v3) \
|
|
3271 debug_gcpro3 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&v1,&v2,&v3)
|
|
3272 #define NGCPRO4(v1,v2,v3,v4) \
|
|
3273 debug_gcpro4 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,\
|
|
3274 &v1,&v2,&v3,&v4)
|
|
3275 #define NGCPRO5(v1,v2,v3,v4,v5) \
|
|
3276 debug_gcpro5 (__FILE__, __LINE__,&ngcpro1,&ngcpro2,&ngcpro3,&ngcpro4,\
|
|
3277 &ngcpro5,&v1,&v2,&v3,&v4,&v5)
|
|
3278 #define NUNGCPRO \
|
|
3279 debug_ungcpro(__FILE__, __LINE__,&ngcpro1)
|
|
3280
|
|
3281 #define NNGCPRO1(v) \
|
|
3282 debug_gcpro1 (__FILE__, __LINE__,&nngcpro1,&v)
|
|
3283 #define NNGCPRO2(v1,v2) \
|
|
3284 debug_gcpro2 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&v1,&v2)
|
|
3285 #define NNGCPRO3(v1,v2,v3) \
|
|
3286 debug_gcpro3 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&v1,&v2,&v3)
|
|
3287 #define NNGCPRO4(v1,v2,v3,v4) \
|
|
3288 debug_gcpro4 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,\
|
|
3289 &v1,&v2,&v3,&v4)
|
|
3290 #define NNGCPRO5(v1,v2,v3,v4,v5) \
|
|
3291 debug_gcpro5 (__FILE__, __LINE__,&nngcpro1,&nngcpro2,&nngcpro3,&nngcpro4,\
|
|
3292 &nngcpro5,&v1,&v2,&v3,&v4,&v5)
|
|
3293 #define NNUNGCPRO \
|
|
3294 debug_ungcpro(__FILE__, __LINE__,&nngcpro1)
|
|
3295
|
|
3296 #else /* ! DEBUG_GCPRO */
|
|
3297
|
|
3298 #define GCPRO1(var1) ((void) ( \
|
|
3299 gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \
|
|
3300 gcprolist = &gcpro1 ))
|
|
3301
|
|
3302 #define GCPRO2(var1, var2) ((void) ( \
|
|
3303 gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \
|
|
3304 gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \
|
|
3305 gcprolist = &gcpro2 ))
|
|
3306
|
|
3307 #define GCPRO3(var1, var2, var3) ((void) ( \
|
|
3308 gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \
|
|
3309 gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \
|
|
3310 gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \
|
|
3311 gcprolist = &gcpro3 ))
|
|
3312
|
|
3313 #define GCPRO4(var1, var2, var3, var4) ((void) ( \
|
|
3314 gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \
|
|
3315 gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \
|
|
3316 gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \
|
|
3317 gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \
|
|
3318 gcprolist = &gcpro4 ))
|
|
3319
|
|
3320 #define GCPRO5(var1, var2, var3, var4, var5) ((void) ( \
|
|
3321 gcpro1.next = gcprolist, gcpro1.var = &var1, gcpro1.nvars = 1, \
|
|
3322 gcpro2.next = &gcpro1, gcpro2.var = &var2, gcpro2.nvars = 1, \
|
|
3323 gcpro3.next = &gcpro2, gcpro3.var = &var3, gcpro3.nvars = 1, \
|
|
3324 gcpro4.next = &gcpro3, gcpro4.var = &var4, gcpro4.nvars = 1, \
|
|
3325 gcpro5.next = &gcpro4, gcpro5.var = &var5, gcpro5.nvars = 1, \
|
|
3326 gcprolist = &gcpro5 ))
|
|
3327
|
853
|
3328 #define GCPRO1_ARRAY(array, n) ((void) ( \
|
|
3329 gcpro1.next = gcprolist, gcpro1.var = array, gcpro1.nvars = n, \
|
|
3330 gcprolist = &gcpro1 ))
|
|
3331
|
|
3332 #define GCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \
|
|
3333 gcpro1.next = gcprolist, gcpro1.var = array1, gcpro1.nvars = n1, \
|
|
3334 gcpro2.next = &gcpro1, gcpro2.var = array2, gcpro2.nvars = n2, \
|
|
3335 gcprolist = &gcpro2 ))
|
|
3336
|
|
3337 #define GCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \
|
|
3338 gcpro1.next = gcprolist, gcpro1.var = array1, gcpro1.nvars = n1, \
|
|
3339 gcpro2.next = &gcpro1, gcpro2.var = array2, gcpro2.nvars = n2, \
|
|
3340 gcpro3.next = &gcpro2, gcpro3.var = array3, gcpro3.nvars = n3, \
|
|
3341 gcprolist = &gcpro3 ))
|
|
3342
|
1204
|
3343 #if defined (__cplusplus) && defined (ERROR_CHECK_GC)
|
|
3344 /* We need to reset each gcpro to avoid triggering the assert() in
|
|
3345 ~gcpro(). This happens in UNGCPRO and longjmp(). */
|
|
3346 #define UNWIND_GCPRO_TO(val) \
|
|
3347 do \
|
|
3348 { \
|
|
3349 struct gcpro *__gcpro_stop = (val); \
|
|
3350 /* Try to catch UNGCPRO without GCPRO. We arrange for there to be a \
|
|
3351 sentinel at the end of the gcprolist, so it should never be NULL. */ \
|
|
3352 assert (__gcpro_stop); \
|
|
3353 while (gcprolist != __gcpro_stop) \
|
|
3354 { \
|
|
3355 struct gcpro *__gcpro_next = gcprolist->next; \
|
|
3356 gcprolist->next = 0; \
|
|
3357 gcprolist = __gcpro_next; \
|
|
3358 assert (gcprolist); \
|
|
3359 } \
|
|
3360 } while (0)
|
|
3361 #else
|
|
3362 #define UNWIND_GCPRO_TO(val) (gcprolist = (val))
|
|
3363 #endif /* defined (__cplusplus) && defined (ERROR_CHECK_GC) */
|
|
3364
|
|
3365 #define UNGCPRO_1(gcpro1) UNWIND_GCPRO_TO (gcpro1.next)
|
|
3366
|
|
3367 #define UNGCPRO UNGCPRO_1 (gcpro1)
|
428
|
3368
|
|
3369 #define NGCPRO1(var1) ((void) ( \
|
|
3370 ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \
|
|
3371 gcprolist = &ngcpro1 ))
|
|
3372
|
|
3373 #define NGCPRO2(var1, var2) ((void) ( \
|
|
3374 ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \
|
|
3375 ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \
|
|
3376 gcprolist = &ngcpro2 ))
|
|
3377
|
|
3378 #define NGCPRO3(var1, var2, var3) ((void) ( \
|
|
3379 ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \
|
|
3380 ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \
|
|
3381 ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \
|
|
3382 gcprolist = &ngcpro3 ))
|
|
3383
|
|
3384 #define NGCPRO4(var1, var2, var3, var4) ((void) ( \
|
|
3385 ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \
|
|
3386 ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \
|
|
3387 ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \
|
|
3388 ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \
|
|
3389 gcprolist = &ngcpro4 ))
|
|
3390
|
|
3391 #define NGCPRO5(var1, var2, var3, var4, var5) ((void) ( \
|
|
3392 ngcpro1.next = gcprolist, ngcpro1.var = &var1, ngcpro1.nvars = 1, \
|
|
3393 ngcpro2.next = &ngcpro1, ngcpro2.var = &var2, ngcpro2.nvars = 1, \
|
|
3394 ngcpro3.next = &ngcpro2, ngcpro3.var = &var3, ngcpro3.nvars = 1, \
|
|
3395 ngcpro4.next = &ngcpro3, ngcpro4.var = &var4, ngcpro4.nvars = 1, \
|
|
3396 ngcpro5.next = &ngcpro4, ngcpro5.var = &var5, ngcpro5.nvars = 1, \
|
|
3397 gcprolist = &ngcpro5 ))
|
|
3398
|
853
|
3399 #define NGCPRO1_ARRAY(array, n) ((void) ( \
|
|
3400 ngcpro1.next = gcprolist, ngcpro1.var = array, ngcpro1.nvars = n, \
|
|
3401 gcprolist = &ngcpro1 ))
|
|
3402
|
|
3403 #define NGCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \
|
|
3404 ngcpro1.next = gcprolist, ngcpro1.var = array1, ngcpro1.nvars = n1, \
|
|
3405 ngcpro2.next = &ngcpro1, ngcpro2.var = array2, ngcpro2.nvars = n2, \
|
|
3406 gcprolist = &ngcpro2 ))
|
|
3407
|
|
3408 #define NGCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \
|
|
3409 ngcpro1.next = gcprolist, ngcpro1.var = array1, ngcpro1.nvars = n1, \
|
|
3410 ngcpro2.next = &ngcpro1, ngcpro2.var = array2, ngcpro2.nvars = n2, \
|
|
3411 ngcpro3.next = &ngcpro2, ngcpro3.var = array3, ngcpro3.nvars = n3, \
|
|
3412 gcprolist = &ngcpro3 ))
|
|
3413
|
1204
|
3414 #define NUNGCPRO UNGCPRO_1 (ngcpro1)
|
428
|
3415
|
|
3416 #define NNGCPRO1(var1) ((void) ( \
|
|
3417 nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
|
|
3418 gcprolist = &nngcpro1 ))
|
|
3419
|
|
3420 #define NNGCPRO2(var1, var2) ((void) ( \
|
|
3421 nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
|
|
3422 nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
|
|
3423 gcprolist = &nngcpro2 ))
|
|
3424
|
|
3425 #define NNGCPRO3(var1, var2, var3) ((void) ( \
|
|
3426 nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
|
|
3427 nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
|
|
3428 nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
|
|
3429 gcprolist = &nngcpro3 ))
|
|
3430
|
|
3431 #define NNGCPRO4(var1, var2, var3, var4) ((void) ( \
|
|
3432 nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
|
|
3433 nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
|
|
3434 nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
|
|
3435 nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \
|
|
3436 gcprolist = &nngcpro4 ))
|
|
3437
|
|
3438 #define NNGCPRO5(var1, var2, var3, var4, var5) ((void) ( \
|
|
3439 nngcpro1.next = gcprolist, nngcpro1.var = &var1, nngcpro1.nvars = 1, \
|
|
3440 nngcpro2.next = &nngcpro1, nngcpro2.var = &var2, nngcpro2.nvars = 1, \
|
|
3441 nngcpro3.next = &nngcpro2, nngcpro3.var = &var3, nngcpro3.nvars = 1, \
|
|
3442 nngcpro4.next = &nngcpro3, nngcpro4.var = &var4, nngcpro4.nvars = 1, \
|
|
3443 nngcpro5.next = &nngcpro4, nngcpro5.var = &var5, nngcpro5.nvars = 1, \
|
|
3444 gcprolist = &nngcpro5 ))
|
|
3445
|
853
|
3446 #define NNGCPRO1_ARRAY(array, n) ((void) ( \
|
|
3447 nngcpro1.next = gcprolist, nngcpro1.var = array, nngcpro1.nvars = n, \
|
|
3448 gcprolist = &nngcpro1 ))
|
|
3449
|
|
3450 #define NNGCPRO2_ARRAY(array1, n1, array2, n2) ((void) ( \
|
|
3451 nngcpro1.next = gcprolist, nngcpro1.var = array1, nngcpro1.nvars = n1, \
|
|
3452 nngcpro2.next = &nngcpro1, nngcpro2.var = array2, nngcpro2.nvars = n2, \
|
|
3453 gcprolist = &nngcpro2 ))
|
|
3454
|
|
3455 #define NNGCPRO3_ARRAY(array1, n1, array2, n2, array3, n3) ((void) ( \
|
|
3456 nngcpro1.next = gcprolist, nngcpro1.var = array1, nngcpro1.nvars = n1, \
|
|
3457 nngcpro2.next = &nngcpro1, nngcpro2.var = array2, nngcpro2.nvars = n2, \
|
|
3458 nngcpro3.next = &nngcpro2, nngcpro3.var = array3, nngcpro3.nvars = n3, \
|
|
3459 gcprolist = &nngcpro3 ))
|
|
3460
|
1204
|
3461 #define NNUNGCPRO UNGCPRO_1 (nngcpro1)
|
428
|
3462
|
|
3463 #endif /* ! DEBUG_GCPRO */
|
|
3464
|
|
3465 /* Evaluate expr, UNGCPRO, and then return the value of expr. */
|
|
3466 #define RETURN_UNGCPRO(expr) do \
|
|
3467 { \
|
|
3468 Lisp_Object ret_ungc_val = (expr); \
|
|
3469 UNGCPRO; \
|
|
3470 RETURN_SANS_WARNINGS ret_ungc_val; \
|
|
3471 } while (0)
|
|
3472
|
|
3473 /* Evaluate expr, NUNGCPRO, UNGCPRO, and then return the value of expr. */
|
|
3474 #define RETURN_NUNGCPRO(expr) do \
|
|
3475 { \
|
|
3476 Lisp_Object ret_ungc_val = (expr); \
|
|
3477 NUNGCPRO; \
|
|
3478 UNGCPRO; \
|
|
3479 RETURN_SANS_WARNINGS ret_ungc_val; \
|
|
3480 } while (0)
|
|
3481
|
|
3482 /* Evaluate expr, NNUNGCPRO, NUNGCPRO, UNGCPRO, and then return the
|
|
3483 value of expr. */
|
|
3484 #define RETURN_NNUNGCPRO(expr) do \
|
|
3485 { \
|
|
3486 Lisp_Object ret_ungc_val = (expr); \
|
|
3487 NNUNGCPRO; \
|
|
3488 NUNGCPRO; \
|
|
3489 UNGCPRO; \
|
|
3490 RETURN_SANS_WARNINGS ret_ungc_val; \
|
|
3491 } while (0)
|
|
3492
|
452
|
3493 extern Lisp_Object_ptr_dynarr *staticpros;
|
|
3494
|
771
|
3495 #ifdef DEBUG_XEMACS
|
|
3496
|
|
3497 /* Help debug crashes gc-marking a staticpro'ed object. */
|
|
3498
|
1632
|
3499 MODULE_API void staticpro_1 (Lisp_Object *, char *);
|
|
3500 MODULE_API void staticpro_nodump_1 (Lisp_Object *, char *);
|
771
|
3501 #define staticpro(ptr) staticpro_1 (ptr, #ptr)
|
|
3502 #define staticpro_nodump(ptr) staticpro_nodump_1 (ptr, #ptr)
|
|
3503
|
996
|
3504 #ifdef HAVE_SHLIB
|
1632
|
3505 MODULE_API void unstaticpro_nodump_1 (Lisp_Object *, char *);
|
996
|
3506 #define unstaticpro_nodump(ptr) unstaticpro_nodump_1 (ptr, #ptr)
|
|
3507 #endif
|
|
3508
|
771
|
3509 #else
|
611
|
3510
|
428
|
3511 /* Call staticpro (&var) to protect static variable `var'. */
|
1632
|
3512 MODULE_API void staticpro (Lisp_Object *);
|
428
|
3513
|
|
3514 /* Call staticpro_nodump (&var) to protect static variable `var'. */
|
|
3515 /* var will not be saved at dump time */
|
1632
|
3516 MODULE_API void staticpro_nodump (Lisp_Object *);
|
428
|
3517
|
996
|
3518 #ifdef HAVE_SHLIB
|
|
3519 /* Call unstaticpro_nodump (&var) to stop protecting static variable `var'. */
|
1632
|
3520 MODULE_API void unstaticpro_nodump (Lisp_Object *);
|
996
|
3521 #endif
|
|
3522
|
771
|
3523 #endif
|
|
3524
|
|
3525 void register_post_gc_action (void (*fun) (void *), void *arg);
|
|
3526 int begin_gc_forbidden (void);
|
|
3527 void end_gc_forbidden (int count);
|
|
3528
|
1650
|
3529 #ifdef __cplusplus
|
|
3530 }
|
|
3531 #endif
|
|
3532
|
771
|
3533
|
|
3534 /************************************************************************/
|
|
3535 /* Misc definitions */
|
|
3536 /************************************************************************/
|
442
|
3537
|
|
3538 /************************************************************************/
|
|
3539 /* prototypes */
|
|
3540 /************************************************************************/
|
|
3541
|
|
3542 /* NOTE: Prototypes should go HERE, not in various header files, unless
|
|
3543 they specifically reference a type that's not defined in lisp.h.
|
|
3544 (And even then, you might consider adding the type to lisp.h.)
|
|
3545
|
|
3546 The idea is that header files typically contain the innards of objects,
|
|
3547 and we want to minimize the number of "dependencies" of one file on
|
|
3548 the specifics of such objects. Putting prototypes here minimizes the
|
|
3549 number of header files that need to be included -- good for a number
|
|
3550 of reasons. --ben */
|
|
3551
|
|
3552 /*--------------- prototypes for various public c functions ------------*/
|
|
3553
|
|
3554 /* Prototypes for all init/syms_of/vars_of initialization functions. */
|
|
3555 #include "symsinit.h"
|
|
3556
|
1650
|
3557 #ifdef __cplusplus
|
|
3558 extern "C" {
|
|
3559 #endif
|
|
3560
|
826
|
3561 /* Defined in abbrev.c */
|
1632
|
3562 MODULE_API EXFUN (Fexpand_abbrev, 0);
|
826
|
3563
|
428
|
3564 /* Defined in alloc.c */
|
1632
|
3565 MODULE_API EXFUN (Fcons, 2);
|
|
3566 MODULE_API EXFUN (Flist, MANY);
|
826
|
3567 EXFUN (Fmake_byte_code, MANY);
|
1632
|
3568 MODULE_API EXFUN (Fmake_list, 2);
|
|
3569 MODULE_API EXFUN (Fmake_string, 2);
|
|
3570 MODULE_API EXFUN (Fmake_symbol, 1);
|
|
3571 MODULE_API EXFUN (Fmake_vector, 2);
|
|
3572 MODULE_API EXFUN (Fvector, MANY);
|
826
|
3573
|
428
|
3574 void release_breathing_space (void);
|
|
3575 Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object);
|
1632
|
3576 MODULE_API Lisp_Object make_vector (Elemcount, Lisp_Object);
|
|
3577 MODULE_API Lisp_Object vector1 (Lisp_Object);
|
|
3578 MODULE_API Lisp_Object vector2 (Lisp_Object, Lisp_Object);
|
|
3579 MODULE_API Lisp_Object vector3 (Lisp_Object, Lisp_Object, Lisp_Object);
|
665
|
3580 Lisp_Object make_bit_vector (Elemcount, Lisp_Object);
|
|
3581 Lisp_Object make_bit_vector_from_byte_vector (unsigned char *, Elemcount);
|
428
|
3582 Lisp_Object noseeum_make_marker (void);
|
|
3583 void garbage_collect_1 (void);
|
1632
|
3584 MODULE_API Lisp_Object acons (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
3585 MODULE_API Lisp_Object cons3 (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
3586 MODULE_API Lisp_Object list1 (Lisp_Object);
|
|
3587 MODULE_API Lisp_Object list2 (Lisp_Object, Lisp_Object);
|
|
3588 MODULE_API Lisp_Object list3 (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
3589 MODULE_API Lisp_Object list4 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
3590 Lisp_Object);
|
|
3591 MODULE_API Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object,
|
|
3592 Lisp_Object);
|
|
3593 MODULE_API Lisp_Object list6 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object,
|
|
3594 Lisp_Object, Lisp_Object);
|
428
|
3595 DECLARE_DOESNT_RETURN (memory_full (void));
|
|
3596 void disksave_object_finalization (void);
|
|
3597 extern int purify_flag;
|
|
3598 extern EMACS_INT gc_generation_number[1];
|
|
3599 int c_readonly (Lisp_Object);
|
|
3600 int lisp_readonly (Lisp_Object);
|
1632
|
3601 MODULE_API void copy_lisp_object (Lisp_Object dst, Lisp_Object src);
|
|
3602 MODULE_API Lisp_Object build_intstring (const Ibyte *);
|
|
3603 MODULE_API Lisp_Object build_string (const CIbyte *);
|
|
3604 MODULE_API Lisp_Object build_ext_string (const Extbyte *, Lisp_Object);
|
|
3605 MODULE_API Lisp_Object build_msg_intstring (const Ibyte *);
|
|
3606 MODULE_API Lisp_Object build_msg_string (const CIbyte *);
|
|
3607 MODULE_API Lisp_Object make_string (const Ibyte *, Bytecount);
|
|
3608 MODULE_API Lisp_Object make_ext_string (const Extbyte *, EMACS_INT, Lisp_Object);
|
771
|
3609 void init_string_ascii_begin (Lisp_Object string);
|
428
|
3610 Lisp_Object make_uninit_string (Bytecount);
|
1632
|
3611 MODULE_API Lisp_Object make_float (double);
|
867
|
3612 Lisp_Object make_string_nocopy (const Ibyte *, Bytecount);
|
853
|
3613 void free_cons (Lisp_Object);
|
428
|
3614 void free_list (Lisp_Object);
|
|
3615 void free_alist (Lisp_Object);
|
1204
|
3616 void free_marker (Lisp_Object);
|
428
|
3617 int object_dead_p (Lisp_Object);
|
|
3618 void mark_object (Lisp_Object obj);
|
1598
|
3619 #ifdef USE_KKCC
|
|
3620 void kkcc_gc_stack_push_lisp_object (Lisp_Object obj);
|
|
3621 #endif /* USE_KKCC */
|
428
|
3622 int marked_p (Lisp_Object obj);
|
851
|
3623 extern int funcall_allocation_flag;
|
814
|
3624 extern int need_to_garbage_collect;
|
1632
|
3625 extern MODULE_API int need_to_check_c_alloca;
|
888
|
3626 extern int need_to_signal_post_gc;
|
1333
|
3627 extern Lisp_Object Qpost_gc_hook, Qgarbage_collecting;
|
851
|
3628 void recompute_funcall_allocation_flag (void);
|
428
|
3629
|
|
3630 #ifdef MEMORY_USAGE_STATS
|
665
|
3631 Bytecount malloced_storage_size (void *, Bytecount, struct overhead_stats *);
|
|
3632 Bytecount fixed_type_block_overhead (Bytecount);
|
428
|
3633 #endif
|
1204
|
3634
|
|
3635 #ifdef EVENT_DATA_AS_OBJECTS
|
|
3636 Lisp_Object make_key_data (void);
|
|
3637 Lisp_Object make_button_data (void);
|
|
3638 Lisp_Object make_motion_data (void);
|
|
3639 Lisp_Object make_process_data (void);
|
|
3640 Lisp_Object make_timeout_data (void);
|
|
3641 Lisp_Object make_magic_data (void);
|
|
3642 Lisp_Object make_magic_eval_data (void);
|
|
3643 Lisp_Object make_eval_data (void);
|
|
3644 Lisp_Object make_misc_user_data (void);
|
|
3645 void free_key_data (Lisp_Object);
|
|
3646 void free_button_data (Lisp_Object);
|
|
3647 void free_motion_data (Lisp_Object);
|
|
3648 void free_process_data (Lisp_Object);
|
|
3649 void free_timeout_data (Lisp_Object);
|
|
3650 void free_magic_data (Lisp_Object);
|
|
3651 void free_magic_eval_data (Lisp_Object);
|
|
3652 void free_eval_data (Lisp_Object);
|
|
3653 void free_misc_user_data (Lisp_Object);
|
|
3654 #endif /* EVENT_DATA_AS_OBJECTS */
|
934
|
3655
|
428
|
3656 /* Defined in buffer.c */
|
|
3657 Lisp_Object get_truename_buffer (Lisp_Object);
|
|
3658 void switch_to_buffer (Lisp_Object, Lisp_Object);
|
|
3659 extern int find_file_compare_truenames;
|
|
3660 extern int find_file_use_truenames;
|
867
|
3661 Ibyte *get_initial_directory (Ibyte *pathname, Bytecount size);
|
771
|
3662 void set_buffer_internal (struct buffer *b);
|
|
3663 struct buffer *decode_buffer (Lisp_Object buffer, int allow_string);
|
|
3664
|
|
3665 void record_buffer (Lisp_Object buf);
|
|
3666 Lisp_Object get_buffer (Lisp_Object name,
|
|
3667 int error_if_deleted_or_does_not_exist);
|
|
3668 int map_over_sharing_buffers (struct buffer *buf,
|
|
3669 int (*mapfun) (struct buffer *buf,
|
|
3670 void *closure),
|
|
3671 void *closure);
|
1204
|
3672 void cleanup_buffer_undo_lists (void);
|
771
|
3673
|
|
3674 extern struct buffer *current_buffer;
|
|
3675
|
|
3676 extern void init_initial_directory (void); /* initialize initial_directory */
|
|
3677
|
|
3678 EXFUN (Fbuffer_disable_undo, 1);
|
1632
|
3679 MODULE_API EXFUN (Fbuffer_modified_p, 1);
|
|
3680 MODULE_API EXFUN (Fbuffer_name, 1);
|
|
3681 MODULE_API EXFUN (Fcurrent_buffer, 0);
|
771
|
3682 EXFUN (Ferase_buffer, 1);
|
|
3683 EXFUN (Fget_buffer, 1);
|
|
3684 EXFUN (Fget_buffer_create, 1);
|
|
3685 EXFUN (Fget_file_buffer, 1);
|
1632
|
3686 MODULE_API EXFUN (Fkill_buffer, 1);
|
771
|
3687 EXFUN (Fother_buffer, 3);
|
|
3688 EXFUN (Frecord_buffer, 1);
|
1632
|
3689 MODULE_API EXFUN (Fset_buffer, 1);
|
771
|
3690 EXFUN (Fset_buffer_modified_p, 2);
|
|
3691
|
|
3692 extern Lisp_Object QSscratch, Qafter_change_function, Qafter_change_functions;
|
|
3693 extern Lisp_Object Qbefore_change_function, Qbefore_change_functions;
|
|
3694 extern Lisp_Object Qbuffer_or_string_p, Qdefault_directory, Qfirst_change_hook;
|
|
3695 extern Lisp_Object Qpermanent_local, Vafter_change_function;
|
|
3696 extern Lisp_Object Vafter_change_functions, Vbefore_change_function;
|
|
3697 extern Lisp_Object Vbefore_change_functions, Vbuffer_alist, Vbuffer_defaults;
|
|
3698 extern Lisp_Object Vinhibit_read_only, Vtransient_mark_mode;
|
428
|
3699
|
563
|
3700 /* Defined in bytecode.c */
|
826
|
3701 EXFUN (Fbyte_code, 3);
|
|
3702
|
593
|
3703 DECLARE_DOESNT_RETURN (invalid_byte_code
|
867
|
3704 (const CIbyte *reason, Lisp_Object frob));
|
563
|
3705
|
826
|
3706 /* Defined in callint.c */
|
|
3707 EXFUN (Fcall_interactively, 3);
|
|
3708 EXFUN (Fprefix_numeric_value, 1);
|
|
3709
|
|
3710 /* Defined in casefiddle.c */
|
|
3711 EXFUN (Fdowncase, 2);
|
|
3712 EXFUN (Fupcase, 2);
|
|
3713 EXFUN (Fupcase_initials, 2);
|
|
3714 EXFUN (Fupcase_initials_region, 3);
|
|
3715 EXFUN (Fupcase_region, 3);
|
|
3716
|
|
3717 /* Defined in casetab.c */
|
|
3718 EXFUN (Fset_standard_case_table, 1);
|
|
3719
|
|
3720 /* Defined in chartab.c */
|
|
3721 EXFUN (Freset_char_table, 1);
|
|
3722
|
|
3723 /* Defined in cmds.c */
|
|
3724 EXFUN (Fbeginning_of_line, 2);
|
|
3725 EXFUN (Fend_of_line, 2);
|
|
3726 EXFUN (Fforward_char, 2);
|
|
3727 EXFUN (Fforward_line, 2);
|
|
3728
|
428
|
3729 /* Defined in data.c */
|
826
|
3730 EXFUN (Fadd1, 1);
|
|
3731 EXFUN (Faref, 2);
|
|
3732 EXFUN (Faset, 3);
|
|
3733 EXFUN (Fcar, 1);
|
|
3734 EXFUN (Fcar_safe, 1);
|
|
3735 EXFUN (Fcdr, 1);
|
919
|
3736 EXFUN (Fcdr_safe, 1);
|
826
|
3737 EXFUN (Fgeq, MANY);
|
|
3738 EXFUN (Fgtr, MANY);
|
|
3739 EXFUN (Findirect_function, 1);
|
|
3740 EXFUN (Fleq, MANY);
|
|
3741 EXFUN (Flistp, 1);
|
|
3742 EXFUN (Flss, MANY);
|
|
3743 EXFUN (Fmax, MANY);
|
|
3744 EXFUN (Fmin, MANY);
|
|
3745 EXFUN (Fminus, MANY);
|
|
3746 EXFUN (Fnumber_to_string, 1);
|
|
3747 EXFUN (Fplus, MANY);
|
|
3748 EXFUN (Fquo, MANY);
|
|
3749 EXFUN (Frem, 2);
|
|
3750 EXFUN (Fsetcar, 2);
|
|
3751 EXFUN (Fsetcdr, 2);
|
|
3752 EXFUN (Fsub1, 1);
|
|
3753 EXFUN (Fsubr_max_args, 1);
|
|
3754 EXFUN (Fsubr_min_args, 1);
|
|
3755 EXFUN (Ftimes, MANY);
|
|
3756
|
428
|
3757 DECLARE_DOESNT_RETURN (c_write_error (Lisp_Object));
|
|
3758 DECLARE_DOESNT_RETURN (lisp_write_error (Lisp_Object));
|
|
3759 DECLARE_DOESNT_RETURN (args_out_of_range (Lisp_Object, Lisp_Object));
|
|
3760 DECLARE_DOESNT_RETURN (args_out_of_range_3 (Lisp_Object, Lisp_Object,
|
|
3761 Lisp_Object));
|
1632
|
3762 MODULE_API Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object);
|
|
3763 MODULE_API
|
428
|
3764 DECLARE_DOESNT_RETURN (dead_wrong_type_argument (Lisp_Object, Lisp_Object));
|
|
3765 void check_int_range (EMACS_INT, EMACS_INT, EMACS_INT);
|
|
3766
|
771
|
3767 EXFUN (Fint_to_char, 1);
|
|
3768 EXFUN (Fchar_to_int, 1);
|
|
3769
|
428
|
3770 enum arith_comparison {
|
|
3771 arith_equal,
|
|
3772 arith_notequal,
|
|
3773 arith_less,
|
|
3774 arith_grtr,
|
|
3775 arith_less_or_equal,
|
|
3776 arith_grtr_or_equal };
|
|
3777 Lisp_Object arithcompare (Lisp_Object, Lisp_Object, enum arith_comparison);
|
|
3778
|
707
|
3779 /* Do NOT use word_to_lisp or wasteful_word_to_lisp to decode time_t's
|
|
3780 unless you KNOW arg is non-negative. They cannot return negative
|
|
3781 values! Use make_time. */
|
428
|
3782 Lisp_Object word_to_lisp (unsigned int);
|
|
3783 unsigned int lisp_to_word (Lisp_Object);
|
|
3784
|
|
3785 /* Defined in dired.c */
|
867
|
3786 Lisp_Object make_directory_hash_table (const Ibyte *);
|
428
|
3787 Lisp_Object wasteful_word_to_lisp (unsigned int);
|
|
3788
|
|
3789 /* Defined in doc.c */
|
826
|
3790 EXFUN (Fsubstitute_command_keys, 1);
|
|
3791
|
814
|
3792 Lisp_Object unparesseuxify_doc_string (int fd, EMACS_INT position,
|
867
|
3793 Ibyte *name_nonreloc,
|
814
|
3794 Lisp_Object name_reloc,
|
|
3795 int standard_doc_file);
|
428
|
3796 Lisp_Object read_doc_string (Lisp_Object);
|
|
3797
|
|
3798 /* Defined in doprnt.c */
|
867
|
3799 Bytecount emacs_doprnt_va (Lisp_Object stream, const Ibyte *format_nonreloc,
|
771
|
3800 Bytecount format_length, Lisp_Object format_reloc,
|
|
3801 va_list vargs);
|
867
|
3802 Bytecount emacs_doprnt (Lisp_Object stream, const Ibyte *format_nonreloc,
|
771
|
3803 Bytecount format_length, Lisp_Object format_reloc,
|
|
3804 int nargs, const Lisp_Object *largs, ...);
|
867
|
3805 Lisp_Object emacs_vsprintf_string_lisp (const CIbyte *format_nonreloc,
|
771
|
3806 Lisp_Object format_reloc, int nargs,
|
|
3807 const Lisp_Object *largs);
|
867
|
3808 Lisp_Object emacs_sprintf_string_lisp (const CIbyte *format_nonreloc,
|
771
|
3809 Lisp_Object format_reloc, int nargs, ...);
|
867
|
3810 Ibyte *emacs_vsprintf_malloc_lisp (const CIbyte *format_nonreloc,
|
771
|
3811 Lisp_Object format_reloc, int nargs,
|
|
3812 const Lisp_Object *largs,
|
|
3813 Bytecount *len_out);
|
867
|
3814 Ibyte *emacs_sprintf_malloc_lisp (Bytecount *len_out,
|
|
3815 const CIbyte *format_nonreloc,
|
771
|
3816 Lisp_Object format_reloc, int nargs, ...);
|
867
|
3817 Lisp_Object emacs_vsprintf_string (const CIbyte *format, va_list vargs);
|
|
3818 Lisp_Object emacs_sprintf_string (const CIbyte *format, ...)
|
771
|
3819 PRINTF_ARGS (1, 2);
|
867
|
3820 Ibyte *emacs_vsprintf_malloc (const CIbyte *format, va_list vargs,
|
771
|
3821 Bytecount *len_out);
|
867
|
3822 Ibyte *emacs_sprintf_malloc (Bytecount *len_out, const CIbyte *format, ...)
|
771
|
3823 PRINTF_ARGS (2, 3);
|
867
|
3824 Bytecount emacs_vsprintf (Ibyte *output, const CIbyte *format,
|
771
|
3825 va_list vargs);
|
867
|
3826 Bytecount emacs_sprintf (Ibyte *output, const CIbyte *format, ...)
|
771
|
3827 PRINTF_ARGS (2, 3);
|
|
3828
|
428
|
3829
|
|
3830 /* Defined in editfns.c */
|
826
|
3831 EXFUN (Fbobp, 1);
|
|
3832 EXFUN (Fbolp, 1);
|
|
3833 EXFUN (Fbuffer_substring, 3);
|
|
3834 EXFUN (Fchar_after, 2);
|
|
3835 EXFUN (Fchar_to_string, 1);
|
|
3836 EXFUN (Fdelete_region, 3);
|
|
3837 EXFUN (Feobp, 1);
|
|
3838 EXFUN (Feolp, 1);
|
|
3839 EXFUN (Ffollowing_char, 1);
|
|
3840 EXFUN (Fformat, MANY);
|
|
3841 EXFUN (Fgoto_char, 2);
|
|
3842 EXFUN (Finsert, MANY);
|
|
3843 EXFUN (Finsert_buffer_substring, 3);
|
|
3844 EXFUN (Finsert_char, 4);
|
|
3845 EXFUN (Fnarrow_to_region, 3);
|
|
3846 EXFUN (Fpoint, 1);
|
|
3847 EXFUN (Fpoint_marker, 2);
|
|
3848 EXFUN (Fpoint_max, 1);
|
|
3849 EXFUN (Fpoint_min, 1);
|
|
3850 EXFUN (Fpreceding_char, 1);
|
|
3851 EXFUN (Fsystem_name, 0);
|
|
3852 EXFUN (Fuser_home_directory, 0);
|
|
3853 EXFUN (Fuser_login_name, 1);
|
|
3854 EXFUN (Fwiden, 1);
|
|
3855
|
428
|
3856 void uncache_home_directory (void);
|
867
|
3857 Ibyte *get_home_directory (void);
|
|
3858 Ibyte *user_login_name (uid_t *);
|
428
|
3859 void buffer_insert1 (struct buffer *, Lisp_Object);
|
665
|
3860 Lisp_Object make_string_from_buffer (struct buffer *, Charbpos, Charcount);
|
|
3861 Lisp_Object make_string_from_buffer_no_extents (struct buffer *, Charbpos, Charcount);
|
707
|
3862 Lisp_Object make_time (time_t);
|
428
|
3863 Lisp_Object save_excursion_save (void);
|
844
|
3864 Lisp_Object save_restriction_save (struct buffer *buf);
|
428
|
3865 Lisp_Object save_excursion_restore (Lisp_Object);
|
|
3866 Lisp_Object save_restriction_restore (Lisp_Object);
|
771
|
3867 void widen_buffer (struct buffer *b, int no_clip);
|
|
3868 int beginning_of_line_p (struct buffer *b, Charbpos pt);
|
428
|
3869
|
|
3870 /* Defined in emacsfns.c */
|
|
3871 Lisp_Object save_current_buffer_restore (Lisp_Object);
|
|
3872
|
|
3873 /* Defined in emacs.c */
|
826
|
3874 EXFUN (Fkill_emacs, 1);
|
|
3875 EXFUN (Frunning_temacs_p, 0);
|
1123
|
3876 EXFUN (Fforce_debugging_signal, 1);
|
826
|
3877
|
428
|
3878 SIGTYPE fatal_error_signal (int);
|
442
|
3879 Lisp_Object make_arg_list (int, Extbyte **);
|
|
3880 void make_argc_argv (Lisp_Object, int *, Extbyte ***);
|
|
3881 void free_argc_argv (Extbyte **);
|
771
|
3882 Lisp_Object split_external_path (const Extbyte *path);
|
867
|
3883 Lisp_Object split_env_path (const CIbyte *evarname, const Ibyte *default_);
|
771
|
3884
|
428
|
3885 /* Nonzero means don't do interactive redisplay and don't change tty modes */
|
442
|
3886 extern int noninteractive, noninteractive1;
|
771
|
3887 extern int inhibit_non_essential_printing_operations;
|
428
|
3888 extern int preparing_for_armageddon;
|
458
|
3889 extern Fixnum emacs_priority;
|
428
|
3890 extern int suppress_early_error_handler_backtrace;
|
771
|
3891 void debug_break (void);
|
|
3892 int debug_can_access_memory (void *ptr, Bytecount len);
|
|
3893 void really_abort (void);
|
776
|
3894 void zero_out_command_line_status_vars (void);
|
428
|
3895
|
826
|
3896 /* Defined in emodules.c */
|
996
|
3897 #ifdef HAVE_SHLIB
|
826
|
3898 EXFUN (Flist_modules, 0);
|
|
3899 EXFUN (Fload_module, 3);
|
996
|
3900 extern int unloading_module;
|
|
3901 #endif
|
826
|
3902
|
428
|
3903 /* Defined in eval.c */
|
1706
|
3904 MODULE_API EXFUN (Fapply, MANY);
|
826
|
3905 EXFUN (Fbacktrace, 2);
|
|
3906 EXFUN (Fcommand_execute, 3);
|
|
3907 EXFUN (Fcommandp, 1);
|
1706
|
3908 MODULE_API EXFUN (Feval, 1);
|
|
3909 MODULE_API EXFUN (Ffuncall, MANY);
|
826
|
3910 EXFUN (Ffunctionp, 1);
|
|
3911 EXFUN (Finteractive_p, 0);
|
|
3912 EXFUN (Fprogn, UNEVALLED);
|
1706
|
3913 MODULE_API EXFUN (Fsignal, 2);
|
|
3914 MODULE_API EXFUN (Fthrow, 2);
|
|
3915 MODULE_API EXFUN (Fcall_with_condition_handler, MANY);
|
853
|
3916 EXFUN (Ffunction_max_args, 1);
|
|
3917 EXFUN (Ffunction_min_args, 1);
|
826
|
3918
|
1632
|
3919 MODULE_API DECLARE_DOESNT_RETURN (signal_error_1 (Lisp_Object, Lisp_Object));
|
563
|
3920 void maybe_signal_error_1 (Lisp_Object, Lisp_Object, Lisp_Object,
|
578
|
3921 Error_Behavior);
|
563
|
3922 Lisp_Object maybe_signal_continuable_error_1 (Lisp_Object, Lisp_Object,
|
578
|
3923 Lisp_Object, Error_Behavior);
|
1632
|
3924 MODULE_API DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (signal_ferror
|
|
3925 (Lisp_Object,
|
|
3926 const CIbyte *,
|
|
3927 ...), 2, 3);
|
578
|
3928 void maybe_signal_ferror (Lisp_Object, Lisp_Object, Error_Behavior,
|
867
|
3929 const CIbyte *, ...) PRINTF_ARGS (4, 5);
|
|
3930 Lisp_Object signal_continuable_ferror (Lisp_Object, const CIbyte *, ...)
|
442
|
3931 PRINTF_ARGS (2, 3);
|
563
|
3932 Lisp_Object maybe_signal_continuable_ferror (Lisp_Object, Lisp_Object,
|
578
|
3933 Error_Behavior,
|
867
|
3934 const CIbyte *, ...)
|
442
|
3935 PRINTF_ARGS (4, 5);
|
563
|
3936
|
867
|
3937 Lisp_Object build_error_data (const CIbyte *reason, Lisp_Object frob);
|
|
3938 DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, const CIbyte *,
|
563
|
3939 Lisp_Object));
|
867
|
3940 void maybe_signal_error (Lisp_Object, const CIbyte *, Lisp_Object,
|
578
|
3941 Lisp_Object, Error_Behavior);
|
867
|
3942 Lisp_Object signal_continuable_error (Lisp_Object, const CIbyte *,
|
563
|
3943 Lisp_Object);
|
867
|
3944 Lisp_Object maybe_signal_continuable_error (Lisp_Object, const CIbyte *,
|
563
|
3945 Lisp_Object,
|
578
|
3946 Lisp_Object, Error_Behavior);
|
563
|
3947 DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (signal_ferror_with_frob
|
442
|
3948 (Lisp_Object, Lisp_Object,
|
867
|
3949 const CIbyte *,
|
442
|
3950 ...), 3, 4);
|
563
|
3951 void maybe_signal_ferror_with_frob (Lisp_Object, Lisp_Object, Lisp_Object,
|
578
|
3952 Error_Behavior,
|
867
|
3953 const CIbyte *, ...) PRINTF_ARGS (5, 6);
|
563
|
3954 Lisp_Object signal_continuable_ferror_with_frob (Lisp_Object, Lisp_Object,
|
867
|
3955 const CIbyte *,
|
563
|
3956 ...) PRINTF_ARGS (3, 4);
|
|
3957 Lisp_Object maybe_signal_continuable_ferror_with_frob (Lisp_Object,
|
|
3958 Lisp_Object,
|
|
3959 Lisp_Object,
|
578
|
3960 Error_Behavior,
|
867
|
3961 const CIbyte *, ...)
|
442
|
3962 PRINTF_ARGS (5, 6);
|
867
|
3963 DECLARE_DOESNT_RETURN (signal_error_2 (Lisp_Object, const CIbyte *,
|
563
|
3964 Lisp_Object, Lisp_Object));
|
867
|
3965 void maybe_signal_error_2 (Lisp_Object, const CIbyte *, Lisp_Object,
|
578
|
3966 Lisp_Object, Lisp_Object, Error_Behavior);
|
867
|
3967 Lisp_Object signal_continuable_error_2 (Lisp_Object, const CIbyte *,
|
563
|
3968 Lisp_Object, Lisp_Object);
|
867
|
3969 Lisp_Object maybe_signal_continuable_error_2 (Lisp_Object, const CIbyte *,
|
563
|
3970 Lisp_Object, Lisp_Object,
|
|
3971 Lisp_Object,
|
578
|
3972 Error_Behavior);
|
563
|
3973
|
|
3974
|
436
|
3975 DECLARE_DOESNT_RETURN (signal_malformed_list_error (Lisp_Object));
|
|
3976 DECLARE_DOESNT_RETURN (signal_malformed_property_list_error (Lisp_Object));
|
|
3977 DECLARE_DOESNT_RETURN (signal_circular_list_error (Lisp_Object));
|
|
3978 DECLARE_DOESNT_RETURN (signal_circular_property_list_error (Lisp_Object));
|
|
3979
|
867
|
3980 DECLARE_DOESNT_RETURN (syntax_error (const CIbyte *reason,
|
609
|
3981 Lisp_Object frob));
|
867
|
3982 DECLARE_DOESNT_RETURN (syntax_error_2 (const CIbyte *reason,
|
609
|
3983 Lisp_Object frob1,
|
442
|
3984 Lisp_Object frob2));
|
867
|
3985 void maybe_syntax_error (const CIbyte *, Lisp_Object, Lisp_Object,
|
578
|
3986 Error_Behavior);
|
867
|
3987 DECLARE_DOESNT_RETURN (sferror (const CIbyte *reason, Lisp_Object frob));
|
|
3988 DECLARE_DOESNT_RETURN (sferror_2 (const CIbyte *reason, Lisp_Object frob1,
|
563
|
3989 Lisp_Object frob2));
|
867
|
3990 void maybe_sferror (const CIbyte *, Lisp_Object, Lisp_Object,
|
578
|
3991 Error_Behavior);
|
1632
|
3992 MODULE_API DECLARE_DOESNT_RETURN (invalid_argument (const CIbyte *reason,
|
|
3993 Lisp_Object frob));
|
|
3994 MODULE_API DECLARE_DOESNT_RETURN (invalid_argument_2 (const CIbyte *reason,
|
|
3995 Lisp_Object frob1,
|
|
3996 Lisp_Object frob2));
|
867
|
3997 void maybe_invalid_argument (const CIbyte *, Lisp_Object, Lisp_Object,
|
578
|
3998 Error_Behavior);
|
1632
|
3999 MODULE_API DECLARE_DOESNT_RETURN (invalid_operation (const CIbyte *reason,
|
|
4000 Lisp_Object frob));
|
|
4001 MODULE_API DECLARE_DOESNT_RETURN (invalid_operation_2 (const CIbyte *reason,
|
|
4002 Lisp_Object frob1,
|
|
4003 Lisp_Object frob2));
|
|
4004 MODULE_API void maybe_invalid_operation (const CIbyte *, Lisp_Object,
|
|
4005 Lisp_Object, Error_Behavior);
|
867
|
4006 DECLARE_DOESNT_RETURN (invalid_state (const CIbyte *reason,
|
563
|
4007 Lisp_Object frob));
|
867
|
4008 DECLARE_DOESNT_RETURN (invalid_state_2 (const CIbyte *reason,
|
563
|
4009 Lisp_Object frob1,
|
|
4010 Lisp_Object frob2));
|
867
|
4011 void maybe_invalid_state (const CIbyte *, Lisp_Object, Lisp_Object,
|
609
|
4012 Error_Behavior);
|
867
|
4013 DECLARE_DOESNT_RETURN (invalid_change (const CIbyte *reason,
|
563
|
4014 Lisp_Object frob));
|
867
|
4015 DECLARE_DOESNT_RETURN (invalid_change_2 (const CIbyte *reason,
|
563
|
4016 Lisp_Object frob1,
|
|
4017 Lisp_Object frob2));
|
867
|
4018 void maybe_invalid_change (const CIbyte *, Lisp_Object, Lisp_Object,
|
609
|
4019 Error_Behavior);
|
1632
|
4020 MODULE_API DECLARE_DOESNT_RETURN (invalid_constant (const CIbyte *reason,
|
|
4021 Lisp_Object frob));
|
867
|
4022 DECLARE_DOESNT_RETURN (invalid_constant_2 (const CIbyte *reason,
|
563
|
4023 Lisp_Object frob1,
|
|
4024 Lisp_Object frob2));
|
867
|
4025 void maybe_invalid_constant (const CIbyte *, Lisp_Object, Lisp_Object,
|
578
|
4026 Error_Behavior);
|
867
|
4027 DECLARE_DOESNT_RETURN (wtaerror (const CIbyte *reason, Lisp_Object frob));
|
1632
|
4028 MODULE_API DECLARE_DOESNT_RETURN (out_of_memory (const CIbyte *reason,
|
|
4029 Lisp_Object frob));
|
867
|
4030 DECLARE_DOESNT_RETURN (stack_overflow (const CIbyte *reason,
|
442
|
4031 Lisp_Object frob));
|
1632
|
4032 MODULE_API
|
563
|
4033 DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (printing_unreadable_object
|
867
|
4034 (const CIbyte *,
|
563
|
4035 ...), 1, 2);
|
442
|
4036
|
436
|
4037 Lisp_Object signal_void_function_error (Lisp_Object);
|
|
4038 Lisp_Object signal_invalid_function_error (Lisp_Object);
|
|
4039 Lisp_Object signal_wrong_number_of_arguments_error (Lisp_Object, int);
|
|
4040
|
428
|
4041 Lisp_Object run_hook_with_args_in_buffer (struct buffer *, int, Lisp_Object *,
|
|
4042 enum run_hooks_condition);
|
|
4043 Lisp_Object run_hook_with_args (int, Lisp_Object *, enum run_hooks_condition);
|
|
4044 void va_run_hook_with_args (Lisp_Object, int, ...);
|
|
4045 void va_run_hook_with_args_in_buffer (struct buffer *, Lisp_Object, int, ...);
|
|
4046 Lisp_Object run_hook (Lisp_Object);
|
1706
|
4047 MODULE_API Lisp_Object apply1 (Lisp_Object, Lisp_Object);
|
|
4048 MODULE_API Lisp_Object call0 (Lisp_Object);
|
|
4049 MODULE_API Lisp_Object call1 (Lisp_Object, Lisp_Object);
|
|
4050 MODULE_API Lisp_Object call2 (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4051 MODULE_API Lisp_Object call3 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4052 Lisp_Object);
|
|
4053 MODULE_API Lisp_Object call4 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4054 Lisp_Object, Lisp_Object);
|
|
4055 MODULE_API Lisp_Object call5 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4056 Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4057 MODULE_API Lisp_Object call6 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4058 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4059 Lisp_Object);
|
|
4060 MODULE_API Lisp_Object call7 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4061 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4062 Lisp_Object, Lisp_Object);
|
|
4063 MODULE_API Lisp_Object call8 (Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4064 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4065 Lisp_Object, Lisp_Object, Lisp_Object);
|
428
|
4066 Lisp_Object call0_in_buffer (struct buffer *, Lisp_Object);
|
|
4067 Lisp_Object call1_in_buffer (struct buffer *, Lisp_Object, Lisp_Object);
|
|
4068 Lisp_Object call2_in_buffer (struct buffer *, Lisp_Object, Lisp_Object,
|
|
4069 Lisp_Object);
|
|
4070 Lisp_Object call3_in_buffer (struct buffer *, Lisp_Object, Lisp_Object,
|
|
4071 Lisp_Object, Lisp_Object);
|
|
4072 Lisp_Object call4_in_buffer (struct buffer *, Lisp_Object, Lisp_Object,
|
|
4073 Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4074 Lisp_Object call5_in_buffer (struct buffer *, Lisp_Object, Lisp_Object,
|
|
4075 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4076 Lisp_Object);
|
|
4077 Lisp_Object call6_in_buffer (struct buffer *, Lisp_Object, Lisp_Object,
|
|
4078 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4079 Lisp_Object, Lisp_Object);
|
|
4080 Lisp_Object eval_in_buffer (struct buffer *, Lisp_Object);
|
853
|
4081
|
|
4082 struct call_trapping_problems_result
|
|
4083 {
|
|
4084 int caught_error, caught_throw;
|
|
4085 Lisp_Object error_conditions, data;
|
|
4086 Lisp_Object backtrace;
|
|
4087 Lisp_Object thrown_tag;
|
|
4088 Lisp_Object thrown_value;
|
|
4089 };
|
|
4090
|
|
4091 #define NO_INHIBIT_ERRORS (1<<0)
|
|
4092 #define NO_INHIBIT_THROWS (1<<1)
|
|
4093 #define INTERNAL_INHIBIT_ERRORS (1<<0)
|
|
4094 #define INTERNAL_INHIBIT_THROWS (1<<1)
|
|
4095 #define INHIBIT_WARNING_ISSUE (1<<2)
|
|
4096 #define ISSUE_WARNINGS_AT_DEBUG_LEVEL (1<<3)
|
|
4097 #define INHIBIT_QUIT (1<<4)
|
|
4098 #define UNINHIBIT_QUIT (1<<5)
|
|
4099 #define INHIBIT_GC (1<<6)
|
|
4100 #define INHIBIT_EXISTING_PERMANENT_DISPLAY_OBJECT_DELETION (1<<7)
|
|
4101 #define INHIBIT_EXISTING_CODING_SYSTEM_DELETION (1<<8)
|
|
4102 #define INHIBIT_EXISTING_CHARSET_DELETION (1<<9)
|
|
4103 #define INHIBIT_PERMANENT_DISPLAY_OBJECT_CREATION (1<<10)
|
|
4104 #define INHIBIT_CODING_SYSTEM_CREATION (1<<11)
|
|
4105 #define INHIBIT_CHARSET_CREATION (1<<12)
|
|
4106 #define INHIBIT_EXISTING_BUFFER_TEXT_MODIFICATION (1<<13)
|
|
4107 #define INHIBIT_ANY_CHANGE_AFFECTING_REDISPLAY (1<<14)
|
|
4108 #define INHIBIT_ENTERING_DEBUGGER (1<<15)
|
|
4109 #define CALL_WITH_SUSPENDED_ERRORS (1<<16)
|
1333
|
4110 #define POSTPONE_WARNING_ISSUE (1<<17)
|
853
|
4111
|
|
4112 enum check_allowed_operation
|
|
4113 {
|
|
4114 OPERATION_DELETE_OBJECT,
|
|
4115 OPERATION_CREATE_OBJECT,
|
|
4116 OPERATION_MODIFY_BUFFER_TEXT,
|
1429
|
4117 OPERATION_MODIFY_OBJECT_PROPERTY
|
853
|
4118 };
|
|
4119
|
|
4120 int get_inhibit_flags (void);
|
|
4121 void check_allowed_operation (int what, Lisp_Object obj, Lisp_Object prop);
|
|
4122 void note_object_created (Lisp_Object obj);
|
|
4123 void note_object_deleted (Lisp_Object obj);
|
|
4124 Lisp_Object call_with_condition_handler (Lisp_Object (*handler) (Lisp_Object,
|
|
4125 Lisp_Object,
|
|
4126 Lisp_Object),
|
|
4127 Lisp_Object handler_arg,
|
|
4128 Lisp_Object (*fun) (Lisp_Object),
|
|
4129 Lisp_Object arg);
|
1318
|
4130 int set_trapping_problems_flags (int flags);
|
853
|
4131 Lisp_Object call_trapping_problems (Lisp_Object warning_class,
|
|
4132 const char *warning_string,
|
|
4133 int flags,
|
|
4134 struct call_trapping_problems_result
|
|
4135 *problem,
|
|
4136 Lisp_Object (*fun) (void *),
|
|
4137 void *arg);
|
|
4138 Lisp_Object va_call_trapping_problems (Lisp_Object warning_class,
|
|
4139 const char *warning_string,
|
|
4140 int flags,
|
|
4141 struct call_trapping_problems_result
|
|
4142 *problem,
|
|
4143 lisp_fn_t fun, int nargs, ...);
|
|
4144 Lisp_Object call0_trapping_problems (const char *, Lisp_Object, int);
|
|
4145 Lisp_Object call1_trapping_problems (const char *, Lisp_Object, Lisp_Object,
|
|
4146 int);
|
|
4147 Lisp_Object call2_trapping_problems (const char *, Lisp_Object, Lisp_Object,
|
|
4148 Lisp_Object, int);
|
|
4149 Lisp_Object call3_trapping_problems (const char *, Lisp_Object, Lisp_Object,
|
|
4150 Lisp_Object, Lisp_Object, int);
|
|
4151 Lisp_Object call4_trapping_problems (const char *, Lisp_Object, Lisp_Object,
|
|
4152 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4153 int);
|
|
4154 Lisp_Object call5_trapping_problems (const char *, Lisp_Object, Lisp_Object,
|
|
4155 Lisp_Object, Lisp_Object, Lisp_Object,
|
|
4156 Lisp_Object, int);
|
|
4157 Lisp_Object eval_in_buffer_trapping_problems (const char *, struct buffer *,
|
|
4158 Lisp_Object, int);
|
1333
|
4159 Lisp_Object run_hook_trapping_problems (Lisp_Object, Lisp_Object, int);
|
|
4160 Lisp_Object safe_run_hook_trapping_problems (Lisp_Object, Lisp_Object, int);
|
|
4161 Lisp_Object run_hook_with_args_in_buffer_trapping_problems (Lisp_Object,
|
|
4162 struct buffer *,
|
|
4163 int nargs,
|
853
|
4164 Lisp_Object *args,
|
|
4165 enum
|
|
4166 run_hooks_condition
|
|
4167 cond, int flags);
|
1333
|
4168 Lisp_Object run_hook_with_args_trapping_problems (Lisp_Object,
|
853
|
4169 int nargs,
|
|
4170 Lisp_Object *args,
|
|
4171 enum run_hooks_condition
|
|
4172 cond,
|
|
4173 int flags);
|
1333
|
4174 Lisp_Object va_run_hook_with_args_trapping_problems (Lisp_Object,
|
853
|
4175 Lisp_Object hook_var,
|
|
4176 int nargs, ...);
|
1333
|
4177 Lisp_Object va_run_hook_with_args_in_buffer_trapping_problems (Lisp_Object,
|
|
4178 struct buffer *,
|
|
4179 Lisp_Object,
|
853
|
4180 int nargs, ...);
|
|
4181 Lisp_Object call_with_suspended_errors (lisp_fn_t, Lisp_Object,
|
|
4182 Lisp_Object,
|
578
|
4183 Error_Behavior, int, ...);
|
428
|
4184 /* C Code should be using internal_catch, record_unwind_p, condition_case_1 */
|
1318
|
4185 int proper_redisplay_wrapping_in_place (void);
|
428
|
4186 Lisp_Object internal_catch (Lisp_Object, Lisp_Object (*) (Lisp_Object),
|
853
|
4187 Lisp_Object, int * volatile,
|
|
4188 Lisp_Object * volatile);
|
428
|
4189 Lisp_Object condition_case_1 (Lisp_Object,
|
|
4190 Lisp_Object (*) (Lisp_Object),
|
|
4191 Lisp_Object,
|
|
4192 Lisp_Object (*) (Lisp_Object, Lisp_Object),
|
|
4193 Lisp_Object);
|
|
4194 Lisp_Object condition_case_3 (Lisp_Object, Lisp_Object, Lisp_Object);
|
1632
|
4195 MODULE_API Lisp_Object unbind_to_1 (int, Lisp_Object);
|
771
|
4196 #define unbind_to(obj) unbind_to_1 (obj, Qnil)
|
428
|
4197 void specbind (Lisp_Object, Lisp_Object);
|
1632
|
4198 MODULE_API int record_unwind_protect (Lisp_Object (*) (Lisp_Object),
|
|
4199 Lisp_Object);
|
771
|
4200 int record_unwind_protect_freeing_dynarr (void *ptr);
|
1333
|
4201 int record_unwind_protect_restoring_int (int *addr, int val);
|
802
|
4202 int internal_bind_int (int *addr, int newval);
|
|
4203 int internal_bind_lisp_object (Lisp_Object *addr, Lisp_Object newval);
|
970
|
4204 void do_autoload (Lisp_Object, Lisp_Object); /* GCPROs both arguments */
|
428
|
4205 Lisp_Object un_autoload (Lisp_Object);
|
|
4206 void warn_when_safe_lispobj (Lisp_Object, Lisp_Object, Lisp_Object);
|
1632
|
4207 MODULE_API void warn_when_safe (Lisp_Object, Lisp_Object, const CIbyte *,
|
|
4208 ...) PRINTF_ARGS (3, 4);
|
1292
|
4209 extern int backtrace_with_internal_sections;
|
428
|
4210
|
1315
|
4211 extern Lisp_Object Vstack_trace_on_error;
|
428
|
4212
|
|
4213 /* Defined in event-stream.c */
|
826
|
4214 EXFUN (Faccept_process_output, 3);
|
|
4215 EXFUN (Fadd_timeout, 4);
|
|
4216 EXFUN (Fdisable_timeout, 1);
|
|
4217 EXFUN (Fdiscard_input, 0);
|
|
4218 EXFUN (Fdispatch_event, 1);
|
|
4219 EXFUN (Fenqueue_eval_event, 2);
|
|
4220 EXFUN (Fnext_event, 2);
|
|
4221 EXFUN (Fread_key_sequence, 3);
|
|
4222 EXFUN (Fsit_for, 2);
|
|
4223 EXFUN (Fsleep_for, 1);
|
|
4224
|
428
|
4225 void wait_delaying_user_input (int (*) (void *), void *);
|
1268
|
4226 int detect_input_pending (int how_many);
|
428
|
4227 void reset_this_command_keys (Lisp_Object, int);
|
|
4228 Lisp_Object enqueue_misc_user_event (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4229 Lisp_Object enqueue_misc_user_event_pos (Lisp_Object, Lisp_Object,
|
|
4230 Lisp_Object, int, int, int, int);
|
442
|
4231 extern int modifier_keys_are_sticky;
|
428
|
4232
|
|
4233 /* Defined in event-Xt.c */
|
|
4234 void signal_special_Xt_user_event (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4235
|
|
4236
|
|
4237 /* Defined in events.c */
|
826
|
4238 EXFUN (Fcopy_event, 2);
|
|
4239 EXFUN (Fevent_to_character, 4);
|
|
4240
|
428
|
4241 void clear_event_resource (void);
|
|
4242 Lisp_Object allocate_event (void);
|
|
4243
|
771
|
4244 EXFUN (Fevent_x_pixel, 1);
|
|
4245 EXFUN (Fevent_y_pixel, 1);
|
|
4246
|
|
4247
|
|
4248 /* Defined in file-coding.c */
|
|
4249 EXFUN (Fcoding_category_list, 0);
|
|
4250 EXFUN (Fcoding_category_system, 1);
|
|
4251 EXFUN (Fcoding_priority_list, 0);
|
|
4252 EXFUN (Fcoding_system_description, 1);
|
|
4253 EXFUN (Fcoding_system_documentation, 1);
|
|
4254 EXFUN (Fcoding_system_list, 1);
|
|
4255 EXFUN (Fcoding_system_name, 1);
|
|
4256 EXFUN (Fcoding_system_p, 1);
|
|
4257 EXFUN (Fcoding_system_property, 2);
|
|
4258 EXFUN (Fcoding_system_type, 1);
|
|
4259 EXFUN (Fcopy_coding_system, 2);
|
|
4260 EXFUN (Fdecode_big5_char, 1);
|
|
4261 EXFUN (Fdecode_coding_region, 4);
|
|
4262 EXFUN (Fdecode_shift_jis_char, 1);
|
|
4263 EXFUN (Fdefine_coding_system_alias, 2);
|
|
4264 EXFUN (Fdetect_coding_region, 3);
|
|
4265 EXFUN (Fdefault_encoding_detection_enabled_p, 0);
|
|
4266 EXFUN (Fencode_big5_char, 1);
|
|
4267 EXFUN (Fencode_coding_region, 4);
|
|
4268 EXFUN (Fencode_shift_jis_char, 1);
|
|
4269 EXFUN (Ffind_coding_system, 1);
|
|
4270 EXFUN (Fget_coding_system, 1);
|
|
4271 EXFUN (Fmake_coding_system, 4);
|
|
4272 EXFUN (Fset_coding_category_system, 2);
|
|
4273 EXFUN (Fset_coding_priority_list, 1);
|
|
4274 EXFUN (Fsubsidiary_coding_system, 2);
|
|
4275
|
|
4276 extern Lisp_Object Qshift_jis, Qiso2022, Qbig5, Qccl;
|
|
4277 extern Lisp_Object Qcharset_g0;
|
|
4278 extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error;
|
|
4279 extern Lisp_Object Qcoding_systemp, Qcr, Qcrlf, Qdecode, Qencode;
|
|
4280 extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted;
|
|
4281 extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
|
|
4282 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output;
|
|
4283 extern Lisp_Object Qinput_charset_conversion, Qlf, Qlock_shift;
|
|
4284 extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol;
|
|
4285 extern Lisp_Object Qno_conversion, Qraw_text;
|
|
4286 extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion;
|
|
4287 extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven;
|
|
4288 extern Lisp_Object Qshort, Vcoding_system_for_read;
|
|
4289 extern Lisp_Object Vcoding_system_for_write;
|
|
4290 extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system;
|
|
4291 extern Lisp_Object Vterminal_coding_system;
|
|
4292 extern Lisp_Object Qcanonicalize_after_coding;
|
|
4293 int coding_system_is_for_text_file (Lisp_Object coding_system);
|
|
4294 Lisp_Object find_coding_system_for_text_file (Lisp_Object name, int eol_wrap);
|
1632
|
4295 MODULE_API Lisp_Object get_coding_system_for_text_file (Lisp_Object name,
|
|
4296 int eol_wrap);
|
771
|
4297 int coding_system_is_binary (Lisp_Object coding_system);
|
|
4298
|
|
4299
|
428
|
4300 /* Defined in fileio.c */
|
826
|
4301 EXFUN (Fdirectory_file_name, 1);
|
|
4302 EXFUN (Fdo_auto_save, 2);
|
|
4303 EXFUN (Fexpand_file_name, 2);
|
|
4304 EXFUN (Ffile_accessible_directory_p, 1);
|
|
4305 EXFUN (Ffile_directory_p, 1);
|
|
4306 EXFUN (Ffile_executable_p, 1);
|
|
4307 EXFUN (Ffile_exists_p, 1);
|
|
4308 EXFUN (Ffile_name_absolute_p, 1);
|
|
4309 EXFUN (Ffile_name_as_directory, 1);
|
|
4310 EXFUN (Ffile_name_directory, 1);
|
|
4311 EXFUN (Ffile_name_nondirectory, 1);
|
|
4312 EXFUN (Ffile_readable_p, 1);
|
|
4313 EXFUN (Ffile_symlink_p, 1);
|
|
4314 EXFUN (Ffile_truename, 2);
|
|
4315 EXFUN (Ffind_file_name_handler, 2);
|
|
4316 EXFUN (Finsert_file_contents_internal, 7);
|
|
4317 EXFUN (Fmake_temp_name, 1);
|
|
4318 EXFUN (Fsubstitute_in_file_name, 1);
|
|
4319 EXFUN (Funhandled_file_name_directory, 1);
|
|
4320 EXFUN (Fverify_visited_file_modtime, 1);
|
|
4321
|
428
|
4322 void record_auto_save (void);
|
|
4323 void force_auto_save_soon (void);
|
563
|
4324 DECLARE_DOESNT_RETURN (report_error_with_errno (Lisp_Object errtype,
|
867
|
4325 const CIbyte *string,
|
563
|
4326 Lisp_Object data));
|
|
4327 DECLARE_DOESNT_RETURN (report_file_type_error (Lisp_Object errtype,
|
|
4328 Lisp_Object oserrmess,
|
867
|
4329 const CIbyte *string,
|
563
|
4330 Lisp_Object data));
|
867
|
4331 DECLARE_DOESNT_RETURN (report_file_error (const CIbyte *, Lisp_Object));
|
428
|
4332 Lisp_Object lisp_strerror (int);
|
|
4333 Lisp_Object expand_and_dir_to_file (Lisp_Object, Lisp_Object);
|
|
4334 int internal_delete_file (Lisp_Object);
|
|
4335
|
|
4336 /* Defined in filelock.c */
|
826
|
4337 EXFUN (Funlock_buffer, 0);
|
|
4338
|
428
|
4339 void lock_file (Lisp_Object);
|
|
4340 void unlock_file (Lisp_Object);
|
|
4341 void unlock_all_files (void);
|
|
4342 void unlock_buffer (struct buffer *);
|
|
4343
|
|
4344 /* Defined in floatfns.c */
|
826
|
4345 EXFUN (Ftruncate, 1);
|
|
4346
|
428
|
4347 double extract_float (Lisp_Object);
|
|
4348
|
|
4349 /* Defined in fns.c */
|
1632
|
4350 MODULE_API EXFUN (Fappend, MANY);
|
826
|
4351 EXFUN (Fassoc, 2);
|
|
4352 EXFUN (Fassq, 2);
|
|
4353 EXFUN (Fcanonicalize_lax_plist, 2);
|
|
4354 EXFUN (Fcanonicalize_plist, 2);
|
|
4355 EXFUN (Fcheck_valid_plist, 1);
|
|
4356 EXFUN (Fconcat, MANY);
|
|
4357 EXFUN (Fcopy_alist, 1);
|
|
4358 EXFUN (Fcopy_list, 1);
|
|
4359 EXFUN (Fcopy_sequence, 1);
|
|
4360 EXFUN (Fcopy_tree, 2);
|
|
4361 EXFUN (Fdelete, 2);
|
|
4362 EXFUN (Fdelq, 2);
|
|
4363 EXFUN (Fdestructive_alist_to_plist, 1);
|
|
4364 EXFUN (Felt, 2);
|
1632
|
4365 MODULE_API EXFUN (Fequal, 2);
|
|
4366 MODULE_API EXFUN (Fget, 3);
|
826
|
4367 EXFUN (Flast, 2);
|
|
4368 EXFUN (Flax_plist_get, 3);
|
|
4369 EXFUN (Flax_plist_remprop, 2);
|
1632
|
4370 MODULE_API EXFUN (Flength, 1);
|
826
|
4371 EXFUN (Fmapcar, 2);
|
|
4372 EXFUN (Fmember, 2);
|
|
4373 EXFUN (Fmemq, 2);
|
|
4374 EXFUN (Fnconc, MANY);
|
1632
|
4375 MODULE_API EXFUN (Fnreverse, 1);
|
826
|
4376 EXFUN (Fnthcdr, 2);
|
|
4377 EXFUN (Fold_assq, 2);
|
|
4378 EXFUN (Fold_equal, 2);
|
|
4379 EXFUN (Fold_member, 2);
|
|
4380 EXFUN (Fold_memq, 2);
|
|
4381 EXFUN (Fplist_get, 3);
|
|
4382 EXFUN (Fplist_member, 2);
|
|
4383 EXFUN (Fplist_put, 3);
|
1632
|
4384 MODULE_API EXFUN (Fprovide, 1);
|
|
4385 MODULE_API EXFUN (Fput, 3);
|
826
|
4386 EXFUN (Frassq, 2);
|
|
4387 EXFUN (Fremassq, 2);
|
|
4388 EXFUN (Freplace_list, 2);
|
1632
|
4389 MODULE_API EXFUN (Freverse, 1);
|
1268
|
4390 EXFUN (Fsafe_length, 1);
|
826
|
4391 EXFUN (Fsort, 2);
|
|
4392 EXFUN (Fstring_equal, 2);
|
|
4393 EXFUN (Fstring_lessp, 2);
|
|
4394 EXFUN (Fsubstring, 3);
|
|
4395 EXFUN (Fvalid_plist_p, 1);
|
|
4396
|
428
|
4397 Lisp_Object list_sort (Lisp_Object, Lisp_Object,
|
|
4398 int (*) (Lisp_Object, Lisp_Object, Lisp_Object));
|
|
4399 Lisp_Object merge (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4400
|
|
4401 void bump_string_modiff (Lisp_Object);
|
|
4402 Lisp_Object memq_no_quit (Lisp_Object, Lisp_Object);
|
|
4403 Lisp_Object assoc_no_quit (Lisp_Object, Lisp_Object);
|
|
4404 Lisp_Object assq_no_quit (Lisp_Object, Lisp_Object);
|
|
4405 Lisp_Object rassq_no_quit (Lisp_Object, Lisp_Object);
|
|
4406 Lisp_Object delq_no_quit (Lisp_Object, Lisp_Object);
|
|
4407 Lisp_Object delq_no_quit_and_free_cons (Lisp_Object, Lisp_Object);
|
|
4408 Lisp_Object remassoc_no_quit (Lisp_Object, Lisp_Object);
|
|
4409 Lisp_Object remassq_no_quit (Lisp_Object, Lisp_Object);
|
|
4410 Lisp_Object remrassq_no_quit (Lisp_Object, Lisp_Object);
|
|
4411
|
|
4412 int plists_differ (Lisp_Object, Lisp_Object, int, int, int);
|
|
4413 Lisp_Object internal_plist_get (Lisp_Object, Lisp_Object);
|
|
4414 void internal_plist_put (Lisp_Object *, Lisp_Object, Lisp_Object);
|
|
4415 int internal_remprop (Lisp_Object *, Lisp_Object);
|
|
4416 Lisp_Object external_plist_get (Lisp_Object *, Lisp_Object,
|
578
|
4417 int, Error_Behavior);
|
428
|
4418 void external_plist_put (Lisp_Object *, Lisp_Object,
|
578
|
4419 Lisp_Object, int, Error_Behavior);
|
|
4420 int external_remprop (Lisp_Object *, Lisp_Object, int, Error_Behavior);
|
853
|
4421 int internal_equal_trapping_problems (Lisp_Object warning_class,
|
|
4422 const char *warning_string,
|
|
4423 int flags,
|
|
4424 struct call_trapping_problems_result *p,
|
|
4425 int retval,
|
|
4426 Lisp_Object obj1, Lisp_Object obj2,
|
|
4427 int depth);
|
428
|
4428 int internal_equal (Lisp_Object, Lisp_Object, int);
|
801
|
4429 int internal_equalp (Lisp_Object obj1, Lisp_Object obj2, int depth);
|
428
|
4430 Lisp_Object concat2 (Lisp_Object, Lisp_Object);
|
|
4431 Lisp_Object concat3 (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4432 Lisp_Object vconcat2 (Lisp_Object, Lisp_Object);
|
|
4433 Lisp_Object vconcat3 (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4434 Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
|
|
4435 Lisp_Object bytecode_nconc2 (Lisp_Object *);
|
442
|
4436 void check_losing_bytecode (const char *, Lisp_Object);
|
428
|
4437
|
771
|
4438 Lisp_Object add_suffix_to_symbol (Lisp_Object symbol,
|
|
4439 const Char_ASCII *ascii_string);
|
|
4440 Lisp_Object add_prefix_to_symbol (const Char_ASCII *ascii_string,
|
|
4441 Lisp_Object symbol);
|
|
4442
|
826
|
4443 /* Defined in free-hook.c */
|
|
4444 EXFUN (Freally_free, 1);
|
|
4445
|
428
|
4446 /* Defined in glyphs.c */
|
826
|
4447 EXFUN (Fmake_glyph_internal, 1);
|
|
4448
|
578
|
4449 Error_Behavior decode_error_behavior_flag (Lisp_Object);
|
|
4450 Lisp_Object encode_error_behavior_flag (Error_Behavior);
|
428
|
4451
|
563
|
4452 /* Defined in glyphs-shared.c */
|
|
4453 void shared_resource_validate (Lisp_Object instantiator);
|
|
4454 Lisp_Object shared_resource_normalize (Lisp_Object inst,
|
|
4455 Lisp_Object console_type,
|
|
4456 Lisp_Object dest_mask,
|
|
4457 Lisp_Object tag);
|
|
4458 extern Lisp_Object Q_resource_type, Q_resource_id;
|
|
4459
|
|
4460 /* Defined in gui.c */
|
|
4461 DECLARE_DOESNT_RETURN (gui_error (const char *reason,
|
|
4462 Lisp_Object frob));
|
569
|
4463 DECLARE_DOESNT_RETURN (gui_error_2 (const char *reason,
|
|
4464 Lisp_Object frob0, Lisp_Object frob1));
|
428
|
4465 /* Defined in indent.c */
|
826
|
4466 EXFUN (Findent_to, 3);
|
|
4467 EXFUN (Fvertical_motion, 3);
|
|
4468
|
|
4469 int byte_spaces_at_point (struct buffer *, Bytebpos);
|
665
|
4470 int column_at_point (struct buffer *, Charbpos, int);
|
793
|
4471 int string_column_at_point (Lisp_Object, Charbpos, int);
|
428
|
4472 int current_column (struct buffer *);
|
|
4473 void invalidate_current_column (void);
|
665
|
4474 Charbpos vmotion (struct window *, Charbpos, int, int *);
|
|
4475 Charbpos vmotion_pixels (Lisp_Object, Charbpos, int, int, int *);
|
428
|
4476
|
771
|
4477 /* Defined in insdel.c */
|
|
4478 void set_buffer_point (struct buffer *buf, Charbpos pos, Bytebpos bipos);
|
|
4479
|
826
|
4480 /* Defined in intl.c */
|
|
4481 EXFUN (Fgettext, 1);
|
|
4482
|
428
|
4483 /* Defined in keymap.c */
|
826
|
4484 EXFUN (Fdefine_key, 3);
|
|
4485 EXFUN (Fkey_description, 1);
|
|
4486 EXFUN (Flookup_key, 3);
|
|
4487 EXFUN (Fmake_sparse_keymap, 1);
|
|
4488
|
793
|
4489 void where_is_to_char (Lisp_Object, Eistring *);
|
428
|
4490
|
|
4491 /* Defined in lread.c */
|
826
|
4492 EXFUN (Fread, 1);
|
|
4493
|
428
|
4494 void ebolify_bytecode_constants (Lisp_Object);
|
|
4495 void close_load_descs (void);
|
|
4496 int locate_file (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object *, int);
|
|
4497 EXFUN (Flocate_file_clear_hashing, 1);
|
442
|
4498 int isfloat_string (const char *);
|
428
|
4499
|
|
4500 /* Well, I've decided to enable this. -- ben */
|
|
4501 /* And I've decided to make it work right. -- sb */
|
|
4502 #define LOADHIST
|
|
4503 /* Define the following symbol to enable load history of dumped files */
|
|
4504 #define LOADHIST_DUMPED
|
|
4505 /* Define the following symbol to enable load history of C source */
|
|
4506 #define LOADHIST_BUILTIN
|
|
4507
|
|
4508 #ifdef LOADHIST /* this is just a stupid idea */
|
|
4509 #define LOADHIST_ATTACH(x) \
|
|
4510 do { if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list); } \
|
|
4511 while (0)
|
|
4512 #else /*! LOADHIST */
|
|
4513 # define LOADHIST_ATTACH(x)
|
|
4514 #endif /*! LOADHIST */
|
|
4515
|
826
|
4516 /* Defined in macros.c */
|
|
4517 EXFUN (Fexecute_kbd_macro, 2);
|
|
4518
|
428
|
4519 /* Defined in marker.c */
|
826
|
4520 EXFUN (Fcopy_marker, 2);
|
|
4521 EXFUN (Fmake_marker, 0);
|
|
4522 EXFUN (Fmarker_buffer, 1);
|
|
4523 EXFUN (Fmarker_position, 1);
|
|
4524 EXFUN (Fset_marker, 3);
|
|
4525 EXFUN (Fset_marker_insertion_type, 2);
|
|
4526
|
|
4527 Bytebpos byte_marker_position (Lisp_Object);
|
665
|
4528 Charbpos marker_position (Lisp_Object);
|
826
|
4529 void set_byte_marker_position (Lisp_Object, Bytebpos);
|
665
|
4530 void set_marker_position (Lisp_Object, Charbpos);
|
428
|
4531 void unchain_marker (Lisp_Object);
|
|
4532 Lisp_Object noseeum_copy_marker (Lisp_Object, Lisp_Object);
|
|
4533 Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
|
|
4534 #ifdef MEMORY_USAGE_STATS
|
|
4535 int compute_buffer_marker_usage (struct buffer *, struct overhead_stats *);
|
|
4536 #endif
|
771
|
4537 void init_buffer_markers (struct buffer *b);
|
|
4538 void uninit_buffer_markers (struct buffer *b);
|
428
|
4539
|
|
4540 /* Defined in minibuf.c */
|
|
4541 extern int minibuf_level;
|
867
|
4542 Charcount scmp_1 (const Ibyte *, const Ibyte *, Charcount, int);
|
428
|
4543 #define scmp(s1, s2, len) scmp_1 (s1, s2, len, completion_ignore_case)
|
|
4544 extern int completion_ignore_case;
|
867
|
4545 int regexp_ignore_completion_p (const Ibyte *, Lisp_Object,
|
428
|
4546 Bytecount, Bytecount);
|
|
4547 Lisp_Object clear_echo_area (struct frame *, Lisp_Object, int);
|
|
4548 Lisp_Object clear_echo_area_from_print (struct frame *, Lisp_Object, int);
|
867
|
4549 void echo_area_append (struct frame *, const Ibyte *, Lisp_Object,
|
428
|
4550 Bytecount, Bytecount, Lisp_Object);
|
867
|
4551 void echo_area_message (struct frame *, const Ibyte *, Lisp_Object,
|
428
|
4552 Bytecount, Bytecount, Lisp_Object);
|
|
4553 Lisp_Object echo_area_status (struct frame *);
|
|
4554 int echo_area_active (struct frame *);
|
|
4555 Lisp_Object echo_area_contents (struct frame *);
|
867
|
4556 void message_internal (const Ibyte *, Lisp_Object, Bytecount, Bytecount);
|
|
4557 void message_append_internal (const Ibyte *, Lisp_Object,
|
428
|
4558 Bytecount, Bytecount);
|
1632
|
4559 MODULE_API void message (const char *, ...) PRINTF_ARGS (1, 2);
|
442
|
4560 void message_append (const char *, ...) PRINTF_ARGS (1, 2);
|
|
4561 void message_no_translate (const char *, ...) PRINTF_ARGS (1, 2);
|
428
|
4562 void clear_message (void);
|
|
4563
|
771
|
4564 /* Defined in mule-charset.c */
|
826
|
4565 EXFUN (Fmake_charset, 3);
|
|
4566
|
771
|
4567 extern Lisp_Object Ql2r, Qr2l;
|
|
4568
|
428
|
4569 /* Defined in print.c */
|
826
|
4570 EXFUN (Fdisplay_error, 2);
|
|
4571 EXFUN (Ferror_message_string, 1);
|
|
4572 EXFUN (Fprin1, 2);
|
|
4573 EXFUN (Fprin1_to_string, 2);
|
|
4574 EXFUN (Fprinc, 2);
|
|
4575 EXFUN (Fprint, 2);
|
|
4576
|
771
|
4577
|
|
4578 /* Lower-level ways to output data: */
|
|
4579 void print_internal (Lisp_Object, Lisp_Object, int);
|
428
|
4580 void debug_print (Lisp_Object);
|
1204
|
4581 void debug_p4 (Lisp_Object obj);
|
|
4582 void debug_p3 (Lisp_Object obj);
|
|
4583 void debug_short_backtrace (int);
|
|
4584 void debug_backtrace (void);
|
428
|
4585 /* NOTE: Do not call this with the data of a Lisp_String. Use princ.
|
|
4586 * Note: stream should be defaulted before calling
|
|
4587 * (eg Qnil means stdout, not Vstandard_output, etc) */
|
1632
|
4588 MODULE_API void write_c_string (Lisp_Object stream, const CIbyte *str);
|
771
|
4589 /* Same goes for this function. */
|
1632
|
4590 MODULE_API void write_string (Lisp_Object stream, const Ibyte *str);
|
428
|
4591 /* Same goes for this function. */
|
867
|
4592 void write_string_1 (Lisp_Object stream, const Ibyte *str, Bytecount size);
|
826
|
4593 void write_eistring (Lisp_Object stream, const Eistring *ei);
|
771
|
4594
|
|
4595 /* Higher-level (printf-style) ways to output data: */
|
1632
|
4596 MODULE_API void write_fmt_string (Lisp_Object stream, const CIbyte *fmt, ...);
|
|
4597 MODULE_API void write_fmt_string_lisp (Lisp_Object stream, const CIbyte *fmt,
|
|
4598 int nargs, ...);
|
867
|
4599 void stderr_out (const CIbyte *, ...) PRINTF_ARGS (1, 2);
|
|
4600 void stderr_out_lisp (const CIbyte *, int nargs, ...);
|
|
4601 void stdout_out (const CIbyte *, ...) PRINTF_ARGS (1, 2);
|
1346
|
4602 void external_out (int dest, const CIbyte *fmt, ...) PRINTF_ARGS (2, 3);
|
867
|
4603 void debug_out (const CIbyte *, ...) PRINTF_ARGS (1, 2);
|
|
4604 DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (const CIbyte *,
|
771
|
4605 ...), 1, 2);
|
|
4606
|
|
4607 /* Internal functions: */
|
1261
|
4608 Lisp_Object canonicalize_printcharfun (Lisp_Object printcharfun);
|
771
|
4609 void temp_output_buffer_setup (Lisp_Object);
|
|
4610 void temp_output_buffer_show (Lisp_Object, Lisp_Object);
|
428
|
4611 void print_cons (Lisp_Object, Lisp_Object, int);
|
|
4612 void print_vector (Lisp_Object, Lisp_Object, int);
|
|
4613 void print_string (Lisp_Object, Lisp_Object, int);
|
771
|
4614 void print_symbol (Lisp_Object, Lisp_Object, int);
|
|
4615 void print_float (Lisp_Object, Lisp_Object, int);
|
603
|
4616 /* The number of bytes required to store the decimal printed
|
|
4617 representation of an integral type. Add a few bytes for truncation,
|
|
4618 optional sign prefix, and null byte terminator.
|
614
|
4619 2.40824 == log (256) / log (10).
|
|
4620
|
|
4621 We don't use floating point since Sun cc (buggily?) cannot use
|
|
4622 floating point computations to define a compile-time integral
|
|
4623 constant. */
|
603
|
4624 #define DECIMAL_PRINT_SIZE(integral_type) \
|
614
|
4625 (((2410824 * sizeof (integral_type)) / 1000000) + 3)
|
577
|
4626 void long_to_string (char *, long);
|
428
|
4627 extern int print_escape_newlines;
|
1632
|
4628 extern MODULE_API int print_readably;
|
428
|
4629 Lisp_Object internal_with_output_to_temp_buffer (Lisp_Object,
|
|
4630 Lisp_Object (*) (Lisp_Object),
|
|
4631 Lisp_Object, Lisp_Object);
|
|
4632 void float_to_string (char *, double);
|
|
4633 void internal_object_printer (Lisp_Object, Lisp_Object, int);
|
|
4634
|
|
4635 /* Defined in rangetab.c */
|
826
|
4636 EXFUN (Fclear_range_table, 1);
|
|
4637 EXFUN (Fget_range_table, 3);
|
|
4638 EXFUN (Fmake_range_table, 0);
|
|
4639 EXFUN (Fput_range_table, 4);
|
|
4640
|
428
|
4641 void put_range_table (Lisp_Object, EMACS_INT, EMACS_INT, Lisp_Object);
|
|
4642 int unified_range_table_bytes_needed (Lisp_Object);
|
|
4643 int unified_range_table_bytes_used (void *);
|
|
4644 void unified_range_table_copy_data (Lisp_Object, void *);
|
|
4645 Lisp_Object unified_range_table_lookup (void *, EMACS_INT, Lisp_Object);
|
|
4646 int unified_range_table_nentries (void *);
|
|
4647 void unified_range_table_get_range (void *, int, EMACS_INT *, EMACS_INT *,
|
|
4648 Lisp_Object *);
|
|
4649
|
|
4650 /* Defined in search.c */
|
826
|
4651 EXFUN (Fmatch_beginning, 1);
|
|
4652 EXFUN (Fmatch_end, 1);
|
|
4653 EXFUN (Fskip_chars_backward, 3);
|
|
4654 EXFUN (Fskip_chars_forward, 3);
|
|
4655 EXFUN (Fstring_match, 4);
|
|
4656
|
428
|
4657 struct re_pattern_buffer;
|
|
4658 struct re_registers;
|
867
|
4659 Charbpos scan_buffer (struct buffer *, Ichar, Charbpos, Charbpos, EMACS_INT,
|
826
|
4660 EMACS_INT *, int);
|
665
|
4661 Charbpos find_next_newline (struct buffer *, Charbpos, int);
|
|
4662 Charbpos find_next_newline_no_quit (struct buffer *, Charbpos, int);
|
826
|
4663 Bytebpos byte_find_next_newline_no_quit (struct buffer *, Bytebpos, int);
|
867
|
4664 Bytecount byte_find_next_ichar_in_string (Lisp_Object, Ichar, Bytecount,
|
826
|
4665 EMACS_INT);
|
665
|
4666 Charbpos find_before_next_newline (struct buffer *, Charbpos, Charbpos, int);
|
826
|
4667 struct re_pattern_buffer *compile_pattern (Lisp_Object pattern,
|
|
4668 struct re_registers *regp,
|
|
4669 Lisp_Object translate,
|
|
4670 Lisp_Object searchobj,
|
|
4671 struct buffer *searchbuf,
|
|
4672 int posix, Error_Behavior errb);
|
867
|
4673 Bytecount fast_string_match (Lisp_Object, const Ibyte *,
|
428
|
4674 Lisp_Object, Bytecount,
|
578
|
4675 Bytecount, int, Error_Behavior, int);
|
428
|
4676 Bytecount fast_lisp_string_match (Lisp_Object, Lisp_Object);
|
507
|
4677 extern Fixnum warn_about_possibly_incompatible_back_references;
|
502
|
4678
|
428
|
4679
|
|
4680 /* Defined in signal.c */
|
|
4681 void init_interrupts_late (void);
|
|
4682
|
|
4683 /* Defined in sound.c */
|
826
|
4684 EXFUN (Fding, 3);
|
|
4685
|
428
|
4686 void init_device_sound (struct device *);
|
563
|
4687 DECLARE_DOESNT_RETURN (report_sound_error (const Char_ASCII *, Lisp_Object));
|
428
|
4688
|
|
4689 /* Defined in specifier.c */
|
826
|
4690 EXFUN (Fadd_spec_to_specifier, 5);
|
|
4691 EXFUN (Fspecifier_spec_list, 4);
|
|
4692
|
428
|
4693 Lisp_Object specifier_instance (Lisp_Object, Lisp_Object, Lisp_Object,
|
578
|
4694 Error_Behavior, int, int, Lisp_Object);
|
428
|
4695 Lisp_Object specifier_instance_no_quit (Lisp_Object, Lisp_Object, Lisp_Object,
|
578
|
4696 Error_Behavior, int, Lisp_Object);
|
428
|
4697
|
|
4698 /* Defined in symbols.c */
|
826
|
4699 EXFUN (Fboundp, 1);
|
|
4700 EXFUN (Fbuilt_in_variable_type, 1);
|
|
4701 EXFUN (Fdefault_boundp, 1);
|
|
4702 EXFUN (Fdefault_value, 1);
|
|
4703 EXFUN (Ffboundp, 1);
|
|
4704 EXFUN (Ffset, 2);
|
|
4705 EXFUN (Fintern, 2);
|
|
4706 EXFUN (Fintern_soft, 2);
|
|
4707 EXFUN (Fkill_local_variable, 1);
|
|
4708 EXFUN (Fset, 2);
|
|
4709 EXFUN (Fset_default, 2);
|
|
4710 EXFUN (Fsymbol_function, 1);
|
|
4711 EXFUN (Fsymbol_name, 1);
|
|
4712 EXFUN (Fsymbol_plist, 1);
|
|
4713 EXFUN (Fsymbol_value, 1);
|
|
4714
|
867
|
4715 unsigned int hash_string (const Ibyte *, Bytecount);
|
|
4716 Lisp_Object intern_int (const Ibyte *str);
|
1632
|
4717 MODULE_API Lisp_Object intern (const CIbyte *str);
|
867
|
4718 Lisp_Object intern_converting_underscores_to_dashes (const CIbyte *str);
|
|
4719 Lisp_Object oblookup (Lisp_Object, const Ibyte *, Bytecount);
|
428
|
4720 void map_obarray (Lisp_Object, int (*) (Lisp_Object, void *), void *);
|
|
4721 Lisp_Object indirect_function (Lisp_Object, int);
|
|
4722 Lisp_Object symbol_value_in_buffer (Lisp_Object, Lisp_Object);
|
|
4723 void kill_buffer_local_variables (struct buffer *);
|
|
4724 int symbol_value_buffer_local_info (Lisp_Object, struct buffer *);
|
|
4725 Lisp_Object find_symbol_value (Lisp_Object);
|
|
4726 Lisp_Object find_symbol_value_quickly (Lisp_Object, int);
|
|
4727 Lisp_Object top_level_value (Lisp_Object);
|
|
4728 void reject_constant_symbols (Lisp_Object sym, Lisp_Object newval,
|
|
4729 int function_p,
|
|
4730 Lisp_Object follow_past_lisp_magic);
|
|
4731
|
|
4732 /* Defined in syntax.c */
|
665
|
4733 Charbpos scan_words (struct buffer *, Charbpos, int);
|
826
|
4734 EXFUN (Fchar_syntax, 2);
|
|
4735 EXFUN (Fforward_word, 2);
|
|
4736 extern Lisp_Object Vstandard_syntax_table;
|
|
4737 void signal_syntax_table_extent_changed (EXTENT extent);
|
|
4738 void signal_syntax_table_extent_adjust (struct buffer *buf);
|
|
4739 void init_buffer_syntax_cache (struct buffer *buf);
|
|
4740 void mark_buffer_syntax_cache (struct buffer *buf);
|
|
4741 void uninit_buffer_syntax_cache (struct buffer *buf);
|
|
4742 extern Lisp_Object Qsyntax_table;
|
428
|
4743
|
771
|
4744 /* Defined in sysdep.c */
|
|
4745 long get_random (void);
|
|
4746 void seed_random (long arg);
|
|
4747
|
|
4748 /* Defined in text.c */
|
867
|
4749 void find_charsets_in_ibyte_string (unsigned char *charsets,
|
|
4750 const Ibyte *str,
|
771
|
4751 Bytecount len);
|
867
|
4752 void find_charsets_in_ichar_string (unsigned char *charsets,
|
|
4753 const Ichar *str,
|
771
|
4754 Charcount len);
|
867
|
4755 int ibyte_string_displayed_columns (const Ibyte *str, Bytecount len);
|
|
4756 int ichar_string_displayed_columns (const Ichar *str, Charcount len);
|
|
4757 Charcount ibyte_string_nonascii_chars (const Ibyte *str, Bytecount len);
|
|
4758 void convert_ibyte_string_into_ichar_dynarr (const Ibyte *str,
|
771
|
4759 Bytecount len,
|
867
|
4760 Ichar_dynarr *dyn);
|
|
4761 Charcount convert_ibyte_string_into_ichar_string (const Ibyte *str,
|
771
|
4762 Bytecount len,
|
867
|
4763 Ichar *arr);
|
|
4764 void convert_ichar_string_into_ibyte_dynarr (Ichar *arr, int nels,
|
|
4765 Ibyte_dynarr *dyn);
|
|
4766 Ibyte *convert_ichar_string_into_malloced_string (Ichar *arr, int nels,
|
771
|
4767 Bytecount *len_out);
|
867
|
4768 Bytecount copy_text_between_formats (const Ibyte *src, Bytecount srclen,
|
826
|
4769 Internal_Format srcfmt,
|
|
4770 Lisp_Object srcobj,
|
867
|
4771 Ibyte *dst, Bytecount dstlen,
|
826
|
4772 Internal_Format dstfmt,
|
|
4773 Lisp_Object dstobj,
|
|
4774 Bytecount *src_used);
|
|
4775 Bytecount copy_buffer_text_out (struct buffer *buf, Bytebpos pos,
|
867
|
4776 Bytecount len, Ibyte *dst, Bytecount dstlen,
|
826
|
4777 Internal_Format dstfmt, Lisp_Object dstobj,
|
|
4778 Bytecount *src_used);
|
771
|
4779
|
|
4780 /* flags for get_buffer_pos_char(), get_buffer_range_char(), etc. */
|
|
4781 /* At most one of GB_COERCE_RANGE and GB_NO_ERROR_IF_BAD should be
|
|
4782 specified. At most one of GB_NEGATIVE_FROM_END and GB_NO_ERROR_IF_BAD
|
|
4783 should be specified. */
|
|
4784
|
|
4785 #define GB_ALLOW_PAST_ACCESSIBLE (1 << 0)
|
|
4786 #define GB_ALLOW_NIL (1 << 1)
|
|
4787 #define GB_CHECK_ORDER (1 << 2)
|
|
4788 #define GB_COERCE_RANGE (1 << 3)
|
|
4789 #define GB_NO_ERROR_IF_BAD (1 << 4)
|
|
4790 #define GB_NEGATIVE_FROM_END (1 << 5)
|
|
4791 #define GB_HISTORICAL_STRING_BEHAVIOR (GB_NEGATIVE_FROM_END | GB_ALLOW_NIL)
|
|
4792
|
|
4793 Charbpos get_buffer_pos_char (struct buffer *b, Lisp_Object pos,
|
|
4794 unsigned int flags);
|
|
4795 Bytebpos get_buffer_pos_byte (struct buffer *b, Lisp_Object pos,
|
|
4796 unsigned int flags);
|
|
4797 void get_buffer_range_char (struct buffer *b, Lisp_Object from, Lisp_Object to,
|
|
4798 Charbpos *from_out, Charbpos *to_out,
|
|
4799 unsigned int flags);
|
|
4800 void get_buffer_range_byte (struct buffer *b, Lisp_Object from, Lisp_Object to,
|
|
4801 Bytebpos *from_out, Bytebpos *to_out,
|
|
4802 unsigned int flags);
|
|
4803 Charcount get_string_pos_char (Lisp_Object string, Lisp_Object pos,
|
|
4804 unsigned int flags);
|
|
4805 Bytecount get_string_pos_byte (Lisp_Object string, Lisp_Object pos,
|
|
4806 unsigned int flags);
|
|
4807 void get_string_range_char (Lisp_Object string, Lisp_Object from,
|
|
4808 Lisp_Object to, Charcount *from_out,
|
|
4809 Charcount *to_out, unsigned int flags);
|
|
4810 void get_string_range_byte (Lisp_Object string, Lisp_Object from,
|
|
4811 Lisp_Object to, Bytecount *from_out,
|
|
4812 Bytecount *to_out, unsigned int flags);
|
826
|
4813 Charxpos get_buffer_or_string_pos_char (Lisp_Object object, Lisp_Object pos,
|
|
4814 unsigned int flags);
|
|
4815 Bytexpos get_buffer_or_string_pos_byte (Lisp_Object object, Lisp_Object pos,
|
|
4816 unsigned int flags);
|
771
|
4817 void get_buffer_or_string_range_char (Lisp_Object object, Lisp_Object from,
|
826
|
4818 Lisp_Object to, Charxpos *from_out,
|
|
4819 Charxpos *to_out, unsigned int flags);
|
771
|
4820 void get_buffer_or_string_range_byte (Lisp_Object object, Lisp_Object from,
|
826
|
4821 Lisp_Object to, Bytexpos *from_out,
|
|
4822 Bytexpos *to_out, unsigned int flags);
|
|
4823 Charxpos buffer_or_string_accessible_begin_char (Lisp_Object object);
|
|
4824 Charxpos buffer_or_string_accessible_end_char (Lisp_Object object);
|
|
4825 Bytexpos buffer_or_string_accessible_begin_byte (Lisp_Object object);
|
|
4826 Bytexpos buffer_or_string_accessible_end_byte (Lisp_Object object);
|
|
4827 Charxpos buffer_or_string_absolute_begin_char (Lisp_Object object);
|
|
4828 Charxpos buffer_or_string_absolute_end_char (Lisp_Object object);
|
|
4829 Bytexpos buffer_or_string_absolute_begin_byte (Lisp_Object object);
|
|
4830 Bytexpos buffer_or_string_absolute_end_byte (Lisp_Object object);
|
|
4831 Charbpos charbpos_clip_to_bounds (Charbpos lower, Charbpos num,
|
|
4832 Charbpos upper);
|
|
4833 Bytebpos bytebpos_clip_to_bounds (Bytebpos lower, Bytebpos num,
|
|
4834 Bytebpos upper);
|
|
4835 Charxpos charxpos_clip_to_bounds (Charxpos lower, Charxpos num,
|
|
4836 Charxpos upper);
|
|
4837 Bytexpos bytexpos_clip_to_bounds (Bytexpos lower, Bytexpos num,
|
|
4838 Bytexpos upper);
|
|
4839 Charxpos buffer_or_string_clip_to_accessible_char (Lisp_Object object,
|
|
4840 Charxpos pos);
|
|
4841 Bytexpos buffer_or_string_clip_to_accessible_byte (Lisp_Object object,
|
|
4842 Bytexpos pos);
|
|
4843 Charxpos buffer_or_string_clip_to_absolute_char (Lisp_Object object,
|
|
4844 Charxpos pos);
|
|
4845 Bytexpos buffer_or_string_clip_to_absolute_byte (Lisp_Object object,
|
|
4846 Bytexpos pos);
|
|
4847
|
771
|
4848
|
|
4849 #ifdef ENABLE_COMPOSITE_CHARS
|
|
4850
|
867
|
4851 Ichar lookup_composite_char (Ibyte *str, int len);
|
|
4852 Lisp_Object composite_char_string (Ichar ch);
|
771
|
4853 #endif /* ENABLE_COMPOSITE_CHARS */
|
|
4854
|
|
4855 EXFUN (Ffind_charset, 1);
|
|
4856 EXFUN (Fget_charset, 1);
|
|
4857 EXFUN (Fcharset_list, 0);
|
|
4858
|
|
4859 extern Lisp_Object Vcharset_ascii;
|
|
4860 extern Lisp_Object Vcharset_control_1;
|
|
4861 extern Lisp_Object Vcharset_latin_iso8859_1;
|
|
4862 extern Lisp_Object Vcharset_latin_iso8859_2;
|
|
4863 extern Lisp_Object Vcharset_latin_iso8859_3;
|
|
4864 extern Lisp_Object Vcharset_latin_iso8859_4;
|
|
4865 extern Lisp_Object Vcharset_thai_tis620;
|
|
4866 extern Lisp_Object Vcharset_greek_iso8859_7;
|
|
4867 extern Lisp_Object Vcharset_arabic_iso8859_6;
|
|
4868 extern Lisp_Object Vcharset_hebrew_iso8859_8;
|
|
4869 extern Lisp_Object Vcharset_katakana_jisx0201;
|
|
4870 extern Lisp_Object Vcharset_latin_jisx0201;
|
|
4871 extern Lisp_Object Vcharset_cyrillic_iso8859_5;
|
|
4872 extern Lisp_Object Vcharset_latin_iso8859_9;
|
|
4873 extern Lisp_Object Vcharset_japanese_jisx0208_1978;
|
|
4874 extern Lisp_Object Vcharset_chinese_gb2312;
|
|
4875 extern Lisp_Object Vcharset_japanese_jisx0208;
|
|
4876 extern Lisp_Object Vcharset_korean_ksc5601;
|
|
4877 extern Lisp_Object Vcharset_japanese_jisx0212;
|
|
4878 extern Lisp_Object Vcharset_chinese_cns11643_1;
|
|
4879 extern Lisp_Object Vcharset_chinese_cns11643_2;
|
|
4880 extern Lisp_Object Vcharset_chinese_big5_1;
|
|
4881 extern Lisp_Object Vcharset_chinese_big5_2;
|
|
4882 extern Lisp_Object Vcharset_composite;
|
|
4883
|
867
|
4884 Ichar Lstream_get_ichar_1 (Lstream *stream, int first_char);
|
|
4885 int Lstream_fput_ichar (Lstream *stream, Ichar ch);
|
|
4886 void Lstream_funget_ichar (Lstream *stream, Ichar ch);
|
|
4887
|
|
4888 DECLARE_INLINE_HEADER (Ibyte *qxestrdup (const Ibyte *s))
|
771
|
4889 {
|
867
|
4890 return (Ibyte *) xstrdup ((const char *) s);
|
771
|
4891 }
|
|
4892
|
867
|
4893 DECLARE_INLINE_HEADER (Bytecount qxestrlen (const Ibyte *s))
|
771
|
4894 {
|
|
4895 return strlen ((const char *) s);
|
|
4896 }
|
|
4897
|
867
|
4898 DECLARE_INLINE_HEADER (Charcount qxestrcharlen (const Ibyte *s))
|
771
|
4899 {
|
|
4900 return bytecount_to_charcount (s, qxestrlen (s));
|
|
4901 }
|
|
4902
|
867
|
4903 DECLARE_INLINE_HEADER (int qxestrcmp (const Ibyte *s1,
|
|
4904 const Ibyte *s2))
|
771
|
4905 {
|
|
4906 return strcmp ((const char *) s1, (const char *) s2);
|
|
4907 }
|
|
4908
|
867
|
4909 DECLARE_INLINE_HEADER (int qxestrcmp_c (const Ibyte *s1,
|
771
|
4910 const char *s2))
|
|
4911 {
|
|
4912 return strcmp ((const char *) s1, s2);
|
|
4913 }
|
|
4914
|
867
|
4915 DECLARE_INLINE_HEADER (int qxestrncmp (const Ibyte *string1,
|
|
4916 const Ibyte *string2,
|
771
|
4917 Bytecount count))
|
|
4918 {
|
|
4919 return strncmp ((const char *) string1, (const char *) string2,
|
|
4920 (size_t) count);
|
|
4921 }
|
|
4922
|
867
|
4923 DECLARE_INLINE_HEADER (int qxestrncmp_c (const Ibyte *string1,
|
771
|
4924 const char *string2,
|
|
4925 Bytecount count))
|
|
4926 {
|
|
4927 return strncmp ((const char *) string1, string2, (size_t) count);
|
|
4928 }
|
|
4929
|
867
|
4930 DECLARE_INLINE_HEADER (Ibyte *qxestrcpy (Ibyte *strDest,
|
|
4931 const Ibyte *strSource))
|
771
|
4932 {
|
867
|
4933 return (Ibyte *) strcpy ((char *) strDest, (const char *) strSource);
|
771
|
4934 }
|
|
4935
|
867
|
4936 DECLARE_INLINE_HEADER (Ibyte *qxestrcpy_c (Ibyte *strDest,
|
771
|
4937 const char *strSource))
|
|
4938 {
|
867
|
4939 return (Ibyte *) strcpy ((char *) strDest, strSource);
|
771
|
4940 }
|
|
4941
|
867
|
4942 DECLARE_INLINE_HEADER (Ibyte *qxestrncpy (Ibyte *strDest,
|
|
4943 const Ibyte *strSource,
|
771
|
4944 Bytecount count))
|
|
4945 {
|
867
|
4946 return (Ibyte *) strncpy ((char *) strDest, (const char *) strSource,
|
771
|
4947 (size_t) count);
|
|
4948 }
|
|
4949
|
867
|
4950 DECLARE_INLINE_HEADER (Ibyte *qxestrncpy_c (Ibyte *strDest,
|
771
|
4951 const char *strSource,
|
|
4952 Bytecount count))
|
|
4953 {
|
867
|
4954 return (Ibyte *) strncpy ((char *) strDest, strSource, (size_t) count);
|
771
|
4955 }
|
|
4956
|
867
|
4957 DECLARE_INLINE_HEADER (Ibyte *qxestrcat (Ibyte *strDest,
|
|
4958 const Ibyte *strSource))
|
771
|
4959 {
|
867
|
4960 return (Ibyte *) strcat ((char *) strDest, (const char *) strSource);
|
771
|
4961 }
|
|
4962
|
867
|
4963 DECLARE_INLINE_HEADER (Ibyte *qxestrcat_c (Ibyte *strDest,
|
771
|
4964 const char *strSource))
|
|
4965 {
|
867
|
4966 return (Ibyte *) strcat ((char *) strDest, strSource);
|
771
|
4967 }
|
|
4968
|
867
|
4969 DECLARE_INLINE_HEADER (Ibyte *qxestrncat (Ibyte *strDest,
|
|
4970 const Ibyte *strSource,
|
771
|
4971 Bytecount count))
|
|
4972 {
|
867
|
4973 return (Ibyte *) strncat ((char *) strDest, (const char *) strSource,
|
771
|
4974 (size_t) count);
|
|
4975 }
|
|
4976
|
867
|
4977 DECLARE_INLINE_HEADER (Ibyte *qxestrncat_c (Ibyte *strDest,
|
771
|
4978 const char *strSource,
|
|
4979 Bytecount count))
|
|
4980 {
|
867
|
4981 return (Ibyte *) strncat ((char *) strDest, strSource, (size_t) count);
|
771
|
4982 }
|
|
4983
|
867
|
4984 DECLARE_INLINE_HEADER (Ibyte *qxestrchr (const Ibyte *s, Ichar c))
|
771
|
4985 {
|
|
4986 assert (c >= 0 && c <= 255);
|
867
|
4987 return (Ibyte *) strchr ((const char *) s, c);
|
771
|
4988 }
|
|
4989
|
867
|
4990 DECLARE_INLINE_HEADER (Ibyte *qxestrrchr (const Ibyte *s, Ichar c))
|
771
|
4991 {
|
|
4992 assert (c >= 0 && c <= 255);
|
867
|
4993 return (Ibyte *) strrchr ((const char *) s, c);
|
771
|
4994 }
|
|
4995
|
867
|
4996 DECLARE_INLINE_HEADER (Ibyte *qxestrstr (const Ibyte *string1,
|
|
4997 const Ibyte *string2))
|
771
|
4998 {
|
867
|
4999 return (Ibyte *) strstr ((const char *) string1, (const char *) string2);
|
771
|
5000 }
|
|
5001
|
867
|
5002 DECLARE_INLINE_HEADER (Bytecount qxestrcspn (const Ibyte *string,
|
|
5003 const CIbyte *strCharSet))
|
771
|
5004 {
|
|
5005 return (Bytecount) strcspn ((const char *) string, strCharSet);
|
|
5006 }
|
|
5007
|
867
|
5008 DECLARE_INLINE_HEADER (Bytecount qxestrspn (const Ibyte *string,
|
|
5009 const CIbyte *strCharSet))
|
771
|
5010 {
|
|
5011 return (Bytecount) strspn ((const char *) string, strCharSet);
|
|
5012 }
|
|
5013
|
867
|
5014 DECLARE_INLINE_HEADER (Ibyte *qxestrpbrk (const Ibyte *string,
|
|
5015 const CIbyte *strCharSet))
|
771
|
5016 {
|
867
|
5017 return (Ibyte *) strpbrk ((const char *) string, strCharSet);
|
771
|
5018 }
|
|
5019
|
867
|
5020 DECLARE_INLINE_HEADER (Ibyte *qxestrtok (Ibyte *strToken,
|
|
5021 const CIbyte *strDelimit))
|
771
|
5022 {
|
867
|
5023 return (Ibyte *) strtok ((char *) strToken, strDelimit);
|
771
|
5024 }
|
|
5025
|
867
|
5026 DECLARE_INLINE_HEADER (double qxestrtod (const Ibyte *nptr,
|
|
5027 Ibyte **endptr))
|
771
|
5028 {
|
|
5029 return strtod ((const char *) nptr, (char **) endptr);
|
|
5030 }
|
|
5031
|
867
|
5032 DECLARE_INLINE_HEADER (long qxestrtol (const Ibyte *nptr, Ibyte **endptr,
|
771
|
5033 int base))
|
|
5034 {
|
|
5035 return strtol ((const char *) nptr, (char **) endptr, base);
|
|
5036 }
|
|
5037
|
867
|
5038 DECLARE_INLINE_HEADER (unsigned long qxestrtoul (const Ibyte *nptr,
|
|
5039 Ibyte **endptr,
|
771
|
5040 int base))
|
|
5041 {
|
|
5042 return strtoul ((const char *) nptr, (char **) endptr, base);
|
|
5043 }
|
|
5044
|
867
|
5045 DECLARE_INLINE_HEADER (int qxeatoi (const Ibyte *string))
|
771
|
5046 {
|
|
5047 return atoi ((const char *) string);
|
|
5048 }
|
|
5049
|
1204
|
5050 DECLARE_INLINE_HEADER (Ibyte *qxestrupr (Ibyte *s))
|
|
5051 {
|
|
5052 return (Ibyte *) strupr ((char *) s);
|
|
5053 }
|
|
5054
|
|
5055 DECLARE_INLINE_HEADER (Ibyte *qxestrlwr (Ibyte *s))
|
|
5056 {
|
|
5057 return (Ibyte *) strlwr ((char *) s);
|
|
5058 }
|
|
5059
|
867
|
5060 int qxesprintf (Ibyte *buffer, const CIbyte *format, ...)
|
771
|
5061 PRINTF_ARGS (2, 3);
|
|
5062
|
|
5063 /* Do not use POSIX locale routines. Not Mule-correct. */
|
|
5064 #define qxestrcoll DO NOT USE.
|
|
5065 #define qxestrxfrm DO NOT USE.
|
|
5066
|
867
|
5067 int qxestrcasecmp (const Ibyte *s1, const Ibyte *s2);
|
|
5068 int qxestrcasecmp_c (const Ibyte *s1, const Char_ASCII *s2);
|
|
5069 int qxestrcasecmp_i18n (const Ibyte *s1, const Ibyte *s2);
|
771
|
5070 int ascii_strcasecmp (const Char_ASCII *s1, const Char_ASCII *s2);
|
|
5071 int lisp_strcasecmp (Lisp_Object s1, Lisp_Object s2);
|
|
5072 int lisp_strcasecmp_i18n (Lisp_Object s1, Lisp_Object s2);
|
867
|
5073 int qxestrncasecmp (const Ibyte *s1, const Ibyte *s2, Bytecount len);
|
|
5074 int qxestrncasecmp_c (const Ibyte *s1, const Char_ASCII *s2, Bytecount len);
|
|
5075 int qxestrncasecmp_i18n (const Ibyte *s1, const Ibyte *s2, Bytecount len);
|
771
|
5076 int ascii_strncasecmp (const Char_ASCII *s1, const Char_ASCII *s2,
|
|
5077 Bytecount len);
|
867
|
5078 int qxememcmp (const Ibyte *s1, const Ibyte *s2, Bytecount len);
|
|
5079 int qxememcmp4 (const Ibyte *s1, Bytecount len1,
|
|
5080 const Ibyte *s2, Bytecount len2);
|
|
5081 int qxememcasecmp (const Ibyte *s1, const Ibyte *s2, Bytecount len);
|
|
5082 int qxememcasecmp4 (const Ibyte *s1, Bytecount len1,
|
|
5083 const Ibyte *s2, Bytecount len2);
|
|
5084 int qxetextcmp (const Ibyte *s1, Bytecount len1,
|
|
5085 const Ibyte *s2, Bytecount len2);
|
|
5086 int qxetextcmp_matching (const Ibyte *s1, Bytecount len1,
|
|
5087 const Ibyte *s2, Bytecount len2,
|
801
|
5088 Charcount *matching);
|
867
|
5089 int qxetextcasecmp (const Ibyte *s1, Bytecount len1,
|
|
5090 const Ibyte *s2, Bytecount len2);
|
|
5091 int qxetextcasecmp_matching (const Ibyte *s1, Bytecount len1,
|
|
5092 const Ibyte *s2, Bytecount len2,
|
801
|
5093 Charcount *matching);
|
771
|
5094
|
|
5095 void buffer_mule_signal_inserted_region (struct buffer *buf, Charbpos start,
|
|
5096 Bytecount bytelength,
|
|
5097 Charcount charlength);
|
|
5098 void buffer_mule_signal_deleted_region (struct buffer *buf, Charbpos start,
|
826
|
5099 Charbpos end, Bytebpos byte_start,
|
|
5100 Bytebpos byte_end);
|
771
|
5101
|
|
5102 /* Defined in unicode.c */
|
1204
|
5103 extern const struct sized_memory_description to_unicode_description;
|
|
5104 extern const struct sized_memory_description from_unicode_description;
|
771
|
5105 void init_charset_unicode_tables (Lisp_Object charset);
|
|
5106 void free_charset_unicode_tables (Lisp_Object charset);
|
|
5107 void recalculate_unicode_precedence (void);
|
|
5108 extern Lisp_Object Qunicode;
|
|
5109 extern Lisp_Object Qutf_16, Qutf_8, Qucs_4, Qutf_7;
|
|
5110 #ifdef MEMORY_USAGE_STATS
|
|
5111 Bytecount compute_from_unicode_table_size (Lisp_Object charset,
|
|
5112 struct overhead_stats *stats);
|
|
5113 Bytecount compute_to_unicode_table_size (Lisp_Object charset,
|
|
5114 struct overhead_stats *stats);
|
|
5115 #endif /* MEMORY_USAGE_STATS */
|
|
5116
|
428
|
5117 /* Defined in undo.c */
|
826
|
5118 EXFUN (Fundo_boundary, 0);
|
|
5119
|
428
|
5120 Lisp_Object truncate_undo_list (Lisp_Object, int, int);
|
|
5121 void record_extent (Lisp_Object, int);
|
665
|
5122 void record_insert (struct buffer *, Charbpos, Charcount);
|
|
5123 void record_delete (struct buffer *, Charbpos, Charcount);
|
|
5124 void record_change (struct buffer *, Charbpos, Charcount);
|
428
|
5125
|
|
5126 /* Defined in unex*.c */
|
814
|
5127 #ifdef WIN32_NATIVE
|
867
|
5128 int unexec (Ibyte *, Ibyte *, uintptr_t, uintptr_t, uintptr_t);
|
814
|
5129 #else
|
|
5130 int unexec (Extbyte *, Extbyte *, uintptr_t, uintptr_t, uintptr_t);
|
|
5131 #endif
|
428
|
5132 #ifdef RUN_TIME_REMAP
|
|
5133 int run_time_remap (char *);
|
|
5134 #endif
|
|
5135
|
|
5136 /* Defined in vm-limit.c */
|
442
|
5137 void memory_warnings (void *, void (*) (const char *));
|
428
|
5138
|
442
|
5139 /*--------------- prototypes for constant symbols ------------*/
|
|
5140
|
826
|
5141 /* #### We should get rid of this and put the prototypes back up there in
|
|
5142 #### the per-file stuff, where they belong. */
|
|
5143
|
771
|
5144 /* Use the following when you have to add a bunch of symbols. */
|
|
5145
|
|
5146 /*
|
|
5147
|
|
5148 (defun redo-symbols (beg end)
|
|
5149 "Snarf any symbols out of the region and print them into a temporary buffer,
|
|
5150 which is displayed when the function finishes. The symbols are laid out with
|
|
5151 `extern Lisp_Object ' before each one, with as many as can fit on one line
|
|
5152 \(the maximum line width is controlled by the constant `max-line-length' in the
|
|
5153 code)."
|
|
5154 (interactive "r")
|
|
5155 (save-excursion
|
|
5156 (goto-char beg)
|
|
5157 (let (syms)
|
|
5158 (while (re-search-forward "\\s-\\(Q[A-Za-z_0-9]+\\)" end t)
|
|
5159 (push (match-string 1) syms))
|
|
5160 (setq syms (sort syms #'string-lessp))
|
|
5161 (with-output-to-temp-buffer "*Symbols*"
|
|
5162 (let* ((col 0)
|
|
5163 (start "extern Lisp_Object ")
|
|
5164 (startlen (length start))
|
|
5165 ;; with a default-width frame of 80 chars, you can only fit
|
|
5166 ;; 79 before wrapping. you can see this to a lower value if
|
|
5167 ;; you don't want it right up against the right margin.
|
|
5168 (max-line-length 79))
|
|
5169 (dolist (sym syms)
|
|
5170 (cond (;; if something already on line (this will always be the
|
|
5171 ;; case except the very first iteration), see what
|
|
5172 ;; space we've got. (need to take into account 2
|
|
5173 ;; for the comma+space, 1 for the semicolon at the
|
|
5174 ;; end.) if enough space, do it.
|
|
5175 (and (> col 0) (< (+ col (length sym) 2)
|
|
5176 (1- max-line-length)))
|
|
5177 (princ ", ")
|
|
5178 (princ sym)
|
|
5179 (incf col 2)
|
|
5180 (incf col (length sym)))
|
|
5181 (t
|
|
5182 ;; either we're first iteration or we ran out of space.
|
|
5183 ;; if the latter, terminate the previous line. this
|
|
5184 ;; loop is written on purpose so that it always prints
|
|
5185 ;; at least one item, even if that would go over.
|
|
5186 (when (> col 0)
|
|
5187 (princ ";\n")
|
|
5188 (setq col 0))
|
|
5189 (princ start)
|
|
5190 (incf col startlen)
|
|
5191 (princ sym)
|
|
5192 (incf col (length sym)))))
|
|
5193 ;; finally terminate the last line.
|
|
5194 (princ ";\n"))))))
|
|
5195
|
|
5196 */
|
|
5197
|
814
|
5198 extern Lisp_Object Qactivate_menubar_hook, Qand_optional, Qand_rest;
|
|
5199 extern Lisp_Object Qarith_error, Qarrayp, Qautoload, Qbackground;
|
|
5200 extern Lisp_Object Qbackground_pixmap, Qbeginning_of_buffer, Qbitp, Qblinking;
|
|
5201 extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only;
|
|
5202 extern Lisp_Object Qbyte_code, Qcall_interactively, Qcategory_designator_p;
|
|
5203 extern Lisp_Object Qcategory_table_value_p, Qcdr, Qchar_or_string_p;
|
|
5204 extern Lisp_Object Qcharacterp, Qcircular_list, Qcircular_property_list;
|
|
5205 extern Lisp_Object Qcolor_pixmap_image_instance_p, Qcommandp;
|
|
5206 extern Lisp_Object Qcompletion_ignore_case, Qconsole_live_p, Qconst_specifier;
|
|
5207 extern Lisp_Object Qconversion_error, Qcurrent_menubar;
|
771
|
5208 extern Lisp_Object Qcyclic_variable_indirection, Qdefun, Qdevice_live_p, Qdim;
|
|
5209 extern Lisp_Object Qdirection, Qdisabled, Qdisabled_command_hook;
|
930
|
5210 extern Lisp_Object Qdisplay_table, Qdll_error, Qdomain_error, Qediting_error;
|
771
|
5211 extern Lisp_Object Qend_of_buffer, Qend_of_file, Qend_open, Qerror;
|
|
5212 extern Lisp_Object Qerror_conditions, Qerror_lacks_explanatory_string;
|
|
5213 extern Lisp_Object Qerror_message, Qevent_live_p, Qexit, Qextent_live_p;
|
996
|
5214 extern Lisp_Object Qexternal_debugging_output, Qfeaturep, Qfile_error;
|
|
5215 extern Lisp_Object Qfile_name_sans_extension, Qfinal;
|
1111
|
5216 extern Lisp_Object Qforeground, Qformat, Qframe_live_p, Qgraphic;
|
771
|
5217 extern Lisp_Object Qgui_error, Qicon_glyph_p, Qidentity, Qinhibit_quit;
|
|
5218 extern Lisp_Object Qinhibit_read_only, Qinteger_char_or_marker_p;
|
1632
|
5219 extern Lisp_Object Qinteger_or_char_p, Qinteger_or_marker_p;
|
|
5220 extern Lisp_Object Qinteractive, Qinternal_error;
|
771
|
5221 extern Lisp_Object Qinvalid_byte_code, Qinvalid_change, Qinvalid_constant;
|
|
5222 extern Lisp_Object Qinvalid_function, Qinvalid_operation;
|
|
5223 extern Lisp_Object Qinvalid_read_syntax, Qinvalid_state, Qio_error, Qlambda;
|
1111
|
5224 extern Lisp_Object Qlayout, Qlist_formation_error, Qlistp, Qload;
|
771
|
5225 extern Lisp_Object Qlong_name, Qmacro, Qmakunbound, Qmalformed_list;
|
996
|
5226 extern Lisp_Object Qmalformed_property_list, Qmark, Qmodule;
|
771
|
5227 extern Lisp_Object Qmono_pixmap_image_instance_p, Qmouse_leave_buffer_hook;
|
|
5228 extern Lisp_Object Qnative_layout, Qnatnump, Qnetwork_error, Qno_catch;
|
|
5229 extern Lisp_Object Qnothing_image_instance_p, Qnumber_char_or_marker_p;
|
1111
|
5230 extern Lisp_Object Qnumberp, Qout_of_memory;
|
442
|
5231 extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_p;
|
771
|
5232 extern Lisp_Object Qpointer_image_instance_p, Qprint_length;
|
563
|
5233 extern Lisp_Object Qprint_string_length, Qprinting_unreadable_object;
|
1632
|
5234 extern Lisp_Object Qprogn, Qquit, Qquote, Qrange_error;
|
771
|
5235 extern Lisp_Object Qread_char, Qread_from_minibuffer;
|
|
5236 extern Lisp_Object Qreally_early_error_handler, Qregion_beginning;
|
|
5237 extern Lisp_Object Qregion_end, Qregistry, Qreverse_direction_charset;
|
|
5238 extern Lisp_Object Qrun_hooks, Qsans_modifiers, Qsave_buffers_kill_emacs;
|
|
5239 extern Lisp_Object Qself_insert_command, Qself_insert_defer_undo, Qsequencep;
|
|
5240 extern Lisp_Object Qset, Qsetting_constant, Qshort_name, Qsingularity_error;
|
|
5241 extern Lisp_Object Qsound_error, Qstack_overflow, Qstandard_input;
|
|
5242 extern Lisp_Object Qstandard_output, Qstart_open, Qstring_lessp;
|
|
5243 extern Lisp_Object Qstructure_formation_error, Qsubwindow;
|
1632
|
5244 extern Lisp_Object Qsubwindow_image_instance_p;
|
771
|
5245 extern Lisp_Object Qtext_conversion_error, Qtext_image_instance_p, Qtop_level;
|
1632
|
5246 extern Lisp_Object Qtrue_list_p, Qunderflow_error, Qunderline;
|
771
|
5247 extern Lisp_Object Quser_files_and_directories, Qvalues;
|
|
5248 extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvoid_function;
|
|
5249 extern Lisp_Object Qvoid_variable, Qwindow_live_p, Qwrong_number_of_arguments;
|
442
|
5250 extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p;
|
|
5251
|
1632
|
5252 extern MODULE_API Lisp_Object Qintegerp, Qinvalid_argument, Qprocess_error;
|
|
5253 extern MODULE_API Lisp_Object Qsyntax_error, Qt, Qunbound;
|
|
5254
|
442
|
5255 #define SYMBOL(fou) extern Lisp_Object fou
|
1632
|
5256 #define SYMBOL_MODULE_API(fou) extern MODULE_API Lisp_Object fou
|
442
|
5257 #define SYMBOL_KEYWORD(la_cle_est_fou) extern Lisp_Object la_cle_est_fou
|
|
5258 #define SYMBOL_GENERAL(tout_le_monde, est_fou) \
|
|
5259 extern Lisp_Object tout_le_monde
|
|
5260
|
|
5261 #include "general-slots.h"
|
|
5262
|
|
5263 #undef SYMBOL
|
1632
|
5264 #undef SYMBOL_MODULE_API
|
442
|
5265 #undef SYMBOL_KEYWORD
|
|
5266 #undef SYMBOL_GENERAL
|
|
5267
|
|
5268 /*--------------- prototypes for variables of type Lisp_Object ------------*/
|
|
5269
|
826
|
5270 /* #### We should get rid of this and put the prototypes back up there in
|
|
5271 #### the per-file stuff, where they belong. */
|
|
5272
|
446
|
5273 extern Lisp_Object Vactivate_menubar_hook;
|
|
5274 extern Lisp_Object Vautoload_queue, Vblank_menubar;
|
771
|
5275 extern Lisp_Object Vcommand_history;
|
428
|
5276 extern Lisp_Object Vcommand_line_args, Vconfigure_info_directory;
|
|
5277 extern Lisp_Object Vconfigure_site_directory, Vconfigure_site_module_directory;
|
|
5278 extern Lisp_Object Vconsole_list, Vcontrolling_terminal;
|
|
5279 extern Lisp_Object Vcurrent_compiled_function_annotation, Vcurrent_load_list;
|
|
5280 extern Lisp_Object Vcurrent_mouse_event, Vcurrent_prefix_arg, Vdata_directory;
|
434
|
5281 extern Lisp_Object Vdirectory_sep_char, Vdisabled_command_hook;
|
|
5282 extern Lisp_Object Vdoc_directory, Vinternal_doc_file_name;
|
428
|
5283 extern Lisp_Object Vecho_area_buffer, Vemacs_major_version;
|
|
5284 extern Lisp_Object Vemacs_minor_version, Vexec_directory, Vexec_path;
|
|
5285 extern Lisp_Object Vexecuting_macro, Vfeatures, Vfile_domain;
|
771
|
5286 extern Lisp_Object Vinhibit_quit, Vinvocation_directory, Vinvocation_name;
|
|
5287 extern Lisp_Object Vlast_command, Vlast_command_char;
|
428
|
5288 extern Lisp_Object Vlast_command_event, Vlast_input_event;
|
|
5289 extern Lisp_Object Vload_file_name_internal;
|
|
5290 extern Lisp_Object Vload_file_name_internal_the_purecopy, Vload_history;
|
|
5291 extern Lisp_Object Vload_path, Vmark_even_if_inactive, Vmenubar_configuration;
|
|
5292 extern Lisp_Object Vminibuf_preprompt, Vminibuf_prompt, Vminibuffer_zero;
|
|
5293 extern Lisp_Object Vmodule_directory, Vmswindows_downcase_file_names;
|
|
5294 extern Lisp_Object Vmswindows_get_true_file_attributes, Vobarray;
|
|
5295 extern Lisp_Object Vprint_length, Vprint_level, Vprocess_environment;
|
|
5296 extern Lisp_Object Vquit_flag;
|
|
5297 extern Lisp_Object Vrecent_keys_ring, Vshell_file_name, Vsite_directory;
|
|
5298 extern Lisp_Object Vsite_module_directory;
|
|
5299 extern Lisp_Object Vstandard_input, Vstandard_output, Vstdio_str;
|
771
|
5300 extern Lisp_Object Vsynchronous_sounds, Vsystem_name;
|
428
|
5301 extern Lisp_Object Vthis_command_keys, Vunread_command_event;
|
|
5302 extern Lisp_Object Vx_initial_argv_list;
|
|
5303
|
1650
|
5304 #ifdef __cplusplus
|
|
5305 }
|
|
5306 #endif
|
|
5307
|
440
|
5308 #endif /* INCLUDED_lisp_h_ */
|