chickadee » bind » bind-opaque-type

(bind-opaque-type TYPENAME SCHEMETYPE)syntax

Similar to bind-type, but provides automatic argument- and result conversions to wrap a value into a structure:

(bind-opaque-type myfile (pointer "FILE"))

(bind "myfile fopen(char *, char *);")

(fopen "somefile" "r")   ==> <myfile>

(bind-opaque-type TYPENAME TYPE) is basically equivalent to (bind-type TYPENAME TYPE TYPE->RECORD RECORD->TYPE) where TYPE->RECORD and RECORD->TYPE are compiler-generated conversion functions that wrap objects of type TYPE into a record and back.