diff options
Diffstat (limited to 'usr.bin/make/lst.lib')
28 files changed, 250 insertions, 80 deletions
diff --git a/usr.bin/make/lst.lib/Makefile b/usr.bin/make/lst.lib/Makefile new file mode 100644 index 000000000000..1e73eca40479 --- /dev/null +++ b/usr.bin/make/lst.lib/Makefile @@ -0,0 +1,10 @@ +# $NetBSD: Makefile,v 1.3 1995/06/14 15:20:42 christos Exp $ + +OBJ=lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o \ + lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o \ + lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o \ + lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o \ + lstForEachFrom.o lstDestroy.o lstNext.o + +CFLAGS=-I.. +all: ${OBJ} diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c index 93800db01a0b..b6f15d371536 100644 --- a/usr.bin/make/lst.lib/lstAppend.c +++ b/usr.bin/make/lst.lib/lstAppend.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstAppend.c,v 1.4 1995/06/14 15:20:44 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstAppend.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstAppend.c,v 1.4 1995/06/14 15:20:44 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -70,23 +76,23 @@ Lst_Append (l, ln, d) register List list; register ListNode lNode; register ListNode nLNode; - + if (LstValid (l) && (ln == NILLNODE && LstIsEmpty (l))) { goto ok; } - + if (!LstValid (l) || LstIsEmpty (l) || ! LstNodeValid (ln, l)) { return (FAILURE); } ok: - + list = (List)l; lNode = (ListNode)ln; PAlloc (nLNode, ListNode); nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - + if (lNode == NilListNode) { if (list->isCirc) { nLNode->nextPtr = nLNode->prevPtr = nLNode; @@ -97,17 +103,17 @@ Lst_Append (l, ln, d) } else { nLNode->prevPtr = lNode; nLNode->nextPtr = lNode->nextPtr; - + lNode->nextPtr = nLNode; if (nLNode->nextPtr != NilListNode) { nLNode->nextPtr->prevPtr = nLNode; } - + if (lNode == list->lastPtr) { list->lastPtr = nLNode; } } - + return (SUCCESS); } diff --git a/usr.bin/make/lst.lib/lstAtEnd.c b/usr.bin/make/lst.lib/lstAtEnd.c index e61a28c0673f..a4ed0d7b0181 100644 --- a/usr.bin/make/lst.lib/lstAtEnd.c +++ b/usr.bin/make/lst.lib/lstAtEnd.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstAtEnd.c,v 1.4 1995/06/14 15:20:46 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstAtEnd.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.4 1995/06/14 15:20:46 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -44,7 +50,7 @@ static char sccsid[] = "@(#)lstAtEnd.c 8.2 (Berkeley) 4/28/95"; */ #include "lstInt.h" - + /*- *----------------------------------------------------------------------- * Lst_AtEnd -- @@ -64,7 +70,7 @@ Lst_AtEnd (l, d) ClientData d; /* Datum to add */ { register LstNode end; - + end = Lst_Last (l); return (Lst_Append (l, end, d)); } diff --git a/usr.bin/make/lst.lib/lstAtFront.c b/usr.bin/make/lst.lib/lstAtFront.c index 5e8b7f1ab4c2..ef694d345d4e 100644 --- a/usr.bin/make/lst.lib/lstAtFront.c +++ b/usr.bin/make/lst.lib/lstAtFront.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstAtFront.c,v 1.4 1995/06/14 15:20:48 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstAtFront.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.4 1995/06/14 15:20:48 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -65,7 +71,7 @@ Lst_AtFront (l, d) ClientData d; { register LstNode front; - + front = Lst_First (l); return (Lst_Insert (l, front, d)); } diff --git a/usr.bin/make/lst.lib/lstClose.c b/usr.bin/make/lst.lib/lstClose.c index 6f9174f3db8a..e07ed4a81c81 100644 --- a/usr.bin/make/lst.lib/lstClose.c +++ b/usr.bin/make/lst.lib/lstClose.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstClose.c,v 1.4 1995/06/14 15:20:50 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstClose.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstClose.c,v 1.4 1995/06/14 15:20:50 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -68,7 +74,7 @@ Lst_Close (l) Lst l; /* The list to close */ { register List list = (List) l; - + if (LstValid(l) == TRUE) { list->isOpen = FALSE; list->atEnd = Unknown; diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c index e7726a862b60..74baa86b2096 100644 --- a/usr.bin/make/lst.lib/lstConcat.c +++ b/usr.bin/make/lst.lib/lstConcat.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstConcat.c,v 1.5 1995/06/14 15:20:53 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstConcat.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstConcat.c,v 1.5 1995/06/14 15:20:53 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -149,7 +155,7 @@ Lst_Concat (l1, l2, flags) /* * Finish bookkeeping. The last new element becomes the last element - * of list one. + * of list one. */ list1->lastPtr = last; @@ -173,4 +179,4 @@ Lst_Concat (l1, l2, flags) return (SUCCESS); } - + diff --git a/usr.bin/make/lst.lib/lstDatum.c b/usr.bin/make/lst.lib/lstDatum.c index 6b0988e0fa2b..6125b665174b 100644 --- a/usr.bin/make/lst.lib/lstDatum.c +++ b/usr.bin/make/lst.lib/lstDatum.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstDatum.c,v 1.4 1995/06/14 15:20:54 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDatum.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstDatum.c,v 1.4 1995/06/14 15:20:54 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c index 4b901257b001..b4c5f8bb805a 100644 --- a/usr.bin/make/lst.lib/lstDeQueue.c +++ b/usr.bin/make/lst.lib/lstDeQueue.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstDeQueue.c,v 1.4 1995/06/14 15:20:56 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDeQueue.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.4 1995/06/14 15:20:56 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -65,12 +71,12 @@ Lst_DeQueue (l) { ClientData rd; register ListNode tln; - + tln = (ListNode) Lst_First (l); if (tln == NilListNode) { return ((ClientData) NIL); } - + rd = tln->datum; if (Lst_Remove (l, (LstNode)tln) == FAILURE) { return ((ClientData) NIL); diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c index 56ea5c528fe6..23e0ecd6b7d7 100644 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ b/usr.bin/make/lst.lib/lstDestroy.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstDestroy.c,v 1.5 1995/06/14 15:20:58 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDestroy.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.5 1995/06/14 15:20:58 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -68,7 +74,7 @@ Lst_Destroy (l, freeProc) register ListNode ln; register ListNode tln = NilListNode; register List list = (List)l; - + if (l == NILLST || ! l) { /* * Note the check for l == (Lst)0 to catch uninitialized static Lst's. @@ -97,6 +103,6 @@ Lst_Destroy (l, freeProc) free ((Address)ln); } } - + free ((Address)l); } diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c index 184b386228d3..b0d36f83a0e5 100644 --- a/usr.bin/make/lst.lib/lstDupl.c +++ b/usr.bin/make/lst.lib/lstDupl.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstDupl.c,v 1.5 1995/06/14 15:21:02 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstDupl.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstDupl.c,v 1.5 1995/06/14 15:21:02 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -68,7 +74,7 @@ Lst_Duplicate (l, copyProc) register Lst nl; register ListNode ln; register List list = (List)l; - + if (!LstValid (l)) { return (NILLST); } @@ -94,6 +100,6 @@ Lst_Duplicate (l, copyProc) ln = ln->nextPtr; } } - + return (nl); } diff --git a/usr.bin/make/lst.lib/lstEnQueue.c b/usr.bin/make/lst.lib/lstEnQueue.c index 1016c88d2834..cdd865cfad05 100644 --- a/usr.bin/make/lst.lib/lstEnQueue.c +++ b/usr.bin/make/lst.lib/lstEnQueue.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstEnQueue.c,v 1.4 1995/06/14 15:21:04 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstEnQueue.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.4 1995/06/14 15:21:04 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -67,7 +73,7 @@ Lst_EnQueue (l, d) if (LstValid (l) == FALSE) { return (FAILURE); } - + return (Lst_Append (l, Lst_Last(l), d)); } diff --git a/usr.bin/make/lst.lib/lstFind.c b/usr.bin/make/lst.lib/lstFind.c index bab85ccd173c..41b9e1cf4b9d 100644 --- a/usr.bin/make/lst.lib/lstFind.c +++ b/usr.bin/make/lst.lib/lstFind.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstFind.c,v 1.5 1995/06/14 15:21:07 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstFind.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstFind.c,v 1.5 1995/06/14 15:21:07 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c index 08de990afe5c..19cd4e04867e 100644 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ b/usr.bin/make/lst.lib/lstFindFrom.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstFindFrom.c,v 1.5 1995/06/14 15:21:09 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstFindFrom.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.5 1995/06/14 15:21:09 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -69,13 +75,13 @@ Lst_FindFrom (l, ln, d, cProc) { register ListNode tln; Boolean found = FALSE; - + if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { return (NILLNODE); } - + tln = (ListNode)ln; - + do { if ((*cProc) (tln->datum, d) == 0) { found = TRUE; @@ -84,7 +90,7 @@ Lst_FindFrom (l, ln, d, cProc) tln = tln->nextPtr; } } while (tln != (ListNode)ln && tln != NilListNode); - + if (found) { return ((LstNode)tln); } else { diff --git a/usr.bin/make/lst.lib/lstFirst.c b/usr.bin/make/lst.lib/lstFirst.c index 9a95018777ab..f97c12c1f624 100644 --- a/usr.bin/make/lst.lib/lstFirst.c +++ b/usr.bin/make/lst.lib/lstFirst.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstFirst.c,v 1.4 1995/06/14 15:21:12 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstFirst.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstFirst.c,v 1.4 1995/06/14 15:21:12 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstForEach.c b/usr.bin/make/lst.lib/lstForEach.c index 1d6ba9396dc6..00c1fa91dc64 100644 --- a/usr.bin/make/lst.lib/lstForEach.c +++ b/usr.bin/make/lst.lib/lstForEach.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstForEach.c,v 1.5 1995/06/14 15:21:14 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstForEach.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstForEach.c,v 1.5 1995/06/14 15:21:14 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c index 7c9e51e749f0..a5efc640d299 100644 --- a/usr.bin/make/lst.lib/lstForEachFrom.c +++ b/usr.bin/make/lst.lib/lstForEachFrom.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstForEachFrom.c,v 1.4 1995/06/14 15:21:16 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstForEachFrom.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.4 1995/06/14 15:21:16 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -51,7 +57,7 @@ static char sccsid[] = "@(#)lstForEachFrom.c 8.2 (Berkeley) 4/28/95"; * Lst_ForEachFrom -- * Apply the given function to each element of the given list. The * function should return 0 if traversal should continue and non- - * zero if it should abort. + * zero if it should abort. * * Results: * None. @@ -66,7 +72,7 @@ void Lst_ForEachFrom (l, ln, proc, d) Lst l; LstNode ln; - register int (*proc)(); + register int (*proc) __P((ClientData, ClientData)); register ClientData d; { register ListNode tln = (ListNode)ln; @@ -74,19 +80,19 @@ Lst_ForEachFrom (l, ln, proc, d) register ListNode next; Boolean done; int result; - + if (!LstValid (list) || LstIsEmpty (list)) { return; } - + do { /* * Take care of having the current element deleted out from under * us. */ - + next = tln->nextPtr; - + (void) tln->useCount++; result = (*proc) (tln->datum, d); (void) tln->useCount--; @@ -99,7 +105,7 @@ Lst_ForEachFrom (l, ln, proc, d) */ done = (next == tln->nextPtr && (next == NilListNode || next == list->firstPtr)); - + next = tln->nextPtr; if (tln->flags & LN_DELETED) { @@ -107,5 +113,6 @@ Lst_ForEachFrom (l, ln, proc, d) } tln = next; } while (!result && !LstIsEmpty(list) && !done); - + } + diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c index 17276be6f1e7..dfcb873971af 100644 --- a/usr.bin/make/lst.lib/lstInit.c +++ b/usr.bin/make/lst.lib/lstInit.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstInit.c,v 1.4 1995/06/14 15:21:18 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstInit.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstInit.c,v 1.4 1995/06/14 15:21:18 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -63,14 +69,14 @@ Lst_Init(circ) Boolean circ; /* TRUE if the list should be made circular */ { register List nList; - + PAlloc (nList, List); - + nList->firstPtr = NilListNode; nList->lastPtr = NilListNode; nList->isOpen = FALSE; nList->isCirc = circ; nList->atEnd = Unknown; - + return ((Lst)nList); } diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c index 724924adf071..07070202e470 100644 --- a/usr.bin/make/lst.lib/lstInsert.c +++ b/usr.bin/make/lst.lib/lstInsert.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstInsert.c,v 1.4 1995/06/14 15:21:21 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstInsert.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstInsert.c,v 1.4 1995/06/14 15:21:21 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -76,17 +82,17 @@ Lst_Insert (l, ln, d) */ if (LstValid (l) && (LstIsEmpty (l) && ln == NILLNODE)) goto ok; - + if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { return (FAILURE); } - + ok: PAlloc (nLNode, ListNode); - + nLNode->datum = d; nLNode->useCount = nLNode->flags = 0; - + if (ln == NILLNODE) { if (list->isCirc) { nLNode->prevPtr = nLNode->nextPtr = nLNode; @@ -97,17 +103,17 @@ Lst_Insert (l, ln, d) } else { nLNode->prevPtr = lNode->prevPtr; nLNode->nextPtr = lNode; - + if (nLNode->prevPtr != NilListNode) { nLNode->prevPtr->nextPtr = nLNode; } lNode->prevPtr = nLNode; - + if (lNode == list->firstPtr) { list->firstPtr = nLNode; } } - + return (SUCCESS); } - + diff --git a/usr.bin/make/lst.lib/lstInt.h b/usr.bin/make/lst.lib/lstInt.h index 1253660f8e81..975d5dc5fe89 100644 --- a/usr.bin/make/lst.lib/lstInt.h +++ b/usr.bin/make/lst.lib/lstInt.h @@ -1,3 +1,5 @@ +/* $NetBSD: lstInt.h,v 1.6 1995/11/10 21:27:27 cgd Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -33,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)lstInt.h 8.2 (Berkeley) 4/28/95 + * from: @(#)lstInt.h 8.1 (Berkeley) 6/6/93 */ /*- @@ -43,6 +45,7 @@ #ifndef _LSTINT_H_ #define _LSTINT_H_ +#include "make.h" #include "lst.h" typedef struct ListNode { @@ -87,7 +90,7 @@ typedef struct { * PAlloc (var, ptype) -- * Allocate a pointer-typedef structure 'ptype' into the variable 'var' */ -#define PAlloc(var,ptype) var = (ptype) malloc (sizeof (*var)) +#define PAlloc(var,ptype) var = (ptype) emalloc (sizeof (*var)) /* * LstValid (l) -- diff --git a/usr.bin/make/lst.lib/lstIsAtEnd.c b/usr.bin/make/lst.lib/lstIsAtEnd.c index 7fdf68dca49c..be17403b43bc 100644 --- a/usr.bin/make/lst.lib/lstIsAtEnd.c +++ b/usr.bin/make/lst.lib/lstIsAtEnd.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstIsAtEnd.c,v 1.4 1995/06/14 15:21:25 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstIsAtEnd.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.4 1995/06/14 15:21:25 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstIsEmpty.c b/usr.bin/make/lst.lib/lstIsEmpty.c index da475611bfa8..6fc9b908f758 100644 --- a/usr.bin/make/lst.lib/lstIsEmpty.c +++ b/usr.bin/make/lst.lib/lstIsEmpty.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstIsEmpty.c,v 1.4 1995/06/14 15:21:27 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstIsEmpty.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.4 1995/06/14 15:21:27 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstLast.c b/usr.bin/make/lst.lib/lstLast.c index a87c50c0f837..1c28fd7c7e77 100644 --- a/usr.bin/make/lst.lib/lstLast.c +++ b/usr.bin/make/lst.lib/lstLast.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstLast.c,v 1.4 1995/06/14 15:21:29 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstLast.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstLast.c,v 1.4 1995/06/14 15:21:29 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c index a6145ee64fd3..fc9b1bbc03ac 100644 --- a/usr.bin/make/lst.lib/lstMember.c +++ b/usr.bin/make/lst.lib/lstMember.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstMember.c,v 1.4 1995/06/14 15:21:32 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstMember.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstMember.c,v 1.4 1995/06/14 15:21:32 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -57,7 +63,7 @@ Lst_Member (l, d) if (lNode == NilListNode) { return NILLNODE; } - + do { if (lNode->datum == d) { return (LstNode)lNode; diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c index b6986d866d59..d36e5065ee00 100644 --- a/usr.bin/make/lst.lib/lstNext.c +++ b/usr.bin/make/lst.lib/lstNext.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstNext.c,v 1.4 1995/06/14 15:21:35 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstNext.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstNext.c,v 1.4 1995/06/14 15:21:35 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -71,14 +77,14 @@ Lst_Next (l) { register ListNode tln; register List list = (List)l; - + if ((LstValid (l) == FALSE) || (list->isOpen == FALSE)) { return (NILLNODE); } - + list->prevPtr = list->curPtr; - + if (list->curPtr == NilListNode) { if (list->atEnd == Unknown) { /* @@ -108,7 +114,7 @@ Lst_Next (l) list->atEnd = Middle; } } - + return ((LstNode)tln); } diff --git a/usr.bin/make/lst.lib/lstOpen.c b/usr.bin/make/lst.lib/lstOpen.c index 9da8cfab5769..ae492b17e3bd 100644 --- a/usr.bin/make/lst.lib/lstOpen.c +++ b/usr.bin/make/lst.lib/lstOpen.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstOpen.c,v 1.4 1995/06/14 15:21:37 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstOpen.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstOpen.c,v 1.4 1995/06/14 15:21:37 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c index 98eb3ce53493..7d13cae0e6ca 100644 --- a/usr.bin/make/lst.lib/lstRemove.c +++ b/usr.bin/make/lst.lib/lstRemove.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstRemove.c,v 1.4 1995/06/14 15:21:39 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstRemove.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstRemove.c,v 1.4 1995/06/14 15:21:39 christos Exp $"; +#endif #endif /* not lint */ /*- @@ -72,7 +78,7 @@ Lst_Remove (l, ln) !LstNodeValid (ln, l)) { return (FAILURE); } - + /* * unlink it from the list */ @@ -82,7 +88,7 @@ Lst_Remove (l, ln) if (lNode->prevPtr != NilListNode) { lNode->prevPtr->nextPtr = lNode->nextPtr; } - + /* * if either the firstPtr or lastPtr of the list point to this node, * adjust them accordingly @@ -115,7 +121,7 @@ Lst_Remove (l, ln) if (list->firstPtr == lNode) { list->firstPtr = NilListNode; } - + /* * note that the datum is unmolested. The caller must free it as * necessary and as expected. @@ -125,7 +131,7 @@ Lst_Remove (l, ln) } else { lNode->flags |= LN_DELETED; } - + return (SUCCESS); } diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c index 8adb6895aec1..635e2c86a403 100644 --- a/usr.bin/make/lst.lib/lstReplace.c +++ b/usr.bin/make/lst.lib/lstReplace.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstReplace.c,v 1.4 1995/06/14 15:21:41 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstReplace.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstReplace.c,v 1.4 1995/06/14 15:21:41 christos Exp $"; +#endif #endif /* not lint */ /*- diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c index a5875f686874..971e540ad9e9 100644 --- a/usr.bin/make/lst.lib/lstSucc.c +++ b/usr.bin/make/lst.lib/lstSucc.c @@ -1,3 +1,5 @@ +/* $NetBSD: lstSucc.c,v 1.4 1995/06/14 15:21:42 christos Exp $ */ + /* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -35,7 +37,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)lstSucc.c 8.2 (Berkeley) 4/28/95"; +#if 0 +static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; +#else +static char rcsid[] = "$NetBSD: lstSucc.c,v 1.4 1995/06/14 15:21:42 christos Exp $"; +#endif #endif /* not lint */ /*- |
