X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=0a4d827e86db00960420ff8e7bf928a1449d94ea;hp=d7ff973ad07471eb1dc6ccb4a8df7b65de126c70;hb=576172ff50f9dd94dd2f5cc91d247c1e50dbe7fc;hpb=05039d8ea34618b385736ae6d7578b1643fad3d2 diff --git a/init.c b/init.c index d7ff973..0a4d827 100644 --- a/init.c +++ b/init.c @@ -18,10 +18,10 @@ #include #include #include -#include #include "mutt.h" #include "keymap.h" +#include "crypt.h" #include "charset.h" #include "thread.h" #include "mutt_idna.h" @@ -360,24 +360,6 @@ static int magic_from_string (struct option_t* dst, const char* val, } -static void addr_to_string (char* dst, ssize_t dstlen, - struct option_t* option) { - char s[HUGE_STRING]; - s[0] = '\0'; - rfc822_addrcat(s, sizeof(s), *((address_t**) option->data), 0); - snprintf (dst, dstlen, "%s=\"%s\"", option->option, NONULL (s)); -} - -static int addr_from_string (struct option_t* dst, const char* val, - char* errbuf __attribute__ ((unused)), ssize_t errlen __attribute__ ((unused))) { - if (!dst) - return (0); - address_list_wipe((address_t**) dst->data); - if (val && *val) - *((address_t**) dst->data) = rfc822_parse_adrlist (NULL, val); - return (1); -} - static struct { unsigned short type; void (*opt_tostr) (char* dst, ssize_t dstlen, struct option_t* option); @@ -393,7 +375,6 @@ static struct { { DT_SORT, sort_to_string, sort_from_string }, { DT_RX, rx_to_string, rx_from_string }, { DT_MAGIC, magic_to_string, magic_from_string }, - { DT_ADDR, addr_to_string, addr_from_string }, }; @@ -1148,23 +1129,16 @@ static int parse_set (BUFFER * tmp, BUFFER * s, unsigned long data, } else if (DTYPE (option->type) == DT_STR || DTYPE (option->type) == DT_PATH || - DTYPE (option->type) == DT_ADDR || DTYPE (option->type) == DT_MAGIC || DTYPE (option->type) == DT_NUM || DTYPE (option->type) == DT_SORT || DTYPE (option->type) == DT_RX) { /* XXX maybe we need to get unset into handlers? */ - if (DTYPE (option->type) == DT_STR || - DTYPE (option->type) == DT_PATH || - DTYPE (option->type) == DT_ADDR) - { + if (DTYPE (option->type) == DT_STR || DTYPE (option->type) == DT_PATH) { if (unset) { CHECK_PAGER; - if (DTYPE (option->type) == DT_ADDR) - address_list_wipe((address_t **) option->data); - else - p_delete((void **)(void *)&option->data); + p_delete((void **)(void *)&option->data); break; } } @@ -1597,9 +1571,6 @@ int mutt_var_value_complete (char *buffer, ssize_t len, int pos) if (DTYPE (option->type) == DT_PATH) mutt_pretty_mailbox (tmp); } - else if (DTYPE (option->type) == DT_ADDR) { - rfc822_addrcat(tmp, sizeof(tmp), *((address_t **) option->data), 0); - } else if (DTYPE (option->type) == DT_QUAD) m_strcpy(tmp, sizeof(tmp), vals[quadoption(option->data)]); else if (DTYPE (option->type) == DT_NUM)