Mercurial > trustbridge
comparison common/portpath.h @ 188:a3bde2aaabd9
merged.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 26 Mar 2014 09:12:10 +0100 |
parents | 70d627e9e801 |
children | 17e1c8f37d72 |
comparison
equal
deleted
inserted
replaced
187:0c06a608e15f | 188:a3bde2aaabd9 |
---|---|
1 #ifndef PORTPATH_H | 1 #ifndef PORTPATH_H |
2 #define PORTPATH_H | 2 #define PORTPATH_H |
3 | |
4 #include <stdbool.h> | |
3 | 5 |
4 /** | 6 /** |
5 * @file portpath.h | 7 * @file portpath.h |
6 * @brief Platform independent functions for file and path handling. | 8 * @brief Platform independent functions for file and path handling. |
7 * @details portpath contains functions to handle file and path names | 9 * @details portpath contains functions to handle file and path names |
8 * in a platform independent way. The code unsing this functions | 10 * in a platform independent way. The code unsing this functions |
9 * should be protable between GNU/Linux and Windows32 systems. | 11 * should be protable between GNU/Linux and Windows32 systems. |
10 */ | 12 */ |
11 | |
12 /** | |
13 * @brief portable version of dirname | |
14 * @details return the directory component of the given path. | |
15 * The argument path may be altered by the function. | |
16 * @param[inout] path the pathname | |
17 * @returns a pointer to the string containing the directory component | |
18 */ | |
19 char *port_dirname(char *path); | |
20 | |
21 | 13 |
22 /** | 14 /** |
23 * @brief portable version of dirname | 15 * @brief portable version of dirname |
24 * @details return the directory component of the given path. | 16 * @details return the directory component of the given path. |
25 * The argument path may be altered by the function. | 17 * The argument path may be altered by the function. |
36 * @param[in] path the original pathname | 28 * @param[in] path the original pathname |
37 * @returns a pointer to the resolved path or NULL on error | 29 * @returns a pointer to the resolved path or NULL on error |
38 */ | 30 */ |
39 char *port_realpath(char *path); | 31 char *port_realpath(char *path); |
40 | 32 |
33 /** | |
34 * @brief test if a file exists | |
35 * @details uses a platform specific stat call to test if the given | |
36 * file exists. | |
37 * @param[in] path the path to the file | |
38 * @returns true if the file exists and false otherwise | |
39 */ | |
40 bool port_fileexits(char *path); | |
41 | |
42 /** | |
43 * @brief test if a file is a directory | |
44 * @details uses a platform specific stat call to test if the given | |
45 * file is an directory. | |
46 * @param[in] path the path to the file | |
47 * @returns true if the file is an directory and false otherwise | |
48 */ | |
49 bool port_isdir(char *path); | |
50 | |
41 #endif | 51 #endif |