Nearly all were already split like this. The consistency helps ad hoc
scripting.
15 files changed:
* http://www.cl.cam.ac.uk/~mgk25/ucs/norm_charmap.c
*/
* 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",
{
static const char *correct[] = {
"UTF-8",
* return the string representation of the numeric offset.
*/
* 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;
{
static char buffer[sizeof "+3579139459"]; /* 2,147,483,648 / 60 = 35,791,394 */
bool pos;
* "%option nounput" which is flex-specific
* makefile hackery just to compile dtimep.c with different flags
*/
* "%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)
/* inform calls advertise() with no what and no tail.
* Thus the simple "[invo_name: ]fmt\n" results. */
/* 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, ...)
-char *concataddr (char *orig, char *str)
+char *
+concataddr (char *orig, char *str)
{
return formataddr(orig, str);
}
{
return formataddr(orig, str);
}
#include <h/utils.h>
/* Return malloc'd copy of str, or of "" if NULL, exit on failure. */
#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);
{
if (str)
return mh_xstrdup(str);
* Locking using the spool locking algorithm
*/
* 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)
}
/* m_getfld_track_filepos() with the existing 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");
{
if (!*gstate)
die("m_getfld_track_filepos2 without gstate");
m_getfld_track_filepos(gstate, (*gstate)->iob);
}
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;
{
m_getfld_state_t s = *gstate;
/* m_getfld() with the existing iob. */
/* 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");
{
if (!*gstate)
die("m_getfld2 without gstate");
/* m_unknown() with the existing 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");
{
if (!*gstate)
die("m_unknown2 without gstate");
* Set the snoop callback for this connection.
*/
* 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;
netsec_snoop_callback callback, void *context)
{
nsc->ns_snoop_cb = callback;
-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;
unsigned int *len)
{
netsec_context *nsc = (netsec_context *) context;
#define MAXMSGS 256
/* Call malloc(3), exiting on NULL return. */
#define MAXMSGS 256
/* Call malloc(3), exiting on NULL return. */
-void *mh_xmalloc(size_t size)
+void *
+mh_xmalloc(size_t size)
}
/* Call realloc(3), exiting on NULL return. */
}
/* Call realloc(3), exiting on NULL return. */
-void *mh_xrealloc(void *ptr, size_t size)
+void *
+mh_xrealloc(void *ptr, size_t size)
}
/* Call calloc(3), exiting on NULL return. */
}
/* 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)
}
/* Duplicate a NUL-terminated string, exit on failure. */
}
/* Duplicate a NUL-terminated string, exit on failure. */
-char *mh_xstrdup(const char *src)
+char *
+mh_xstrdup(const char *src)
* folder_exists
* Check to see if a folder exists.
*/
* folder_exists
* Check to see if a folder exists.
*/
-int folder_exists(const char *folder)
+int
+folder_exists(const char *folder)
* Check to see if a folder exists, if not, prompt the user to create
* it.
*/
* 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;
{
struct stat st;
extern int errno;
* 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. */
* 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\"",
{
if (!size) {
inform("trunccpy: zero-length destination: \"%.20s\"",
/* has_prefix returns true if non-NULL s starts with non-NULL prefix. */
/* 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++;
{
while (*s && *s == *prefix) {
s++;
/* has_suffix returns true if non-NULL s ends with non-NULL suffix. */
/* 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)
/* has_suffix_c returns true if non-NULL string s ends with a c before the
* terminating NUL. */
/* 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;
}
{
return *s && s[strlen(s) - 1] == 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. */
/* 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)
/* to_lower runs all of s through tolower(3). */
/* to_lower runs all of s through tolower(3). */
/* to_upper runs all of s through toupper(3). */
/* to_upper runs all of s through toupper(3). */
-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;
{
int status = OK;
char *locale;
* 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. */
* 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)
-void bvector_init(struct bvector *bv)
+void
+bvector_init(struct bvector *bv)
{
bv->bits = bv->tiny;
bv->maxsize = BVEC_INIT_SIZE;
{
bv->bits = bv->tiny;
bv->maxsize = BVEC_INIT_SIZE;
-void bvector_fini(struct bvector *bv)
+void
+bvector_fini(struct bvector *bv)
{
if (bv->bits != bv->tiny)
free(bv->bits);
{
if (bv->bits != bv->tiny)
free(bv->bits);
static unsigned char directives_stack[32];
static unsigned int directives_index;
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];
}
{
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");
{
if (directives_index >= sizeof(directives_stack) - 1) {
fprintf(stderr, "mhbuild: #on/off overflow, continuing\n");
directives_stack[++directives_index] = 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;
}
{
directives_index = 0;
directives_stack[0] = onoff;
}
-static void directive_pop(void)
+static void
+directive_pop(void)
{
if (directives_index > 0)
directives_index--;
{
if (directives_index > 0)
directives_index--;
* Either way, the result depends on ASCII LF, either from typing Enter
* or an escaped Ctrl-J, being amongst the read characters.
*/
* 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;
{
char buf[128];
ssize_t n;
-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);
{
static char buffer[4096]; /* I hope no parameters are larger */
size_t bufsize = sizeof(buffer);
-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. */
{
/* Preserve result of original test that considered an empty string
* OK. */