SCCS-vsn: usr.bin/make/lst.lib/lstAppend.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstAtEnd.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstAtFront.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstClose.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstConcat.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstDatum.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstDeQueue.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstDestroy.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstDupl.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstEnQueue.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstFind.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstFindFrom.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstFirst.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstForEach.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstForEachFrom.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstInit.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstInsert.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstIsAtEnd.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstIsEmpty.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstLast.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstMember.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstNext.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstOpen.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstRemove.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstReplace.c 8.2
SCCS-vsn: usr.bin/make/lst.lib/lstSucc.c 8.2
26 files changed:
-static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstAppend.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstAtEnd.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstAtFront.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstClose.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstConcat.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
list2->firstPtr->prevPtr = list1->lastPtr;
if (list1->lastPtr != NilListNode) {
list1->lastPtr->nextPtr = list2->firstPtr;
list2->firstPtr->prevPtr = list1->lastPtr;
if (list1->lastPtr != NilListNode) {
list1->lastPtr->nextPtr = list2->firstPtr;
+ } else {
+ list1->firstPtr = list2->firstPtr;
}
list1->lastPtr = list2->lastPtr;
}
}
list1->lastPtr = list2->lastPtr;
}
-static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDatum.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDeQueue.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDestroy.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
void
Lst_Destroy (l, freeProc)
Lst l;
void
Lst_Destroy (l, freeProc)
Lst l;
- register void (*freeProc)();
+ register void (*freeProc) __P((ClientData));
{
register ListNode ln;
register ListNode tln = NilListNode;
{
register ListNode ln;
register ListNode tln = NilListNode;
+
+ /* To ease scanning */
+ if (list->lastPtr != NilListNode)
+ list->lastPtr->nextPtr = NilListNode;
+ else {
+ free ((Address)l);
+ return;
+ }
+
- for (ln = list->firstPtr;
- ln != NilListNode && tln != list->firstPtr;
- ln = tln) {
- tln = ln->nextPtr;
- (*freeProc) (ln->datum);
- free ((Address)ln);
+ for (ln = list->firstPtr; ln != NilListNode; ln = tln) {
+ tln = ln->nextPtr;
+ (*freeProc) (ln->datum);
+ free ((Address)ln);
- for (ln = list->firstPtr;
- ln != NilListNode && tln != list->firstPtr;
- ln = tln) {
- tln = ln->nextPtr;
- free ((Address)ln);
+ for (ln = list->firstPtr; ln != NilListNode; ln = tln) {
+ tln = ln->nextPtr;
+ free ((Address)ln);
-static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstDupl.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
Lst
Lst_Duplicate (l, copyProc)
Lst l; /* the list to duplicate */
Lst
Lst_Duplicate (l, copyProc)
Lst l; /* the list to duplicate */
- ClientData (*copyProc)(); /* A function to duplicate each ClientData */
+ /* A function to duplicate each ClientData */
+ ClientData (*copyProc) __P((ClientData));
{
register Lst nl;
register ListNode ln;
{
register Lst nl;
register ListNode ln;
-static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstEnQueue.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstFind.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
Lst_Find (l, d, cProc)
Lst l;
ClientData d;
Lst_Find (l, d, cProc)
Lst l;
ClientData d;
+ int (*cProc) __P((ClientData, ClientData));
{
return (Lst_FindFrom (l, Lst_First(l), d, cProc));
}
{
return (Lst_FindFrom (l, Lst_First(l), d, cProc));
}
-static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstFindFrom.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
Lst l;
register LstNode ln;
register ClientData d;
Lst l;
register LstNode ln;
register ClientData d;
- register int (*cProc)();
+ register int (*cProc) __P((ClientData, ClientData));
{
register ListNode tln;
Boolean found = FALSE;
{
register ListNode tln;
Boolean found = FALSE;
-static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstFirst.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstForEach.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
void
Lst_ForEach (l, proc, d)
Lst l;
void
Lst_ForEach (l, proc, d)
Lst l;
- register int (*proc)();
+ register int (*proc) __P((ClientData, ClientData));
register ClientData d;
{
Lst_ForEachFrom(l, Lst_First(l), proc, d);
register ClientData d;
{
Lst_ForEachFrom(l, Lst_First(l), proc, d);
-static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstForEachFrom.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstInit.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstInsert.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstIsAtEnd.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstIsEmpty.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstLast.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstMember.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstNext.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstOpen.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstRemove.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstReplace.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
-static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lstSucc.c 8.2 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-