- retrieve global state, init if needed
- inspired by rpm5.org, details differ
- use it for initialisation in rpmrc instead of abusing rpmluaGetPrintBuffer
/* Force Lua state initialization */
#ifdef WITH_LUA
- (void)rpmluaGetPrintBuffer(NULL);
+ (void) rpmluaGetGlobalState();
#endif
return 0;
static int luaopen_rpm(lua_State *L);
static int rpm_print(lua_State *L);
+rpmlua rpmluaGetGlobalState(void)
+{
+ INITSTATE(NULL, lua);
+ return lua;
+}
+
rpmlua rpmluaNew()
{
rpmlua lua = (rpmlua) xcalloc(1, sizeof(*lua));
rpmlua rpmluaNew(void);
void *rpmluaFree(rpmlua lua);
+rpmlua rpmluaGetGlobalState(void);
int rpmluaCheckScript(rpmlua lua, const char *script,
const char *name);