summaryrefslogtreecommitdiff
path: root/usr.bin/gencat/gencat.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-10 22:20:55 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-10 22:20:55 +0000
commitb8aaa8bec8414f8e55cf9b61fe0873d242c773b8 (patch)
tree5e43016c4fae834239fd38972fd58355ed6b54b5 /usr.bin/gencat/gencat.c
parentf18f6607440f6d2da08fac3522d88a65c77a5f3e (diff)
mostly ansi cleanup; pval ok
Diffstat (limited to 'usr.bin/gencat/gencat.c')
-rw-r--r--usr.bin/gencat/gencat.c63
1 files changed, 20 insertions, 43 deletions
diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c
index d4d8a17ac17..023ae413c74 100644
--- a/usr.bin/gencat/gencat.c
+++ b/usr.bin/gencat/gencat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencat.c,v 1.7 2002/02/16 21:27:46 millert Exp $ */
+/* $OpenBSD: gencat.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $ */
/* $NetBSD: gencat.c,v 1.9 1998/10/09 17:00:56 itohy Exp $ */
/*-
@@ -40,7 +40,7 @@
#include <sys/cdefs.h>
#ifndef lint
static char rcsid[] =
- "$OpenBSD: gencat.c,v 1.7 2002/02/16 21:27:46 millert Exp $";
+ "$OpenBSD: gencat.c,v 1.8 2003/06/10 22:20:46 deraadt Exp $";
#endif /* not lint */
/***********************************************************
@@ -133,16 +133,14 @@ void usage(void);
void
-usage()
+usage(void)
{
fprintf(stderr, "Usage: %s catfile msgfile ...\n", __progname);
exit(1);
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ofd, ifd;
char *catfile = NULL;
@@ -179,9 +177,7 @@ main(argc, argv)
}
static void
-warning(cptr, msg)
- char *cptr;
- char *msg;
+warning(char *cptr, char *msg)
{
fprintf(stderr, "%s: %s on line %ld\n", __progname, msg, lineno);
fprintf(stderr, "%s\n", curline);
@@ -194,23 +190,20 @@ warning(cptr, msg)
}
static void
-error(cptr, msg)
- char *cptr;
- char *msg;
+error(char *cptr, char *msg)
{
warning(cptr, msg);
exit(1);
}
static void
-nomem()
+nomem(void)
{
error(NULL, "out of memory");
}
static void *
-xmalloc(len)
- size_t len;
+xmalloc(size_t len)
{
void *p;
@@ -220,9 +213,7 @@ xmalloc(len)
}
static void *
-xrealloc(ptr, size)
- void *ptr;
- size_t size;
+xrealloc(void *ptr, size_t size)
{
if ((ptr = realloc(ptr, size)) == NULL)
nomem();
@@ -230,8 +221,7 @@ xrealloc(ptr, size)
}
static char *
-xstrdup(str)
- const char *str;
+xstrdup(const char *str)
{
char *nstr;
@@ -241,8 +231,7 @@ xstrdup(str)
}
static char *
-getline(fd)
- int fd;
+getline(int fd)
{
static long curlen = BUFSIZ;
static char buf[BUFSIZ], *bptr = buf, *bend = buf;
@@ -285,8 +274,7 @@ getline(fd)
}
static char *
-wskip(cptr)
- char *cptr;
+wskip(char *cptr)
{
if (!*cptr || !ISSPACE(*cptr)) {
warning(cptr, "expected a space");
@@ -298,8 +286,7 @@ wskip(cptr)
}
static char *
-cskip(cptr)
- char *cptr;
+cskip(char *cptr)
{
if (!*cptr || ISSPACE(*cptr)) {
warning(cptr, "wasn't expecting a space");
@@ -311,10 +298,7 @@ cskip(cptr)
}
static char *
-getmsg(fd, cptr, quote)
- int fd;
- char *cptr;
- char quote;
+getmsg(int fd, char *cptr, char quote)
{
static char *msg = NULL;
static long msglen = 0;
@@ -428,8 +412,7 @@ getmsg(fd, cptr, quote)
}
void
-MCParse(fd)
- int fd;
+MCParse(int fd)
{
char *cptr, *str;
int setid, msgid = 0;
@@ -515,8 +498,7 @@ MCParse(fd)
* that would otherwise be required.
*/
void
-MCWriteCat(fd)
- int fd;
+MCWriteCat(int fd)
{
int nsets; /* number of sets */
int nmsgs; /* number of msgs */
@@ -621,8 +603,7 @@ MCWriteCat(fd)
}
void
-MCAddSet(setId)
- int setId;
+MCAddSet(int setId)
{
struct _setT *p, *q;
@@ -662,9 +643,7 @@ MCAddSet(setId)
}
void
-MCAddMsg(msgId, str)
- int msgId;
- const char *str;
+MCAddMsg(int msgId, const char *str)
{
struct _msgT *p, *q;
@@ -705,8 +684,7 @@ MCAddMsg(msgId, str)
}
void
-MCDelSet(setId)
- int setId;
+MCDelSet(int setId)
{
struct _setT *set;
struct _msgT *msg;
@@ -729,8 +707,7 @@ MCDelSet(setId)
}
void
-MCDelMsg(msgId)
- int msgId;
+MCDelMsg(int msgId)
{
struct _msgT *msg;