]> diplodocus.org Git - nmh/commitdiff
Split function definition prototypes so identifier starts a line.
authorRalph Corderoy <ralph@inputplus.co.uk>
Thu, 2 Nov 2017 01:21:56 +0000 (01:21 +0000)
committerRalph Corderoy <ralph@inputplus.co.uk>
Thu, 2 Nov 2017 01:27:28 +0000 (01:27 +0000)
Nearly all were already split like this.  The consistency helps ad hoc
scripting.

15 files changed:
sbr/check_charset.c
sbr/dtime.c
sbr/dtimep.l
sbr/error.c
sbr/fmt_addr.c
sbr/getcpy.c
sbr/lock_file.c
sbr/m_getfld.c
sbr/netsec.c
sbr/utils.c
sbr/vector.c
uip/mhbuildsbr.c
uip/mhlsbr.c
uip/mhparse.c
uip/mhstoresbr.c

index 71129fe..be7b92e 100644 (file)
@@ -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",
index 5e0fdc0..26b451d 100644 (file)
@@ -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;
index fdae74c..4db108d 100644 (file)
@@ -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);
 }
index 8285051..54d6fac 100644 (file)
@@ -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;
 
index 4684fa7..37b286a 100644 (file)
@@ -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);
 }
index 615f307..003971b 100644 (file)
@@ -13,7 +13,8 @@
 #include <h/utils.h>
 
 /* 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);
index b1f31b6..8f1732b 100644 (file)
@@ -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;
 
index 9793b05..d7ef292 100644 (file)
@@ -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");
index 1fe8f1a..01c25f5 100644 (file)
@@ -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;
index 18dd4b5..feb3e76 100644 (file)
@@ -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;
index c87e2e4..77908cb 100644 (file)
@@ -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);
index 9b2dc71..b563443 100644 (file)
@@ -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--;
index ef9f830..bafc7d9 100644 (file)
@@ -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;
index 4efe1a3..9c005bf 100644 (file)
@@ -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);
index 116b159..f73e68a 100644 (file)
@@ -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. */