diff options
Diffstat (limited to 'src/microhttpd/mhd_str.h')
-rw-r--r-- | src/microhttpd/mhd_str.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h index 4faeba08..2943cf27 100644 --- a/src/microhttpd/mhd_str.h +++ b/src/microhttpd/mhd_str.h | |||
@@ -74,6 +74,7 @@ struct _MHD_str_w_len | |||
74 | #ifndef MHD_FAVOR_SMALL_CODE | 74 | #ifndef MHD_FAVOR_SMALL_CODE |
75 | /** | 75 | /** |
76 | * Check two strings for equality, ignoring case of US-ASCII letters. | 76 | * Check two strings for equality, ignoring case of US-ASCII letters. |
77 | * | ||
77 | * @param str1 first string to compare | 78 | * @param str1 first string to compare |
78 | * @param str2 second string to compare | 79 | * @param str2 second string to compare |
79 | * @return non-zero if two strings are equal, zero otherwise. | 80 | * @return non-zero if two strings are equal, zero otherwise. |
@@ -123,7 +124,7 @@ MHD_str_equal_caseless_bin_n_ (const char *const str1, | |||
123 | /** | 124 | /** |
124 | * Check whether @a str has case-insensitive @a token. | 125 | * Check whether @a str has case-insensitive @a token. |
125 | * Token could be surrounded by spaces and tabs and delimited by comma. | 126 | * Token could be surrounded by spaces and tabs and delimited by comma. |
126 | * Match succeed if substring between start, end of string or comma | 127 | * Match succeed if substring between start, end (of string) or comma |
127 | * contains only case-insensitive token and optional spaces and tabs. | 128 | * contains only case-insensitive token and optional spaces and tabs. |
128 | * @warning token must not contain null-characters except optional | 129 | * @warning token must not contain null-characters except optional |
129 | * terminating null-character. | 130 | * terminating null-character. |
@@ -225,8 +226,9 @@ MHD_str_remove_tokens_caseless_ (char *str, | |||
225 | /** | 226 | /** |
226 | * Convert decimal US-ASCII digits in string to number in uint64_t. | 227 | * Convert decimal US-ASCII digits in string to number in uint64_t. |
227 | * Conversion stopped at first non-digit character. | 228 | * Conversion stopped at first non-digit character. |
229 | * | ||
228 | * @param str string to convert | 230 | * @param str string to convert |
229 | * @param out_val pointer to uint64_t to store result of conversion | 231 | * @param[out] out_val pointer to uint64_t to store result of conversion |
230 | * @return non-zero number of characters processed on succeed, | 232 | * @return non-zero number of characters processed on succeed, |
231 | * zero if no digit is found, resulting value is larger | 233 | * zero if no digit is found, resulting value is larger |
232 | * then possible to store in uint64_t or @a out_val is NULL | 234 | * then possible to store in uint64_t or @a out_val is NULL |
@@ -240,9 +242,10 @@ MHD_str_to_uint64_ (const char *str, | |||
240 | * number in uint64_t. | 242 | * number in uint64_t. |
241 | * Conversion stopped at first non-digit character or after @a maxlen | 243 | * Conversion stopped at first non-digit character or after @a maxlen |
242 | * digits. | 244 | * digits. |
245 | * | ||
243 | * @param str string to convert | 246 | * @param str string to convert |
244 | * @param maxlen maximum number of characters to process | 247 | * @param maxlen maximum number of characters to process |
245 | * @param out_val pointer to uint64_t to store result of conversion | 248 | * @param[out] out_val pointer to uint64_t to store result of conversion |
246 | * @return non-zero number of characters processed on succeed, | 249 | * @return non-zero number of characters processed on succeed, |
247 | * zero if no digit is found, resulting value is larger | 250 | * zero if no digit is found, resulting value is larger |
248 | * then possible to store in uint64_t or @a out_val is NULL | 251 | * then possible to store in uint64_t or @a out_val is NULL |
@@ -256,8 +259,9 @@ MHD_str_to_uint64_n_ (const char *str, | |||
256 | /** | 259 | /** |
257 | * Convert hexadecimal US-ASCII digits in string to number in uint32_t. | 260 | * Convert hexadecimal US-ASCII digits in string to number in uint32_t. |
258 | * Conversion stopped at first non-digit character. | 261 | * Conversion stopped at first non-digit character. |
262 | * | ||
259 | * @param str string to convert | 263 | * @param str string to convert |
260 | * @param out_val pointer to uint32_t to store result of conversion | 264 | * @param[out] out_val pointer to uint32_t to store result of conversion |
261 | * @return non-zero number of characters processed on succeed, | 265 | * @return non-zero number of characters processed on succeed, |
262 | * zero if no digit is found, resulting value is larger | 266 | * zero if no digit is found, resulting value is larger |
263 | * then possible to store in uint32_t or @a out_val is NULL | 267 | * then possible to store in uint32_t or @a out_val is NULL |
@@ -272,9 +276,10 @@ MHD_strx_to_uint32_ (const char *str, | |||
272 | * to number in uint32_t. | 276 | * to number in uint32_t. |
273 | * Conversion stopped at first non-digit character or after @a maxlen | 277 | * Conversion stopped at first non-digit character or after @a maxlen |
274 | * digits. | 278 | * digits. |
279 | * | ||
275 | * @param str string to convert | 280 | * @param str string to convert |
276 | * @param maxlen maximum number of characters to process | 281 | * @param maxlen maximum number of characters to process |
277 | * @param out_val pointer to uint32_t to store result of conversion | 282 | * @param[out] out_val pointer to uint32_t to store result of conversion |
278 | * @return non-zero number of characters processed on succeed, | 283 | * @return non-zero number of characters processed on succeed, |
279 | * zero if no digit is found, resulting value is larger | 284 | * zero if no digit is found, resulting value is larger |
280 | * then possible to store in uint32_t or @a out_val is NULL | 285 | * then possible to store in uint32_t or @a out_val is NULL |
@@ -288,8 +293,9 @@ MHD_strx_to_uint32_n_ (const char *str, | |||
288 | /** | 293 | /** |
289 | * Convert hexadecimal US-ASCII digits in string to number in uint64_t. | 294 | * Convert hexadecimal US-ASCII digits in string to number in uint64_t. |
290 | * Conversion stopped at first non-digit character. | 295 | * Conversion stopped at first non-digit character. |
296 | * | ||
291 | * @param str string to convert | 297 | * @param str string to convert |
292 | * @param out_val pointer to uint64_t to store result of conversion | 298 | * @param[out] out_val pointer to uint64_t to store result of conversion |
293 | * @return non-zero number of characters processed on succeed, | 299 | * @return non-zero number of characters processed on succeed, |
294 | * zero if no digit is found, resulting value is larger | 300 | * zero if no digit is found, resulting value is larger |
295 | * then possible to store in uint64_t or @a out_val is NULL | 301 | * then possible to store in uint64_t or @a out_val is NULL |
@@ -304,9 +310,10 @@ MHD_strx_to_uint64_ (const char *str, | |||
304 | * to number in uint64_t. | 310 | * to number in uint64_t. |
305 | * Conversion stopped at first non-digit character or after @a maxlen | 311 | * Conversion stopped at first non-digit character or after @a maxlen |
306 | * digits. | 312 | * digits. |
313 | * | ||
307 | * @param str string to convert | 314 | * @param str string to convert |
308 | * @param maxlen maximum number of characters to process | 315 | * @param maxlen maximum number of characters to process |
309 | * @param out_val pointer to uint64_t to store result of conversion | 316 | * @param[out] out_val pointer to uint64_t to store result of conversion |
310 | * @return non-zero number of characters processed on succeed, | 317 | * @return non-zero number of characters processed on succeed, |
311 | * zero if no digit is found, resulting value is larger | 318 | * zero if no digit is found, resulting value is larger |
312 | * then possible to store in uint64_t or @a out_val is NULL | 319 | * then possible to store in uint64_t or @a out_val is NULL |
@@ -325,15 +332,16 @@ MHD_strx_to_uint64_n_ (const char *str, | |||
325 | * Conversion stopped at first non-digit character or after @a maxlen | 332 | * Conversion stopped at first non-digit character or after @a maxlen |
326 | * digits. | 333 | * digits. |
327 | * To be used only within macro. | 334 | * To be used only within macro. |
335 | * | ||
328 | * @param str the string to convert | 336 | * @param str the string to convert |
329 | * @param maxlen the maximum number of characters to process | 337 | * @param maxlen the maximum number of characters to process |
330 | * @param out_val the pointer to uint64_t to store result of conversion | 338 | * @param out_val the pointer to variable to store result of conversion |
331 | * @param val_size the size of variable pointed by @a out_val | 339 | * @param val_size the size of variable pointed by @a out_val, in bytes, 4 or 8 |
332 | * @param max_val the maximum decoded number | 340 | * @param max_val the maximum decoded number |
333 | * @param base the numeric base, 10 or 16 | 341 | * @param base the numeric base, 10 or 16 |
334 | * @return non-zero number of characters processed on succeed, | 342 | * @return non-zero number of characters processed on succeed, |
335 | * zero if no digit is found, resulting value is larger | 343 | * zero if no digit is found, resulting value is larger |
336 | * then @ max_val or @a out_val is NULL | 344 | * then @max_val, @val_size is not 16/32 or @a out_val is NULL |
337 | */ | 345 | */ |
338 | size_t | 346 | size_t |
339 | MHD_str_to_uvalue_n_ (const char *str, | 347 | MHD_str_to_uvalue_n_ (const char *str, |