make quadopts be consistently dealt with as strings.
[apps/madmutt.git] / lib-lua / runtime.c
index f7401e2..923222b 100644 (file)
@@ -97,6 +97,17 @@ quadopt_t luaM_checkquadopt(lua_State *Ls, int narg)
     return i;
 }
 
+void luaM_pushquadopt(lua_State *Ls, int val)
+{
+    switch (val) {
+      case M_YES:    return lua_pushstring(Ls, "yes");
+      case M_NO:     return lua_pushstring(Ls, "no");
+      case M_ASKYES: return lua_pushstring(Ls, "ask-yes");
+      case M_ASKNO:  return lua_pushstring(Ls, "ask-no");
+      default:       return lua_pushnil(Ls);
+    }
+}
+
 const char *luaM_checkrx(lua_State *Ls, int narg)
 {
     const char *s = luaL_checkstring(Ls, narg);