MCPcopy Create free account
hub / github.com/audacity/audacity / serd_node_new_uri

Function serd_node_new_uri

lib-src/lv2/serd/src/node.c:201–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201SerdNode
202serd_node_new_uri(const SerdURI* uri, const SerdURI* base, SerdURI* out)
203{
204 SerdURI abs_uri = *uri;
205 if (base) {
206 serd_uri_resolve(uri, base, &abs_uri);
207 }
208
209 const size_t len = serd_uri_string_length(&abs_uri);
210 uint8_t* buf = (uint8_t*)malloc(len + 1);
211 SerdNode node = { buf, 0, 0, 0, SERD_URI };
212 uint8_t* ptr = buf;
213 const size_t actual_len = serd_uri_serialise(&abs_uri, string_sink, &ptr);
214
215 buf[actual_len] = '\0';
216 node.n_bytes = actual_len;
217 node.n_chars = serd_strlen(buf, NULL, NULL);
218
219 if (out) {
220 serd_uri_parse(buf, out); // TODO: cleverly avoid double parse
221 }
222
223 return node;
224}
225
226SerdNode
227serd_node_new_relative_uri(const SerdURI* uri,

Callers 1

Calls 5

serd_uri_resolveFunction · 0.85
serd_uri_string_lengthFunction · 0.85
serd_uri_serialiseFunction · 0.85
serd_strlenFunction · 0.85
serd_uri_parseFunction · 0.85

Tested by

no test coverage detected