diff options
author | David Robillard <d@drobilla.net> | 2016-03-16 16:54:49 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-04-13 19:15:32 +0200 |
commit | 8f88d086f0d94c1d6e8afbcd16c10b392cbb207c (patch) | |
tree | 07b59f6097b188b00938326197d7f6b3ed03d5e9 /src | |
parent | c678dcfa54f3cf6784ac505f9e669ee233ba34c9 (diff) | |
download | serd-8f88d086f0d94c1d6e8afbcd16c10b392cbb207c.tar.gz serd-8f88d086f0d94c1d6e8afbcd16c10b392cbb207c.tar.bz2 serd-8f88d086f0d94c1d6e8afbcd16c10b392cbb207c.zip |
Rename SerdChunk to SerdStringView
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 10 | ||||
-rw-r--r-- | src/serd_internal.h | 6 | ||||
-rw-r--r-- | src/uri.c | 2 | ||||
-rw-r--r-- | src/writer.c | 10 |
4 files changed, 14 insertions, 14 deletions
@@ -158,7 +158,7 @@ bool serd_env_qualify(const SerdEnv* env, const SerdNode* uri, SerdNode* prefix, - SerdChunk* suffix) + SerdStringView* suffix) { for (size_t i = 0; i < env->n_prefixes; ++i) { const SerdNode* const prefix_uri = &env->prefixes[i].uri; @@ -179,8 +179,8 @@ serd_env_qualify(const SerdEnv* env, SerdStatus serd_env_expand(const SerdEnv* env, const SerdNode* curie, - SerdChunk* uri_prefix, - SerdChunk* uri_suffix) + SerdStringView* uri_prefix, + SerdStringView* uri_suffix) { const char* const colon = (const char*)memchr( curie->buf, ':', curie->n_bytes + 1); @@ -206,8 +206,8 @@ serd_env_expand_node(const SerdEnv* env, { switch (node->type) { case SERD_CURIE: { - SerdChunk prefix; - SerdChunk suffix; + SerdStringView prefix; + SerdStringView suffix; if (serd_env_expand(env, node, &prefix, &suffix)) { return SERD_NODE_NULL; } diff --git a/src/serd_internal.h b/src/serd_internal.h index 3ffb9d4d..c51b88ed 100644 --- a/src/serd_internal.h +++ b/src/serd_internal.h @@ -436,7 +436,7 @@ parse_utf8_char(const uint8_t* utf8, size_t* size) /* URI utilities */ static inline bool -chunk_equals(const SerdChunk* a, const SerdChunk* b) +slice_equals(const SerdStringView* a, const SerdStringView* b) { return a->len == b->len && !strncmp((const char*)a->buf, (const char*)b->buf, a->len); @@ -466,8 +466,8 @@ static inline size_t uri_rooted_index(const SerdURI* uri, const SerdURI* root) { if (!root || !root->scheme.len || - !chunk_equals(&root->scheme, &uri->scheme) || - !chunk_equals(&root->authority, &uri->authority)) { + !slice_equals(&root->scheme, &uri->scheme) || + !slice_equals(&root->authority, &uri->authority)) { return 0; } @@ -280,7 +280,7 @@ remove_dot_segments(const char* path, size_t len, size_t* up) /// Merge `base` and `path` in-place static void -merge(SerdChunk* base, SerdChunk* path) +merge(SerdStringView* base, SerdStringView* path) { size_t up; const char* begin = remove_dot_segments(path->buf, path->len, &up); diff --git a/src/writer.c b/src/writer.c index 3f198a93..a075f037 100644 --- a/src/writer.c +++ b/src/writer.c @@ -480,8 +480,8 @@ write_uri_node(SerdWriter* const writer, const Field field, const SerdStatementFlags flags) { - SerdNode prefix; - SerdChunk suffix; + SerdNode prefix; + SerdStringView suffix; if (is_inline_start(writer, field, flags)) { ++writer->indent; @@ -538,9 +538,9 @@ write_curie(SerdWriter* const writer, const Field field, const SerdStatementFlags flags) { - SerdChunk prefix; - SerdChunk suffix; - SerdStatus st; + SerdStringView prefix; + SerdStringView suffix; + SerdStatus st; switch (writer->syntax) { case SERD_NTRIPLES: case SERD_NQUADS: |