diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-02 18:57:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-02 18:57:48 -0700 |
commit | 8d52205b778c41e438192c5bc4187edd679fbdfd (patch) | |
tree | 9f082467fa66bac00206adf2fee0d04bb753b284 /lisplib.c | |
parent | abbc0d00006c3126b9d1cf8150c21f4a8c56089a (diff) | |
download | txr-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |