summaryrefslogtreecommitdiff
path: root/usr.bin/make/dir.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-09-14 13:43:32 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-09-14 13:43:32 +0000
commitc4465c8c2691ab013c83c9c05cb5c22c8131bcf7 (patch)
tree85f30d79a92b6c15a652ccb192883b37e8f4dbce /usr.bin/make/dir.h
parentfb69cad801d15905ce6c6dbbca475698712adb3d (diff)
- new DirReadDir internal function, that just reads a directory from
the disk or from a cache. - use it in Dir_AddDir, and directly to set up dot. - change Dir_AddDir to use string intervals, as this simplifies dependend functions. - set up an open-hashing cache for opened directory names. - add_dirpath() function in main, to simplify code. - simplify cleaning-up directories, as Dir_ClearPath is overkill.
Diffstat (limited to 'usr.bin/make/dir.h')
-rw-r--r--usr.bin/make/dir.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/make/dir.h b/usr.bin/make/dir.h
index a53ab24faaf..bc563fe76d7 100644
--- a/usr.bin/make/dir.h
+++ b/usr.bin/make/dir.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dir.h,v 1.7 2000/09/14 13:32:06 espie Exp $ */
+/* $OpenBSD: dir.h,v 1.8 2000/09/14 13:43:31 espie Exp $ */
/* $NetBSD: dir.h,v 1.4 1996/11/06 17:59:05 christos Exp $ */
/*
@@ -47,12 +47,12 @@
#ifndef _DIR
#define _DIR
-typedef struct Path {
- char *name; /* Name of directory */
- int refCount; /* Number of paths with this directory */
- int hits; /* the number of times a file in this
+typedef struct Path_ {
+ int refCount; /* Number of paths with this directory */
+ int hits; /* the number of times a file in this
* directory has been found */
- Hash_Table files; /* Hash table of files in directory */
+ Hash_Table files; /* Hash table of files in directory */
+ char name[1]; /* Name of directory */
} Path;
extern void Dir_Init __P((void));
@@ -61,7 +61,7 @@ extern Boolean Dir_HasWildcards __P((char *));
extern void Dir_Expand __P((char *, Lst, Lst));
extern char *Dir_FindFile __P((char *, Lst));
extern Boolean Dir_MTime __P((GNode *));
-extern void Dir_AddDir __P((Lst, char *));
+extern void Dir_AddDir __P((Lst, const char *, const char *));
extern char *Dir_MakeFlags __P((char *, Lst));
extern void Dir_ClearPath __P((Lst));
extern void Dir_Concat __P((Lst, Lst));