OSSL_parse_url

Parse url into allocated scheme/user/host/port/path/query/fragment components.

Synopsis

Declared in <openssl/http.h>

int
OSSL_parse_url(
    char const* url,
    char** pscheme,
    char** puser,
    char** phost,
    char** pport,
    int* pport_num,
    char** ppath,
    char** pquery,
    char** pfrag);

Return Value

1 on success, or 0 on failure; free each returned string with OPENSSL_free().

Parameters

NameDescription
urlURL string to parse.
pschemeReceives allocated scheme (for example "https"), or NULL to skip.
puserReceives allocated userinfo, or NULL to skip.
phostReceives allocated host, or NULL to skip.
pportReceives allocated port string, or NULL to skip.
pport_numReceives numeric port, or NULL to skip.
ppathReceives allocated path (at least "/"), or NULL to skip.
pqueryReceives allocated query without leading '?', or NULL to skip.
pfragReceives allocated fragment without leading '#', or NULL to skip.