Mercurial > emacs
changeset 9435:3a157cdf395c
(Lisp_Misc): new type code, replacing Lisp_Marker (and soon to replace other
type codes as well).
(XMARKER, SETMARKER, MARKERP): Check/set the new type field.
(XMISC, SETMISC, MISCP): New accessor macros for the superset type.
(struct Lisp_Free): New structure.
(Lisp_Misc_Free): Type code for that structure.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 11 Oct 1994 07:45:20 +0000 |
parents | d79ecfc2776c |
children | 907353876b8b |
files | src/lisp.h |
diffstat | 1 files changed, 26 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lisp.h Tue Oct 11 07:29:05 1994 +0000 +++ b/src/lisp.h Tue Oct 11 07:45:20 1994 +0000 @@ -38,8 +38,9 @@ /* Symbol. XSYMBOL (object) points to a struct Lisp_Symbol. */ Lisp_Symbol, - /* Marker (buffer ptr). XMARKER(object) points to a struct Lisp_Marker. */ - Lisp_Marker, + /* Miscellaneous. XMISC (object) points to a union Lisp_Misc, + whose first member indicates the subtype. */ + Lisp_Misc, /* String. XSTRING (object) points to a struct Lisp_String. The length of the string, and its contents, are stored therein. */ @@ -161,11 +162,12 @@ Lisp_Overlay }; -/* This is the set of datatypes that share the marker structure. +/* This is the set of datatypes that share a common structure. The first member of the structure is a type code from this set. */ enum Lisp_Misc_Type { - Lisp_Misc_Marker + Lisp_Misc_Marker, + Lisp_Misc_Free }; #ifndef NO_UNION_TYPE @@ -429,12 +431,13 @@ #define XSUBR(a) ((struct Lisp_Subr *) XPNTR(a)) #define XSTRING(a) ((struct Lisp_String *) XPNTR(a)) #define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a)) -#define XMARKER(a) ((struct Lisp_Marker *) XPNTR(a)) +#define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) #define XOBJFWD(a) ((Lisp_Object *) XPNTR(a)) #define XINTPTR(a) ((int *) XPNTR(a)) #define XWINDOW(a) ((struct window *) XPNTR(a)) #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a)) #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a)) +#define XMARKER(a) (&(XMISC(a)->u_marker)) #define XSETINT(a, b) XSET (a, Lisp_Int, b) #define XSETCONS(a, b) XSET (a, Lisp_Cons, b) @@ -443,7 +446,7 @@ #define XSETSUBR(a, b) XSET (a, Lisp_Subr, b) #define XSETSTRING(a, b) XSET (a, Lisp_String, b) #define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b) -#define XSETMARKER(a, b) XSET (a, Lisp_Marker, b) +#define XSETMISC(a, b) XSET (a, Lisp_Misc, b) #define XSETOBJFWD(a, b) XSET (a, Lisp_Objfwd, b) #define XSETWINDOW(a, b) XSET (a, Lisp_Window, b) #define XSETPROCESS(a, b) XSET (a, Lisp_Process, b) @@ -452,6 +455,7 @@ #define XSETBUFFER_OBJFWD(a, b) XSET (a, Lisp_Buffer_Objfwd, b) #define XSETWINDOW_CONFIGURATION(a, b) XSET (a, Lisp_Window_Configuration, b) #define XSETINTFWD(a, b) XSET (a, Lisp_Intfwd, b) +#define XSETMARKER(a, b) (XSETMISC (a, b), XMISC (a)->type = Lisp_Misc_Marker) #ifdef USE_TEXT_PROPERTIES /* Basic data type for use of intervals. See the macros in intervals.h */ @@ -584,6 +588,20 @@ int bufpos; }; +/* A miscellaneous object, when it's on the free list. */ +struct Lisp_Free + { + enum Lisp_Misc_Type type; /* = Lisp_Misc_Free */ + union Lisp_Misc *chain; + }; + +union Lisp_Misc + { + enum Lisp_Misc_Type type; + struct Lisp_Free u_free; + struct Lisp_Marker u_marker; + }; + #ifdef LISP_FLOAT_TYPE /* Optional Lisp floating point type */ struct Lisp_Float @@ -700,7 +718,7 @@ #define INTEGERP(x) (XTYPE ((x)) == Lisp_Int) #define SYMBOLP(x) (XTYPE ((x)) == Lisp_Symbol) -#define MARKERP(x) (XTYPE ((x)) == Lisp_Marker) +#define MISCP(x) (XTYPE ((x)) == Lisp_Misc) #define STRINGP(x) (XTYPE ((x)) == Lisp_String) #define VECTORP(x) (XTYPE ((x)) == Lisp_Vector) #define CONSP(x) (XTYPE ((x)) == Lisp_Cons) @@ -723,6 +741,7 @@ #define BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Buffer_Local_Value) #define SOME_BUFFER_LOCAL_VALUEP(x) (XTYPE ((x)) == Lisp_Some_Buffer_Local_Value) #define BUFFER_OBJFWDP(x) (XTYPE ((x)) == Lisp_Buffer_Objfwd) +#define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker) #define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))