]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/engine/pathsys.h
2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
4 * This file is part of Jam - see jam.c for Copyright information.
8 * pathsys.h - PATHNAME struct
12 * PATHNAME - a name of a file, broken into <grist>dir/base/suffix(member)
14 * <grist> - salt to distinguish between targets that would otherwise have the
15 * same name - it never appears in the bound name of a target.
17 * (member) - archive member name: the syntax is arbitrary, but must agree in
18 * path_parse(), path_build() and the Jambase.
21 #ifndef PATHSYS_VP_20020211_H
22 #define PATHSYS_VP_20020211_H
28 typedef struct _pathpart
34 typedef struct _pathname
38 #define f_grist part[ 0 ]
39 #define f_root part[ 1 ]
40 #define f_dir part[ 2 ]
41 #define f_base part[ 3 ]
42 #define f_suffix part[ 4 ]
43 #define f_member part[ 5 ]
47 void path_build( PATHNAME
*, string
* file
);
48 void path_parse( char const * file
, PATHNAME
* );
49 void path_parent( PATHNAME
* );
50 int path_translate_to_os( char const *, string
* file
);
52 /* Given a path, returns an object containing an equivalent path in canonical
53 * format that can be used as a unique key for that path. Equivalent paths such
54 * as a/b, A\B, and a\B on NT all yield the same key.
56 OBJECT
* path_as_key( OBJECT
* path
);
58 /* Called as an optimization when we know we have a path that is already in its
59 * canonical/long/key form. Avoids the need for some subsequent path_as_key()
60 * call to do a potentially expensive path conversion requiring access to the
61 * actual underlying file system.
63 void path_register_key( OBJECT
* canonic_path
);
65 /* Returns a static pointer to the system dependent path to the temporary
66 * directory. NOTE: Does *not* include a trailing path separator.
68 string
const * path_tmpdir( void );
70 /* Returns a new temporary name. */
71 OBJECT
* path_tmpnam( void );
73 /* Returns a new temporary path. */
74 OBJECT
* path_tmpfile( void );
76 /* Give the first argument to 'main', return a full path to our executable.
77 * Returns null in the unlikely case it cannot be determined. Caller is
78 * responsible for freeing the string.
80 * Implemented in jam.c
82 char * executable_path( char const * argv0
);
84 void path_done( void );