aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-03-02 11:09:33 -0500
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commita365de08588b5da0783d0ec905576f272108442c (patch)
treee28e8a6248c9507b17ae431522b13361c826e825 /include
parentf0f4bfb37f36fce6d6e216a90162b81691f61e83 (diff)
downloadserd-a365de08588b5da0783d0ec905576f272108442c.tar.gz
serd-a365de08588b5da0783d0ec905576f272108442c.tar.bz2
serd-a365de08588b5da0783d0ec905576f272108442c.zip
Simplify SerdEnv API
Diffstat (limited to 'include')
-rw-r--r--include/serd/serd.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 3d08eb07..c2077f5c 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -931,26 +931,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_NONNULL 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_NONNULL env,
- const SerdNode* SERD_NONNULL curie,
- SerdStringView* SERD_NONNULL uri_prefix,
- SerdStringView* SERD_NONNULL uri_suffix);
+SerdNode* SERD_ALLOCATED
+serd_env_qualify(const SerdEnv* SERD_NONNULL env,
+ const SerdNode* SERD_NONNULL uri);
/**
Expand `node`, transforming CURIEs into URIs.
@@ -963,8 +953,8 @@ serd_env_expand(const SerdEnv* SERD_NONNULL env,
*/
SERD_API
SerdNode* SERD_ALLOCATED
-serd_env_expand_node(const SerdEnv* SERD_NONNULL env,
- const SerdNode* SERD_NONNULL node);
+serd_env_expand(const SerdEnv* SERD_NONNULL env,
+ const SerdNode* SERD_NONNULL node);
/// Call `func` for each prefix defined in `env`
SERD_API