> Hello
>
>
> This is what I want to do (from Lua archive). In short, if the one can
> enumerate all windows in Windows, using neko program only (of course, it
> can use some general purpose dll to allow it for dynamic calls and
> callbacks, but this shouldn't depend on particular API function):
Most of the C callbacks allow you to pass an extra parameter, so here's
a quick example :
// your fake Enum API :
typedef void (*enum_function)( int item, void *param );
void do_enum( enum_function f, void *param ) {
f(1,param);
f(2,param);
f(3,param);
}
// your program, you want to use do_enum with a neko function
value neko_do_enum( value neko_function ) {
val_check_function(neko_function,1); // takes 1 parameter
do_enum(neko_wrapper,neko_function);
return val_null;
}
// and your wrapper which callback your neko function :
void neko_wrapper( int item, void *param ) {
val_call1((value)param,alloc_int(item));
}
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)