aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-13 11:22:18 +0100
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commit4401b2bbcda598599469722d7288bc36e389e356 (patch)
tree858d8e69db0018e3c825c74cbd2cd82a4b66a0c6 /src/node.c
parent70277ccdb3035db83d81d942777c12a60c4aded3 (diff)
downloadserd-4401b2bbcda598599469722d7288bc36e389e356.tar.gz
serd-4401b2bbcda598599469722d7288bc36e389e356.tar.bz2
serd-4401b2bbcda598599469722d7288bc36e389e356.zip
Shorten node constructor names
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/src/node.c b/src/node.c
index 803f2c9b..db814233 100644
--- a/src/node.c
+++ b/src/node.c
@@ -107,28 +107,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_dir_sep(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;
@@ -229,9 +229,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) {
@@ -255,10 +255,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);
@@ -286,7 +286,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;
@@ -341,7 +341,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 = (uint64_t)((i < 0) ? -i : i);
const unsigned digits = serd_digits((double)abs_i);
@@ -366,9 +366,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);
char* const str = (char*)calloc(len + 2, 1);