From: Ralph Corderoy Date: Thu, 2 Nov 2017 01:21:56 +0000 (+0000) Subject: Split function definition prototypes so identifier starts a line. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/1df63930a063aa03a7bd09bb719803ea4820d4e1?ds=sidebyside Split function definition prototypes so identifier starts a line. Nearly all were already split like this. The consistency helps ad hoc scripting. --- diff --git a/sbr/check_charset.c b/sbr/check_charset.c index 71129fef..be7b92ee 100644 --- a/sbr/check_charset.c +++ b/sbr/check_charset.c @@ -105,7 +105,8 @@ write_charset_8bit (void) * http://www.cl.cam.ac.uk/~mgk25/ucs/norm_charmap.c */ -static const char *norm_charmap(char *name) +static const char * +norm_charmap(char *name) { static const char *correct[] = { "UTF-8", diff --git a/sbr/dtime.c b/sbr/dtime.c index 5e0fdc0a..26b451da 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -285,7 +285,8 @@ dasctime (struct tws *tw, int flags) * return the string representation of the numeric offset. */ -char *dtimezone(int offset, int flags) +char * +dtimezone(int offset, int flags) { static char buffer[sizeof "+3579139459"]; /* 2,147,483,648 / 60 = 35,791,394 */ bool pos; diff --git a/sbr/dtimep.l b/sbr/dtimep.l index fdae74cc..4db108dc 100644 --- a/sbr/dtimep.l +++ b/sbr/dtimep.l @@ -378,7 +378,8 @@ nl [ \t\n()] * "%option nounput" which is flex-specific * makefile hackery just to compile dtimep.c with different flags */ -void dtimep_yyunput(int c) +void +dtimep_yyunput(int c) { unput(c); } diff --git a/sbr/error.c b/sbr/error.c index 82850510..54d6fac5 100644 --- a/sbr/error.c +++ b/sbr/error.c @@ -13,7 +13,8 @@ /* inform calls advertise() with no what and no tail. * Thus the simple "[invo_name: ]fmt\n" results. */ -void inform(char *fmt, ...) +void +inform(char *fmt, ...) { va_list ap; diff --git a/sbr/fmt_addr.c b/sbr/fmt_addr.c index 4684fa7f..37b286a2 100644 --- a/sbr/fmt_addr.c +++ b/sbr/fmt_addr.c @@ -111,7 +111,8 @@ formataddr (char *orig, char *str) return buf; } -char *concataddr (char *orig, char *str) +char * +concataddr (char *orig, char *str) { return formataddr(orig, str); } diff --git a/sbr/getcpy.c b/sbr/getcpy.c index 615f307f..003971b2 100644 --- a/sbr/getcpy.c +++ b/sbr/getcpy.c @@ -13,7 +13,8 @@ #include /* Return malloc'd copy of str, or of "" if NULL, exit on failure. */ -char *getcpy(const char *str) +char * +getcpy(const char *str) { if (str) return mh_xstrdup(str); diff --git a/sbr/lock_file.c b/sbr/lock_file.c index b1f31b68..8f1732b4 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -133,7 +133,8 @@ lkopendata(const char *file, int access, mode_t mode, int *failed_to_lock) * Locking using the spool locking algorithm */ -int lkopenspool(const char *file, int access, mode_t mode, int *failed_to_lock) +int +lkopenspool(const char *file, int access, mode_t mode, int *failed_to_lock) { static bool deja_vu; diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 9793b054..d7ef292c 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -352,7 +352,8 @@ m_getfld_track_filepos (m_getfld_state_t *gstate, FILE *iob) } /* m_getfld_track_filepos() with the existing iob. */ -void m_getfld_track_filepos2(m_getfld_state_t *gstate) +void +m_getfld_track_filepos2(m_getfld_state_t *gstate) { if (!*gstate) die("m_getfld_track_filepos2 without gstate"); @@ -360,7 +361,8 @@ void m_getfld_track_filepos2(m_getfld_state_t *gstate) m_getfld_track_filepos(gstate, (*gstate)->iob); } -void m_getfld_state_destroy (m_getfld_state_t *gstate) +void +m_getfld_state_destroy (m_getfld_state_t *gstate) { m_getfld_state_t s = *gstate; @@ -849,7 +851,8 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, /* m_getfld() with the existing iob. */ -int m_getfld2(m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz) +int +m_getfld2(m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz) { if (!*gstate) die("m_getfld2 without gstate"); @@ -949,7 +952,8 @@ m_unknown(m_getfld_state_t *gstate, FILE *iob) /* m_unknown() with the existing iob. */ -void m_unknown2(m_getfld_state_t *gstate) +void +m_unknown2(m_getfld_state_t *gstate) { if (!*gstate) die("m_unknown2 without gstate"); diff --git a/sbr/netsec.c b/sbr/netsec.c index 1fe8f1ae..01c25f5f 100644 --- a/sbr/netsec.c +++ b/sbr/netsec.c @@ -288,7 +288,8 @@ netsec_set_snoop(netsec_context *nsc, int snoop) * Set the snoop callback for this connection. */ -void netsec_set_snoop_callback(netsec_context *nsc, +void +netsec_set_snoop_callback(netsec_context *nsc, netsec_snoop_callback callback, void *context) { nsc->ns_snoop_cb = callback; @@ -1103,7 +1104,8 @@ netsec_set_sasl_params(netsec_context *nsc, const char *service, * library when asked. */ -int netsec_get_user(void *context, int id, const char **result, +int +netsec_get_user(void *context, int id, const char **result, unsigned int *len) { netsec_context *nsc = (netsec_context *) context; diff --git a/sbr/utils.c b/sbr/utils.c index 18dd4b54..feb3e76b 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -28,7 +28,8 @@ const char plurals[] = "s"; #define MAXMSGS 256 /* Call malloc(3), exiting on NULL return. */ -void *mh_xmalloc(size_t size) +void * +mh_xmalloc(size_t size) { void *p; @@ -42,7 +43,8 @@ void *mh_xmalloc(size_t size) } /* Call realloc(3), exiting on NULL return. */ -void *mh_xrealloc(void *ptr, size_t size) +void * +mh_xrealloc(void *ptr, size_t size) { void *new; @@ -62,7 +64,8 @@ void *mh_xrealloc(void *ptr, size_t size) } /* Call calloc(3), exiting on NULL return. */ -void *mh_xcalloc(size_t nelem, size_t elsize) +void * +mh_xcalloc(size_t nelem, size_t elsize) { void *p; @@ -77,7 +80,8 @@ void *mh_xcalloc(size_t nelem, size_t elsize) } /* Duplicate a NUL-terminated string, exit on failure. */ -char *mh_xstrdup(const char *src) +char * +mh_xstrdup(const char *src) { size_t n; char *dest; @@ -173,7 +177,8 @@ addlist (char *list, const char *item) * folder_exists * Check to see if a folder exists. */ -int folder_exists(const char *folder) +int +folder_exists(const char *folder) { struct stat st; @@ -185,7 +190,8 @@ int folder_exists(const char *folder) * Check to see if a folder exists, if not, prompt the user to create * it. */ -void create_folder(char *folder, int autocreate, void (*done_callback)(int)) +void +create_folder(char *folder, int autocreate, void (*done_callback)(int)) { struct stat st; extern int errno; @@ -338,7 +344,8 @@ nmh_strcasestr (const char *s1, const char *s2) * reporting a possibly very long external string back to the user. One * of its advantages over strncpy(3) is it doesn't pad in the common * case of no truncation. */ -void trunccpy(char *dst, const char *src, size_t size) +void +trunccpy(char *dst, const char *src, size_t size) { if (!size) { inform("trunccpy: zero-length destination: \"%.20s\"", @@ -356,7 +363,8 @@ void trunccpy(char *dst, const char *src, size_t size) /* has_prefix returns true if non-NULL s starts with non-NULL prefix. */ -bool has_prefix(const char *s, const char *prefix) +bool +has_prefix(const char *s, const char *prefix) { while (*s && *s == *prefix) { s++; @@ -368,7 +376,8 @@ bool has_prefix(const char *s, const char *prefix) /* has_suffix returns true if non-NULL s ends with non-NULL suffix. */ -bool has_suffix(const char *s, const char *suffix) +bool +has_suffix(const char *s, const char *suffix) { size_t ls, lsuf; @@ -381,7 +390,8 @@ bool has_suffix(const char *s, const char *suffix) /* has_suffix_c returns true if non-NULL string s ends with a c before the * terminating NUL. */ -bool has_suffix_c(const char *s, int c) +bool +has_suffix_c(const char *s, int c) { return *s && s[strlen(s) - 1] == c; } @@ -389,7 +399,8 @@ bool has_suffix_c(const char *s, int c) /* trim_suffix_c deletes c from the end of non-NULL string s if it's * present, shortening s by 1. Only one instance of c is removed. */ -void trim_suffix_c(char *s, int c) +void +trim_suffix_c(char *s, int c) { if (!*s) return; @@ -401,7 +412,8 @@ void trim_suffix_c(char *s, int c) /* to_lower runs all of s through tolower(3). */ -void to_lower(char *s) +void +to_lower(char *s) { unsigned char *b; @@ -411,7 +423,8 @@ void to_lower(char *s) /* to_upper runs all of s through toupper(3). */ -void to_upper(char *s) +void +to_upper(char *s) { unsigned char *b; @@ -420,7 +433,8 @@ void to_upper(char *s) } -int nmh_init(const char *argv0, bool read_context, bool check_version) +int +nmh_init(const char *argv0, bool read_context, bool check_version) { int status = OK; char *locale; @@ -536,7 +550,8 @@ nmh_version_changed (int older) * isascii(3), i.e. is outside [0, 0x7f]. If start is NULL it returns * false. Bytes are examined until a NUL byte, or, if end is not NULL, * whilst start is before end. */ -bool contains8bit(const char *start, const char *end) +bool +contains8bit(const char *start, const char *end) { const char *p; char c; diff --git a/sbr/vector.c b/sbr/vector.c index c87e2e4d..77908cb1 100644 --- a/sbr/vector.c +++ b/sbr/vector.c @@ -67,7 +67,8 @@ bvector_create (void) return vec; } -void bvector_init(struct bvector *bv) +void +bvector_init(struct bvector *bv) { bv->bits = bv->tiny; bv->maxsize = BVEC_INIT_SIZE; @@ -96,7 +97,8 @@ bvector_free (bvector_t vec) free (vec); } -void bvector_fini(struct bvector *bv) +void +bvector_fini(struct bvector *bv) { if (bv->bits != bv->tiny) free(bv->bits); diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 9b2dc717..b563443a 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -82,12 +82,14 @@ static int extract_headers (CT, char *, FILE **); static unsigned char directives_stack[32]; static unsigned int directives_index; -static int do_direct(void) +static int +do_direct(void) { return directives_stack[directives_index]; } -static void directive_onoff(int onoff) +static void +directive_onoff(int onoff) { if (directives_index >= sizeof(directives_stack) - 1) { fprintf(stderr, "mhbuild: #on/off overflow, continuing\n"); @@ -96,13 +98,15 @@ static void directive_onoff(int onoff) directives_stack[++directives_index] = onoff; } -static void directive_init(int onoff) +static void +directive_init(int onoff) { directives_index = 0; directives_stack[0] = onoff; } -static void directive_pop(void) +static void +directive_pop(void) { if (directives_index > 0) directives_index--; diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index ef9f8305..bafc7d92 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -1596,7 +1596,8 @@ putch (char ch, unsigned long flags) * Either way, the result depends on ASCII LF, either from typing Enter * or an escaped Ctrl-J, being amongst the read characters. */ -static bool linefeed_typed(void) +static bool +linefeed_typed(void) { char buf[128]; ssize_t n; diff --git a/uip/mhparse.c b/uip/mhparse.c index 4efe1a31..9c005bff 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -4139,7 +4139,8 @@ get_param(PM first, const char *name, char replace, int fetchonly) * necessary */ -char *get_param_value(PM pm, char replace) +char * +get_param_value(PM pm, char replace) { static char buffer[4096]; /* I hope no parameters are larger */ size_t bufsize = sizeof(buffer); diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 116b159a..f73e68a9 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -1346,7 +1346,8 @@ clobber_check (char *original_file, mhstoreinfo_t info) return file; } -static bool use_param_as_filename(const char *p) +static bool +use_param_as_filename(const char *p) { /* Preserve result of original test that considered an empty string * OK. */