diff options
author | David Robillard <d@drobilla.net> | 2023-02-26 12:39:18 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 16:27:02 -0500 |
commit | 70277ccdb3035db83d81d942777c12a60c4aded3 (patch) | |
tree | 401d570c44167148cb282d1013ec1eaf4abe6283 /src/env.c | |
parent | febb30141356df83a56026bbb14099e3cb2c82fc (diff) | |
download | serd-70277ccdb3035db83d81d942777c12a60c4aded3.tar.gz serd-70277ccdb3035db83d81d942777c12a60c4aded3.tar.bz2 serd-70277ccdb3035db83d81d942777c12a60c4aded3.zip |
Rename string view fields
Diffstat (limited to 'src/env.c')
-rw-r--r-- | src/env.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -179,9 +179,9 @@ serd_env_qualify(const SerdEnv* const env, const SerdNode* const prefix_uri = &env->prefixes[i].uri; if (uri->n_bytes >= prefix_uri->n_bytes) { if (!strncmp(uri->buf, prefix_uri->buf, prefix_uri->n_bytes)) { - *prefix = env->prefixes[i].name; - suffix->buf = uri->buf + prefix_uri->n_bytes; - suffix->len = uri->n_bytes - prefix_uri->n_bytes; + *prefix = env->prefixes[i].name; + suffix->data = uri->buf + prefix_uri->n_bytes; + suffix->length = uri->n_bytes - prefix_uri->n_bytes; return true; } } @@ -208,10 +208,10 @@ serd_env_expand(const SerdEnv* const env, const size_t name_len = (size_t)(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 = curie->n_bytes - name_len - 1; + uri_prefix->data = prefix->uri.buf; + uri_prefix->length = prefix->uri.n_bytes; + uri_suffix->data = colon + 1; + uri_suffix->length = curie->n_bytes - name_len - 1; return SERD_SUCCESS; } return SERD_BAD_CURIE; @@ -238,10 +238,10 @@ serd_env_expand_node(const SerdEnv* const env, const SerdNode* const node) if (serd_env_expand(env, node, &prefix, &suffix)) { return SERD_NODE_NULL; } - const size_t len = prefix.len + suffix.len; + const size_t len = prefix.length + suffix.length; char* buf = (char*)malloc(len + 1); SerdNode ret = {buf, len, 0, SERD_URI}; - snprintf(buf, ret.n_bytes + 1, "%s%s", prefix.buf, suffix.buf); + snprintf(buf, ret.n_bytes + 1, "%s%s", prefix.data, suffix.data); return ret; } case SERD_BLANK: |