github.com/aergoio/aergo@v1.3.1/contract/vm.h (about) 1 #ifndef _VM_H 2 #define _VM_H 3 4 #include <lualib.h> 5 #include <lauxlib.h> 6 #include <luajit.h> 7 #include "sqlite3-binding.h" 8 9 extern const char *construct_name; 10 11 lua_State *vm_newstate(); 12 int vm_isnil(lua_State *L, int idx); 13 void vm_getfield(lua_State *L, const char *name); 14 void vm_get_constructor(lua_State *L); 15 void vm_remove_constructor(lua_State *L); 16 const char *vm_loadbuff(lua_State *L, const char *code, size_t sz, char *hex_id, int *service); 17 const char *vm_pcall(lua_State *L, int argc, int* nresult); 18 const char *vm_get_json_ret(lua_State *L, int nresult, int *err); 19 const char *vm_copy_result(lua_State *L, lua_State *target, int cnt); 20 sqlite3 *vm_get_db(lua_State *L); 21 void vm_get_abi_function(lua_State *L, char *fname); 22 int vm_is_payable_function(lua_State *L, char *fname); 23 char *vm_resolve_function(lua_State *L, char *fname, int *viewflag, int *payflag); 24 void vm_set_count_hook(lua_State *L, int limit); 25 void vm_db_release_resource(lua_State *L); 26 27 #endif /* _VM_H */