From d7b064e238d98e1c9942cfb6e53c0767893310b1 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 6 Feb 2002 15:26:07 +0000 Subject: ANSIfy and remove some dead code. Sponsored by: DARPA, NAI Labs --- libexec/ypxfr/yp_dbwrite.c | 13 ++++--------- libexec/ypxfr/ypxfr_extern.h | 2 +- libexec/ypxfr/ypxfr_getmap.c | 8 +++----- libexec/ypxfr/ypxfr_main.c | 22 ++++++++-------------- libexec/ypxfr/ypxfr_misc.c | 27 +++++++++------------------ libexec/ypxfr/ypxfrd_getmap.c | 10 ++++------ 6 files changed, 29 insertions(+), 53 deletions(-) (limited to 'libexec/ypxfr') diff --git a/libexec/ypxfr/yp_dbwrite.c b/libexec/ypxfr/yp_dbwrite.c index 4715d7f..05031c1 100644 --- a/libexec/ypxfr/yp_dbwrite.c +++ b/libexec/ypxfr/yp_dbwrite.c @@ -53,10 +53,8 @@ static const char rcsid[] = /* * Open a DB database read/write */ -DB *yp_open_db_rw(domain, map, flags) - const char *domain; - const char *map; - const int flags; +DB * +yp_open_db_rw(const char *domain, const char *map, const int flags) { DB *dbp; char buf[1025]; @@ -91,11 +89,8 @@ DB *yp_open_db_rw(domain, map, flags) return (dbp); } -int yp_put_record(dbp,key,data,allow_overwrite) - DB *dbp; - DBT *key; - DBT *data; - int allow_overwrite; +int +yp_put_record(DB *dbp, DBT *key, DBT *data, int allow_overwrite) { int rval; diff --git a/libexec/ypxfr/ypxfr_extern.h b/libexec/ypxfr/ypxfr_extern.h index f5feedf..acfa105 100644 --- a/libexec/ypxfr/ypxfr_extern.h +++ b/libexec/ypxfr/ypxfr_extern.h @@ -54,7 +54,7 @@ extern DB *yp_open_db_rw(const char *, const char *, const int); extern void yp_init_dbs(void); extern int yp_put_record(DB *, DBT *, DBT *, int); extern int yp_get_record(const char *, const char *, const DBT *, DBT *, int); -extern int ypxfr_get_map(char *, char *, char *, int (*)()); +extern int ypxfr_get_map(char *, char *, char *, int (*)(int, char *, int, char *, int, char*)); extern char *ypxfr_get_master(char *, char *, char *, const int); extern unsigned long ypxfr_get_order(char *, char *, char *, const int); extern int ypxfr_match(char *, char *, char *, char *, unsigned long); diff --git a/libexec/ypxfr/ypxfr_getmap.c b/libexec/ypxfr/ypxfr_getmap.c index b7ec9f2..3c3d2e7 100644 --- a/libexec/ypxfr/ypxfr_getmap.c +++ b/libexec/ypxfr/ypxfr_getmap.c @@ -59,11 +59,9 @@ extern enum ypstat yp_errno; * talking to one of the slaves instead. We do need to dig into libc * a little though, since it contains the magic XDR function we need. */ -int ypxfr_get_map(map, domain, host, callback) - char *map; - char *domain; - char *host; - int (*callback)(); +int +ypxfr_get_map(char *map, char *domain, char *host, + int (*callback)(int, char *, int, char *, int, char*)) { CLIENT *clnt; ypreq_nokey req; diff --git a/libexec/ypxfr/ypxfr_main.c b/libexec/ypxfr/ypxfr_main.c index 24d9d4a..f1be4f2 100644 --- a/libexec/ypxfr/ypxfr_main.c +++ b/libexec/ypxfr/ypxfr_main.c @@ -64,9 +64,8 @@ struct sockaddr_in ypxfr_callback_addr; struct yppushresp_xfr ypxfr_resp; DB *dbp; -static void ypxfr_exit(retval, temp) - ypxfrstat retval; - char *temp; +static void +ypxfr_exit(ypxfrstat retval, char *temp) { CLIENT *clnt; int sock = RPC_ANYSOCK; @@ -107,7 +106,8 @@ static void ypxfr_exit(retval, temp) exit(0); } -static void usage() +static void +usage(void) { if (_rpcpmstart) { ypxfr_exit(YPXFR_BADARGS,NULL); @@ -120,13 +120,9 @@ static void usage() } } -int ypxfr_foreach(status, key, keylen, val, vallen, data) - int status; - char *key; - int keylen; - char *val; - int vallen; - char *data; +int +ypxfr_foreach(int status, char *key, int keylen, char *val, int vallen, + char *data) { DBT dbkey, dbval; @@ -161,9 +157,7 @@ int ypxfr_foreach(status, key, keylen, val, vallen, data) } int -main(argc,argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; int ypxfr_force = 0; diff --git a/libexec/ypxfr/ypxfr_misc.c b/libexec/ypxfr/ypxfr_misc.c index 0682def..ede4f56 100644 --- a/libexec/ypxfr/ypxfr_misc.c +++ b/libexec/ypxfr/ypxfr_misc.c @@ -46,8 +46,8 @@ struct dom_binding {}; #include #include "ypxfr_extern.h" -char *ypxfrerr_string(code) - ypxfrstat code; +char * +ypxfrerr_string(ypxfrstat code) { switch (code) { case YPXFR_SUCC: @@ -120,11 +120,8 @@ char *ypxfrerr_string(code) * allocated by the XDR routines. We have to rememver to free() or * xdr_free() the memory as required to avoid leaking memory. */ -char *ypxfr_get_master(domain,map,source,yplib) - char *domain; - char *map; - char *source; - const int yplib; +char * +ypxfr_get_master(char *domain, char *map, char *source, const int yplib) { static char mastername[MAXPATHLEN + 2]; @@ -195,11 +192,8 @@ failed")); } } -unsigned long ypxfr_get_order(domain, map, source, yplib) - char *domain; - char *map; - char *source; - const int yplib; +unsigned long +ypxfr_get_order(char *domain, char *map, char *source, const int yplib) { if (yplib) { unsigned long order; @@ -260,12 +254,9 @@ failed")); } } -int ypxfr_match(server, domain, map, key, keylen) - char *server; - char *domain; - char *map; - char *key; - unsigned long keylen; +int +ypxfr_match(char *server, char *domain, char *map, char *key, + unsigned long keylen) { ypreq_key ypkey; ypresp_val *ypval; diff --git a/libexec/ypxfr/ypxfrd_getmap.c b/libexec/ypxfr/ypxfrd_getmap.c index 5d57c84..d7a0171 100644 --- a/libexec/ypxfr/ypxfrd_getmap.c +++ b/libexec/ypxfr/ypxfrd_getmap.c @@ -51,7 +51,8 @@ static const char rcsid[] = int fp = 0; -static bool_t xdr_my_xfr(register XDR *xdrs, xfr *objp) +static bool_t +xdr_my_xfr(register XDR *xdrs, xfr *objp) { while (1) { if (!xdr_xfr(xdrs, objp)) @@ -100,11 +101,8 @@ static bool_t xdr_my_xfr(register XDR *xdrs, xfr *objp) #define PERM_SECURE (S_IRUSR|S_IWUSR) -int ypxfrd_get_map(host, map, domain, tmpname) - char *host; - char *map; - char *domain; - char *tmpname; +int +ypxfrd_get_map(char *host, char *map, char *domain, char *tmpname) { CLIENT *clnt; struct ypxfr_mapname req; -- cgit v1.1