diff options
author | jkh <jkh@FreeBSD.org> | 1994-05-25 06:27:24 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1994-05-25 06:27:24 +0000 |
commit | 066a73bf853775c28ff75acb5b135a2a3fb0a897 (patch) | |
tree | 93c4484bf6172e4fa095c7be3d391f0c93b0922f | |
parent | 50de4f0fe3642024ca5388420530632a99e80ecd (diff) | |
download | FreeBSD-src-066a73bf853775c28ff75acb5b135a2a3fb0a897.zip FreeBSD-src-066a73bf853775c28ff75acb5b135a2a3fb0a897.tar.gz |
Add new find_plist() function.
-rw-r--r-- | usr.sbin/pkg_install/lib/lib.h | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/plist.c | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h index 4796f85..7acf8ed 100644 --- a/usr.sbin/pkg_install/lib/lib.h +++ b/usr.sbin/pkg_install/lib/lib.h @@ -1,4 +1,4 @@ -/* $Id: lib.h,v 1.4 1993/09/18 03:39:49 jkh Exp $ */ +/* $Id: lib.h,v 1.5 1994/04/05 14:08:46 jkh Exp $ */ /* * FreeBSD install - a package for the installation and maintainance @@ -129,7 +129,7 @@ Boolean y_or_n(Boolean, const char *, ...); /* Packing list */ PackingList new_plist_entry(void); PackingList last_plist(Package *); -Boolean in_plist(Package *, plist_t); +PackingList find_plist(Package *, plist_t); void plist_delete(Package *, Boolean, plist_t, char *); void free_plist(Package *); void mark_plist(Package *); diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c index 6c54e66..eb8dee8 100644 --- a/usr.sbin/pkg_install/lib/plist.c +++ b/usr.sbin/pkg_install/lib/plist.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: plist.c,v 1.4 1993/09/12 20:45:53 jkh Exp $"; +static const char *rcsid = "$Id: plist.c,v 1.5 1993/09/18 03:39:50 jkh Exp $"; #endif /* @@ -80,20 +80,20 @@ mark_plist(Package *pkg) } } -/* Return whether or not there is an item of 'type' in the list */ -Boolean -in_plist(Package *pkg, plist_t type) +/* Find a given item in a packing list and, if so, return it (else NULL) */ +PackingList +find_plist(Package *pkg, plist_t type) { PackingList p = pkg->head; while (p) { if (p->type == type) - return TRUE; + return p; p = p->next; } - return FALSE; + return NULL; } - + /* * Delete plist item 'type' in the list (if 'name' is non-null, match it * too.) If 'all' is set, delete all items, not just the first occurance. |