X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Furl.h;h=c389fb16a9a9b72b8acc0e16a34307b6c7a4a04e;hb=0f88062c8973258611a8cba9a0e9668d1c688030;hp=39d6e05b1a3dd52f4c55d2f6cb2430bc44f785cd;hpb=8dfb51232c3b8c1f70026503593281cd6bc76a97;p=libucw.git diff --git a/ucw/url.h b/ucw/url.h index 39d6e05b..c389fb16 100644 --- a/ucw/url.h +++ b/ucw/url.h @@ -15,17 +15,32 @@ /* Non-control meanings of control characters */ -#define NCC_SEMICOLON 1 -#define NCC_SLASH 2 -#define NCC_QUEST 3 -#define NCC_COLON 4 -#define NCC_AT 5 -#define NCC_EQUAL 6 -#define NCC_AND 7 -#define NCC_HASH 8 -#define NCC_MAX 9 +enum { + NCC_SEMICOLON = 1, + NCC_SLASH = 2, + NCC_QUEST = 3, + NCC_COLON = 4, + NCC_AT = 5, + NCC_EQUAL = 6, + NCC_AND = 7, + NCC_HASH = 8, +#ifdef CONFIG_URL_ESCAPE_COMPAT + NCC_MAX = 9 +#else + // Avoid 9 (\t) and 10 (\n) + NCC_DOLLAR = 11, + NCC_PLUS = 12, + // Avoid 13 (\r) + NCC_COMMA = 14, + NCC_MAX = 15 +#endif +}; +#ifdef CONFIG_URL_ESCAPE_COMPAT #define NCC_CHARS " ;/?:@=&#" +#else +#define NCC_CHARS " ;/?:@=&#\t\n$+\r," +#endif /* Remove/Introduce '%' escapes */ @@ -52,7 +67,7 @@ int url_canonicalize(struct url *u); int url_pack(struct url *u, char *d); int url_canon_split_rel(const char *url, char *buf1, char *buf2, struct url *u, struct url *base); int url_auto_canonicalize_rel(const char *src, char *dst, struct url *base); -uns identify_protocol(const char *p); +uns url_identify_protocol(const char *p); int url_has_repeated_component(const char *url); static inline int url_canon_split(const char *url, char *buf1, char *buf2, struct url *u)