NetSurf
|
Interface to URL parsing and joining operations. More...
#include "utils/errors.h"
Go to the source code of this file.
Functions | |
nserror | url_escape (const char *unescaped, bool sptoplus, const char *escexceptions, char **result) |
Escape a string suitable for inclusion in an URL. More... | |
nserror | url_unescape (const char *str, size_t length, size_t *length_out, char **result_out) |
Convert an escaped string to plain. More... | |
Interface to URL parsing and joining operations.
Definition in file url.h.
nserror url_escape | ( | const char * | unescaped, |
bool | sptoplus, | ||
const char * | escexceptions, | ||
char ** | result | ||
) |
Escape a string suitable for inclusion in an URL.
[in] | unescaped | the unescaped string |
[in] | sptoplus | true iff spaces should be converted to + |
[in] | escexceptions | NULL or a string of characters to be excluded from escaping. |
[out] | result | Returns pointer to buffer to escaped string. Returned string is '\0' terminated. |
Definition at line 131 of file url.c.
References NSERROR_BAD_PARAMETER, NSERROR_NOMEM, NSERROR_OK, and result.
Referenced by atari_path_to_nsurl(), form_url_encode(), make_search_nsurl(), posix_path_to_nsurl(), and ro_path_to_nsurl().
nserror url_unescape | ( | const char * | str, |
size_t | length, | ||
size_t * | length_out, | ||
char ** | result_out | ||
) |
Convert an escaped string to plain.
[in] | str | String to unescape. |
[in] | length | Length of string or 0 to use strlen. |
[out] | length_out | Iff non-NULL, value updated to length of returned result_out string (excluding trailing '\0'`). |
[out] | result_out | Returns unescaped string, owned by caller. Must be freed with free(). Returned string has trailing '\0'. |
Definition at line 67 of file url.c.
References ascii_is_hex(), NSERROR_BAD_PARAMETER, NSERROR_NOMEM, NSERROR_OK, result, and xdigit_to_hex().
Referenced by amiga_nsurl_to_path(), atari_nsurl_to_path(), download_ro_filetype(), fetch_data_process(), posix_nsurl_to_path(), ro_nsurl_to_path(), url_to_path(), and windows_nsurl_to_path().