aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-03-16 16:21:20 -0400
committerDavid Robillard <d@drobilla.net>2019-04-13 19:15:32 +0200
commitc678dcfa54f3cf6784ac505f9e669ee233ba34c9 (patch)
tree9609a6978f1c25d009543d6d88043078b613a0c4 /src/env.c
parent2a480d8cc56fe4d29fba2759b62d9f09fc0cc87e (diff)
downloadserd-c678dcfa54f3cf6784ac505f9e669ee233ba34c9.tar.gz
serd-c678dcfa54f3cf6784ac505f9e669ee233ba34c9.tar.bz2
serd-c678dcfa54f3cf6784ac505f9e669ee233ba34c9.zip
Use char* for strings in public API
The constant casting just makes user code a mess, for no benefit.
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/env.c b/src/env.c
index 582c1b44..a27e342e 100644
--- a/src/env.c
+++ b/src/env.c
@@ -88,7 +88,7 @@ serd_env_set_base_uri(SerdEnv* env,
static inline SerdPrefix*
serd_env_find(const SerdEnv* env,
- const uint8_t* name,
+ const char* name,
size_t name_len)
{
for (size_t i = 0; i < env->n_prefixes; ++i) {
@@ -144,9 +144,9 @@ serd_env_set_prefix(SerdEnv* env,
}
SerdStatus
-serd_env_set_prefix_from_strings(SerdEnv* env,
- const uint8_t* name,
- const uint8_t* uri)
+serd_env_set_prefix_from_strings(SerdEnv* env,
+ const char* name,
+ const char* uri)
{
const SerdNode name_node = serd_node_from_string(SERD_LITERAL, name);
const SerdNode uri_node = serd_node_from_string(SERD_URI, uri);
@@ -182,7 +182,7 @@ serd_env_expand(const SerdEnv* env,
SerdChunk* uri_prefix,
SerdChunk* uri_suffix)
{
- const uint8_t* const colon = (const uint8_t*)memchr(
+ const char* const colon = (const char*)memchr(
curie->buf, ':', curie->n_bytes + 1);
if (curie->type != SERD_CURIE || !colon) {
return SERD_ERR_BAD_ARG;
@@ -212,7 +212,7 @@ serd_env_expand_node(const SerdEnv* env,
return SERD_NODE_NULL;
}
const size_t len = prefix.len + suffix.len;
- uint8_t* buf = (uint8_t*)malloc(len + 1);
+ char* buf = (char*)malloc(len + 1);
SerdNode ret = { buf, len, 0, SERD_URI };
snprintf((char*)buf, ret.n_bytes + 1, "%s%s", prefix.buf, suffix.buf);
return ret;