it's now safe (i hope) to include Jambase.configure multiple times
[k8jam.git] / src / pathsys.h
blob44848f2300b47f437944785137cd54c751c1fe78
1 /*
2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
3 * This file is part of Jam - see jam.c for Copyright information.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * pathsys.h - PATHNAME struct
21 #ifndef JAMH_PATHSYS_H
22 #define JAMH_PATHSYS_H
25 * PATHNAME - a name of a file, broken into <grist>dir/base/suffix(member)
27 * <grist> is salt to distinguish between targets that otherwise would
28 * have the same name: it never appears in the bound name of a target.
29 * (member) is an archive member name: the syntax is arbitrary, but must
30 * agree in path_parse(), path_build() and the Jambase.
32 * On VMS, we keep track of whether the original path was a directory
33 * (without a file), so that $(VAR:D) can climb to the parent.
36 typedef struct _pathname PATHNAME;
37 typedef struct _pathpart PATHPART;
39 struct _pathpart {
40 const char *ptr;
41 int len;
45 #define f_grist part[0]
46 #define f_root part[1]
47 #define f_dir part[2]
48 #define f_base part[3]
49 #define f_suffix part[4]
50 #define f_member part[5]
52 struct _pathname {
53 PATHPART part[6];
57 extern void path_build (char *file, const PATHNAME *f);
58 extern void path_parse (const char *file, PATHNAME *f);
59 extern void path_parent (PATHNAME *f);
61 /* if 'pwd'is NULL, use getcwd() */
62 extern char *normalize_path (const char *path, char *buffer, size_t bufferSize, const char *pwd);
65 #endif