13#define NLUA_LOAD_TABLE \
16#define NLUA_DONE "__done__"
17#define NLUA_DEPRECATED( L, f ) \
19 lua_pushfstring( L, _( "Deprecated function call: %s" ), f ); \
22#define NLUA_WARN( L, str, ... ) \
24 lua_pushfstring( L, str, ##__VA_ARGS__ ); \
28#define nluaL_optarg( L, ind, def, checkfunc ) \
29 ( lua_isnoneornil( L, ind ) ? ( def ) : checkfunc( L, ind ) )
32extern lua_State *
naevL;
40int nlua_warn( lua_State *L,
int idx );
42nlua_env nlua_newEnv(
const char *name );
43void nlua_freeEnv( nlua_env env );
44void nlua_pushenv( lua_State *L, nlua_env env );
45void nlua_setenv( lua_State *L, nlua_env env,
const char *name );
46void nlua_getenv( lua_State *L, nlua_env env,
const char *name );
47void nlua_register( nlua_env env,
const char *libname,
const luaL_Reg *l,
49int nlua_dobufenv( nlua_env env,
const char *buff,
size_t sz,
51int nlua_dofileenv( nlua_env env,
const char *filename );
52int nlua_dochunkenv( nlua_env env,
int chunk,
const char *name );
55int nlua_pcall( nlua_env env,
int nargs,
int nresults );
61int nlua_ref( lua_State *L,
int idx );
71void 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_helperTags(lua_State *L, int idx, char *const *tags)
Helper function to deal with tags.
int nlua_reffield(int objref, const char *name)
Gets the reference to the specified field from an object reference.
void lua_clearCache(void)
Clears the cached stuff.
void nlua_resize(void)
Propagates a resize event to all the environments forcibly.
int nlua_errTrace(lua_State *L)
Gets a trace from Lua.