#include "lib-lua_priv.h"
static lua_State *L;
+static reg_entry registry[LTK_count];
static const luaL_Reg lualibs[] = {
{"", luaopen_base},
+ {LUA_OSLIBNAME, luaopen_os},
{LUA_LOADLIBNAME, luaopen_package},
{LUA_TABLIBNAME, luaopen_table},
{LUA_IOLIBNAME, luaopen_io},
return status;
}
+const char *mlua_reggets(int tk)
+{
+ if (registry[tk].type != REG_STR)
+ return NULL;
+ return registry[tk].s;
+}
+
+void mlua_regsets(int tk, const char *s)
+{
+ reg_entry_wipe(registry + tk);
+ registry[tk].type = REG_STR;
+ registry[tk].s = m_strdup(s);
+}