summaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_str.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_str.h')
-rw-r--r--src/microhttpd/mhd_str.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h
index 5c519568..2572c050 100644
--- a/src/microhttpd/mhd_str.h
+++ b/src/microhttpd/mhd_str.h
@@ -124,4 +124,72 @@ MHD_strx_to_sizet_n_ (const char * str,
size_t maxlen,
size_t * out_val);
+
+/**
+ * Convert hexadecimal US-ASCII digits in string to number in uint32_t.
+ * Conversion stopped at first non-digit character.
+ * @param str string to convert
+ * @param out_val pointer to uint32_t to store result of conversion
+ * @return non-zero number of characters processed on succeed,
+ * zero if no digit is found, resulting value is larger
+ * then possible to store in uint32_t or @a out_val is NULL
+ */
+size_t
+MHD_strx_to_uint32_ (const char * str,
+ uint32_t * out_val);
+
+
+/**
+ * Convert not more then @a maxlen hexadecimal US-ASCII digits in string
+ * to number in uint32_t.
+ * Conversion stopped at first non-digit character or after @a maxlen
+ * digits.
+ * @param str string to convert
+ * @param maxlen maximum number of characters to process
+ * @param out_val pointer to uint32_t to store result of conversion
+ * @param next_char pointer to store pointer to character next to last
+ * converted digit, ignored if NULL
+ * @return non-zero number of characters processed on succeed,
+ * zero if no digit is found, resulting value is larger
+ * then possible to store in uint32_t or @a out_val is NULL
+ */
+size_t
+MHD_strx_to_uint32_n_ (const char * str,
+ size_t maxlen,
+ uint32_t * out_val);
+
+
+/**
+ * Convert hexadecimal US-ASCII digits in string to number in uint64_t.
+ * Conversion stopped at first non-digit character.
+ * @param str string to convert
+ * @param out_val pointer to uint64_t to store result of conversion
+ * @return non-zero number of characters processed on succeed,
+ * zero if no digit is found, resulting value is larger
+ * then possible to store in uint64_t or @a out_val is NULL
+ */
+size_t
+MHD_strx_to_uint64_ (const char * str,
+ uint64_t * out_val);
+
+
+/**
+ * Convert not more then @a maxlen hexadecimal US-ASCII digits in string
+ * to number in uint64_t.
+ * Conversion stopped at first non-digit character or after @a maxlen
+ * digits.
+ * @param str string to convert
+ * @param maxlen maximum number of characters to process
+ * @param out_val pointer to uint64_t to store result of conversion
+ * @param next_char pointer to store pointer to character next to last
+ * converted digit, ignored if NULL
+ * @return non-zero number of characters processed on succeed,
+ * zero if no digit is found, resulting value is larger
+ * then possible to store in uint64_t or @a out_val is NULL
+ */
+size_t
+MHD_strx_to_uint64_n_ (const char * str,
+ size_t maxlen,
+ uint64_t * out_val);
+
#endif /* MHD_STR_H */