NetSurf
Functions
url.h File Reference

Interface to URL parsing and joining operations. More...

#include "utils/errors.h"
Include dependency graph for url.h:
This graph shows which files directly or indirectly include this file:

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

Detailed Description

Interface to URL parsing and joining operations.

Definition in file url.h.

Function Documentation

◆ url_escape()

nserror url_escape ( const char *  unescaped,
bool  sptoplus,
const char *  escexceptions,
char **  result 
)

Escape a string suitable for inclusion in an URL.

Parameters
[in]unescapedthe unescaped string
[in]sptoplustrue iff spaces should be converted to +
[in]escexceptionsNULL or a string of characters to be excluded from escaping.
[out]resultReturns pointer to buffer to escaped string. Returned string is '\0' terminated.
Returns
NSERROR_OK on success

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().

Here is the caller graph for this function:

◆ url_unescape()

nserror url_unescape ( const char *  str,
size_t  length,
size_t *  length_out,
char **  result_out 
)

Convert an escaped string to plain.

Parameters
[in]strString to unescape.
[in]lengthLength of string or 0 to use strlen.
[out]length_outIff non-NULL, value updated to length of returned result_out string (excluding trailing '\0'`).
[out]result_outReturns unescaped string, owned by caller. Must be freed with free(). Returned string has trailing '\0'.
Returns
NSERROR_OK on success

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().

Here is the call graph for this function:
Here is the caller graph for this function: