98 #define uri_field( uri, field ) (&uri->scheme)[field] 106 #define URI_FIELD( name ) \ 107 ( ( offsetof ( struct uri, name ) - \ 108 offsetof ( struct uri, scheme ) ) / sizeof ( void * ) ) 211 extern size_t uri_decode (
const char *encoded,
void *buf,
size_t len );
216 extern struct uri *
parse_uri (
const char *uri_string );
220 unsigned int default_port );
223 const char *relative_path );
225 struct uri *relative_uri );
227 const char *filename );
const char * equery
Query (with original URI encoding)
struct uri * cwuri
Current working URI.
static void uri_put(struct uri *uri)
Decrement URI reference count.
static struct uri * uri_get(struct uri *uri)
Increment URI reference count.
static int uri_is_absolute(const struct uri *uri)
URI is an absolute URI.
#define URI_FIELD(name)
Calculate index of a URI field.
static int uri_has_path(const struct uri *uri)
URI has a path.
static int uri_has_relative_path(const struct uri *uri)
URI has a relative path.
A request parameter list.
struct uri * parse_uri(const char *uri_string)
Parse URI.
size_t uri_decode(const char *encoded, void *buf, size_t len)
Decode URI field.
const char * port
Port number.
struct uri * resolve_uri(const struct uri *base_uri, struct uri *relative_uri)
Resolve base+relative URI.
const char * scheme
Scheme.
char * resolve_path(const char *base_path, const char *relative_path)
Resolve base+relative path.
const char * path
Path (after URI decoding)
struct parameters * params
Request parameters.
Generalized socket address structure.
#define ref_get(refcnt)
Get additional reference to object.
size_t format_uri(const struct uri *uri, char *buf, size_t len)
Format URI.
unsigned int uri_port(const struct uri *uri, unsigned int default_port)
Get port from URI.
static struct dynamic_item password
const char * host
Host name.
void churi(struct uri *uri)
Change working URI.
size_t uri_encode_string(unsigned int field, const char *string, char *buf, ssize_t len)
Encode URI field string.
const char * efragment
Fragment (with original URI encoding)
static int uri_has_absolute_path(const struct uri *uri)
URI has an absolute path.
const char * opaque
Opaque part.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct refcnt refcnt
Reference count.
struct uri * uri_dup(const struct uri *uri)
Duplicate URI.
const char * password
Password.
const char * epath
Path (with original URI encoding)
const char * user
User name.
A Uniform Resource Identifier.
struct uri * pxe_uri(struct sockaddr *sa_server, const char *filename)
Construct URI from server address and filename.
char * format_uri_alloc(const struct uri *uri)
Format URI.
#define NULL
NULL pointer (VOID *)
static int uri_has_opaque(const struct uri *uri)
URI has an opaque part.
size_t uri_encode(unsigned int field, const void *raw, size_t raw_len, char *buf, ssize_t len)
Encode URI field.
#define ref_put(refcnt)
Drop reference to object.