On 19/02/2017 17:32, Christoph Egger wrote:
> Hi!
>
> [0] discusses how to pass a callback to some C library. Now I would like
> to pass a function from some C library to some C library. Is there a
> better way to express this than using <cCall ...> to get a smalltalk
> function and CCallbackDescriptor to pass it back?
You can get the address of a C function with something like
CFunctionDescriptor addressOf: 'unlink'
If the function is not defined, the returned object will satisfy #isNull:
st> (CFunctionDescriptor addressOf: 'unlink') isNull
false
st> (CFunctionDescriptor addressOf: 'aaa') isNull
true
Paolo
_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk