I need the address of a Tcl callback routine so I can pass it (using ffidl::callout
) to a C DLL's SetCallback routine, i.e. the C prototype is:
int SetCallback(long lAddress);
I need the address of a Tcl callback routine so I can pass it (using ffidl::callout
) to a C DLL's SetCallback routine, i.e. the C prototype is:
int SetCallback(long lAddress);
Well, you should declare the callout correctly:
::ffidl::callout SetCallback {pointer-proc} int [ffidl::symbol ....]
The important thing is that you declare the parameter as pointer-proc
. This allows you to pass the name of a proc (you have to register it with ::ffidl::callback
first) as argument.
The actual address for that proc is not usually not relevant, and you'll probably never see it.
If you really want the address of the proc (which is rare), then you can use
::ffidl::callout get_address {pointer-proc} pointer [::ffidl::symbol [::ffidl::find-lib ffidl] ffidl_pointer_pun]