summaryrefslogtreecommitdiffstats
path: root/ffi.h
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 /ffi.h
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 'ffi.h')
-rw-r--r--ffi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ffi.h b/ffi.h
index 9f7876ef..c8f6021b 100644
--- a/ffi.h
+++ b/ffi.h
@@ -64,6 +64,11 @@ mem_t *ffi_closure_get_fptr(val closure);
val ffi_call_wrap(val fptr, val ffi_call_desc, struct args *args);
val ffi_typedef(val name, val type);
val ffi_size(val type);
+val ffi_alignof(val type);
+val ffi_offsetof(val type, val memb);
+val ffi_arraysize(val type);
+val ffi_elemsize(val type);
+val ffi_elemtype(val type);
val ffi_put_into(val dstbuf, val obj, val type);
val ffi_put(val obj, val type);
val ffi_in(val srcbuf, val obj, val type, val copy_p);