2 Oct
2019
2 Oct
'19
7:42 a.m.
(Sorry if this basic question has been answered before; didn't find in the list archives, wiki or manual.) What's the general approach for wrapping C functions like this: int foo(struct bar **out); So the foo function sets *out to some value of type "struct bar *", and we want to keep that "struct bar *" in Scheme and pass it around to other FFI functions. If it's not necessary to preserve the "int" return value then this can be worked around by writing a wrapper function in C: struct bar *my_foo_wrapper(void) { struct bar *bar; foo(&bar); return bar; } But is there a more general way to get values from out parameters into Scheme?
2508
Age (days ago)
2508
Last active (days ago)
0 comments
1 participants
participants (1)
-
Lassi Kortela