move OPT_QUIT into the lua registry
[apps/madmutt.git] / lib-lua / runtime.c
index 552587c..7a351ee 100644 (file)
@@ -74,9 +74,23 @@ const char *mlua_reggets(int tk)
     return registry[tk].s;
 }
 
+quadopt_t mlua_reggetq(int tk)
+{
+    if (registry[tk].type != REG_QUAD)
+        return -1;
+    return registry[tk].i;
+}
+
 void mlua_regsets(int tk, const char *s)
 {
     reg_entry_wipe(registry + tk);
     registry[tk].type = REG_STR;
     registry[tk].s    = m_strdup(s);
 }
+
+void mlua_regsetq(int tk, quadopt_t q)
+{
+    reg_entry_wipe(registry + tk);
+    registry[tk].type = REG_QUAD;
+    registry[tk].i    = q;
+}