summaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-06-23 16:15:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-06-23 16:15:52 +0000
commit6d5c836a14118d8966a373381cc9baffc8053b05 (patch)
treea64365d82a4d9ae12d63957ef82c7fa9f7cba8fe /usr.bin/make/lst.h
parentf2ea075bfec3d7ed2a75e88eb97d7601030791f5 (diff)
Trivial consequences of the previous list changes:
- audit code for Lst_Datum, it's never applied to an empty pointer, so check can be removed -> turn into a macro, - Lst_First, Lst_Last can become macro as well - specialized version of Lst_Succ (Lst_Adv) to use in loops where it cannot fail, - Lst_Open can no longer fail. Trim down corresponding code. Reviewed millert@, miod@
Diffstat (limited to 'usr.bin/make/lst.h')
-rw-r--r--usr.bin/make/lst.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h
index 7ed98129a65..12c6cd92202 100644
--- a/usr.bin/make/lst.h
+++ b/usr.bin/make/lst.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lst.h,v 1.16 2000/06/17 14:43:36 espie Exp $ */
+/* $OpenBSD: lst.h,v 1.17 2000/06/23 16:15:49 espie Exp $ */
/* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */
/*
@@ -141,13 +141,15 @@ void Lst_Concat __P((Lst, Lst));
* Node-specific functions
*/
/* Return first element in list */
-LstNode Lst_First __P((Lst));
+#define Lst_First(l) ((l)->firstPtr)
/* Return last element in list */
-LstNode Lst_Last __P((Lst));
+#define Lst_Last(l) ((l)->lastPtr)
/* Return successor to given element */
LstNode Lst_Succ __P((LstNode));
+/* Return successor to existing element */
+#define Lst_Adv(ln) ((ln)->nextPtr)
/* Get datum from LstNode */
-void * Lst_Datum __P((LstNode));
+#define Lst_Datum(ln) ((ln)->datum)
/*
* Functions for entire lists
@@ -178,7 +180,7 @@ LstNode Lst_Member __P((Lst, void *));
* between Lst_Open() and Lst_Close().
*/
/* Open the list */
-ReturnStatus Lst_Open __P((Lst));
+void Lst_Open __P((Lst));
/* Next element please */
LstNode Lst_Next __P((Lst));
/* Done yet? */