X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Furl.h;h=a9c4449876646fccff0dfc8766e54505d53ecb74;hb=588db76b04e7f92fedc50dca757917f5f0c90ad6;hp=df1ad76fc7e91f6fe96a421543d5ae1aecf63d77;hpb=03846211ba84582b133a985200502a39462dfe66;p=libucw.git diff --git a/lib/url.h b/lib/url.h index df1ad76f..a9c44498 100644 --- a/lib/url.h +++ b/lib/url.h @@ -1,9 +1,16 @@ /* * Sherlock Library -- URL Functions * - * (c) 1997 Martin Mares, + * (c) 1997--2004 Martin Mares + * (c) 2001 Robert Spalek + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. */ +#ifndef _SHERLOCK_URL_H +#define _SHERLOCK_URL_H + #define MAX_URL_SIZE 1024 /* Non-control meanings of control characters */ @@ -15,7 +22,10 @@ #define NCC_AT 5 #define NCC_EQUAL 6 #define NCC_AND 7 -#define NCC_MAX 8 +#define NCC_HASH 8 +#define NCC_MAX 9 + +#define NCC_CHARS " ;/?:@=&#" /* Remove/Introduce '%' escapes */ @@ -28,6 +38,7 @@ struct url { byte *protocol; uns protoid; byte *user; + byte *pass; byte *host; uns port; /* ~0 if unspec */ byte *rest; @@ -39,7 +50,9 @@ int url_normalize(struct url *, struct url *); int url_canonicalize(struct url *); int url_pack(struct url *, byte *); int url_canon_split(byte *, byte *, byte *, struct url *); +int url_auto_canonicalize(byte *, byte *); uns identify_protocol(byte *); +int url_has_repeated_component(byte *url); /* Error codes */ @@ -58,6 +71,13 @@ char *url_error(uns); #define URL_PROTO_UNKNOWN 0 #define URL_PROTO_HTTP 1 #define URL_PROTO_FTP 2 -#define URL_PROTO_MAX 3 +#define URL_PROTO_FILE 3 +#define URL_PROTO_MAX 4 + +#define URL_PNAMES { "unknown", "http", "ftp", "file" } +#define URL_DEFPORTS { ~0, 80, 21, 0 } +#define URL_PATH_FLAGS { 0, 1, 1, 1 } + +extern byte *url_proto_names[]; -#define URL_PNAMES { "unknown", "http", "ftp" } +#endif