1321653Ssjg/*	$NetBSD: dir.h,v 1.18 2017/05/31 22:02:06 maya Exp $	*/
2236769Sobrien
3236769Sobrien/*
4236769Sobrien * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
5236769Sobrien *
6236769Sobrien * This code is derived from software contributed to Berkeley by
7236769Sobrien * Adam de Boor.
8236769Sobrien *
9236769Sobrien * Redistribution and use in source and binary forms, with or without
10236769Sobrien * modification, are permitted provided that the following conditions
11236769Sobrien * are met:
12236769Sobrien * 1. Redistributions of source code must retain the above copyright
13236769Sobrien *    notice, this list of conditions and the following disclaimer.
14236769Sobrien * 2. Redistributions in binary form must reproduce the above copyright
15236769Sobrien *    notice, this list of conditions and the following disclaimer in the
16236769Sobrien *    documentation and/or other materials provided with the distribution.
17236769Sobrien * 3. Neither the name of the University nor the names of its contributors
18236769Sobrien *    may be used to endorse or promote products derived from this software
19236769Sobrien *    without specific prior written permission.
20236769Sobrien *
21236769Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22236769Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23236769Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24236769Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25236769Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26236769Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27236769Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28236769Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29236769Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30236769Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31236769Sobrien * SUCH DAMAGE.
32236769Sobrien *
33236769Sobrien *	from: @(#)dir.h	8.1 (Berkeley) 6/6/93
34236769Sobrien */
35236769Sobrien
36236769Sobrien/*
37236769Sobrien * Copyright (c) 1988, 1989 by Adam de Boor
38236769Sobrien * Copyright (c) 1989 by Berkeley Softworks
39236769Sobrien * All rights reserved.
40236769Sobrien *
41236769Sobrien * This code is derived from software contributed to Berkeley by
42236769Sobrien * Adam de Boor.
43236769Sobrien *
44236769Sobrien * Redistribution and use in source and binary forms, with or without
45236769Sobrien * modification, are permitted provided that the following conditions
46236769Sobrien * are met:
47236769Sobrien * 1. Redistributions of source code must retain the above copyright
48236769Sobrien *    notice, this list of conditions and the following disclaimer.
49236769Sobrien * 2. Redistributions in binary form must reproduce the above copyright
50236769Sobrien *    notice, this list of conditions and the following disclaimer in the
51236769Sobrien *    documentation and/or other materials provided with the distribution.
52236769Sobrien * 3. All advertising materials mentioning features or use of this software
53236769Sobrien *    must display the following acknowledgement:
54236769Sobrien *	This product includes software developed by the University of
55236769Sobrien *	California, Berkeley and its contributors.
56236769Sobrien * 4. Neither the name of the University nor the names of its contributors
57236769Sobrien *    may be used to endorse or promote products derived from this software
58236769Sobrien *    without specific prior written permission.
59236769Sobrien *
60236769Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
61236769Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
62236769Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
63236769Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
64236769Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
65236769Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
66236769Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67236769Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
68236769Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
69236769Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70236769Sobrien * SUCH DAMAGE.
71236769Sobrien *
72236769Sobrien *	from: @(#)dir.h	8.1 (Berkeley) 6/6/93
73236769Sobrien */
74236769Sobrien
75236769Sobrien/* dir.h --
76236769Sobrien */
77236769Sobrien
78321653Ssjg#ifndef	MAKE_DIR_H
79321653Ssjg#define	MAKE_DIR_H
80236769Sobrien
81236769Sobrientypedef struct Path {
82236769Sobrien    char         *name;	    	/* Name of directory */
83236769Sobrien    int	    	  refCount; 	/* Number of paths with this directory */
84236769Sobrien    int		  hits;	    	/* the number of times a file in this
85236769Sobrien				 * directory has been found */
86236769Sobrien    Hash_Table    files;    	/* Hash table of files in directory */
87236769Sobrien} Path;
88236769Sobrien
89236769Sobrienvoid Dir_Init(const char *);
90236769Sobrienvoid Dir_InitCur(const char *);
91236769Sobrienvoid Dir_InitDot(void);
92236769Sobrienvoid Dir_End(void);
93236769Sobrienvoid Dir_SetPATH(void);
94236769SobrienBoolean Dir_HasWildcards(char *);
95236769Sobrienvoid Dir_Expand(const char *, Lst, Lst);
96236769Sobrienchar *Dir_FindFile(const char *, Lst);
97236769Sobrienint Dir_FindHereOrAbove(char *, char *, char *, int);
98236769Sobrienint Dir_MTime(GNode *, Boolean);
99236769SobrienPath *Dir_AddDir(Lst, const char *);
100236769Sobrienchar *Dir_MakeFlags(const char *, Lst);
101236769Sobrienvoid Dir_ClearPath(Lst);
102236769Sobrienvoid Dir_Concat(Lst, Lst);
103236769Sobrienvoid Dir_PrintDirectories(void);
104236769Sobrienvoid Dir_PrintPath(Lst);
105236769Sobrienvoid Dir_Destroy(void *);
106236769Sobrienvoid * Dir_CopyDir(void *);
107236769Sobrien
108321653Ssjg#endif /* MAKE_DIR_H */
109