11#define NLUA_LOAD_TABLE "_LOADED"
13#define NLUA_DONE "__done__"
15#define nluaL_optarg(L,ind,def,checkfunc) \
16 (lua_isnoneornil(L,ind) ? (def) : checkfunc(L,ind))
19extern lua_State *naevL;
20extern nlua_env __NLUA_CURENV;
27nlua_env nlua_newEnv (
void);
28void nlua_freeEnv(nlua_env env);
29void nlua_pushenv(lua_State* L, nlua_env env);
30void nlua_setenv(lua_State* L, nlua_env env,
const char *name);
31void nlua_getenv(lua_State* L, nlua_env env,
const char *name);
32void nlua_register(nlua_env env,
const char *libname,
33 const luaL_Reg *l,
int metatable);
34int nlua_dobufenv(nlua_env env,
38int nlua_dofileenv(nlua_env env,
const char *filename);
39int nlua_dochunkenv( nlua_env env,
int chunk,
const char *name );
42int nlua_pcall( nlua_env env,
int nargs,
int nresults );
48int nlua_ref( lua_State *L,
int idx );
55void nlua_pushEnvTable( lua_State *L );
void nlua_unref(lua_State *L, int idx)
Removes a reference set with nlua_ref.
int nlua_refenv(nlua_env env, const char *name)
Gets the reference of a global in a lua environment.
int nlua_ref(lua_State *L, int idx)
Creates a new reference to a Lua structure at a position.
int nlua_loadStandard(nlua_env env)
Loads the standard Naev Lua API.
int nlua_refenvtype(nlua_env env, const char *name, int type)
Gets the reference of a global in a lua environment if it matches a type.
int nlua_reffield(int objref, const char *name)
Gets the reference to the specified field from an object reference.
void nlua_resize(void)
Propagates a resize event to all the environments forcibly.
int nlua_errTrace(lua_State *L)
Gets a trace from Lua.