summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-12-19 00:04:27 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-12-19 00:04:27 +0000
commitd0130d96c585fdb50dc22f4eb3e62eeaf925c54e (patch)
tree1473dd29f02676192ef554ecc68d312e01370f9d
parentafc4108f5f7812de12c1db4f1db50663cd70f797 (diff)
Rearrange Lst_Find interface to conform better with other functions.
-rw-r--r--usr.bin/make/Makefile4
-rw-r--r--usr.bin/make/arch.c6
-rw-r--r--usr.bin/make/cond.c6
-rw-r--r--usr.bin/make/dir.c6
-rw-r--r--usr.bin/make/job.c12
-rw-r--r--usr.bin/make/lst.h11
-rw-r--r--usr.bin/make/lst.lib/Makefile4
-rw-r--r--usr.bin/make/lst.lib/lstFind.c77
-rw-r--r--usr.bin/make/lst.lib/lstFindFrom.c52
-rw-r--r--usr.bin/make/main.c8
-rw-r--r--usr.bin/make/suff.c42
-rw-r--r--usr.bin/make/var.c16
12 files changed, 74 insertions, 170 deletions
diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile
index 2b4e9c54db4..230f862efb9 100644
--- a/usr.bin/make/Makefile
+++ b/usr.bin/make/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.12 1999/12/09 18:20:06 espie Exp $
+# $OpenBSD: Makefile,v 1.13 1999/12/19 00:04:24 espie Exp $
PROG= make
CFLAGS+= -I${.CURDIR} -Wall -Wno-char-subscripts -Wno-unused -Wstrict-prototypes#-Wmissing-prototypes -Wstrict-prototypes
@@ -11,7 +11,7 @@ SRCS= arch.c buf.c compat.c cond.c dir.c error.c for.c hash.c job.c main.c \
make.c parse.c str.c suff.c targ.c var.c #util.c
SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
- lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
+ lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
.PATH: ${.CURDIR}/lst.lib
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index e73c81d392f..0fc031483fa 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arch.c,v 1.22 1999/12/18 21:58:07 espie Exp $ */
+/* $OpenBSD: arch.c,v 1.23 1999/12/19 00:04:24 espie Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: arch.c,v 1.22 1999/12/18 21:58:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.23 1999/12/19 00:04:24 espie Exp $";
#endif
#endif /* not lint */
@@ -496,7 +496,7 @@ ArchStatMember (archive, member, hash)
if (cp != NULL)
member = cp + 1;
- ln = Lst_Find (archives, (ClientData) archive, ArchFindArchive);
+ ln = Lst_Find(archives, ArchFindArchive, (ClientData)archive);
if (ln != NULL) {
ar = (Arch *) Lst_Datum (ln);
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c
index c05957a4260..0358a08983b 100644
--- a/usr.bin/make/cond.c
+++ b/usr.bin/make/cond.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cond.c,v 1.12 1999/12/18 21:53:32 espie Exp $ */
+/* $OpenBSD: cond.c,v 1.13 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: cond.c,v 1.12 1999/12/18 21:53:32 espie Exp $";
+static char rcsid[] = "$OpenBSD: cond.c,v 1.13 1999/12/19 00:04:25 espie Exp $";
#endif
#endif /* not lint */
@@ -339,7 +339,7 @@ CondDoMake (argLen, arg)
Boolean result;
arg[argLen] = '\0';
- if (Lst_Find (create, (ClientData)arg, CondStrMatch) == NULL) {
+ if (Lst_Find(create, CondStrMatch, (ClientData)arg) == NULL) {
result = FALSE;
} else {
result = TRUE;
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index 8368464d31a..0a71509f296 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.c,v 1.13 1999/12/18 21:58:07 espie Exp $ */
+/* $OpenBSD: dir.c,v 1.14 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: dir.c,v 1.13 1999/12/18 21:58:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: dir.c,v 1.14 1999/12/19 00:04:25 espie Exp $";
#endif
#endif /* not lint */
@@ -1062,7 +1062,7 @@ Dir_AddDir (path, name)
DIR *d; /* for reading directory */
register struct dirent *dp; /* entry in directory */
- ln = Lst_Find (openDirectories, (ClientData)name, DirFindName);
+ ln = Lst_Find(openDirectories, DirFindName, (ClientData)name);
if (ln != NULL) {
p = (Path *)Lst_Datum (ln);
if (Lst_Member(path, (ClientData)p) == NULL) {
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 7c8c50cef38..95985fcf76c 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.20 1999/12/18 21:58:07 espie Exp $ */
+/* $OpenBSD: job.c,v 1.21 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: job.c,v 1.20 1999/12/18 21:58:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: job.c,v 1.21 1999/12/19 00:04:25 espie Exp $";
#endif
#endif /* not lint */
@@ -2253,11 +2253,11 @@ Job_CatchChildren(block)
}
- jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid);
+ jnode = Lst_Find(jobs, JobCmpPid, (ClientData)&pid);
if (jnode == NULL) {
if (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)) {
- jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid);
+ jnode = Lst_Find(stoppedJobs, JobCmpPid, (ClientData)&pid);
if (jnode == NULL) {
Error("Resumed child (%d) not in table", pid);
continue;
@@ -3103,10 +3103,10 @@ JobFlagForMigration(hostID)
(void) fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);
(void) fflush(stdout);
}
- jnode = Lst_Find(jobs, (ClientData)hostID, JobCmpRmtID);
+ jnode = Lst_Find(jobs, JobCmpRmtID, (ClientData)hostID);
if (jnode == NULL) {
- jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID);
+ jnode = Lst_Find(stoppedJobs, JobCmpRmtID, (ClientData)hostID);
if (jnode == NULL) {
if (DEBUG(JOB)) {
Error("Evicting host(%d) not in table", hostID);
diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h
index 885adaeb572..34c234670ba 100644
--- a/usr.bin/make/lst.h
+++ b/usr.bin/make/lst.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lst.h,v 1.10 1999/12/18 21:58:07 espie Exp $ */
+/* $OpenBSD: lst.h,v 1.11 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: lst.h,v 1.7 1996/11/06 17:59:12 christos Exp $ */
/*
@@ -60,6 +60,7 @@
typedef struct Lst *Lst;
typedef struct LstNode *LstNode;
+typedef int (*FindProc)__P((ClientData, ClientData));
/*
* NOFREE can be used as the freeProc to Lst_Destroy when the elements are
@@ -117,12 +118,12 @@ ClientData Lst_Datum __P((LstNode));
/*
* Functions for entire lists
*/
+
/* Find an element in a list */
-LstNode Lst_Find __P((Lst, ClientData,
- int (*)(ClientData, ClientData)));
+#define Lst_Find(l, cProc, d) Lst_FindFrom(Lst_First(l), cProc, d)
+
/* Find an element starting from somewhere */
-LstNode Lst_FindFrom __P((Lst, LstNode, ClientData,
- int (*cProc)(ClientData, ClientData)));
+LstNode Lst_FindFrom __P((LstNode, FindProc, ClientData));
/*
* See if the given datum is on the list. Returns the LstNode containing
* the datum
diff --git a/usr.bin/make/lst.lib/Makefile b/usr.bin/make/lst.lib/Makefile
index b682876f8cb..1bf425655ef 100644
--- a/usr.bin/make/lst.lib/Makefile
+++ b/usr.bin/make/lst.lib/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.5 1998/12/05 00:06:31 espie Exp $
+# $OpenBSD: Makefile,v 1.6 1999/12/19 00:04:25 espie Exp $
# $NetBSD: Makefile,v 1.4 1996/11/06 17:59:31 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 \
+ lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.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
diff --git a/usr.bin/make/lst.lib/lstFind.c b/usr.bin/make/lst.lib/lstFind.c
deleted file mode 100644
index 814564c9b8a..00000000000
--- a/usr.bin/make/lst.lib/lstFind.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* $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 $ */
-
-/*
- * Copyright (c) 1988, 1989, 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Adam de Boor.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93";
-#else
-static char rcsid[] = "$OpenBSD: lstFind.c,v 1.5 1999/12/18 21:53:33 espie Exp $";
-#endif
-#endif /* not lint */
-
-/*-
- * LstFind.c --
- * Find a node on a list.
- */
-
-#include "lstInt.h"
-
-/*-
- *-----------------------------------------------------------------------
- * Lst_Find --
- * Find a node on the given list using the given comparison function
- * and the given datum.
- *
- * Results:
- * The found node or NULL if none matches.
- *
- * Side Effects:
- * None.
- *
- *-----------------------------------------------------------------------
- */
-LstNode
-Lst_Find (l, d, cProc)
- Lst l;
- ClientData d;
- int (*cProc) __P((ClientData, ClientData));
-{
- return (Lst_FindFrom (l, Lst_First(l), d, cProc));
-}
-
diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c
index ba033c291fa..8ef31a77330 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.5 1999/12/18 21:53:33 espie Exp $ */
+/* $OpenBSD: lstFindFrom.c,v 1.6 1999/12/19 00:04:26 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.5 1999/12/18 21:53:33 espie Exp $";
+static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.6 1999/12/19 00:04:26 espie Exp $";
#endif
#endif /* not lint */
@@ -55,47 +55,27 @@ static char *rcsid = "$OpenBSD: lstFindFrom.c,v 1.5 1999/12/18 21:53:33 espie Ex
/*-
*-----------------------------------------------------------------------
* Lst_FindFrom --
- * Search for a node starting and ending with the given one on the
- * given list using the passed datum and comparison function to
- * determine when it has been found.
+ * Search for a node through a list, starting with the given node,
+ * using the comparison function and passed datum to determine when
+ * it has been found.
*
* Results:
- * The found node or NULL
+ * The node if found, or NULL
*
* Side Effects:
- * None.
- *
+ * Whatever cProc incurs.
*-----------------------------------------------------------------------
*/
LstNode
-Lst_FindFrom (l, ln, d, cProc)
- Lst l;
- register LstNode ln;
- register ClientData d;
- register int (*cProc) __P((ClientData, ClientData));
+Lst_FindFrom(ln, cProc, d)
+ LstNode ln;
+ FindProc cProc;
+ ClientData d;
{
- register ListNode tln;
- Boolean found = FALSE;
-
- if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) {
- return (NULL);
- }
-
- tln = (ListNode)ln;
+ ListNode tln;
- do {
- if ((*cProc) (tln->datum, d) == 0) {
- found = TRUE;
- break;
- } else {
- tln = tln->nextPtr;
- }
- } while (tln != (ListNode)ln && tln != NULL);
-
- if (found) {
- return ((LstNode)tln);
- } else {
- return (NULL);
- }
+ for (tln = (ListNode)ln; tln != NULL; tln = tln->nextPtr)
+ if ((*cProc)(tln->datum, d) == 0)
+ return (LstNode)tln;
+ return NULL;
}
-
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 8a6a5a3307e..f602dac7b5f 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.26 1999/12/18 21:58:07 espie Exp $ */
+/* $OpenBSD: main.c,v 1.27 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -49,7 +49,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.26 1999/12/18 21:58:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.27 1999/12/19 00:04:25 espie Exp $";
#endif
#endif /* not lint */
@@ -713,7 +713,7 @@ main(argc, argv)
Dir_Expand (_PATH_DEFSYSMK, sysIncPath, sysMkPath);
if (Lst_IsEmpty(sysMkPath))
Fatal("make: no system rules (%s).", _PATH_DEFSYSMK);
- ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
+ ln = Lst_Find(sysMkPath, ReadMakefile, (ClientData)NULL);
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
}
@@ -721,7 +721,7 @@ main(argc, argv)
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
- ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile);
+ ln = Lst_Find(makefiles, ReadMakefile, (ClientData)NULL);
if (ln != NULL)
Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
} else if (!ReadMakefile("BSDmakefile", NULL))
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 7090f455035..412c72545ad 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: suff.c,v 1.20 1999/12/18 21:58:07 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.21 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-static char rcsid[] = "$OpenBSD: suff.c,v 1.20 1999/12/18 21:58:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: suff.c,v 1.21 1999/12/19 00:04:25 espie Exp $";
#endif
#endif /* not lint */
@@ -536,10 +536,10 @@ SuffParseTransform(str, srcPtr, targPtr)
*/
for (;;) {
if (srcLn == NULL) {
- srcLn = Lst_Find(sufflist, (ClientData)str, SuffSuffIsPrefix);
+ srcLn = Lst_Find(sufflist, SuffSuffIsPrefix, (ClientData)str);
} else {
- srcLn = Lst_FindFrom (sufflist, Lst_Succ(srcLn), (ClientData)str,
- SuffSuffIsPrefix);
+ srcLn = Lst_FindFrom(Lst_Succ(srcLn),
+ SuffSuffIsPrefix, (ClientData)str);
}
if (srcLn == NULL) {
/*
@@ -567,7 +567,7 @@ SuffParseTransform(str, srcPtr, targPtr)
single = src;
singleLn = srcLn;
} else {
- targLn = Lst_Find(sufflist, (ClientData)str2, SuffSuffHasNameP);
+ targLn = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)str2);
if (targLn != NULL) {
*srcPtr = src;
*targPtr = (Suff *)Lst_Datum(targLn);
@@ -623,7 +623,7 @@ Suff_AddTransform (line)
*t; /* target suffix */
LstNode ln; /* Node for existing transformation */
- ln = Lst_Find (transforms, (ClientData)line, SuffGNHasNameP);
+ ln = Lst_Find(transforms, SuffGNHasNameP, (ClientData)line);
if (ln == NULL) {
/*
* Make a new graph node for the transformation. It will be filled in
@@ -755,7 +755,7 @@ SuffRebuildGraph(transformp, sp)
*/
cp = SuffStrIsPrefix(s->name, transform->name);
if (cp != (char *)NULL) {
- ln = Lst_Find(sufflist, (ClientData)cp, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)cp);
if (ln != NULL) {
/*
* Found target. Link in and return, since it can't be anything
@@ -777,7 +777,7 @@ SuffRebuildGraph(transformp, sp)
* Null-terminate the source suffix in order to find it.
*/
cp[1] = '\0';
- ln = Lst_Find(sufflist, (ClientData)transform->name, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)transform->name);
/*
* Replace the start of the target suffix
*/
@@ -815,7 +815,7 @@ Suff_AddSuffix (str)
Suff *s; /* new suffix descriptor */
LstNode ln;
- ln = Lst_Find (sufflist, (ClientData)str, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)str);
if (ln == NULL) {
s = (Suff *) emalloc (sizeof (Suff));
@@ -858,7 +858,7 @@ Suff_GetPath (sname)
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname);
if (ln == NULL) {
return (NULL);
} else {
@@ -954,7 +954,7 @@ Suff_AddInclude (sname)
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname);
if (ln != NULL) {
s = (Suff *) Lst_Datum (ln);
s->flags |= SUFF_INCLUDE;
@@ -984,7 +984,7 @@ Suff_AddLib (sname)
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)sname, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)sname);
if (ln != NULL) {
s = (Suff *) Lst_Datum (ln);
s->flags |= SUFF_LIBRARY;
@@ -1266,8 +1266,8 @@ SuffFindCmds (targ, slst)
* The node matches the prefix ok, see if it has a known
* suffix.
*/
- ln = Lst_Find (sufflist, (ClientData)&cp[prefLen],
- SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP,
+ (ClientData)&cp[prefLen]);
if (ln != NULL) {
/*
* It even has a known suffix, see if there's a transformation
@@ -1482,7 +1482,7 @@ SuffExpandChildren(cgnp, pgnp)
* Else use the default system search path.
*/
cp = cgn->name + strlen(cgn->name);
- ln = Lst_Find(sufflist, (ClientData)cp, SuffSuffIsSuffixP);
+ ln = Lst_Find(sufflist, SuffSuffIsSuffixP, (ClientData)cp);
if (DEBUG(SUFF)) {
printf("Wildcard expanding \"%s\"...", cgn->name);
@@ -1611,7 +1611,7 @@ SuffApplyTransform(tGn, sGn, t, s)
* Locate the transformation rule itself
*/
tname = str_concat(s->name, t->name, 0);
- ln = Lst_Find(transforms, (ClientData)tname, SuffGNHasNameP);
+ ln = Lst_Find(transforms, SuffGNHasNameP, (ClientData)tname);
free(tname);
if (ln == NULL) {
@@ -1758,7 +1758,7 @@ SuffFindArchiveDeps(gn, slst)
/*
* Use first matching suffix...
*/
- ln = Lst_Find(ms->parents, eoarch, SuffSuffIsSuffixP);
+ ln = Lst_Find(ms->parents, SuffSuffIsSuffixP, eoarch);
if (ln != NULL) {
/*
@@ -1860,7 +1860,7 @@ SuffFindNormalDeps(gn, slst)
/*
* Look for next possible suffix...
*/
- ln = Lst_FindFrom(sufflist, ln, eoname, SuffSuffIsSuffixP);
+ ln = Lst_FindFrom(ln, SuffSuffIsSuffixP, eoname);
if (ln != NULL) {
int prefLen; /* Length of the prefix */
@@ -2249,7 +2249,7 @@ SuffFindDeps (gn, slst)
LstNode ln;
Suff *s;
- ln = Lst_Find (sufflist, (ClientData)LIBSUFF, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)LIBSUFF);
if (gn->suffix)
gn->suffix->refCount--;
if (ln != NULL) {
@@ -2295,7 +2295,7 @@ Suff_SetNull(name)
Suff *s;
LstNode ln;
- ln = Lst_Find(sufflist, (ClientData)name, SuffSuffHasNameP);
+ ln = Lst_Find(sufflist, SuffSuffHasNameP, (ClientData)name);
if (ln != NULL) {
s = (Suff *)Lst_Datum(ln);
if (suffNull != (Suff *)NULL) {
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 578c5332f14..7a6e58ff974 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.27 1999/12/18 21:58:08 espie Exp $ */
+/* $OpenBSD: var.c,v 1.28 1999/12/19 00:04:25 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -70,7 +70,7 @@
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: var.c,v 1.27 1999/12/18 21:58:08 espie Exp $";
+static char rcsid[] = "$OpenBSD: var.c,v 1.28 1999/12/19 00:04:25 espie Exp $";
#endif
#endif /* not lint */
@@ -320,16 +320,16 @@ VarFind (name, ctxt, flags)
* look for it in VAR_CMD, VAR_GLOBAL and the environment, in that order,
* depending on the FIND_* flags in 'flags'
*/
- var = Lst_Find(ctxt->context, (ClientData)name, VarCmp);
+ var = Lst_Find(ctxt->context, VarCmp, (ClientData)name);
if ((var == NULL) && (flags & FIND_CMD) && (ctxt != VAR_CMD))
- var = Lst_Find (VAR_CMD->context, (ClientData)name, VarCmp);
+ var = Lst_Find(VAR_CMD->context, VarCmp, (ClientData)name);
if (!checkEnvFirst && (var == NULL) && (flags & FIND_GLOBAL) &&
(ctxt != VAR_GLOBAL)) {
- var = Lst_Find (VAR_GLOBAL->context, (ClientData)name, VarCmp);
+ var = Lst_Find(VAR_GLOBAL->context, VarCmp, (ClientData)name);
}
if ((var == NULL) && (flags & FIND_ENV)) {
- var = Lst_Find(VAR_ENV->context, (ClientData)name, VarCmp);
+ var = Lst_Find(VAR_ENV->context, VarCmp, (ClientData)name);
if (var == NULL) {
char *env;
@@ -339,7 +339,7 @@ VarFind (name, ctxt, flags)
}
if (var == NULL && checkEnvFirst && (flags & FIND_GLOBAL) &&
(ctxt != VAR_GLOBAL))
- var = Lst_Find(VAR_GLOBAL->context, (ClientData)name, VarCmp);
+ var = Lst_Find(VAR_GLOBAL->context, VarCmp, (ClientData)name);
if (var == NULL)
return NULL;
else
@@ -435,7 +435,7 @@ Var_Delete(name, ctxt)
if (DEBUG(VAR)) {
printf("%s:delete %s\n", ctxt->name, name);
}
- ln = Lst_Find(ctxt->context, (ClientData)name, VarCmp);
+ ln = Lst_Find(ctxt->context, VarCmp, (ClientData)name);
if (ln != NULL) {
register Var *v;