+static int path_from_string (struct option_t* dst, const char* val,
+ char* errbuf __attribute__ ((unused)), ssize_t errlen __attribute__ ((unused))) {
+ char path[_POSIX_PATH_MAX];
+
+ if (!dst)
+ return 0;
+
+ if (m_strisempty(val)) {
+ p_delete((char**) dst->data);
+ return 1;
+ }
+
+ path[0] = '\0';
+ m_strcpy(path, sizeof(path), val);
+ mutt_expand_path (path, sizeof(path));
+ m_strreplace((char **) dst->data, path);
+ return 1;
+}
+
+static int str_from_string (struct option_t* dst, const char* val,
+ char* errbuf, ssize_t errlen) {
+ if (!dst)
+ return 0;
+
+ if (!check_special (dst->option, (unsigned long) val, errbuf, errlen))
+ return 0;
+
+ m_strreplace((char**) dst->data, val);
+ return 1;
+}
+
+static void quad_to_string (char* dst, ssize_t dstlen,
+ struct option_t* option) {
+ const char *vals[] = { "no", "yes", "ask-no", "ask-yes" };
+ snprintf (dst, dstlen, "%s=%s", option->option,
+ vals[quadoption (option->data)]);
+}
+
+static int quad_from_string (struct option_t* dst, const char* val,
+ char* errbuf __attribute__ ((unused)), ssize_t errlen __attribute__ ((unused))) {
+ int flag = -1;
+
+ if (!dst)
+ return 0;
+ if (ascii_strncasecmp (val, "yes", 3) == 0)
+ flag = M_YES;
+ else if (ascii_strncasecmp (val, "no", 2) == 0)
+ flag = M_NO;
+ else if (ascii_strncasecmp (val, "ask-yes", 7) == 0)
+ flag = M_ASKYES;
+ else if (ascii_strncasecmp (val, "ask-no", 6) == 0)
+ flag = M_ASKNO;
+
+ if (flag < 0)
+ return 0;
+
+ set_quadoption (dst->data, flag);
+ return 1;
+}
+
+static void sort_to_string (char* dst, ssize_t dstlen,
+ struct option_t* option) {
+ const struct mapping_t *map = get_sortmap (option);
+ const char *p = NULL;