aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorEli Zaretskii2012-11-13 16:17:18 +0200
committerEli Zaretskii2012-11-13 16:17:18 +0200
commit3c4ca7155293ffc2d04708007131bcbc882d8913 (patch)
tree61787be8cd43b6fb3d5159852fbd186eea404de7 /src/lisp.h
parent5ade42a5114255c43117065494b96d480c1e1588 (diff)
parentc708524567662c8911c5ab2695acc7bda0383705 (diff)
downloademacs-3c4ca7155293ffc2d04708007131bcbc882d8913.tar.gz
emacs-3c4ca7155293ffc2d04708007131bcbc882d8913.zip
Merge from trunk.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h212
1 files changed, 93 insertions, 119 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 7746b4e313e..c909287b7cd 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -160,11 +160,9 @@ enum Lisp_Bits
160#define GCTYPEBITS 3 160#define GCTYPEBITS 3
161 GCTYPEBITS, 161 GCTYPEBITS,
162 162
163 /* 2**GCTYPEBITS. This must also be a macro that expands to a 163 /* 2**GCTYPEBITS. This must be a macro that expands to a literal
164 literal integer constant, for MSVC. */ 164 integer constant, for MSVC. */
165 GCALIGNMENT =
166#define GCALIGNMENT 8 165#define GCALIGNMENT 8
167 GCALIGNMENT,
168 166
169 /* Number of bits in a Lisp_Object value, not counting the tag. */ 167 /* Number of bits in a Lisp_Object value, not counting the tag. */
170 VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS, 168 VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS,
@@ -410,14 +408,11 @@ enum pvec_type
410 PVEC_WINDOW_CONFIGURATION, 408 PVEC_WINDOW_CONFIGURATION,
411 PVEC_SUBR, 409 PVEC_SUBR,
412 PVEC_OTHER, 410 PVEC_OTHER,
413 /* These last 4 are special because we OR them in fns.c:internal_equal, 411 /* These should be last, check internal_equal to see why. */
414 so they have to use a disjoint bit pattern: 412 PVEC_COMPILED,
415 if (!(size & (PVEC_COMPILED | PVEC_CHAR_TABLE 413 PVEC_CHAR_TABLE,
416 | PVEC_SUB_CHAR_TABLE | PVEC_FONT))) */ 414 PVEC_SUB_CHAR_TABLE,
417 PVEC_COMPILED = 0x10, 415 PVEC_FONT /* Should be last because it's used for range checking. */
418 PVEC_CHAR_TABLE = 0x20,
419 PVEC_SUB_CHAR_TABLE = 0x30,
420 PVEC_FONT = 0x40
421}; 416};
422 417
423/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers 418/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
@@ -437,9 +432,18 @@ enum More_Lisp_Bits
437 only the number of Lisp_Object fields (that need to be traced by GC). 432 only the number of Lisp_Object fields (that need to be traced by GC).
438 The distinction is used, e.g., by Lisp_Process, which places extra 433 The distinction is used, e.g., by Lisp_Process, which places extra
439 non-Lisp_Object fields at the end of the structure. */ 434 non-Lisp_Object fields at the end of the structure. */
440 PSEUDOVECTOR_SIZE_BITS = 16, 435 PSEUDOVECTOR_SIZE_BITS = 12,
441 PSEUDOVECTOR_SIZE_MASK = (1 << PSEUDOVECTOR_SIZE_BITS) - 1, 436 PSEUDOVECTOR_SIZE_MASK = (1 << PSEUDOVECTOR_SIZE_BITS) - 1,
442 PVEC_TYPE_MASK = 0x0fff << PSEUDOVECTOR_SIZE_BITS, 437
438 /* To calculate the memory footprint of the pseudovector, it's useful
439 to store the size of non-Lisp area in word_size units here. */
440 PSEUDOVECTOR_REST_BITS = 12,
441 PSEUDOVECTOR_REST_MASK = (((1 << PSEUDOVECTOR_REST_BITS) - 1)
442 << PSEUDOVECTOR_SIZE_BITS),
443
444 /* Used to extract pseudovector subtype information. */
445 PSEUDOVECTOR_AREA_BITS = PSEUDOVECTOR_SIZE_BITS + PSEUDOVECTOR_REST_BITS,
446 PVEC_TYPE_MASK = 0x3f << PSEUDOVECTOR_AREA_BITS,
443 447
444 /* Number of bits to put in each character in the internal representation 448 /* Number of bits to put in each character in the internal representation
445 of bool vectors. This should not vary across implementations. */ 449 of bool vectors. This should not vary across implementations. */
@@ -450,9 +454,6 @@ enum More_Lisp_Bits
450 For example, if tem is a Lisp_Object whose type is Lisp_Cons, 454 For example, if tem is a Lisp_Object whose type is Lisp_Cons,
451 XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */ 455 XCONS (tem) is the struct Lisp_Cons * pointing to the memory for that cons. */
452 456
453/* Return a perfect hash of the Lisp_Object representation. */
454#define XHASH(a) XLI (a)
455
456#if USE_LSB_TAG 457#if USE_LSB_TAG
457 458
458enum lsb_bits 459enum lsb_bits
@@ -505,6 +506,11 @@ static EMACS_INT const VALMASK
505 506
506#endif /* not USE_LSB_TAG */ 507#endif /* not USE_LSB_TAG */
507 508
509/* Return a (Lisp-integer sized) hash of the Lisp_Object value. Happens to be
510 like XUINT right now, but XUINT should only be applied to objects we know
511 are integers. */
512#define XHASH(a) XUINT (a)
513
508/* For integers known to be positive, XFASTINT sometimes provides 514/* For integers known to be positive, XFASTINT sometimes provides
509 faster retrieval and XSETFASTINT provides faster storage. 515 faster retrieval and XSETFASTINT provides faster storage.
510 If not, fallback on the non-accelerated path. */ 516 If not, fallback on the non-accelerated path. */
@@ -520,17 +526,12 @@ static EMACS_INT const VALMASK
520# define XUNTAG(a, type) XPNTR (a) 526# define XUNTAG(a, type) XPNTR (a)
521#endif 527#endif
522 528
523#define EQ(x, y) (XHASH (x) == XHASH (y)) 529#define EQ(x, y) (XLI (x) == XLI (y))
524 530
525/* Largest and smallest representable fixnum values. These are the C 531/* Largest and smallest representable fixnum values. These are the C
526 values. They are macros for use in static initializers, and 532 values. They are macros for use in static initializers. */
527 constants for visibility to GDB. */
528static EMACS_INT const MOST_POSITIVE_FIXNUM =
529#define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS) 533#define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS)
530 MOST_POSITIVE_FIXNUM;
531static EMACS_INT const MOST_NEGATIVE_FIXNUM =
532#define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM) 534#define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM)
533 MOST_NEGATIVE_FIXNUM;
534 535
535/* Value is non-zero if I doesn't fit into a Lisp fixnum. It is 536/* Value is non-zero if I doesn't fit into a Lisp fixnum. It is
536 written this way so that it also works if I is of unsigned 537 written this way so that it also works if I is of unsigned
@@ -615,13 +616,13 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
615 616
616/* Pseudovector types. */ 617/* Pseudovector types. */
617 618
618#define XSETPVECTYPE(v, code) XSETTYPED_PVECTYPE (v, header.size, code) 619#define XSETPVECTYPE(v, code) \
619#define XSETTYPED_PVECTYPE(v, size_member, code) \ 620 ((v)->header.size |= PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_AREA_BITS))
620 ((v)->size_member |= PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_SIZE_BITS)) 621#define XSETPVECTYPESIZE(v, code, lispsize, restsize) \
621#define XSETPVECTYPESIZE(v, code, sizeval) \
622 ((v)->header.size = (PSEUDOVECTOR_FLAG \ 622 ((v)->header.size = (PSEUDOVECTOR_FLAG \
623 | ((code) << PSEUDOVECTOR_SIZE_BITS) \ 623 | ((code) << PSEUDOVECTOR_AREA_BITS) \
624 | (sizeval))) 624 | ((restsize) << PSEUDOVECTOR_SIZE_BITS) \
625 | (lispsize)))
625 626
626/* The cast to struct vectorlike_header * avoids aliasing issues. */ 627/* The cast to struct vectorlike_header * avoids aliasing issues. */
627#define XSETPSEUDOVECTOR(a, b, code) \ 628#define XSETPSEUDOVECTOR(a, b, code) \
@@ -633,16 +634,14 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
633#define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \ 634#define XSETTYPED_PSEUDOVECTOR(a, b, size, code) \
634 (XSETVECTOR (a, b), \ 635 (XSETVECTOR (a, b), \
635 eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \ 636 eassert ((size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
636 == (PSEUDOVECTOR_FLAG | (code << PSEUDOVECTOR_SIZE_BITS)))) 637 == (PSEUDOVECTOR_FLAG | (code << PSEUDOVECTOR_AREA_BITS))))
637 638
638#define XSETWINDOW_CONFIGURATION(a, b) \ 639#define XSETWINDOW_CONFIGURATION(a, b) \
639 (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION)) 640 (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW_CONFIGURATION))
640#define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS)) 641#define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS))
641#define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW)) 642#define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW))
642#define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL)) 643#define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL))
643/* XSETSUBR is special since Lisp_Subr lacks struct vectorlike_header. */ 644#define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
644#define XSETSUBR(a, b) \
645 XSETTYPED_PSEUDOVECTOR (a, b, XSUBR (a)->size, PVEC_SUBR)
646#define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED)) 645#define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
647#define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER)) 646#define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
648#define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE)) 647#define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE))
@@ -809,7 +808,7 @@ struct Lisp_String
809 }; 808 };
810 809
811/* Header of vector-like objects. This documents the layout constraints on 810/* Header of vector-like objects. This documents the layout constraints on
812 vectors and pseudovectors other than struct Lisp_Subr. It also prevents 811 vectors and pseudovectors (objects of PVEC_xxx subtype). It also prevents
813 compilers from being fooled by Emacs's type punning: the XSETPSEUDOVECTOR 812 compilers from being fooled by Emacs's type punning: the XSETPSEUDOVECTOR
814 and PSEUDOVECTORP macros cast their pointers to struct vectorlike_header *, 813 and PSEUDOVECTORP macros cast their pointers to struct vectorlike_header *,
815 because when two such pointers potentially alias, a compiler won't 814 because when two such pointers potentially alias, a compiler won't
@@ -817,43 +816,26 @@ struct Lisp_String
817 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8546>. */ 816 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8546>. */
818struct vectorlike_header 817struct vectorlike_header
819 { 818 {
820 /* This field contains various pieces of information: 819 /* The only field contains various pieces of information:
821 - The MSB (ARRAY_MARK_FLAG) holds the gcmarkbit. 820 - The MSB (ARRAY_MARK_FLAG) holds the gcmarkbit.
822 - The next bit (PSEUDOVECTOR_FLAG) indicates whether this is a plain 821 - The next bit (PSEUDOVECTOR_FLAG) indicates whether this is a plain
823 vector (0) or a pseudovector (1). 822 vector (0) or a pseudovector (1).
824 - If PSEUDOVECTOR_FLAG is 0, the rest holds the size (number 823 - If PSEUDOVECTOR_FLAG is 0, the rest holds the size (number
825 of slots) of the vector. 824 of slots) of the vector.
826 - If PSEUDOVECTOR_FLAG is 1, the rest is subdivided into 825 - If PSEUDOVECTOR_FLAG is 1, the rest is subdivided into three fields:
827 a "pvec type" tag held in PVEC_TYPE_MASK and a size held in the lowest 826 - a) pseudovector subtype held in PVEC_TYPE_MASK field;
828 PSEUDOVECTOR_SIZE_BITS. That size normally indicates the number of 827 - b) number of Lisp_Objects slots at the beginning of the object
829 Lisp_Object slots at the beginning of the object that need to be 828 held in PSEUDOVECTOR_SIZE_MASK field. These objects are always
830 traced by the GC, tho some types use it slightly differently. 829 traced by the GC;
831 - E.g. if the pvec type is PVEC_FREE it means this is an unallocated 830 - c) size of the rest fields held in PSEUDOVECTOR_REST_MASK and
832 vector on a free-list and PSEUDOVECTOR_SIZE_BITS indicates its size 831 measured in word_size units. Rest fields may also include
833 in bytes. */ 832 Lisp_Objects, but these objects usually needs some special treatment
833 during GC.
834 There are some exceptions. For PVEC_FREE, b) is always zero. For
835 PVEC_BOOL_VECTOR and PVEC_SUBR, both b) and c) are always zero.
836 Current layout limits the pseudovectors to 63 PVEC_xxx subtypes,
837 4095 Lisp_Objects in GC-ed area and 4095 word-sized other slots. */
834 ptrdiff_t size; 838 ptrdiff_t size;
835
836 /* When the vector is allocated from a vector block, NBYTES is used
837 if the vector is not on a free list, and VECTOR is used otherwise.
838 For large vector-like objects, BUFFER or VECTOR is used as a pointer
839 to the next vector-like object. It is generally a buffer or a
840 Lisp_Vector alias, so for convenience it is a union instead of a
841 pointer: this way, one can write P->next.vector instead of ((struct
842 Lisp_Vector *) P->next). */
843 union {
844 /* This is only needed for small vectors that are not free because the
845 `size' field only gives us the number of Lisp_Object slots, whereas we
846 need to know the total size, including non-Lisp_Object data.
847 FIXME: figure out a way to store this info elsewhere so we can
848 finally get rid of this extra word of overhead. */
849 ptrdiff_t nbytes;
850 struct buffer *buffer;
851 /* FIXME: This can be removed: For large vectors, this field could be
852 placed *before* the vector itself. And for small vectors on a free
853 list, this field could be stored in the vector's bytes, since the
854 empty vector is handled specially anyway. */
855 struct Lisp_Vector *vector;
856 } next;
857 }; 839 };
858 840
859/* Regular vector is just a header plus array of Lisp_Objects. */ 841/* Regular vector is just a header plus array of Lisp_Objects. */
@@ -1027,15 +1009,11 @@ struct Lisp_Sub_Char_Table
1027 1009
1028/* This structure describes a built-in function. 1010/* This structure describes a built-in function.
1029 It is generated by the DEFUN macro only. 1011 It is generated by the DEFUN macro only.
1030 defsubr makes it into a Lisp object. 1012 defsubr makes it into a Lisp object. */
1031
1032 This type is treated in most respects as a pseudovector,
1033 but since we never dynamically allocate or free them,
1034 we don't need a struct vectorlike_header and its 'next' field. */
1035 1013
1036struct Lisp_Subr 1014struct Lisp_Subr
1037 { 1015 {
1038 ptrdiff_t size; 1016 struct vectorlike_header header;
1039 union { 1017 union {
1040 Lisp_Object (*a0) (void); 1018 Lisp_Object (*a0) (void);
1041 Lisp_Object (*a1) (Lisp_Object); 1019 Lisp_Object (*a1) (Lisp_Object);
@@ -1183,14 +1161,29 @@ struct Lisp_Symbol
1183 1161
1184/* The structure of a Lisp hash table. */ 1162/* The structure of a Lisp hash table. */
1185 1163
1164struct hash_table_test
1165{
1166 /* Name of the function used to compare keys. */
1167 Lisp_Object name;
1168
1169 /* User-supplied hash function, or nil. */
1170 Lisp_Object user_hash_function;
1171
1172 /* User-supplied key comparison function, or nil. */
1173 Lisp_Object user_cmp_function;
1174
1175 /* C function to compare two keys. */
1176 bool (*cmpfn) (struct hash_table_test *t, Lisp_Object, Lisp_Object);
1177
1178 /* C function to compute hash code. */
1179 EMACS_UINT (*hashfn) (struct hash_table_test *t, Lisp_Object);
1180};
1181
1186struct Lisp_Hash_Table 1182struct Lisp_Hash_Table
1187{ 1183{
1188 /* This is for Lisp; the hash table code does not refer to it. */ 1184 /* This is for Lisp; the hash table code does not refer to it. */
1189 struct vectorlike_header header; 1185 struct vectorlike_header header;
1190 1186
1191 /* Function used to compare keys. */
1192 Lisp_Object test;
1193
1194 /* Nil if table is non-weak. Otherwise a symbol describing the 1187 /* Nil if table is non-weak. Otherwise a symbol describing the
1195 weakness of the table. */ 1188 weakness of the table. */
1196 Lisp_Object weak; 1189 Lisp_Object weak;
@@ -1221,12 +1214,6 @@ struct Lisp_Hash_Table
1221 hash table size to reduce collisions. */ 1214 hash table size to reduce collisions. */
1222 Lisp_Object index; 1215 Lisp_Object index;
1223 1216
1224 /* User-supplied hash function, or nil. */
1225 Lisp_Object user_hash_function;
1226
1227 /* User-supplied key comparison function, or nil. */
1228 Lisp_Object user_cmp_function;
1229
1230 /* Only the fields above are traced normally by the GC. The ones below 1217 /* Only the fields above are traced normally by the GC. The ones below
1231 `count' are special and are either ignored by the GC or traced in 1218 `count' are special and are either ignored by the GC or traced in
1232 a special way (e.g. because of weakness). */ 1219 a special way (e.g. because of weakness). */
@@ -1239,17 +1226,12 @@ struct Lisp_Hash_Table
1239 This is gc_marked specially if the table is weak. */ 1226 This is gc_marked specially if the table is weak. */
1240 Lisp_Object key_and_value; 1227 Lisp_Object key_and_value;
1241 1228
1229 /* The comparison and hash functions. */
1230 struct hash_table_test test;
1231
1242 /* Next weak hash table if this is a weak hash table. The head 1232 /* Next weak hash table if this is a weak hash table. The head
1243 of the list is in weak_hash_tables. */ 1233 of the list is in weak_hash_tables. */
1244 struct Lisp_Hash_Table *next_weak; 1234 struct Lisp_Hash_Table *next_weak;
1245
1246 /* C function to compare two keys. */
1247 bool (*cmpfn) (struct Lisp_Hash_Table *,
1248 Lisp_Object, EMACS_UINT,
1249 Lisp_Object, EMACS_UINT);
1250
1251 /* C function to compute hash code. */
1252 EMACS_UINT (*hashfn) (struct Lisp_Hash_Table *, Lisp_Object);
1253}; 1235};
1254 1236
1255 1237
@@ -1304,6 +1286,15 @@ static double const DEFAULT_REHASH_THRESHOLD = 0.8;
1304 1286
1305static double const DEFAULT_REHASH_SIZE = 1.5; 1287static double const DEFAULT_REHASH_SIZE = 1.5;
1306 1288
1289/* Combine two integers X and Y for hashing. The result might not fit
1290 into a Lisp integer. */
1291
1292LISP_INLINE EMACS_UINT
1293sxhash_combine (EMACS_UINT x, EMACS_UINT y)
1294{
1295 return (x << 4) + (x >> (BITS_PER_EMACS_INT - 4)) + y;
1296}
1297
1307/* These structures are used for various misc types. */ 1298/* These structures are used for various misc types. */
1308 1299
1309struct Lisp_Misc_Any /* Supertype of all Misc types. */ 1300struct Lisp_Misc_Any /* Supertype of all Misc types. */
@@ -1703,6 +1694,8 @@ typedef struct {
1703#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) 1694#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
1704#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value) 1695#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
1705 1696
1697#define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x)))
1698
1706#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int) 1699#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int)
1707#define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool) 1700#define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool)
1708#define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj) 1701#define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj)
@@ -1716,7 +1709,7 @@ typedef struct {
1716 1709
1717#define PSEUDOVECTOR_TYPEP(v, code) \ 1710#define PSEUDOVECTOR_TYPEP(v, code) \
1718 (((v)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \ 1711 (((v)->size & (PSEUDOVECTOR_FLAG | PVEC_TYPE_MASK)) \
1719 == (PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_SIZE_BITS))) 1712 == (PSEUDOVECTOR_FLAG | ((code) << PSEUDOVECTOR_AREA_BITS)))
1720 1713
1721/* True if object X, with internal type struct T *, is a pseudovector whose 1714/* True if object X, with internal type struct T *, is a pseudovector whose
1722 code is CODE. */ 1715 code is CODE. */
@@ -1729,8 +1722,7 @@ typedef struct {
1729#define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS) 1722#define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS)
1730#define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW) 1723#define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW)
1731#define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL) 1724#define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL)
1732/* SUBRP is special since Lisp_Subr lacks struct vectorlike_header. */ 1725#define SUBRP(x) PSEUDOVECTORP (x, PVEC_SUBR)
1733#define SUBRP(x) TYPED_PSEUDOVECTORP (x, Lisp_Subr, PVEC_SUBR)
1734#define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED) 1726#define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED)
1735#define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER) 1727#define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER)
1736#define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE) 1728#define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
@@ -1791,20 +1783,6 @@ typedef struct {
1791#define CHECK_WINDOW_CONFIGURATION(x) \ 1783#define CHECK_WINDOW_CONFIGURATION(x) \
1792 CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x) 1784 CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x)
1793 1785
1794/* A window of any sort, leaf or interior, is "valid" if one of its
1795 buffer, vchild, or hchild members is non-nil. */
1796#define CHECK_VALID_WINDOW(x) \
1797 CHECK_TYPE (WINDOWP (x) \
1798 && (!NILP (XWINDOW (x)->buffer) \
1799 || !NILP (XWINDOW (x)->vchild) \
1800 || !NILP (XWINDOW (x)->hchild)), \
1801 Qwindow_valid_p, x)
1802
1803/* A window is "live" if and only if it shows a buffer. */
1804#define CHECK_LIVE_WINDOW(x) \
1805 CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer), \
1806 Qwindow_live_p, x)
1807
1808#define CHECK_PROCESS(x) \ 1786#define CHECK_PROCESS(x) \
1809 CHECK_TYPE (PROCESSP (x), Qprocessp, x) 1787 CHECK_TYPE (PROCESSP (x), Qprocessp, x)
1810 1788
@@ -1919,8 +1897,8 @@ typedef struct {
1919#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ 1897#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
1920 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ 1898 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1921 static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ 1899 static struct Lisp_Subr alignas (GCALIGNMENT) sname = \
1922 { (PVEC_SUBR << PSEUDOVECTOR_SIZE_BITS) \ 1900 { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \
1923 | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ 1901 | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \
1924 { (Lisp_Object (__cdecl *)(void))fnname }, \ 1902 { (Lisp_Object (__cdecl *)(void))fnname }, \
1925 minargs, maxargs, lname, intspec, 0}; \ 1903 minargs, maxargs, lname, intspec, 0}; \
1926 Lisp_Object fnname 1904 Lisp_Object fnname
@@ -1928,8 +1906,8 @@ typedef struct {
1928#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ 1906#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
1929 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ 1907 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1930 static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ 1908 static struct Lisp_Subr alignas (GCALIGNMENT) sname = \
1931 { PVEC_SUBR << PSEUDOVECTOR_SIZE_BITS, \ 1909 { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \
1932 { .a ## maxargs = fnname }, \ 1910 { .a ## maxargs = fnname }, \
1933 minargs, maxargs, lname, intspec, 0}; \ 1911 minargs, maxargs, lname, intspec, 0}; \
1934 Lisp_Object fnname 1912 Lisp_Object fnname
1935#endif 1913#endif
@@ -2658,9 +2636,6 @@ extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
2658 2636
2659EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST; 2637EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST;
2660 2638
2661/* Defined in frame.c. */
2662extern Lisp_Object Qframep;
2663
2664/* Defined in data.c. */ 2639/* Defined in data.c. */
2665extern Lisp_Object indirect_function (Lisp_Object); 2640extern Lisp_Object indirect_function (Lisp_Object);
2666extern Lisp_Object find_symbol_value (Lisp_Object); 2641extern Lisp_Object find_symbol_value (Lisp_Object);
@@ -2746,15 +2721,15 @@ extern Lisp_Object larger_vector (Lisp_Object, ptrdiff_t, ptrdiff_t);
2746extern void sweep_weak_hash_tables (void); 2721extern void sweep_weak_hash_tables (void);
2747extern Lisp_Object Qcursor_in_echo_area; 2722extern Lisp_Object Qcursor_in_echo_area;
2748extern Lisp_Object Qstring_lessp; 2723extern Lisp_Object Qstring_lessp;
2749extern Lisp_Object QCsize, QCtest, QCweakness, Qequal, Qeq, Qeql; 2724extern Lisp_Object QCsize, QCtest, QCweakness, Qequal, Qeq;
2750EMACS_UINT hash_string (char const *, ptrdiff_t); 2725EMACS_UINT hash_string (char const *, ptrdiff_t);
2751EMACS_UINT sxhash (Lisp_Object, int); 2726EMACS_UINT sxhash (Lisp_Object, int);
2752Lisp_Object make_hash_table (Lisp_Object, Lisp_Object, Lisp_Object, 2727Lisp_Object make_hash_table (struct hash_table_test, Lisp_Object, Lisp_Object,
2753 Lisp_Object, Lisp_Object, Lisp_Object, 2728 Lisp_Object, Lisp_Object);
2754 Lisp_Object);
2755ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *); 2729ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, EMACS_UINT *);
2756ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object, 2730ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
2757 EMACS_UINT); 2731 EMACS_UINT);
2732extern struct hash_table_test hashtest_eql, hashtest_equal;
2758 2733
2759extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t, 2734extern Lisp_Object substring_both (Lisp_Object, ptrdiff_t, ptrdiff_t,
2760 ptrdiff_t, ptrdiff_t); 2735 ptrdiff_t, ptrdiff_t);
@@ -2976,7 +2951,7 @@ extern void make_byte_code (struct Lisp_Vector *);
2976extern Lisp_Object Qautomatic_gc; 2951extern Lisp_Object Qautomatic_gc;
2977extern Lisp_Object Qchar_table_extra_slots; 2952extern Lisp_Object Qchar_table_extra_slots;
2978extern struct Lisp_Vector *allocate_vector (EMACS_INT); 2953extern struct Lisp_Vector *allocate_vector (EMACS_INT);
2979extern struct Lisp_Vector *allocate_pseudovector (int memlen, int lisplen, int tag); 2954extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
2980#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ 2955#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
2981 ((typ*) \ 2956 ((typ*) \
2982 allocate_pseudovector \ 2957 allocate_pseudovector \
@@ -3328,7 +3303,6 @@ extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
3328#if HAVE_NS 3303#if HAVE_NS
3329extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); 3304extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
3330#endif 3305#endif
3331extern Lisp_Object frame_buffer_predicate (Lisp_Object);
3332extern void frames_discard_buffer (Lisp_Object); 3306extern void frames_discard_buffer (Lisp_Object);
3333extern void syms_of_frame (void); 3307extern void syms_of_frame (void);
3334 3308