diff options
Diffstat (limited to 'src/microhttpd/mhd_str.h')
-rw-r--r-- | src/microhttpd/mhd_str.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h index 6975d6b8..22d09cff 100644 --- a/src/microhttpd/mhd_str.h +++ b/src/microhttpd/mhd_str.h @@ -60,4 +60,39 @@ MHD_str_equal_caseless_n_ (const char * const str1, const char * const str2, size_t maxlen); +/** + * Convert decimal 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 + * @param next_char pointer to store pointer to character next to last + * converted digit, ignored if NULL + * @return non-zero if conversion succeed; zero if no digit is found, + * value is larger then possible to store in uint64_t or + * @a out_val is NULL + */ +int +MHD_str_to_uint64_ (const char * str, + uint64_t * out_val, + const char ** next_char); + +/** + * Convert not more then @a maxlen decimal 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 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 if conversion succeed; zero if no digit is found, + * value is larger then possible to store in uint64_t or + * @a out_val is NULL + */ +int +MHD_str_to_uint64_n_ (const char * str, + size_t maxlen, + uint64_t * out_val, + const char ** next_char); + #endif /* MHD_STR_H */ |