aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-10-12 05:13:45 +0000
committerKarl Heuer1994-10-12 05:13:45 +0000
commitee4c9ce4d78e49deb60a390b950f4dbeaef21cb6 (patch)
tree0c41bf86c9ecf8c13ba39ae6f5c11a933aed37f2 /src
parent9bdff5c5c73bc2c48f8dcda1fb3dc6d62f599222 (diff)
downloademacs-ee4c9ce4d78e49deb60a390b950f4dbeaef21cb6.tar.gz
emacs-ee4c9ce4d78e49deb60a390b950f4dbeaef21cb6.zip
(enum Lisp_Misc_Type): Add new enumerations Lisp_Misc_Intfwd,
Lisp_Misc_Boolfwd, Lisp_Misc_Objfwd, Lisp_Misc_Buffer_Objfwd. (enum Lisp_Type): Delete the corresponding enumerations from here. (struct Lisp_Buffer_Objfwd): New structure. (struct Lisp_Intfwd, struct Lisp_Boolfwd, struct Lisp_Objfwd): Ditto. (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD): Access the new structure. (INTFWDP, BOOLFWDP, OBJFWDP, BUFFER_OBJFWDP): Ditto. (XSETINTFWD, XSETBOOLFWD, XSETOBJFWD, XSETBUFFER_OBJFWD): Deleted. (union Lisp_Misc): Add new members. (allocate_misc): Declare this function. (XINTPTR): Deleted.
Diffstat (limited to 'src')
-rw-r--r--src/lisp.h102
1 files changed, 60 insertions, 42 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 01d80468027..85316dff879 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -66,30 +66,10 @@ enum Lisp_Type
66 as well as pointing to the code. */ 66 as well as pointing to the code. */
67 Lisp_Subr, 67 Lisp_Subr,
68 68
69 /* Forwarding pointer to an int variable.
70 This is allowed only in the value cell of a symbol,
71 and it means that the symbol's value really lives in the
72 specified int variable.
73 XINTPTR(obj) points to the int variable. */
74 Lisp_Intfwd,
75
76 /* Boolean forwarding pointer to an int variable.
77 This is like Lisp_Intfwd except that the ostensible
78 "value" of the symbol is t if the int variable is nonzero,
79 nil if it is zero. XINTPTR(obj) points to the int variable. */
80 Lisp_Boolfwd,
81
82 /* Object describing a connection to a subprocess. 69 /* Object describing a connection to a subprocess.
83 It points to storage of type struct Lisp_Process */ 70 It points to storage of type struct Lisp_Process */
84 Lisp_Process, 71 Lisp_Process,
85 72
86 /* Forwarding pointer to a Lisp_Object variable.
87 This is allowed only in the value cell of a symbol,
88 and it means that the symbol's value really lives in the
89 specified variable.
90 XOBJFWD(obj) points to the Lisp_Object variable. */
91 Lisp_Objfwd,
92
93#ifdef MULTI_FRAME 73#ifdef MULTI_FRAME
94 /* Pointer to a vector-like object describing a display frame 74 /* Pointer to a vector-like object describing a display frame
95 on which Emacs can display a window hierarchy. We don't define 75 on which Emacs can display a window hierarchy. We don't define
@@ -137,11 +117,6 @@ enum Lisp_Type
137 Only make-local-variable does that. */ 117 Only make-local-variable does that. */
138 Lisp_Some_Buffer_Local_Value, 118 Lisp_Some_Buffer_Local_Value,
139 119
140
141 /* Like Lisp_Objfwd except that value lives in a slot
142 in the current buffer. Value is byte index of slot within buffer */
143 Lisp_Buffer_Objfwd,
144
145 /* Window used for Emacs display. 120 /* Window used for Emacs display.
146 Data inside looks like a Lisp_Vector. */ 121 Data inside looks like a Lisp_Vector. */
147 Lisp_Window, 122 Lisp_Window,
@@ -166,8 +141,12 @@ enum Lisp_Type
166 The first member of the structure is a type code from this set. */ 141 The first member of the structure is a type code from this set. */
167enum Lisp_Misc_Type 142enum Lisp_Misc_Type
168 { 143 {
144 Lisp_Misc_Free,
169 Lisp_Misc_Marker, 145 Lisp_Misc_Marker,
170 Lisp_Misc_Free 146 Lisp_Misc_Intfwd,
147 Lisp_Misc_Boolfwd,
148 Lisp_Misc_Objfwd,
149 Lisp_Misc_Buffer_Objfwd
171 }; 150 };
172 151
173#ifndef NO_UNION_TYPE 152#ifndef NO_UNION_TYPE
@@ -432,12 +411,14 @@ extern int pure_size;
432#define XSTRING(a) ((struct Lisp_String *) XPNTR(a)) 411#define XSTRING(a) ((struct Lisp_String *) XPNTR(a))
433#define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a)) 412#define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a))
434#define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) 413#define XMISC(a) ((union Lisp_Misc *) XPNTR(a))
435#define XOBJFWD(a) ((Lisp_Object *) XPNTR(a))
436#define XINTPTR(a) ((int *) XPNTR(a))
437#define XWINDOW(a) ((struct window *) XPNTR(a)) 414#define XWINDOW(a) ((struct window *) XPNTR(a))
438#define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a)) 415#define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
439#define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a)) 416#define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a))
440#define XMARKER(a) (&(XMISC(a)->u_marker)) 417#define XMARKER(a) (&(XMISC(a)->u_marker))
418#define XINTFWD(a) (&(XMISC(a)->u_intfwd))
419#define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd))
420#define XOBJFWD(a) (&(XMISC(a)->u_objfwd))
421#define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd))
441 422
442#define XSETINT(a, b) XSET (a, Lisp_Int, b) 423#define XSETINT(a, b) XSET (a, Lisp_Int, b)
443#define XSETCONS(a, b) XSET (a, Lisp_Cons, b) 424#define XSETCONS(a, b) XSET (a, Lisp_Cons, b)
@@ -447,14 +428,10 @@ extern int pure_size;
447#define XSETSTRING(a, b) XSET (a, Lisp_String, b) 428#define XSETSTRING(a, b) XSET (a, Lisp_String, b)
448#define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b) 429#define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b)
449#define XSETMISC(a, b) XSET (a, Lisp_Misc, b) 430#define XSETMISC(a, b) XSET (a, Lisp_Misc, b)
450#define XSETOBJFWD(a, b) XSET (a, Lisp_Objfwd, b)
451#define XSETWINDOW(a, b) XSET (a, Lisp_Window, b) 431#define XSETWINDOW(a, b) XSET (a, Lisp_Window, b)
452#define XSETPROCESS(a, b) XSET (a, Lisp_Process, b) 432#define XSETPROCESS(a, b) XSET (a, Lisp_Process, b)
453#define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) 433#define XSETFLOAT(a, b) XSET (a, Lisp_Float, b)
454#define XSETBOOLFWD(a, b) XSET (a, Lisp_Boolfwd, b)
455#define XSETBUFFER_OBJFWD(a, b) XSET (a, Lisp_Buffer_Objfwd, b)
456#define XSETWINDOW_CONFIGURATION(a, b) XSET (a, Lisp_Window_Configuration, b) 434#define XSETWINDOW_CONFIGURATION(a, b) XSET (a, Lisp_Window_Configuration, b)
457#define XSETINTFWD(a, b) XSET (a, Lisp_Intfwd, b)
458#define XSETMARKER(a, b) (XSETMISC (a, b), XMISC (a)->type = Lisp_Misc_Marker) 435#define XSETMARKER(a, b) (XSETMISC (a, b), XMISC (a)->type = Lisp_Misc_Marker)
459 436
460#ifdef USE_TEXT_PROPERTIES 437#ifdef USE_TEXT_PROPERTIES
@@ -577,9 +554,15 @@ struct Lisp_Subr
577 char *prompt; 554 char *prompt;
578 char *doc; 555 char *doc;
579 }; 556 };
557
558/* A miscellaneous object, when it's on the free list. */
559struct Lisp_Free
560 {
561 enum Lisp_Misc_Type type; /* = Lisp_Misc_Free */
562 union Lisp_Misc *chain;
563 };
580 564
581/* In a marker, the markbit of the chain field is used as the gc mark bit */ 565/* In a marker, the markbit of the chain field is used as the gc mark bit */
582
583struct Lisp_Marker 566struct Lisp_Marker
584 { 567 {
585 enum Lisp_Misc_Type type; /* = Lisp_Misc_Marker */ 568 enum Lisp_Misc_Type type; /* = Lisp_Misc_Marker */
@@ -588,11 +571,42 @@ struct Lisp_Marker
588 int bufpos; 571 int bufpos;
589 }; 572 };
590 573
591/* A miscellaneous object, when it's on the free list. */ 574/* Forwarding pointer to an int variable.
592struct Lisp_Free 575 This is allowed only in the value cell of a symbol,
576 and it means that the symbol's value really lives in the
577 specified int variable. */
578struct Lisp_Intfwd
593 { 579 {
594 enum Lisp_Misc_Type type; /* = Lisp_Misc_Free */ 580 enum Lisp_Misc_Type type; /* = Lisp_Misc_Intfwd */
595 union Lisp_Misc *chain; 581 int *intvar;
582 };
583
584/* Boolean forwarding pointer to an int variable.
585 This is like Lisp_Intfwd except that the ostensible
586 "value" of the symbol is t if the int variable is nonzero,
587 nil if it is zero. */
588struct Lisp_Boolfwd
589 {
590 enum Lisp_Misc_Type type; /* = Lisp_Misc_Boolfwd */
591 int *boolvar;
592 };
593
594/* Forwarding pointer to a Lisp_Object variable.
595 This is allowed only in the value cell of a symbol,
596 and it means that the symbol's value really lives in the
597 specified variable. */
598struct Lisp_Objfwd
599 {
600 enum Lisp_Misc_Type type; /* = Lisp_Misc_Objfwd */
601 Lisp_Object *objvar;
602 };
603
604/* Like Lisp_Objfwd except that value lives in a slot in the
605 current buffer. Value is byte index of slot within buffer. */
606struct Lisp_Buffer_Objfwd
607 {
608 enum Lisp_Misc_Type type; /* = Lisp_Misc_Buffer_Objfwd */
609 int offset;
596 }; 610 };
597 611
598union Lisp_Misc 612union Lisp_Misc
@@ -600,6 +614,10 @@ union Lisp_Misc
600 enum Lisp_Misc_Type type; 614 enum Lisp_Misc_Type type;
601 struct Lisp_Free u_free; 615 struct Lisp_Free u_free;
602 struct Lisp_Marker u_marker; 616 struct Lisp_Marker u_marker;
617 struct Lisp_Intfwd u_intfwd;
618 struct Lisp_Boolfwd u_boolfwd;
619 struct Lisp_Objfwd u_objfwd;
620 struct Lisp_Buffer_Objfwd u_buffer_objfwd;
603 }; 621 };
604 622
605#ifdef LISP_FLOAT_TYPE 623#ifdef LISP_FLOAT_TYPE
@@ -735,13 +753,13 @@ typedef unsigned char UCHAR;
735#define FLOATP(x) (0) 753#define FLOATP(x) (0)
736#endif 754#endif
737#define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay) 755#define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay)
738#define BOOLFWDP(x) (XTYPE ((x)) == Lisp_Boolfwd)
739#define INTFWDP(x) (XTYPE ((x)) == Lisp_Intfwd)
740#define OBJFWDP(x) (XTYPE ((x)) == Lisp_Objfwd)
741#define BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Buffer_Local_Value) 756#define BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Buffer_Local_Value)
742#define SOME_BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Some_Buffer_Local_Value) 757#define SOME_BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Some_Buffer_Local_Value)
743#define BUFFER_OBJFWDP(x) (XTYPE ((x)) == Lisp_Buffer_Objfwd)
744#define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker) 758#define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker)
759#define INTFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd)
760#define BOOLFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd)
761#define OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd)
762#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd)
745 763
746#define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) 764#define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
747#define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) 765#define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))
@@ -1204,7 +1222,7 @@ extern Lisp_Object Fcopy_alist ();
1204 1222
1205/* Defined in alloc.c */ 1223/* Defined in alloc.c */
1206extern Lisp_Object Vpurify_flag; 1224extern Lisp_Object Vpurify_flag;
1207extern Lisp_Object Fcons (), Flist(), Fmake_list (); 1225extern Lisp_Object Fcons (), Flist(), Fmake_list (), allocate_misc ();
1208extern Lisp_Object Fmake_vector (), Fvector (), Fmake_symbol (), Fmake_marker (); 1226extern Lisp_Object Fmake_vector (), Fvector (), Fmake_symbol (), Fmake_marker ();
1209extern Lisp_Object Fmake_string (), build_string (), make_string (); 1227extern Lisp_Object Fmake_string (), build_string (), make_string ();
1210extern Lisp_Object make_event_array (), make_uninit_string (); 1228extern Lisp_Object make_event_array (), make_uninit_string ();