aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-02-20 13:17:03 -0500
committerDavid Robillard <d@drobilla.net>2022-01-13 15:33:54 -0500
commite04877cdf389fac06f899d4d690af2fcb0d6d2c7 (patch)
treed8bebc8c55509a344aae0524e497770a621452b6 /include/serd
parentfaac2e52df494481dc28168a856058a414a913f2 (diff)
downloadserd-e04877cdf389fac06f899d4d690af2fcb0d6d2c7.tar.gz
serd-e04877cdf389fac06f899d4d690af2fcb0d6d2c7.tar.bz2
serd-e04877cdf389fac06f899d4d690af2fcb0d6d2c7.zip
Rename SerdURI to SerdURIView
Diffstat (limited to 'include/serd')
-rw-r--r--include/serd/serd.h78
1 files changed, 39 insertions, 39 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index f971d417..fa0b2c0d 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -234,8 +234,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 {
@@ -245,9 +245,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}};
/**
@@ -272,7 +272,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`.
@@ -281,16 +281,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`
@@ -301,11 +301,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);
/**
@}
@@ -401,16 +401,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.
@@ -423,9 +423,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.
@@ -439,9 +439,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.
@@ -457,10 +457,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.
@@ -630,7 +630,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
@@ -878,12 +878,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