diff options
author | David Robillard <d@drobilla.net> | 2015-01-29 22:49:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-01-29 22:49:40 +0000 |
commit | 48648e4330b224391307343198152cce4f446874 (patch) | |
tree | cd643b485161a7ea2bea5497a01788d06c0d2e8d /lilv | |
parent | 4ff9f0b0b78681e4015feb1b2a54ec6f7becf563 (diff) | |
download | lilv-48648e4330b224391307343198152cce4f446874.tar.gz lilv-48648e4330b224391307343198152cce4f446874.tar.bz2 lilv-48648e4330b224391307343198152cce4f446874.zip |
Add lilv_file_uri_parse() for correct URI to path conversion.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5528 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'lilv')
-rw-r--r-- | lilv/lilv.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lilv/lilv.h b/lilv/lilv.h index faaade4..ca63e90 100644 --- a/lilv/lilv.h +++ b/lilv/lilv.h @@ -45,6 +45,11 @@ #else # define LILV_API #endif +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +# define LILV_DEPRECATED __attribute__((__deprecated__)) +#else +# define LILV_DEPRECATED +#endif #ifdef __cplusplus extern "C" { @@ -104,12 +109,25 @@ typedef void LilvNodes; /**< set<Node>. */ Convert a file URI string to a local path string. For example, "file://foo/bar/baz.ttl" returns "/foo/bar/baz.ttl". Return value is shared and must not be deleted by caller. + This function does not handle escaping correctly and should not be used for + general file URIs. Use lilv_file_uri_parse() instead. @return `uri` converted to a path, or NULL on failure (URI is not local). */ -LILV_API const char* +LILV_API LILV_DEPRECATED const char* lilv_uri_to_path(const char* uri); /** + Convert a file URI string to a local path string. + For example, "file://foo/bar%20one/baz.ttl" returns "/foo/bar one/baz.ttl". + Return value must be freed by caller. + @param uri The file URI to parse. + @param hostname If non-NULL, set to the hostname in the URI, if any. + @return `uri` converted to a path, or NULL on failure (URI is not local). +*/ +LILV_API char* +lilv_file_uri_parse(const char* uri, char** hostname); + +/** Create a new URI value. Returned value must be freed by caller with lilv_node_free(). */ |