Qpid Proton C API 0.40.0
 
Loading...
Searching...
No Matches
URL

Deprecated - Use a third-party URL library. More...

Typedefs

typedef struct pn_url_t pn_url_t
 A parsed URL.
 

Functions

pn_url_tpn_url (void)
 Create an empty URL.
 
pn_url_tpn_url_parse (const char *url)
 Parse a string URL as a pn_url_t.
 
void pn_url_free (pn_url_t *url)
 Free a URL.
 
void pn_url_clear (pn_url_t *url)
 Clear the contents of the URL.
 
const char * pn_url_str (pn_url_t *url)
 Return the string form of a URL.
 

Getters for parts of the URL.

Values belong to the URL.

May return NULL if the value is not set.

const char * pn_url_get_scheme (pn_url_t *url)
 
const char * pn_url_get_username (pn_url_t *url)
 
const char * pn_url_get_password (pn_url_t *url)
 
const char * pn_url_get_host (pn_url_t *url)
 
const char * pn_url_get_port (pn_url_t *url)
 
const char * pn_url_get_path (pn_url_t *url)
 

Setters for parts of the URL.

Values are copied.

Value can be NULL to indicate the part is not set.

void pn_url_set_scheme (pn_url_t *url, const char *scheme)
 
void pn_url_set_username (pn_url_t *url, const char *username)
 
void pn_url_set_password (pn_url_t *url, const char *password)
 
void pn_url_set_host (pn_url_t *url, const char *host)
 
void pn_url_set_port (pn_url_t *url, const char *port)
 
void pn_url_set_path (pn_url_t *url, const char *path)
 

Detailed Description

Deprecated - Use a third-party URL library.

Function Documentation

◆ pn_url_parse()

pn_url_t * pn_url_parse ( const char *  url)

Parse a string URL as a pn_url_t.

URL syntax:

[ <scheme> :// ] [ <user> [ : <password> ] @ ] <host> [ : <port> ] [ / <path> ]

scheme, user, password, port cannot contain any of '@', ':', '/'

If the first character of host is '[' then it can contain any character up to ']' (this is to allow IPv6 literal syntax). Otherwise it also cannot contain '@', ':', '/'

path can contain any character

Parameters
[in]urlA URL string.
Returns
The parsed pn_url_t or NULL if url is not a valid URL string.

◆ pn_url_str()

const char * pn_url_str ( pn_url_t url)

Return the string form of a URL.

The returned string is owned by the pn_url_t and will become invalid if it is modified.