diff options
author | David Robillard <d@drobilla.net> | 2016-03-16 16:54:49 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 3eff44c4784c6f0cfdc8c857ff47f8bdd3ae713c (patch) | |
tree | 87346d71b5aa60b980055620597f1a6119c226b0 /serd | |
parent | 085e63e53502adfc16c3830ed6b0b941314b8f8a (diff) | |
download | serd-3eff44c4784c6f0cfdc8c857ff47f8bdd3ae713c.tar.gz serd-3eff44c4784c6f0cfdc8c857ff47f8bdd3ae713c.tar.bz2 serd-3eff44c4784c6f0cfdc8c857ff47f8bdd3ae713c.zip |
Rename SerdChunk to SerdStringView
Diffstat (limited to 'serd')
-rw-r--r-- | serd/serd.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/serd/serd.h b/serd/serd.h index adb0f476..b3ecb850 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -225,12 +225,12 @@ typedef struct { } SerdNode; /** - An unterminated string fragment. + An unterminated immutable slice of a string. */ typedef struct { const char* buf; /**< Start of chunk */ size_t len; /**< Length of chunk in bytes */ -} SerdChunk; +} SerdStringView; /** A mutable buffer in memory. @@ -255,17 +255,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; /** @@ -735,7 +735,7 @@ bool serd_env_qualify(const SerdEnv* env, const SerdNode* uri, SerdNode* prefix, - SerdChunk* suffix); + SerdStringView* suffix); /** Expand `curie`. @@ -747,8 +747,8 @@ SERD_API SerdStatus serd_env_expand(const SerdEnv* env, const SerdNode* curie, - SerdChunk* uri_prefix, - SerdChunk* uri_suffix); + SerdStringView* uri_prefix, + SerdStringView* uri_suffix); /** Expand `node`, which must be a CURIE or URI, to a full URI. @@ -991,7 +991,7 @@ size_t serd_buffer_sink(const void* buf, size_t len, void* 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. |