1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-12 09:58:36 +00:00

Add new find_plist() function.

This commit is contained in:
Jordan K. Hubbard 1994-05-25 06:27:24 +00:00
parent b6532a528a
commit 4e8667ba2c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1547
2 changed files with 9 additions and 9 deletions

View File

@ -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 *);

View File

@ -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.