aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-10 09:45:15 +0100
committerDavid Robillard <d@drobilla.net>2022-01-13 23:05:22 -0500
commitf7d10ea309fb52d09a58b2832fe4a09a120b16aa (patch)
tree3b5d870063d0565ac29334ffb64363fdac23b012 /include/serd
parentb9cc3b642a9365c033c1fa31458d7822b42d0913 (diff)
downloadserd-f7d10ea309fb52d09a58b2832fe4a09a120b16aa.tar.gz
serd-f7d10ea309fb52d09a58b2832fe4a09a120b16aa.tar.bz2
serd-f7d10ea309fb52d09a58b2832fe4a09a120b16aa.zip
Add serd_canonical_path()
Diffstat (limited to 'include/serd')
-rw-r--r--include/serd/serd.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 72a4c3fa..362de28d 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -256,6 +256,19 @@ size_t
serd_strlen(const char* SERD_NONNULL str, SerdNodeFlags* SERD_NULLABLE flags);
/**
+ Return `path` as a canonical absolute path.
+
+ This expands all symbolic links, relative references, and removes extra
+ directory separators. Null is returned on error, including if the path does
+ not exist.
+
+ @return A new string that must be freed with serd_free(), or null.
+*/
+SERD_API
+char* SERD_NULLABLE
+serd_canonical_path(const char* SERD_NONNULL path);
+
+/**
@}
@defgroup serd_io_functions I/O Function Types
@{