summaryrefslogtreecommitdiffstats
path: root/src/filesystem.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-04 16:07:48 +0200
committerDavid Robillard <d@drobilla.net>2020-08-06 17:34:19 +0200
commit18c8af55e63653c74d58137cd12434f1213f4230 (patch)
tree902c20f451ab01b30f91d218a9a291fb3190b085 /src/filesystem.c
parentdd521d78d1959d694e6e5a565a37e9693756cb00 (diff)
downloadlilv-18c8af55e63653c74d58137cd12434f1213f4230.tar.gz
lilv-18c8af55e63653c74d58137cd12434f1213f4230.tar.bz2
lilv-18c8af55e63653c74d58137cd12434f1213f4230.zip
Rename some filename utilities for clarity
Loosely inspired by Python and the std::filesystem API.
Diffstat (limited to 'src/filesystem.c')
-rw-r--r--src/filesystem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/filesystem.c b/src/filesystem.c
index dbb528f..45ece12 100644
--- a/src/filesystem.c
+++ b/src/filesystem.c
@@ -149,7 +149,7 @@ lilv_path_relative_to(const char* path, const char* base)
}
char*
-lilv_dirname(const char* path)
+lilv_path_parent(const char* path)
{
const char* s = path + strlen(path) - 1; // Last character
for (; s > path && lilv_is_dir_sep(*s); --s) {} // Last non-slash
@@ -207,7 +207,7 @@ lilv_dir_path(const char* path)
}
char*
-lilv_realpath(const char* path)
+lilv_path_canonical(const char* path)
{
if (!path) {
return NULL;
@@ -325,7 +325,7 @@ lilv_dir_for_each(const char* path,
}
int
-lilv_mkdir_p(const char* dir_path)
+lilv_create_directories(const char* dir_path)
{
char* path = lilv_strdup(dir_path);
const size_t path_len = strlen(path);
@@ -373,8 +373,8 @@ lilv_file_equals(const char* a_path, const char* b_path)
bool match = false;
FILE* a_file = NULL;
FILE* b_file = NULL;
- char* const a_real = lilv_realpath(a_path);
- char* const b_real = lilv_realpath(b_path);
+ char* const a_real = lilv_path_canonical(a_path);
+ char* const b_real = lilv_path_canonical(b_path);
if (!strcmp(a_real, b_real)) {
match = true; // Real paths match
} else if (lilv_file_size(a_path) != lilv_file_size(b_path)) {