Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): rename Dir_Expand to SearchPath_Expand



details:   https://anonhg.NetBSD.org/src/rev/833f38c9940a
branches:  trunk
changeset: 980070:833f38c9940a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 23 10:48:49 2021 +0000

description:
make(1): rename Dir_Expand to SearchPath_Expand

The main subject of this function is the search path.  In this search
path the pattern is expanded.

diffstat:

 usr.bin/make/arch.c            |   6 +++---
 usr.bin/make/dir.c             |  13 +++++++------
 usr.bin/make/dir.h             |   4 ++--
 usr.bin/make/main.c            |   7 ++++---
 usr.bin/make/parse.c           |   6 +++---
 usr.bin/make/suff.c            |   6 +++---
 usr.bin/make/unit-tests/dir.mk |   4 ++--
 7 files changed, 24 insertions(+), 22 deletions(-)

diffs (194 lines):

diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/arch.c       Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.193 2021/01/09 16:06:09 rillig Exp $        */
+/*     $NetBSD: arch.c,v 1.194 2021/01/23 10:48:49 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*     "@(#)arch.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: arch.c,v 1.193 2021/01/09 16:06:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.194 2021/01/23 10:48:49 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -341,7 +341,7 @@
 
                } else if (Dir_HasWildcards(memName)) {
                        StringList members = LST_INIT;
-                       Dir_Expand(memName, &dirSearchPath, &members);
+                       SearchPath_Expand(&dirSearchPath, memName, &members);
 
                        while (!Lst_IsEmpty(&members)) {
                                char *member = Lst_Dequeue(&members);
diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/dir.c        Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.255 2021/01/10 21:20:46 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.256 2021/01/23 10:48:49 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -89,8 +89,9 @@
  *                     Returns TRUE if the name given it needs to
  *                     be wildcard-expanded.
  *
- *     Dir_Expand      Given a pattern and a path, return a Lst of names
- *                     which match the pattern on the search path.
+ *     SearchPath_Expand
+ *                     Expand a filename pattern to find all matching files
+ *                     from the search path.
  *
  *     Dir_FindFile    Searches for a file on a given search path.
  *                     If it exists, the entire path is returned.
@@ -137,7 +138,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.255 2021/01/10 21:20:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.256 2021/01/23 10:48:49 rillig Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -797,7 +798,7 @@
                                     suffix, suffix_len);
 
                if (contains_wildcard(file)) {
-                       Dir_Expand(file, path, expansions);
+                       SearchPath_Expand(path, file, expansions);
                        free(file);
                } else {
                        Lst_Append(expansions, file);
@@ -843,7 +844,7 @@
  *     expansions      the list on which to place the results
  */
 void
-Dir_Expand(const char *word, SearchPath *path, StringList *expansions)
+SearchPath_Expand(SearchPath *path, const char *word, StringList *expansions)
 {
        const char *cp;
 
diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/dir.h
--- a/usr.bin/make/dir.h        Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/dir.h        Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.h,v 1.40 2020/12/01 19:28:32 rillig Exp $  */
+/*     $NetBSD: dir.h,v 1.41 2021/01/23 10:48:49 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
 void Dir_End(void);
 void Dir_SetPATH(void);
 Boolean Dir_HasWildcards(const char *);
-void Dir_Expand(const char *, SearchPath *, StringList *);
+void SearchPath_Expand(SearchPath *, const char *, StringList *);
 char *Dir_FindFile(const char *, SearchPath *);
 char *Dir_FindHereOrAbove(const char *, const char *);
 void Dir_UpdateMTime(GNode *, Boolean);
diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/main.c       Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.514 2021/01/19 20:51:46 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.515 2021/01/23 10:48:49 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -110,7 +110,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.514 2021/01/19 20:51:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.515 2021/01/23 10:48:49 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -1214,8 +1214,9 @@
        StringListNode *ln;
        StringList sysMkPath = LST_INIT;
 
-       Dir_Expand(_PATH_DEFSYSMK,
+       SearchPath_Expand(
            Lst_IsEmpty(sysIncPath) ? defSysIncPath : sysIncPath,
+           _PATH_DEFSYSMK,
            &sysMkPath);
        if (Lst_IsEmpty(&sysMkPath))
                Fatal("%s: no system rules (%s).", progname, _PATH_DEFSYSMK);
diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/parse.c      Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.527 2021/01/21 14:30:01 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.528 2021/01/23 10:48:49 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.527 2021/01/21 14:30:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.528 2021/01/23 10:48:49 rillig Exp $");
 
 /* types and constants */
 
@@ -1176,7 +1176,7 @@
                 */
                SearchPath *emptyPath = SearchPath_New();
 
-               Dir_Expand(line, emptyPath, curTargs);
+               SearchPath_Expand(emptyPath, line, curTargs);
 
                SearchPath_Free(emptyPath);
        } else {
diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/suff.c       Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.335 2021/01/10 21:20:46 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.336 2021/01/23 10:48:49 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.335 2021/01/10 21:20:46 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.336 2021/01/23 10:48:49 rillig Exp $");
 
 typedef List SuffixList;
 typedef ListNode SuffixListNode;
@@ -1246,7 +1246,7 @@
         * Expand the word along the chosen path
         */
        Lst_Init(&expansions);
-       Dir_Expand(cgn->name, Suff_FindPath(cgn), &expansions);
+       SearchPath_Expand(Suff_FindPath(cgn), cgn->name, &expansions);
 
        while (!Lst_IsEmpty(&expansions)) {
                GNode *gn;
diff -r ad8b661bb77a -r 833f38c9940a usr.bin/make/unit-tests/dir.mk
--- a/usr.bin/make/unit-tests/dir.mk    Sat Jan 23 07:34:00 2021 +0000
+++ b/usr.bin/make/unit-tests/dir.mk    Sat Jan 23 10:48:49 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: dir.mk,v 1.8 2020/11/03 18:42:33 rillig Exp $
+# $NetBSD: dir.mk,v 1.9 2021/01/23 10:48:49 rillig Exp $
 #
 # Tests for dir.c.
 
@@ -79,7 +79,7 @@
 
 # Demonstrate debug logging for filename expansion, especially curly braces.
 .MAKEFLAGS: -dd
-# The below line does not call Dir_Expand yet.
+# The below line does not call SearchPath_Expand yet.
 # It is expanded only when necessary, that is, when the 'debug' target is
 # indeed made.
 debug: {{thi,fou}r,fif}twen



Home | Main Index | Thread Index | Old Index