uri_absolute — determine whether a URI is relative or absolute
URI parsing library (liburi, -luri)
#include <liburi.h>
int uri_absolute(
URI *uri);
The uri_absolute function determines whether a
parsed URI is absolute or relative.
An absolute URI is one which does not require the use of a base URI in order to be used.
uriThe URI to evaluate.
If successful, uri_absolute returns
1 if uri contains an
absolute URI, and 0 otherwise.
If an error occurs, uri_absolute returns
-1, and sets errno
accordingly.
URI *relative, *absolute;
int r, a;
absolute = uri_create_str("http://example.com", NULL);
relative = uri_create_str("sample?toggle=1", NULL);
/* a will be set to 1 */
a = uri_absolute(absolute);
/* r will be set to 0 */
b = uri_absolute(relative);
liburi(3), uri_absolute_path(3).