Build a bridge between Java and Lua script. More...
Static Public Member Functions | |
static int | retainLuaFunctionById (int functionId) |
Add a reference count for the Lua functionId(+1),and save this reference in the Lua table named luaj_function_id_retain. More... | |
static int | releaseLuaFunctionById (int functionId) |
Release a reference count for the Lua functionId(-1).If the reference count is still greater than 0,save this reference in the Lua table named luaj_function_id_retain. More... | |
static int | callLuaFunctionById (int functionId, const char *arg) |
Call the Lua function corresponding to the functionId with the string pointer arg. More... | |
static int | callLuaGlobalFunction (const char *functionName, const char *arg) |
Call a global Lua function named functionName with the string pointer arg. More... | |
Build a bridge between Java and Lua script.
This mechanism make Lua and Java call each other easily.
|
static |
Add a reference count for the Lua functionId(+1),and save this reference in the Lua table named luaj_function_id_retain.
the reference id of Lua function. the reference count of the functionId if luaj_function_id_retain table exists and the corresponding value for functionId exists, otherwise return 0.
|
static |
Release a reference count for the Lua functionId(-1).If the reference count is still greater than 0,save this reference in the Lua table named luaj_function_id_retain.
Otherwise, remove the reference about this functionId in the luaj_function_id table and the luaj_function_id_retain table by set the corresponding value nil.
the reference id of Lua function. the retain count or 0.
|
static |
Call the Lua function corresponding to the functionId with the string pointer arg.
the reference id to the Lua function. the string pointer point to the argument. a number value returned from the Lua function when call sucessfully, otherwise return -1 or the opposite number for one of the three numbers LUA_ERRRUN,LUA_ERRMEM and LUA_ERRERR.
|
static |
Call a global Lua function named functionName with the string pointer arg.
the name of global function. the string pointer point to the argument. a number value returned frome the Lua function when call sucessfully, otherwise return -1 or the opposite number for one of the three numbers LUA_ERRRUN,LUA_ERRMEM and LUA_ERRERR.