]> granicus.if.org Git - neomutt/commitdiff
rename ParameterList variables
authorRichard Russon <rich@flatcap.org>
Tue, 16 Jul 2019 18:33:14 +0000 (19:33 +0100)
committerRichard Russon <rich@flatcap.org>
Tue, 16 Jul 2019 21:17:50 +0000 (22:17 +0100)
email/parameter.c
email/parameter.h
email/rfc2231.c
email/rfc2231.h
hcache/serialize.c
hcache/serialize.h

index dbc9529dd7c5bfafeb8f6575dec974d5381ea5cd..f7e967be7ecb69bb6e9aeee5f84ce6bd7bc5feae 100644 (file)
@@ -56,14 +56,14 @@ void mutt_param_free_one(struct Parameter **p)
 
 /**
  * mutt_param_free - Free a ParameterList
- * @param p ParameterList to free
+ * @param pl ParameterList to free
  */
-void mutt_param_free(struct ParameterList *p)
+void mutt_param_free(struct ParameterList *pl)
 {
-  if (!p)
+  if (!pl)
     return;
 
-  struct Parameter *np = TAILQ_FIRST(p);
+  struct Parameter *np = TAILQ_FIRST(pl);
   struct Parameter *next = NULL;
   while (np)
   {
@@ -71,23 +71,23 @@ void mutt_param_free(struct ParameterList *p)
     mutt_param_free_one(&np);
     np = next;
   }
-  TAILQ_INIT(p);
+  TAILQ_INIT(pl);
 }
 
 /**
  * mutt_param_get - Find a matching Parameter
- * @param p ParameterList
- * @param s String to match
+ * @param pl ParameterList
+ * @param s  String to match
  * @retval ptr Matching Parameter
  * @retval NULL No match
  */
-char *mutt_param_get(const struct ParameterList *p, const char *s)
+char *mutt_param_get(const struct ParameterList *pl, const char *s)
 {
-  if (!p)
+  if (!pl)
     return NULL;
 
   struct Parameter *np = NULL;
-  TAILQ_FOREACH(np, p, entries)
+  TAILQ_FOREACH(np, pl, entries)
   {
     if (mutt_str_strcasecmp(s, np->attribute) == 0)
       return np->value;
@@ -98,7 +98,7 @@ char *mutt_param_get(const struct ParameterList *p, const char *s)
 
 /**
  * mutt_param_set - Set a Parameter
- * @param[in]  p         ParameterList
+ * @param[in]  pl        ParameterList
  * @param[in]  attribute Attribute to match
  * @param[in]  value     Value to set
  *
@@ -107,19 +107,19 @@ char *mutt_param_get(const struct ParameterList *p, const char *s)
  * @note If a matching Parameter isn't found a new one will be allocated.
  *       The new Parameter will be inserted at the front of the list.
  */
-void mutt_param_set(struct ParameterList *p, const char *attribute, const char *value)
+void mutt_param_set(struct ParameterList *pl, const char *attribute, const char *value)
 {
-  if (!p)
+  if (!pl)
     return;
 
   if (!value)
   {
-    mutt_param_delete(p, attribute);
+    mutt_param_delete(pl, attribute);
     return;
   }
 
   struct Parameter *np = NULL;
-  TAILQ_FOREACH(np, p, entries)
+  TAILQ_FOREACH(np, pl, entries)
   {
     if (mutt_str_strcasecmp(attribute, np->attribute) == 0)
     {
@@ -131,25 +131,25 @@ void mutt_param_set(struct ParameterList *p, const char *attribute, const char *
   np = mutt_param_new();
   np->attribute = mutt_str_strdup(attribute);
   np->value = mutt_str_strdup(value);
-  TAILQ_INSERT_HEAD(p, np, entries);
+  TAILQ_INSERT_HEAD(pl, np, entries);
 }
 
 /**
  * mutt_param_delete - Delete a matching Parameter
- * @param[in]  p         ParameterList
- * @param[in]  attribute Attribute to match
+ * @param[in] pl        ParameterList
+ * @param[in] attribute Attribute to match
  */
-void mutt_param_delete(struct ParameterList *p, const char *attribute)
+void mutt_param_delete(struct ParameterList *pl, const char *attribute)
 {
-  if (!p)
+  if (!pl)
     return;
 
   struct Parameter *np = NULL;
-  TAILQ_FOREACH(np, p, entries)
+  TAILQ_FOREACH(np, pl, entries)
   {
     if (mutt_str_strcasecmp(attribute, np->attribute) == 0)
     {
-      TAILQ_REMOVE(p, np, entries);
+      TAILQ_REMOVE(pl, np, entries);
       mutt_param_free_one(&np);
       return;
     }
@@ -158,20 +158,20 @@ void mutt_param_delete(struct ParameterList *p, const char *attribute)
 
 /**
  * mutt_param_cmp_strict - Strictly compare two ParameterLists
- * @param p1 First parameter
- * @param p2 Second parameter
+ * @param pl1 First parameter
+ * @param pl2 Second parameter
  * @retval true Parameters are strictly identical
  */
-bool mutt_param_cmp_strict(const struct ParameterList *p1, const struct ParameterList *p2)
+bool mutt_param_cmp_strict(const struct ParameterList *pl1, const struct ParameterList *pl2)
 {
-  if (!p1 && !p2)
+  if (!pl1 && !pl2)
     return false;
 
-  if ((p1 == NULL) ^ (p2 == NULL))
+  if ((pl1 == NULL) ^ (pl2 == NULL))
     return true;
 
-  struct Parameter *np1 = TAILQ_FIRST(p1);
-  struct Parameter *np2 = TAILQ_FIRST(p2);
+  struct Parameter *np1 = TAILQ_FIRST(pl1);
+  struct Parameter *np2 = TAILQ_FIRST(pl2);
 
   while (np1 && np2)
   {
index 569ba1062ed648ea2e7358bc0d038018001dd37f..b609478b81d6d061121c0f932c178d3e3339ca13 100644 (file)
@@ -37,12 +37,12 @@ struct Parameter
 };
 TAILQ_HEAD(ParameterList, Parameter);
 
-bool              mutt_param_cmp_strict(const struct ParameterList *p1, const struct ParameterList *p2);
-void              mutt_param_delete    (struct ParameterList *p, const char *attribute);
-void              mutt_param_free      (struct ParameterList *p);
-void              mutt_param_free_one  (struct Parameter **p);
-char *            mutt_param_get       (const struct ParameterList *p, const char *s);
+bool              mutt_param_cmp_strict(const struct ParameterList *pl1, const struct ParameterList *pl2);
+void              mutt_param_delete    (struct ParameterList *pl, const char *attribute);
+void              mutt_param_free      (struct ParameterList *pl);
+void              mutt_param_free_one  (struct Parameter **pl);
+char *            mutt_param_get       (const struct ParameterList *pl, const char *s);
 struct Parameter *mutt_param_new       (void);
-void              mutt_param_set       (struct ParameterList *p, const char *attribute, const char *value);
+void              mutt_param_set       (struct ParameterList *pl, const char *attribute, const char *value);
 
 #endif /* MUTT_EMAIL_PARAMETER_H */
index a409dc5d85b7464de1a076119517011a787ed508..03c3e733b4cf3502e815848ca0748201156dbedf 100644 (file)
@@ -62,16 +62,16 @@ struct Rfc2231Parameter
 
 /**
  * purge_empty_parameters - Remove any ill-formed Parameters from a list
- * @param p Parameter List to check
+ * @param pl Parameter List to check
  */
-static void purge_empty_parameters(struct ParameterList *p)
+static void purge_empty_parameters(struct ParameterList *pl)
 {
   struct Parameter *np = NULL, *tmp = NULL;
-  TAILQ_FOREACH_SAFE(np, p, entries, tmp)
+  TAILQ_FOREACH_SAFE(np, pl, entries, tmp)
   {
     if (!np->attribute || !np->value)
     {
-      TAILQ_REMOVE(p, np, entries);
+      TAILQ_REMOVE(pl, np, entries);
       mutt_param_free_one(&np);
     }
   }
@@ -179,10 +179,10 @@ static void free_parameter(struct Rfc2231Parameter **p)
 
 /**
  * join_continuations - Process continuation parameters
- * @param p   Parameter List for the results
+ * @param pl  Parameter List for the results
  * @param par Continuation Parameter
  */
-static void join_continuations(struct ParameterList *p, struct Rfc2231Parameter *par)
+static void join_continuations(struct ParameterList *pl, struct Rfc2231Parameter *par)
 {
   char attribute[256];
   char charset[256];
@@ -225,17 +225,17 @@ static void join_continuations(struct ParameterList *p, struct Rfc2231Parameter
     struct Parameter *np = mutt_param_new();
     np->attribute = mutt_str_strdup(attribute);
     np->value = value;
-    TAILQ_INSERT_HEAD(p, np, entries);
+    TAILQ_INSERT_HEAD(pl, np, entries);
   }
 }
 
 /**
  * rfc2231_decode_parameters - Decode a Parameter list
- * @param p List to decode
+ * @param pl List to decode
  */
-void rfc2231_decode_parameters(struct ParameterList *p)
+void rfc2231_decode_parameters(struct ParameterList *pl)
 {
-  if (!p)
+  if (!pl)
     return;
 
   struct Rfc2231Parameter *conthead = NULL;
@@ -248,10 +248,10 @@ void rfc2231_decode_parameters(struct ParameterList *p)
   int index;
   bool dirty = false; /* set when we may have created empty parameters. */
 
-  purge_empty_parameters(p);
+  purge_empty_parameters(pl);
 
   struct Parameter *np = NULL, *tmp = NULL;
-  TAILQ_FOREACH_SAFE(np, p, entries, tmp)
+  TAILQ_FOREACH_SAFE(np, pl, entries, tmp)
   {
     s = strchr(np->attribute, '*');
     if (!s)
@@ -300,7 +300,7 @@ void rfc2231_decode_parameters(struct ParameterList *p)
 
       np->attribute = NULL;
       np->value = NULL;
-      TAILQ_REMOVE(p, np, entries);
+      TAILQ_REMOVE(pl, np, entries);
       FREE(&np);
 
       list_insert(&conthead, conttmp);
@@ -309,12 +309,12 @@ void rfc2231_decode_parameters(struct ParameterList *p)
 
   if (conthead)
   {
-    join_continuations(p, conthead);
+    join_continuations(pl, conthead);
     dirty = true;
   }
 
   if (dirty)
-    purge_empty_parameters(p);
+    purge_empty_parameters(pl);
 }
 
 /**
index 281a8e7305550bd6d6f15051694701f13eb75fb9..589838bf8d4cd62b186647993d8ae5e429669a0f 100644 (file)
@@ -30,7 +30,7 @@ struct ParameterList;
 /* These Config Variables are only used in rfc2231.c */
 extern bool C_Rfc2047Parameters;
 
-void                 rfc2231_decode_parameters(struct ParameterList *p);
+void                 rfc2231_decode_parameters(struct ParameterList *pl);
 struct ParameterList rfc2231_encode_string    (const char *attribute, char *value);
 
 #endif /* MUTT_EMAIL_RFC2231_H */
index 78ff8faa3ba614a27f9b246fa89ac70c6266467b..f3f525b03d4834010461b371011615fe3d225fb0 100644 (file)
@@ -353,13 +353,13 @@ void serial_restore_buffer(struct Buffer **b, const unsigned char *d, int *off,
 
 /**
  * serial_dump_parameter - Pack a Parameter into a binary blob
- * @param p       Parameter to pack
+ * @param pl      Parameter to pack
  * @param d       Binary blob to add to
  * @param off     Offset into the blob
  * @param convert If true, the strings will be converted to utf-8
  * @retval ptr End of the newly packed binary
  */
-unsigned char *serial_dump_parameter(struct ParameterList *p, unsigned char *d,
+unsigned char *serial_dump_parameter(struct ParameterList *pl, unsigned char *d,
                                      int *off, bool convert)
 {
   unsigned int counter = 0;
@@ -368,7 +368,7 @@ unsigned char *serial_dump_parameter(struct ParameterList *p, unsigned char *d,
   d = serial_dump_int(0xdeadbeef, d, off);
 
   struct Parameter *np = NULL;
-  TAILQ_FOREACH(np, p, entries)
+  TAILQ_FOREACH(np, pl, entries)
   {
     d = serial_dump_char(np->attribute, d, off, false);
     d = serial_dump_char(np->value, d, off, convert);
@@ -382,12 +382,12 @@ unsigned char *serial_dump_parameter(struct ParameterList *p, unsigned char *d,
 
 /**
  * serial_restore_parameter - Unpack a Parameter from a binary blob
- * @param p       Store the unpacked Parameter here
+ * @param pl      Store the unpacked Parameter here
  * @param d       Binary blob to read from
  * @param off     Offset into the blob
  * @param convert If true, the strings will be converted from utf-8
  */
-void serial_restore_parameter(struct ParameterList *p, const unsigned char *d,
+void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d,
                               int *off, bool convert)
 {
   unsigned int counter;
@@ -400,7 +400,7 @@ void serial_restore_parameter(struct ParameterList *p, const unsigned char *d,
     np = mutt_param_new();
     serial_restore_char(&np->attribute, d, off, false);
     serial_restore_char(&np->value, d, off, convert);
-    TAILQ_INSERT_TAIL(p, np, entries);
+    TAILQ_INSERT_TAIL(pl, np, entries);
     counter--;
   }
 }
index 42e7d4345ee584b353dd525ddf2ec4dd8e9008fe..b27e0c083b7be9c3b8cef721bef67099d299801b 100644 (file)
@@ -45,7 +45,7 @@ unsigned char *serial_dump_char(char *c, unsigned char *d, int *off, bool conver
 unsigned char *serial_dump_char_size(char *c, unsigned char *d, int *off, ssize_t size, bool convert);
 unsigned char *serial_dump_envelope(struct Envelope *e, unsigned char *d, int *off, bool convert);
 unsigned char *serial_dump_int(unsigned int i, unsigned char *d, int *off);
-unsigned char *serial_dump_parameter(struct ParameterList *p, unsigned char *d, int *off, bool convert);
+unsigned char *serial_dump_parameter(struct ParameterList *pl, unsigned char *d, int *off, bool convert);
 unsigned char *serial_dump_stailq(struct ListHead *l, unsigned char *d, int *off, bool convert);
 
 void           serial_restore_address(struct Address **a, const unsigned char *d, int *off, bool convert);
@@ -54,7 +54,7 @@ void           serial_restore_buffer(struct Buffer **b, const unsigned char *d,
 void           serial_restore_char(char **c, const unsigned char *d, int *off, bool convert);
 void           serial_restore_envelope(struct Envelope *e, const unsigned char *d, int *off, bool convert);
 void           serial_restore_int(unsigned int *i, const unsigned char *d, int *off);
-void           serial_restore_parameter(struct ParameterList *p, const unsigned char *d, int *off, bool convert);
+void           serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert);
 void           serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert);
 
 void *        mutt_hcache_dump(header_cache_t *hc, const struct Email *e, int *off, unsigned int uidvalidity);