summaryrefslogtreecommitdiff
path: root/utils/nsurl.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-05-11 21:31:14 +0100
committerVincent Sanders <vince@kyllikki.org>2014-05-11 21:31:14 +0100
commit39b0393d31a86a8fcfa770ad040207ace95bde0d (patch)
treed59b25fbd066984d0feaf57a4763134d0e9a2884 /utils/nsurl.c
parent06a3f84e5032b93052f1eb95946d5f51aa9368f2 (diff)
downloadnetsurf-39b0393d31a86a8fcfa770ad040207ace95bde0d.tar.gz
netsurf-39b0393d31a86a8fcfa770ad040207ace95bde0d.tar.bz2
cleanup utils header, remove cruft and add documentation
Diffstat (limited to 'utils/nsurl.c')
-rw-r--r--utils/nsurl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c
index c99b0d34a..5c0a48511 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -36,6 +36,17 @@
/* Define to enable NSURL debugging */
#undef NSURL_DEBUG
+/**
+ * Return a hex digit for the given numerical value.
+ *
+ * \param digit the value to get the hex digit for.
+ * \return character in range 0-9A-F
+ */
+inline static char digit2uppercase_hex(unsigned char digit) {
+ assert(digit < 16);
+ return "0123456789ABCDEF"[digit];
+}
+
static bool nsurl__is_unreserved(unsigned char c)
{
/* From RFC3986 section 2.3 (unreserved characters)