> Hi Nicolas,
>
> Right, I think I’ve mastered accessing C functions from Neko / haXe, but
> I’m still fuzzy on accessing Neko / haXe functions from C. I’m guessing
> the callback method calls Neko functions from passed objects with
> functions attached?
I'm not sure I understand.
To call an object method, you must use val_ocall* api functions
> I’m also guessing that the Neko VM will have to be
> embedded if I am to call a Neko function directly?
You'll need libneko.so at runtime yes
> I’ve scanned the
> “embedding the vm” several times, but it will need to be broken down a
> little to make much sense in my amateur brain. For instance, where does
> the passed *module get used in the example “execute” function?
There was a typo (fixed).
The module is the filename and is used as argument to the loader.
Actually what the code is doing is the following (in pseudo code) :
var vm = new NekoVM
var loader = new NekoLoader
vm.select();
try {
ret = loader.loadmodule(module,loader);
} catch( e ) {
print("Uncaught exception - "+e);
ret = null;
}
return ret;
> It’s not
> used anywhere there that I can see. Also, what would the possible
> strings *module would likely contain? Would I use a relative url to the
> main module .n file?
Yes exactly.
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)