X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=query.c;h=ce1f052a8ded3e9b6d89b860b552162b76b43054;hp=5509aac95ace5b8cbeb0cd806e53654c2519db1c;hb=711f787502b6a1a1c150b948a5ed9156c8ef9ba1;hpb=4a0b020a3048f079979bea43c04f9fe388f9354d diff --git a/query.c b/query.c index 5509aac..ce1f052 100644 --- a/query.c +++ b/query.c @@ -11,24 +11,24 @@ # include "config.h" #endif +#include +#include +#include + #include #include #include #include #include +#include #include #include "mutt.h" +#include "alias.h" #include "mutt_idna.h" #include "sort.h" -#include "lib/debug.h" - -#include -#include -#include - typedef struct query { address_t *addr; char *name; @@ -55,7 +55,7 @@ static struct mapping_t QueryHelp[] = { static int FirstColumn; static int SecondColumn; -static void query_menu (char *buf, size_t buflen, QUERY * results, +static void query_menu (char *buf, ssize_t buflen, QUERY * results, int retbuf); static address_t *result_to_addr (QUERY * r) @@ -78,7 +78,7 @@ static QUERY *run_query (char *s, int quiet) QUERY *cur = NULL; char cmd[_POSIX_PATH_MAX]; char *buf = NULL; - size_t buflen; + ssize_t buflen; int dummy = 0; char msg[STRING]; char *p; @@ -207,7 +207,7 @@ static int query_tag (MUTTMENU * menu, int n, int m) return cur->tagged - ot; } -int mutt_query_complete (char *buf, size_t buflen) +int mutt_query_complete (char *buf, ssize_t buflen) { QUERY *results = NULL; address_t *tmpa; @@ -226,7 +226,7 @@ int mutt_query_complete (char *buf, size_t buflen) mutt_addrlist_to_local (tmpa); buf[0] = '\0'; rfc822_write_address (buf, buflen, tmpa, 0); - address_delete (&tmpa); + address_list_wipe(&tmpa); mutt_clear_error (); return (0); } @@ -236,7 +236,7 @@ int mutt_query_complete (char *buf, size_t buflen) return (0); } -void mutt_query_menu (char *buf, size_t buflen) +void mutt_query_menu (char *buf, ssize_t buflen) { if (!QueryCmd) { mutt_error _("Query command not defined."); @@ -254,7 +254,7 @@ void mutt_query_menu (char *buf, size_t buflen) } } -static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) +static void query_menu (char *buf, ssize_t buflen, QUERY * results, int retbuf) { MUTTMENU *menu; HEADER *msg = NULL; @@ -311,7 +311,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) if (op == OP_QUERY) { queryp = results; while (queryp) { - address_delete (&queryp->addr); + address_list_wipe(&queryp->addr); p_delete(&queryp->name); p_delete(&queryp->other); results = queryp->next; @@ -390,7 +390,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) address_t *a = result_to_addr (QueryTable[menu->current].data); mutt_create_alias (NULL, a); - address_delete (&a); + address_list_wipe(&a); } break; @@ -426,7 +426,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) /* if we need to return the selected entries */ if (retbuf && (done == 2)) { int tagged = 0; - size_t curpos = 0; + ssize_t curpos = 0; p_clear(buf, buflen); @@ -440,7 +440,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) tagged = 1; rfc822_write_address (buf, buflen, tmpa, 0); curpos = m_strlen(buf); - address_delete (&tmpa); + address_list_wipe(&tmpa); } else if (curpos + 2 < buflen) { address_t *tmpa = result_to_addr (QueryTable[i].data); @@ -450,7 +450,7 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) rfc822_write_address ((char *) buf + curpos + 1, buflen - curpos - 1, tmpa, 0); curpos = m_strlen(buf); - address_delete (&tmpa); + address_list_wipe(&tmpa); } } } @@ -460,14 +460,14 @@ static void query_menu (char *buf, size_t buflen, QUERY * results, int retbuf) mutt_addrlist_to_local (tmpa); rfc822_write_address (buf, buflen, tmpa, 0); - address_delete (&tmpa); + address_list_wipe(&tmpa); } } queryp = results; while (queryp) { - address_delete (&queryp->addr); + address_list_wipe(&queryp->addr); p_delete(&queryp->name); p_delete(&queryp->other); results = queryp->next;