diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lisp.h b/src/lisp.h index 61ead0907d3..9fe189f36f5 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -307,6 +307,11 @@ extern int pure_size; | |||
| 307 | ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK)) | 307 | ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK)) |
| 308 | #endif | 308 | #endif |
| 309 | 309 | ||
| 310 | /* Convert a C integer into a Lisp_Object integer. */ | ||
| 311 | |||
| 312 | #define make_number(N) \ | ||
| 313 | ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS) | ||
| 314 | |||
| 310 | /* During garbage collection, XGCTYPE must be used for extracting types | 315 | /* During garbage collection, XGCTYPE must be used for extracting types |
| 311 | so that the mark bit is ignored. XMARKBIT accesses the markbit. | 316 | so that the mark bit is ignored. XMARKBIT accesses the markbit. |
| 312 | Markbits are used only in particular slots of particular structure types. | 317 | Markbits are used only in particular slots of particular structure types. |
| @@ -510,6 +515,21 @@ struct Lisp_Cons | |||
| 510 | Lisp_Object car, cdr; | 515 | Lisp_Object car, cdr; |
| 511 | }; | 516 | }; |
| 512 | 517 | ||
| 518 | /* Take the car or cdr of something known to be a cons cell. */ | ||
| 519 | #define XCAR(c) (XCONS ((c))->car) | ||
| 520 | #define XCDR(c) (XCONS ((c))->cdr) | ||
| 521 | |||
| 522 | /* Take the car or cdr of something whose type is not known. */ | ||
| 523 | #define CAR(c) \ | ||
| 524 | (CONSP ((c)) ? XCAR ((c)) \ | ||
| 525 | : NILP ((c)) ? Qnil \ | ||
| 526 | : wrong_type_argument (Qlistp, (c))) | ||
| 527 | |||
| 528 | #define CDR(c) \ | ||
| 529 | (CONSP ((c)) ? XCDR ((c)) \ | ||
| 530 | : NILP ((c)) ? Qnil \ | ||
| 531 | : wrong_type_argument (Qlistp, (c))) | ||
| 532 | |||
| 513 | /* Like a cons, but records info on where the text lives that it was read from */ | 533 | /* Like a cons, but records info on where the text lives that it was read from */ |
| 514 | /* This is not really in use now */ | 534 | /* This is not really in use now */ |
| 515 | 535 | ||
| @@ -1400,7 +1420,6 @@ extern Lisp_Object Flsh (), Fash (); | |||
| 1400 | 1420 | ||
| 1401 | extern Lisp_Object Fadd1 (), Fsub1 (); | 1421 | extern Lisp_Object Fadd1 (), Fsub1 (); |
| 1402 | 1422 | ||
| 1403 | extern Lisp_Object make_number (); | ||
| 1404 | extern Lisp_Object long_to_cons (); | 1423 | extern Lisp_Object long_to_cons (); |
| 1405 | extern unsigned long cons_to_long (); | 1424 | extern unsigned long cons_to_long (); |
| 1406 | extern void args_out_of_range (); | 1425 | extern void args_out_of_range (); |