diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-21 17:32:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-21 17:32:13 -0700 |
commit | 0dd1d1a586fcfcf11e0b1c926c8be9c4c8d525be (patch) | |
tree | 1e674edaf8401bc52745c930edfe3c114e1073a7 /lib.c | |
parent | bc06c87a10f9d9ddc4209ec0a49ab48bf37dc706 (diff) | |
download | txr-0dd1d1a586fcfcf11e0b1c926c8be9c4c8d525be.tar.gz txr-0dd1d1a586fcfcf11e0b1c926c8be9c4c8d525be.tar.bz2 txr-0dd1d1a586fcfcf11e0b1c926c8be9c4c8d525be.zip |
New function: cptr-buf.
* eval.c (eval_init): Register cptr-buf intrinsic.
* lib.c (cptr_buf): New function.
* lib.h (cptr_buf): Declared.
* txr.1: Documented.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -7832,6 +7832,13 @@ val cptr_obj(val obj, val type_sym_in) return cptr_typed(coerce(mem_t *, obj), type_sym, 0); } +val cptr_buf(val buf, val type_sym_in) +{ + val type_sym = default_null_arg(type_sym_in); + mem_t *ptr = buf_get(buf, lit("cptr-buf")); + return cptr_typed(ptr, type_sym, 0); +} + val cptr_zap(val cptr) { (void) cptr_handle(cptr, nil, lit("cptr-zap")); |