aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd
diff options
context:
space:
mode:
Diffstat (limited to 'include/serd')
-rw-r--r--include/serd/serd.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 7b3d0cf7..d0811911 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -191,11 +191,11 @@ typedef struct {
SerdType type; ///< Node type
} SerdNode;
-/// An unterminated string fragment
+/// An unterminated immutable slice of a string
typedef struct {
const char* SERD_NULLABLE buf; ///< Start of chunk
size_t len; ///< Length of chunk in bytes
-} SerdChunk;
+} SerdStringView;
/// A mutable buffer in memory
typedef struct {
@@ -216,17 +216,17 @@ typedef struct {
/**
A parsed URI
- This struct directly refers to chunks in other strings, it does not own any
+ 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
in-place without allocating memory.
*/
typedef struct {
- SerdChunk scheme; ///< Scheme
- SerdChunk authority; ///< Authority
- SerdChunk path_base; ///< Path prefix if relative
- SerdChunk path; ///< Path suffix
- SerdChunk query; ///< Query
- SerdChunk fragment; ///< Fragment
+ SerdStringView scheme; ///< Scheme
+ SerdStringView authority; ///< Authority
+ SerdStringView path_base; ///< Path prefix if relative
+ SerdStringView path; ///< Path suffix
+ SerdStringView query; ///< Query
+ SerdStringView fragment; ///< Fragment
} SerdURI;
/**
@@ -675,7 +675,7 @@ bool
serd_env_qualify(const SerdEnv* SERD_NONNULL env,
const SerdNode* SERD_NONNULL uri,
SerdNode* SERD_NONNULL prefix,
- SerdChunk* SERD_NONNULL suffix);
+ SerdStringView* SERD_NONNULL suffix);
/**
Expand `curie`.
@@ -687,8 +687,8 @@ SERD_API
SerdStatus
serd_env_expand(const SerdEnv* SERD_NONNULL env,
const SerdNode* SERD_NONNULL curie,
- SerdChunk* SERD_NONNULL uri_prefix,
- SerdChunk* SERD_NONNULL uri_suffix);
+ SerdStringView* SERD_NONNULL uri_prefix,
+ SerdStringView* SERD_NONNULL uri_suffix);
/**
Expand `node`, which must be a CURIE or URI, to a full URI.
@@ -912,7 +912,7 @@ serd_buffer_sink(const void* SERD_NONNULL buf,
void* SERD_NONNULL stream);
/**
- Finish a serialisation to a chunk with serd_buffer_sink().
+ Finish a serialisation to a buffer with serd_buffer_sink().
The returned string is the result of the serialisation, which is null
terminated (by this function) and owned by the caller.