aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-06-29 12:53:23 -0400
committerDavid Robillard <d@drobilla.net>2017-06-30 10:29:33 -0400
commit902d171c5e79561a534c3cbb9cc547cd1fadeab7 (patch)
tree20b2e3bdadb7e390ab33d5e1163ebdfe8b6280cf /src/env.c
parent195e4bcff3c4dfd3fe8bbf0df57d53ce89ca99e8 (diff)
downloadserd-902d171c5e79561a534c3cbb9cc547cd1fadeab7.tar.gz
serd-902d171c5e79561a534c3cbb9cc547cd1fadeab7.tar.bz2
serd-902d171c5e79561a534c3cbb9cc547cd1fadeab7.zip
Fix various clang-tidy issues
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/env.c b/src/env.c
index 92cb4150..adda27ba 100644
--- a/src/env.c
+++ b/src/env.c
@@ -69,16 +69,16 @@ serd_env_get_base_uri(const SerdEnv* env,
SERD_API
SerdStatus
serd_env_set_base_uri(SerdEnv* env,
- const SerdNode* uri_node)
+ const SerdNode* uri)
{
- if (!env || !uri_node) {
+ if (!env || !uri) {
return SERD_ERR_BAD_ARG;
}
// Resolve base URI and create a new node and URI for it
SerdURI base_uri;
SerdNode base_uri_node = serd_node_new_uri_from_node(
- uri_node, &env->base_uri, &base_uri);
+ uri, &env->base_uri, &base_uri);
if (base_uri_node.buf) {
// Replace the current base URI
@@ -128,18 +128,18 @@ SERD_API
SerdStatus
serd_env_set_prefix(SerdEnv* env,
const SerdNode* name,
- const SerdNode* uri_node)
+ const SerdNode* uri)
{
- if (!name->buf || uri_node->type != SERD_URI) {
+ if (!name->buf || uri->type != SERD_URI) {
return SERD_ERR_BAD_ARG;
- } else if (serd_uri_string_has_scheme(uri_node->buf)) {
+ } else if (serd_uri_string_has_scheme(uri->buf)) {
// Set prefix to absolute URI
- serd_env_add(env, name, uri_node);
+ serd_env_add(env, name, uri);
} else {
// Resolve relative URI and create a new node and URI for it
SerdURI abs_uri;
SerdNode abs_uri_node = serd_node_new_uri_from_node(
- uri_node, &env->base_uri, &abs_uri);
+ uri, &env->base_uri, &abs_uri);
// Set prefix to resolved (absolute) URI
serd_env_add(env, name, &abs_uri_node);
@@ -185,7 +185,7 @@ SERD_API
bool
serd_env_qualify(const SerdEnv* env,
const SerdNode* uri,
- SerdNode* prefix_name,
+ SerdNode* prefix,
SerdChunk* suffix)
{
for (size_t i = 0; i < env->n_prefixes; ++i) {
@@ -194,7 +194,7 @@ serd_env_qualify(const SerdEnv* env,
if (!strncmp((const char*)uri->buf,
(const char*)prefix_uri->buf,
prefix_uri->n_bytes)) {
- *prefix_name = env->prefixes[i].name;
+ *prefix = env->prefixes[i].name;
suffix->buf = uri->buf + prefix_uri->n_bytes;
suffix->len = uri->n_bytes - prefix_uri->n_bytes;
if (is_name(suffix->buf, suffix->len)) {
@@ -209,23 +209,23 @@ serd_env_qualify(const SerdEnv* env,
SERD_API
SerdStatus
serd_env_expand(const SerdEnv* env,
- const SerdNode* qname,
+ const SerdNode* curie,
SerdChunk* uri_prefix,
SerdChunk* uri_suffix)
{
const uint8_t* const colon = (const uint8_t*)memchr(
- qname->buf, ':', qname->n_bytes + 1);
+ curie->buf, ':', curie->n_bytes + 1);
if (!colon) {
- return SERD_ERR_BAD_ARG; // Invalid qname
+ return SERD_ERR_BAD_ARG; // Invalid CURIE
}
- const size_t name_len = colon - qname->buf;
- const SerdPrefix* const prefix = serd_env_find(env, qname->buf, name_len);
+ const size_t name_len = colon - curie->buf;
+ const SerdPrefix* const prefix = serd_env_find(env, curie->buf, name_len);
if (prefix) {
uri_prefix->buf = prefix->uri.buf;
uri_prefix->len = prefix->uri.n_bytes;
uri_suffix->buf = colon + 1;
- uri_suffix->len = qname->n_bytes - (colon - qname->buf) - 1;
+ uri_suffix->len = curie->n_bytes - (colon - curie->buf) - 1;
return SERD_SUCCESS;
}
return SERD_ERR_NOT_FOUND;