Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ypbind ANSIfy, remove __P(), unifdef __STDC__.
details: https://anonhg.NetBSD.org/src/rev/89748123c675
branches: trunk
changeset: 533663:89748123c675
user: wiz <wiz%NetBSD.org@localhost>
date: Sat Jul 06 21:44:40 2002 +0000
description:
ANSIfy, remove __P(), unifdef __STDC__.
diffstat:
usr.sbin/ypbind/ypbind.c | 132 ++++++++++++++++------------------------------
1 files changed, 45 insertions(+), 87 deletions(-)
diffs (truncated from 317 to 300 lines):
diff -r 7da0ba404038 -r 89748123c675 usr.sbin/ypbind/ypbind.c
--- a/usr.sbin/ypbind/ypbind.c Sat Jul 06 21:30:26 2002 +0000
+++ b/usr.sbin/ypbind/ypbind.c Sat Jul 06 21:44:40 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ypbind.c,v 1.46 2001/02/19 23:22:50 cgd Exp $ */
+/* $NetBSD: ypbind.c,v 1.47 2002/07/06 21:44:40 wiz Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt%fsa.ca@localhost>
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef LINT
-__RCSID("$NetBSD: ypbind.c,v 1.46 2001/02/19 23:22:50 cgd Exp $");
+__RCSID("$NetBSD: ypbind.c,v 1.47 2002/07/06 21:44:40 wiz Exp $");
#endif
#include <sys/param.h>
@@ -52,11 +52,7 @@
#include <stdlib.h>
#include <errno.h>
#include <syslog.h>
-#if __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <ctype.h>
#include <dirent.h>
#include <netdb.h>
@@ -131,33 +127,33 @@
static u_long rmtcr_port;
static SVCXPRT *udptransp, *tcptransp;
-int _yp_invalid_domain __P((const char *)); /* from libc */
-int main __P((int, char *[]));
+int _yp_invalid_domain(const char *); /* from libc */
+int main(int, char *[]);
-static void usage __P((void));
-static void yp_log __P((int, const char *, ...))
+static void usage(void);
+static void yp_log(int, const char *, ...)
__attribute__((__format__(__printf__, 2, 3)));
-static struct _dom_binding *makebinding __P((const char *));
-static int makelock __P((struct _dom_binding *));
-static void removelock __P((struct _dom_binding *));
-static void *ypbindproc_null_2 __P((SVCXPRT *, void *));
-static void *ypbindproc_domain_2 __P((SVCXPRT *, void *));
-static void *ypbindproc_setdom_2 __P((SVCXPRT *, void *));
-static void ypbindprog_2 __P((struct svc_req *, SVCXPRT *));
-static void checkwork __P((void));
-static int ping __P((struct _dom_binding *));
-static int nag_servers __P((struct _dom_binding *));
-static enum clnt_stat handle_replies __P((void));
-static enum clnt_stat handle_ping __P((void));
-static void rpc_received __P((char *, struct sockaddr_in *, int));
-static struct _dom_binding *xid2ypdb __P((u_int32_t));
-static u_int32_t unique_xid __P((struct _dom_binding *));
-static int broadcast __P((char *, int));
-static int direct __P((char *, int));
-static int direct_set __P((char *, int, struct _dom_binding *));
+static struct _dom_binding *makebinding(const char *);
+static int makelock(struct _dom_binding *);
+static void removelock(struct _dom_binding *);
+static void *ypbindproc_null_2(SVCXPRT *, void *);
+static void *ypbindproc_domain_2(SVCXPRT *, void *);
+static void *ypbindproc_setdom_2(SVCXPRT *, void *);
+static void ypbindprog_2(struct svc_req *, SVCXPRT *);
+static void checkwork(void);
+static int ping(struct _dom_binding *);
+static int nag_servers(struct _dom_binding *);
+static enum clnt_stat handle_replies(void);
+static enum clnt_stat handle_ping(void);
+static void rpc_received(char *, struct sockaddr_in *, int);
+static struct _dom_binding *xid2ypdb(u_int32_t);
+static u_int32_t unique_xid(struct _dom_binding *);
+static int broadcast(char *, int);
+static int direct(char *, int);
+static int direct_set(char *, int, struct _dom_binding *);
static void
-usage()
+usage(void)
{
char *opt = "";
#ifdef DEBUG
@@ -171,22 +167,11 @@
}
static void
-#if __STDC__
yp_log(int pri, const char *fmt, ...)
-#else
-yp_log(pri, fmt, va_alist)
- int pri;
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
#if defined(DEBUG)
if (debug)
@@ -198,8 +183,7 @@
}
static struct _dom_binding *
-makebinding(dm)
- const char *dm;
+makebinding(const char *dm)
{
struct _dom_binding *ypdb;
@@ -215,8 +199,7 @@
}
static int
-makelock(ypdb)
- struct _dom_binding *ypdb;
+makelock(struct _dom_binding *ypdb)
{
int fd;
char path[MAXPATHLEN];
@@ -237,8 +220,7 @@
}
static void
-removelock(ypdb)
- struct _dom_binding *ypdb;
+removelock(struct _dom_binding *ypdb)
{
char path[MAXPATHLEN];
@@ -248,9 +230,7 @@
}
static void *
-ypbindproc_null_2(transp, argp)
- SVCXPRT *transp;
- void *argp;
+ypbindproc_null_2(SVCXPRT *transp, void *argp)
{
static char res;
@@ -263,9 +243,7 @@
}
static void *
-ypbindproc_domain_2(transp, argp)
- SVCXPRT *transp;
- void *argp;
+ypbindproc_domain_2(SVCXPRT *transp, void *argp)
{
static struct ypbind_resp res;
struct _dom_binding *ypdb;
@@ -349,9 +327,7 @@
}
static void *
-ypbindproc_setdom_2(transp, argp)
- SVCXPRT *transp;
- void *argp;
+ypbindproc_setdom_2(SVCXPRT *transp, void *argp)
{
struct ypbind_setdom *sd = argp;
struct sockaddr_in *fromsin, bindsin;
@@ -422,9 +398,7 @@
}
static void
-ypbindprog_2(rqstp, transp)
- struct svc_req *rqstp;
- register SVCXPRT *transp;
+ypbindprog_2(struct svc_req *rqstp, register SVCXPRT *transp)
{
union {
char ypbindproc_domain_2_arg[YPMAXDOMAIN + 1];
@@ -433,7 +407,7 @@
struct authunix_parms *creds;
char *result;
xdrproc_t xdr_argument, xdr_result;
- void *(*local) __P((SVCXPRT *, void *));
+ void *(*local)(SVCXPRT *, void *);
switch (rqstp->rq_proc) {
case YPBINDPROC_NULL:
@@ -484,9 +458,7 @@
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct timeval tv;
fd_set fdsr;
@@ -654,7 +626,7 @@
* checking answer -- binding 60 sec
*/
void
-checkwork()
+checkwork(void)
{
struct _dom_binding *ypdb;
time_t t;
@@ -675,8 +647,7 @@
}
int
-ping(ypdb)
- struct _dom_binding *ypdb;
+ping(struct _dom_binding *ypdb)
{
char *dom = ypdb->dom_domain;
struct rpc_msg msg;
@@ -737,8 +708,7 @@
}
static int
-nag_servers(ypdb)
- struct _dom_binding *ypdb;
+nag_servers(struct _dom_binding *ypdb)
{
char *dom = ypdb->dom_domain;
struct rpc_msg msg;
@@ -834,9 +804,7 @@
}
static int
-broadcast(buf, outlen)
- char *buf;
- int outlen;
+broadcast(char *buf, int outlen)
{
struct ifaddrs *ifap, *ifa;
struct sockaddr_in bindsin;
@@ -882,9 +850,7 @@
}
static int
-direct(buf, outlen)
- char *buf;
- int outlen;
+direct(char *buf, int outlen)
{
static FILE *df;
static char ypservers_path[MAXPATHLEN];
@@ -953,10 +919,7 @@
}
static int
-direct_set(buf, outlen, ypdb)
- char *buf;
- int outlen;
- struct _dom_binding *ypdb;
+direct_set(char *buf, int outlen, struct _dom_binding *ypdb)
{
struct sockaddr_in bindsin;
char path[MAXPATHLEN];
@@ -1010,7 +973,7 @@
}
static enum clnt_stat
-handle_replies()
+handle_replies(void)
{
char buf[BUFSIZE];
int fromlen, inlen;
@@ -1060,7 +1023,7 @@
}
static enum clnt_stat
-handle_ping()
+handle_ping(void)
{
char buf[BUFSIZE];
int fromlen, inlen;
@@ -1113,10 +1076,7 @@
* LOOPBACK IS MORE IMPORTANT: PUT IN HACK
*/
void
-rpc_received(dom, raddrp, force)
- char *dom;
- struct sockaddr_in *raddrp;
- int force;
+rpc_received(char *dom, struct sockaddr_in *raddrp, int force)
{
struct _dom_binding *ypdb;
struct iovec iov[2];
@@ -1204,8 +1164,7 @@
}
Home |
Main Index |
Thread Index |
Old Index