summaryrefslogtreecommitdiff
path: root/usr.bin/rpcgen/rpc_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rpcgen/rpc_util.c')
-rw-r--r--usr.bin/rpcgen/rpc_util.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/usr.bin/rpcgen/rpc_util.c b/usr.bin/rpcgen/rpc_util.c
index 1f7c73098e3..3b0ddbea456 100644
--- a/usr.bin/rpcgen/rpc_util.c
+++ b/usr.bin/rpcgen/rpc_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_util.c,v 1.4 2001/07/18 22:26:00 deraadt Exp $ */
+/* $OpenBSD: rpc_util.c,v 1.5 2001/11/24 19:17:47 deraadt Exp $ */
/* $NetBSD: rpc_util.c,v 1.6 1995/08/29 23:05:57 cgd Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)rpc_util.c 1.11 89/02/22 (C) 1987 SMI";
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <unistd.h>
#include "rpc_scan.h"
#include "rpc_parse.h"
#include "rpc_util.h"
@@ -68,6 +69,7 @@ list *defined; /* list of defined things */
/*
* Reinitialize the world
*/
+void
reinitialize()
{
memset(curline, 0, MAXLINESIZE);
@@ -79,6 +81,7 @@ reinitialize()
/*
* string equality
*/
+int
streq(a, b)
char *a;
char *b;
@@ -116,7 +119,6 @@ storeval(lstp, val)
list **l;
list *lst;
-
for (l = lstp; *l != NULL; l = (list **) & (*l)->next);
lst = ALLOC(list);
lst->val = val;
@@ -124,7 +126,7 @@ storeval(lstp, val)
*l = lst;
}
-static
+static int
findit(def, type)
definition *def;
char *type;
@@ -193,7 +195,7 @@ ptype(prefix, type, follow)
}
}
-static
+static int
typedefed(def, type)
definition *def;
char *type;
@@ -205,6 +207,7 @@ typedefed(def, type)
}
}
+int
isvectordef(type, rel)
char *type;
relation rel;
@@ -238,7 +241,7 @@ locase(str)
static char buf[100];
char *p = buf;
- while (c = *str++) {
+ while ((c = *str++)) {
*p++ = (c >= 'A' && c <= 'Z') ? (c - 'A' + 'a') : c;
}
*p = 0;
@@ -278,6 +281,7 @@ error(msg)
* Something went wrong, unlink any files that we may have created and then
* die.
*/
+void
crash()
{
int i;
@@ -352,7 +356,6 @@ tabify(f, tab)
}
}
-
static token tokstrings[] = {
{TOK_IDENT, "identifier"},
{TOK_CONST, "const"},
@@ -400,7 +403,7 @@ toktostr(kind)
return (sp->str);
}
-static
+static void
printbuf()
{
char c;
@@ -409,7 +412,7 @@ printbuf()
# define TABSIZE 4
- for (i = 0; c = curline[i]; i++) {
+ for (i = 0; (c = curline[i]); i++) {
if (c == '\t') {
cnt = 8 - (i % TABSIZE);
c = ' ';
@@ -450,7 +453,7 @@ make_argname(pname, vname)
char *vname;
{
char *name;
-
+
name = (char *)malloc(strlen(pname) + strlen(vname) + strlen(ARGEXT) + 3);
if (!name) {
fprintf(stderr, "failed in malloc");
@@ -493,8 +496,7 @@ find_type(type)
{
bas_type * ptr;
- ptr=typ_list_h;
-
+ ptr = typ_list_h;
while (ptr != NULL) {
if (strcmp(ptr->name,type) == 0)