Mercurial > emacs
comparison src/lisp.h @ 11335:78eda0ee4cba
(XMISCTYPE): New macro.
(union Lisp_Misc): Delete the `type' field.
Use XMISCTYPE instead of that.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 10 Apr 1995 00:31:47 +0000 |
parents | de3d87b4c418 |
children | 595afe6de74d |
comparison
equal
deleted
inserted
replaced
11334:8c536ef844ee | 11335:78eda0ee4cba |
---|---|
375 #define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a)) | 375 #define XSYMBOL(a) ((struct Lisp_Symbol *) XPNTR(a)) |
376 #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a)) | 376 #define XFLOAT(a) ((struct Lisp_Float *) XPNTR(a)) |
377 | 377 |
378 /* Misc types. */ | 378 /* Misc types. */ |
379 #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) | 379 #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) |
380 #define XMISCTYPE(a) (XMARKER (a)->type) | |
380 #define XMARKER(a) (&(XMISC(a)->u_marker)) | 381 #define XMARKER(a) (&(XMISC(a)->u_marker)) |
381 #define XINTFWD(a) (&(XMISC(a)->u_intfwd)) | 382 #define XINTFWD(a) (&(XMISC(a)->u_intfwd)) |
382 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) | 383 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) |
383 #define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) | 384 #define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) |
384 #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) | 385 #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) |
402 #define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b) | 403 #define XSETSYMBOL(a, b) XSET (a, Lisp_Symbol, b) |
403 #define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) | 404 #define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) |
404 | 405 |
405 /* Misc types. */ | 406 /* Misc types. */ |
406 #define XSETMISC(a, b) XSET (a, Lisp_Misc, b) | 407 #define XSETMISC(a, b) XSET (a, Lisp_Misc, b) |
407 #define XSETMARKER(a, b) (XSETMISC (a, b), XMISC (a)->type = Lisp_Misc_Marker) | 408 #define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker) |
408 | 409 |
409 /* Pseudovector types. */ | 410 /* Pseudovector types. */ |
410 #define XSETPSEUDOVECTOR(a, b, code) \ | 411 #define XSETPSEUDOVECTOR(a, b, code) \ |
411 (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code)) | 412 (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code)) |
412 #define XSETWINDOW_CONFIGURATION(a, b) \ | 413 #define XSETWINDOW_CONFIGURATION(a, b) \ |
770 int spacer : 16; | 771 int spacer : 16; |
771 int offset; | 772 int offset; |
772 }; | 773 }; |
773 | 774 |
774 | 775 |
776 /* To get the type field of a union Lisp_Misc, use XMISCTYPE. | |
777 It uses one of these struct subtypes to get the type field. */ | |
778 | |
775 union Lisp_Misc | 779 union Lisp_Misc |
776 { | 780 { |
777 int type : 16; | |
778 struct Lisp_Free u_free; | 781 struct Lisp_Free u_free; |
779 struct Lisp_Marker u_marker; | 782 struct Lisp_Marker u_marker; |
780 struct Lisp_Intfwd u_intfwd; | 783 struct Lisp_Intfwd u_intfwd; |
781 struct Lisp_Boolfwd u_boolfwd; | 784 struct Lisp_Boolfwd u_boolfwd; |
782 struct Lisp_Objfwd u_objfwd; | 785 struct Lisp_Objfwd u_objfwd; |
924 #define FLOATP(x) (0) | 927 #define FLOATP(x) (0) |
925 #define GC_FLOATP(x) (0) | 928 #define GC_FLOATP(x) (0) |
926 #endif | 929 #endif |
927 #define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) | 930 #define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) |
928 #define GC_VECTORP(x) (GC_VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) | 931 #define GC_VECTORP(x) (GC_VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG)) |
929 #define OVERLAYP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Overlay) | 932 #define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay) |
930 #define GC_OVERLAYP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Overlay) | 933 #define GC_OVERLAYP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay) |
931 #define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker) | 934 #define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) |
932 #define GC_MARKERP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker) | 935 #define GC_MARKERP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) |
933 #define INTFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd) | 936 #define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd) |
934 #define GC_INTFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd) | 937 #define GC_INTFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd) |
935 #define BOOLFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd) | 938 #define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd) |
936 #define GC_BOOLFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd) | 939 #define GC_BOOLFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd) |
937 #define OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd) | 940 #define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd) |
938 #define GC_OBJFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd) | 941 #define GC_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd) |
939 #define BUFFER_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd) | 942 #define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd) |
940 #define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd) | 943 #define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd) |
941 #define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Local_Value) | 944 #define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value) |
942 #define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Local_Value) | 945 #define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value) |
943 #define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Some_Buffer_Local_Value) | 946 #define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value) |
944 #define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Some_Buffer_Local_Value) | 947 #define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value) |
945 #define KBOARD_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Kboard_Objfwd) | 948 #define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd) |
946 #define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Kboard_Objfwd) | 949 #define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd) |
947 | 950 |
948 | 951 |
949 /* True if object X is a pseudovector whose code is CODE. */ | 952 /* True if object X is a pseudovector whose code is CODE. */ |
950 #define PSEUDOVECTORP(x, code) \ | 953 #define PSEUDOVECTORP(x, code) \ |
951 (VECTORLIKEP (x) \ | 954 (VECTORLIKEP (x) \ |