diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 6 | ||||
-rw-r--r-- | src/node.c | 46 | ||||
-rw-r--r-- | src/serdi.c | 4 |
3 files changed, 27 insertions, 29 deletions
@@ -88,7 +88,7 @@ serd_env_set_base_uri(SerdEnv* const env, const SerdNode* const uri) // Resolve base URI and create a new node and URI for it SerdURIView base_uri; SerdNode base_uri_node = - serd_node_new_uri_from_node(uri, &env->base_uri, &base_uri); + serd_new_uri_from_node(uri, &env->base_uri, &base_uri); // Replace the current base URI serd_node_free(&env->base_uri_node); @@ -151,7 +151,7 @@ serd_env_set_prefix(SerdEnv* const env, // Resolve relative URI and create a new node and URI for it SerdURIView abs_uri; SerdNode abs_uri_node = - serd_node_new_uri_from_node(uri, &env->base_uri, &abs_uri); + serd_new_uri_from_node(uri, &env->base_uri, &abs_uri); // Set prefix to resolved (absolute) URI serd_env_add(env, name, &abs_uri_node); @@ -237,7 +237,7 @@ serd_env_expand_node(const SerdEnv* const env, const SerdNode* const node) break; case SERD_URI: { SerdURIView ignored; - return serd_node_new_uri_from_node(node, &env->base_uri, &ignored); + return serd_new_uri_from_node(node, &env->base_uri, &ignored); } case SERD_CURIE: { SerdStringView prefix; @@ -117,28 +117,28 @@ serd_node_equals(const SerdNode* const a, const SerdNode* const b) } SerdNode -serd_node_new_uri_from_node(const SerdNode* const uri_node, - const SerdURIView* const base, - SerdURIView* const out) +serd_new_uri_from_node(const SerdNode* const uri_node, + const SerdURIView* const base, + SerdURIView* const out) { return (uri_node->type == SERD_URI && uri_node->buf) - ? serd_node_new_uri_from_string(uri_node->buf, base, out) + ? serd_new_uri_from_string(uri_node->buf, base, out) : SERD_NODE_NULL; } SerdNode -serd_node_new_uri_from_string(const char* const str, - const SerdURIView* const base, - SerdURIView* const out) +serd_new_uri_from_string(const char* const str, + const SerdURIView* const base, + SerdURIView* const out) { if (!str || str[0] == '\0') { // Empty URI => Base URI, or nothing if no base is given - return base ? serd_node_new_uri(base, NULL, out) : SERD_NODE_NULL; + return base ? serd_new_uri(base, NULL, out) : SERD_NODE_NULL; } SerdURIView uri; serd_uri_parse(str, &uri); - return serd_node_new_uri(&uri, base, out); // Resolve/Serialise + return serd_new_uri(&uri, base, out); // Resolve/Serialise } static bool @@ -178,9 +178,9 @@ is_uri_path_char(const char c) } SerdNode -serd_node_new_file_uri(const char* const path, - const char* const hostname, - SerdURIView* const out) +serd_new_file_uri(const char* const path, + const char* const hostname, + SerdURIView* const out) { const size_t path_len = strlen(path); const size_t hostname_len = hostname ? strlen(hostname) : 0; @@ -228,9 +228,9 @@ serd_node_new_file_uri(const char* const path, } SerdNode -serd_node_new_uri(const SerdURIView* const uri, - const SerdURIView* const base, - SerdURIView* const out) +serd_new_uri(const SerdURIView* const uri, + const SerdURIView* const base, + SerdURIView* const out) { SerdURIView abs_uri = *uri; if (base) { @@ -254,10 +254,10 @@ serd_node_new_uri(const SerdURIView* const uri, } SerdNode -serd_node_new_relative_uri(const SerdURIView* const uri, - const SerdURIView* const base, - const SerdURIView* const root, - SerdURIView* const out) +serd_new_relative_uri(const SerdURIView* const uri, + const SerdURIView* const base, + const SerdURIView* const root, + SerdURIView* const out) { const size_t uri_len = serd_uri_string_length(uri); const size_t base_len = serd_uri_string_length(base); @@ -285,7 +285,7 @@ serd_digits(const double abs) } SerdNode -serd_node_new_decimal(const double d, const unsigned frac_digits) +serd_new_decimal(const double d, const unsigned frac_digits) { if (isnan(d) || isinf(d)) { return SERD_NODE_NULL; @@ -340,7 +340,7 @@ serd_node_new_decimal(const double d, const unsigned frac_digits) } SerdNode -serd_node_new_integer(const int64_t i) +serd_new_integer(const int64_t i) { uint64_t abs_i = (i < 0) ? -i : i; const unsigned digits = serd_digits((double)abs_i); @@ -365,9 +365,7 @@ serd_node_new_integer(const int64_t i) } SerdNode -serd_node_new_blob(const void* const buf, - const size_t size, - const bool wrap_lines) +serd_new_blob(const void* const buf, const size_t size, const bool wrap_lines) { const size_t len = serd_base64_get_length(size, wrap_lines); uint8_t* str = (uint8_t*)calloc(len + 2, 1); diff --git a/src/serdi.c b/src/serdi.c index f713f327..c447e2b2 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -318,9 +318,9 @@ main(int argc, char** argv) SerdURIView base_uri = SERD_URI_NULL; SerdNode base = SERD_NODE_NULL; if (a < argc) { // Base URI given on command line - base = serd_node_new_uri_from_string((const char*)argv[a], NULL, &base_uri); + base = serd_new_uri_from_string((const char*)argv[a], NULL, &base_uri); } else if (from_file && in_fd != stdin) { // Use input file URI - base = serd_node_new_file_uri(input, NULL, &base_uri); + base = serd_new_file_uri(input, NULL, &base_uri); } FILE* const out_fd = stdout; |