dir.h (a34d5fb1) | dir.h (ca58f742) |
---|---|
1/* $NetBSD: dir.h,v 1.43 2021/02/05 05:48:19 rillig Exp $ */ | 1/* $NetBSD: dir.h,v 1.18 2017/05/31 22:02:06 maya Exp $ */ |
2 3/* 4 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Adam de Boor. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 57 unchanged lines hidden (view full) --- 67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 70 * SUCH DAMAGE. 71 * 72 * from: @(#)dir.h 8.1 (Berkeley) 6/6/93 73 */ 74 | 2 3/* 4 * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Adam de Boor. 8 * 9 * Redistribution and use in source and binary forms, with or without --- 57 unchanged lines hidden (view full) --- 67 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 68 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 69 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 70 * SUCH DAMAGE. 71 * 72 * from: @(#)dir.h 8.1 (Berkeley) 6/6/93 73 */ 74 |
75#ifndef MAKE_DIR_H 76#define MAKE_DIR_H | 75/* dir.h -- 76 */ |
77 | 77 |
78typedef struct CachedDir CachedDir; | 78#ifndef MAKE_DIR_H 79#define MAKE_DIR_H |
79 | 80 |
80void Dir_Init(void); | 81typedef struct Path { 82 char *name; /* Name of directory */ 83 int refCount; /* Number of paths with this directory */ 84 int hits; /* the number of times a file in this 85 * directory has been found */ 86 Hash_Table files; /* Hash table of files in directory */ 87} Path; 88 89void Dir_Init(const char *); |
81void Dir_InitCur(const char *); 82void Dir_InitDot(void); 83void Dir_End(void); 84void Dir_SetPATH(void); | 90void Dir_InitCur(const char *); 91void Dir_InitDot(void); 92void Dir_End(void); 93void Dir_SetPATH(void); |
85Boolean Dir_HasWildcards(const char *); 86void SearchPath_Expand(SearchPath *, const char *, StringList *); 87char *Dir_FindFile(const char *, SearchPath *); 88char *Dir_FindHereOrAbove(const char *, const char *); 89void Dir_UpdateMTime(GNode *, Boolean); 90CachedDir *SearchPath_Add(SearchPath *, const char *); 91char *SearchPath_ToFlags(SearchPath *, const char *); 92void SearchPath_Clear(SearchPath *); 93void SearchPath_AddAll(SearchPath *, SearchPath *); | 94Boolean Dir_HasWildcards(char *); 95void Dir_Expand(const char *, Lst, Lst); 96char *Dir_FindFile(const char *, Lst); 97int Dir_FindHereOrAbove(char *, char *, char *, int); 98int Dir_MTime(GNode *, Boolean); 99Path *Dir_AddDir(Lst, const char *); 100char *Dir_MakeFlags(const char *, Lst); 101void Dir_ClearPath(Lst); 102void Dir_Concat(Lst, Lst); |
94void Dir_PrintDirectories(void); | 103void Dir_PrintDirectories(void); |
95void SearchPath_Print(const SearchPath *); 96SearchPath *Dir_CopyDirSearchPath(void); | 104void Dir_PrintPath(Lst); 105void Dir_Destroy(void *); 106void * Dir_CopyDir(void *); |
97 | 107 |
98/* Stripped-down variant of struct stat. */ 99struct cached_stat { 100 time_t cst_mtime; 101 mode_t cst_mode; 102}; 103 104int cached_lstat(const char *, struct cached_stat *); 105int cached_stat(const char *, struct cached_stat *); 106 | |
107#endif /* MAKE_DIR_H */ | 108#endif /* MAKE_DIR_H */ |