summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/lst.h
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-03-22 12:40:24 +0000
committerharti <harti@FreeBSD.org>2005-03-22 12:40:24 +0000
commitd00a9bb878ce962b2c776f964d33da7de1d5794f (patch)
tree93703839b233ce8518ae1fed2a06c76f184e848f /usr.bin/make/lst.h
parent08bf05ebc055444257dc884ae58aae47bc7c4578 (diff)
downloadFreeBSD-src-d00a9bb878ce962b2c776f964d33da7de1d5794f.zip
FreeBSD-src-d00a9bb878ce962b2c776f964d33da7de1d5794f.tar.gz
Remove Lst_Find() and Lst_FindFrom() now that they aren't needed anymore.
Diffstat (limited to 'usr.bin/make/lst.h')
-rw-r--r--usr.bin/make/lst.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h
index a81e09c..736031f 100644
--- a/usr.bin/make/lst.h
+++ b/usr.bin/make/lst.h
@@ -69,7 +69,6 @@ struct Lst {
};
typedef struct Lst Lst;
-typedef int CompareProc(const void *, const void *);
typedef void *DuplicateProc(void *);
typedef void FreeProc(void *);
@@ -137,10 +136,7 @@ void Lst_Concat(Lst *, Lst *, int);
/*
* Functions for entire lists
*/
-/* Find an element in a list */
-#define Lst_Find(LST, D, FN) (Lst_FindFrom((LST), Lst_First(LST), (D), (FN)))
-/* Find an element starting from somewhere */
-LstNode *Lst_FindFrom(Lst *, LstNode *, const void *, CompareProc *);
+
/*
* See if the given datum is on the list. Returns the LstNode containing
* the datum
@@ -148,8 +144,15 @@ LstNode *Lst_FindFrom(Lst *, LstNode *, const void *, CompareProc *);
LstNode *Lst_Member(Lst *, void *);
/* Loop through a list. Note, that you may not delete the list element. */
+/*
#define LST_FOREACH(PTR, LST) \
for ((PTR) = (LST)->firstPtr; (PTR) != NULL; (PTR) = (PTR)->nextPtr)
+*/
+#define LST_FOREACH(PTR, LST) \
+ for (LstNode *_tmp1 = (LST)->firstPtr, *_tmp2 = Lst_Succ(_tmp1);\
+ ((PTR) = _tmp1) != NULL; \
+ (Lst_Succ(_tmp1) != _tmp2 ? abort() : (void)0), \
+ (_tmp1 = _tmp2), _tmp2 = Lst_Succ(_tmp1))
/*
* for using the list as a queue
OpenPOWER on IntegriCloud