#include "common.h"
#include "host_addr.h"
#include "url.h"
#include "misc.h"
#include "walloc.h"
#include "override.h"
Defines | |
#define | ESCAPE_CHAR '%' |
#define | TRANSPARENT_CHAR(x, m) ((x) >= 32 && (x) < 128 && (is_transparent[(x)-32] & (m))) |
#define | PATH_MASK 0x1 |
#define | QUERY_MASK 0x2 |
#define | D(x) { (x), CONST_STRLEN(x) } |
Functions | |
RCSID ("$Id:url.c, v 1.23 2005/10/20 07:17:12 cbiere Exp $") | |
gchar * | url_escape_mask (const gchar *url, guint8 mask) |
Escape undesirable characters using xx, where xx is an hex code. | |
gint | url_escape_mask_into (const gchar *url, gchar *target, gint len, guint8 mask) |
Escape undesirable characters using xx, where xx is an hex code. | |
gchar * | url_escape (const gchar *url) |
Escape undesirable characters using xx, where xx is an hex code. | |
gchar * | url_escape_query (const gchar *url) |
Same as url_escape(), but '+' are also escaped for the query string. | |
gint | url_escape_into (const gchar *url, gchar *target, gint len) |
Escape undesirable characters using xx, where xx is an hex code. | |
gchar * | url_escape_cntrl (gchar *url) |
Escape control characters using xx, where xx is an hex code. | |
gchar * | url_unescape (gchar *url, gboolean inplace) |
Unescape string, in-place if `inplace' is TRUE. | |
url_params_t * | url_params_parse (gchar *query) |
Parse all the parameters in the URL query string. | |
const gchar * | url_params_get (url_params_t *up, const gchar *name) |
Get the value of a parameter, or NULL if the parameter is not present. | |
void | free_params_kv (gpointer key, gpointer value, gpointer unused_udata) |
void | url_params_free (url_params_t *up) |
Dispose of the url_params_t structure. | |
gboolean | url_safe_char (gchar c, url_policy_t p) |
gchar * | url_normalize (gchar *url, url_policy_t pol) |
| |
Variables | |
guint32 | lib_debug |
const guint8 | is_transparent [96] |
Reserved chars: ";", "/", "?", ":", "@", "=" and "&" Unsafe chars : " ", '"', "<", ">", "#", and "%" Misc chars : "{", "}", "|", "\", "^", "~", "[", "]" and "`". | |
const char | hex_alphabet [] = "0123456789ABCDEF" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Escape undesirable characters using xx, where xx is an hex code.
|
|
Escape control characters using xx, where xx is an hex code.
|
|
Escape undesirable characters using xx, where xx is an hex code. This is done in the `target' buffer, whose size is `len'.
|
|
Escape undesirable characters using xx, where xx is an hex code.
|
|
Escape undesirable characters using xx, where xx is an hex code. This is done in the `target' buffer, whose size is `len'. `mask' tells us whether we're escaping an URL path or a query string.
|
|
Same as url_escape(), but '+' are also escaped for the query string.
|
|
|
|
Dispose of the url_params_t structure.
|
|
Get the value of a parameter, or NULL if the parameter is not present. The value returned has already been URL-unescaped. |
|
Parse all the parameters in the URL query string. All parameter values are stored in their URL-unescaped form, but parameter names are NOT un-escaped.
|
|
|
|
Unescape string, in-place if `inplace' is TRUE. Returns the argument if un-escaping is NOT necessary, a new string otherwise unless in-place decoding was requested.
|
|
|
|
Initial value: { 0,3,0,0,3,0,0,3,3,3,3,1,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3, 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0, }
|
|
|