Signed-off-by: Pierre Habouzit <madcoder@debian.org>
- {"strict_mime", DT_BOOL, R_NONE, OPTSTRICTMIME, "no" },
- {"rfc2047_parameters", DT_BOOL, R_NONE, OPTRFC2047PARAMS, "yes"},
{ NULL, -1, R_NONE, -1, NULL }
};
{ NULL, -1, R_NONE, -1, NULL }
};
############ Put tokens here ############
## alias_file
## alias_format
############ Put tokens here ############
## alias_file
## alias_format
## beep
## beep_new
## bindir
## beep
## beep_new
## bindir
## gecos_mask
## hcache_backend
## homedir
## gecos_mask
## hcache_backend
## homedir
## quit
## sendmail
## shell
## quit
## sendmail
## shell
## tmpdir
## username
## version
## tmpdir
## username
## version
quadopt_t luaM_checkquadopt(lua_State *Ls, int narg)
{
const char *s;
quadopt_t luaM_checkquadopt(lua_State *Ls, int narg)
{
const char *s;
- int i = luaL_checkinteger(Ls, narg);
+ int i;
+
+ if (lua_type(Ls, narg) == LUA_TSTRING) {
+ s = lua_tostring(Ls, narg);
+ switch (mlua_which_token(s, -1)) {
+ case LTK_YES: return M_YES;
+ case LTK_NO: return M_NO;
+ case LTK_ASK_YES: return M_ASKYES;
+ case LTK_ASK_NO: return M_ASKNO;
+ default:
+ break;
+ }
+ }
+ i = luaL_checkinteger(Ls, narg);
if (i & ~3) {
s = lua_pushfstring(Ls, "int in [0-3] expected, got %d", i);
return luaL_argerror(Ls, narg, s);
if (i & ~3) {
s = lua_pushfstring(Ls, "int in [0-3] expected, got %d", i);
return luaL_argerror(Ls, narg, s);
OPTREVALIAS,
OPTREVNAME,
OPTREVREAL,
OPTREVALIAS,
OPTREVNAME,
OPTREVREAL,
OPTSAVEADDRESS,
OPTSAVEEMPTY,
OPTSAVENAME,
OPTSAVEADDRESS,
OPTSAVEEMPTY,
OPTSAVENAME,
OPTSPAMSEP,
OPTSTATUSONTOP,
OPTSTRICTMAILTO,
OPTSPAMSEP,
OPTSTATUSONTOP,
OPTSTRICTMAILTO,
OPTSTRICTTHREADS,
OPTSTRIPWAS,
OPTSTUFFQUOTED,
OPTSTRICTTHREADS,
OPTSTRIPWAS,
OPTSTUFFQUOTED,