From b4dee10576e9916c0c8d80033bc429dc38a70c1c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 16 Mar 2016 16:54:49 -0400 Subject: Rename SerdChunk to SerdStringView --- include/serd/serd.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include') 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. -- cgit v1.2.1