GATE
|
URI and URL parsing and creation functions. More...
Functions | |
GATE_CORE_API gate_result_t | gate_uri_init (gate_uri_t *uri) |
Initializes an empty URI object. | |
GATE_CORE_API gate_result_t | gate_uri_copy (gate_uri_t *target, gate_uri_t const *src) |
Initializes an URI object by copying data from another URI object. | |
GATE_CORE_API gate_result_t | gate_uri_destroy (gate_uri_t *uri) |
Destroys the URI object by releasing all its contained strings. | |
GATE_CORE_API gate_result_t | gate_uri_parse (gate_uri_t *uri, gate_string_t const *text) |
Initializes an URI object by parsing a text string. | |
GATE_CORE_API gate_result_t | gate_uri_to_string (gate_uri_t const *uri, gate_string_t *text, gate_bool_t absolute_path_only) |
Creates a string from the contents of the given URI object. | |
GATE_CORE_API gate_result_t | gate_uri_escape (gate_string_t const *src, gate_string_t *dest) |
Performs an URI string ESCAPE conversion. | |
GATE_CORE_API gate_result_t | gate_uri_unescape (gate_string_t const *src, gate_string_t *dest) |
Performs an URI string UNESCAPE conversion. | |
GATE_CORE_API gate_result_t | gate_uri_parse_user_info (gate_string_t const *src, gate_string_t *username, gate_string_t *password) |
Parses an URI's userinfo field and creates username and password tokens from it. | |
GATE_CORE_API gate_result_t | gate_uri_build_user_info (gate_string_t const *username, gate_string_t const *password, gate_string_t *user_info) |
Generates an URI's userinfo field from username and password parameters. | |
GATE_CORE_API gate_result_t | gate_uri_parse_path (gate_string_t const *path, gate_string_t *abs_path, gate_string_t *query_part) |
Parses an absolute path and splits it into path and query component. | |
URI and URL parsing and creation functions.
GATE_CORE_API gate_result_t gate_uri_init | ( | gate_uri_t * | uri | ) |
Initializes an empty URI object.
[out] | uri | Pointer to URI object to be initialized |
GATE_CORE_API gate_result_t gate_uri_copy | ( | gate_uri_t * | target, |
gate_uri_t const * | src ) |
Initializes an URI object by copying data from another URI object.
[out] | target | Pointer to target URI object to be initialized |
[in] | src | Pointer to source URI object to copy content from |
GATE_CORE_API gate_result_t gate_uri_destroy | ( | gate_uri_t * | uri | ) |
Destroys the URI object by releasing all its contained strings.
[in] | uri | Pointer to target URI object to be destroyed |
GATE_CORE_API gate_result_t gate_uri_parse | ( | gate_uri_t * | uri, |
gate_string_t const * | text ) |
Initializes an URI object by parsing a text string.
[out] | uri | Pointer to target URI object to be initialized |
[in] | text | Pointer to source string to be parsed |
GATE_CORE_API gate_result_t gate_uri_to_string | ( | gate_uri_t const * | uri, |
gate_string_t * | text, | ||
gate_bool_t | absolute_path_only ) |
Creates a string from the contents of the given URI object.
[in] | uri | Pointer to source URI object |
[out] | text | Pointer to target string to be initialized with URI's content |
[in] | absolute_path_only | If TRUE, only the path part is exported - schema, user and host is skipped |
GATE_CORE_API gate_result_t gate_uri_escape | ( | gate_string_t const * | src, |
gate_string_t * | dest ) |
Performs an URI string ESCAPE conversion.
[in] | src | Pointer to plain input string to be escaped |
[out] | dest | Pointer to target string to be initialized with escaped content |
GATE_CORE_API gate_result_t gate_uri_unescape | ( | gate_string_t const * | src, |
gate_string_t * | dest ) |
Performs an URI string UNESCAPE conversion.
[in] | src | Pointer to escaped input string to be unescaped |
[out] | dest | Pointer to target string to be initialized with plain content |
GATE_CORE_API gate_result_t gate_uri_parse_user_info | ( | gate_string_t const * | src, |
gate_string_t * | username, | ||
gate_string_t * | password ) |
Parses an URI's userinfo field and creates username and password tokens from it.
[in] | src | Pointer to encoded userinfo string |
[out] | username | Pointer to target string to be initialized with username content |
[out] | password | Pointer to target string to be initialized with password content |
GATE_CORE_API gate_result_t gate_uri_build_user_info | ( | gate_string_t const * | username, |
gate_string_t const * | password, | ||
gate_string_t * | user_info ) |
Generates an URI's userinfo field from username and password parameters.
[in] | username | Pointer to plain username content |
[in] | password | Pointer to plain password content |
[out] | user_info | Pointer to target string to be initialized with encoded userinfo |
GATE_CORE_API gate_result_t gate_uri_parse_path | ( | gate_string_t const * | path, |
gate_string_t * | abs_path, | ||
gate_string_t * | query_part ) |
Parses an absolute path and splits it into path and query component.
[in] | path | Pointer to string to be parsed |
[out] | abs_path | Pointer to output absolute path value |
[out] | query_part | Pointer to output query value |