diff options
author | David Robillard <d@drobilla.net> | 2021-03-02 11:09:33 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 23:04:04 -0500 |
commit | aca4640882aab7da0193ee2f5767ecd6d9506b0c (patch) | |
tree | bffe2871b838e6db98838e82cc5ff01d1661922f /include | |
parent | 9b344f6425657b2a077c3948289199155f490ff9 (diff) | |
download | serd-aca4640882aab7da0193ee2f5767ecd6d9506b0c.tar.gz serd-aca4640882aab7da0193ee2f5767ecd6d9506b0c.tar.bz2 serd-aca4640882aab7da0193ee2f5767ecd6d9506b0c.zip |
Simplify SerdEnv API
Diffstat (limited to 'include')
-rw-r--r-- | include/serd/serd.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h index 6abadf04..da4291c6 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -1437,26 +1437,16 @@ serd_env_set_prefix(SerdEnv* SERD_NONNULL env, SerdStringView name, SerdStringView uri); -/// Qualify `uri` into a CURIE if possible -SERD_API -bool -serd_env_qualify(const SerdEnv* SERD_NULLABLE env, - const SerdNode* SERD_NONNULL uri, - const SerdNode* SERD_NULLABLE* SERD_NONNULL prefix, - SerdStringView* SERD_NONNULL suffix); - /** - Expand `curie`. + Qualify `uri` into a CURIE if possible. - Errors: SERD_ERR_BAD_ARG if `curie` is not valid, or SERD_ERR_BAD_CURIE if - prefix is not defined in `env`. + Returns null if `uri` can not be qualified (usually because no corresponding + prefix is defined). */ SERD_API -SerdStatus -serd_env_expand(const SerdEnv* SERD_NULLABLE env, - const SerdNode* SERD_NULLABLE curie, - SerdStringView* SERD_NONNULL uri_prefix, - SerdStringView* SERD_NONNULL uri_suffix); +SerdNode* SERD_ALLOCATED +serd_env_qualify(const SerdEnv* SERD_NULLABLE env, + const SerdNode* SERD_NULLABLE uri); /** Expand `node`, which must be a CURIE or URI, to a full URI. @@ -1465,8 +1455,8 @@ serd_env_expand(const SerdEnv* SERD_NULLABLE env, */ SERD_API SerdNode* SERD_ALLOCATED -serd_env_expand_node(const SerdEnv* SERD_NULLABLE env, - const SerdNode* SERD_NONNULL node); +serd_env_expand(const SerdEnv* SERD_NULLABLE env, + const SerdNode* SERD_NULLABLE node); /// Write all prefixes in `env` to `sink` SERD_API |