From 7a290130bdeb411625f16451af3f2cfd25eeaf00 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 30 Oct 2009 08:58:34 +1100 Subject: lib/util Use rfc1738.c from Squid for all our URL encode/decode needs. Andrew Bartlett --- lib/util/util.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'lib/util/util.h') diff --git a/lib/util/util.h b/lib/util/util.h index c766e3dce7..159f812d98 100644 --- a/lib/util/util.h +++ b/lib/util/util.h @@ -307,6 +307,31 @@ _PUBLIC_ void all_string_sub(char *s,const char *pattern,const char *insert, siz **/ _PUBLIC_ void rfc1738_unescape(char *buf); + +/** + * rfc1738_escape + * Returns a static buffer that contains the RFC + * 1738 compliant, escaped version of the given url. (escapes unsafe and % characters) + **/ +_PUBLIC_ char *rfc1738_escape(TALLOC_CTX *mem_ctx, const char *url); + +/** + * rfc1738_escape_unescaped + * + * Returns a static buffer that contains + * the RFC 1738 compliant, escaped version of the given url (escapes unsafe chars only) + **/ +_PUBLIC_ char *rfc1738_escape_unescaped(TALLOC_CTX *mem_ctx, const char *url); + +/** + * rfc1738_escape_part + * Returns a static buffer that contains the RFC + * 1738 compliant, escaped version of the given url segment. (escapes + * unsafe, reserved and % chars) It would mangle the :// in http://, + * and mangle paths (because of /). + **/ +_PUBLIC_ char *rfc1738_escape_part(TALLOC_CTX *mem_ctx, const char *url); + /** format a string into length-prefixed dotted domain format, as used in NBT and in some ADS structures -- cgit