diff options
author | David Robillard <d@drobilla.net> | 2018-04-29 18:29:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | 5c02da92038072f28408854e862fc2d4edf765d4 (patch) | |
tree | 34577415801279981b626b18c1dc69dc79afea7f /include/serd/env.h | |
parent | 672e90382da08efa8f593fdc9081e31d0e548fa0 (diff) | |
download | serd-5c02da92038072f28408854e862fc2d4edf765d4.tar.gz serd-5c02da92038072f28408854e862fc2d4edf765d4.tar.bz2 serd-5c02da92038072f28408854e862fc2d4edf765d4.zip |
Simplify node construction API
Diffstat (limited to 'include/serd/env.h')
-rw-r--r-- | include/serd/env.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/include/serd/env.h b/include/serd/env.h index 7a03e80d..db2c1150 100644 --- a/include/serd/env.h +++ b/include/serd/env.h @@ -9,7 +9,6 @@ #include "serd/sink.h" #include "serd/status.h" #include "serd/string_view.h" -#include "serd/uri.h" #include <stdbool.h> @@ -26,21 +25,19 @@ typedef struct SerdEnvImpl SerdEnv; /// Create a new environment SERD_API SerdEnv* SERD_ALLOCATED -serd_env_new(const SerdNode* SERD_NULLABLE base_uri); +serd_env_new(SerdStringView base_uri); /// Free `env` SERD_API void serd_env_free(SerdEnv* SERD_NULLABLE env); /// Get the current base URI -SERD_API const SerdNode* SERD_NULLABLE -serd_env_base_uri(const SerdEnv* SERD_NONNULL env, - SerdURIView* SERD_NULLABLE out); +SERD_PURE_API const SerdNode* SERD_NULLABLE +serd_env_base_uri(const SerdEnv* SERD_NULLABLE env); /// Set the current base URI SERD_API SerdStatus -serd_env_set_base_uri(SerdEnv* SERD_NONNULL env, - const SerdNode* SERD_NULLABLE uri); +serd_env_set_base_uri(SerdEnv* SERD_NONNULL env, SerdStringView uri); /** Set a namespace prefix. @@ -50,15 +47,9 @@ serd_env_set_base_uri(SerdEnv* SERD_NONNULL env, expand to "http://www.w3.org/2001/XMLSchema#decimal". */ SERD_API SerdStatus -serd_env_set_prefix(SerdEnv* SERD_NONNULL env, - const SerdNode* SERD_NONNULL name, - const SerdNode* SERD_NONNULL uri); - -/// Set a namespace prefix -SERD_API SerdStatus -serd_env_set_prefix_from_strings(SerdEnv* SERD_NONNULL env, - const char* SERD_NONNULL name, - const char* SERD_NONNULL uri); +serd_env_set_prefix(SerdEnv* SERD_NONNULL env, + SerdStringView name, + SerdStringView uri); /// Qualify `uri` into a CURIE if possible SERD_API bool |