option.c: fixed warnings
[k8jam.git] / src / pathsys.h
blobb47e3aa5d4484f667bc164099b1777150f686119
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, version 3 of the License ONLY.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * pathsys.h - PATHNAME struct
20 #ifndef JAMH_PATHSYS_H
21 #define JAMH_PATHSYS_H
24 * PATHNAME - a name of a file, broken into <grist>dir/base/suffix(member)
26 * <grist> is salt to distinguish between targets that otherwise would
27 * have the same name: it never appears in the bound name of a target.
28 * (member) is an archive member name: the syntax is arbitrary, but must
29 * agree in path_parse(), path_build() and the Jambase.
31 * On VMS, we keep track of whether the original path was a directory
32 * (without a file), so that $(VAR:D) can climb to the parent.
35 typedef struct _pathname PATHNAME;
36 typedef struct _pathpart PATHPART;
38 struct _pathpart {
39 const char *ptr;
40 int len;
44 #define f_grist part[0]
45 #define f_root part[1]
46 #define f_dir part[2]
47 #define f_base part[3]
48 #define f_suffix part[4]
49 #define f_member part[5]
51 struct _pathname {
52 PATHPART part[6];
56 extern void path_build (char *file, const PATHNAME *f);
57 extern void path_parse (const char *file, PATHNAME *f);
58 extern void path_parent (PATHNAME *f);
60 /* if 'pwd'is NULL, use getcwd() */
61 extern char *normalize_path (const char *path, char *buffer, size_t bufferSize, const char *pwd);
64 #endif