From 841e7684dfaabeb3eea1d52bab6ca1b4cf90be42 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Mon, 15 May 2017 14:47:06 +0100 Subject: [PATCH] replace 'PARAMETER' with 'struct Parameter' --- commands.c | 2 +- hcache/hcache.c | 6 +++--- mbox.c | 2 +- mutt.h | 12 ++++++------ muttlib.c | 18 +++++++++--------- parse.c | 6 +++--- protos.h | 10 +++++----- rfc2231.c | 14 +++++++------- rfc2231.h | 2 +- sendlib.c | 4 ++-- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/commands.c b/commands.c index eb2935061..e191c44b2 100644 --- a/commands.c +++ b/commands.c @@ -910,7 +910,7 @@ void mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp) char buf[LONG_STRING]; char obuf[LONG_STRING]; char tmp[STRING]; - PARAMETER *p = NULL; + struct Parameter *p = NULL; char charset[STRING]; char *cp = NULL; diff --git a/hcache/hcache.c b/hcache/hcache.c index 84cc4dd56..504e5005d 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -332,7 +332,7 @@ static void restore_buffer(struct Buffer **b, const unsigned char *d, int *off, (*b)->destroy = used; } -static unsigned char *dump_parameter(PARAMETER *p, unsigned char *d, int *off, int convert) +static unsigned char *dump_parameter(struct Parameter *p, unsigned char *d, int *off, int convert) { unsigned int counter = 0; unsigned int start_off = *off; @@ -352,7 +352,7 @@ static unsigned char *dump_parameter(PARAMETER *p, unsigned char *d, int *off, i return d; } -static void restore_parameter(PARAMETER **p, const unsigned char *d, int *off, int convert) +static void restore_parameter(struct Parameter **p, const unsigned char *d, int *off, int convert) { unsigned int counter; @@ -360,7 +360,7 @@ static void restore_parameter(PARAMETER **p, const unsigned char *d, int *off, i while (counter) { - *p = safe_malloc(sizeof(PARAMETER)); + *p = safe_malloc(sizeof(struct Parameter)); restore_char(&(*p)->attribute, d, off, 0); restore_char(&(*p)->value, d, off, convert); p = &(*p)->next; diff --git a/mbox.c b/mbox.c index 899cb4556..5357e5696 100644 --- a/mbox.c +++ b/mbox.c @@ -608,7 +608,7 @@ static int strict_cmp_envelopes(const struct Envelope *e1, const struct Envelope } } -static int strict_cmp_parameters(const PARAMETER *p1, const PARAMETER *p2) +static int strict_cmp_parameters(const struct Parameter *p1, const struct Parameter *p2) { while (p1 && p2) { diff --git a/mutt.h b/mutt.h index 84b4b8efb..0509dadd0 100644 --- a/mutt.h +++ b/mutt.h @@ -692,16 +692,16 @@ static inline struct Envelope *mutt_new_envelope(void) return safe_calloc(1, sizeof(struct Envelope)); } -typedef struct parameter +struct Parameter { char *attribute; char *value; - struct parameter *next; -} PARAMETER; + struct Parameter *next; +}; -static inline PARAMETER *mutt_new_parameter(void) +static inline struct Parameter *mutt_new_parameter(void) { - return safe_calloc(1, sizeof(PARAMETER)); + return safe_calloc(1, sizeof(struct Parameter)); } /* Information that helps in determining the Content-* of an attachment */ @@ -723,7 +723,7 @@ struct Body { char *xtype; /* content-type if x-unknown */ char *subtype; /* content-type subtype */ - PARAMETER *parameter; /* parameters of the content-type */ + struct Parameter *parameter; /* parameters of the content-type */ char *description; /* content-description */ char *form_name; /* Content-Disposition form-data name param */ long hdr_offset; /* offset in stream where the headers begin. diff --git a/muttlib.c b/muttlib.c index 7a5a693a1..db82584b8 100644 --- a/muttlib.c +++ b/muttlib.c @@ -108,7 +108,7 @@ int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src) char tmp[_POSIX_PATH_MAX]; struct Body *b = NULL; - PARAMETER *par = NULL, **ppar = NULL; + struct Parameter *par = NULL, **ppar = NULL; bool use_disp; @@ -217,10 +217,10 @@ void mutt_free_body(struct Body **p) *p = 0; } -void mutt_free_parameter(PARAMETER **p) +void mutt_free_parameter(struct Parameter **p) { - PARAMETER *t = *p; - PARAMETER *o = NULL; + struct Parameter *t = *p; + struct Parameter *o = NULL; while (t) { @@ -635,7 +635,7 @@ char *mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw) } -char *mutt_get_parameter(const char *s, PARAMETER *p) +char *mutt_get_parameter(const char *s, struct Parameter *p) { for (; p; p = p->next) if (ascii_strcasecmp(s, p->attribute) == 0) @@ -644,9 +644,9 @@ char *mutt_get_parameter(const char *s, PARAMETER *p) return NULL; } -void mutt_set_parameter(const char *attribute, const char *value, PARAMETER **p) +void mutt_set_parameter(const char *attribute, const char *value, struct Parameter **p) { - PARAMETER *q = NULL; + struct Parameter *q = NULL; if (!value) { @@ -670,9 +670,9 @@ void mutt_set_parameter(const char *attribute, const char *value, PARAMETER **p) *p = q; } -void mutt_delete_parameter(const char *attribute, PARAMETER **p) +void mutt_delete_parameter(const char *attribute, struct Parameter **p) { - PARAMETER *q = NULL; + struct Parameter *q = NULL; for (q = *p; q; p = &q->next, q = q->next) { diff --git a/parse.c b/parse.c index ee142e2b0..3971bcca6 100644 --- a/parse.c +++ b/parse.c @@ -132,9 +132,9 @@ int mutt_check_encoding(const char *c) return ENCOTHER; } -static PARAMETER *parse_parameters(const char *s) +static struct Parameter *parse_parameters(const char *s) { - PARAMETER *head = NULL, *cur = NULL, *new = NULL; + struct Parameter *head = NULL, *cur = NULL, *new = NULL; char buffer[LONG_STRING]; const char *p = NULL; size_t i; @@ -373,7 +373,7 @@ void mutt_parse_content_type(char *s, struct Body *ct) static void parse_content_disposition(const char *s, struct Body *ct) { - PARAMETER *parms = NULL; + struct Parameter *parms = NULL; if (ascii_strncasecmp("inline", s, 6) == 0) ct->disposition = DISPINLINE; diff --git a/protos.h b/protos.h index 703f6fba2..47395f7b6 100644 --- a/protos.h +++ b/protos.h @@ -75,9 +75,9 @@ void mutt_FormatString(char *dest, /* output buffer */ format_flag flags); /* callback flags */ void mutt_parse_content_type(char *s, struct Body *ct); -void mutt_generate_boundary(PARAMETER **parm); -void mutt_delete_parameter(const char *attribute, PARAMETER **p); -void mutt_set_parameter(const char *attribute, const char *value, PARAMETER **p); +void mutt_generate_boundary(struct Parameter **parm); +void mutt_delete_parameter(const char *attribute, struct Parameter **p); +void mutt_set_parameter(const char *attribute, const char *value, struct Parameter **p); #ifdef USE_NOTMUCH int mutt_parse_virtual_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err); @@ -138,7 +138,7 @@ char *mutt_find_hook(int type, const char *pat); char *mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw); char *mutt_get_body_charset(char *d, size_t dlen, struct Body *b); const char *mutt_get_name(struct Address *a); -char *mutt_get_parameter(const char *s, PARAMETER *p); +char *mutt_get_parameter(const char *s, struct Parameter *p); struct List *mutt_crypt_hook(struct Address *adr); char *mutt_make_date(char *s, size_t len); void mutt_timeout_hook(void); @@ -212,7 +212,7 @@ void mutt_free_color(int fg, int bg); void mutt_free_enter_state(struct EnterState **esp); void mutt_free_envelope(struct Envelope **p); void mutt_free_header(struct Header **h); -void mutt_free_parameter(PARAMETER **p); +void mutt_free_parameter(struct Parameter **p); void mutt_free_regexp(REGEXP **pp); void mutt_help(int menu); void mutt_draw_tree(struct Context *ctx); diff --git a/rfc2231.c b/rfc2231.c index 888efd1f3..c934bcf0d 100644 --- a/rfc2231.c +++ b/rfc2231.c @@ -44,9 +44,9 @@ struct rfc2231_parameter struct rfc2231_parameter *next; }; -static void purge_empty_parameters(PARAMETER **headp) +static void purge_empty_parameters(struct Parameter **headp) { - PARAMETER *p = NULL, *q = NULL, **last = NULL; + struct Parameter *p = NULL, *q = NULL, **last = NULL; for (last = headp, p = *headp; p; p = q) { @@ -142,7 +142,7 @@ static void rfc2231_free_parameter(struct rfc2231_parameter **p) } /* process continuation parameters */ -static void rfc2231_join_continuations(PARAMETER **head, struct rfc2231_parameter *par) +static void rfc2231_join_continuations(struct Parameter **head, struct rfc2231_parameter *par) { struct rfc2231_parameter *q = NULL; @@ -192,11 +192,11 @@ static void rfc2231_join_continuations(PARAMETER **head, struct rfc2231_paramete } } -void rfc2231_decode_parameters(PARAMETER **headp) +void rfc2231_decode_parameters(struct Parameter **headp) { - PARAMETER *head = NULL; - PARAMETER **last; - PARAMETER *p = NULL, *q = NULL; + struct Parameter *head = NULL; + struct Parameter **last; + struct Parameter *p = NULL, *q = NULL; struct rfc2231_parameter *conthead = NULL; struct rfc2231_parameter *conttmp = NULL; diff --git a/rfc2231.h b/rfc2231.h index f27840968..e9e3d4c66 100644 --- a/rfc2231.h +++ b/rfc2231.h @@ -18,7 +18,7 @@ #ifndef _MUTT_RFC2231_H #define _MUTT_RFC2231_H 1 -void rfc2231_decode_parameters(PARAMETER **headp); +void rfc2231_decode_parameters(struct Parameter **headp); int rfc2231_encode_string(char **pd); diff --git a/sendlib.c b/sendlib.c index 0e6c2c345..2674d29cb 100644 --- a/sendlib.c +++ b/sendlib.c @@ -289,7 +289,7 @@ static void encode_8bit(FGETCONV *fc, FILE *fout, int istext) int mutt_write_mime_header(struct Body *a, FILE *f) { - PARAMETER *p = NULL; + struct Parameter *p = NULL; char buffer[STRING]; char *t = NULL; char *fn = NULL; @@ -476,7 +476,7 @@ int mutt_write_mime_body(struct Body *a, FILE *f) #undef write_as_text_part -void mutt_generate_boundary(PARAMETER **parm) +void mutt_generate_boundary(struct Parameter **parm) { char rs[MUTT_RANDTAG_LEN + 1]; -- 2.40.0