From 8d52205b778c41e438192c5bc4187edd679fbdfd Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 2 Jun 2017 18:57:48 -0700 Subject: 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. --- ffi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ffi.h') 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); -- cgit v1.2.3