diff options
| author | Gerd Moellmann | 2000-07-13 14:06:39 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-07-13 14:06:39 +0000 |
| commit | c9f6631ca3e3b01415c72615bb0bcaf9a4f00dde (patch) | |
| tree | b253d1ed4efc995e0341b9945bf2d9a3e50ce71c /src | |
| parent | 90d36cb17401e4efaf34d0e88fa93f5d6828f1ad (diff) | |
| download | emacs-c9f6631ca3e3b01415c72615bb0bcaf9a4f00dde.tar.gz emacs-c9f6631ca3e3b01415c72615bb0bcaf9a4f00dde.zip | |
(AREF, ASET, ASIZE): New macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lisp.h b/src/lisp.h index 6967eed2ccd..6835cd64671 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -460,6 +460,7 @@ extern Lisp_Object make_number (); | |||
| 460 | #define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a)) | 460 | #define XFLOAT(a) (eassert (GC_FLOATP(a)),(struct Lisp_Float *) XPNTR(a)) |
| 461 | 461 | ||
| 462 | /* Misc types. */ | 462 | /* Misc types. */ |
| 463 | |||
| 463 | #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) | 464 | #define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) |
| 464 | #define XMISCTYPE(a) (XMARKER (a)->type) | 465 | #define XMISCTYPE(a) (XMARKER (a)->type) |
| 465 | #define XMARKER(a) (&(XMISC(a)->u_marker)) | 466 | #define XMARKER(a) (&(XMISC(a)->u_marker)) |
| @@ -472,6 +473,7 @@ extern Lisp_Object make_number (); | |||
| 472 | #define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd)) | 473 | #define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd)) |
| 473 | 474 | ||
| 474 | /* Pseudovector types. */ | 475 | /* Pseudovector types. */ |
| 476 | |||
| 475 | #define XPROCESS(a) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a)) | 477 | #define XPROCESS(a) (eassert (GC_PROCESSP(a)),(struct Lisp_Process *) XPNTR(a)) |
| 476 | #define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a)) | 478 | #define XWINDOW(a) (eassert (GC_WINDOWP(a)),(struct window *) XPNTR(a)) |
| 477 | #define XSUBR(a) (eassert (GC_SUBRP(a)),(struct Lisp_Subr *) XPNTR(a)) | 479 | #define XSUBR(a) (eassert (GC_SUBRP(a)),(struct Lisp_Subr *) XPNTR(a)) |
| @@ -479,7 +481,6 @@ extern Lisp_Object make_number (); | |||
| 479 | #define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a)) | 481 | #define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a)) |
| 480 | #define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a)) | 482 | #define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a)) |
| 481 | 483 | ||
| 482 | |||
| 483 | /* Construct a Lisp_Object from a value or address. */ | 484 | /* Construct a Lisp_Object from a value or address. */ |
| 484 | 485 | ||
| 485 | #define XSETINT(a, b) XSET (a, Lisp_Int, b) | 486 | #define XSETINT(a, b) XSET (a, Lisp_Int, b) |
| @@ -490,10 +491,12 @@ extern Lisp_Object make_number (); | |||
| 490 | #define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) | 491 | #define XSETFLOAT(a, b) XSET (a, Lisp_Float, b) |
| 491 | 492 | ||
| 492 | /* Misc types. */ | 493 | /* Misc types. */ |
| 494 | |||
| 493 | #define XSETMISC(a, b) XSET (a, Lisp_Misc, b) | 495 | #define XSETMISC(a, b) XSET (a, Lisp_Misc, b) |
| 494 | #define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker) | 496 | #define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker) |
| 495 | 497 | ||
| 496 | /* Pseudovector types. */ | 498 | /* Pseudovector types. */ |
| 499 | |||
| 497 | #define XSETPSEUDOVECTOR(a, b, code) \ | 500 | #define XSETPSEUDOVECTOR(a, b, code) \ |
| 498 | (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code)) | 501 | (XSETVECTOR (a, b), XVECTOR (a)->size |= PSEUDOVECTOR_FLAG | (code)) |
| 499 | #define XSETWINDOW_CONFIGURATION(a, b) \ | 502 | #define XSETWINDOW_CONFIGURATION(a, b) \ |
| @@ -505,6 +508,13 @@ extern Lisp_Object make_number (); | |||
| 505 | #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER)) | 508 | #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER)) |
| 506 | #define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE)) | 509 | #define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE)) |
| 507 | #define XSETBOOL_VECTOR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BOOL_VECTOR)) | 510 | #define XSETBOOL_VECTOR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BOOL_VECTOR)) |
| 511 | |||
| 512 | /* Convenience macros for dealing with Lisp arrays. */ | ||
| 513 | |||
| 514 | #define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX] | ||
| 515 | #define ASET(ARRAY, IDX, VAL) (AREF ((ARRAY), (IDX)) = (VAL)) | ||
| 516 | #define ASIZE(ARRAY) XVECTOR ((ARRAY))->size | ||
| 517 | |||
| 508 | 518 | ||
| 509 | /* Basic data type for use of intervals. See the macros in intervals.h. */ | 519 | /* Basic data type for use of intervals. See the macros in intervals.h. */ |
| 510 | 520 | ||