@type quadopt_t {
.ctype = unsigned : 2;
.check = luaM_checkquadopt($L, $$);
- .push = lua_pushinteger($L, $$);
+ .push = luaM_pushquadopt($L, $$);
};
@type string_t {
int status);
quadopt_t luaM_checkquadopt(lua_State *L, int narg);
+void luaM_pushquadopt(lua_State *Ls, int val);
+
const char *luaM_checkrx(lua_State *Ls, int narg);
char *luaM_pathnew(const char *val);
rx_t *luaM_rxnew(const char* val);
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);