Module Name: src
Committed By: rillig
Date: Sun Nov 29 08:48:24 UTC 2020
Modified Files:
src/usr.bin/make: dir.c dir.h
Log Message:
make(1): unexport CachedDir internals
To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/usr.bin/make/dir.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/make/dir.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.228 src/usr.bin/make/dir.c:1.229
--- src/usr.bin/make/dir.c:1.228 Sun Nov 29 01:40:26 2020
+++ src/usr.bin/make/dir.c Sun Nov 29 08:48:24 2020
@@ -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 CachedDirListNode;
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. */
Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.37 src/usr.bin/make/dir.h:1.38
--- src/usr.bin/make/dir.h:1.37 Sat Nov 28 22:56:01 2020
+++ src/usr.bin/make/dir.h Sun Nov 29 08:48:24 2020
@@ -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 *);