diff options
author | David Robillard <d@drobilla.net> | 2020-08-05 23:34:52 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-06 17:34:42 +0200 |
commit | 0cdd992e06a090f1965045fade378579ea5ac05d (patch) | |
tree | 0e86807fcc8b8162466eb0cdcb3cf5731a0568bb /src | |
parent | 2dcf6144853eb9fd0b77ba04d36bda73dacaf92e (diff) | |
download | lilv-0cdd992e06a090f1965045fade378579ea5ac05d.tar.gz lilv-0cdd992e06a090f1965045fade378579ea5ac05d.tar.bz2 lilv-0cdd992e06a090f1965045fade378579ea5ac05d.zip |
Add lilv_path_current()
Diffstat (limited to 'src')
-rw-r--r-- | src/filesystem.c | 6 | ||||
-rw-r--r-- | src/filesystem.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/filesystem.c b/src/filesystem.c index 39ba2a2..4ba0bd9 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -115,6 +115,12 @@ lilv_path_is_child(const char* path, const char* dir) } char* +lilv_path_current(void) +{ + return getcwd(NULL, 0); +} + +char* lilv_path_absolute(const char* path) { if (lilv_path_is_absolute(path)) { diff --git a/src/filesystem.h b/src/filesystem.h index 8971372..b43e394 100644 --- a/src/filesystem.h +++ b/src/filesystem.h @@ -29,6 +29,10 @@ lilv_path_is_absolute(const char* path); bool lilv_path_is_child(const char* path, const char* dir); +/// Return the current working directory +char* +lilv_path_current(void); + /** Return `path` as an absolute path. |