From 76252edd4087a921ae0ee7b30d38fdf3386c64eb Mon Sep 17 00:00:00 2001 From: millert Date: Sun, 2 Feb 1997 23:32:15 +0000 Subject: [PATCH] Use public stringlist (in libc) --- usr.sbin/netgroup_mkdb/netgroup_mkdb.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/usr.sbin/netgroup_mkdb/netgroup_mkdb.c b/usr.sbin/netgroup_mkdb/netgroup_mkdb.c index 25142f6d031..870a0a0bf4d 100644 --- a/usr.sbin/netgroup_mkdb/netgroup_mkdb.c +++ b/usr.sbin/netgroup_mkdb/netgroup_mkdb.c @@ -1,3 +1,6 @@ +/* $OpenBSD: netgroup_mkdb.c,v 1.4 1997/02/02 23:32:15 millert Exp $ */ +/* $NetBSD: netgroup_mkdb.c,v 1.6 1997/01/19 03:30:14 lukem Exp $ */ + /* * Copyright (c) 1994 Christos Zoulas * All rights reserved. @@ -29,7 +32,7 @@ * SUCH DAMAGE. */ #ifndef lint -static char *rcsid = "$Id: netgroup_mkdb.c,v 1.3 1997/01/15 23:44:08 millert Exp $"; +static char *rcsid = "$OpenBSD: netgroup_mkdb.c,v 1.4 1997/02/02 23:32:15 millert Exp $"; #endif #include @@ -44,6 +47,7 @@ static char *rcsid = "$Id: netgroup_mkdb.c,v 1.3 1997/01/15 23:44:08 millert Exp #include #include #include +#include #define _NETGROUP_PRIVATE #include #include @@ -70,7 +74,7 @@ struct nentry { static DB *ng_insert __P((DB *, const char *)); static void ng_reventry __P((DB *, DB *, struct nentry *, char *, - size_t, struct stringlist *)); + size_t, StringList *)); static void ng_print __P((struct nentry *, struct string *)); static void ng_rprint __P((DB *, struct string *)); @@ -359,7 +363,7 @@ ng_reventry(db, udb, fe, name, s, ss) struct nentry *fe; char *name; size_t s; - struct stringlist *ss; + StringList *ss; { DBT key, data; struct nentry *e; @@ -367,11 +371,11 @@ ng_reventry(db, udb, fe, name, s, ss) char *p; DB *xdb; - if (_ng_sl_find(ss, name) != NULL) { + if (sl_find(ss, name) != NULL) { warnx("Cycle in netgroup `%s'", name); return; } - _ng_sl_add(ss, name); + sl_add(ss, name); for (e = fe->n_next; e != NULL; e = e->n_next) switch (e->n_type) { @@ -438,7 +442,7 @@ ng_reverse(db, s) size_t s; { int pos; - struct stringlist *sl; + StringList *sl; DBT key, data; struct nentry *fe; DB *udb = dbopen(NULL, O_RDWR | O_CREAT | O_EXCL, 0, @@ -450,10 +454,10 @@ ng_reverse(db, s) for (pos = R_FIRST;; pos = R_NEXT) switch ((db->seq)(db, &key, &data, pos)) { case 0: - sl = _ng_sl_init(); + sl = sl_init(); memcpy(&fe, data.data, sizeof(fe)); ng_reventry(db, udb, fe, (char *) key.data, s, sl); - _ng_sl_free(sl, 0); + sl_free(sl, 0); break; case 1: -- 2.20.1