From d7a4a138ba371e8a969a7fde8219c88870d288fc Mon Sep 17 00:00:00 2001 From: "Staysail Systems, Inc" Date: Thu, 22 Feb 2024 01:03:04 -0800 Subject: Manual page updates for v1.7.2 --- man/v1.7.2/nng_url_parse.3.html | 146 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 man/v1.7.2/nng_url_parse.3.html (limited to 'man/v1.7.2/nng_url_parse.3.html') diff --git a/man/v1.7.2/nng_url_parse.3.html b/man/v1.7.2/nng_url_parse.3.html new file mode 100644 index 00000000..e8fc0db7 --- /dev/null +++ b/man/v1.7.2/nng_url_parse.3.html @@ -0,0 +1,146 @@ +--- +version: v1.7.2 +layout: manpage_v2 +title: nng_url_parse(3) +--- +

nng_url_parse(3)

+
+

NAME

+
+
+

nng_url_parse - create URL structure from a string

+
+
+
+
+

SYNOPSIS

+
+
+
+
#include <nng/nng.h>
+
+int nng_url_parse(nng_url **urlp, const char *str);
+
+
+
+
+
+

DESCRIPTION

+
+
+

The nng_url_parse() function parses the string str containing an +RFC 3986 compliant URL, and creates +an +nng_url structure containing the results. +A pointer to the resulting structure is stored in urlp.

+
+
+

The structure may disposed of when no longer needed by calling +nng_url_free().

+
+
+

URL Canonicalization

+
+

The nng_url_parse() function also canonicalizes the results, as +follows:

+
+
+
    +
  1. +

    The URL is parsed into the various components.

    +
  2. +
  3. +

    The u_scheme, u_hostname, u_host, and u_port members are +converted to lower case.

    +
  4. +
  5. +

    Percent-encoded values for +unreserved characters +converted to their unencoded forms.

    +
  6. +
  7. +

    Additionally URL percent-encoded values for characters in the path +and with numeric values larger than 127 (i.e. not ASCII) are decoded.

    +
  8. +
  9. +

    The resulting u_path is checked for invalid UTF-8 sequences, consisting +of surrogate pairs, illegal byte sequences, or overlong encodings. +If this check fails, then the entire URL is considered invalid, and +the function returns NNG_EINVAL.

    +
  10. +
  11. +

    Path segments consisting of . and .. are resolved as per +RFC 3986 6.2.2.3.

    +
  12. +
  13. +

    Further, empty path segments are removed, meaning that duplicate +slash (/) separators are removed from the path.

    +
  14. +
  15. +

    If a port was not specified, but the scheme defines a default +port, then u_port will be filled in with the value of the default port.

    +
  16. +
+
+
+ + + + + +
+ + +Only the u_userinfo, u_query, and u_fragment members will ever be + NULL. The other members will be filled in with either default values + or the empty string if they cannot be determined from str. +
+
+
+
+
+
+

RETURN VALUES

+
+
+

This function returns 0 on success, and non-zero otherwise.

+
+
+
+
+

ERRORS

+
+
+ + + + + + + + + +
+NNG_ENOMEM + +

Insufficient free memory exists to allocate a message.

+
+NNG_EINVAL + +

An invalid URL was supplied.

+
+
+
+
+
+

SEE ALSO

+ +
-- cgit v1.2.3-70-g09d2