summaryrefslogtreecommitdiff
path: root/src/basic/path-util.h
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-06-01 14:11:37 +0900
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit0809ca2a5a48ba63a3ba0d5d579d897547751c36 (patch)
treec38ab30c0e1e1521968f772c3507e71b581ade34 /src/basic/path-util.h
parent88272c0fe5aca0bcdb60aeb1b4d5f4cf1c9a47b4 (diff)
path-util: introduce path_simplify_and_warn()
Diffstat (limited to 'src/basic/path-util.h')
-rw-r--r--src/basic/path-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/basic/path-util.h b/src/basic/path-util.h
index 4fabe06e6..489a6c472 100644
--- a/src/basic/path-util.h
+++ b/src/basic/path-util.h
@@ -181,3 +181,11 @@ bool empty_or_root(const char *root);
static inline const char *empty_to_root(const char *path) {
return isempty(path) ? "/" : path;
}
+
+enum {
+ PATH_CHECK_FATAL = 1 << 0, /* If not set, then error message is appended with 'ignoring'. */
+ PATH_CHECK_ABSOLUTE = 1 << 1,
+ PATH_CHECK_RELATIVE = 1 << 2,
+};
+
+int path_simplify_and_warn(char *path, unsigned flag, const char *unit, const char *filename, unsigned line, const char *lvalue);