diff options
Diffstat (limited to 'man/uri.3')
-rw-r--r-- | man/uri.3 | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/man/uri.3 b/man/uri.3 new file mode 100644 index 0000000..03aa753 --- /dev/null +++ b/man/uri.3 @@ -0,0 +1,85 @@ +.Dd Jan 18, 2021 +.Dt YURI 3 +.Sh NAME +.Nm uri_new , +.Nm uri_decode , +.Nm uri_encode , +.Nm uri_normalize , +.Nm uri_free +.Nd URI object manipulation functions +.Sh SYNOPSIS +.In yuri.h +.Ft "struct uri *" +.Fn uri_new +.Ft "struct uri *" +.Fn uri_decode "const char *str" +.Ft "char *" +.Fn uri_encode "struct uri *u" +.Ft int +.Fn uri_normalize "struct uri *u" +.Ft void +.Fn uri_free "struct uri *u" +.Sh DESCRIPTION +.Fn uri_new +initializes a new URI object. +.Pp +.Fn uri_decode +decodes URI pointed to by string +.Em str +and returns a corresponding URI object. +.Pp +.Fn uri_encode +encodes URI object pointed to by +.Em u +and returns corresponding string. +.Pp +.Fn uri_normalize +normalizes URI object pointed to by +.Em u +as per section 6.2 of RFC 3986. +.Pp +.Fn uri_free +frees a URI object. +.Pp +For information on manipulating existing URI objects, refer to +.Xr uri_set 3 +and +.Xr uri_unset 3 . +.Sh RETURN VALUES +.Fn uri_new +and +.Fn uri_decode +return a valid pointer to newly allocated URI object on success, or +.Nm NULL +on failure. +.Pp +.Fn uri_encode +return a valid string pointer on success, or +.Nm NULL +on failure. +.Pp +.Fn uri_normalize +returns +.Em 0 +on success, or +.Em -1 +on failure. +.Pp +Upon success, values returned by +.Fn uri_new +and +.Fn uri_decode +should be passed to +.Fn uri_free +after use, +and values returned by +.Fn uri_encode +should be passed to +.Fn free +after use. +.Sh SEE ALSO +.Xr uri_set 3 , +.Xr uri_unset 3 , +.Xr uri_get 3 +.Sh AUTHORS +.An Ali Fardan Aq Mt raiz@stellarbound.space |