URL

## Typedefs

typedef struct pn_url_t | pn_url_t
| A parsed URL. More...

## Functions

PN_EXTERN pn_url_t * | pn_url (void)
| Create an empty URL. More...
PN_EXTERN pn_url_t * | pn_url_parse (const char *url)
| Parse a string URL as a pn_url_t. More...
PN_EXTERN void | pn_url_free (pn_url_t *url)
| Free a URL. More...
PN_EXTERN void | pn_url_clear (pn_url_t *url)
| Clear the contents of the URL. More...
PN_EXTERN const char * | pn_url_str (pn_url_t *url)
| Return the string form of a URL. More...

## Getters for parts of the URL.

Values belong to the URL. May return NULL if the value is not set.
PN_EXTERN const char * | pn_url_get_scheme (pn_url_t *url)
PN_EXTERN const char * | pn_url_get_username (pn_url_t *url)
PN_EXTERN const char * | pn_url_get_password (pn_url_t *url)
PN_EXTERN const char * | pn_url_get_host (pn_url_t *url)
PN_EXTERN const char * | pn_url_get_port (pn_url_t *url)
PN_EXTERN 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.
PN_EXTERN void | pn_url_set_scheme (pn_url_t *url, const char *scheme)
PN_EXTERN void | pn_url_set_username (pn_url_t *url, const char *username)
PN_EXTERN void | pn_url_set_password (pn_url_t *url, const char *password)
PN_EXTERN void | pn_url_set_host (pn_url_t *url, const char *host)
PN_EXTERN void | pn_url_set_port (pn_url_t *url, const char *port)
PN_EXTERN void | pn_url_set_path (pn_url_t *url, const char *path)

## Detailed Description

## Typedef Documentation

typedef struct pn_url_t pn_url_t

A parsed URL.

## Function Documentation

PN_EXTERN pn_url_t* pn_url | ( | void |  | ) |

Create an empty URL.

PN_EXTERN void pn_url_clear | ( | pn_url_t * | url | ) |

Clear the contents of the URL.

PN_EXTERN void pn_url_free | ( | pn_url_t * | url | ) |

Free a URL.

PN_EXTERN const char* pn_url_get_host | ( | pn_url_t * | url | ) |

PN_EXTERN const char* pn_url_get_password | ( | pn_url_t * | url | ) |

PN_EXTERN const char* pn_url_get_path | ( | pn_url_t * | url | ) |

PN_EXTERN const char* pn_url_get_port | ( | pn_url_t * | url | ) |

PN_EXTERN const char* pn_url_get_scheme | ( | pn_url_t * | url | ) |

PN_EXTERN const char* pn_url_get_username | ( | pn_url_t * | url | ) |

PN_EXTERN pn_url_t* pn_url_parse | ( | const char * | url | ) |

Parse a string URL as a pn_url_t.

Parameters

  [in] | url | A URL string.

Returns
  The parsed pn_url_t or NULL if url is not a valid URL string.

PN_EXTERN void pn_url_set_host | ( | pn_url_t * | url,
|  | const char * | host
| ) |  |

PN_EXTERN void pn_url_set_password | ( | pn_url_t * | url,
|  | const char * | password
| ) |  |

PN_EXTERN void pn_url_set_path | ( | pn_url_t * | url,
|  | const char * | path
| ) |  |

PN_EXTERN void pn_url_set_port | ( | pn_url_t * | url,
|  | const char * | port
| ) |  |

PN_EXTERN void pn_url_set_scheme | ( | pn_url_t * | url,
|  | const char * | scheme
| ) |  |

PN_EXTERN void pn_url_set_username | ( | pn_url_t * | url,
|  | const char * | username
| ) |  |

PN_EXTERN 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.