From 1ce5afe1dc4fae58f6f1175a576b03a7f8316db2 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Tue, 16 Jul 2019 19:33:14 +0100 Subject: [PATCH] rename ParameterList variables --- email/parameter.c | 58 +++++++++++++++++++++++----------------------- email/parameter.h | 12 +++++----- email/rfc2231.c | 30 ++++++++++++------------ email/rfc2231.h | 2 +- hcache/serialize.c | 12 +++++----- hcache/serialize.h | 4 ++-- 6 files changed, 59 insertions(+), 59 deletions(-) diff --git a/email/parameter.c b/email/parameter.c index dbc9529dd..f7e967be7 100644 --- a/email/parameter.c +++ b/email/parameter.c @@ -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) { diff --git a/email/parameter.h b/email/parameter.h index 569ba1062..b609478b8 100644 --- a/email/parameter.h +++ b/email/parameter.h @@ -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 */ diff --git a/email/rfc2231.c b/email/rfc2231.c index a409dc5d8..03c3e733b 100644 --- a/email/rfc2231.c +++ b/email/rfc2231.c @@ -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); } /** diff --git a/email/rfc2231.h b/email/rfc2231.h index 281a8e730..589838bf8 100644 --- a/email/rfc2231.h +++ b/email/rfc2231.h @@ -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 */ diff --git a/hcache/serialize.c b/hcache/serialize.c index 78ff8faa3..f3f525b03 100644 --- a/hcache/serialize.c +++ b/hcache/serialize.c @@ -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--; } } diff --git a/hcache/serialize.h b/hcache/serialize.h index 42e7d4345..b27e0c083 100644 --- a/hcache/serialize.h +++ b/hcache/serialize.h @@ -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); -- 2.40.0