convert to new nsdispatch(3)

This commit is contained in:
lukem 1999-01-19 08:07:58 +00:00
parent 27323a9339
commit 6a471ed8f9
3 changed files with 29 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: getgrent.c,v 1.29 1999/01/18 20:37:13 christos Exp $ */
/* $NetBSD: getgrent.c,v 1.30 1999/01/19 08:07:58 lukem Exp $ */
/*
* Copyright (c) 1989, 1993
@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)getgrent.c 8.2 (Berkeley) 3/21/94";
#else
__RCSID("$NetBSD: getgrent.c,v 1.29 1999/01/18 20:37:13 christos Exp $");
__RCSID("$NetBSD: getgrent.c,v 1.30 1999/01/19 08:07:58 lukem Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -429,14 +429,15 @@ __grscancompat(search, gid, name)
const char *name;
{
static ns_dtab dtab[] = {
NS_FILES_CB(_bad_grscan, "files"),
NS_DNS_CB(_dns_grscan, NULL),
NS_NIS_CB(_nis_grscan, NULL),
NS_COMPAT_CB(_bad_grscan, "compat"),
NS_FILES_CB(_bad_grscan, "files")
NS_DNS_CB(_dns_grscan, NULL)
NS_NIS_CB(_nis_grscan, NULL)
NS_COMPAT_CB(_bad_grscan, "compat")
{ 0 }
};
return nsdispatch(NULL, dtab, NSDB_GROUP_COMPAT, search, gid, name);
return (nsdispatch(NULL, dtab, NSDB_GROUP_COMPAT, "grscancompat",
__nsdefaultsrc, search, gid, name));
}
@ -536,14 +537,15 @@ grscan(search, gid, name)
{
int r;
static ns_dtab dtab[] = {
NS_FILES_CB(_local_grscan, NULL),
NS_DNS_CB(_dns_grscan, NULL),
NS_NIS_CB(_nis_grscan, NULL),
NS_COMPAT_CB(_compat_grscan, NULL),
NS_FILES_CB(_local_grscan, NULL)
NS_DNS_CB(_dns_grscan, NULL)
NS_NIS_CB(_nis_grscan, NULL)
NS_COMPAT_CB(_compat_grscan, NULL)
{ 0 }
};
r = nsdispatch(NULL, dtab, NSDB_GROUP, search, gid, name);
r = nsdispatch(NULL, dtab, NSDB_GROUP, "grscan", __nsdefaultsrc,
search, gid, name);
return (r == NS_SUCCESS) ? 1 : 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: getnetgrent.c,v 1.18 1999/01/18 20:38:01 christos Exp $ */
/* $NetBSD: getnetgrent.c,v 1.19 1999/01/19 08:07:58 lukem Exp $ */
/*
* Copyright (c) 1994 Christos Zoulas
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: getnetgrent.c,v 1.18 1999/01/18 20:38:01 christos Exp $");
__RCSID("$NetBSD: getnetgrent.c,v 1.19 1999/01/19 08:07:58 lukem Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -300,12 +300,13 @@ lookup(name, line, bywhat)
{
int r;
static ns_dtab dtab[] = {
NS_FILES_CB(_local_lookup, NULL),
NS_DNS_CB(_nis_lookup, NULL),
{ NULL, NULL, NULL }
NS_FILES_CB(_local_lookup, NULL)
NS_DNS_CB(_nis_lookup, NULL)
{ 0 }
};
r = nsdispatch(NULL, dtab, NSDB_NETGROUP, name, line, bywhat);
r = nsdispatch(NULL, dtab, NSDB_NETGROUP, "lookup", __nsdefaultsrc,
name, line, bywhat);
return (r == NS_SUCCESS) ? 1 : 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: getusershell.c,v 1.13 1999/01/16 07:47:19 lukem Exp $ */
/* $NetBSD: getusershell.c,v 1.14 1999/01/19 08:07:58 lukem Exp $ */
/*
* Copyright (c) 1985, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: getusershell.c,v 1.13 1999/01/16 07:47:19 lukem Exp $");
__RCSID("$NetBSD: getusershell.c,v 1.14 1999/01/19 08:07:58 lukem Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -258,17 +258,17 @@ static const char *const *
initshells()
{
static ns_dtab dtab[] = {
NS_FILES_CB(_local_initshells, NULL),
NS_DNS_CB(_dns_initshells, NULL),
NS_NIS_CB(_nis_initshells, NULL),
{ NULL, NULL, NULL }
NS_FILES_CB(_local_initshells, NULL)
NS_DNS_CB(_dns_initshells, NULL)
NS_NIS_CB(_nis_initshells, NULL)
{ 0 }
};
if (sl)
sl_free(sl, 1);
sl = sl_init();
if (nsdispatch(NULL, dtab, NSDB_SHELLS) != NS_SUCCESS) {
if (nsdispatch(NULL, dtab, NSDB_SHELLS, "initshells", __nsdefaultsrc)
!= NS_SUCCESS) {
if (sl)
sl_free(sl, 1);
sl = NULL;