summaryrefslogtreecommitdiff
path: root/libexec/ypxfr
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2002-02-06 15:26:07 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2002-02-06 15:26:07 +0000
commitdc584ddbc5eb111cdb9863e2652621d7b5e9ba76 (patch)
tree9c2a46d61c0b1ec2538854e870b6861acfd2ee7a /libexec/ypxfr
parented4d1c46a27632aa553e7c24c969262bfc2d5c97 (diff)
downloadsrc-test2-dc584ddbc5eb111cdb9863e2652621d7b5e9ba76.tar.gz
src-test2-dc584ddbc5eb111cdb9863e2652621d7b5e9ba76.zip
Notes
Diffstat (limited to 'libexec/ypxfr')
-rw-r--r--libexec/ypxfr/yp_dbwrite.c13
-rw-r--r--libexec/ypxfr/ypxfr_extern.h2
-rw-r--r--libexec/ypxfr/ypxfr_getmap.c8
-rw-r--r--libexec/ypxfr/ypxfr_main.c22
-rw-r--r--libexec/ypxfr/ypxfr_misc.c27
-rw-r--r--libexec/ypxfr/ypxfrd_getmap.c10
6 files changed, 29 insertions, 53 deletions
diff --git a/libexec/ypxfr/yp_dbwrite.c b/libexec/ypxfr/yp_dbwrite.c
index 4715d7fa3204..05031c163d72 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 f5feedfec05f..acfa10589076 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 b7ec9f2a2d41..3c3d2e7bc771 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 24d9d4a8529f..f1be4f24f26b 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 0682def089ae..ede4f56e632d 100644
--- a/libexec/ypxfr/ypxfr_misc.c
+++ b/libexec/ypxfr/ypxfr_misc.c
@@ -46,8 +46,8 @@ struct dom_binding {};
#include <rpcsvc/ypclnt.h>
#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 5d57c846eace..d7a0171c3210 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;