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): unexport CachedDir internals



details:   https://anonhg.NetBSD.org/src/rev/50df92a1931a
branches:  trunk
changeset: 957469:50df92a1931a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 29 08:48:24 2020 +0000

description:
make(1): unexport CachedDir internals

diffstat:

 usr.bin/make/dir.c |  30 ++++++++++++++++++++++++++++--
 usr.bin/make/dir.h |  18 ++----------------
 2 files changed, 30 insertions(+), 18 deletions(-)

diffs (83 lines):

diff -r dbb47d95a4e8 -r 50df92a1931a usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Sun Nov 29 01:40:26 2020 +0000
+++ b/usr.bin/make/dir.c        Sun Nov 29 08:48:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.228 2020/11/29 01:40:26 rillig Exp $ */
+/*     $NetBSD: dir.c,v 1.229 2020/11/29 08:48:24 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*     "@(#)dir.c      8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: dir.c,v 1.228 2020/11/29 01:40:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.229 2020/11/29 08:48:24 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -214,6 +214,32 @@
 
 typedef ListNode SearchPathNode;
 
+/* A cache for the filenames in a directory. */
+struct CachedDir {
+       /*
+        * Name of directory, either absolute or relative to the current
+        * directory. The name is not normalized in any way, that is, "."
+        * and "./." are different.
+        *
+        * Not sure what happens when .CURDIR is assigned a new value; see
+        * Parse_DoVar.
+        */
+       char *name;
+
+       /*
+        * The number of SearchPaths with this directory.
+        *
+        * TODO: Log the reference counting; see Dir_Expand, partPath.
+        */
+       int refCount;
+
+       /* The number of times a file in this directory has been found. */
+       int hits;
+
+       /* The names of the files in the directory. */
+       HashSet files;
+};
+
 SearchPath dirSearchPath = LST_INIT;   /* main search path */
 
 /* A list of cached directories, with fast lookup by directory name. */
diff -r dbb47d95a4e8 -r 50df92a1931a usr.bin/make/dir.h
--- a/usr.bin/make/dir.h        Sun Nov 29 01:40:26 2020 +0000
+++ b/usr.bin/make/dir.h        Sun Nov 29 08:48:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.h,v 1.37 2020/11/28 22:56:01 rillig Exp $  */
+/*     $NetBSD: dir.h,v 1.38 2020/11/29 08:48:24 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,21 +75,7 @@
 #ifndef        MAKE_DIR_H
 #define        MAKE_DIR_H
 
-/* A cache for the filenames in a directory. */
-typedef struct CachedDir {
-    char *name;                        /* Name of directory, either absolute or
-                                * relative to the current directory.
-                                * The name is not normalized in any way,
-                                * that is, "." and "./." are different.
-                                *
-                                * Not sure what happens when .CURDIR is
-                                * assigned a new value; see Parse_DoVar. */
-    int refCount;              /* Number of SearchPaths with this directory */
-    /* TODO: Log the reference counting; see Dir_Expand, partPath. */
-    int hits;                  /* The number of times a file in this
-                                * directory has been found */
-    HashSet files;             /* The files in the directory. */
-} CachedDir;
+typedef struct CachedDir CachedDir;
 
 void Dir_Init(void);
 void Dir_InitDir(const char *);



Home | Main Index | Thread Index | Old Index