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 },
};
}
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