From f7d10ea309fb52d09a58b2832fe4a09a120b16aa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Nov 2020 09:45:15 +0100 Subject: Add serd_canonical_path() --- include/serd/serd.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/serd') 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 @@ -255,6 +255,19 @@ SERD_API 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 -- cgit v1.2.1