16#include "../dlib/dlib.h"
19#define URL_HTTP_PORT 80
20#define URL_HTTPS_PORT 443
23#define URL_HOST_ERROR -1
24#define URL_HOST_NAME 0
25#define URL_HOST_IPV4 1
26#define URL_HOST_IPV6 2
32#define URL_Get (1 << 0)
33#define URL_Post (1 << 1)
35#define URL_E2EQuery (1 << 5)
36#define URL_ReloadPage (1 << 7)
37#define URL_ReloadFromCache (1 << 8)
39#define URL_IgnoreScroll (1 << 9)
40#define URL_SpamSafe (1 << 10)
42#define URL_MultipartEnc (1 << 11)
49#define URL_SCHEME_(u) (u)->scheme
50#define URL_AUTHORITY_(u) (u)->authority
51#define URL_PATH_(u) (u)->path
52#define URL_QUERY_(u) (u)->query
53#define URL_FRAGMENT_(u) (u)->fragment
54#define URL_HOST_(u) a_Url_hostname(u)
55#define URL_STR_(u) a_Url_str(u)
57#define URL_DATA_(u) (u)->data
59#define URL_PORT_(u) (URL_HOST(u), (u)->port)
60#define URL_FLAGS_(u) (u)->flags
61#define URL_ILLEGAL_CHARS_(u) (u)->illegal_chars
62#define URL_ILLEGAL_CHARS_SPC_(u) (u)->illegal_chars_spc
69#define NPTR2STR(p) ((p) ? (p) : "")
70#define URL_SCHEME(u) NPTR2STR(URL_SCHEME_(u))
71#define URL_AUTHORITY(u) NPTR2STR(URL_AUTHORITY_(u))
72#define URL_PATH(u) NPTR2STR(URL_PATH_(u))
73#define URL_QUERY(u) NPTR2STR(URL_QUERY_(u))
74#define URL_FRAGMENT(u) NPTR2STR(URL_FRAGMENT_(u))
75#define URL_HOST(u) NPTR2STR(URL_HOST_(u))
76#define URL_STR(u) NPTR2STR(URL_STR_(u))
77#define URL_DATA(u) URL_DATA_(u)
78#define URL_PORT(u) URL_PORT_(u)
79#define URL_FLAGS(u) URL_FLAGS_(u)
80#define URL_ILLEGAL_CHARS(u) URL_ILLEGAL_CHARS_(u)
81#define URL_ILLEGAL_CHARS_SPC(u) URL_ILLEGAL_CHARS_SPC_(u)
int illegal_chars_spc
number of illegal space chars
int ismap_url_len
Used by server side image maps.
int illegal_chars
number of illegal chars
char * a_Url_string_strip_delimiters(const char *str)
RFC-3986 suggests this stripping when "importing" URLs from other media.
void a_Url_set_flags(DilloUrl *u, int flags)
Set DilloUrl flags.
char * a_Url_encode_hex_str(const char *str)
Urlencode 'str'.
int a_Url_cmp(const DilloUrl *A, const DilloUrl *B)
Compare two Url's to check if they're the same, or which one is bigger.
bool_t a_Url_same_organization(const DilloUrl *u1, const DilloUrl *u2)
void a_Url_set_ismap_coords(DilloUrl *u, char *coord_str)
Set DilloUrl ismap coordinates.
void a_Url_set_data(DilloUrl *u, Dstr **data)
Set DilloUrl data (like POST info, etc.)
const char * a_Url_hostname(const DilloUrl *u)
Return the hostname as a string.
void a_Url_free(DilloUrl *u)
Free a DilloUrl.
char * a_Url_decode_hex_str(const char *str)
Parse possible hexadecimal octets in the URI path.
DilloUrl * a_Url_new(const char *url_str, const char *base_url)
Transform (and resolve) an URL string into the respective DilloURL.
char * a_Url_str(const DilloUrl *url)
Return the url as a string.
int a_Url_host_type(const char *host)
What type of host is this?
DilloUrl * a_Url_dup(const DilloUrl *u)
Duplicate a Url structure.