From 0dd1d1a586fcfcf11e0b1c926c8be9c4c8d525be Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 21 Aug 2019 17:32:13 -0700 Subject: 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. --- txr.1 | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 0f025e9a..8c5805e8 100644 --- a/txr.1 +++ b/txr.1 @@ -49650,13 +49650,13 @@ This symbol becomes the object's type tag. The lifetime of the returned -.cptr +.code cptr object is independent from that of .metn object . If the lifetime of .meta object reaches its end before that of the -.code cptr , +.codn cptr , the pointer stored inside the .code cptr becomes invalid. @@ -49683,6 +49683,41 @@ type, then the expression reproduces .metn n . +.coNP Function @ cptr-buf +.synb +.mets (cptr-obj < buf <> [ type-symbol ]) +.syne +.desc +The +.code cptr-buf +returns a +.code cptr +object which holds a pointer to a buffer object's storage +area. The +.meta buf +argument must be of type +.codn buf . + +The +.meta type-symbol +argument should be a symbol. If omitted, it defaults to +.codn nil . +This symbol becomes the +.code cptr +object's type tag. + +The lifetime of the returned +.code cptr +object is independent from that of +.metn buf . +If the lifetime of +.meta buf +reaches its end before that of the +.codn cptr , +the pointer stored inside the +.code cptr +becomes invalid. + .coNP Function @ cptr-cast .synb .mets (cptr-cast < type-symbol << cptr ) -- cgit v1.2.3