diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-19 22:11:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-19 22:11:50 -0700 |
commit | 12d65cff8c48ac1f86b056f542296adbc1fd3651 (patch) | |
tree | 5f983a6dfd2af6f483aacb5cb516a018a986f133 /txr.1 | |
parent | f4c156db5e4505fc1a18ae7d4a6597b656a20aa2 (diff) | |
download | txr-12d65cff8c48ac1f86b056f542296adbc1fd3651.tar.gz txr-12d65cff8c48ac1f86b056f542296adbc1fd3651.tar.bz2 txr-12d65cff8c48ac1f86b056f542296adbc1fd3651.zip |
ffi: new function, carray-cptr.
* ffi.c (carray_cptr): New function.
(ffi_init): Registered intrinsic.
* ffi.h (carray_cptr): Declared.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -54968,6 +54968,47 @@ type, the calculated number of elements is rounded down. The trailing portion of the buffer corresponding to the division remainder, being insufficient to constitute a whole array element, is excluded from the array view. +.coNP Function @ carray-cptr +.synb +.mets (carray-cptr < cptr < type <> [ length ]) +.syne +.desc +The +.code carray-cptr +function creates a +.code carray +object based on a pointer derived from a +.code cptr +object. + +The +.meta cptr +argument must be of type +.codn cptr . +The object's +.code cptr +type tag is ignored. + +The +.meta type +argument must specify a compiled FFI type, which will become +the element type of the returned +.codn carray . + +If +.meta length +is specified as +.codn nil , +or not specified, +then the returned +.code carray +object will be of unknown length. Otherwise, +.meta length +must be a non-negative integer which will be taken as the +length of the array. + +Note: this conversion is inherently unsafe. + .coNP Function @ length-carray .synb .mets (length-carray << carray ) |