From bf01cef66e561ea0cd2ad0babf08194b00f84b77 Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Wed, 12 Aug 2020 15:23:49 +0200
Subject: Move local URI utility functions

---
 src/node.c | 56 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/node.c b/src/node.c
index 30f8e982..51dc8828 100644
--- a/src/node.c
+++ b/src/node.c
@@ -87,6 +87,34 @@ serd_node_check_padding(const SerdNode* node)
 #endif
 }
 
+static size_t
+serd_uri_string_length(const SerdURIView* uri)
+{
+  size_t len = uri->path_prefix.len;
+
+#define ADD_LEN(field, n_delims)     \
+  if ((field).len) {                 \
+    len += (field).len + (n_delims); \
+  }
+
+  ADD_LEN(uri->path, 1)      // + possible leading `/'
+  ADD_LEN(uri->scheme, 1)    // + trailing `:'
+  ADD_LEN(uri->authority, 2) // + leading `//'
+  ADD_LEN(uri->query, 1)     // + leading `?'
+  ADD_LEN(uri->fragment, 1)  // + leading `#'
+
+  return len + 2; // + 2 for authority `//'
+}
+
+static size_t
+string_sink(const void* buf, size_t size, size_t nmemb, void* stream)
+{
+  char** ptr = (char**)stream;
+  memcpy(*ptr, buf, size * nmemb);
+  *ptr += size * nmemb;
+  return nmemb;
+}
+
 size_t
 serd_node_total_size(const SerdNode* node)
 {
@@ -369,34 +397,6 @@ serd_node_equals(const SerdNode* a, const SerdNode* b)
   return serd_node_total_size(b) == a_size && !memcmp(a, b, a_size);
 }
 
-static size_t
-serd_uri_string_length(const SerdURIView* uri)
-{
-  size_t len = uri->path_prefix.len;
-
-#define ADD_LEN(field, n_delims)     \
-  if ((field).len) {                 \
-    len += (field).len + (n_delims); \
-  }
-
-  ADD_LEN(uri->path, 1)      // + possible leading `/'
-  ADD_LEN(uri->scheme, 1)    // + trailing `:'
-  ADD_LEN(uri->authority, 2) // + leading `//'
-  ADD_LEN(uri->query, 1)     // + leading `?'
-  ADD_LEN(uri->fragment, 1)  // + leading `#'
-
-  return len + 2; // + 2 for authority `//'
-}
-
-static size_t
-string_sink(const void* buf, size_t size, size_t nmemb, void* stream)
-{
-  char** ptr = (char**)stream;
-  memcpy(*ptr, buf, size * nmemb);
-  *ptr += size * nmemb;
-  return nmemb;
-}
-
 SerdNode*
 serd_new_uri(const SerdStringView str)
 {
-- 
cgit v1.2.1