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

>   Christoph
> 
> [0] 
> https://www.gnu.org/software/smalltalk/manual/html_node/Smalltalk-callbacks.html
> 
> 
> 
> _______________________________________________
> help-smalltalk mailing list
> help-smalltalk@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-smalltalk
> 

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to