]> granicus.if.org Git - neomutt/commitdiff
rename rfc822 constants
authorRichard Russon <rich@flatcap.org>
Tue, 28 Nov 2017 23:25:50 +0000 (23:25 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 29 Nov 2017 00:29:10 +0000 (00:29 +0000)
address.c
address.h
mutt_address.c
rfc2047.c
sendlib.c

index aca851a4fffebaa8234fc1c14d53be344aa710b6..4b58b0b4827d7aeaebb654edcdc897b25880a5bb 100644 (file)
--- a/address.c
+++ b/address.c
  *
  * 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
  * | :--------------------------- | :---------------------------------------------------------
 #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)
index c5f42642ef4878b668abe0c905c10329dfcd400d..e0f8a8f1d59fd667ebbd09a8b146a5133812e366 100644 (file)
--- 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);
index 7861ce34bb9cbd76bfa6350d9fde91d126456109..2bef2095b8b225d8456f0433905a22764f33c179 100644 (file)
@@ -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;
index 40cbd50579d7c63971319dfffbe143cd793a257f..afc9f9a7450302c8a2fb8690607225df34aca7ec 100644 (file)
--- 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;
index 6dd10adbe309c1af9d3a83cdf144b4e69c17dd51..c36cef97611126d7c613e861260831f2c220b2f0 100644 (file)
--- 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);
     }