aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/canon.c11
-rw-r--r--src/env.c51
-rw-r--r--src/env.h14
-rw-r--r--src/log.c6
-rw-r--r--src/node.c73
-rw-r--r--src/node_spec.h20
-rw-r--r--src/node_syntax.c6
-rw-r--r--src/nodes.c22
-rw-r--r--src/read_turtle.c16
-rw-r--r--src/uri.c12
-rw-r--r--src/uri_utils.h4
-rw-r--r--src/world.c16
-rw-r--r--src/writer.c19
13 files changed, 135 insertions, 135 deletions
diff --git a/src/canon.c b/src/canon.c
index c0ce8ef4..2ef28e07 100644
--- a/src/canon.c
+++ b/src/canon.c
@@ -18,9 +18,9 @@
#include "serd/sink.h"
#include "serd/statement.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/world.h"
#include "zix/attributes.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdbool.h>
@@ -113,11 +113,10 @@ build_tagged(SerdAllocator* const ZIX_NONNULL allocator,
}
// Make a new literal that is otherwise identical
- *out =
- serd_node_new(allocator,
- serd_a_literal(serd_node_string_view(node),
- serd_node_flags(node),
- serd_substring(canonical_lang, lang_len)));
+ *out = serd_node_new(allocator,
+ serd_a_literal(serd_node_string_view(node),
+ serd_node_flags(node),
+ zix_substring(canonical_lang, lang_len)));
const ExessResult r = {EXESS_SUCCESS, node_len};
return r;
diff --git a/src/env.c b/src/env.c
index e90b68a4..d17910f9 100644
--- a/src/env.c
+++ b/src/env.c
@@ -13,6 +13,7 @@
#include "zix/allocator.h"
#include "zix/attributes.h"
#include "zix/filesystem.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdbool.h>
@@ -33,7 +34,7 @@ struct SerdEnvImpl {
};
SerdEnv*
-serd_env_new(SerdAllocator* const allocator, const SerdStringView base_uri)
+serd_env_new(SerdAllocator* const allocator, const ZixStringView base_uri)
{
SerdEnv* env =
(SerdEnv*)serd_acalloc(allocator, 1, sizeof(struct SerdEnvImpl));
@@ -138,7 +139,7 @@ serd_env_base_uri(const SerdEnv* const env)
}
SerdStatus
-serd_env_set_base_uri(SerdEnv* const env, const SerdStringView uri)
+serd_env_set_base_uri(SerdEnv* const env, const ZixStringView uri)
{
assert(env);
@@ -168,12 +169,12 @@ serd_env_set_base_uri(SerdEnv* const env, const SerdStringView uri)
}
SerdStatus
-serd_env_set_base_path(SerdEnv* const env, const SerdStringView path)
+serd_env_set_base_path(SerdEnv* const env, const ZixStringView path)
{
assert(env);
if (!path.data || !path.length) {
- return serd_env_set_base_uri(env, serd_empty_string());
+ return serd_env_set_base_uri(env, zix_empty_string());
}
char* const real_path = zix_canonical_path(NULL, path.data);
@@ -192,12 +193,12 @@ serd_env_set_base_path(SerdEnv* const env, const SerdStringView path)
base_path[real_path_len] = path_last;
base_node = serd_node_new(
- NULL, serd_a_file_uri(serd_string(base_path), serd_empty_string()));
+ NULL, serd_a_file_uri(zix_string(base_path), zix_empty_string()));
serd_afree(env->allocator, base_path);
} else {
base_node = serd_node_new(
- NULL, serd_a_file_uri(serd_string(real_path), serd_empty_string()));
+ NULL, serd_a_file_uri(zix_string(real_path), zix_empty_string()));
}
serd_env_set_base_uri(env, serd_node_string_view(base_node));
@@ -207,8 +208,8 @@ serd_env_set_base_path(SerdEnv* const env, const SerdStringView path)
return SERD_SUCCESS;
}
-SerdStringView
-serd_env_find_prefix(const SerdEnv* const env, const SerdStringView name)
+ZixStringView
+serd_env_find_prefix(const SerdEnv* const env, const ZixStringView name)
{
for (size_t i = 0; i < env->n_prefixes; ++i) {
const SerdNode* const prefix_name = env->prefixes[i].name;
@@ -219,7 +220,7 @@ serd_env_find_prefix(const SerdEnv* const env, const SerdStringView name)
}
}
- return serd_empty_string();
+ return zix_empty_string();
}
ZIX_PURE_FUNC static SerdPrefix*
@@ -240,7 +241,7 @@ serd_env_find(const SerdEnv* const env,
static SerdStatus
serd_env_add(SerdEnv* const env,
- const SerdStringView name,
+ const ZixStringView name,
const SerdNode* const uri)
{
SerdPrefix* const prefix = serd_env_find(env, name.data, name.length);
@@ -276,9 +277,9 @@ serd_env_add(SerdEnv* const env,
}
SerdStatus
-serd_env_set_prefix(SerdEnv* const env,
- const SerdStringView name,
- const SerdStringView uri)
+serd_env_set_prefix(SerdEnv* const env,
+ const ZixStringView name,
+ const ZixStringView uri)
{
assert(env);
@@ -316,10 +317,10 @@ serd_env_set_prefix(SerdEnv* const env,
}
SerdStatus
-serd_env_qualify(const SerdEnv* const env,
- const SerdStringView uri,
- SerdStringView* const prefix,
- SerdStringView* const suffix)
+serd_env_qualify(const SerdEnv* const env,
+ const ZixStringView uri,
+ ZixStringView* const prefix,
+ ZixStringView* const suffix)
{
for (size_t i = 0; i < env->n_prefixes; ++i) {
const SerdNode* const prefix_uri = env->prefixes[i].uri;
@@ -341,10 +342,10 @@ serd_env_qualify(const SerdEnv* const env,
}
SerdStatus
-serd_env_expand_in_place(const SerdEnv* const env,
- const SerdStringView curie,
- SerdStringView* const uri_prefix,
- SerdStringView* const uri_suffix)
+serd_env_expand_in_place(const SerdEnv* const env,
+ const ZixStringView curie,
+ ZixStringView* const uri_prefix,
+ ZixStringView* const uri_suffix)
{
const char* const str = curie.data;
const char* const colon =
@@ -367,15 +368,15 @@ serd_env_expand_in_place(const SerdEnv* const env,
}
SerdNode*
-serd_env_expand_curie(const SerdEnv* const env, const SerdStringView curie)
+serd_env_expand_curie(const SerdEnv* const env, const ZixStringView curie)
{
if (!env) {
return NULL;
}
- SerdStringView prefix = serd_empty_string();
- SerdStringView suffix = serd_empty_string();
- SerdStatus st = serd_env_expand_in_place(env, curie, &prefix, &suffix);
+ ZixStringView prefix = zix_empty_string();
+ ZixStringView suffix = zix_empty_string();
+ SerdStatus st = serd_env_expand_in_place(env, curie, &prefix, &suffix);
if (st || !prefix.data || !suffix.data) {
return NULL;
}
diff --git a/src/env.h b/src/env.h
index 64a0abc1..54ae84e1 100644
--- a/src/env.h
+++ b/src/env.h
@@ -6,17 +6,17 @@
#include "serd/env.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/uri.h"
#include "zix/attributes.h"
+#include "zix/string_view.h"
/**
Return the URI for the prefix with the given name.
If no such prefix is known, returns an empty string view.
*/
-ZIX_PURE_FUNC SerdStringView
-serd_env_find_prefix(const SerdEnv* env, SerdStringView name);
+ZIX_PURE_FUNC ZixStringView
+serd_env_find_prefix(const SerdEnv* env, ZixStringView name);
/**
Expand `curie`.
@@ -25,10 +25,10 @@ serd_env_find_prefix(const SerdEnv* env, SerdStringView name);
not defined in `env`.
*/
SerdStatus
-serd_env_expand_in_place(const SerdEnv* env,
- SerdStringView curie,
- SerdStringView* uri_prefix,
- SerdStringView* uri_suffix);
+serd_env_expand_in_place(const SerdEnv* env,
+ ZixStringView curie,
+ ZixStringView* uri_prefix,
+ ZixStringView* uri_suffix);
ZIX_PURE_FUNC SerdURIView
serd_env_base_uri_view(const SerdEnv* env);
diff --git a/src/log.c b/src/log.c
index 6ba885c6..a13bfd9a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -10,9 +10,9 @@
#include "serd/log.h"
#include "serd/node.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/world.h"
#include "zix/attributes.h"
+#include "zix/string_view.h"
#if USE_ISATTY
# include <unistd.h>
@@ -120,7 +120,7 @@ serd_quiet_log_func(void* const handle,
const SerdLogLevel level,
const size_t n_fields,
const SerdLogField* const fields,
- const SerdStringView message)
+ const ZixStringView message)
{
(void)handle;
(void)level;
@@ -219,7 +219,7 @@ serd_vxlogf(const SerdWorld* const world,
level,
n_fields,
fields,
- serd_substring(message, (size_t)r));
+ zix_substring(message, (size_t)r));
}
return serd_default_vxlogf(
diff --git a/src/node.c b/src/node.c
index b4cd14fa..f38cdb78 100644
--- a/src/node.c
+++ b/src/node.c
@@ -10,11 +10,11 @@
#include "exess/exess.h"
#include "serd/node.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/uri.h"
#include "serd/value.h"
#include "serd/write_result.h"
#include "zix/attributes.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdbool.h>
@@ -49,7 +49,7 @@ static const ExessDatatype value_type_datatypes[] = {
// Argument constructors
SerdNodeArgs
-serd_a_token(const SerdNodeType type, const SerdStringView string)
+serd_a_token(const SerdNodeType type, const ZixStringView string)
{
const SerdNodeArgs args = {SERD_NODE_ARGS_TOKEN, {{type, string}}};
return args;
@@ -65,7 +65,7 @@ serd_a_parsed_uri(const SerdURIView uri)
}
SerdNodeArgs
-serd_a_file_uri(const SerdStringView path, const SerdStringView hostname)
+serd_a_file_uri(const ZixStringView path, const ZixStringView hostname)
{
SerdNodeArgs args;
args.type = SERD_NODE_ARGS_FILE_URI;
@@ -75,9 +75,9 @@ serd_a_file_uri(const SerdStringView path, const SerdStringView hostname)
}
SerdNodeArgs
-serd_a_literal(const SerdStringView string,
- const SerdNodeFlags flags,
- const SerdStringView meta)
+serd_a_literal(const ZixStringView string,
+ const SerdNodeFlags flags,
+ const ZixStringView meta)
{
SerdNodeArgs args;
args.type = SERD_NODE_ARGS_LITERAL;
@@ -247,14 +247,15 @@ result(const SerdStatus status, const size_t count)
}
static SerdWriteResult
-serd_node_construct_simple(const size_t buf_size,
- void* const buf,
- const SerdNodeType type,
- const SerdNodeFlags flags,
- const SerdStringView string)
+serd_node_construct_simple(const size_t buf_size,
+ void* const buf,
+ const SerdNodeType type,
+ const SerdNodeFlags flags,
+ const ZixStringView string)
{
const size_t total_size =
sizeof(SerdNode) + serd_node_pad_length(string.length);
+
if (!buf || total_size > buf_size) {
return result(SERD_OVERFLOW, total_size);
}
@@ -274,7 +275,7 @@ serd_node_construct_simple(const size_t buf_size,
}
ZIX_PURE_FUNC static bool
-is_langtag(const SerdStringView string)
+is_langtag(const ZixStringView string)
{
// First character must be a letter
size_t i = 0;
@@ -303,11 +304,11 @@ is_langtag(const SerdStringView string)
}
static SerdWriteResult
-serd_node_construct_literal(const size_t buf_size,
- void* const buf,
- const SerdStringView string,
- const SerdNodeFlags flags,
- const SerdStringView meta)
+serd_node_construct_literal(const size_t buf_size,
+ void* const buf,
+ const ZixStringView string,
+ const SerdNodeFlags flags,
+ const ZixStringView meta)
{
if (!(flags & (SERD_HAS_DATATYPE | SERD_HAS_LANGUAGE))) {
return serd_node_construct_simple(
@@ -469,9 +470,9 @@ serd_node_construct_value(const size_t buf_size,
return serd_node_construct_literal(buf_size,
buf,
- serd_substring(temp, r.count),
+ zix_substring(temp, r.count),
SERD_HAS_DATATYPE,
- serd_string(datatype_uri));
+ zix_string(datatype_uri));
}
static SerdWriteResult
@@ -486,9 +487,9 @@ serd_node_construct_decimal(const size_t buf_size,
return serd_node_construct_literal(buf_size,
buf,
- serd_substring(temp, r.count),
+ zix_substring(temp, r.count),
SERD_HAS_DATATYPE,
- serd_string(EXESS_XSD_URI "decimal"));
+ zix_string(EXESS_XSD_URI "decimal"));
}
static SerdWriteResult
@@ -502,18 +503,18 @@ serd_node_construct_integer(const size_t buf_size,
return serd_node_construct_literal(buf_size,
buf,
- serd_substring(temp, r.count),
+ zix_substring(temp, r.count),
SERD_HAS_DATATYPE,
- serd_string(NS_XSD "integer"));
+ zix_string(NS_XSD "integer"));
}
static SerdWriteResult
serd_node_construct_binary(
- const size_t buf_size,
- void* const buf,
- const size_t value_size,
- const void* const value,
- const SerdStringView datatype_uri,
+ const size_t buf_size,
+ void* const buf,
+ const size_t value_size,
+ const void* const value,
+ const ZixStringView datatype_uri,
ExessResult (*write_func)(size_t, const void*, size_t, char*))
{
// Verify argument sanity
@@ -825,10 +826,10 @@ construct_write(const void* const buf,
}
static SerdWriteResult
-serd_node_construct_file_uri(const size_t buf_size,
- void* const buf,
- const SerdStringView path,
- const SerdStringView hostname)
+serd_node_construct_file_uri(const size_t buf_size,
+ void* const buf,
+ const ZixStringView path,
+ const ZixStringView hostname)
{
SerdNode* const node = (SerdNode*)buf;
ConstructWriteHead head = {(char*)buf, buf_size, 0U};
@@ -902,7 +903,7 @@ serd_node_construct(const size_t buf_size,
buf,
args.data.as_blob.size,
args.data.as_blob.data,
- serd_string(NS_XSD "hexBinary"),
+ zix_string(NS_XSD "hexBinary"),
exess_write_hex);
case SERD_NODE_ARGS_BASE64:
@@ -910,7 +911,7 @@ serd_node_construct(const size_t buf_size,
buf,
args.data.as_blob.size,
args.data.as_blob.data,
- serd_string(NS_XSD "base64Binary"),
+ zix_string(NS_XSD "base64Binary"),
exess_write_base64);
}
@@ -941,12 +942,12 @@ serd_node_length(const SerdNode* const node)
return node->length;
}
-SerdStringView
+ZixStringView
serd_node_string_view(const SerdNode* const node)
{
assert(node);
- const SerdStringView r = {(const char*)(node + 1), node->length};
+ const ZixStringView r = {(const char*)(node + 1), node->length};
return r;
}
diff --git a/src/node_spec.h b/src/node_spec.h
index 97243bf6..2daee100 100644
--- a/src/node_spec.h
+++ b/src/node_spec.h
@@ -5,7 +5,7 @@
#define SERD_SRC_NODE_SPEC_H
#include "serd/node.h"
-#include "serd/string_view.h"
+#include "zix/string_view.h"
/**
A lightweight "specification" of a node.
@@ -16,23 +16,23 @@
allocate one.
*/
typedef struct {
- SerdNodeType type; ///< Basic type of this node
- SerdStringView string; ///< String contents of this node
- SerdNodeFlags flags; ///< Additional node flags
- SerdStringView meta; ///< String contents of datatype or language node
+ SerdNodeType type; ///< Basic type of this node
+ ZixStringView string; ///< String contents of this node
+ SerdNodeFlags flags; ///< Additional node flags
+ ZixStringView meta; ///< String contents of datatype or language node
} NodeSpec;
static inline NodeSpec
-token_spec(const SerdNodeType type, const SerdStringView string)
+token_spec(const SerdNodeType type, const ZixStringView string)
{
- NodeSpec spec = {type, string, 0U, serd_empty_string()};
+ NodeSpec spec = {type, string, 0U, zix_empty_string()};
return spec;
}
static inline NodeSpec
-literal_spec(const SerdStringView string,
- const SerdNodeFlags flags,
- const SerdStringView meta)
+literal_spec(const ZixStringView string,
+ const SerdNodeFlags flags,
+ const ZixStringView meta)
{
NodeSpec spec = {SERD_LITERAL, string, flags, meta};
return spec;
diff --git a/src/node_syntax.c b/src/node_syntax.c
index b40bc0dc..a66c6e22 100644
--- a/src/node_syntax.c
+++ b/src/node_syntax.c
@@ -16,10 +16,10 @@
#include "serd/sink.h"
#include "serd/statement.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/syntax.h"
#include "serd/world.h"
#include "serd/writer.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdio.h>
@@ -112,7 +112,7 @@ serd_node_from_syntax(SerdAllocator* const allocator,
if (env) {
node = serd_node_from_syntax_in(temp_world, str, syntax, env);
} else {
- SerdEnv* const temp_env = serd_env_new(allocator, serd_empty_string());
+ SerdEnv* const temp_env = serd_env_new(allocator, zix_empty_string());
if (temp_env) {
node = serd_node_from_syntax_in(temp_world, str, syntax, temp_env);
}
@@ -177,7 +177,7 @@ serd_node_to_syntax(SerdAllocator* const allocator,
if (env) {
string = serd_node_to_syntax_in(temp_world, node, syntax, env);
} else {
- SerdEnv* const temp_env = serd_env_new(allocator, serd_empty_string());
+ SerdEnv* const temp_env = serd_env_new(allocator, zix_empty_string());
if (temp_env) {
string = serd_node_to_syntax_in(temp_world, node, syntax, temp_env);
}
diff --git a/src/nodes.c b/src/nodes.c
index 68d9cf3c..22ee3146 100644
--- a/src/nodes.c
+++ b/src/nodes.c
@@ -14,12 +14,12 @@
#include "serd/memory.h"
#include "serd/nodes.h"
-#include "serd/string_view.h"
#include "serd/write_result.h"
#include "zix/allocator.h"
#include "zix/attributes.h"
#include "zix/digest.h"
#include "zix/hash.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdbool.h>
@@ -137,9 +137,9 @@ nodes_key(const NodesEntry* const entry)
}
static ZixHashCode
-token_hash(const ZixHashCode seed,
- const SerdNodeType type,
- const SerdStringView string)
+token_hash(const ZixHashCode seed,
+ const SerdNodeType type,
+ const ZixStringView string)
{
const SerdNode node_header = {string.length, 0U, type};
ZixHashCode h = seed;
@@ -378,9 +378,9 @@ serd_nodes_manage_entry_node(SerdNodes* const nodes, SerdNode* const node)
}
static const SerdNode*
-serd_nodes_token(SerdNodes* const nodes,
- const SerdNodeType type,
- const SerdStringView string)
+serd_nodes_token(SerdNodes* const nodes,
+ const SerdNodeType type,
+ const ZixStringView string)
{
// Calculate a hash code for the token without actually constructing it
const NodeSpec key = token_spec(type, string);
@@ -406,10 +406,10 @@ serd_nodes_token(SerdNodes* const nodes,
}
static const SerdNode*
-serd_nodes_literal(SerdNodes* const nodes,
- const SerdStringView string,
- const SerdNodeFlags flags,
- const SerdStringView meta)
+serd_nodes_literal(SerdNodes* const nodes,
+ const ZixStringView string,
+ const SerdNodeFlags flags,
+ const ZixStringView meta)
{
// Calculate a hash code for the literal without actually constructing it
const NodeSpec spec = literal_spec(string, flags, meta);
diff --git a/src/read_turtle.c b/src/read_turtle.c
index 03d1950f..c6982327 100644
--- a/src/read_turtle.c
+++ b/src/read_turtle.c
@@ -21,9 +21,9 @@
#include "serd/sink.h"
#include "serd/statement.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/uri.h"
#include "zix/attributes.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdbool.h>
@@ -396,8 +396,8 @@ read_PrefixedName(SerdReader* const reader,
skip_byte(reader, ':');
// Search environment for the prefix URI
- const SerdStringView prefix = serd_node_string_view(dest);
- const SerdStringView prefix_uri = serd_env_find_prefix(reader->env, prefix);
+ const ZixStringView prefix = serd_node_string_view(dest);
+ const ZixStringView prefix_uri = serd_env_find_prefix(reader->env, prefix);
if (!prefix_uri.length) {
return r_err(reader, st, "unknown prefix \"%s\"", prefix.data);
}
@@ -645,7 +645,7 @@ read_anon(SerdReader* const reader,
}
static bool
-node_has_string(const SerdNode* const node, const SerdStringView string)
+node_has_string(const SerdNode* const node, const ZixStringView string)
{
return node->length == string.length &&
!memcmp(serd_node_string(node), string.data, string.length);
@@ -657,10 +657,10 @@ read_named_object(SerdReader* const reader,
SerdNode** const dest,
bool* const ate_dot)
{
- static const char* const XSD_BOOLEAN = NS_XSD "boolean";
- static const size_t XSD_BOOLEAN_LEN = 40;
- static const SerdStringView true_string = {"true", 4U};
- static const SerdStringView false_string = {"false", 5U};
+ static const char* const XSD_BOOLEAN = NS_XSD "boolean";
+ static const size_t XSD_BOOLEAN_LEN = 40;
+ static const ZixStringView true_string = ZIX_STATIC_STRING("true");
+ static const ZixStringView false_string = ZIX_STATIC_STRING("false");
/* This function deals with nodes that start with some letters. Unlike
everything else, the cases here aren't nicely distinguished by leading
diff --git a/src/uri.c b/src/uri.c
index 234bf834..53574600 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -9,8 +9,8 @@
#include "serd/memory.h"
#include "serd/status.h"
#include "serd/stream.h"
-#include "serd/string_view.h"
#include "serd/uri.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdbool.h>
@@ -245,7 +245,7 @@ remove_dot_segments(const char* const path, const size_t len, size_t* const up)
/// Merge `base` and `path` in-place
static void
-merge(SerdStringView* const base, SerdStringView* const path)
+merge(ZixStringView* const base, ZixStringView* const path)
{
size_t up = 0;
const char* begin = remove_dot_segments(path->data, path->length, &up);
@@ -543,10 +543,10 @@ is_dir_sep(const char c)
}
size_t
-serd_write_file_uri(const SerdStringView path,
- const SerdStringView hostname,
- const SerdWriteFunc sink,
- void* const stream)
+serd_write_file_uri(const ZixStringView path,
+ const ZixStringView hostname,
+ const SerdWriteFunc sink,
+ void* const stream)
{
const bool is_windows = is_windows_path(path.data);
size_t len = 0U;
diff --git a/src/uri_utils.h b/src/uri_utils.h
index 76060d6a..63e67d62 100644
--- a/src/uri_utils.h
+++ b/src/uri_utils.h
@@ -7,8 +7,8 @@
#include "string_utils.h"
#include "serd/attributes.h"
-#include "serd/string_view.h"
#include "serd/uri.h"
+#include "zix/string_view.h"
#include <stdbool.h>
#include <string.h>
@@ -19,7 +19,7 @@ typedef struct {
} SlashIndexes;
static inline bool
-slice_equals(const SerdStringView* a, const SerdStringView* b)
+slice_equals(const ZixStringView* a, const ZixStringView* b)
{
return a->length == b->length && !strncmp(a->data, b->data, a->length);
}
diff --git a/src/world.c b/src/world.c
index 37cfe301..b4fe4ebc 100644
--- a/src/world.c
+++ b/src/world.c
@@ -10,8 +10,8 @@
#include "serd/node.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/world.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <stdio.h>
@@ -34,13 +34,13 @@ serd_world_new(SerdAllocator* const allocator)
return NULL;
}
- const SerdStringView rdf_first = serd_string(NS_RDF "first");
- const SerdStringView rdf_nil = serd_string(NS_RDF "nil");
- const SerdStringView rdf_rest = serd_string(NS_RDF "rest");
- const SerdStringView rdf_type = serd_string(NS_RDF "type");
- const SerdStringView xsd_boolean = serd_string(NS_XSD "boolean");
- const SerdStringView xsd_decimal = serd_string(NS_XSD "decimal");
- const SerdStringView xsd_integer = serd_string(NS_XSD "integer");
+ static const ZixStringView rdf_first = ZIX_STATIC_STRING(NS_RDF "first");
+ static const ZixStringView rdf_nil = ZIX_STATIC_STRING(NS_RDF "nil");
+ static const ZixStringView rdf_rest = ZIX_STATIC_STRING(NS_RDF "rest");
+ static const ZixStringView rdf_type = ZIX_STATIC_STRING(NS_RDF "type");
+ static const ZixStringView xsd_boolean = ZIX_STATIC_STRING(NS_XSD "boolean");
+ static const ZixStringView xsd_decimal = ZIX_STATIC_STRING(NS_XSD "decimal");
+ static const ZixStringView xsd_integer = ZIX_STATIC_STRING(NS_XSD "integer");
world->limits.reader_stack_size = 1048576U;
world->limits.writer_max_depth = 128U;
diff --git a/src/writer.c b/src/writer.c
index 7b821145..b87df07a 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -25,11 +25,10 @@
#include "serd/sink.h"
#include "serd/statement.h"
#include "serd/status.h"
-#include "serd/string_view.h"
#include "serd/syntax.h"
#include "serd/uri.h"
#include "serd/world.h"
-#include "serd/writer.h"
+#include "zix/string_view.h"
#include <assert.h>
#include <errno.h>
@@ -836,9 +835,9 @@ write_uri_node(SerdWriter* const writer,
const SerdNode* const node,
const SerdField field)
{
- SerdStatus st = SERD_SUCCESS;
- const SerdStringView string = serd_node_string_view(node);
- const bool has_scheme = serd_uri_string_has_scheme(string.data);
+ SerdStatus st = SERD_SUCCESS;
+ const ZixStringView string = serd_node_string_view(node);
+ const bool has_scheme = serd_uri_string_has_scheme(string.data);
if (supports_abbrev(writer)) {
if (!(writer->flags & SERD_WRITE_LONGHAND) && field == SERD_PREDICATE &&
@@ -850,8 +849,8 @@ write_uri_node(SerdWriter* const writer,
return esink("()", 2, writer);
}
- SerdStringView prefix = {NULL, 0};
- SerdStringView suffix = {NULL, 0};
+ ZixStringView prefix = {NULL, 0};
+ ZixStringView suffix = {NULL, 0};
if (has_scheme && !(writer->flags & SERD_WRITE_EXPANDED) &&
!serd_env_qualify(writer->env, string, &prefix, &suffix)) {
TRY(st, write_lname(writer, prefix.data, prefix.length));
@@ -1387,8 +1386,8 @@ serd_writer_set_base_uri(SerdWriter* writer, const SerdNode* uri)
return SERD_BAD_ARG;
}
- const SerdStringView uri_string =
- uri ? serd_node_string_view(uri) : serd_empty_string();
+ const ZixStringView uri_string =
+ uri ? serd_node_string_view(uri) : zix_empty_string();
if (uri && (writer->syntax == SERD_TURTLE || writer->syntax == SERD_TRIG)) {
TRY(st, terminate_context(writer));
@@ -1403,7 +1402,7 @@ serd_writer_set_base_uri(SerdWriter* writer, const SerdNode* uri)
}
SerdStatus
-serd_writer_set_root_uri(SerdWriter* writer, const SerdStringView uri)
+serd_writer_set_root_uri(SerdWriter* writer, const ZixStringView uri)
{
assert(writer);