summaryrefslogtreecommitdiff
path: root/devel/bmake/files/lst.lib
diff options
context:
space:
mode:
Diffstat (limited to 'devel/bmake/files/lst.lib')
-rw-r--r--devel/bmake/files/lst.lib/lstAppend.c18
-rw-r--r--devel/bmake/files/lst.lib/lstAtEnd.c8
-rw-r--r--devel/bmake/files/lst.lib/lstAtFront.c8
-rw-r--r--devel/bmake/files/lst.lib/lstConcat.c24
-rw-r--r--devel/bmake/files/lst.lib/lstDatum.c14
-rw-r--r--devel/bmake/files/lst.lib/lstDeQueue.c18
-rw-r--r--devel/bmake/files/lst.lib/lstDestroy.c30
-rw-r--r--devel/bmake/files/lst.lib/lstDupl.c28
-rw-r--r--devel/bmake/files/lst.lib/lstEnQueue.c8
-rw-r--r--devel/bmake/files/lst.lib/lstFind.c10
-rw-r--r--devel/bmake/files/lst.lib/lstFindFrom.c32
-rw-r--r--devel/bmake/files/lst.lib/lstFirst.c10
-rw-r--r--devel/bmake/files/lst.lib/lstForEach.c8
-rw-r--r--devel/bmake/files/lst.lib/lstForEachFrom.c12
-rw-r--r--devel/bmake/files/lst.lib/lstInit.c10
-rw-r--r--devel/bmake/files/lst.lib/lstInsert.c16
-rw-r--r--devel/bmake/files/lst.lib/lstInt.h18
-rw-r--r--devel/bmake/files/lst.lib/lstIsEmpty.c10
-rw-r--r--devel/bmake/files/lst.lib/lstLast.c10
-rw-r--r--devel/bmake/files/lst.lib/lstMember.c16
-rw-r--r--devel/bmake/files/lst.lib/lstNext.c18
-rw-r--r--devel/bmake/files/lst.lib/lstOpen.c10
-rw-r--r--devel/bmake/files/lst.lib/lstRemove.c18
-rw-r--r--devel/bmake/files/lst.lib/lstReplace.c10
-rw-r--r--devel/bmake/files/lst.lib/lstSucc.c10
25 files changed, 178 insertions, 196 deletions
diff --git a/devel/bmake/files/lst.lib/lstAppend.c b/devel/bmake/files/lst.lib/lstAppend.c
index 6249ce751ae..910c328d4f8 100644
--- a/devel/bmake/files/lst.lib/lstAppend.c
+++ b/devel/bmake/files/lst.lib/lstAppend.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstAppend.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAppend.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstAppend.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -69,18 +69,18 @@ __RCSID("$NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg 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.
*
*-----------------------------------------------------------------------
*/
ReturnStatus
-Lst_InsertAfter(Lst l, LstNode ln, ClientData d)
+Lst_InsertAfter(Lst l, LstNode ln, void *d)
{
List list;
ListNode lNode;
ListNode nLNode;
- if (LstValid (l) && (ln == NILLNODE && LstIsEmpty (l))) {
+ if (LstValid (l) && (ln == NULL && LstIsEmpty (l))) {
goto ok;
}
@@ -96,11 +96,11 @@ Lst_InsertAfter(Lst l, LstNode ln, ClientData d)
nLNode->datum = d;
nLNode->useCount = nLNode->flags = 0;
- if (lNode == NilListNode) {
+ if (lNode == NULL) {
if (list->isCirc) {
nLNode->nextPtr = nLNode->prevPtr = nLNode;
} else {
- nLNode->nextPtr = nLNode->prevPtr = NilListNode;
+ nLNode->nextPtr = nLNode->prevPtr = NULL;
}
list->firstPtr = list->lastPtr = nLNode;
} else {
@@ -108,7 +108,7 @@ Lst_InsertAfter(Lst l, LstNode ln, ClientData d)
nLNode->nextPtr = lNode->nextPtr;
lNode->nextPtr = nLNode;
- if (nLNode->nextPtr != NilListNode) {
+ if (nLNode->nextPtr != NULL) {
nLNode->nextPtr->prevPtr = nLNode;
}
diff --git a/devel/bmake/files/lst.lib/lstAtEnd.c b/devel/bmake/files/lst.lib/lstAtEnd.c
index a0b0eed50bb..675274f91af 100644
--- a/devel/bmake/files/lst.lib/lstAtEnd.c
+++ b/devel/bmake/files/lst.lib/lstAtEnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstAtEnd.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstAtEnd.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -70,7 +70,7 @@ __RCSID("$NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
ReturnStatus
-Lst_AtEnd(Lst l, ClientData d)
+Lst_AtEnd(Lst l, void *d)
{
LstNode end;
diff --git a/devel/bmake/files/lst.lib/lstAtFront.c b/devel/bmake/files/lst.lib/lstAtFront.c
index 4b3b2198d8c..5dec59f5df4 100644
--- a/devel/bmake/files/lst.lib/lstAtFront.c
+++ b/devel/bmake/files/lst.lib/lstAtFront.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstAtFront.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstAtFront.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -67,7 +67,7 @@ __RCSID("$NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
ReturnStatus
-Lst_AtFront(Lst l, ClientData d)
+Lst_AtFront(Lst l, void *d)
{
LstNode front;
diff --git a/devel/bmake/files/lst.lib/lstConcat.c b/devel/bmake/files/lst.lib/lstConcat.c
index a72f1463e78..f27ff4aa57b 100644
--- a/devel/bmake/files/lst.lib/lstConcat.c
+++ b/devel/bmake/files/lst.lib/lstConcat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstConcat.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstConcat.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstConcat.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstConcat.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstConcat.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstConcat.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -90,7 +90,7 @@ Lst_Concat(Lst l1, Lst l2, int 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
@@ -99,7 +99,7 @@ Lst_Concat(Lst l1, Lst l2, int flags)
* 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.
*/
- 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
@@ -109,14 +109,14 @@ Lst_Concat(Lst l1, Lst l2, int 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;
}
list1->lastPtr = list2->lastPtr;
}
- if (list1->isCirc && list1->firstPtr != NilListNode) {
+ if (list1->isCirc && list1->firstPtr != NULL) {
/*
* If the first list is supposed to be circular and it is (now)
* non-empty, we must make sure it's circular by linking the
@@ -126,7 +126,7 @@ Lst_Concat(Lst l1, Lst l2, int flags)
list1->lastPtr->nextPtr = list1->firstPtr;
}
free(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
* the loop less difficult. The loop simply goes through the entire
@@ -139,14 +139,14 @@ Lst_Concat(Lst l1, Lst l2, int flags)
* 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;
@@ -172,7 +172,7 @@ Lst_Concat(Lst l1, Lst l2, int flags)
list1->lastPtr->nextPtr = list1->firstPtr;
list1->firstPtr->prevPtr = list1->lastPtr;
} else {
- last->nextPtr = NilListNode;
+ last->nextPtr = NULL;
}
if (list2->isCirc) {
diff --git a/devel/bmake/files/lst.lib/lstDatum.c b/devel/bmake/files/lst.lib/lstDatum.c
index 25b3b54384a..4d327319bd5 100644
--- a/devel/bmake/files/lst.lib/lstDatum.c
+++ b/devel/bmake/files/lst.lib/lstDatum.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstDatum.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDatum.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstDatum.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -58,20 +58,20 @@ __RCSID("$NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
* Return the datum stored in the given node.
*
* Results:
- * The datum or (ick!) NIL if the node is invalid.
+ * The datum or NULL if the node is invalid.
*
* Side Effects:
* None.
*
*-----------------------------------------------------------------------
*/
-ClientData
+void *
Lst_Datum(LstNode ln)
{
- if (ln != NILLNODE) {
+ if (ln != NULL) {
return ((ln)->datum);
} else {
- return ((ClientData) NIL);
+ return NULL;
}
}
diff --git a/devel/bmake/files/lst.lib/lstDeQueue.c b/devel/bmake/files/lst.lib/lstDeQueue.c
index a64e22ed2f5..a5db30094fd 100644
--- a/devel/bmake/files/lst.lib/lstDeQueue.c
+++ b/devel/bmake/files/lst.lib/lstDeQueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstDeQueue.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstDeQueue.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -58,7 +58,7 @@ __RCSID("$NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
* 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 NULL if the list
* is empty.
*
* Side Effects:
@@ -66,20 +66,20 @@ __RCSID("$NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*
*-----------------------------------------------------------------------
*/
-ClientData
+void *
Lst_DeQueue(Lst l)
{
- ClientData rd;
+ void *rd;
ListNode tln;
tln = Lst_First(l);
- if (tln == NilListNode) {
- return ((ClientData) NIL);
+ if (tln == NULL) {
+ return NULL;
}
rd = tln->datum;
if (Lst_Remove(l, tln) == FAILURE) {
- return ((ClientData) NIL);
+ return NULL;
} else {
return (rd);
}
diff --git a/devel/bmake/files/lst.lib/lstDestroy.c b/devel/bmake/files/lst.lib/lstDestroy.c
index 424bbda5b7f..09d25d32da6 100644
--- a/devel/bmake/files/lst.lib/lstDestroy.c
+++ b/devel/bmake/files/lst.lib/lstDestroy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstDestroy.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstDestroy.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -68,40 +68,34 @@ __RCSID("$NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
void
-Lst_Destroy(Lst l, FreeProc *freeProc)
+Lst_Destroy(Lst list, FreeProc *freeProc)
{
ListNode ln;
- ListNode tln = NilListNode;
- List list = l;
+ ListNode tln = NULL;
- if (l == NILLST || ! l) {
- /*
- * Note the check for l == (Lst)0 to catch uninitialized static Lst's.
- * Gross, but useful.
- */
+ if (list == NULL)
return;
- }
/* To ease scanning */
- if (list->lastPtr != NilListNode)
- list->lastPtr->nextPtr = NilListNode;
+ if (list->lastPtr != NULL)
+ list->lastPtr->nextPtr = NULL;
else {
- free(l);
+ free(list);
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(ln);
}
} else {
- for (ln = list->firstPtr; ln != NilListNode; ln = tln) {
+ for (ln = list->firstPtr; ln != NULL; ln = tln) {
tln = ln->nextPtr;
free(ln);
}
}
- free(l);
+ free(list);
}
diff --git a/devel/bmake/files/lst.lib/lstDupl.c b/devel/bmake/files/lst.lib/lstDupl.c
index d47e408e7ed..e81320828c8 100644
--- a/devel/bmake/files/lst.lib/lstDupl.c
+++ b/devel/bmake/files/lst.lib/lstDupl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstDupl.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDupl.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstDupl.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -56,15 +56,15 @@ __RCSID("$NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
/*-
*-----------------------------------------------------------------------
* Lst_Duplicate --
- * Duplicate an entire list. If a function to copy a ClientData is
+ * Duplicate an entire list. If a function to copy a void *is
* given, the individual client elements will be duplicated as well.
*
* Input:
* l the list to duplicate
- * copyProc A function to duplicate each ClientData
+ * copyProc A function to duplicate each void *
*
* Results:
- * The new Lst structure or NILLST if failure.
+ * The new Lst structure or NULL if failure.
*
* Side Effects:
* A new list is created.
@@ -78,26 +78,26 @@ Lst_Duplicate(Lst l, DuplicateProc *copyProc)
List list = l;
if (!LstValid (l)) {
- return (NILLST);
+ return NULL;
}
nl = Lst_Init(list->isCirc);
- if (nl == NILLST) {
- return (NILLST);
+ if (nl == NULL) {
+ return NULL;
}
ln = list->firstPtr;
- while (ln != NilListNode) {
- if (copyProc != NOCOPY) {
+ while (ln != NULL) {
+ if (copyProc != NULL) {
if (Lst_AtEnd(nl, copyProc(ln->datum)) == FAILURE) {
- return (NILLST);
+ return NULL;
}
} else if (Lst_AtEnd(nl, ln->datum) == FAILURE) {
- return (NILLST);
+ return NULL;
}
if (list->isCirc && ln == list->lastPtr) {
- ln = NilListNode;
+ ln = NULL;
} else {
ln = ln->nextPtr;
}
diff --git a/devel/bmake/files/lst.lib/lstEnQueue.c b/devel/bmake/files/lst.lib/lstEnQueue.c
index 4b644fac0c7..fda551c2548 100644
--- a/devel/bmake/files/lst.lib/lstEnQueue.c
+++ b/devel/bmake/files/lst.lib/lstEnQueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstEnQueue.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstEnQueue.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -67,7 +67,7 @@ __RCSID("$NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
ReturnStatus
-Lst_EnQueue(Lst l, ClientData d)
+Lst_EnQueue(Lst l, void *d)
{
if (LstValid (l) == FALSE) {
return (FAILURE);
diff --git a/devel/bmake/files/lst.lib/lstFind.c b/devel/bmake/files/lst.lib/lstFind.c
index b92f98d258c..5243f30c1b9 100644
--- a/devel/bmake/files/lst.lib/lstFind.c
+++ b/devel/bmake/files/lst.lib/lstFind.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstFind.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFind.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstFind.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -59,7 +59,7 @@ __RCSID("$NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg 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.
@@ -67,7 +67,7 @@ __RCSID("$NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
LstNode
-Lst_Find(Lst l, ClientData d, int (*cProc)(ClientData, ClientData))
+Lst_Find(Lst l, const void *d, int (*cProc)(const void *, const void *))
{
return (Lst_FindFrom(l, Lst_First(l), d, cProc));
}
diff --git a/devel/bmake/files/lst.lib/lstFindFrom.c b/devel/bmake/files/lst.lib/lstFindFrom.c
index 70b8ff0df51..3e076874dbd 100644
--- a/devel/bmake/files/lst.lib/lstFindFrom.c
+++ b/devel/bmake/files/lst.lib/lstFindFrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstFindFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstFindFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -60,7 +60,7 @@ __RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
* determine when it has been found.
*
* Results:
- * The found node or NILLNODE
+ * The found node or NULL
*
* Side Effects:
* None.
@@ -68,31 +68,23 @@ __RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
LstNode
-Lst_FindFrom(Lst l, LstNode ln, ClientData d,
- int (*cProc)(ClientData, ClientData))
+Lst_FindFrom(Lst l, LstNode ln, const void *d,
+ int (*cProc)(const void *, const void *))
{
ListNode tln;
- Boolean found = FALSE;
if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) {
- return (NILLNODE);
+ return NULL;
}
tln = ln;
do {
- if ((*cProc) (tln->datum, d) == 0) {
- found = TRUE;
- break;
- } else {
- tln = tln->nextPtr;
- }
- } while (tln != ln && tln != NilListNode);
+ if ((*cProc)(tln->datum, d) == 0)
+ return (tln);
+ tln = tln->nextPtr;
+ } while (tln != ln && tln != NULL);
- if (found) {
- return (tln);
- } else {
- return (NILLNODE);
- }
+ return NULL;
}
diff --git a/devel/bmake/files/lst.lib/lstFirst.c b/devel/bmake/files/lst.lib/lstFirst.c
index f40c80eeeaa..7adb1db9e62 100644
--- a/devel/bmake/files/lst.lib/lstFirst.c
+++ b/devel/bmake/files/lst.lib/lstFirst.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstFirst.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFirst.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstFirst.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -58,7 +58,7 @@ __RCSID("$NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg 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.
@@ -69,7 +69,7 @@ LstNode
Lst_First(Lst l)
{
if (!LstValid (l) || LstIsEmpty (l)) {
- return (NILLNODE);
+ return NULL;
} else {
return (l->firstPtr);
}
diff --git a/devel/bmake/files/lst.lib/lstForEach.c b/devel/bmake/files/lst.lib/lstForEach.c
index 571191cedec..bdaf22fd7c5 100644
--- a/devel/bmake/files/lst.lib/lstForEach.c
+++ b/devel/bmake/files/lst.lib/lstForEach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstForEach.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstForEach.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstForEach.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -69,7 +69,7 @@ __RCSID("$NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*/
/*VARARGS2*/
int
-Lst_ForEach(Lst l, int (*proc)(ClientData, ClientData), ClientData d)
+Lst_ForEach(Lst l, int (*proc)(void *, void *), void *d)
{
return Lst_ForEachFrom(l, Lst_First(l), proc, d);
}
diff --git a/devel/bmake/files/lst.lib/lstForEachFrom.c b/devel/bmake/files/lst.lib/lstForEachFrom.c
index b0f3b39d423..a16c1f7f0f1 100644
--- a/devel/bmake/files/lst.lib/lstForEachFrom.c
+++ b/devel/bmake/files/lst.lib/lstForEachFrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstForEachFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstForEachFrom.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -70,8 +70,8 @@ __RCSID("$NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*/
/*VARARGS2*/
int
-Lst_ForEachFrom(Lst l, LstNode ln, int (*proc)(ClientData, ClientData),
- ClientData d)
+Lst_ForEachFrom(Lst l, LstNode ln, int (*proc)(void *, void *),
+ void *d)
{
ListNode tln = ln;
List list = l;
@@ -98,7 +98,7 @@ Lst_ForEachFrom(Lst l, LstNode ln, int (*proc)(ClientData, ClientData),
* - nothing's been added after the current node (check this
* after proc() has been called).
*/
- done = (next == NilListNode || next == list->firstPtr);
+ done = (next == NULL || next == list->firstPtr);
(void) tln->useCount++;
result = (*proc) (tln->datum, d);
diff --git a/devel/bmake/files/lst.lib/lstInit.c b/devel/bmake/files/lst.lib/lstInit.c
index 929ffec2da3..4435d9a68cd 100644
--- a/devel/bmake/files/lst.lib/lstInit.c
+++ b/devel/bmake/files/lst.lib/lstInit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstInit.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstInit.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInit.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstInit.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstInit.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstInit.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -75,8 +75,8 @@ Lst_Init(Boolean circ)
PAlloc (nList, List);
- nList->firstPtr = NilListNode;
- nList->lastPtr = NilListNode;
+ nList->firstPtr = NULL;
+ nList->lastPtr = NULL;
nList->isOpen = FALSE;
nList->isCirc = circ;
nList->atEnd = Unknown;
diff --git a/devel/bmake/files/lst.lib/lstInsert.c b/devel/bmake/files/lst.lib/lstInsert.c
index f038baf4236..fde8a5ec0f7 100644
--- a/devel/bmake/files/lst.lib/lstInsert.c
+++ b/devel/bmake/files/lst.lib/lstInsert.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstInsert.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstInsert.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstInsert.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -73,7 +73,7 @@ __RCSID("$NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
ReturnStatus
-Lst_InsertBefore(Lst l, LstNode ln, ClientData d)
+Lst_InsertBefore(Lst l, LstNode ln, void *d)
{
ListNode nLNode; /* new lnode for d */
ListNode lNode = ln;
@@ -83,7 +83,7 @@ Lst_InsertBefore(Lst l, LstNode ln, ClientData 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)) {
@@ -96,18 +96,18 @@ Lst_InsertBefore(Lst l, LstNode ln, ClientData d)
nLNode->datum = d;
nLNode->useCount = nLNode->flags = 0;
- if (ln == NILLNODE) {
+ if (ln == NULL) {
if (list->isCirc) {
nLNode->prevPtr = nLNode->nextPtr = nLNode;
} else {
- nLNode->prevPtr = nLNode->nextPtr = NilListNode;
+ 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/devel/bmake/files/lst.lib/lstInt.h b/devel/bmake/files/lst.lib/lstInt.h
index a9c9e587af3..c79dc42c6b0 100644
--- a/devel/bmake/files/lst.lib/lstInt.h
+++ b/devel/bmake/files/lst.lib/lstInt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lstInt.h,v 1.5 2008/11/11 14:37:06 joerg Exp $ */
+/* $NetBSD: lstInt.h,v 1.6 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -41,8 +41,8 @@
#ifndef _LSTINT_H_
#define _LSTINT_H_
-#include "../make.h"
#include "../lst.h"
+#include "../make_malloc.h"
typedef struct ListNode {
struct ListNode *prevPtr; /* previous element in list */
@@ -51,15 +51,13 @@ typedef struct ListNode {
* node may not be deleted until count
* goes to 0 */
flags:8; /* Node status flags */
- ClientData datum; /* datum associated with this element */
+ void *datum; /* datum associated with this element */
} *ListNode;
/*
* Flags required for synchronization
*/
#define LN_DELETED 0x0001 /* List node should be removed when done */
-#define NilListNode ((ListNode)-1)
-
typedef enum {
Head, Middle, Tail, Unknown
} Where;
@@ -74,14 +72,12 @@ typedef struct List {
*/
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'
@@ -92,18 +88,18 @@ typedef struct List {
* LstValid (l) --
* Return TRUE if the list l is valid
*/
-#define LstValid(l) ((Lst)(l) != NILLST)
+#define LstValid(l) ((Lst)(l) != NULL)
/*
* LstNodeValid (ln, l) --
* Return TRUE if the LstNode ln is valid with respect to l
*/
-#define LstNodeValid(ln, l) ((ln) != NILLNODE)
+#define LstNodeValid(ln, l) ((ln) != NULL)
/*
* 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/devel/bmake/files/lst.lib/lstIsEmpty.c b/devel/bmake/files/lst.lib/lstIsEmpty.c
index a79c34fb80e..6e4a43cf027 100644
--- a/devel/bmake/files/lst.lib/lstIsEmpty.c
+++ b/devel/bmake/files/lst.lib/lstIsEmpty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstIsEmpty.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstIsEmpty.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -63,8 +63,8 @@ __RCSID("$NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
* 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/devel/bmake/files/lst.lib/lstLast.c b/devel/bmake/files/lst.lib/lstLast.c
index f920ac9f301..df3155c80ca 100644
--- a/devel/bmake/files/lst.lib/lstLast.c
+++ b/devel/bmake/files/lst.lib/lstLast.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstLast.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstLast.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstLast.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -58,7 +58,7 @@ __RCSID("$NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg 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.
@@ -69,7 +69,7 @@ LstNode
Lst_Last(Lst l)
{
if (!LstValid(l) || LstIsEmpty (l)) {
- return (NILLNODE);
+ return NULL;
} else {
return (l->lastPtr);
}
diff --git a/devel/bmake/files/lst.lib/lstMember.c b/devel/bmake/files/lst.lib/lstMember.c
index f79d03ab3a8..87ab2f63a51 100644
--- a/devel/bmake/files/lst.lib/lstMember.c
+++ b/devel/bmake/files/lst.lib/lstMember.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstMember.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstMember.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstMember.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -53,14 +53,14 @@ __RCSID("$NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#include "lstInt.h"
LstNode
-Lst_Member(Lst l, ClientData d)
+Lst_Member(Lst l, void *d)
{
List list = l;
ListNode lNode;
lNode = list->firstPtr;
- if (lNode == NilListNode) {
- return NILLNODE;
+ if (lNode == NULL) {
+ return NULL;
}
do {
@@ -68,7 +68,7 @@ Lst_Member(Lst l, ClientData d)
return lNode;
}
lNode = lNode->nextPtr;
- } while (lNode != NilListNode && lNode != list->firstPtr);
+ } while (lNode != NULL && lNode != list->firstPtr);
- return NILLNODE;
+ return NULL;
}
diff --git a/devel/bmake/files/lst.lib/lstNext.c b/devel/bmake/files/lst.lib/lstNext.c
index 2733d78bc56..8a9904745f3 100644
--- a/devel/bmake/files/lst.lib/lstNext.c
+++ b/devel/bmake/files/lst.lib/lstNext.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstNext.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstNext.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstNext.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -63,8 +63,8 @@ __RCSID("$NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg 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:
@@ -80,12 +80,12 @@ Lst_Next(Lst 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.
@@ -95,14 +95,14 @@ Lst_Next(Lst 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/devel/bmake/files/lst.lib/lstOpen.c b/devel/bmake/files/lst.lib/lstOpen.c
index 901bbc69120..dcbc672e025 100644
--- a/devel/bmake/files/lst.lib/lstOpen.c
+++ b/devel/bmake/files/lst.lib/lstOpen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstOpen.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstOpen.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstOpen.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -66,7 +66,7 @@ __RCSID("$NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg 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.
*
@@ -80,7 +80,7 @@ Lst_Open(Lst l)
}
(l)->isOpen = TRUE;
(l)->atEnd = LstIsEmpty (l) ? Head : Unknown;
- (l)->curPtr = NilListNode;
+ (l)->curPtr = NULL;
return (SUCCESS);
}
diff --git a/devel/bmake/files/lst.lib/lstRemove.c b/devel/bmake/files/lst.lib/lstRemove.c
index fd1f712191b..2b4034ea28d 100644
--- a/devel/bmake/files/lst.lib/lstRemove.c
+++ b/devel/bmake/files/lst.lib/lstRemove.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstRemove.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstRemove.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstRemove.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -61,7 +61,7 @@ __RCSID("$NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg 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.
*
@@ -81,10 +81,10 @@ Lst_Remove(Lst l, LstNode 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;
}
@@ -102,12 +102,12 @@ Lst_Remove(Lst l, LstNode 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;
}
}
@@ -118,7 +118,7 @@ Lst_Remove(Lst l, LstNode 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/devel/bmake/files/lst.lib/lstReplace.c b/devel/bmake/files/lst.lib/lstReplace.c
index 9dd1f97de77..55fde547e33 100644
--- a/devel/bmake/files/lst.lib/lstReplace.c
+++ b/devel/bmake/files/lst.lib/lstReplace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstReplace.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstReplace.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstReplace.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -66,9 +66,9 @@ __RCSID("$NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
*-----------------------------------------------------------------------
*/
ReturnStatus
-Lst_Replace(LstNode ln, ClientData d)
+Lst_Replace(LstNode ln, void *d)
{
- if (ln == NILLNODE) {
+ if (ln == NULL) {
return (FAILURE);
} else {
(ln)->datum = d;
diff --git a/devel/bmake/files/lst.lib/lstSucc.c b/devel/bmake/files/lst.lib/lstSucc.c
index c39df6a6830..ea66417bc4c 100644
--- a/devel/bmake/files/lst.lib/lstSucc.c
+++ b/devel/bmake/files/lst.lib/lstSucc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
+/* $NetBSD: lstSucc.c,v 1.3 2009/09/18 21:27:26 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstSucc.c,v 1.3 2009/09/18 21:27:26 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
+__RCSID("$NetBSD: lstSucc.c,v 1.3 2009/09/18 21:27:26 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -70,8 +70,8 @@ __RCSID("$NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
LstNode
Lst_Succ(LstNode ln)
{
- if (ln == NILLNODE) {
- return (NILLNODE);
+ if (ln == NULL) {
+ return NULL;
} else {
return (ln->nextPtr);
}