aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h297
1 files changed, 170 insertions, 127 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 7f5d5df66c6..d7e88e7c8b8 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -223,13 +223,7 @@ enum Lisp_Misc_Type
223 { 223 {
224 Lisp_Misc_Free = 0x5eab, 224 Lisp_Misc_Free = 0x5eab,
225 Lisp_Misc_Marker, 225 Lisp_Misc_Marker,
226 Lisp_Misc_Intfwd,
227 Lisp_Misc_Boolfwd,
228 Lisp_Misc_Objfwd,
229 Lisp_Misc_Buffer_Objfwd,
230 Lisp_Misc_Buffer_Local_Value,
231 Lisp_Misc_Overlay, 226 Lisp_Misc_Overlay,
232 Lisp_Misc_Kboard_Objfwd,
233 Lisp_Misc_Save_Value, 227 Lisp_Misc_Save_Value,
234 /* Currently floats are not a misc type, 228 /* Currently floats are not a misc type,
235 but let's define this in case we want to change that. */ 229 but let's define this in case we want to change that. */
@@ -238,6 +232,18 @@ enum Lisp_Misc_Type
238 Lisp_Misc_Limit 232 Lisp_Misc_Limit
239 }; 233 };
240 234
235/* These are the types of forwarding objects used in the value slot
236 of symbols for special built-in variables whose value is stored in
237 C variables. */
238enum Lisp_Fwd_Type
239 {
240 Lisp_Fwd_Int, /* Fwd to a C `int' variable. */
241 Lisp_Fwd_Bool, /* Fwd to a C boolean var. */
242 Lisp_Fwd_Obj, /* Fwd to a C Lisp_Object variable. */
243 Lisp_Fwd_Buffer_Obj, /* Fwd to a Lisp_Object field of buffers. */
244 Lisp_Fwd_Kboard_Obj, /* Fwd to a Lisp_Object field of kboards. */
245 };
246
241#ifndef GCTYPEBITS 247#ifndef GCTYPEBITS
242#define GCTYPEBITS 3 248#define GCTYPEBITS 3
243#endif 249#endif
@@ -566,17 +572,19 @@ extern size_t pure_size;
566#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any)) 572#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any))
567#define XMISCTYPE(a) (XMISCANY (a)->type) 573#define XMISCTYPE(a) (XMISCANY (a)->type)
568#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker)) 574#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker))
569#define XINTFWD(a) (eassert (INTFWDP (a)), &(XMISC(a)->u_intfwd))
570#define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &(XMISC(a)->u_boolfwd))
571#define XOBJFWD(a) (eassert (OBJFWDP (a)), &(XMISC(a)->u_objfwd))
572#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay)) 575#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay))
573#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value)) 576#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value))
577
578/* Forwarding object types. */
579
580#define XFWDTYPE(a) (a->u_intfwd.type)
581#define XINTFWD(a) (eassert (INTFWDP (a)), &((a)->u_intfwd))
582#define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &((a)->u_boolfwd))
583#define XOBJFWD(a) (eassert (OBJFWDP (a)), &((a)->u_objfwd))
574#define XBUFFER_OBJFWD(a) \ 584#define XBUFFER_OBJFWD(a) \
575 (eassert (BUFFER_OBJFWDP (a)), &(XMISC(a)->u_buffer_objfwd)) 585 (eassert (BUFFER_OBJFWDP (a)), &((a)->u_buffer_objfwd))
576#define XBUFFER_LOCAL_VALUE(a) \
577 (eassert (BUFFER_LOCAL_VALUEP (a)), &(XMISC(a)->u_buffer_local_value))
578#define XKBOARD_OBJFWD(a) \ 586#define XKBOARD_OBJFWD(a) \
579 (eassert (KBOARD_OBJFWDP (a)), &(XMISC(a)->u_kboard_objfwd)) 587 (eassert (KBOARD_OBJFWDP (a)), &((a)->u_kboard_objfwd))
580 588
581/* Pseudovector types. */ 589/* Pseudovector types. */
582 590
@@ -988,19 +996,32 @@ enum symbol_interned
988 SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2 996 SYMBOL_INTERNED_IN_INITIAL_OBARRAY = 2
989}; 997};
990 998
999enum symbol_redirect
1000{
1001 SYMBOL_PLAINVAL = 4,
1002 SYMBOL_VARALIAS = 1,
1003 SYMBOL_LOCALIZED = 2,
1004 SYMBOL_FORWARDED = 3
1005};
1006
991/* In a symbol, the markbit of the plist is used as the gc mark bit */ 1007/* In a symbol, the markbit of the plist is used as the gc mark bit */
992 1008
993struct Lisp_Symbol 1009struct Lisp_Symbol
994{ 1010{
995 unsigned gcmarkbit : 1; 1011 unsigned gcmarkbit : 1;
996 1012
997 /* Non-zero means symbol serves as a variable alias. The symbol 1013 /* Indicates where the value can be found:
998 holding the real value is found in the value slot. */ 1014 0 : it's a plain var, the value is in the `value' field.
999 unsigned indirect_variable : 1; 1015 1 : it's a varalias, the value is really in the `alias' symbol.
1016 2 : it's a localized var, the value is in the `blv' object.
1017 3 : it's a forwarding variable, the value is in `forward'.
1018 */
1019 enum symbol_redirect redirect : 3;
1000 1020
1001 /* Non-zero means symbol is constant, i.e. changing its value 1021 /* Non-zero means symbol is constant, i.e. changing its value
1002 should signal an error. */ 1022 should signal an error. If the value is 3, then the var
1003 unsigned constant : 1; 1023 can be changed, but only by `defconst'. */
1024 unsigned constant : 2;
1004 1025
1005 /* Interned state of the symbol. This is an enumerator from 1026 /* Interned state of the symbol. This is an enumerator from
1006 enum symbol_interned. */ 1027 enum symbol_interned. */
@@ -1013,10 +1034,15 @@ struct Lisp_Symbol
1013 Lisp_Object xname; 1034 Lisp_Object xname;
1014 1035
1015 /* Value of the symbol or Qunbound if unbound. If this symbol is a 1036 /* Value of the symbol or Qunbound if unbound. If this symbol is a
1016 defvaralias, `value' contains the symbol for which it is an 1037 defvaralias, `alias' contains the symbol for which it is an
1017 alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get 1038 alias. Use the SYMBOL_VALUE and SET_SYMBOL_VALUE macros to get
1018 and set a symbol's value, to take defvaralias into account. */ 1039 and set a symbol's value, to take defvaralias into account. */
1019 Lisp_Object value; 1040 union {
1041 Lisp_Object value;
1042 struct Lisp_Symbol *alias;
1043 struct Lisp_Buffer_Local_Value *blv;
1044 union Lisp_Fwd *fwd;
1045 } val;
1020 1046
1021 /* Function value of the symbol or Qunbound if not fboundp. */ 1047 /* Function value of the symbol or Qunbound if not fboundp. */
1022 Lisp_Object function; 1048 Lisp_Object function;
@@ -1030,6 +1056,23 @@ struct Lisp_Symbol
1030 1056
1031/* Value is name of symbol. */ 1057/* Value is name of symbol. */
1032 1058
1059#define SYMBOL_VAL(sym) \
1060 (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value)
1061#define SYMBOL_ALIAS(sym) \
1062 (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias)
1063#define SYMBOL_BLV(sym) \
1064 (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv)
1065#define SYMBOL_FWD(sym) \
1066 (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd)
1067#define SET_SYMBOL_VAL(sym, v) \
1068 (eassert ((sym)->redirect == SYMBOL_PLAINVAL), (sym)->val.value = (v))
1069#define SET_SYMBOL_ALIAS(sym, v) \
1070 (eassert ((sym)->redirect == SYMBOL_VARALIAS), (sym)->val.alias = (v))
1071#define SET_SYMBOL_BLV(sym, v) \
1072 (eassert ((sym)->redirect == SYMBOL_LOCALIZED), (sym)->val.blv = (v))
1073#define SET_SYMBOL_FWD(sym, v) \
1074 (eassert ((sym)->redirect == SYMBOL_FORWARDED), (sym)->val.fwd = (v))
1075
1033#define SYMBOL_NAME(sym) \ 1076#define SYMBOL_NAME(sym) \
1034 LISP_MAKE_RVALUE (XSYMBOL (sym)->xname) 1077 LISP_MAKE_RVALUE (XSYMBOL (sym)->xname)
1035 1078
@@ -1049,24 +1092,6 @@ struct Lisp_Symbol
1049 1092
1050#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant 1093#define SYMBOL_CONSTANT_P(sym) XSYMBOL (sym)->constant
1051 1094
1052/* Value is the value of SYM, with defvaralias taken into
1053 account. */
1054
1055#define SYMBOL_VALUE(sym) \
1056 (XSYMBOL (sym)->indirect_variable \
1057 ? indirect_variable (XSYMBOL (sym))->value \
1058 : XSYMBOL (sym)->value)
1059
1060/* Set SYM's value to VAL, taking defvaralias into account. */
1061
1062#define SET_SYMBOL_VALUE(sym, val) \
1063 do { \
1064 if (XSYMBOL (sym)->indirect_variable) \
1065 indirect_variable (XSYMBOL (sym))->value = (val); \
1066 else \
1067 XSYMBOL (sym)->value = (val); \
1068 } while (0)
1069
1070 1095
1071/*********************************************************************** 1096/***********************************************************************
1072 Hash Tables 1097 Hash Tables
@@ -1200,9 +1225,11 @@ struct Lisp_Hash_Table
1200 1225
1201struct Lisp_Misc_Any /* Supertype of all Misc types. */ 1226struct Lisp_Misc_Any /* Supertype of all Misc types. */
1202{ 1227{
1203 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Marker */ 1228 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_??? */
1204 unsigned gcmarkbit : 1; 1229 unsigned gcmarkbit : 1;
1205 int spacer : 15; 1230 int spacer : 15;
1231 /* Make it as long as "Lisp_Free without padding". */
1232 void *fill;
1206}; 1233};
1207 1234
1208struct Lisp_Marker 1235struct Lisp_Marker
@@ -1225,7 +1252,7 @@ struct Lisp_Marker
1225 - Fmarker_buffer 1252 - Fmarker_buffer
1226 - Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain. 1253 - Fset_marker: check eq(oldbuf, newbuf) to avoid unchain+rechain.
1227 - unchain_marker: to find the list from which to unchain. 1254 - unchain_marker: to find the list from which to unchain.
1228 - Fkill_buffer: to unchain the markers of current indirect buffer. 1255 - Fkill_buffer: to only unchain the markers of current indirect buffer.
1229 */ 1256 */
1230 struct buffer *buffer; 1257 struct buffer *buffer;
1231 1258
@@ -1239,7 +1266,10 @@ struct Lisp_Marker
1239 struct Lisp_Marker *next; 1266 struct Lisp_Marker *next;
1240 /* This is the char position where the marker points. */ 1267 /* This is the char position where the marker points. */
1241 EMACS_INT charpos; 1268 EMACS_INT charpos;
1242 /* This is the byte position. */ 1269 /* This is the byte position.
1270 It's mostly used as a charpos<->bytepos cache (i.e. it's not directly
1271 used to implement the functionality of markers, but rather to (ab)use
1272 markers as a cache for char<->byte mappings). */
1243 EMACS_INT bytepos; 1273 EMACS_INT bytepos;
1244}; 1274};
1245 1275
@@ -1249,9 +1279,7 @@ struct Lisp_Marker
1249 specified int variable. */ 1279 specified int variable. */
1250struct Lisp_Intfwd 1280struct Lisp_Intfwd
1251 { 1281 {
1252 int type : 16; /* = Lisp_Misc_Intfwd */ 1282 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Int */
1253 unsigned gcmarkbit : 1;
1254 int spacer : 15;
1255 EMACS_INT *intvar; 1283 EMACS_INT *intvar;
1256 }; 1284 };
1257 1285
@@ -1261,9 +1289,7 @@ struct Lisp_Intfwd
1261 nil if it is zero. */ 1289 nil if it is zero. */
1262struct Lisp_Boolfwd 1290struct Lisp_Boolfwd
1263 { 1291 {
1264 int type : 16; /* = Lisp_Misc_Boolfwd */ 1292 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Bool */
1265 unsigned gcmarkbit : 1;
1266 int spacer : 15;
1267 int *boolvar; 1293 int *boolvar;
1268 }; 1294 };
1269 1295
@@ -1273,9 +1299,7 @@ struct Lisp_Boolfwd
1273 specified variable. */ 1299 specified variable. */
1274struct Lisp_Objfwd 1300struct Lisp_Objfwd
1275 { 1301 {
1276 int type : 16; /* = Lisp_Misc_Objfwd */ 1302 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Obj */
1277 unsigned gcmarkbit : 1;
1278 int spacer : 15;
1279 Lisp_Object *objvar; 1303 Lisp_Object *objvar;
1280 }; 1304 };
1281 1305
@@ -1283,11 +1307,9 @@ struct Lisp_Objfwd
1283 current buffer. Value is byte index of slot within buffer. */ 1307 current buffer. Value is byte index of slot within buffer. */
1284struct Lisp_Buffer_Objfwd 1308struct Lisp_Buffer_Objfwd
1285 { 1309 {
1286 int type : 16; /* = Lisp_Misc_Buffer_Objfwd */ 1310 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */
1287 unsigned gcmarkbit : 1;
1288 int spacer : 15;
1289 Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */
1290 int offset; 1311 int offset;
1312 Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */
1291 }; 1313 };
1292 1314
1293/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when 1315/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when
@@ -1316,48 +1338,51 @@ struct Lisp_Buffer_Objfwd
1316 1338
1317struct Lisp_Buffer_Local_Value 1339struct Lisp_Buffer_Local_Value
1318 { 1340 {
1319 int type : 16; /* = Lisp_Misc_Buffer_Local_Value */
1320 unsigned gcmarkbit : 1;
1321 int spacer : 11;
1322
1323 /* 1 means that merely setting the variable creates a local 1341 /* 1 means that merely setting the variable creates a local
1324 binding for the current buffer */ 1342 binding for the current buffer */
1325 unsigned int local_if_set : 1; 1343 unsigned int local_if_set : 1;
1326 /* 1 means this variable is allowed to have frame-local bindings, 1344 /* 1 means this variable can have frame-local bindings, otherwise, it is
1327 so check for them when looking for the proper binding. */ 1345 can have buffer-local bindings. The two cannot be combined. */
1328 unsigned int check_frame : 1; 1346 unsigned int frame_local : 1;
1329 /* 1 means that the binding now loaded was found 1347 /* 1 means that the binding now loaded was found.
1330 as a local binding for the buffer in the `buffer' slot. */ 1348 Presumably equivalent to (defcell!=valcell) */
1331 unsigned int found_for_buffer : 1; 1349 unsigned int found : 1;
1332 /* 1 means that the binding now loaded was found 1350 /* If non-NULL, a forwarding to the C var where it should also be set. */
1333 as a local binding for the frame in the `frame' slot. */ 1351 union Lisp_Fwd *fwd; /* Should never be (Buffer|Kboard)_Objfwd. */
1334 unsigned int found_for_frame : 1; 1352 /* The buffer or frame for which the loaded binding was found. */
1335 Lisp_Object realvalue; 1353 Lisp_Object where;
1336 /* The buffer and frame for which the loaded binding was found. */ 1354 /* A cons cell that holds the default value. It has the form
1337 /* Having both is only needed if we want to allow variables that are 1355 (SYMBOL . DEFAULT-VALUE). */
1338 both buffer local and frame local (in which case, we currently give 1356 Lisp_Object defcell;
1339 precedence to the buffer-local binding). I don't think such 1357 /* The cons cell from `where's parameter alist.
1340 a combination is desirable. --Stef */ 1358 It always has the form (SYMBOL . VALUE)
1341 Lisp_Object buffer, frame; 1359 Note that if `forward' is non-nil, VALUE may be out of date.
1342 1360 Also if the currently loaded binding is the default binding, then
1343 /* A cons cell, (LOADED-BINDING . DEFAULT-VALUE). 1361 this is `eq'ual to defcell. */
1344 1362 Lisp_Object valcell;
1345 LOADED-BINDING is the binding now loaded. It is a cons cell
1346 whose cdr is the binding's value. The cons cell may be an
1347 element of a buffer's local-variable alist, or an element of a
1348 frame's parameter alist, or it may be this cons cell.
1349
1350 DEFAULT-VALUE is the variable's default value, seen when the
1351 current buffer and selected frame do not have their own
1352 bindings for the variable. When the default binding is loaded,
1353 LOADED-BINDING is actually this very cons cell; thus, its car
1354 points to itself. */
1355 Lisp_Object cdr;
1356 }; 1363 };
1357 1364
1365#define BLV_FOUND(blv) \
1366 (eassert ((blv)->found == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found)
1367#define SET_BLV_FOUND(blv, v) \
1368 (eassert ((v) == !EQ ((blv)->defcell, (blv)->valcell)), (blv)->found = (v))
1369
1370#define BLV_VALUE(blv) (XCDR ((blv)->valcell))
1371#define SET_BLV_VALUE(blv, v) (XSETCDR ((blv)->valcell, v))
1372
1358/* START and END are markers in the overlay's buffer, and 1373/* START and END are markers in the overlay's buffer, and
1359 PLIST is the overlay's property list. */ 1374 PLIST is the overlay's property list. */
1360struct Lisp_Overlay 1375struct Lisp_Overlay
1376/* An overlay's real data content is:
1377 - plist
1378 - buffer
1379 - insertion type of both ends
1380 - start & start_byte
1381 - end & end_byte
1382 - next (singly linked list of overlays).
1383 - start_next and end_next (singly linked list of markers).
1384 I.e. 9words plus 2 bits, 3words of which are for external linked lists.
1385*/
1361 { 1386 {
1362 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */ 1387 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Overlay */
1363 unsigned gcmarkbit : 1; 1388 unsigned gcmarkbit : 1;
@@ -1370,9 +1395,7 @@ struct Lisp_Overlay
1370 current kboard. */ 1395 current kboard. */
1371struct Lisp_Kboard_Objfwd 1396struct Lisp_Kboard_Objfwd
1372 { 1397 {
1373 enum Lisp_Misc_Type type : 16; /* = Lisp_Misc_Kboard_Objfwd */ 1398 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Kboard_Obj */
1374 unsigned gcmarkbit : 1;
1375 int spacer : 15;
1376 int offset; 1399 int offset;
1377 }; 1400 };
1378 1401
@@ -1401,9 +1424,9 @@ struct Lisp_Free
1401#ifdef USE_LSB_TAG 1424#ifdef USE_LSB_TAG
1402 /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment. 1425 /* Try to make sure that sizeof(Lisp_Misc) preserves TYPEBITS-alignment.
1403 This assumes that Lisp_Marker is the largest of the alternatives and 1426 This assumes that Lisp_Marker is the largest of the alternatives and
1404 that Lisp_Intfwd has the same size as "Lisp_Free w/o padding". */ 1427 that Lisp_Misc_Any has the same size as "Lisp_Free w/o padding". */
1405 char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1) 1428 char padding[((((sizeof (struct Lisp_Marker) - 1) >> GCTYPEBITS) + 1)
1406 << GCTYPEBITS) - sizeof (struct Lisp_Intfwd)]; 1429 << GCTYPEBITS) - sizeof (struct Lisp_Misc_Any)];
1407#endif 1430#endif
1408 }; 1431 };
1409 1432
@@ -1414,15 +1437,18 @@ union Lisp_Misc
1414 { 1437 {
1415 struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */ 1438 struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */
1416 struct Lisp_Free u_free; /* Includes padding to force alignment. */ 1439 struct Lisp_Free u_free; /* Includes padding to force alignment. */
1417 struct Lisp_Marker u_marker; 1440 struct Lisp_Marker u_marker; /* 5 */
1418 struct Lisp_Intfwd u_intfwd; 1441 struct Lisp_Overlay u_overlay; /* 5 */
1419 struct Lisp_Boolfwd u_boolfwd; 1442 struct Lisp_Save_Value u_save_value; /* 3 */
1420 struct Lisp_Objfwd u_objfwd; 1443 };
1421 struct Lisp_Buffer_Objfwd u_buffer_objfwd; 1444
1422 struct Lisp_Buffer_Local_Value u_buffer_local_value; 1445union Lisp_Fwd
1423 struct Lisp_Overlay u_overlay; 1446 {
1424 struct Lisp_Kboard_Objfwd u_kboard_objfwd; 1447 struct Lisp_Intfwd u_intfwd; /* 2 */
1425 struct Lisp_Save_Value u_save_value; 1448 struct Lisp_Boolfwd u_boolfwd; /* 2 */
1449 struct Lisp_Objfwd u_objfwd; /* 2 */
1450 struct Lisp_Buffer_Objfwd u_buffer_objfwd; /* 2 */
1451 struct Lisp_Kboard_Objfwd u_kboard_objfwd; /* 2 */
1426 }; 1452 };
1427 1453
1428/* Lisp floating point type */ 1454/* Lisp floating point type */
@@ -1564,15 +1590,13 @@ typedef struct {
1564#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) 1590#define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
1565#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay) 1591#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
1566#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) 1592#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
1567#define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
1568#define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
1569#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
1570#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
1571#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
1572#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
1573#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
1574#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value) 1593#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
1575 1594
1595#define INTFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Int)
1596#define BOOLFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Bool)
1597#define OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Obj)
1598#define BUFFER_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Buffer_Obj)
1599#define KBOARD_OBJFWDP(x) (XFWDTYPE (x) == Lisp_Fwd_Kboard_Obj)
1576 1600
1577/* True if object X is a pseudovector whose code is CODE. */ 1601/* True if object X is a pseudovector whose code is CODE. */
1578#define PSEUDOVECTORP(x, code) \ 1602#define PSEUDOVECTORP(x, code) \
@@ -1789,24 +1813,44 @@ extern void defsubr P_ ((struct Lisp_Subr *));
1789#define MANY -2 1813#define MANY -2
1790#define UNEVALLED -1 1814#define UNEVALLED -1
1791 1815
1792extern void defvar_lisp (const char *, Lisp_Object *); 1816extern void defvar_lisp (struct Lisp_Objfwd *, const char *, Lisp_Object *);
1793extern void defvar_lisp_nopro (const char *, Lisp_Object *); 1817extern void defvar_lisp_nopro (struct Lisp_Objfwd *, const char *, Lisp_Object *);
1794extern void defvar_bool (const char *, int *); 1818extern void defvar_bool (struct Lisp_Boolfwd *, const char *, int *);
1795extern void defvar_int (const char *, EMACS_INT *); 1819extern void defvar_int (struct Lisp_Intfwd *, const char *, EMACS_INT *);
1796extern void defvar_kboard (const char *, int); 1820extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int);
1797 1821
1798/* Macros we use to define forwarded Lisp variables. 1822/* Macros we use to define forwarded Lisp variables.
1799 These are used in the syms_of_FILENAME functions. */ 1823 These are used in the syms_of_FILENAME functions. */
1800 1824
1801#define DEFVAR_LISP(lname, vname, doc) defvar_lisp (lname, vname) 1825#define DEFVAR_LISP(lname, vname, doc) \
1802#define DEFVAR_LISP_NOPRO(lname, vname, doc) defvar_lisp_nopro (lname, vname) 1826 do { \
1803#define DEFVAR_BOOL(lname, vname, doc) defvar_bool (lname, vname) 1827 static struct Lisp_Objfwd o_fwd; \
1804#define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname) 1828 defvar_lisp (&o_fwd, lname, vname); \
1829 } while (0)
1830#define DEFVAR_LISP_NOPRO(lname, vname, doc) \
1831 do { \
1832 static struct Lisp_Objfwd o_fwd; \
1833 defvar_lisp_nopro (&o_fwd, lname, vname); \
1834 } while (0)
1835#define DEFVAR_BOOL(lname, vname, doc) \
1836 do { \
1837 static struct Lisp_Boolfwd b_fwd; \
1838 defvar_bool (&b_fwd, lname, vname); \
1839 } while (0)
1840#define DEFVAR_INT(lname, vname, doc) \
1841 do { \
1842 static struct Lisp_Intfwd i_fwd; \
1843 defvar_int (&i_fwd, lname, vname); \
1844 } while (0)
1805 1845
1806#define DEFVAR_KBOARD(lname, vname, doc) \ 1846#define DEFVAR_KBOARD(lname, vname, doc) \
1807 defvar_kboard (lname, \ 1847 do { \
1808 (int)((char *)(&current_kboard->vname) \ 1848 static struct Lisp_Kboard_Objfwd ko_fwd; \
1809 - (char *)current_kboard)) 1849 defvar_kboard (&ko_fwd, \
1850 lname, \
1851 (int)((char *)(&current_kboard->vname) \
1852 - (char *)current_kboard)); \
1853 } while (0)
1810 1854
1811 1855
1812 1856
@@ -2341,13 +2385,11 @@ extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
2341extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, 2385extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object,
2342 Lisp_Object)) NO_RETURN; 2386 Lisp_Object)) NO_RETURN;
2343extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN; 2387extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
2344extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object, 2388extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
2345 Lisp_Object, struct buffer *)); 2389extern void set_internal (Lisp_Object, Lisp_Object, struct buffer *, int);
2346extern Lisp_Object do_symval_forwarding P_ ((Lisp_Object));
2347extern Lisp_Object set_internal P_ ((Lisp_Object, Lisp_Object, struct buffer *, int));
2348extern void syms_of_data P_ ((void)); 2390extern void syms_of_data P_ ((void));
2349extern void init_data P_ ((void)); 2391extern void init_data P_ ((void));
2350extern void swap_in_global_binding P_ ((Lisp_Object)); 2392extern void swap_in_global_binding P_ ((struct Lisp_Symbol *));
2351 2393
2352/* Defined in cmds.c */ 2394/* Defined in cmds.c */
2353EXFUN (Fend_of_line, 1); 2395EXFUN (Fend_of_line, 1);
@@ -3388,6 +3430,7 @@ extern void syms_of_term P_ ((void));
3388extern void fatal P_ ((const char *msgid, ...)) NO_RETURN; 3430extern void fatal P_ ((const char *msgid, ...)) NO_RETURN;
3389 3431
3390/* Defined in terminal.c */ 3432/* Defined in terminal.c */
3433EXFUN (Fframe_terminal, 1);
3391EXFUN (Fdelete_terminal, 2); 3434EXFUN (Fdelete_terminal, 2);
3392extern void syms_of_terminal P_ ((void)); 3435extern void syms_of_terminal P_ ((void));
3393 3436