summaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.lib
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-12-18 21:53:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-12-18 21:53:35 +0000
commit55cf72374a6a0695c5f50929233d06baccf648f7 (patch)
treeed27b73215fc2d04eb4940923b41124839f62167 /usr.bin/make/lst.lib
parente4bc6799b57e2d16e3a510719ddd8e746dda9879 (diff)
NIL, NILGNODE, etc, are only glorified NULL.
Get rid of them. Get rid of list.h, nothing uses it anyway.
Diffstat (limited to 'usr.bin/make/lst.lib')
-rw-r--r--usr.bin/make/lst.lib/lstAppend.c14
-rw-r--r--usr.bin/make/lst.lib/lstConcat.c30
-rw-r--r--usr.bin/make/lst.lib/lstDatum.c10
-rw-r--r--usr.bin/make/lst.lib/lstDeQueue.c12
-rw-r--r--usr.bin/make/lst.lib/lstDestroy.c16
-rw-r--r--usr.bin/make/lst.lib/lstDupl.c18
-rw-r--r--usr.bin/make/lst.lib/lstFind.c6
-rw-r--r--usr.bin/make/lst.lib/lstFindFrom.c12
-rw-r--r--usr.bin/make/lst.lib/lstFirst.c8
-rw-r--r--usr.bin/make/lst.lib/lstForEachFrom.c6
-rw-r--r--usr.bin/make/lst.lib/lstInit.c8
-rw-r--r--usr.bin/make/lst.lib/lstInsert.c12
-rw-r--r--usr.bin/make/lst.lib/lstInt.h14
-rw-r--r--usr.bin/make/lst.lib/lstIsEmpty.c8
-rw-r--r--usr.bin/make/lst.lib/lstLast.c8
-rw-r--r--usr.bin/make/lst.lib/lstMember.c12
-rw-r--r--usr.bin/make/lst.lib/lstNext.c16
-rw-r--r--usr.bin/make/lst.lib/lstOpen.c8
-rw-r--r--usr.bin/make/lst.lib/lstRemove.c16
-rw-r--r--usr.bin/make/lst.lib/lstReplace.c6
-rw-r--r--usr.bin/make/lst.lib/lstSucc.c8
21 files changed, 122 insertions, 126 deletions
diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c
index 95f895e8cec..d96fac8dba7 100644
--- a/usr.bin/make/lst.lib/lstAppend.c
+++ b/usr.bin/make/lst.lib/lstAppend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstAppend.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */
+/* $OpenBSD: lstAppend.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstAppend.c,v 1.5 1996/11/06 17:59:31 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.5 1999/12/18 02:11:27 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.6 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -64,7 +64,7 @@ static char rcsid[] = "$OpenBSD: lstAppend.c,v 1.5 1999/12/18 02:11:27 espie Exp
* A new ListNode is created and linked in to the List. The lastPtr
* field of the List will be altered if ln is the last node in the
* list. lastPtr and firstPtr will alter if the list was empty and
- * ln was NILLNODE.
+ * ln was NULL.
*
*-----------------------------------------------------------------------
*/
@@ -78,7 +78,7 @@ Lst_Append (l, ln, d)
register ListNode lNode;
register ListNode nLNode;
- if (LstValid (l) && (ln == NILLNODE && LstIsEmpty (l))) {
+ if (LstValid (l) && (ln == NULL && LstIsEmpty (l))) {
goto ok;
}
@@ -94,15 +94,15 @@ Lst_Append (l, ln, d)
nLNode->datum = d;
nLNode->useCount = nLNode->flags = 0;
- if (lNode == NilListNode) {
- nLNode->nextPtr = nLNode->prevPtr = NilListNode;
+ if (lNode == NULL) {
+ nLNode->nextPtr = nLNode->prevPtr = NULL;
list->firstPtr = list->lastPtr = nLNode;
} else {
nLNode->prevPtr = lNode;
nLNode->nextPtr = lNode->nextPtr;
lNode->nextPtr = nLNode;
- if (nLNode->nextPtr != NilListNode) {
+ if (nLNode->nextPtr != NULL) {
nLNode->nextPtr->prevPtr = nLNode;
}
diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c
index 66803597894..88270d845df 100644
--- a/usr.bin/make/lst.lib/lstConcat.c
+++ b/usr.bin/make/lst.lib/lstConcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstConcat.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */
+/* $OpenBSD: lstConcat.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstConcat.c,v 1.6 1996/11/06 17:59:34 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstConcat.c,v 1.5 1999/12/18 02:11:27 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstConcat.c,v 1.6 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -88,16 +88,16 @@ Lst_Concat (l1, l2, flags)
}
if (flags == LST_CONCLINK) {
- if (list2->firstPtr != NilListNode) {
+ if (list2->firstPtr != NULL) {
/*
* We set the nextPtr of the
- * last element of list two to be NIL to make the loop easier and
+ * last element of list two to be NULL to make the loop easier and
* so we don't need an extra case should the first list turn
* out to be non-circular -- the final element will already point
- * to NIL space and the first element will be untouched if it
- * existed before and will also point to NIL space if it didn't.
+ * to NULL space and the first element will be untouched if it
+ * existed before and will also point to NULL space if it didn't.
*/
- list2->lastPtr->nextPtr = NilListNode;
+ list2->lastPtr->nextPtr = NULL;
/*
* So long as the second list isn't empty, we just link the
* first element of the second list to the last element of the
@@ -107,7 +107,7 @@ Lst_Concat (l1, l2, flags)
* the last element of the first list.
*/
list2->firstPtr->prevPtr = list1->lastPtr;
- if (list1->lastPtr != NilListNode) {
+ if (list1->lastPtr != NULL) {
list1->lastPtr->nextPtr = list2->firstPtr;
} else {
list1->firstPtr = list2->firstPtr;
@@ -115,27 +115,27 @@ Lst_Concat (l1, l2, flags)
list1->lastPtr = list2->lastPtr;
}
free ((Address)l2);
- } else if (list2->firstPtr != NilListNode) {
+ } else if (list2->firstPtr != NULL) {
/*
- * We set the nextPtr of the last element of list 2 to be nil to make
+ * We set the nextPtr of the last element of list 2 to be NULL to make
* the loop less difficult. The loop simply goes through the entire
* second list creating new LstNodes and filling in the nextPtr, and
* prevPtr to fit into l1 and its datum field from the
* datum field of the corresponding element in l2. The 'last' node
* follows the last of the new nodes along until the entire l2 has
* been appended. Only then does the bookkeeping catch up with the
- * changes. During the first iteration of the loop, if 'last' is nil,
+ * changes. During the first iteration of the loop, if 'last' is NULL,
* the first list must have been empty so the newly-created node is
* made the first node of the list.
*/
- list2->lastPtr->nextPtr = NilListNode;
+ list2->lastPtr->nextPtr = NULL;
for (last = list1->lastPtr, ln = list2->firstPtr;
- ln != NilListNode;
+ ln != NULL;
ln = ln->nextPtr)
{
PAlloc (nln, ListNode);
nln->datum = ln->datum;
- if (last != NilListNode) {
+ if (last != NULL) {
last->nextPtr = nln;
} else {
list1->firstPtr = nln;
@@ -151,7 +151,7 @@ Lst_Concat (l1, l2, flags)
*/
list1->lastPtr = last;
- last->nextPtr = NilListNode;
+ last->nextPtr = NULL;
list2->lastPtr->nextPtr = list2->firstPtr;
}
diff --git a/usr.bin/make/lst.lib/lstDatum.c b/usr.bin/make/lst.lib/lstDatum.c
index fbfbdcdf13c..a8b51fa0681 100644
--- a/usr.bin/make/lst.lib/lstDatum.c
+++ b/usr.bin/make/lst.lib/lstDatum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstDatum.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */
+/* $OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstDatum.c,v 1.5 1996/11/06 17:59:35 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.4 1998/12/05 00:06:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstDatum.c,v 1.4 1998/12/05 00:06:31 espie Exp
* Return the datum stored in the given node.
*
* Results:
- * The datum or (ick!) NIL if the node is invalid.
+ * The datum or (ick!) NULL if the node is invalid.
*
* Side Effects:
* None.
@@ -69,10 +69,10 @@ ClientData
Lst_Datum (ln)
LstNode ln;
{
- if (ln != NILLNODE) {
+ if (ln != NULL) {
return (((ListNode)ln)->datum);
} else {
- return ((ClientData) NIL);
+ return ((ClientData) NULL);
}
}
diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c
index a77ae583feb..89495585268 100644
--- a/usr.bin/make/lst.lib/lstDeQueue.c
+++ b/usr.bin/make/lst.lib/lstDeQueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstDeQueue.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */
+/* $OpenBSD: lstDeQueue.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstDeQueue.c,v 1.5 1996/11/06 17:59:36 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.4 1998/12/05 00:06:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstDeQueue.c,v 1.4 1998/12/05 00:06:31 espie Ex
* Remove and return the datum at the head of the given list.
*
* Results:
- * The datum in the node at the head or (ick) NIL if the list
+ * The datum in the node at the head or (ick) NULL if the list
* is empty.
*
* Side Effects:
@@ -74,13 +74,13 @@ Lst_DeQueue (l)
register ListNode tln;
tln = (ListNode) Lst_First (l);
- if (tln == NilListNode) {
- return ((ClientData) NIL);
+ if (tln == NULL) {
+ return ((ClientData) NULL);
}
rd = tln->datum;
if (Lst_Remove (l, (LstNode)tln) == FAILURE) {
- return ((ClientData) NIL);
+ return ((ClientData) NULL);
} else {
return (rd);
}
diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c
index 0b63720645c..4625656e3c3 100644
--- a/usr.bin/make/lst.lib/lstDestroy.c
+++ b/usr.bin/make/lst.lib/lstDestroy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstDestroy.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */
+/* $OpenBSD: lstDestroy.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstDestroy.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDestroy.c,v 1.4 1998/12/05 00:06:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDestroy.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -73,10 +73,10 @@ Lst_Destroy (l, freeProc)
register void (*freeProc) __P((ClientData));
{
register ListNode ln;
- register ListNode tln = NilListNode;
+ register ListNode tln = NULL;
register List list = (List)l;
- if (l == NILLST || ! l) {
+ if (l == NULL) {
/*
* Note the check for l == (Lst)0 to catch uninitialized static Lst's.
* Gross, but useful.
@@ -85,21 +85,21 @@ Lst_Destroy (l, freeProc)
}
/* To ease scanning */
- if (list->lastPtr != NilListNode)
- list->lastPtr->nextPtr = NilListNode;
+ if (list->lastPtr != NULL)
+ list->lastPtr->nextPtr = NULL;
else {
free ((Address)l);
return;
}
if (freeProc) {
- for (ln = list->firstPtr; ln != NilListNode; ln = tln) {
+ for (ln = list->firstPtr; ln != NULL; ln = tln) {
tln = ln->nextPtr;
(*freeProc) (ln->datum);
free ((Address)ln);
}
} else {
- for (ln = list->firstPtr; ln != NilListNode; ln = tln) {
+ for (ln = list->firstPtr; ln != NULL; ln = tln) {
tln = ln->nextPtr;
free ((Address)ln);
}
diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c
index e91abf77383..e21b71148c8 100644
--- a/usr.bin/make/lst.lib/lstDupl.c
+++ b/usr.bin/make/lst.lib/lstDupl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstDupl.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */
+/* $OpenBSD: lstDupl.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstDupl.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.5 1999/12/18 02:11:27 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.6 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -60,7 +60,7 @@ static char rcsid[] = "$OpenBSD: lstDupl.c,v 1.5 1999/12/18 02:11:27 espie Exp $
* given, the individual client elements will be duplicated as well.
*
* Results:
- * The new Lst structure or NILLST if failure.
+ * The new Lst structure or NULL if failure.
*
* Side Effects:
* A new list is created.
@@ -77,22 +77,22 @@ Lst_Duplicate (l, copyProc)
register List list = (List)l;
if (!LstValid (l)) {
- return (NILLST);
+ return (NULL);
}
nl = Lst_Init();
- if (nl == NILLST) {
- return (NILLST);
+ if (nl == NULL) {
+ return (NULL);
}
ln = list->firstPtr;
- while (ln != NilListNode) {
+ while (ln != NULL) {
if (copyProc != NOCOPY) {
if (Lst_AtEnd (nl, (*copyProc) (ln->datum)) == FAILURE) {
- return (NILLST);
+ return (NULL);
}
} else if (Lst_AtEnd (nl, ln->datum) == FAILURE) {
- return (NILLST);
+ return (NULL);
}
ln = ln->nextPtr;
diff --git a/usr.bin/make/lst.lib/lstFind.c b/usr.bin/make/lst.lib/lstFind.c
index 2b0a9e0cc38..814564c9b8a 100644
--- a/usr.bin/make/lst.lib/lstFind.c
+++ b/usr.bin/make/lst.lib/lstFind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstFind.c,v 1.4 1998/12/05 00:06:31 espie Exp $ */
+/* $OpenBSD: lstFind.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstFind.c,v 1.6 1996/11/06 17:59:39 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstFind.c,v 1.4 1998/12/05 00:06:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstFind.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ static char rcsid[] = "$OpenBSD: lstFind.c,v 1.4 1998/12/05 00:06:31 espie Exp $
* and the given datum.
*
* Results:
- * The found node or NILLNODE if none matches.
+ * The found node or NULL if none matches.
*
* Side Effects:
* None.
diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c
index 38a9aebc949..ba033c291fa 100644
--- a/usr.bin/make/lst.lib/lstFindFrom.c
+++ b/usr.bin/make/lst.lib/lstFindFrom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstFindFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstFindFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstFindFrom.c,v 1.6 1996/11/06 17:59:40 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -60,7 +60,7 @@ static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.4 1998/12/05 00:06:32 espie Ex
* determine when it has been found.
*
* Results:
- * The found node or NILLNODE
+ * The found node or NULL
*
* Side Effects:
* None.
@@ -78,7 +78,7 @@ Lst_FindFrom (l, ln, d, cProc)
Boolean found = FALSE;
if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) {
- return (NILLNODE);
+ return (NULL);
}
tln = (ListNode)ln;
@@ -90,12 +90,12 @@ Lst_FindFrom (l, ln, d, cProc)
} else {
tln = tln->nextPtr;
}
- } while (tln != (ListNode)ln && tln != NilListNode);
+ } while (tln != (ListNode)ln && tln != NULL);
if (found) {
return ((LstNode)tln);
} else {
- return (NILLNODE);
+ return (NULL);
}
}
diff --git a/usr.bin/make/lst.lib/lstFirst.c b/usr.bin/make/lst.lib/lstFirst.c
index 37d13a5b706..c0d6a4611d0 100644
--- a/usr.bin/make/lst.lib/lstFirst.c
+++ b/usr.bin/make/lst.lib/lstFirst.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstFirst.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstFirst.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstFirst.c,v 1.5 1996/11/06 17:59:41 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstFirst.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstFirst.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstFirst.c,v 1.4 1998/12/05 00:06:32 espie Exp
* Return the first node on the given list.
*
* Results:
- * The first node or NILLNODE if the list is empty.
+ * The first node or NULL if the list is empty.
*
* Side Effects:
* None.
@@ -70,7 +70,7 @@ Lst_First (l)
Lst l;
{
if (!LstValid (l) || LstIsEmpty (l)) {
- return (NILLNODE);
+ return (NULL);
} else {
return ((LstNode)((List)l)->firstPtr);
}
diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c
index 12ae71acce3..5fe2dc3ec9b 100644
--- a/usr.bin/make/lst.lib/lstForEachFrom.c
+++ b/usr.bin/make/lst.lib/lstForEachFrom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstForEachFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstForEachFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstForEachFrom.c,v 1.5 1996/11/06 17:59:42 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstForEachFrom.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -105,7 +105,7 @@ Lst_ForEachFrom (l, ln, proc, d)
* doesn't exist.
*/
done = (next == tln->nextPtr &&
- (next == NilListNode || next == list->firstPtr));
+ (next == NULL || next == list->firstPtr));
next = tln->nextPtr;
diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c
index 0be8d012920..89ac9b3d6d5 100644
--- a/usr.bin/make/lst.lib/lstInit.c
+++ b/usr.bin/make/lst.lib/lstInit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstInit.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */
+/* $OpenBSD: lstInit.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstInit.c,v 1.5 1996/11/06 17:59:43 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstInit.c,v 1.5 1999/12/18 02:11:27 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstInit.c,v 1.6 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -72,8 +72,8 @@ Lst_Init()
PAlloc (nList, List);
- nList->firstPtr = NilListNode;
- nList->lastPtr = NilListNode;
+ nList->firstPtr = NULL;
+ nList->lastPtr = NULL;
nList->isOpen = FALSE;
nList->atEnd = Unknown;
diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c
index 5a32422de91..d81be7e2b18 100644
--- a/usr.bin/make/lst.lib/lstInsert.c
+++ b/usr.bin/make/lst.lib/lstInsert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstInsert.c,v 1.5 1999/12/18 02:11:27 espie Exp $ */
+/* $OpenBSD: lstInsert.c,v 1.6 1999/12/18 21:53:33 espie Exp $ */
/* $NetBSD: lstInsert.c,v 1.5 1996/11/06 17:59:44 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstInsert.c,v 1.5 1999/12/18 02:11:27 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstInsert.c,v 1.6 1999/12/18 21:53:33 espie Exp $";
#endif
#endif /* not lint */
@@ -81,7 +81,7 @@ Lst_Insert (l, ln, d)
/*
* check validity of arguments
*/
- if (LstValid (l) && (LstIsEmpty (l) && ln == NILLNODE))
+ if (LstValid (l) && (LstIsEmpty (l) && ln == NULL))
goto ok;
if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) {
@@ -94,14 +94,14 @@ Lst_Insert (l, ln, d)
nLNode->datum = d;
nLNode->useCount = nLNode->flags = 0;
- if (ln == NILLNODE) {
- nLNode->prevPtr = nLNode->nextPtr = NilListNode;
+ if (ln == NULL) {
+ nLNode->prevPtr = nLNode->nextPtr = NULL;
list->firstPtr = list->lastPtr = nLNode;
} else {
nLNode->prevPtr = lNode->prevPtr;
nLNode->nextPtr = lNode;
- if (nLNode->prevPtr != NilListNode) {
+ if (nLNode->prevPtr != NULL) {
nLNode->prevPtr->nextPtr = nLNode;
}
lNode->prevPtr = nLNode;
diff --git a/usr.bin/make/lst.lib/lstInt.h b/usr.bin/make/lst.lib/lstInt.h
index d2ce8155e49..d1033808117 100644
--- a/usr.bin/make/lst.lib/lstInt.h
+++ b/usr.bin/make/lst.lib/lstInt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstInt.h,v 1.7 1999/12/18 02:11:28 espie Exp $ */
+/* $OpenBSD: lstInt.h,v 1.8 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstInt.h,v 1.7 1996/11/06 17:59:44 christos Exp $ */
/*
@@ -63,8 +63,6 @@ typedef struct ListNode {
*/
#define LN_DELETED 0x0001 /* List node should be removed when done */
-#define NilListNode ((ListNode)-1)
-
typedef enum {
Head, Middle, Tail, Unknown
} Where;
@@ -77,14 +75,12 @@ typedef struct {
*/
Where atEnd; /* Where in the list the last access was */
Boolean isOpen; /* true if list has been Lst_Open'ed */
- ListNode curPtr; /* current node, if open. NilListNode if
+ ListNode curPtr; /* current node, if open. NULL if
* *just* opened */
ListNode prevPtr; /* Previous node, if open. Used by
* Lst_Remove */
} *List;
-#define NilList ((List)-1)
-
/*
* PAlloc (var, ptype) --
* Allocate a pointer-typedef structure 'ptype' into the variable 'var'
@@ -95,18 +91,18 @@ typedef struct {
* LstValid (l) --
* Return TRUE if the list l is valid
*/
-#define LstValid(l) (((Lst)l == NILLST) ? FALSE : TRUE)
+#define LstValid(l) ((l) == NULL ? FALSE : TRUE)
/*
* LstNodeValid (ln, l) --
* Return TRUE if the LstNode ln is valid with respect to l
*/
-#define LstNodeValid(ln, l) ((((LstNode)ln) == NILLNODE) ? FALSE : TRUE)
+#define LstNodeValid(ln, l) ((ln) == NULL ? FALSE : TRUE)
/*
* LstIsEmpty (l) --
* TRUE if the list l is empty.
*/
-#define LstIsEmpty(l) (((List)l)->firstPtr == NilListNode)
+#define LstIsEmpty(l) (((List)l)->firstPtr == NULL)
#endif /* _LSTINT_H_ */
diff --git a/usr.bin/make/lst.lib/lstIsEmpty.c b/usr.bin/make/lst.lib/lstIsEmpty.c
index aabec4e5978..2ff56351ee2 100644
--- a/usr.bin/make/lst.lib/lstIsEmpty.c
+++ b/usr.bin/make/lst.lib/lstIsEmpty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstIsEmpty.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstIsEmpty.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstIsEmpty.c,v 1.5 1996/11/06 17:59:47 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -63,8 +63,8 @@ static char rcsid[] = "$OpenBSD: lstIsEmpty.c,v 1.4 1998/12/05 00:06:32 espie Ex
* Side Effects:
* None.
*
- * A list is considered empty if its firstPtr == NilListNode (or if
- * the list itself is NILLIST).
+ * A list is considered empty if its firstPtr == NULL (or if
+ * the list itself is NULL).
*-----------------------------------------------------------------------
*/
Boolean
diff --git a/usr.bin/make/lst.lib/lstLast.c b/usr.bin/make/lst.lib/lstLast.c
index 6c4e9b5cf5a..e824fdf7399 100644
--- a/usr.bin/make/lst.lib/lstLast.c
+++ b/usr.bin/make/lst.lib/lstLast.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstLast.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstLast.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstLast.c,v 1.5 1996/11/06 17:59:48 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstLast.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstLast.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ static char rcsid[] = "$OpenBSD: lstLast.c,v 1.4 1998/12/05 00:06:32 espie Exp $
* Return the last node on the list l.
*
* Results:
- * The requested node or NILLNODE if the list is empty.
+ * The requested node or NULL if the list is empty.
*
* Side Effects:
* None.
@@ -70,7 +70,7 @@ Lst_Last (l)
Lst l;
{
if (!LstValid(l) || LstIsEmpty (l)) {
- return (NILLNODE);
+ return (NULL);
} else {
return ((LstNode)((List)l)->lastPtr);
}
diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c
index af8eb15354c..0cbed448fcf 100644
--- a/usr.bin/make/lst.lib/lstMember.c
+++ b/usr.bin/make/lst.lib/lstMember.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstMember.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstMember.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstMember.c,v 1.5 1996/11/06 17:59:48 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstMember.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstMember.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -61,8 +61,8 @@ Lst_Member (l, d)
register ListNode lNode;
lNode = list->firstPtr;
- if (lNode == NilListNode) {
- return NILLNODE;
+ if (lNode == NULL) {
+ return NULL;
}
do {
@@ -70,7 +70,7 @@ Lst_Member (l, d)
return (LstNode)lNode;
}
lNode = lNode->nextPtr;
- } while (lNode != NilListNode && lNode != list->firstPtr);
+ } while (lNode != NULL && lNode != list->firstPtr);
- return NILLNODE;
+ return NULL;
}
diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c
index db43d37164e..52d76636659 100644
--- a/usr.bin/make/lst.lib/lstNext.c
+++ b/usr.bin/make/lst.lib/lstNext.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstNext.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstNext.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstNext.c,v 1.5 1996/11/06 17:59:49 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstNext.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstNext.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -63,8 +63,8 @@ static char rcsid[] = "$OpenBSD: lstNext.c,v 1.4 1998/12/05 00:06:32 espie Exp $
* Return the next node for the given list.
*
* Results:
- * The next node or NILLNODE if the list has yet to be opened. Also
- * if the list is non-circular and the end has been reached, NILLNODE
+ * The next node or NULL if the list has yet to be opened. Also
+ * if the list is non-circular and the end has been reached, NULL
* is returned.
*
* Side Effects:
@@ -81,12 +81,12 @@ Lst_Next (l)
if ((LstValid (l) == FALSE) ||
(list->isOpen == FALSE)) {
- return (NILLNODE);
+ return (NULL);
}
list->prevPtr = list->curPtr;
- if (list->curPtr == NilListNode) {
+ if (list->curPtr == NULL) {
if (list->atEnd == Unknown) {
/*
* If we're just starting out, atEnd will be Unknown.
@@ -96,14 +96,14 @@ Lst_Next (l)
list->curPtr = tln = list->firstPtr;
list->atEnd = Middle;
} else {
- tln = NilListNode;
+ tln = NULL;
list->atEnd = Tail;
}
} else {
tln = list->curPtr->nextPtr;
list->curPtr = tln;
- if (tln == list->firstPtr || tln == NilListNode) {
+ if (tln == list->firstPtr || tln == NULL) {
/*
* If back at the front, then we've hit the end...
*/
diff --git a/usr.bin/make/lst.lib/lstOpen.c b/usr.bin/make/lst.lib/lstOpen.c
index 72a89642618..6434f4ace48 100644
--- a/usr.bin/make/lst.lib/lstOpen.c
+++ b/usr.bin/make/lst.lib/lstOpen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstOpen.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstOpen.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstOpen.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -66,7 +66,7 @@ static char rcsid[] = "$OpenBSD: lstOpen.c,v 1.4 1998/12/05 00:06:32 espie Exp $
* SUCCESS or FAILURE.
*
* Side Effects:
- * isOpen is set TRUE and curPtr is set to NilListNode so the
+ * isOpen is set TRUE and curPtr is set to NULL so the
* other sequential functions no it was just opened and can choose
* the first element accessed based on this.
*
@@ -81,7 +81,7 @@ Lst_Open (l)
}
((List) l)->isOpen = TRUE;
((List) l)->atEnd = LstIsEmpty (l) ? Head : Unknown;
- ((List) l)->curPtr = NilListNode;
+ ((List) l)->curPtr = NULL;
return (SUCCESS);
}
diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c
index 5f54142ed5f..b44c09334ea 100644
--- a/usr.bin/make/lst.lib/lstRemove.c
+++ b/usr.bin/make/lst.lib/lstRemove.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstRemove.c,v 1.4 1998/12/05 00:06:32 espie Exp $ */
+/* $OpenBSD: lstRemove.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstRemove.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.4 1998/12/05 00:06:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -61,7 +61,7 @@ static char rcsid[] = "$OpenBSD: lstRemove.c,v 1.4 1998/12/05 00:06:32 espie Exp
* SUCCESS or FAILURE.
*
* Side Effects:
- * The list's firstPtr will be set to NilListNode if ln is the last
+ * The list's firstPtr will be set to NULL if ln is the last
* node on the list. firsPtr and lastPtr will be altered if ln is
* either the first or last node, respectively, on the list.
*
@@ -83,10 +83,10 @@ Lst_Remove (l, ln)
/*
* unlink it from the list
*/
- if (lNode->nextPtr != NilListNode) {
+ if (lNode->nextPtr != NULL) {
lNode->nextPtr->prevPtr = lNode->prevPtr;
}
- if (lNode->prevPtr != NilListNode) {
+ if (lNode->prevPtr != NULL) {
lNode->prevPtr->nextPtr = lNode->nextPtr;
}
@@ -104,12 +104,12 @@ Lst_Remove (l, ln)
/*
* Sequential access stuff. If the node we're removing is the current
* node in the list, reset the current node to the previous one. If the
- * previous one was non-existent (prevPtr == NilListNode), we set the
+ * previous one was non-existent (prevPtr == NULL), we set the
* end to be Unknown, since it is.
*/
if (list->isOpen && (list->curPtr == lNode)) {
list->curPtr = list->prevPtr;
- if (list->curPtr == NilListNode) {
+ if (list->curPtr == NULL) {
list->atEnd = Unknown;
}
}
@@ -120,7 +120,7 @@ Lst_Remove (l, ln)
* this case). The list is, therefore, empty and is marked as such
*/
if (list->firstPtr == lNode) {
- list->firstPtr = NilListNode;
+ list->firstPtr = NULL;
}
/*
diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c
index 178f42822b4..467fffe486b 100644
--- a/usr.bin/make/lst.lib/lstReplace.c
+++ b/usr.bin/make/lst.lib/lstReplace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstReplace.c,v 1.4 1998/12/05 00:06:33 espie Exp $ */
+/* $OpenBSD: lstReplace.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstReplace.c,v 1.5 1996/11/06 17:59:51 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstReplace.c,v 1.4 1998/12/05 00:06:33 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstReplace.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -70,7 +70,7 @@ Lst_Replace (ln, d)
register LstNode ln;
ClientData d;
{
- if (ln == NILLNODE) {
+ if (ln == NULL) {
return (FAILURE);
} else {
((ListNode) ln)->datum = d;
diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c
index 089382e56be..31f09a0302d 100644
--- a/usr.bin/make/lst.lib/lstSucc.c
+++ b/usr.bin/make/lst.lib/lstSucc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstSucc.c,v 1.4 1998/12/05 00:06:33 espie Exp $ */
+/* $OpenBSD: lstSucc.c,v 1.5 1999/12/18 21:53:34 espie Exp $ */
/* $NetBSD: lstSucc.c,v 1.5 1996/11/06 17:59:52 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstSucc.c,v 1.4 1998/12/05 00:06:33 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstSucc.c,v 1.5 1999/12/18 21:53:34 espie Exp $";
#endif
#endif /* not lint */
@@ -71,8 +71,8 @@ LstNode
Lst_Succ (ln)
LstNode ln;
{
- if (ln == NILLNODE) {
- return (NILLNODE);
+ if (ln == NULL) {
+ return (NULL);
} else {
return ((LstNode) ((ListNode) ln)->nextPtr);
}