From: Pietro Cerutti Date: Fri, 17 May 2019 13:12:54 +0000 (+0000) Subject: Rename mutt_addresslist_* to mutt_addrlist_* X-Git-Tag: 2019-10-25~200^2~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63149ce0d5773af33885495aa6bc60f7180b6620;p=neomutt Rename mutt_addresslist_* to mutt_addrlist_* --- diff --git a/addrbook.c b/addrbook.c index efafdcd27..3104c5adf 100644 --- a/addrbook.c +++ b/addrbook.c @@ -92,7 +92,7 @@ static const char *alias_format_str(char *buf, size_t buflen, size_t col, int co break; case 'r': addr[0] = '\0'; - mutt_addresslist_write(addr, sizeof(addr), &alias->addr, true); + mutt_addrlist_write(addr, sizeof(addr), &alias->addr, true); snprintf(fmt, sizeof(fmt), "%%%ss", prec); snprintf(buf, buflen, fmt, addr); break; @@ -298,14 +298,14 @@ new_aliases: { if (alias_table[i]->tagged) { - mutt_addresslist_write(buf, buflen, &alias_table[i]->addr, true); + mutt_addrlist_write(buf, buflen, &alias_table[i]->addr, true); t = -1; } } if (t != -1) { - mutt_addresslist_write(buf, buflen, &alias_table[t]->addr, true); + mutt_addrlist_write(buf, buflen, &alias_table[t]->addr, true); } mutt_menu_pop_current(menu); diff --git a/address/address.c b/address/address.c index 6c1045af0..d36da5704 100644 --- a/address/address.c +++ b/address/address.c @@ -385,13 +385,13 @@ struct Address *mutt_addr_new(void) } /** - * mutt_addresslist_remove - Remove an Address from a list + * mutt_addrlist_remove - Remove an Address from a list * @param[in, out] al AddressList * @param[in] mailbox Email address to match * @retval 0 Success * @retval -1 Error, or email not found */ -int mutt_addresslist_remove(struct AddressList *al, const char *mailbox) +int mutt_addrlist_remove(struct AddressList *al, const char *mailbox) { if (!al) return -1; @@ -405,7 +405,7 @@ int mutt_addresslist_remove(struct AddressList *al, const char *mailbox) { if (mutt_str_strcasecmp(mailbox, a->mailbox) == 0) { - mutt_addresslist_free_one(al, a); + mutt_addrlist_free_one(al, a); rc = 0; } } @@ -427,23 +427,23 @@ void mutt_addr_free(struct Address **a) } /** - * mutt_addresslist_free - Free an AddressList + * mutt_addrlist_free - Free an AddressList */ -void mutt_addresslist_free(struct AddressList **al) +void mutt_addrlist_free(struct AddressList **al) { if (!al) return; - mutt_addresslist_free_all(*al); + mutt_addrlist_free_all(*al); FREE(al); } /** - * mutt_addresslist_parse - Parse a list of email addresses + * mutt_addrlist_parse - Parse a list of email addresses * @param al AddressList to append addresses * @param s String to parse * @retval Number of parsed addressess */ -int mutt_addresslist_parse(struct AddressList *al, const char *s) +int mutt_addrlist_parse(struct AddressList *al, const char *s) { if (!s) return 0; @@ -487,7 +487,7 @@ int mutt_addresslist_parse(struct AddressList *al, const char *s) s = next_token(s, comment, &commentlen, sizeof(comment) - 1); if (!s) { - mutt_addresslist_free_all(al); + mutt_addrlist_free_all(al); return 0; } break; @@ -498,7 +498,7 @@ int mutt_addresslist_parse(struct AddressList *al, const char *s) s = parse_quote(s + 1, phrase, &phraselen, sizeof(phrase) - 1); if (!s) { - mutt_addresslist_free_all(al); + mutt_addrlist_free_all(al); return 0; } break; @@ -549,7 +549,7 @@ int mutt_addresslist_parse(struct AddressList *al, const char *s) s = parse_route_addr(s + 1, comment, &commentlen, sizeof(comment) - 1, a); if (!s) { - mutt_addresslist_free_all(al); + mutt_addrlist_free_all(al); mutt_addr_free(&a); return 0; } @@ -566,7 +566,7 @@ int mutt_addresslist_parse(struct AddressList *al, const char *s) s = next_token(s, phrase, &phraselen, sizeof(phrase) - 1); if (!s) { - mutt_addresslist_free_all(al); + mutt_addrlist_free_all(al); return 0; } break; @@ -596,14 +596,14 @@ int mutt_addresslist_parse(struct AddressList *al, const char *s) } /** - * mutt_addresslist_parse - Parse a list of email addresses + * mutt_addrlist_parse2 - Parse a list of email addresses * @param al Add to this List of Addresses * @param s String to parse * @retval int Number of parsed addresses * * The email addresses can be separated by whitespace or commas. */ -int mutt_addresslist_parse2(struct AddressList *al, const char *s) +int mutt_addrlist_parse2(struct AddressList *al, const char *s) { if (!s) return 0; @@ -619,27 +619,27 @@ int mutt_addresslist_parse2(struct AddressList *al, const char *s) char *r = tmp->data; while ((r = strtok(r, " \t"))) { - parsed += mutt_addresslist_parse(al, r); + parsed += mutt_addrlist_parse(al, r); r = NULL; } mutt_buffer_free(&tmp); } else - parsed = mutt_addresslist_parse(al, s); + parsed = mutt_addrlist_parse(al, s); return parsed; } /** - * mutt_addresslist_qualify - Expand local names in an Address list using a hostname - * @param al Address list + * mutt_addrlist_qualify - Expand local names in an Address list using a hostname + * @param al Address list * @param host Hostname * * Any addresses containing a bare name will be expanded using the hostname. * e.g. "john", "example.com" -> 'john@example.com'. This function has no * effect if host is NULL or the empty string. */ -void mutt_addresslist_qualify(struct AddressList *al, const char *host) +void mutt_addrlist_qualify(struct AddressList *al, const char *host) { if (!al || !host || !*host) return; @@ -715,12 +715,12 @@ struct Address *mutt_addr_copy(const struct Address *addr) } /** - * mutt_addresslist_copy - Copy a list of addresses into another list + * mutt_addrlist_copy - Copy a list of addresses into another list * @param dst Destination Address list * @param src Source Address list * @param prune Skip groups if there are more addresses */ -void mutt_addresslist_copy(struct AddressList *dst, const struct AddressList *src, bool prune) +void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune) { if (!dst || !src) return; @@ -790,12 +790,12 @@ bool mutt_addr_valid_msgid(const char *msgid) } /** - * mutt_addresslist_equal - Compare two Address lists for equality - * @param a First Address - * @param b Second Address + * mutt_addrlist_equal - Compare two Address lists for equality + * @param ala First Address + * @param alb Second Address * @retval true Address lists are strictly identical */ -bool mutt_addresslist_equal(const struct AddressList *ala, const struct AddressList *alb) +bool mutt_addrlist_equal(const struct AddressList *ala, const struct AddressList *alb) { if (!ala || !alb) { @@ -821,13 +821,13 @@ bool mutt_addresslist_equal(const struct AddressList *ala, const struct AddressL } /** - * mutt_addresslist_has_recips - Count the number of Addresses with valid recipients + * mutt_addrlist_has_recips - Count the number of Addresses with valid recipients * @param al Address list * @retval num Number of valid Addresses * * An Address has a recipient if the mailbox or group is set. */ -int mutt_addresslist_has_recips(const struct AddressList *al) +int mutt_addrlist_has_recips(const struct AddressList *al) { if (!al) return 0; @@ -861,12 +861,12 @@ bool mutt_addr_cmp(const struct Address *a, const struct Address *b) } /** - * mutt_addresslist_search - Search for an e-mail address in a list - * @param a Address containing the search email - * @param lst Address List + * mutt_addrlist_search - Search for an e-mail address in a list + * @param needle Address containing the search email + * @param haystack Address List * @retval true If the Address is in the list */ -bool mutt_addresslist_search(const struct Address *needle, const struct AddressList *haystack) +bool mutt_addrlist_search(const struct Address *needle, const struct AddressList *haystack) { if (!needle || !haystack) return false; @@ -1122,7 +1122,7 @@ done: } /** - * mutt_addresslist_write - Write an Address to a buffer + * mutt_addrlist_write - Write an Address to a buffer * @param buf Buffer for the Address * @param buflen Length of the buffer * @param al AddressList to display @@ -1134,8 +1134,7 @@ done: * * @note It is assumed that `buf` is nul terminated! */ -size_t mutt_addresslist_write(char *buf, size_t buflen, - const struct AddressList *al, bool display) +size_t mutt_addrlist_write(char *buf, size_t buflen, const struct AddressList *al, bool display) { if (!buf || !al) return 0; @@ -1200,13 +1199,13 @@ done: } /** - * mutt_addresslist_to_intl - Convert an Address list to Punycode - * @param[in] a Address list to modify + * mutt_addrlist_to_intl - Convert an Address list to Punycode + * @param[in] al Address list to modify * @param[out] err Pointer for failed addresses * @retval 0 Success, all addresses converted * @retval -1 Error, err will be set to the failed address */ -int mutt_addresslist_to_intl(struct AddressList *al, char **err) +int mutt_addrlist_to_intl(struct AddressList *al, char **err) { if (!al) return 0; @@ -1247,11 +1246,11 @@ int mutt_addresslist_to_intl(struct AddressList *al, char **err) } /** - * mutt_addresslist_to_local - Convert an Address list from Punycode - * @param a Address list to modify + * mutt_addrlist_to_local - Convert an Address list from Punycode + * @param al Address list to modify * @retval 0 Always */ -int mutt_addresslist_to_local(struct AddressList *al) +int mutt_addrlist_to_local(struct AddressList *al) { if (!al) return 0; @@ -1279,13 +1278,13 @@ int mutt_addresslist_to_local(struct AddressList *al) } /** - * mutt_addresslist_dedupe - Remove duplicate addresses - * @param addr Address list to de-dupe + * mutt_addrlist_dedupe - Remove duplicate addresses + * @param al Address list to de-dupe * @retval ptr Updated Address list * * Given a list of addresses, return a list of unique addresses */ -void mutt_addresslist_dedupe(struct AddressList *al) +void mutt_addrlist_dedupe(struct AddressList *al) { if (!al) return; @@ -1303,7 +1302,7 @@ void mutt_addresslist_dedupe(struct AddressList *al) if (a2->mailbox && (mutt_str_strcasecmp(a->mailbox, a2->mailbox) == 0)) { mutt_debug(LL_DEBUG2, "Removing %s\n", a2->mailbox); - mutt_addresslist_free_one(al, a2); + mutt_addrlist_free_one(al, a2); } } } @@ -1312,13 +1311,13 @@ void mutt_addresslist_dedupe(struct AddressList *al) } /** - * mutt_addresslist_remove_xrefs - Remove cross-references + * mutt_addrlist_remove_xrefs - Remove cross-references * @param a Reference AddressList * @param b AddressLis to trim * * Remove addresses from "b" which are contained in "a" */ -void mutt_addresslist_remove_xrefs(const struct AddressList *a, struct AddressList *b) +void mutt_addrlist_remove_xrefs(const struct AddressList *a, struct AddressList *b) { if (!a || !b) return; @@ -1331,7 +1330,7 @@ void mutt_addresslist_remove_xrefs(const struct AddressList *a, struct AddressLi { if (mutt_addr_cmp(aa, ab)) { - mutt_addresslist_free_one(b, ab); + mutt_addrlist_free_one(b, ab); break; } } @@ -1339,10 +1338,10 @@ void mutt_addresslist_remove_xrefs(const struct AddressList *a, struct AddressLi } /** - * mutt_addresslist_new - Create a new AddressList + * mutt_addrlist_new - Create a new AddressList * @return a newly allocated AddressList */ -struct AddressList *mutt_addresslist_new(void) +struct AddressList *mutt_addrlist_new(void) { struct AddressList *al = mutt_mem_calloc(1, sizeof(struct AddressList)); TAILQ_INIT(al); @@ -1350,22 +1349,22 @@ struct AddressList *mutt_addresslist_new(void) } /** - * mutt_addresslist_free_one - Unlink and free an Address from an AddressList + * mutt_addrlist_free_one - Unlink and free an Address from an AddressList * @param al AddressList - * @param an Address + * @param a Address */ -void mutt_addresslist_free_one(struct AddressList *al, struct Address *a) +void mutt_addrlist_free_one(struct AddressList *al, struct Address *a) { TAILQ_REMOVE(al, a, entries); mutt_addr_free(&a); } /** - * mutt_addresslist_free_all - Unlink and free all Address in an AddressList + * mutt_addrlist_free_all - Unlink and free all Address in an AddressList * @param al AddressList * @note After this call, the AddressList is reinitialized and ready for reuse. */ -void mutt_addresslist_free_all(struct AddressList *al) +void mutt_addrlist_free_all(struct AddressList *al) { if (!al) return; diff --git a/address/address.h b/address/address.h index c23612fd8..6dafc86d3 100644 --- a/address/address.h +++ b/address/address.h @@ -73,24 +73,22 @@ size_t mutt_addr_write(char *buf, size_t buflen, struct Address *addr, struct Address *mutt_addr_new(void); /* Functions that work on struct AddressList */ -struct AddressList *mutt_addresslist_new(void); -void mutt_addresslist_append(struct AddressList *al, struct Address *a); -void mutt_addresslist_prepend(struct AddressList *al, struct Address *a); -void mutt_addresslist_copy(struct AddressList *dst, const struct AddressList *src, bool prune); -void mutt_addresslist_free(struct AddressList **al); -void mutt_addresslist_free_one(struct AddressList *al, struct Address *anode); -void mutt_addresslist_free_all(struct AddressList *al); -size_t mutt_addresslist_write(char *buf, size_t buflen, const struct AddressList* addr, bool display); -int mutt_addresslist_parse(struct AddressList *top, const char *s); -int mutt_addresslist_parse2(struct AddressList *top, const char *s); -int mutt_addresslist_to_local(struct AddressList *al); -int mutt_addresslist_to_intl(struct AddressList *al, char **err); -void mutt_addresslist_dedupe(struct AddressList *al); -void mutt_addresslist_qualify(struct AddressList *al, const char *host); -bool mutt_addresslist_search(const struct Address *needle, const struct AddressList *haystack); -int mutt_addresslist_has_recips(const struct AddressList *al); -bool mutt_addresslist_equal(const struct AddressList *ala, const struct AddressList *alb); -int mutt_addresslist_remove(struct AddressList *al, const char *mailbox); -void mutt_addresslist_remove_xrefs(const struct AddressList *a, struct AddressList *b); +struct AddressList *mutt_addrlist_new(void); +void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune); +void mutt_addrlist_free(struct AddressList **al); +void mutt_addrlist_free_one(struct AddressList *al, struct Address *a); +void mutt_addrlist_free_all(struct AddressList *al); +size_t mutt_addrlist_write(char *buf, size_t buflen, const struct AddressList *al, bool display); +int mutt_addrlist_parse(struct AddressList *al, const char *s); +int mutt_addrlist_parse2(struct AddressList *al, const char *s); +int mutt_addrlist_to_local(struct AddressList *al); +int mutt_addrlist_to_intl(struct AddressList *al, char **err); +void mutt_addrlist_dedupe(struct AddressList *al); +void mutt_addrlist_qualify(struct AddressList *al, const char *host); +bool mutt_addrlist_search(const struct Address *needle, const struct AddressList *haystack); +int mutt_addrlist_has_recips(const struct AddressList *al); +bool mutt_addrlist_equal(const struct AddressList *ala, const struct AddressList *alb); +int mutt_addrlist_remove(struct AddressList *al, const char *mailbox); +void mutt_addrlist_remove_xrefs(const struct AddressList *a, struct AddressList *b); #endif /* MUTT_EMAIL_ADDRESS_H */ diff --git a/address/group.c b/address/group.c index d16795c6c..78a3650ac 100644 --- a/address/group.c +++ b/address/group.c @@ -89,7 +89,7 @@ static void group_remove(struct Group *g) if (!g) return; mutt_hash_delete(Groups, g->name, g); - mutt_addresslist_free_all(&g->al); + mutt_addrlist_free_all(&g->al); mutt_regexlist_free(&g->rs); FREE(&g->name); FREE(&g); @@ -180,8 +180,8 @@ static void group_add_addrlist(struct Group *g, const struct AddressList *al) return; struct AddressList new = TAILQ_HEAD_INITIALIZER(new); - mutt_addresslist_copy(&new, al, false); - mutt_addresslist_remove_xrefs(&g->al, &new); + mutt_addrlist_copy(&new, al, false); + mutt_addrlist_remove_xrefs(&g->al, &new); struct Address *a, *tmp; TAILQ_FOREACH_SAFE(a, &new, entries, tmp) { @@ -217,11 +217,11 @@ static int group_remove_regex(struct Group *g, const char *s) } /** - * mutt_grouplist_add_addresslist - Add Address list to a GroupList + * mutt_grouplist_add_addrlist - Add Address list to a GroupList * @param head GroupList to add to - * @param a Address to add + * @param al Address list to add */ -void mutt_grouplist_add_addresslist(struct GroupList *head, struct AddressList *al) +void mutt_grouplist_add_addrlist(struct GroupList *head, struct AddressList *al) { if (!head || !al) return; @@ -234,13 +234,13 @@ void mutt_grouplist_add_addresslist(struct GroupList *head, struct AddressList * } /** - * mutt_grouplist_remove_addresslist - Remove an AddressList from a GroupList + * mutt_grouplist_remove_addrlist - Remove an AddressList from a GroupList * @param head GroupList to remove from * @param al AddressList to remove * @retval 0 Success * @retval -1 Error */ -int mutt_grouplist_remove_addresslist(struct GroupList *head, struct AddressList *al) +int mutt_grouplist_remove_addrlist(struct GroupList *head, struct AddressList *al) { if (!head || !al) return -1; @@ -253,7 +253,7 @@ int mutt_grouplist_remove_addresslist(struct GroupList *head, struct AddressList struct Address *a = NULL; TAILQ_FOREACH(a, al, entries) { - mutt_addresslist_remove(&gnp->group->al, a->mailbox); + mutt_addrlist_remove(&gnp->group->al, a->mailbox); } if (empty_group(gnp->group)) group_remove(gnp->group); diff --git a/address/group.h b/address/group.h index 148c8d6bc..5b9cf21d4 100644 --- a/address/group.h +++ b/address/group.h @@ -55,13 +55,13 @@ STAILQ_HEAD(GroupList, GroupNode); void mutt_grouplist_init(void); void mutt_grouplist_free(void); void mutt_grouplist_add(struct GroupList *head, struct Group *group); -void mutt_grouplist_add_addresslist(struct GroupList *head, struct AddressList *a); +void mutt_grouplist_add_addrlist(struct GroupList *head, struct AddressList *a); int mutt_grouplist_add_regex(struct GroupList *head, const char *s, int flags, struct Buffer *err); void mutt_grouplist_destroy(struct GroupList *head); void mutt_grouplist_clear(struct GroupList *head); int mutt_grouplist_remove_regex(struct GroupList *head, const char *s); -int mutt_grouplist_remove_addresslist(struct GroupList *head, struct AddressList *a); +int mutt_grouplist_remove_addrlist(struct GroupList *head, struct AddressList *a); bool mutt_group_match(struct Group *g, const char *s); struct Group *mutt_pattern_group(const char *pat); diff --git a/alias.c b/alias.c index f44b50c80..272c3d94d 100644 --- a/alias.c +++ b/alias.c @@ -87,7 +87,7 @@ static void expand_aliases_r(struct AddressList *al, struct ListHead *expn) { mutt_list_insert_head(expn, mutt_str_strdup(a->mailbox)); struct AddressList copy = TAILQ_HEAD_INITIALIZER(copy); - mutt_addresslist_copy(©, alias, false); + mutt_addrlist_copy(©, alias, false); expand_aliases_r(©, expn); struct Address *a2, *tmp; TAILQ_FOREACH_SAFE(a2, ©, entries, tmp) @@ -117,7 +117,7 @@ static void expand_aliases_r(struct AddressList *al, struct ListHead *expn) if (C_UseDomain && (fqdn = mutt_fqdn(true))) { /* now qualify all local addresses */ - mutt_addresslist_qualify(al, fqdn); + mutt_addrlist_qualify(al, fqdn); } } @@ -293,7 +293,7 @@ void mutt_expand_aliases(struct AddressList *al) STAILQ_INIT(&expn); expand_aliases_r(al, &expn); mutt_list_free(&expn); - mutt_addresslist_dedupe(al); + mutt_addrlist_dedupe(al); } /** @@ -413,14 +413,14 @@ retry_name: new = mutt_alias_new(); new->name = mutt_str_strdup(buf); - mutt_addresslist_to_local(al); + mutt_addrlist_to_local(al); if (addr && addr->mailbox) mutt_str_strfcpy(buf, addr->mailbox, sizeof(buf)); else buf[0] = '\0'; - mutt_addresslist_to_intl(al, NULL); + mutt_addrlist_to_intl(al, NULL); do { @@ -430,10 +430,10 @@ retry_name: return; } - mutt_addresslist_parse(&new->addr, buf); + mutt_addrlist_parse(&new->addr, buf); if (TAILQ_EMPTY(&new->addr)) BEEP(); - if (mutt_addresslist_to_intl(&new->addr, &err)) + if (mutt_addrlist_to_intl(&new->addr, &err)) { mutt_error(_("Bad IDN: '%s'"), err); FREE(&err); @@ -454,7 +454,7 @@ retry_name: mutt_str_replace(&TAILQ_FIRST(&new->addr)->personal, buf); buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), &new->addr, true); + mutt_addrlist_write(buf, sizeof(buf), &new->addr, true); snprintf(prompt, sizeof(prompt), _("[%s = %s] Accept?"), new->name, buf); if (mutt_yesorno(prompt, MUTT_YES) != MUTT_YES) { @@ -503,7 +503,7 @@ retry_name: recode_buf(buf, sizeof(buf)); fprintf(fp_alias, "alias %s ", buf); buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), &new->addr, false); + mutt_addrlist_write(buf, sizeof(buf), &new->addr, false); recode_buf(buf, sizeof(buf)); write_safe_address(fp_alias, buf); fputc('\n', fp_alias); @@ -544,7 +544,7 @@ void mutt_alias_add_reverse(struct Alias *t) /* Note that the address mailbox should be converted to intl form * before using as a key in the hash. This is currently done * by all callers, but added here mostly as documentation. */ - mutt_addresslist_to_intl(&t->addr, NULL); + mutt_addrlist_to_intl(&t->addr, NULL); struct Address *a = NULL; TAILQ_FOREACH(a, &t->addr, entries) @@ -565,7 +565,7 @@ void mutt_alias_delete_reverse(struct Alias *t) /* If the alias addresses were converted to local form, they won't * match the hash entries. */ - mutt_addresslist_to_intl(&t->addr, NULL); + mutt_addrlist_to_intl(&t->addr, NULL); struct Address *a = NULL; TAILQ_FOREACH(a, &t->addr, entries) @@ -732,7 +732,7 @@ void mutt_alias_free(struct Alias **p) mutt_alias_delete_reverse(*p); FREE(&(*p)->name); - mutt_addresslist_free_all(&((*p)->addr)); + mutt_addrlist_free_all(&((*p)->addr)); FREE(p); } diff --git a/commands.c b/commands.c index 62dfa0ad8..e730a1fab 100644 --- a/commands.c +++ b/commands.c @@ -400,7 +400,7 @@ void ci_bounce_message(struct Mailbox *m, struct EmailList *el) if (rc || !buf[0]) return; - mutt_addresslist_parse2(&al, buf); + mutt_addrlist_parse2(&al, buf); if (TAILQ_EMPTY(&al)) { mutt_error(_("Error parsing address")); @@ -409,16 +409,16 @@ void ci_bounce_message(struct Mailbox *m, struct EmailList *el) mutt_expand_aliases(&al); - if (mutt_addresslist_to_intl(&al, &err) < 0) + if (mutt_addrlist_to_intl(&al, &err) < 0) { mutt_error(_("Bad IDN: '%s'"), err); FREE(&err); - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); return; } buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), &al, true); + mutt_addrlist_write(buf, sizeof(buf), &al, true); #define EXTRA_SPACE (15 + 7 + 2) snprintf(scratch, sizeof(scratch), @@ -435,7 +435,7 @@ void ci_bounce_message(struct Mailbox *m, struct EmailList *el) if (query_quadoption(C_Bounce, prompt) != MUTT_YES) { - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); mutt_window_clearline(MuttMessageWindow, 0); mutt_message(ngettext("Message not bounced", "Messages not bounced", msg_count)); return; @@ -460,7 +460,7 @@ void ci_bounce_message(struct Mailbox *m, struct EmailList *el) break; } - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); /* If no error, or background, display message. */ if ((rc == 0) || (rc == S_BKG)) mutt_message(ngettext("Message bounced", "Messages bounced", msg_count)); @@ -873,7 +873,7 @@ void mutt_display_address(struct Envelope *env) * paste the on-the-wire form of the address to other, IDN-unable * software. */ buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), al, false); + mutt_addrlist_write(buf, sizeof(buf), al, false); mutt_message("%s: %s", pfx, buf); } diff --git a/compose.c b/compose.c index 911a73654..e47f8741b 100644 --- a/compose.c +++ b/compose.c @@ -440,7 +440,7 @@ static void draw_envelope_addr(int line, struct AddressList *al) char buf[1024]; buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), al, true); + mutt_addrlist_write(buf, sizeof(buf), al, true); SET_COLOR(MT_COLOR_COMPOSE_HEADER); mutt_window_mvprintw(MuttIndexWindow, line, 0, "%*s", HeaderPadding[line], _(Prompts[line])); @@ -520,16 +520,16 @@ static void edit_address_list(int line, struct AddressList *al) char buf[8192] = { 0 }; /* needs to be large for alias expansion */ char *err = NULL; - mutt_addresslist_to_local(al); - mutt_addresslist_write(buf, sizeof(buf), al, false); + mutt_addrlist_to_local(al); + mutt_addrlist_write(buf, sizeof(buf), al, false); if (mutt_get_field(_(Prompts[line]), buf, sizeof(buf), MUTT_ALIAS) == 0) { - mutt_addresslist_free_all(al); - mutt_addresslist_parse2(al, buf); + mutt_addrlist_free_all(al); + mutt_addrlist_parse2(al, buf); mutt_expand_aliases(al); } - if (mutt_addresslist_to_intl(al, &err) != 0) + if (mutt_addrlist_to_intl(al, &err) != 0) { mutt_error(_("Bad IDN: '%s'"), err); mutt_refresh(); @@ -538,7 +538,7 @@ static void edit_address_list(int line, struct AddressList *al) /* redraw the expanded list so the user can see the result */ buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), al, true); + mutt_addrlist_write(buf, sizeof(buf), al, true); mutt_window_move(MuttIndexWindow, line, HDR_XOFFSET); mutt_paddstr(W, buf); } diff --git a/config/address.c b/config/address.c index f60f4a7e0..b7c3cfad8 100644 --- a/config/address.c +++ b/config/address.c @@ -69,9 +69,9 @@ static int address_string_set(const struct ConfigSet *cs, void *var, struct Conf { // TODO - config can only store one struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - mutt_addresslist_parse(&al, value); + mutt_addrlist_parse(&al, value); addr = mutt_addr_copy(TAILQ_FIRST(&al)); - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); } int rc = CSR_SUCCESS; diff --git a/copy.c b/copy.c index 591a363ed..660aeded7 100644 --- a/copy.c +++ b/copy.c @@ -942,8 +942,8 @@ static int copy_delete_attach(struct Body *b, FILE *fp_in, FILE *fp_out, char *d * @param[out] h Array of header strings * @param[in] al AddressList * - * This function is the equivalent of mutt_write_addresslist(), but writes to - * a buffer instead of writing to a stream. mutt_write_addresslist could be + * This function is the equivalent of mutt_write_addrlist(), but writes to + * a buffer instead of writing to a stream. mutt_write_addrlist could be * re-used if we wouldn't store all the decoded headers in a huge array, first. * * TODO fix that. @@ -1076,11 +1076,11 @@ static int address_header_decode(char **h) } struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - mutt_addresslist_parse(&al, s + l); + mutt_addrlist_parse(&al, s + l); if (TAILQ_EMPTY(&al)) return 0; - mutt_addresslist_to_local(&al); + mutt_addrlist_to_local(&al); rfc2047_decode_addrlist(&al); struct Address *a = NULL; TAILQ_FOREACH(a, &al, entries) @@ -1102,7 +1102,7 @@ static int address_header_decode(char **h) format_address_header(h, &al); } - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); FREE(&s); return 1; diff --git a/edit.c b/edit.c index 62f63af6f..21f9affc6 100644 --- a/edit.c +++ b/edit.c @@ -273,7 +273,7 @@ static void be_print_header(struct Envelope *env) { addstr("To: "); tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &env->to, true); + mutt_addrlist_write(tmp, sizeof(tmp), &env->to, true); addstr(tmp); addch('\n'); } @@ -281,7 +281,7 @@ static void be_print_header(struct Envelope *env) { addstr("Cc: "); tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &env->cc, true); + mutt_addrlist_write(tmp, sizeof(tmp), &env->cc, true); addstr(tmp); addch('\n'); } @@ -289,7 +289,7 @@ static void be_print_header(struct Envelope *env) { addstr("Bcc: "); tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &env->bcc, true); + mutt_addrlist_write(tmp, sizeof(tmp), &env->bcc, true); addstr(tmp); addch('\n'); } @@ -315,24 +315,24 @@ static void be_edit_header(struct Envelope *e, bool force) addstr("To: "); tmp[0] = '\0'; - mutt_addresslist_to_local(&e->to); - mutt_addresslist_write(tmp, sizeof(tmp), &e->to, false); + mutt_addrlist_to_local(&e->to); + mutt_addrlist_write(tmp, sizeof(tmp), &e->to, false); if (TAILQ_EMPTY(&e->to) || force) { if (mutt_enter_string(tmp, sizeof(tmp), 4, MUTT_COMP_NO_FLAGS) == 0) { - mutt_addresslist_free_all(&e->to); - mutt_addresslist_parse2(&e->to, tmp); + mutt_addrlist_free_all(&e->to); + mutt_addrlist_parse2(&e->to, tmp); mutt_expand_aliases(&e->to); - mutt_addresslist_to_intl(&e->to, NULL); /* XXX - IDNA error reporting? */ + mutt_addrlist_to_intl(&e->to, NULL); /* XXX - IDNA error reporting? */ tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &e->to, true); + mutt_addrlist_write(tmp, sizeof(tmp), &e->to, true); mutt_window_mvaddstr(MuttMessageWindow, 0, 4, tmp); } } else { - mutt_addresslist_to_intl(&e->to, NULL); /* XXX - IDNA error reporting? */ + mutt_addrlist_to_intl(&e->to, NULL); /* XXX - IDNA error reporting? */ addstr(tmp); } addch('\n'); @@ -350,20 +350,20 @@ static void be_edit_header(struct Envelope *e, bool force) { addstr("Cc: "); tmp[0] = '\0'; - mutt_addresslist_to_local(&e->cc); - mutt_addresslist_write(tmp, sizeof(tmp), &e->cc, false); + mutt_addrlist_to_local(&e->cc); + mutt_addrlist_write(tmp, sizeof(tmp), &e->cc, false); if (mutt_enter_string(tmp, sizeof(tmp), 4, MUTT_COMP_NO_FLAGS) == 0) { - mutt_addresslist_free_all(&e->cc); - mutt_addresslist_parse2(&e->cc, tmp); + mutt_addrlist_free_all(&e->cc); + mutt_addrlist_parse2(&e->cc, tmp); mutt_expand_aliases(&e->cc); tmp[0] = '\0'; - mutt_addresslist_to_intl(&e->cc, NULL); - mutt_addresslist_write(tmp, sizeof(tmp), &e->cc, true); + mutt_addrlist_to_intl(&e->cc, NULL); + mutt_addrlist_write(tmp, sizeof(tmp), &e->cc, true); mutt_window_mvaddstr(MuttMessageWindow, 0, 4, tmp); } else - mutt_addresslist_to_intl(&e->cc, NULL); + mutt_addrlist_to_intl(&e->cc, NULL); addch('\n'); } @@ -371,20 +371,20 @@ static void be_edit_header(struct Envelope *e, bool force) { addstr("Bcc: "); tmp[0] = '\0'; - mutt_addresslist_to_local(&e->bcc); - mutt_addresslist_write(tmp, sizeof(tmp), &e->bcc, false); + mutt_addrlist_to_local(&e->bcc); + mutt_addrlist_write(tmp, sizeof(tmp), &e->bcc, false); if (mutt_enter_string(tmp, sizeof(tmp), 5, MUTT_COMP_NO_FLAGS) == 0) { - mutt_addresslist_free_all(&e->bcc); - mutt_addresslist_parse2(&e->bcc, tmp); + mutt_addrlist_free_all(&e->bcc); + mutt_addrlist_parse2(&e->bcc, tmp); mutt_expand_aliases(&e->bcc); - mutt_addresslist_to_intl(&e->bcc, NULL); + mutt_addrlist_to_intl(&e->bcc, NULL); tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &e->bcc, true); + mutt_addrlist_write(tmp, sizeof(tmp), &e->bcc, true); mutt_window_mvaddstr(MuttMessageWindow, 0, 5, tmp); } else - mutt_addresslist_to_intl(&e->bcc, NULL); + mutt_addrlist_to_intl(&e->bcc, NULL); addch('\n'); } } @@ -441,11 +441,11 @@ int mutt_builtin_editor(const char *path, struct Email *msg, struct Email *cur) addstr(_(EditorHelp2)); break; case 'b': - mutt_addresslist_parse2(&msg->env->bcc, p); + mutt_addrlist_parse2(&msg->env->bcc, p); mutt_expand_aliases(&msg->env->bcc); break; case 'c': - mutt_addresslist_parse2(&msg->env->cc, p); + mutt_addrlist_parse2(&msg->env->cc, p); mutt_expand_aliases(&msg->env->cc); break; case 'h': @@ -499,7 +499,7 @@ int mutt_builtin_editor(const char *path, struct Email *msg, struct Email *cur) mutt_str_replace(&msg->env->subject, p); break; case 't': - mutt_addresslist_parse(&msg->env->to, p); + mutt_addrlist_parse(&msg->env->to, p); mutt_expand_aliases(&msg->env->to); break; case 'u': diff --git a/email/envelope.c b/email/envelope.c index 4af7775f3..f4ceeb245 100644 --- a/email/envelope.c +++ b/email/envelope.c @@ -63,15 +63,15 @@ void mutt_env_free(struct Envelope **p) { if (!p || !*p) return; - mutt_addresslist_free_all(&(*p)->return_path); - mutt_addresslist_free_all(&(*p)->from); - mutt_addresslist_free_all(&(*p)->to); - mutt_addresslist_free_all(&(*p)->cc); - mutt_addresslist_free_all(&(*p)->bcc); - mutt_addresslist_free_all(&(*p)->sender); - mutt_addresslist_free_all(&(*p)->reply_to); - mutt_addresslist_free_all(&(*p)->mail_followup_to); - mutt_addresslist_free_all(&(*p)->x_original_to); + mutt_addrlist_free_all(&(*p)->return_path); + mutt_addrlist_free_all(&(*p)->from); + mutt_addrlist_free_all(&(*p)->to); + mutt_addrlist_free_all(&(*p)->cc); + mutt_addrlist_free_all(&(*p)->bcc); + mutt_addrlist_free_all(&(*p)->sender); + mutt_addrlist_free_all(&(*p)->reply_to); + mutt_addrlist_free_all(&(*p)->mail_followup_to); + mutt_addrlist_free_all(&(*p)->x_original_to); FREE(&(*p)->list_post); FREE(&(*p)->subject); @@ -192,12 +192,11 @@ bool mutt_env_cmp_strict(const struct Envelope *e1, const struct Envelope *e2) if ((mutt_str_strcmp(e1->message_id, e2->message_id) != 0) || (mutt_str_strcmp(e1->subject, e2->subject) != 0) || !mutt_list_compare(&e1->references, &e2->references) || - !mutt_addresslist_equal(&e1->from, &e2->from) || - !mutt_addresslist_equal(&e1->sender, &e2->sender) || - !mutt_addresslist_equal(&e1->reply_to, &e2->reply_to) || - !mutt_addresslist_equal(&e1->to, &e2->to) || - !mutt_addresslist_equal(&e1->cc, &e2->cc) || - !mutt_addresslist_equal(&e1->return_path, &e2->return_path)) + !mutt_addrlist_equal(&e1->from, &e2->from) || + !mutt_addrlist_equal(&e1->sender, &e2->sender) || + !mutt_addrlist_equal(&e1->reply_to, &e2->reply_to) || + !mutt_addrlist_equal(&e1->to, &e2->to) || !mutt_addrlist_equal(&e1->cc, &e2->cc) || + !mutt_addrlist_equal(&e1->return_path, &e2->return_path)) { return false; } @@ -217,20 +216,20 @@ bool mutt_env_cmp_strict(const struct Envelope *e1, const struct Envelope *e2) * mutt_env_to_local - Convert an Envelope's Address fields to local format * @param env Envelope to modify * - * Run mutt_addresslist_to_local() on each of the Address fields in the Envelope. + * Run mutt_addrlist_to_local() on each of the Address fields in the Envelope. */ void mutt_env_to_local(struct Envelope *env) { if (!env) return; - mutt_addresslist_to_local(&env->return_path); - mutt_addresslist_to_local(&env->from); - mutt_addresslist_to_local(&env->to); - mutt_addresslist_to_local(&env->cc); - mutt_addresslist_to_local(&env->bcc); - mutt_addresslist_to_local(&env->reply_to); - mutt_addresslist_to_local(&env->mail_followup_to); + mutt_addrlist_to_local(&env->return_path); + mutt_addrlist_to_local(&env->from); + mutt_addrlist_to_local(&env->to); + mutt_addrlist_to_local(&env->cc); + mutt_addrlist_to_local(&env->bcc); + mutt_addrlist_to_local(&env->reply_to); + mutt_addrlist_to_local(&env->mail_followup_to); } /* Note that 'member' in the 'env->member' expression is macro argument, not @@ -239,7 +238,7 @@ void mutt_env_to_local(struct Envelope *env) * Note that #member escapes and double quotes the argument. */ #define H_TO_INTL(member) \ - if (mutt_addresslist_to_intl(&env->member, err) && !e) \ + if (mutt_addrlist_to_intl(&env->member, err) && !e) \ { \ if (tag) \ *tag = #member; \ @@ -255,7 +254,7 @@ void mutt_env_to_local(struct Envelope *env) * @retval 0 Success, all addresses converted * @retval 1 Error, tag and err will be set * - * Run mutt_addresslist_to_intl() on each of the Address fields in the Envelope. + * Run mutt_addrlist_to_intl() on each of the Address fields in the Envelope. */ int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err) { diff --git a/email/parse.c b/email/parse.c index 03d34f5d4..644f22cb7 100644 --- a/email/parse.c +++ b/email/parse.c @@ -551,12 +551,12 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, case 'a': if (mutt_str_strcasecmp(line + 1, "pparently-to") == 0) { - mutt_addresslist_parse(&env->to, p); + mutt_addrlist_parse(&env->to, p); matched = true; } else if (mutt_str_strcasecmp(line + 1, "pparently-from") == 0) { - mutt_addresslist_parse(&env->from, p); + mutt_addrlist_parse(&env->from, p); matched = true; } break; @@ -564,7 +564,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, case 'b': if (mutt_str_strcasecmp(line + 1, "cc") == 0) { - mutt_addresslist_parse(&env->bcc, p); + mutt_addrlist_parse(&env->bcc, p); matched = true; } break; @@ -572,7 +572,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, case 'c': if (mutt_str_strcasecmp(line + 1, "c") == 0) { - mutt_addresslist_parse(&env->cc, p); + mutt_addrlist_parse(&env->cc, p); matched = true; } else @@ -659,7 +659,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, case 'f': if (mutt_str_strcasecmp("rom", line + 1) == 0) { - mutt_addresslist_parse(&env->from, p); + mutt_addrlist_parse(&env->from, p); matched = true; } #ifdef USE_NNTP @@ -748,13 +748,13 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, if (mutt_str_strcasecmp(line + 1 + plen, "reply-to") == 0) { /* override the Reply-To: field */ - mutt_addresslist_free_all(&env->reply_to); - mutt_addresslist_parse(&env->reply_to, p); + mutt_addrlist_free_all(&env->reply_to); + mutt_addrlist_parse(&env->reply_to, p); matched = true; } else if (mutt_str_strcasecmp(line + 1 + plen, "followup-to") == 0) { - mutt_addresslist_parse(&env->mail_followup_to, p); + mutt_addrlist_parse(&env->mail_followup_to, p); matched = true; } } @@ -791,12 +791,12 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, } else if (mutt_str_strcasecmp(line + 1, "eply-to") == 0) { - mutt_addresslist_parse(&env->reply_to, p); + mutt_addrlist_parse(&env->reply_to, p); matched = true; } else if (mutt_str_strcasecmp(line + 1, "eturn-path") == 0) { - mutt_addresslist_parse(&env->return_path, p); + mutt_addrlist_parse(&env->return_path, p); matched = true; } else if (mutt_str_strcasecmp(line + 1, "eceived") == 0) @@ -820,7 +820,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, } else if (mutt_str_strcasecmp(line + 1, "ender") == 0) { - mutt_addresslist_parse(&env->sender, p); + mutt_addrlist_parse(&env->sender, p); matched = true; } else if (mutt_str_strcasecmp(line + 1, "tatus") == 0) @@ -858,7 +858,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, case 't': if (mutt_str_strcasecmp(line + 1, "o") == 0) { - mutt_addresslist_parse(&env->to, p); + mutt_addrlist_parse(&env->to, p); matched = true; } break; @@ -911,7 +911,7 @@ int mutt_rfc822_parse_line(struct Envelope *env, struct Email *e, char *line, #endif else if (mutt_str_strcasecmp(line + 1, "-original-to") == 0) { - mutt_addresslist_parse(&env->x_original_to, p); + mutt_addrlist_parse(&env->x_original_to, p); matched = true; } @@ -1497,7 +1497,7 @@ int mutt_parse_mailto(struct Envelope *e, char **body, const char *src) if (url_pct_decode(tmp) < 0) goto out; - mutt_addresslist_parse(&e->to, tmp); + mutt_addrlist_parse(&e->to, tmp); tag = headers ? strtok_r(headers, "&", &p) : NULL; diff --git a/hdrline.c b/hdrline.c index 8d3d1c893..b0f9de053 100644 --- a/hdrline.c +++ b/hdrline.c @@ -876,7 +876,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'f': tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &e->env->from, true); + mutt_addrlist_write(tmp, sizeof(tmp), &e->env->from, true); mutt_format_s(buf, buflen, prec, tmp); break; @@ -1114,7 +1114,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'r': tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &e->env->to, true); + mutt_addrlist_write(tmp, sizeof(tmp), &e->env->to, true); if (optional && (tmp[0] == '\0')) optional = 0; mutt_format_s(buf, buflen, prec, tmp); @@ -1122,7 +1122,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co case 'R': tmp[0] = '\0'; - mutt_addresslist_write(tmp, sizeof(tmp), &e->env->cc, true); + mutt_addrlist_write(tmp, sizeof(tmp), &e->env->cc, true); if (optional && (tmp[0] == '\0')) optional = 0; mutt_format_s(buf, buflen, prec, tmp); diff --git a/init.c b/init.c index 4e0a5ccbd..807c2d5a1 100644 --- a/init.c +++ b/init.c @@ -923,7 +923,7 @@ static enum CommandResult parse_alias(struct Buffer *buf, struct Buffer *s, { mutt_alias_delete_reverse(tmp); /* override the previous value */ - mutt_addresslist_free_all(&tmp->addr); + mutt_addrlist_free_all(&tmp->addr); if (CurrentMenu == MENU_ALIAS) mutt_menu_set_current_redraw_full(); } @@ -931,16 +931,16 @@ static enum CommandResult parse_alias(struct Buffer *buf, struct Buffer *s, mutt_extract_token(buf, s, MUTT_TOKEN_QUOTE | MUTT_TOKEN_SPACE | MUTT_TOKEN_SEMICOLON); mutt_debug(5, "Second token is '%s'\n", buf->data); - mutt_addresslist_parse2(&tmp->addr, buf->data); + mutt_addrlist_parse2(&tmp->addr, buf->data); - if (mutt_addresslist_to_intl(&tmp->addr, &estr)) + if (mutt_addrlist_to_intl(&tmp->addr, &estr)) { mutt_buffer_printf(err, _("Warning: Bad IDN '%s' in alias '%s'"), estr, tmp->name); FREE(&estr); goto bail; } - mutt_grouplist_add_addresslist(&gc, &tmp->addr); + mutt_grouplist_add_addrlist(&gc, &tmp->addr); mutt_alias_add_reverse(tmp); if (C_DebugLevel > LL_DEBUG4) @@ -1151,22 +1151,22 @@ static enum CommandResult parse_group(struct Buffer *buf, struct Buffer *s, { char *estr = NULL; struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - mutt_addresslist_parse2(&al, buf->data); + mutt_addrlist_parse2(&al, buf->data); if (TAILQ_EMPTY(&al)) goto bail; - if (mutt_addresslist_to_intl(&al, &estr)) + if (mutt_addrlist_to_intl(&al, &estr)) { mutt_buffer_printf(err, _("%sgroup: warning: bad IDN '%s'"), (data == 1) ? "un" : "", estr); - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); FREE(&estr); goto bail; } if (data == MUTT_GROUP) - mutt_grouplist_add_addresslist(&gc, &al); + mutt_grouplist_add_addrlist(&gc, &al); else if (data == MUTT_UNGROUP) - mutt_grouplist_remove_addresslist(&gc, &al); - mutt_addresslist_free_all(&al); + mutt_grouplist_remove_addrlist(&gc, &al); + mutt_addrlist_free_all(&al); break; } } diff --git a/main.c b/main.c index c9a962336..a8002d89b 100644 --- a/main.c +++ b/main.c @@ -649,12 +649,12 @@ int main(int argc, char *argv[], char *envp[]) struct ListNode *np = NULL; STAILQ_FOREACH(np, &bcc_list, entries) { - mutt_addresslist_parse(&msg->env->bcc, np->data); + mutt_addrlist_parse(&msg->env->bcc, np->data); } STAILQ_FOREACH(np, &cc_list, entries) { - mutt_addresslist_parse(&msg->env->cc, np->data); + mutt_addrlist_parse(&msg->env->cc, np->data); } mutt_list_free(&bcc_list); @@ -768,8 +768,8 @@ int main(int argc, char *argv[], char *envp[]) if (al) { /* output in machine-readable form */ - mutt_addresslist_to_intl(al, NULL); - mutt_write_addresslist(al, stdout, 0, 0); + mutt_addrlist_to_intl(al, NULL); + mutt_write_addrlist(al, stdout, 0, 0); } else { @@ -869,7 +869,7 @@ int main(int argc, char *argv[], char *envp[]) } } else - mutt_addresslist_parse(&msg->env->to, argv[i]); + mutt_addrlist_parse(&msg->env->to, argv[i]); } if (!draft_file && C_Autoedit && TAILQ_EMPTY(&msg->env->to) && @@ -1004,9 +1004,9 @@ int main(int argc, char *argv[], char *envp[]) } } - mutt_addresslist_copy(&msg->env->to, &opts_env->to, false); - mutt_addresslist_copy(&msg->env->cc, &opts_env->cc, false); - mutt_addresslist_copy(&msg->env->bcc, &opts_env->bcc, false); + mutt_addrlist_copy(&msg->env->to, &opts_env->to, false); + mutt_addrlist_copy(&msg->env->cc, &opts_env->cc, false); + mutt_addrlist_copy(&msg->env->bcc, &opts_env->bcc, false); if (opts_env->subject) mutt_str_replace(&msg->env->subject, opts_env->subject); diff --git a/mbox/mbox.c b/mbox/mbox.c index a2fa8c4d3..fa71c5133 100644 --- a/mbox/mbox.c +++ b/mbox/mbox.c @@ -307,10 +307,10 @@ static int mmdf_parse_mailbox(struct Mailbox *m) } if (TAILQ_EMPTY(&e->env->return_path) && return_path[0]) - mutt_addresslist_parse(&e->env->return_path, return_path); + mutt_addrlist_parse(&e->env->return_path, return_path); if (TAILQ_EMPTY(&e->env->from)) - mutt_addresslist_copy(&e->env->from, &e->env->return_path, false); + mutt_addrlist_copy(&e->env->from, &e->env->return_path, false); m->msg_count++; } @@ -499,11 +499,11 @@ static int mbox_parse_mailbox(struct Mailbox *m) if (TAILQ_EMPTY(&e_cur->env->return_path) && return_path[0]) { - mutt_addresslist_parse(&e_cur->env->return_path, return_path); + mutt_addrlist_parse(&e_cur->env->return_path, return_path); } if (TAILQ_EMPTY(&e_cur->env->from)) - mutt_addresslist_copy(&e_cur->env->from, &e_cur->env->return_path, false); + mutt_addrlist_copy(&e_cur->env->from, &e_cur->env->return_path, false); lines = 0; } diff --git a/muttlib.c b/muttlib.c index e8a3a66a7..4f60a5e13 100644 --- a/muttlib.c +++ b/muttlib.c @@ -222,8 +222,8 @@ void mutt_buffer_expand_path_regex(struct Buffer *buf, bool regex) { struct Email *e = mutt_email_new(); e->env = mutt_env_new(); - mutt_addresslist_copy(&e->env->from, al, false); - mutt_addresslist_copy(&e->env->to, al, false); + mutt_addrlist_copy(&e->env->from, al, false); + mutt_addrlist_copy(&e->env->to, al, false); /* TODO: fix mutt_default_save() to use Buffer */ mutt_buffer_increase_size(p, PATH_MAX); diff --git a/mx.c b/mx.c index e7ce022f8..ad77c7256 100644 --- a/mx.c +++ b/mx.c @@ -1345,8 +1345,8 @@ int mx_path_canon(char *buf, size_t buflen, const char *folder, enum MailboxType struct Email *e = mutt_email_new(); e->env = mutt_env_new(); - mutt_addresslist_copy(&e->env->from, al, false); - mutt_addresslist_copy(&e->env->to, al, false); + mutt_addrlist_copy(&e->env->from, al, false); + mutt_addrlist_copy(&e->env->to, al, false); mutt_default_save(buf, buflen, e); mutt_email_free(&e); break; diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index 6ea3edc54..b76be60c8 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -925,11 +925,11 @@ int crypt_get_keys(struct Email *msg, char **keylist, bool oppenc_mode) if (WithCrypto & APPLICATION_PGP) OptPgpCheckTrust = true; - mutt_addresslist_copy(&addrlist, &msg->env->to, false); - mutt_addresslist_copy(&addrlist, &msg->env->cc, false); - mutt_addresslist_copy(&addrlist, &msg->env->bcc, false); - mutt_addresslist_qualify(&addrlist, fqdn); - mutt_addresslist_dedupe(&addrlist); + mutt_addrlist_copy(&addrlist, &msg->env->to, false); + mutt_addrlist_copy(&addrlist, &msg->env->cc, false); + mutt_addrlist_copy(&addrlist, &msg->env->bcc, false); + mutt_addrlist_qualify(&addrlist, fqdn); + mutt_addrlist_dedupe(&addrlist); *keylist = NULL; @@ -940,7 +940,7 @@ int crypt_get_keys(struct Email *msg, char **keylist, bool oppenc_mode) *keylist = crypt_pgp_find_keys(&addrlist, oppenc_mode); if (!*keylist) { - mutt_addresslist_free_all(&addrlist); + mutt_addrlist_free_all(&addrlist); return -1; } OptPgpCheckTrust = false; @@ -952,7 +952,7 @@ int crypt_get_keys(struct Email *msg, char **keylist, bool oppenc_mode) *keylist = crypt_smime_find_keys(&addrlist, oppenc_mode); if (!*keylist) { - mutt_addresslist_free_all(&addrlist); + mutt_addrlist_free_all(&addrlist); return -1; } if (C_SmimeSelfEncrypt || (C_SmimeEncryptSelf == MUTT_YES)) @@ -967,7 +967,7 @@ int crypt_get_keys(struct Email *msg, char **keylist, bool oppenc_mode) sprintf(*keylist + keylist_size, " %s", self_encrypt); } - mutt_addresslist_free_all(&addrlist); + mutt_addrlist_free_all(&addrlist); return 0; } diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index f66a4e4a1..046b11933 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -4917,7 +4917,7 @@ static struct CryptKeyInfo *crypt_getkeybyaddr(struct Address *a, match = false; /* any match */ struct AddressList alist = TAILQ_HEAD_INITIALIZER(alist); - mutt_addresslist_parse(&alist, k->uid); + mutt_addrlist_parse(&alist, k->uid); struct Address *ka = NULL; TAILQ_FOREACH(ka, &alist, entries) { @@ -4940,7 +4940,7 @@ static struct CryptKeyInfo *crypt_getkeybyaddr(struct Address *a, } } } - mutt_addresslist_free_all(&alist); + mutt_addrlist_free_all(&alist); if (match) { @@ -5184,10 +5184,10 @@ static char *find_keys(struct AddressList *addrlist, unsigned int app, bool oppe } /* check for e-mail address */ - mutt_addresslist_free_all(&hookal); - if (strchr(keyID, '@') && (mutt_addresslist_parse(&hookal, keyID) != 0)) + mutt_addrlist_free_all(&hookal); + if (strchr(keyID, '@') && (mutt_addrlist_parse(&hookal, keyID) != 0)) { - mutt_addresslist_qualify(&hookal, fqdn); + mutt_addrlist_qualify(&hookal, fqdn); p = TAILQ_FIRST(&hookal); } else if (!oppenc_mode) @@ -5206,7 +5206,7 @@ static char *find_keys(struct AddressList *addrlist, unsigned int app, bool oppe else if (ans == MUTT_ABORT) { FREE(&keylist); - mutt_addresslist_free_all(&hookal); + mutt_addrlist_free_all(&hookal); mutt_list_free(&crypt_hook_list); return NULL; } @@ -5227,7 +5227,7 @@ static char *find_keys(struct AddressList *addrlist, unsigned int app, bool oppe if (!k_info) { FREE(&keylist); - mutt_addresslist_free_all(&hookal); + mutt_addrlist_free_all(&hookal); mutt_list_free(&crypt_hook_list); return NULL; } @@ -5244,7 +5244,7 @@ static char *find_keys(struct AddressList *addrlist, unsigned int app, bool oppe key_selected = true; crypt_free_key(&k_info); - mutt_addresslist_free_all(&hookal); + mutt_addrlist_free_all(&hookal); if (crypt_hook) crypt_hook = STAILQ_NEXT(crypt_hook, entries); diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 148772657..59ad8a89a 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1452,10 +1452,10 @@ char *pgp_class_find_keys(struct AddressList *addrlist, bool oppenc_mode) } /* check for e-mail address */ - mutt_addresslist_free_all(&hookal); - if (strchr(keyID, '@') && (mutt_addresslist_parse(&hookal, keyID) != 0)) + mutt_addrlist_free_all(&hookal); + if (strchr(keyID, '@') && (mutt_addrlist_parse(&hookal, keyID) != 0)) { - mutt_addresslist_qualify(&hookal, fqdn); + mutt_addrlist_qualify(&hookal, fqdn); p = TAILQ_FIRST(&hookal); } else if (!oppenc_mode) @@ -1474,7 +1474,7 @@ char *pgp_class_find_keys(struct AddressList *addrlist, bool oppenc_mode) else if (ans == MUTT_ABORT) { FREE(&keylist); - mutt_addresslist_free_all(&hookal); + mutt_addrlist_free_all(&hookal); mutt_list_free(&crypt_hook_list); return NULL; } @@ -1495,7 +1495,7 @@ char *pgp_class_find_keys(struct AddressList *addrlist, bool oppenc_mode) if (!k_info) { FREE(&keylist); - mutt_addresslist_free_all(&hookal); + mutt_addrlist_free_all(&hookal); mutt_list_free(&crypt_hook_list); return NULL; } @@ -1511,7 +1511,7 @@ char *pgp_class_find_keys(struct AddressList *addrlist, bool oppenc_mode) key_selected = true; pgp_free_key(&k_info); - mutt_addresslist_free_all(&hookal); + mutt_addrlist_free_all(&hookal); if (crypt_hook) crypt_hook = STAILQ_NEXT(crypt_hook, entries); diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index 7790e1f6b..d5b133736 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -445,7 +445,7 @@ void pgp_class_invoke_getkeys(struct Address *addr) *tmp = '\0'; struct AddressList alist = TAILQ_HEAD_INITIALIZER(alist); TAILQ_INSERT_TAIL(&alist, addr, entries); - mutt_addresslist_to_local(&alist); + mutt_addrlist_to_local(&alist); mutt_addr_write(tmp, sizeof(tmp), addr, false); mutt_buffer_quote_filename(buf, tmp, true); diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 4d4e94114..ab19b87cc 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -1034,7 +1034,7 @@ struct PgpKeyInfo *pgp_getkeybyaddr(struct Address *a, KeyFlags abilities, for (q = k->address; q; q = q->next) { struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - mutt_addresslist_parse(&al, NONULL(q->addr)); + mutt_addrlist_parse(&al, NONULL(q->addr)); struct Address *qa = NULL; TAILQ_FOREACH(qa, &al, entries) { @@ -1058,7 +1058,7 @@ struct PgpKeyInfo *pgp_getkeybyaddr(struct Address *a, KeyFlags abilities, } } - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); } if (match) diff --git a/query.c b/query.c index 0c27554a8..323cea054 100644 --- a/query.c +++ b/query.c @@ -93,8 +93,8 @@ static struct AddressList *result_to_addr(struct Query *r) if (!r) return NULL; - struct AddressList *al = mutt_addresslist_new(); - mutt_addresslist_copy(al, &r->addr, false); + struct AddressList *al = mutt_addrlist_new(); + mutt_addrlist_copy(al, &r->addr, false); if (!TAILQ_EMPTY(al)) { struct Address *first = TAILQ_FIRST(al); @@ -102,7 +102,7 @@ static struct AddressList *result_to_addr(struct Query *r) if (!second && !first->personal) first->personal = mutt_str_strdup(r->name); - mutt_addresslist_to_intl(al, NULL); + mutt_addrlist_to_intl(al, NULL); } return al; @@ -135,7 +135,7 @@ static void free_query(struct Query **query) p = *query; *query = (*query)->next; - mutt_addresslist_free_all(&p->addr); + mutt_addrlist_free_all(&p->addr); FREE(&p->name); FREE(&p->other); FREE(&p); @@ -194,7 +194,7 @@ static struct Query *run_query(char *s, int quiet) cur = cur->next; } - mutt_addresslist_parse(&cur->addr, p); + mutt_addrlist_parse(&cur->addr, p); p = strtok(NULL, "\t\n"); if (p) { @@ -277,7 +277,7 @@ static const char *query_format_str(char *buf, size_t buflen, size_t col, int co switch (op) { case 'a': - mutt_addresslist_write(tmp, sizeof(tmp), &query->addr, true); + mutt_addrlist_write(tmp, sizeof(tmp), &query->addr, true); mutt_format_s(buf, buflen, prec, tmp); break; case 'c': @@ -475,19 +475,19 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret if (query_table[i].tagged) { struct AddressList *al = result_to_addr(query_table[i].data); - mutt_addresslist_copy(&naddr, al, false); - mutt_addresslist_free(&al); + mutt_addrlist_copy(&naddr, al, false); + mutt_addrlist_free(&al); } } mutt_alias_create(NULL, &naddr); - mutt_addresslist_free_all(&naddr); + mutt_addrlist_free_all(&naddr); } else { struct AddressList *al = result_to_addr(query_table[menu->current].data); mutt_alias_create(NULL, al); - mutt_addresslist_free(&al); + mutt_addrlist_free(&al); } break; @@ -505,8 +505,8 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret if (!menu->tagprefix) { struct AddressList *al = result_to_addr(query_table[menu->current].data); - mutt_addresslist_copy(&msg->env->to, al, false); - mutt_addresslist_free(&al); + mutt_addrlist_copy(&msg->env->to, al, false); + mutt_addrlist_free(&al); } else { @@ -515,8 +515,8 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret if (query_table[i].tagged) { struct AddressList *al = result_to_addr(query_table[i].data); - mutt_addresslist_copy(&msg->env->to, al, false); - mutt_addresslist_free(&al); + mutt_addrlist_copy(&msg->env->to, al, false); + mutt_addrlist_free(&al); } } } @@ -547,20 +547,20 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret if (curpos == 0) { struct AddressList *al = result_to_addr(query_table[i].data); - mutt_addresslist_to_local(al); + mutt_addrlist_to_local(al); tagged = true; - mutt_addresslist_write(buf, buflen, al, false); + mutt_addrlist_write(buf, buflen, al, false); curpos = mutt_str_strlen(buf); - mutt_addresslist_free(&al); + mutt_addrlist_free(&al); } else if (curpos + 2 < buflen) { struct AddressList *al = result_to_addr(query_table[i].data); - mutt_addresslist_to_local(al); + mutt_addrlist_to_local(al); strcat(buf, ", "); - mutt_addresslist_write(buf + curpos + 1, buflen - curpos - 1, al, false); + mutt_addrlist_write(buf + curpos + 1, buflen - curpos - 1, al, false); curpos = mutt_str_strlen(buf); - mutt_addresslist_free(&al); + mutt_addrlist_free(&al); } } } @@ -568,9 +568,9 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret if (!tagged) { struct AddressList *al = result_to_addr(query_table[menu->current].data); - mutt_addresslist_to_local(al); - mutt_addresslist_write(buf, buflen, al, false); - mutt_addresslist_free(&al); + mutt_addrlist_to_local(al); + mutt_addrlist_write(buf, buflen, al, false); + mutt_addrlist_free(&al); } } @@ -602,10 +602,10 @@ int mutt_query_complete(char *buf, size_t buflen) if (!results->next) { struct AddressList *al = result_to_addr(results); - mutt_addresslist_to_local(al); + mutt_addrlist_to_local(al); buf[0] = '\0'; - mutt_addresslist_write(buf, buflen, al, false); - mutt_addresslist_free(&al); + mutt_addrlist_write(buf, buflen, al, false); + mutt_addrlist_free(&al); free_query(&results); mutt_clear_error(); return 0; diff --git a/recvcmd.c b/recvcmd.c index 7380d5754..564e152fb 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -215,7 +215,7 @@ void mutt_attach_bounce(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, str return; struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - mutt_addresslist_parse(&al, buf); + mutt_addrlist_parse(&al, buf); if (TAILQ_EMPTY(&al)) { mutt_error(_("Error parsing address")); @@ -224,7 +224,7 @@ void mutt_attach_bounce(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, str mutt_expand_aliases(&al); - if (mutt_addresslist_to_intl(&al, &err) < 0) + if (mutt_addrlist_to_intl(&al, &err) < 0) { mutt_error(_("Bad IDN: '%s'"), err); FREE(&err); @@ -232,7 +232,7 @@ void mutt_attach_bounce(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, str } buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), &al, true); + mutt_addrlist_write(buf, sizeof(buf), &al, true); #define EXTRA_SPACE (15 + 7 + 2) /* See commands.c. */ @@ -275,7 +275,7 @@ void mutt_attach_bounce(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, str mutt_error(ngettext("Error bouncing message", "Error bouncing messages", p)); end: - mutt_addresslist_free_all(&al); + mutt_addrlist_free_all(&al); } /** diff --git a/remailer.c b/remailer.c index 40f804e1b..a4556d132 100644 --- a/remailer.c +++ b/remailer.c @@ -809,9 +809,9 @@ int mix_check_message(struct Email *msg) } /* Cc and Bcc are empty at this point. */ - mutt_addresslist_qualify(&msg->env->to, fqdn); - mutt_addresslist_qualify(&msg->env->reply_to, fqdn); - mutt_addresslist_qualify(&msg->env->mail_followup_to, fqdn); + mutt_addrlist_qualify(&msg->env->to, fqdn); + mutt_addrlist_qualify(&msg->env->reply_to, fqdn); + mutt_addrlist_qualify(&msg->env->mail_followup_to, fqdn); } return 0; diff --git a/send.c b/send.c index 08a15a7fe..452a8ecf7 100644 --- a/send.c +++ b/send.c @@ -163,7 +163,7 @@ static void remove_user(struct AddressList *al, bool leave_only) { if (mutt_addr_is_user(a) && (!leave_only || TAILQ_NEXT(a, entries))) { - mutt_addresslist_free_one(al, a); + mutt_addrlist_free_one(al, a); } } } @@ -208,14 +208,14 @@ static int edit_address(struct AddressList *al, const char *field) do { buf[0] = '\0'; - mutt_addresslist_to_local(al); - mutt_addresslist_write(buf, sizeof(buf), al, false); + mutt_addrlist_to_local(al); + mutt_addrlist_write(buf, sizeof(buf), al, false); if (mutt_get_field(field, buf, sizeof(buf), MUTT_ALIAS) != 0) return -1; - mutt_addresslist_free_all(al); - mutt_addresslist_parse2(al, buf); + mutt_addrlist_free_all(al); + mutt_addrlist_parse2(al, buf); mutt_expand_aliases(al); - idna_ok = mutt_addresslist_to_intl(al, &err); + idna_ok = mutt_addrlist_to_intl(al, &err); if (idna_ok != 0) { mutt_error(_("Bad IDN: '%s'"), err); @@ -349,11 +349,11 @@ static void process_user_recips(struct Envelope *env) { size_t plen; if ((plen = mutt_str_startswith(uh->data, "to:", CASE_IGNORE))) - mutt_addresslist_parse(&env->to, uh->data + plen); + mutt_addrlist_parse(&env->to, uh->data + plen); else if ((plen = mutt_str_startswith(uh->data, "cc:", CASE_IGNORE))) - mutt_addresslist_parse(&env->cc, uh->data + plen); + mutt_addrlist_parse(&env->cc, uh->data + plen); else if ((plen = mutt_str_startswith(uh->data, "bcc:", CASE_IGNORE))) - mutt_addresslist_parse(&env->bcc, uh->data + plen); + mutt_addrlist_parse(&env->bcc, uh->data + plen); #ifdef USE_NNTP else if ((plen = mutt_str_startswith(uh->data, "newsgroups:", CASE_IGNORE))) env->newsgroups = nntp_get_header(uh->data + plen); @@ -378,13 +378,13 @@ static void process_user_header(struct Envelope *env) if ((plen = mutt_str_startswith(uh->data, "from:", CASE_IGNORE))) { /* User has specified a default From: address. Remove default address */ - mutt_addresslist_free_all(&env->from); - mutt_addresslist_parse(&env->from, uh->data + plen); + mutt_addrlist_free_all(&env->from); + mutt_addrlist_parse(&env->from, uh->data + plen); } else if ((plen = mutt_str_startswith(uh->data, "reply-to:", CASE_IGNORE))) { - mutt_addresslist_free_all(&env->reply_to); - mutt_addresslist_parse(&env->reply_to, uh->data + plen); + mutt_addrlist_free_all(&env->reply_to); + mutt_addrlist_parse(&env->reply_to, uh->data + plen); } else if ((plen = mutt_str_startswith(uh->data, "message-id:", CASE_IGNORE))) { @@ -716,7 +716,7 @@ static int default_to(struct AddressList *to, struct Envelope *env, SendFlags fl if (flags && !TAILQ_EMPTY(&env->mail_followup_to) && (hmfupto == MUTT_YES)) { - mutt_addresslist_copy(to, &env->mail_followup_to, true); + mutt_addrlist_copy(to, &env->mail_followup_to, true); return 0; } @@ -728,7 +728,7 @@ static int default_to(struct AddressList *to, struct Envelope *env, SendFlags fl if (!C_ReplySelf && mutt_addr_is_user(from)) { /* mail is from the user, assume replying to recipients */ - mutt_addresslist_copy(to, &env->to, true); + mutt_addrlist_copy(to, &env->to, true); } else if (reply_to) { @@ -737,8 +737,8 @@ static int default_to(struct AddressList *to, struct Envelope *env, SendFlags fl reply_to && TAILQ_NEXT(TAILQ_FIRST(&env->reply_to), entries); if ((from_is_reply_to && !multiple_reply_to && !reply_to->personal) || (C_IgnoreListReplyTo && mutt_is_mail_list(reply_to) && - (mutt_addresslist_search(reply_to, &env->to) || - mutt_addresslist_search(reply_to, &env->cc)))) + (mutt_addrlist_search(reply_to, &env->to) || + mutt_addrlist_search(reply_to, &env->cc)))) { /* If the Reply-To: address is a mailing list, assume that it was * put there by the mailing list, and use the From: address @@ -746,7 +746,7 @@ static int default_to(struct AddressList *to, struct Envelope *env, SendFlags fl * We also take the from header if our correspondent has a reply-to * header which is identical to the electronic mail address given * in his From header, and the reply-to has no display-name. */ - mutt_addresslist_copy(to, &env->from, false); + mutt_addrlist_copy(to, &env->from, false); } else if (!(from_is_reply_to && !multiple_reply_to) && (C_ReplyTo != MUTT_YES)) { @@ -761,11 +761,11 @@ static int default_to(struct AddressList *to, struct Envelope *env, SendFlags fl switch (query_quadoption(C_ReplyTo, prompt)) { case MUTT_YES: - mutt_addresslist_copy(to, &env->reply_to, false); + mutt_addrlist_copy(to, &env->reply_to, false); break; case MUTT_NO: - mutt_addresslist_copy(to, &env->from, false); + mutt_addrlist_copy(to, &env->from, false); break; default: @@ -773,10 +773,10 @@ static int default_to(struct AddressList *to, struct Envelope *env, SendFlags fl } } else - mutt_addresslist_copy(to, &env->reply_to, false); + mutt_addrlist_copy(to, &env->reply_to, false); } else - mutt_addresslist_copy(to, &env->from, false); + mutt_addrlist_copy(to, &env->from, false); return 0; } @@ -817,7 +817,7 @@ int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, SendFlags flags } else if (flags & SEND_TO_SENDER) { - mutt_addresslist_copy(&out->to, &in->from, false); + mutt_addrlist_copy(&out->to, &in->from, false); } else { @@ -830,10 +830,10 @@ int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, SendFlags flags { /* if(!mutt_addr_is_user(in->to)) */ if (flags & SEND_GROUP_REPLY) - mutt_addresslist_copy(&out->cc, &in->to, true); + mutt_addrlist_copy(&out->cc, &in->to, true); else - mutt_addresslist_copy(&out->to, &in->cc, true); - mutt_addresslist_copy(&out->cc, &in->cc, true); + mutt_addrlist_copy(&out->to, &in->cc, true); + mutt_addrlist_copy(&out->cc, &in->cc, true); } } return 0; @@ -883,9 +883,9 @@ void mutt_fix_reply_recipients(struct Envelope *env) } /* the CC field can get cluttered, especially with lists */ - mutt_addresslist_dedupe(&env->to); - mutt_addresslist_dedupe(&env->cc); - mutt_addresslist_remove_xrefs(&env->to, &env->cc); + mutt_addrlist_dedupe(&env->to); + mutt_addrlist_dedupe(&env->cc); + mutt_addrlist_remove_xrefs(&env->to, &env->cc); if (!TAILQ_EMPTY(&env->cc) && TAILQ_EMPTY(&env->to)) { @@ -1197,8 +1197,8 @@ void mutt_set_followup_to(struct Envelope *env) /* this message goes to known mailing lists, so create a proper * mail-followup-to header */ - mutt_addresslist_copy(&env->mail_followup_to, &env->to, false); - mutt_addresslist_copy(&env->mail_followup_to, &env->cc, true); + mutt_addrlist_copy(&env->mail_followup_to, &env->to, false); + mutt_addrlist_copy(&env->mail_followup_to, &env->cc, true); } /* remove ourselves from the mail-followup-to header */ @@ -1232,7 +1232,7 @@ void mutt_set_followup_to(struct Envelope *env) } } - mutt_addresslist_dedupe(&env->mail_followup_to); + mutt_addrlist_dedupe(&env->mail_followup_to); } } @@ -1932,7 +1932,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile, /* Use any list-post header as a template */ mutt_parse_mailto(msg->env, NULL, cur->env->list_post); /* We don't let them set the sender's address. */ - mutt_addresslist_free_all(&msg->env->from); + mutt_addrlist_free_all(&msg->env->from); } if (!(flags & (SEND_KEY | SEND_POSTPONED | SEND_RESEND))) @@ -1991,7 +1991,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile, { mutt_debug(5, "msg->env->from before set_reverse_name: %s\n", TAILQ_FIRST(&msg->env->from)->mailbox); - mutt_addresslist_free_all(&msg->env->from); + mutt_addrlist_free_all(&msg->env->from); } set_reverse_name(&msg->env->from, cur->env); } @@ -2007,7 +2007,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile, * the 'X-Orig-To header'. */ if (!TAILQ_EMPTY(&cur->env->x_original_to) && TAILQ_EMPTY(&msg->env->from)) { - mutt_addresslist_copy(&msg->env->from, &cur->env->x_original_to, false); + mutt_addrlist_copy(&msg->env->from, &cur->env->x_original_to, false); mutt_debug(5, "msg->env->from extracted from X-Original-To: header: %s\n", TAILQ_FIRST(&msg->env->from)->mailbox); } @@ -2091,7 +2091,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile, /* $use_from and/or $from might have changed in a send-hook */ if (killfrom) { - mutt_addresslist_free_all(&msg->env->from); + mutt_addrlist_free_all(&msg->env->from); if (C_UseFrom && !(flags & (SEND_POSTPONED | SEND_RESEND))) TAILQ_INSERT_TAIL(&msg->env->from, mutt_default_from(), entries); } @@ -2337,7 +2337,7 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile, mutt_select_fcc(fcc, sizeof(fcc), msg); if (killfrom) { - mutt_addresslist_free_all(&msg->env->from); + mutt_addrlist_free_all(&msg->env->from); } } @@ -2374,9 +2374,9 @@ int ci_send_message(SendFlags flags, struct Email *msg, const char *tempfile, #ifdef USE_NNTP if (!(flags & SEND_NEWS)) #endif - if ((mutt_addresslist_has_recips(&msg->env->to) == 0) && - (mutt_addresslist_has_recips(&msg->env->cc) == 0) && - (mutt_addresslist_has_recips(&msg->env->bcc) == 0)) + if ((mutt_addrlist_has_recips(&msg->env->to) == 0) && + (mutt_addrlist_has_recips(&msg->env->cc) == 0) && + (mutt_addrlist_has_recips(&msg->env->bcc) == 0)) { if (!(flags & SEND_BATCH)) { diff --git a/sendlib.c b/sendlib.c index c7308facd..da7c16e07 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1744,8 +1744,8 @@ struct Body *mutt_remove_multipart(struct Body *b) } /** - * mutt_write_addresslist - wrapper around mutt_write_address() - * @param addr Address list + * mutt_write_addrlist - wrapper around mutt_write_address() + * @param al Address list * @param fp File to write to * @param linelen Line length to use * @param display True if these addresses will be displayed to the user @@ -1753,7 +1753,7 @@ struct Body *mutt_remove_multipart(struct Body *b) * So we can handle very large recipient lists without needing a huge temporary * buffer in memory */ -void mutt_write_addresslist(struct AddressList *al, FILE *fp, int linelen, bool display) +void mutt_write_addrlist(struct AddressList *al, FILE *fp, int linelen, bool display) { char buf[1024]; int count = 0; @@ -2243,21 +2243,21 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, if (!TAILQ_EMPTY(&env->from) && !privacy) { buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), &env->from, false); + mutt_addrlist_write(buf, sizeof(buf), &env->from, false); fprintf(fp, "From: %s\n", buf); } if (!TAILQ_EMPTY(&env->sender) && !privacy) { buf[0] = '\0'; - mutt_addresslist_write(buf, sizeof(buf), &env->sender, false); + mutt_addrlist_write(buf, sizeof(buf), &env->sender, false); fprintf(fp, "Sender: %s\n", buf); } if (!TAILQ_EMPTY(&env->to)) { fputs("To: ", fp); - mutt_write_addresslist(&env->to, fp, 4, 0); + mutt_write_addrlist(&env->to, fp, 4, 0); } else if (mode == MUTT_WRITE_HEADER_EDITHDRS) #ifdef USE_NNTP @@ -2268,7 +2268,7 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, if (!TAILQ_EMPTY(&env->cc)) { fputs("Cc: ", fp); - mutt_write_addresslist(&env->cc, fp, 4, 0); + mutt_write_addrlist(&env->cc, fp, 4, 0); } else if (mode == MUTT_WRITE_HEADER_EDITHDRS) #ifdef USE_NNTP @@ -2282,7 +2282,7 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, ((mode == MUTT_WRITE_HEADER_NORMAL) && C_WriteBcc)) { fputs("Bcc: ", fp); - mutt_write_addresslist(&env->bcc, fp, 5, 0); + mutt_write_addrlist(&env->bcc, fp, 5, 0); } } else if (mode == MUTT_WRITE_HEADER_EDITHDRS) @@ -2326,7 +2326,7 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, if (!TAILQ_EMPTY(&env->reply_to)) { fputs("Reply-To: ", fp); - mutt_write_addresslist(&env->reply_to, fp, 10, 0); + mutt_write_addrlist(&env->reply_to, fp, 10, 0); } else if (mode == MUTT_WRITE_HEADER_EDITHDRS) fputs("Reply-To:\n", fp); @@ -2337,7 +2337,7 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, #endif { fputs("Mail-Followup-To: ", fp); - mutt_write_addresslist(&env->mail_followup_to, fp, 18, 0); + mutt_write_addrlist(&env->mail_followup_to, fp, 18, 0); } if ((mode == MUTT_WRITE_HEADER_NORMAL) || (mode == MUTT_WRITE_HEADER_POSTPONE)) @@ -2961,7 +2961,7 @@ void mutt_unprepare_envelope(struct Envelope *env) rfc2047_decode(&item->data); } - mutt_addresslist_free_all(&env->mail_followup_to); + mutt_addrlist_free_all(&env->mail_followup_to); /* back conversions */ rfc2047_decode_envelope(env); @@ -3003,7 +3003,7 @@ static int bounce_message(FILE *fp, struct Email *e, struct AddressList *to, fprintf(fp_tmp, "Resent-Message-ID: %s\n", msgid_str); FREE(&msgid_str); fputs("Resent-To: ", fp_tmp); - mutt_write_addresslist(to, fp_tmp, 11, 0); + mutt_write_addrlist(to, fp_tmp, 11, 0); mutt_copy_header(fp, e, fp_tmp, chflags, NULL); fputc('\n', fp_tmp); mutt_file_copy_bytes(fp, fp_tmp, e->content->length); @@ -3055,17 +3055,17 @@ int mutt_bounce_message(FILE *fp, struct Email *e, struct AddressList *to) if (!from->personal) from->personal = mutt_str_strdup(C_Realname); - mutt_addresslist_qualify(&from_list, fqdn); + mutt_addrlist_qualify(&from_list, fqdn); rfc2047_encode_addrlist(&from_list, "Resent-From"); - if (mutt_addresslist_to_intl(&from_list, &err)) + if (mutt_addrlist_to_intl(&from_list, &err)) { mutt_error(_("Bad IDN %s while preparing resent-from"), err); FREE(&err); - mutt_addresslist_free_all(&from_list); + mutt_addrlist_free_all(&from_list); return -1; } - mutt_addresslist_write(resent_from, sizeof(resent_from), &from_list, false); + mutt_addrlist_write(resent_from, sizeof(resent_from), &from_list, false); #ifdef USE_NNTP OptNewsSend = false; @@ -3075,11 +3075,11 @@ int mutt_bounce_message(FILE *fp, struct Email *e, struct AddressList *to) * function is called, since the user receives confirmation of the address * list being bounced to. */ struct AddressList resent_to = TAILQ_HEAD_INITIALIZER(resent_to); - mutt_addresslist_copy(&resent_to, to, false); + mutt_addrlist_copy(&resent_to, to, false); rfc2047_encode_addrlist(&resent_to, "Resent-To"); int rc = bounce_message(fp, e, &resent_to, resent_from, &from_list); - mutt_addresslist_free_all(&resent_to); - mutt_addresslist_free_all(&from_list); + mutt_addrlist_free_all(&resent_to); + mutt_addrlist_free_all(&from_list); return rc; } diff --git a/sendlib.h b/sendlib.h index 4f07e60f6..5b7b547fd 100644 --- a/sendlib.h +++ b/sendlib.h @@ -83,7 +83,7 @@ int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct void mutt_stamp_attachment(struct Body *a); void mutt_unprepare_envelope(struct Envelope *env); void mutt_update_encoding(struct Body *a); -void mutt_write_addresslist(struct AddressList *addr, FILE *fp, int linelen, bool display); +void mutt_write_addrlist(struct AddressList *addr, FILE *fp, int linelen, bool display); int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath); int mutt_write_mime_body(struct Body *a, FILE *fp); int mutt_write_mime_header(struct Body *a, FILE *fp); diff --git a/test/Makefile.autosetup b/test/Makefile.autosetup index a5cd79503..fc05a58fb 100644 --- a/test/Makefile.autosetup +++ b/test/Makefile.autosetup @@ -5,15 +5,15 @@ ADDRESS_OBJS = test/address/mutt_addr_cat.o \ test/address/mutt_addr_for_display.o \ test/address/mutt_addr_free.o \ test/address/mutt_addr_has_recips.o \ - test/address/mutt_addresslist_dedupe.o \ - test/address/mutt_addresslist_equal.o \ - test/address/mutt_addresslist_parse2.o \ - test/address/mutt_addresslist_parse.o \ - test/address/mutt_addresslist_qualify.o \ - test/address/mutt_addresslist_remove.o \ - test/address/mutt_addresslist_remove_xrefs.o \ - test/address/mutt_addresslist_to_intl.o \ - test/address/mutt_addresslist_to_local.o \ + test/address/mutt_addrlist_dedupe.o \ + test/address/mutt_addrlist_equal.o \ + test/address/mutt_addrlist_parse2.o \ + test/address/mutt_addrlist_parse.o \ + test/address/mutt_addrlist_qualify.o \ + test/address/mutt_addrlist_remove.o \ + test/address/mutt_addrlist_remove_xrefs.o \ + test/address/mutt_addrlist_to_intl.o \ + test/address/mutt_addrlist_to_local.o \ test/address/mutt_addr_new.o \ test/address/mutt_addr_search.o \ test/address/mutt_addr_valid_msgid.o \ diff --git a/test/address/mutt_addr_copy_list.c b/test/address/mutt_addr_copy_list.c index 614f1702c..907d41b74 100644 --- a/test/address/mutt_addr_copy_list.c +++ b/test/address/mutt_addr_copy_list.c @@ -28,10 +28,10 @@ void test_mutt_addr_copy_list(void) { - // void mutt_addresslist_copy(struct AddressList *dst, const struct AddressList *src, bool prune); + // void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune); { - mutt_addresslist_copy(NULL, NULL, false); + mutt_addrlist_copy(NULL, NULL, false); TEST_CHECK(true); // no crash } } diff --git a/test/address/mutt_addr_has_recips.c b/test/address/mutt_addr_has_recips.c index 17b413552..92c1b5ec5 100644 --- a/test/address/mutt_addr_has_recips.c +++ b/test/address/mutt_addr_has_recips.c @@ -28,9 +28,9 @@ void test_mutt_addr_has_recips(void) { - // int mutt_addresslist_has_recips(const struct AddressList *a); + // int mutt_addrlist_has_recips(const struct AddressList *a); { - TEST_CHECK(mutt_addresslist_has_recips(NULL) == 0); + TEST_CHECK(mutt_addrlist_has_recips(NULL) == 0); } } diff --git a/test/address/mutt_addr_search.c b/test/address/mutt_addr_search.c index 685f3ec6a..7d69dad3a 100644 --- a/test/address/mutt_addr_search.c +++ b/test/address/mutt_addr_search.c @@ -28,15 +28,15 @@ void test_mutt_addr_search(void) { - // bool mutt_addresslist_search(const struct Address *needle, const struct AddressList *haystack); + // bool mutt_addrlist_search(const struct Address *needle, const struct AddressList *haystack); { struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - TEST_CHECK(!mutt_addresslist_search(NULL, &al)); + TEST_CHECK(!mutt_addrlist_search(NULL, &al)); } { struct Address a = { 0 }; - TEST_CHECK(!mutt_addresslist_search(&a, NULL)); + TEST_CHECK(!mutt_addrlist_search(&a, NULL)); } } diff --git a/test/address/mutt_addresslist_dedupe.c b/test/address/mutt_addrlist_dedupe.c similarity index 83% rename from test/address/mutt_addresslist_dedupe.c rename to test/address/mutt_addrlist_dedupe.c index 4c9a8cdaf..4c945634d 100644 --- a/test/address/mutt_addresslist_dedupe.c +++ b/test/address/mutt_addrlist_dedupe.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_dedupe() + * Test code for mutt_addrlist_dedupe() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,12 +26,12 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_dedupe(void) +void test_mutt_addrlist_dedupe(void) { - // void mutt_addresslist_dedupe(struct AddressList *al); + // void mutt_addrlist_dedupe(struct AddressList *al); { - mutt_addresslist_dedupe(NULL); + mutt_addrlist_dedupe(NULL); TEST_CHECK(true); // no crash } } diff --git a/test/address/mutt_addresslist_equal.c b/test/address/mutt_addrlist_equal.c similarity index 78% rename from test/address/mutt_addresslist_equal.c rename to test/address/mutt_addrlist_equal.c index d2d6d3469..0ab0d1427 100644 --- a/test/address/mutt_addresslist_equal.c +++ b/test/address/mutt_addrlist_equal.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_equal() + * Test code for mutt_addrlist_equal() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,17 +26,17 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_equal(void) +void test_mutt_addrlist_equal(void) { - // bool mutt_addresslist_equal(const struct AddressList *a, const struct AddressList *b); + // bool mutt_addrlist_equal(const struct AddressList *a, const struct AddressList *b); { struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - TEST_CHECK(!mutt_addresslist_equal(NULL, &al)); + TEST_CHECK(!mutt_addrlist_equal(NULL, &al)); } { struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - TEST_CHECK(!mutt_addresslist_equal(&al, NULL)); + TEST_CHECK(!mutt_addrlist_equal(&al, NULL)); } } diff --git a/test/address/mutt_addresslist_parse.c b/test/address/mutt_addrlist_parse.c similarity index 79% rename from test/address/mutt_addresslist_parse.c rename to test/address/mutt_addrlist_parse.c index 0e20786d1..609b8f57c 100644 --- a/test/address/mutt_addresslist_parse.c +++ b/test/address/mutt_addrlist_parse.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_parse() + * Test code for mutt_addrlist_parse() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,20 +26,20 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_parse(void) +void test_mutt_addrlist_parse(void) { - // void mutt_addresslist_parse(struct AddressList *top, const char *s); + // void mutt_addrlist_parse(struct AddressList *top, const char *s); { struct AddressList alist = TAILQ_HEAD_INITIALIZER(alist); - mutt_addresslist_parse(&alist, "apple"); + mutt_addrlist_parse(&alist, "apple"); TEST_CHECK(TAILQ_FIRST(&alist) != NULL); - mutt_addresslist_free_all(&alist); + mutt_addrlist_free_all(&alist); } { struct AddressList alist = TAILQ_HEAD_INITIALIZER(alist); - mutt_addresslist_parse(&alist, NULL); + mutt_addrlist_parse(&alist, NULL); TEST_CHECK(TAILQ_FIRST(&alist) == NULL); } } diff --git a/test/address/mutt_addresslist_parse2.c b/test/address/mutt_addrlist_parse2.c similarity index 79% rename from test/address/mutt_addresslist_parse2.c rename to test/address/mutt_addrlist_parse2.c index f5b995b0c..2a2b1d4e4 100644 --- a/test/address/mutt_addresslist_parse2.c +++ b/test/address/mutt_addrlist_parse2.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_parse2() + * Test code for mutt_addrlist_parse2() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,21 +26,21 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_parse2(void) +void test_mutt_addrlist_parse2(void) { - // struct Address *mutt_addresslist_parse2(struct Address *p, const char *s); + // struct Address *mutt_addrlist_parse2(struct Address *p, const char *s); { struct AddressList alist = TAILQ_HEAD_INITIALIZER(alist); - mutt_addresslist_parse(&alist, "apple"); + mutt_addrlist_parse(&alist, "apple"); TEST_CHECK(TAILQ_FIRST(&alist) != NULL); - mutt_addresslist_free_all(&alist); + mutt_addrlist_free_all(&alist); } { struct AddressList alist = TAILQ_HEAD_INITIALIZER(alist); - mutt_addresslist_parse(&alist, NULL); + mutt_addrlist_parse(&alist, NULL); TEST_CHECK(TAILQ_FIRST(&alist) == NULL); } - + mutt_buffer_pool_free(); } diff --git a/test/address/mutt_addresslist_qualify.c b/test/address/mutt_addrlist_qualify.c similarity index 70% rename from test/address/mutt_addresslist_qualify.c rename to test/address/mutt_addrlist_qualify.c index 7960a9809..9cd9b8615 100644 --- a/test/address/mutt_addresslist_qualify.c +++ b/test/address/mutt_addrlist_qualify.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_qualify() + * Test code for mutt_addrlist_qualify() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,18 +26,18 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_qualify(void) +void test_mutt_addrlist_qualify(void) { - // void mutt_addresslist_qualify(struct Address *addr, const char *host); + // void mutt_addrlist_qualify(struct Address *addr, const char *host); { - mutt_addresslist_qualify(NULL, "example.com"); - TEST_CHECK_(1, "mutt_addresslist_qualify(NULL, \"example.com\")"); + mutt_addrlist_qualify(NULL, "example.com"); + TEST_CHECK_(1, "mutt_addrlist_qualify(NULL, \"example.com\")"); } { struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - mutt_addresslist_qualify(&al, NULL); - TEST_CHECK_(1, "mutt_addresslist_qualify(&addr, NULL)"); + mutt_addrlist_qualify(&al, NULL); + TEST_CHECK_(1, "mutt_addrlist_qualify(&addr, NULL)"); } } diff --git a/test/address/mutt_addresslist_remove.c b/test/address/mutt_addrlist_remove.c similarity index 78% rename from test/address/mutt_addresslist_remove.c rename to test/address/mutt_addrlist_remove.c index 8b3436684..d6fbe5ca8 100644 --- a/test/address/mutt_addresslist_remove.c +++ b/test/address/mutt_addrlist_remove.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_remove() + * Test code for mutt_addrlist_remove() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,18 +26,18 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_remove(void) +void test_mutt_addrlist_remove(void) { - // int mutt_addresslist_remove(struct AddressList *al, const char *mailbox); + // int mutt_addrlist_remove(struct AddressList *al, const char *mailbox); { - int rc = mutt_addresslist_remove(NULL, "apple"); + int rc = mutt_addrlist_remove(NULL, "apple"); TEST_CHECK(rc == -1); } { struct AddressList a; - int rc = mutt_addresslist_remove(&a, NULL); + int rc = mutt_addrlist_remove(&a, NULL); TEST_CHECK(rc == 0); } } diff --git a/test/address/mutt_addresslist_remove_xrefs.c b/test/address/mutt_addrlist_remove_xrefs.c similarity index 90% rename from test/address/mutt_addresslist_remove_xrefs.c rename to test/address/mutt_addrlist_remove_xrefs.c index 031190c8a..58cac88e4 100644 --- a/test/address/mutt_addresslist_remove_xrefs.c +++ b/test/address/mutt_addrlist_remove_xrefs.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_remove_xrefs() + * Test code for mutt_addrlist_remove_xrefs() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,7 +26,7 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_remove_xrefs(void) +void test_mutt_addrlist_remove_xrefs(void) { // TODO - check when either argument is NULL } diff --git a/test/address/mutt_addresslist_to_intl.c b/test/address/mutt_addrlist_to_intl.c similarity index 77% rename from test/address/mutt_addresslist_to_intl.c rename to test/address/mutt_addrlist_to_intl.c index 1232800c1..82cab35a1 100644 --- a/test/address/mutt_addresslist_to_intl.c +++ b/test/address/mutt_addrlist_to_intl.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_to_intl() + * Test code for mutt_addrlist_to_intl() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,17 +26,17 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_to_intl(void) +void test_mutt_addrlist_to_intl(void) { - // int mutt_addresslist_to_intl(struct AddressList *a, char **err); + // int mutt_addrlist_to_intl(struct AddressList *a, char **err); { char *err = NULL; - TEST_CHECK(mutt_addresslist_to_intl(NULL, &err) == 0); + TEST_CHECK(mutt_addrlist_to_intl(NULL, &err) == 0); } { struct AddressList al = TAILQ_HEAD_INITIALIZER(al); - TEST_CHECK(mutt_addresslist_to_intl(&al, NULL) == 0); + TEST_CHECK(mutt_addrlist_to_intl(&al, NULL) == 0); } } diff --git a/test/address/mutt_addresslist_to_local.c b/test/address/mutt_addrlist_to_local.c similarity index 81% rename from test/address/mutt_addresslist_to_local.c rename to test/address/mutt_addrlist_to_local.c index 7a8a5d733..e884e4ce9 100644 --- a/test/address/mutt_addresslist_to_local.c +++ b/test/address/mutt_addrlist_to_local.c @@ -1,6 +1,6 @@ /** * @file - * Test code for mutt_addresslist_to_local() + * Test code for mutt_addrlist_to_local() * * @authors * Copyright (C) 2019 Richard Russon @@ -26,11 +26,11 @@ #include "mutt/mutt.h" #include "address/lib.h" -void test_mutt_addresslist_to_local(void) +void test_mutt_addrlist_to_local(void) { - // int mutt_addresslist_to_local(struct AddressList *a); + // int mutt_addrlist_to_local(struct AddressList *a); { - TEST_CHECK(mutt_addresslist_to_local(NULL) == 0); + TEST_CHECK(mutt_addrlist_to_local(NULL) == 0); } } diff --git a/test/group/mutt_grouplist_add_addrlist.c b/test/group/mutt_grouplist_add_addrlist.c index e8ee937a6..d7d59ebf8 100644 --- a/test/group/mutt_grouplist_add_addrlist.c +++ b/test/group/mutt_grouplist_add_addrlist.c @@ -32,13 +32,13 @@ void test_mutt_grouplist_add_addrlist(void) { struct AddressList addr = TAILQ_HEAD_INITIALIZER(addr); - mutt_grouplist_add_addresslist(NULL, &addr); + mutt_grouplist_add_addrlist(NULL, &addr); TEST_CHECK_(1, "mutt_grouplist_add_addrlist(NULL, &addr)"); } { struct GroupList head = { 0 }; - mutt_grouplist_add_addresslist(&head, NULL); + mutt_grouplist_add_addrlist(&head, NULL); TEST_CHECK_(1, "mutt_grouplist_add_addrlist(&head, NULL)"); } } diff --git a/test/group/mutt_grouplist_remove_addrlist.c b/test/group/mutt_grouplist_remove_addrlist.c index 5e512e760..c0d1cc105 100644 --- a/test/group/mutt_grouplist_remove_addrlist.c +++ b/test/group/mutt_grouplist_remove_addrlist.c @@ -32,11 +32,11 @@ void test_mutt_grouplist_remove_addrlist(void) { struct AddressList addr = TAILQ_HEAD_INITIALIZER(addr); - TEST_CHECK(mutt_grouplist_remove_addresslist(NULL, &addr) == -1); + TEST_CHECK(mutt_grouplist_remove_addrlist(NULL, &addr) == -1); } { struct GroupList head = { 0 }; - TEST_CHECK(mutt_grouplist_remove_addresslist(&head, NULL) == -1); + TEST_CHECK(mutt_grouplist_remove_addrlist(&head, NULL) == -1); } } diff --git a/test/main.c b/test/main.c index 04d671791..80cb25945 100644 --- a/test/main.c +++ b/test/main.c @@ -38,14 +38,14 @@ NEOMUTT_TEST_ITEM(test_mutt_addr_valid_msgid) \ NEOMUTT_TEST_ITEM(test_mutt_addr_write) \ NEOMUTT_TEST_ITEM(test_mutt_addr_write_single) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_equal) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_parse) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_parse2) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_qualify) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_remove) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_remove_xrefs) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_to_intl) \ - NEOMUTT_TEST_ITEM(test_mutt_addresslist_to_local) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_equal) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_parse) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_parse2) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_qualify) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_remove) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_remove_xrefs) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_to_intl) \ + NEOMUTT_TEST_ITEM(test_mutt_addrlist_to_local) \ NEOMUTT_TEST_ITEM(test_mutt_actx_add_attach) \ NEOMUTT_TEST_ITEM(test_mutt_actx_add_body) \ NEOMUTT_TEST_ITEM(test_mutt_actx_add_fp) \