diff options
author | David Robillard <d@drobilla.net> | 2021-02-20 13:17:03 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | 53c28210b9e81ba33fddce89b2d61fb7c99445dc (patch) | |
tree | 524885916085088ee8d2744cbe3ff4ed217f149f /include/serd/serd.h | |
parent | 19b9f627ba195cab7c7ebea9daca9ead6e4f5d9a (diff) | |
download | serd-53c28210b9e81ba33fddce89b2d61fb7c99445dc.tar.gz serd-53c28210b9e81ba33fddce89b2d61fb7c99445dc.tar.bz2 serd-53c28210b9e81ba33fddce89b2d61fb7c99445dc.zip |
Rename SerdURI to SerdURIView
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r-- | include/serd/serd.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h index 3dacf6a9..bf0740b6 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -217,8 +217,8 @@ typedef size_t (*SerdSink)(const void* SERD_NONNULL buf, /** A parsed URI. - This struct directly refers to chunks in other strings, it does not own any - memory itself. Thus, URIs can be parsed and/or resolved against a base URI + This struct directly refers to slices in other strings, it does not own any + memory itself. This allows some URI operations like resolution to be done in-place without allocating memory. */ typedef struct { @@ -228,9 +228,9 @@ typedef struct { SerdStringView path; ///< Path suffix SerdStringView query; ///< Query SerdStringView fragment; ///< Fragment -} SerdURI; +} SerdURIView; -static const SerdURI SERD_URI_NULL = +static const SerdURIView SERD_URI_NULL = {{NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}}; /** @@ -253,7 +253,7 @@ serd_uri_string_has_scheme(const char* SERD_NULLABLE utf8); /// Parse `utf8`, writing result to `out` SERD_API SerdStatus -serd_uri_parse(const char* SERD_NONNULL utf8, SerdURI* SERD_NONNULL out); +serd_uri_parse(const char* SERD_NONNULL utf8, SerdURIView* SERD_NONNULL out); /** Set target `t` to reference `r` resolved against `base`. @@ -261,15 +261,15 @@ serd_uri_parse(const char* SERD_NONNULL utf8, SerdURI* SERD_NONNULL out); @see [RFC3986 5.2.2](http://tools.ietf.org/html/rfc3986#section-5.2.2) */ SERD_API void -serd_uri_resolve(const SerdURI* SERD_NONNULL r, - const SerdURI* SERD_NONNULL base, - SerdURI* SERD_NONNULL t); +serd_uri_resolve(const SerdURIView* SERD_NONNULL r, + const SerdURIView* SERD_NONNULL base, + SerdURIView* SERD_NONNULL t); /// Serialise `uri` with a series of calls to `sink` SERD_API size_t -serd_uri_serialise(const SerdURI* SERD_NONNULL uri, - SerdSink SERD_NONNULL sink, - void* SERD_NONNULL stream); +serd_uri_serialise(const SerdURIView* SERD_NONNULL uri, + SerdSink SERD_NONNULL sink, + void* SERD_NONNULL stream); /** Serialise `uri` relative to `base` with a series of calls to `sink` @@ -279,11 +279,11 @@ serd_uri_serialise(const SerdURI* SERD_NONNULL uri, used keep up-references ("../") within a certain namespace. */ SERD_API size_t -serd_uri_serialise_relative(const SerdURI* SERD_NONNULL uri, - const SerdURI* SERD_NULLABLE base, - const SerdURI* SERD_NULLABLE root, - SerdSink SERD_NONNULL sink, - void* SERD_NONNULL stream); +serd_uri_serialise_relative(const SerdURIView* SERD_NONNULL uri, + const SerdURIView* SERD_NULLABLE base, + const SerdURIView* SERD_NULLABLE root, + SerdSink SERD_NONNULL sink, + void* SERD_NONNULL stream); /** @} @@ -376,15 +376,15 @@ serd_node_from_substring(SerdType type, /// Simple wrapper for serd_node_new_uri() to resolve a URI node SERD_API SerdNode -serd_node_new_uri_from_node(const SerdNode* SERD_NONNULL uri_node, - const SerdURI* SERD_NULLABLE base, - SerdURI* SERD_NULLABLE out); +serd_node_new_uri_from_node(const SerdNode* SERD_NONNULL uri_node, + const SerdURIView* SERD_NULLABLE base, + SerdURIView* SERD_NULLABLE out); /// Simple wrapper for serd_node_new_uri() to resolve a URI string SERD_API SerdNode -serd_node_new_uri_from_string(const char* SERD_NULLABLE str, - const SerdURI* SERD_NULLABLE base, - SerdURI* SERD_NULLABLE out); +serd_node_new_uri_from_string(const char* SERD_NULLABLE str, + const SerdURIView* SERD_NULLABLE base, + SerdURIView* SERD_NULLABLE out); /** Create a new file URI node from a file system path and optional hostname. @@ -396,9 +396,9 @@ serd_node_new_uri_from_string(const char* SERD_NULLABLE str, If `out` is not NULL, it will be set to the parsed URI. */ SERD_API SerdNode -serd_node_new_file_uri(const char* SERD_NONNULL path, - const char* SERD_NULLABLE hostname, - SerdURI* SERD_NULLABLE out); +serd_node_new_file_uri(const char* SERD_NONNULL path, + const char* SERD_NULLABLE hostname, + SerdURIView* SERD_NULLABLE out); /** Create a new node by serialising `uri` into a new string. @@ -411,9 +411,9 @@ serd_node_new_file_uri(const char* SERD_NONNULL path, memory owned by the new returned node). */ SERD_API SerdNode -serd_node_new_uri(const SerdURI* SERD_NONNULL uri, - const SerdURI* SERD_NULLABLE base, - SerdURI* SERD_NULLABLE out); +serd_node_new_uri(const SerdURIView* SERD_NONNULL uri, + const SerdURIView* SERD_NULLABLE base, + SerdURIView* SERD_NULLABLE out); /** Create a new node by serialising `uri` into a new relative URI. @@ -428,10 +428,10 @@ serd_node_new_uri(const SerdURI* SERD_NONNULL uri, memory owned by the new returned node). */ SERD_API SerdNode -serd_node_new_relative_uri(const SerdURI* SERD_NONNULL uri, - const SerdURI* SERD_NULLABLE base, - const SerdURI* SERD_NULLABLE root, - SerdURI* SERD_NULLABLE out); +serd_node_new_relative_uri(const SerdURIView* SERD_NONNULL uri, + const SerdURIView* SERD_NULLABLE base, + const SerdURIView* SERD_NULLABLE root, + SerdURIView* SERD_NULLABLE out); /** Create a new node by serialising `d` into an xsd:decimal string. @@ -593,7 +593,7 @@ serd_env_free(SerdEnv* SERD_NULLABLE env); /// Get the current base URI SERD_API const SerdNode* SERD_NONNULL serd_env_get_base_uri(const SerdEnv* SERD_NONNULL env, - SerdURI* SERD_NULLABLE out); + SerdURIView* SERD_NULLABLE out); /// Set the current base URI SERD_API SerdStatus @@ -832,12 +832,12 @@ typedef enum { /// Create a new RDF writer SERD_API SerdWriter* SERD_ALLOCATED -serd_writer_new(SerdSyntax syntax, - SerdStyle style, - SerdEnv* SERD_NONNULL env, - const SerdURI* SERD_NULLABLE base_uri, - SerdSink SERD_NONNULL ssink, - void* SERD_NULLABLE stream); +serd_writer_new(SerdSyntax syntax, + SerdStyle style, + SerdEnv* SERD_NONNULL env, + const SerdURIView* SERD_NULLABLE base_uri, + SerdSink SERD_NONNULL ssink, + void* SERD_NULLABLE stream); /// Free `writer` SERD_API void |