From: Richard Russon Date: Tue, 28 Nov 2017 23:25:50 +0000 (+0000) Subject: rename rfc822 constants X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d2c46ecfc94acc6a3b671a143720ccb0c1d1858;p=neomutt rename rfc822 constants --- diff --git a/address.c b/address.c index aca851a4f..4b58b0b48 100644 --- a/address.c +++ b/address.c @@ -26,11 +26,11 @@ * * Representation of an email address * - * | Data | Description - * | :----------------- | :-------------------------------------------------- - * | #RFC822Error | An out-of-band error code - * | #RFC822Errors | Messages for the error codes in #AddressError - * | #RFC822Specials | Characters with special meaning for email addresses + * | Data | Description + * | :--------------- | :-------------------------------------------------- + * | #AddressError | An out-of-band error code + * | #AddressErrors | Messages for the error codes in #AddressError + * | #AddressSpecials | Characters with special meaning for email addresses * * | Function | Description * | :--------------------------- | :--------------------------------------------------------- @@ -59,30 +59,30 @@ #include "mutt_idna.h" /** - * RFC822Specials - Characters with special meaning for email addresses + * AddressSpecials - Characters with special meaning for email addresses */ -const char RFC822Specials[] = "@.,:;<>[]\\\"()"; +const char AddressSpecials[] = "@.,:;<>[]\\\"()"; /** * is_special - Is this character special to an email address? */ -#define is_special(x) strchr(RFC822Specials, x) +#define is_special(x) strchr(AddressSpecials, x) /** - * RFC822Error - An out-of-band error code + * AddressError - An out-of-band error code * * Many of the Address functions set this variable on error. * Its values are defined in #AddressError. - * Text for the errors can be looked up using #RFC822Errors. + * Text for the errors can be looked up using #AddressErrors. */ -int RFC822Error = 0; +int AddressError = 0; /** - * RFC822Errors - Messages for the error codes in #AddressError + * AddressErrors - Messages for the error codes in #AddressError * * These must defined in the same order as enum AddressError. */ -const char *const RFC822Errors[] = { +const char *const AddressErrors[] = { "out of memory", "mismatched parenthesis", "mismatched quotes", "bad route in <>", "bad address in <>", "bad address spec", }; @@ -202,7 +202,7 @@ static const char *parse_comment(const char *s, char *comment, size_t *commentle } if (level) { - RFC822Error = ERR_MISMATCH_PAREN; + AddressError = ERR_MISMATCH_PAREN; return NULL; } return s; @@ -236,7 +236,7 @@ static const char *parse_quote(const char *s, char *token, size_t *tokenlen, siz (*tokenlen)++; s++; } - RFC822Error = ERR_MISMATCH_QUOTE; + AddressError = ERR_MISMATCH_QUOTE; return NULL; } @@ -400,7 +400,7 @@ static const char *parse_route_addr(const char *s, char *comment, size_t *commen } if (!s || *s != ':') { - RFC822Error = ERR_BAD_ROUTE; + AddressError = ERR_BAD_ROUTE; return NULL; /* invalid route */ } @@ -415,7 +415,7 @@ static const char *parse_route_addr(const char *s, char *comment, size_t *commen if (*s != '>') { - RFC822Error = ERR_BAD_ROUTE_ADDR; + AddressError = ERR_BAD_ROUTE_ADDR; return NULL; } @@ -445,7 +445,7 @@ static const char *parse_addr_spec(const char *s, char *comment, size_t *comment commentmax, addr); if (s && *s && *s != ',' && *s != ';') { - RFC822Error = ERR_BAD_ADDR_SPEC; + AddressError = ERR_BAD_ADDR_SPEC; return NULL; } return s; @@ -493,7 +493,7 @@ struct Address *mutt_addr_parse_list(struct Address *top, const char *s) size_t phraselen = 0, commentlen = 0; struct Address *cur = NULL, *last = NULL; - RFC822Error = 0; + AddressError = 0; last = top; while (last && last->next) diff --git a/address.h b/address.h index c5f42642e..e0f8a8f1d 100644 --- a/address.h +++ b/address.h @@ -39,7 +39,7 @@ struct Address }; /** - * enum AddressError - possible values for RFC822Error + * enum AddressError - possible values for AddressError */ enum AddressError { @@ -51,11 +51,11 @@ enum AddressError ERR_BAD_ADDR_SPEC }; -extern int RFC822Error; -extern const char *const RFC822Errors[]; -extern const char RFC822Specials[]; +extern int AddressError; +extern const char *const AddressErrors[]; +extern const char AddressSpecials[]; -#define rfc822_error(x) RFC822Errors[x] +#define address_error(x) AddressErrors[x] struct Address *mutt_addr_append(struct Address **a, struct Address *b, int prune); void mutt_addr_cat(char *buf, size_t buflen, const char *value, const char *specials); diff --git a/mutt_address.c b/mutt_address.c index 7861ce34b..2bef2095b 100644 --- a/mutt_address.c +++ b/mutt_address.c @@ -41,7 +41,7 @@ void rfc822_write_address_single(char *buf, size_t buflen, struct Address *addr, if (addr->personal) { - if (strpbrk(addr->personal, RFC822Specials)) + if (strpbrk(addr->personal, AddressSpecials)) { if (!buflen) goto done; diff --git a/rfc2047.c b/rfc2047.c index 40cbd5057..afc9f9a74 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -627,7 +627,7 @@ void rfc2047_encode_string(char **pd, int encode_specials, int col) charsets = "utf-8"; rfc2047_encode(*pd, strlen(*pd), col, Charset, charsets, &e, &elen, - encode_specials ? RFC822Specials : NULL); + encode_specials ? AddressSpecials : NULL); FREE(pd); *pd = e; diff --git a/sendlib.c b/sendlib.c index 6dd10adbe..c36cef976 100644 --- a/sendlib.c +++ b/sendlib.c @@ -2665,7 +2665,7 @@ void mutt_prepare_envelope(struct Envelope *env, int final) env->to->next = mutt_addr_new(); buffer[0] = 0; - mutt_addr_cat(buffer, sizeof(buffer), "undisclosed-recipients", RFC822Specials); + mutt_addr_cat(buffer, sizeof(buffer), "undisclosed-recipients", AddressSpecials); env->to->mailbox = mutt_str_strdup(buffer); }