diff options
| author | Aurélien Aptel | 2015-11-16 00:42:14 +0100 |
|---|---|---|
| committer | Ted Zlatanov | 2015-11-18 14:24:06 -0500 |
| commit | f69cd6bfa114ea02f3d10ddb2fe809a26eafb9a4 (patch) | |
| tree | 05788868cfcc5fda30d37a83e18de6aab8b1735b /src/data.c | |
| parent | 435cf35bcc28ab4220764dff7874f477310d9a48 (diff) | |
| download | emacs-f69cd6bfa114ea02f3d10ddb2fe809a26eafb9a4.tar.gz emacs-f69cd6bfa114ea02f3d10ddb2fe809a26eafb9a4.zip | |
Add new User Pointer (User_Ptr) type
* src/lisp.h: Add new Lisp_Misc_User_Ptr type.
(XUSER_PTR): New User_Ptr accessor.
* src/alloc.c (make_user_ptr): New function.
(mark_object, sweep_misc): Handle Lisp_Misc_User_Ptr.
* src/data.c (Ftype_of): Return 'user-ptr' for user pointer.
(Fuser-ptrp): New user pointer type predicate function.
(syms_of_data): New 'user-ptrp', 'user-ptr' symbol. New 'user-ptrp'
subr.
* src/print.c (print_object): Add printer for User_Ptr type.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c index 51546044c68..1e9cc814f00 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -223,6 +223,10 @@ for example, (type-of 1) returns `integer'. */) | |||
| 223 | return Qfloat; | 223 | return Qfloat; |
| 224 | case Lisp_Misc_Finalizer: | 224 | case Lisp_Misc_Finalizer: |
| 225 | return Qfinalizer; | 225 | return Qfinalizer; |
| 226 | #ifdef HAVE_MODULES | ||
| 227 | case Lisp_Misc_User_Ptr: | ||
| 228 | return Quser_ptr; | ||
| 229 | #endif | ||
| 226 | default: | 230 | default: |
| 227 | emacs_abort (); | 231 | emacs_abort (); |
| 228 | } | 232 | } |
| @@ -424,6 +428,17 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0, | |||
| 424 | return Qnil; | 428 | return Qnil; |
| 425 | } | 429 | } |
| 426 | 430 | ||
| 431 | #ifdef HAVE_MODULES | ||
| 432 | DEFUN ("user-ptrp", Fuser_ptrp, Suser_ptrp, 1, 1, 0, | ||
| 433 | doc: /* Return t if OBJECT is a module user pointer. */) | ||
| 434 | (Lisp_Object object) | ||
| 435 | { | ||
| 436 | if (USER_PTRP (object)) | ||
| 437 | return Qt; | ||
| 438 | return Qnil; | ||
| 439 | } | ||
| 440 | #endif | ||
| 441 | |||
| 427 | DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, | 442 | DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, |
| 428 | doc: /* Return t if OBJECT is a built-in function. */) | 443 | doc: /* Return t if OBJECT is a built-in function. */) |
| 429 | (Lisp_Object object) | 444 | (Lisp_Object object) |
| @@ -3478,6 +3493,9 @@ syms_of_data (void) | |||
| 3478 | DEFSYM (Qbool_vector_p, "bool-vector-p"); | 3493 | DEFSYM (Qbool_vector_p, "bool-vector-p"); |
| 3479 | DEFSYM (Qchar_or_string_p, "char-or-string-p"); | 3494 | DEFSYM (Qchar_or_string_p, "char-or-string-p"); |
| 3480 | DEFSYM (Qmarkerp, "markerp"); | 3495 | DEFSYM (Qmarkerp, "markerp"); |
| 3496 | #ifdef HAVE_MODULES | ||
| 3497 | DEFSYM (Quser_ptrp, "user-ptrp"); | ||
| 3498 | #endif | ||
| 3481 | DEFSYM (Qbuffer_or_string_p, "buffer-or-string-p"); | 3499 | DEFSYM (Qbuffer_or_string_p, "buffer-or-string-p"); |
| 3482 | DEFSYM (Qinteger_or_marker_p, "integer-or-marker-p"); | 3500 | DEFSYM (Qinteger_or_marker_p, "integer-or-marker-p"); |
| 3483 | DEFSYM (Qfboundp, "fboundp"); | 3501 | DEFSYM (Qfboundp, "fboundp"); |
| @@ -3569,6 +3587,9 @@ syms_of_data (void) | |||
| 3569 | DEFSYM (Qmarker, "marker"); | 3587 | DEFSYM (Qmarker, "marker"); |
| 3570 | DEFSYM (Qoverlay, "overlay"); | 3588 | DEFSYM (Qoverlay, "overlay"); |
| 3571 | DEFSYM (Qfinalizer, "finalizer"); | 3589 | DEFSYM (Qfinalizer, "finalizer"); |
| 3590 | #ifdef HAVE_MODULES | ||
| 3591 | DEFSYM (Quser_ptr, "user-ptr"); | ||
| 3592 | #endif | ||
| 3572 | DEFSYM (Qfloat, "float"); | 3593 | DEFSYM (Qfloat, "float"); |
| 3573 | DEFSYM (Qwindow_configuration, "window-configuration"); | 3594 | DEFSYM (Qwindow_configuration, "window-configuration"); |
| 3574 | DEFSYM (Qprocess, "process"); | 3595 | DEFSYM (Qprocess, "process"); |
| @@ -3683,6 +3704,9 @@ syms_of_data (void) | |||
| 3683 | defsubr (&Sbyteorder); | 3704 | defsubr (&Sbyteorder); |
| 3684 | defsubr (&Ssubr_arity); | 3705 | defsubr (&Ssubr_arity); |
| 3685 | defsubr (&Ssubr_name); | 3706 | defsubr (&Ssubr_name); |
| 3707 | #ifdef HAVE_MODULES | ||
| 3708 | defsubr (&Suser_ptrp); | ||
| 3709 | #endif | ||
| 3686 | 3710 | ||
| 3687 | defsubr (&Sbool_vector_exclusive_or); | 3711 | defsubr (&Sbool_vector_exclusive_or); |
| 3688 | defsubr (&Sbool_vector_union); | 3712 | defsubr (&Sbool_vector_union); |