]> wimlib.net Git - wimlib/blob - include/wimlib/paths.h
Improved error reporting if loading capture configuration file fails
[wimlib] / include / wimlib / paths.h
1 #ifndef _WIMLIB_PATHS_H
2 #define _WIMLIB_PATHS_H
3
4 #include "wimlib/compiler.h"
5 #include "wimlib/types.h"
6
7 const tchar *
8 path_basename(const tchar *path);
9
10 const tchar *
11 path_basename_with_len(const tchar *path, size_t len);
12
13 extern const tchar *
14 path_stream_name(const tchar *path);
15
16 extern void
17 do_canonicalize_path(const tchar *in, tchar *out);
18
19 extern tchar *
20 canonicalize_wim_path(const tchar *wim_path) _malloc_attribute;
21
22 /* is_any_path_separator() - characters treated as path separators in WIM path
23  * specifications and capture configuration files (the former will be translated
24  * to WIM_PATH_SEPARATOR; the latter will be translated to
25  * OS_PREFERRED_PATH_SEPARATOR)
26  *
27  * OS_PREFERRED_PATH_SEPARATOR - preferred (or only) path separator on the
28  * operating system.  Used when constructing filesystem paths to extract or
29  * archive.
30  *
31  * WIM_PATH_SEPARATOR - character treated as path separator for WIM paths.
32  * Currently needs to be '/' on UNIX for the WIM mounting code to work properly.
33  */
34
35 #ifdef __WIN32__
36 #  define OS_PREFERRED_PATH_SEPARATOR L'\\'
37 #  define is_any_path_separator(c) ((c) == L'/' || (c) == L'\\')
38 #else
39 #  define OS_PREFERRED_PATH_SEPARATOR '/'
40 #  define is_any_path_separator(c) ((c) == '/' || (c) == '\\')
41 #endif
42
43 #define WIM_PATH_SEPARATOR WIMLIB_WIM_PATH_SEPARATOR
44
45 #endif /* _WIMLIB_PATHS_H */