summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-10-05 12:13:26 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-10-05 12:13:26 +0000
commit921e9959e65014f43ded14a7376b983c64bd8532 (patch)
treef05e0f4349066313d4f8375138eeb77b68b01b31
parent291307d64e5d3b876ce2535d81ceb6eeb3ba8278 (diff)
downloadnetsurf-921e9959e65014f43ded14a7376b983c64bd8532.tar.gz
netsurf-921e9959e65014f43ded14a7376b983c64bd8532.tar.bz2
Namespaceing.
svn path=/trunk/netsurf/; revision=12955
-rw-r--r--utils/nsurl.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 3eb06fc94..c29340006 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -35,7 +35,7 @@
/* Define to enable NSURL debugging */
#undef NSURL_DEBUG
-static bool isgendelim(unsigned char c)
+static bool nsurl__is_gen_delim(unsigned char c)
{
/* From RFC3986 section 2.2 (reserved characters)
*
@@ -79,7 +79,7 @@ static bool isgendelim(unsigned char c)
return gendelim[c];
}
-static bool issubdelim(unsigned char c)
+static bool nsurl__is_sub_delim(unsigned char c)
{
/* From RFC3986 section 2.2 (reserved characters)
*
@@ -124,18 +124,18 @@ static bool issubdelim(unsigned char c)
return subdelim[c];
}
-static bool isreserved(unsigned char c)
+static bool nsurl__is_reserved(unsigned char c)
{
/* From RFC3986 section 2.3 (unreserved characters)
*
* reserved = gen-delims / sub-delims
*
*/
- return isgendelim(c) | issubdelim(c);
+ return nsurl__is_gen_delim(c) | nsurl__is_sub_delim(c);
}
-static bool isunreserved(unsigned char c)
+static bool nsurl__is_unreserved(unsigned char c)
{
/* From RFC3986 section 2.3 (unreserved characters)
*
@@ -180,9 +180,9 @@ static bool isunreserved(unsigned char c)
}
/* The ASCII codes which should not be percent escaped */
-static bool isurlnoescape(unsigned char c)
+static bool nsurl__is_no_escape(unsigned char c)
{
- return isreserved(c) | isunreserved(c);
+ return nsurl__is_reserved(c) | nsurl__is_unreserved(c);
}
/**
@@ -687,7 +687,7 @@ static nserror nsurl__create_from_section(const char const *url_s,
continue;
}
- if (isunreserved(ascii_offset) == false) {
+ if (nsurl__is_unreserved(ascii_offset) == false) {
/* This character should be escaped after all,
* just let it get copied */
copy_len += 3;
@@ -709,7 +709,7 @@ static nserror nsurl__create_from_section(const char const *url_s,
length -= 2;
- } else if (isurlnoescape(*pos) == false) {
+ } else if (nsurl__is_no_escape(*pos) == false) {
/* This needs to be escaped */
if (copy_len > 0) {
@@ -721,8 +721,10 @@ static nserror nsurl__create_from_section(const char const *url_s,
/* escape */
*(pos_norm++) = '%';
- *(pos_norm++) = digit2uppercase_hex(((unsigned char)*pos) >> 4);
- *(pos_norm++) = digit2uppercase_hex(((unsigned char)*pos) & 0xf);
+ *(pos_norm++) = digit2uppercase_hex(
+ ((unsigned char)*pos) >> 4);
+ *(pos_norm++) = digit2uppercase_hex(
+ ((unsigned char)*pos) & 0xf);
pos_url_s = pos + 1;
length += 2;