ezpresso ezpresso - 1 month ago 6
C Question

What are neko_vm_custom() and neko_vm_set_custom() for?

I am embedding Neko VM into my desktop application. I did a lot of searching, but I am still unable to find out any helpful information regarding these 2 functions, which are declared in the

neko_vm.h
:

void *neko_vm_custom( neko_vm *vm, vkind k );
void neko_vm_set_custom( neko_vm *vm, vkind k, void *v );


What are these functions for?

Update 1



Got some response here.

Answer

with neko_vm_set_custom you can attach a custom variable (a context for example) of a user defined kind to your neko virtual machine.

with neko_vm_custom you get that variable of that kind back.

an example might be: you have one or more vm's running, which are connected to their databases. with neko_vm_set_custom you attach the database connection for specific vm and with neko_vm_custom you can get it back.

Comments