aboutsummaryrefslogtreecommitdiff
path: root/include/util.h
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2017-04-14 23:37:43 +0300
committerFurkan Sahin <furkan-dev@proton.me>2017-04-14 23:37:43 +0300
commit619145b12ce433feceacded9eed1da4ac6f145a5 (patch)
treecb826b8dba53c28dff9b1c440007e1b21a6fba5e /include/util.h
parentaed6f8dcd8f98ee060cd1f9de58a2fce44435fdf (diff)
Add resolve_path() to utils
Diffstat (limited to 'include/util.h')
-rw-r--r--include/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h
index 839af265..e5365458 100644
--- a/include/util.h
+++ b/include/util.h
@@ -49,4 +49,12 @@ pid_t get_parent_pid(pid_t pid);
*/
uint32_t parse_color(const char *color);
+/**
+ * Given a path string, recurseively resolves any symlinks to their targets
+ * (which may be a file, directory) and returns the result.
+ * argument is returned. Caller must free the returned buffer.
+ * If an error occures, if the path does not exist or if the path corresponds
+ * to a dangling symlink, NULL is returned.
+ */
+char* resolve_path(const char* path);
#endif