diff options
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 d0811911..1a577ee4 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -214,10 +214,10 @@ typedef struct { } SerdError; /** - A parsed URI + A parsed URI. This struct directly refers to slices in other strings, it does not own any - memory itself. Thus, URIs can be parsed and/or resolved against a base URI + memory itself. This allows some URI operations like resolution to be done in-place without allocating memory. */ typedef struct { @@ -227,7 +227,7 @@ typedef struct { SerdStringView path; ///< Path suffix SerdStringView query; ///< Query SerdStringView fragment; ///< Fragment -} SerdURI; +} SerdURIView; /** Syntax style options. @@ -348,7 +348,7 @@ typedef size_t (*SerdSink)(const void* SERD_NONNULL buf, @{ */ -static const SerdURI SERD_URI_NULL = +static const SerdURIView SERD_URI_NULL = {{NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {NULL, 0}}; /** @@ -373,7 +373,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`. @@ -382,16 +382,16 @@ serd_uri_parse(const char* SERD_NONNULL utf8, SerdURI* SERD_NONNULL out); */ 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` @@ -402,11 +402,11 @@ serd_uri_serialise(const SerdURI* SERD_NONNULL uri, */ 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); /** @} @@ -440,16 +440,16 @@ 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. @@ -462,9 +462,9 @@ serd_node_new_uri_from_string(const char* SERD_NULLABLE str, */ 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. @@ -478,9 +478,9 @@ serd_node_new_file_uri(const char* SERD_NONNULL path, */ 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. @@ -496,10 +496,10 @@ serd_node_new_uri(const SerdURI* SERD_NONNULL uri, */ 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 @@ -641,7 +641,7 @@ serd_env_free(SerdEnv* SERD_NULLABLE env); 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 @@ -868,12 +868,12 @@ serd_reader_free(SerdReader* SERD_NULLABLE reader); /// 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 |