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;
{
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);
}
/**
- * 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;
{
if (mutt_str_strcasecmp(mailbox, a->mailbox) == 0)
{
- mutt_addresslist_free_one(al, a);
+ mutt_addrlist_free_one(al, a);
rc = 0;
}
}
}
/**
- * 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;
s = next_token(s, comment, &commentlen, sizeof(comment) - 1);
if (!s)
{
- mutt_addresslist_free_all(al);
+ mutt_addrlist_free_all(al);
return 0;
}
break;
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;
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;
}
s = next_token(s, phrase, &phraselen, sizeof(phrase) - 1);
if (!s)
{
- mutt_addresslist_free_all(al);
+ mutt_addrlist_free_all(al);
return 0;
}
break;
}
/**
- * 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;
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;
}
/**
- * 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;
}
/**
- * 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)
{
}
/**
- * 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;
}
/**
- * 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;
}
/**
- * 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
*
* @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;
}
/**
- * 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;
}
/**
- * 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;
}
/**
- * 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;
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);
}
}
}
}
/**
- * 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;
{
if (mutt_addr_cmp(aa, ab))
{
- mutt_addresslist_free_one(b, ab);
+ mutt_addrlist_free_one(b, ab);
break;
}
}
}
/**
- * 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);
}
/**
- * 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;
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 */
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);
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)
{
}
/**
- * 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;
}
/**
- * 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;
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);
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);
{
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)
if (C_UseDomain && (fqdn = mutt_fqdn(true)))
{
/* now qualify all local addresses */
- mutt_addresslist_qualify(al, fqdn);
+ mutt_addrlist_qualify(al, fqdn);
}
}
STAILQ_INIT(&expn);
expand_aliases_r(al, &expn);
mutt_list_free(&expn);
- mutt_addresslist_dedupe(al);
+ mutt_addrlist_dedupe(al);
}
/**
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
{
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);
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)
{
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);
/* 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)
/* 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)
mutt_alias_delete_reverse(*p);
FREE(&(*p)->name);
- mutt_addresslist_free_all(&((*p)->addr));
+ mutt_addrlist_free_all(&((*p)->addr));
FREE(p);
}
if (rc || !buf[0])
return;
- mutt_addresslist_parse2(&al, buf);
+ mutt_addrlist_parse2(&al, buf);
if (TAILQ_EMPTY(&al))
{
mutt_error(_("Error parsing address"));
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),
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;
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));
* 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);
}
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]));
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();
/* 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);
}
{
// 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;
* @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.
}
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)
format_address_header(h, &al);
}
- mutt_addresslist_free_all(&al);
+ mutt_addrlist_free_all(&al);
FREE(&s);
return 1;
{
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');
}
{
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');
}
{
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');
}
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');
{
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');
}
{
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');
}
}
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':
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':
{
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);
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;
}
* 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
* 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; \
* @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)
{
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;
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;
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
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
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;
}
}
}
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)
}
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)
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;
#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;
}
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;
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;
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);
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);
{
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();
}
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)
{
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;
}
}
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);
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
{
}
}
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) &&
}
}
- 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);
}
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++;
}
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;
}
{
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);
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;
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;
*keylist = crypt_pgp_find_keys(&addrlist, oppenc_mode);
if (!*keylist)
{
- mutt_addresslist_free_all(&addrlist);
+ mutt_addrlist_free_all(&addrlist);
return -1;
}
OptPgpCheckTrust = false;
*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))
sprintf(*keylist + keylist_size, " %s", self_encrypt);
}
- mutt_addresslist_free_all(&addrlist);
+ mutt_addrlist_free_all(&addrlist);
return 0;
}
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)
{
}
}
}
- mutt_addresslist_free_all(&alist);
+ mutt_addrlist_free_all(&alist);
if (match)
{
}
/* 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)
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;
}
if (!k_info)
{
FREE(&keylist);
- mutt_addresslist_free_all(&hookal);
+ mutt_addrlist_free_all(&hookal);
mutt_list_free(&crypt_hook_list);
return NULL;
}
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);
}
/* 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)
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;
}
if (!k_info)
{
FREE(&keylist);
- mutt_addresslist_free_all(&hookal);
+ mutt_addrlist_free_all(&hookal);
mutt_list_free(&crypt_hook_list);
return NULL;
}
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);
*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);
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)
{
}
}
- mutt_addresslist_free_all(&al);
+ mutt_addrlist_free_all(&al);
}
if (match)
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);
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;
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);
cur = cur->next;
}
- mutt_addresslist_parse(&cur->addr, p);
+ mutt_addrlist_parse(&cur->addr, p);
p = strtok(NULL, "\t\n");
if (p)
{
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':
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;
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
{
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);
}
}
}
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);
}
}
}
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);
}
}
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;
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"));
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);
}
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. */
mutt_error(ngettext("Error bouncing message", "Error bouncing messages", p));
end:
- mutt_addresslist_free_all(&al);
+ mutt_addrlist_free_all(&al);
}
/**
}
/* 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;
{
if (mutt_addr_is_user(a) && (!leave_only || TAILQ_NEXT(a, entries)))
{
- mutt_addresslist_free_one(al, a);
+ mutt_addrlist_free_one(al, a);
}
}
}
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);
{
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);
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)))
{
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;
}
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)
{
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
* 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))
{
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:
}
}
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;
}
}
else if (flags & SEND_TO_SENDER)
{
- mutt_addresslist_copy(&out->to, &in->from, false);
+ mutt_addrlist_copy(&out->to, &in->from, false);
}
else
{
{
/* 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;
}
/* 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))
{
/* 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 */
}
}
- mutt_addresslist_dedupe(&env->mail_followup_to);
+ mutt_addrlist_dedupe(&env->mail_followup_to);
}
}
/* 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)))
{
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);
}
* 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);
}
/* $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);
}
mutt_select_fcc(fcc, sizeof(fcc), msg);
if (killfrom)
{
- mutt_addresslist_free_all(&msg->env->from);
+ mutt_addrlist_free_all(&msg->env->from);
}
}
#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))
{
}
/**
- * 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
* 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;
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
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
((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)
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);
#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))
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);
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);
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;
* 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;
}
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);
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 \
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
}
}
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);
}
}
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));
}
}
/**
* @file
- * Test code for mutt_addresslist_dedupe()
+ * Test code for mutt_addrlist_dedupe()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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
}
}
/**
* @file
- * Test code for mutt_addresslist_equal()
+ * Test code for mutt_addrlist_equal()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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));
}
}
/**
* @file
- * Test code for mutt_addresslist_parse()
+ * Test code for mutt_addrlist_parse()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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);
}
}
/**
* @file
- * Test code for mutt_addresslist_parse2()
+ * Test code for mutt_addrlist_parse2()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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();
}
/**
* @file
- * Test code for mutt_addresslist_qualify()
+ * Test code for mutt_addrlist_qualify()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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)");
}
}
/**
* @file
- * Test code for mutt_addresslist_remove()
+ * Test code for mutt_addrlist_remove()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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);
}
}
/**
* @file
- * Test code for mutt_addresslist_remove_xrefs()
+ * Test code for mutt_addrlist_remove_xrefs()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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
}
/**
* @file
- * Test code for mutt_addresslist_to_intl()
+ * Test code for mutt_addrlist_to_intl()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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);
}
}
/**
* @file
- * Test code for mutt_addresslist_to_local()
+ * Test code for mutt_addrlist_to_local()
*
* @authors
* Copyright (C) 2019 Richard Russon <rich@flatcap.org>
#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);
}
}
{
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)");
}
}
{
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);
}
}
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) \