Ok, so the function returns a handle to the module? How then do I make function calls to that module?
Lee -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nicolas Cannasse Sent: 22 May 2006 11:54 To: Neko intermediate language mailing list Subject: Re: [Neko] Calling neko / haXe functions from a C library > 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) -- Neko : One VM to run them all (http://nekovm.org)
