/**
* 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)
{
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;
/**
* 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
*
* @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)
{
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;
}
/**
* 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)
{
};
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 */
/**
* 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);
}
}
/**
* 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];
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;
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)
np->attribute = NULL;
np->value = NULL;
- TAILQ_REMOVE(p, np, entries);
+ TAILQ_REMOVE(pl, np, entries);
FREE(&np);
list_insert(&conthead, conttmp);
if (conthead)
{
- join_continuations(p, conthead);
+ join_continuations(pl, conthead);
dirty = true;
}
if (dirty)
- purge_empty_parameters(p);
+ purge_empty_parameters(pl);
}
/**
/* 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 */
/**
* 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;
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);
/**
* 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;
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--;
}
}
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);
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);