uri_create_uri — create a new URI from an existing URI
URI parsing library (liburi, -luri)
#include <liburi.h>
URI *uri_create_uri(
const URI *restrict uri,
const URI *restrict base);
The uri_create_str function creates a new
URI instance from an existing URI.
If uri is not absolute, and an absolute base
URI is supplied as base, the source URI
will be resolved relative to the base URI and the result will be
an absolute URI. If no base URI is supplied, the result will be a
duplicate of uri.
The resulting instance must be freed later using uri_destroy(3).
uriThe source URI to duplicate or resolve.
base
An optional absolute base URI. If base is supplied but is not an absolute URI, the results are undefined.
If the URI was duplicated or resolved successfully,
uri_create_uri will return a new
URI instance. If the URI could not be
duplicated, or some other error occurs, NULL will
be returned and errno set accordingly.
In the event of an error ocurring, errno may be
set to one of the following values:
ENOMEMA memory allocation operation failed.
liburi(3), uri_create_str(3), uri_destroy(3), uri_absolute(3), uri_str(3).