![]() |
![]()
| ![]() |
![]()
NAME
LIBRARYlibrary “libkcgi” SYNOPSIS
char *
char *
DESCRIPTIONFormat an absolute (full) URL. The host is in some standards called the "authority". scheme://host:port/path?key=val scheme://host:port/path scheme:path Passing a If the host is non-empty and not
If the port is zero, it is omitted. The
port is only used if host is
non-empty and not The variable arguments are arranged in pairs terminated by a
single Only the query string pairs are URL-encoded, so the caller must make sure that the characters in host and path are valid. The deprecated form of these functions,
RETURN VALUESReturn newly-allocated strings that must be freed with
free(3)
or EXAMPLESTo print a full URL: khttp_urlabs(KSCHEME_HTTPS, foo.com,
80, b, c, d, NULL); This assigns Setting the port to zero eliminates the port: khttp_urlabs(KSCHEME_HTTPS, foo.com,
0, b, c, d, NULL); This assigns An empty path component ends with the domain (or query string). khttp_urlabs(KSCHEME_HTTPS, foo.com,
0, , c, d, NULL); This assigns To use a host-less scheme, specify a khttp_urlabs(KSCHEME_MAILTO, NULL, 0,
k@b.com, NULL); This assigns AUTHORSWritten by Kristaps Dzonsons <kristaps@bsd.lv>. CAVEATSThese functions can currently be used to create semantically
invalid URLs such as
|