summaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-01-04 17:55:36 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-01-04 17:55:36 +0000
commit45fb3a386813e8f12d372141747d24ba09a32657 (patch)
treee45a65ac5bf4e05c7cfd9892873722ef59e9636a /usr.bin/make/lst.h
parentdeb608b55212d1d748b2fc1e22ebb1207cf73810 (diff)
having a function that iterates through node's datum so that we retrieve
the list item with lst_member is non-sensical, create a new function (Lst_ForEachNodeWhile) that iterates through lstnodes directly and use it. Less obfuscated, slightly more efficient... okay otto@
Diffstat (limited to 'usr.bin/make/lst.h')
-rw-r--r--usr.bin/make/lst.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h
index 6e1af60b989..53d8d098310 100644
--- a/usr.bin/make/lst.h
+++ b/usr.bin/make/lst.h
@@ -2,7 +2,7 @@
#define _LST_H_
/* $OpenPackages$ */
-/* $OpenBSD: lst.h,v 1.25 2003/06/03 02:56:11 millert Exp $ */
+/* $OpenBSD: lst.h,v 1.26 2007/01/04 17:55:35 espie Exp $ */
/* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */
/*
@@ -61,6 +61,7 @@ struct ListNode_ {
typedef void (*SimpleProc)(void *);
typedef int (*FindProc)(void *, void *);
+typedef int (*ForEachNodeWhileProc)(LstNode, void *);
typedef int (*FindProcConst)(void *, const void *);
typedef void (*ForEachProc)(void *, void *);
typedef void *(*DuplicateProc)(void *);
@@ -128,6 +129,8 @@ extern LstNode Lst_Member(Lst, void *);
extern void Lst_ForEachFrom(LstNode, ForEachProc, void *);
extern void Lst_Every(Lst, SimpleProc);
+extern void Lst_ForEachNodeWhile(Lst, ForEachNodeWhileProc, void *);
+
extern bool Lst_AddNew(Lst, void *);
/*
* for using the list as a queue