return (1);
}
-static void magic_to_string (char* dst, ssize_t dstlen,
- struct option_t* option) {
- const char* s = NULL;
- switch (option->data) {
- case M_MBOX: s = "mbox"; break;
- case M_MH: s = "MH"; break;
- case M_MAILDIR: s = "Maildir"; break;
- default: s = "unknown"; break;
- }
- snprintf (dst, dstlen, "%s=%s", option->option, s);
-}
-
static int magic_from_string (struct option_t* dst, const char* val,
char *errbuf, ssize_t errlen)
{
{ DT_QUAD, quad_to_string, quad_from_string },
{ DT_SORT, sort_to_string, sort_from_string },
{ DT_RX, rx_to_string, rx_from_string },
- { DT_MAGIC, magic_to_string, magic_from_string },
};
return (v);
default:
- v = mutt_yesorno(prompt, (v == M_ASKYES));
- CLEARLINE(main_w, LINES - 1);
- return (v);
+ return mutt_yesorno(prompt, (v == M_ASKYES));
}
}
return (v);
default:
- v = mutt_yesorno (prompt, (v == M_ASKYES));
- CLEARLINE(main_w, LINES - 1);
- return (v);
+ return mutt_yesorno(prompt, (v == M_ASKYES));
}
-
- /* not reached */
}
/* always wise to do what someone else did before */
}
else if (DTYPE (option->type) == DT_STR ||
DTYPE (option->type) == DT_PATH ||
- DTYPE (option->type) == DT_MAGIC ||
DTYPE (option->type) == DT_NUM ||
DTYPE (option->type) == DT_SORT ||
DTYPE (option->type) == DT_RX)
(*((short *)option->data) & SORT_REVERSE) ? "reverse-" : "",
(*((short *)option->data) & SORT_LAST) ? "last-" : "", p);
}
- else if (DTYPE (option->type) == DT_MAGIC) {
- const char *p;
- switch (DefaultMagic) {
- case M_MBOX:
- p = "mbox";
- break;
- case M_MH:
- p = "MH";
- break;
- case M_MAILDIR:
- p = "Maildir";
- break;
- default:
- p = "unknown";
- }
- m_strcpy(tmp, sizeof(tmp), p);
- }
else if (DTYPE (option->type) == DT_BOOL)
m_strcpy(tmp, sizeof(tmp), option(option->data) ? "yes" : "no");
else
}
}
-int mutt_get_hook_type (const char *name)
-{
- struct command_t *c;
-
- for (c = Commands; c->name; c++)
- if (c->func == mutt_parse_hook && ascii_strcasecmp (c->name, name) == 0)
- return c->data;
- return 0;
-}
-