Next: objects misc func, Previous: objects misc charp, Up: objects misc [Index]
When interfacing a C language foreign library with Vicare, it is often needed to convert Scheme objects to raw memory blocks, possibly containing ASCIIZ strings. Generalised C buffers are meant to be used in interfaces to foreign C language libraries, when a pointer to raw data is required as argument. (vicare-libs)Introduction to generalised C buffers for details.
Notice that at the C language level only general C buffers exist: Scheme strings should be converted to bytevectors at the Scheme level.
Return the number of bytes in a generalised C buffer object.
buffer must be a bytevector, pointer object or memory-block
struct instance.
When buffer is a pointer object: buffer_len must be an exact
integer (in the range of the C language type size_t
) representing
the number of bytes available in the referenced memory block. Otherwise
buffer_len is ignored.
Given a bytevector object or a pointer object or a memory-block
object return a void *
pointer referencing the data. The second
macro accepts also #f
as value and returns NULL
.
Given a pointer object or a memory-block
object return a
void *
pointer referencing the data. The second macro accepts
also #f
as value and returns NULL
.
Given a bytevector object or a pointer object or a memory-block
object return a char *
pointer referencing the data. The second
macro accepts also #f
as value and returns NULL
.
Next: objects misc func, Previous: objects misc charp, Up: objects misc [Index]