summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-02 18:57:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-02 18:57:48 -0700
commit8d52205b778c41e438192c5bc4187edd679fbdfd (patch)
tree9f082467fa66bac00206adf2fee0d04bb753b284 /lisplib.c
parentabbc0d00006c3126b9d1cf8150c21f4a8c56089a (diff)
downloadtxr-8d52205b778c41e438192c5bc4187edd679fbdfd.tar.gz
txr-8d52205b778c41e438192c5bc4187edd679fbdfd.tar.bz2
txr-8d52205b778c41e438192c5bc4187edd679fbdfd.zip
ffi: functions and macros for basic type properties.
* ffi.c (ffi_alignof, ffi_offsetof, ffi_arraysize, ffi_elemsize, ffi_elemtype): New functions. (ffi_init): Registered intrinsics ffi-alignof, ffi-offsetof, ffi-arraysize, ffi-elemsize, ffi-elemtype. * ffi.h (ffi_alignof, ffi_offsetof, ffi_arraysize, ffi_elemsize, ffi_elemtype): Declared. * lisplib.c (ffi_set_entries): New autoload entries alignof, offsetof, arraysize, elemsize, elemtype. * share/txr/stdlib/ffi.tl (alignof, offsetof, arraysize, elemsize, elemtype): New macros. * txr.1: Documented new functions and macros.
Diffstat (limited to 'lisplib.c')
-rw-r--r--lisplib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisplib.c b/lisplib.c
index df5e9a93..f8ce2f47 100644
--- a/lisplib.c
+++ b/lisplib.c
@@ -524,8 +524,9 @@ static val ffi_set_entries(val dlt, val fun)
{
val name[] = {
lit("with-dyn-lib"), lit("deffi"), lit("deffi-type"), lit("deffi-cb"),
- lit("deffi-var"), lit("typedef"), lit("sizeof"), lit("ffi"),
- lit("carray-ref"),
+ lit("deffi-var"), lit("typedef"), lit("sizeof"), lit("alignof"),
+ lit("offsetof"), lit("arraysize"), lit("elemsize"), lit("elemtype"),
+ lit("ffi"), lit("carray-ref"),
nil
};
set_dlt_entries(dlt, name, fun);