diff options
author | David Robillard <d@drobilla.net> | 2016-03-16 16:54:49 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:23 -0500 |
commit | b4dee10576e9916c0c8d80033bc429dc38a70c1c (patch) | |
tree | 58d9b4a8eea080691ab0177e25dae1001ba711ba /include | |
parent | a29581d3ba664175c459e20e6c86be09707fde6e (diff) | |
download | serd-b4dee10576e9916c0c8d80033bc429dc38a70c1c.tar.gz serd-b4dee10576e9916c0c8d80033bc429dc38a70c1c.tar.bz2 serd-b4dee10576e9916c0c8d80033bc429dc38a70c1c.zip |
Rename SerdChunk to SerdStringView
Diffstat (limited to 'include')
-rw-r--r-- | include/serd/serd.h | 26 |
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. |