34 #ifdef MHD_FAVOR_SMALL_CODE 35 #ifdef _MHD_static_inline 36 #undef _MHD_static_inline 41 #define _MHD_static_inline static 61 _MHD_static_inline
bool 64 return (c >=
'a') && (c <=
'z');
75 _MHD_static_inline
bool 78 return (c >=
'A') && (c <=
'Z');
89 _MHD_static_inline
bool 103 _MHD_static_inline
bool 106 return (c >=
'0') && (c <=
'9');
116 _MHD_static_inline
bool 120 ( (c >=
'A') && (c <=
'F') ) ||
121 ( (c >=
'a') && (c <=
'f') );
131 _MHD_static_inline
bool 148 _MHD_static_inline
char 165 _MHD_static_inline
char 173 #if defined(MHD_FAVOR_SMALL_CODE) 180 _MHD_static_inline
int 184 return (
unsigned char)(c -
'0');
197 _MHD_static_inline
int 201 return (
unsigned char)(c -
'0');
202 if ( (c >=
'A') && (c <=
'F') )
203 return (
unsigned char)(c -
'A' + 10);
204 if ( (c >=
'a') && (c <=
'f') )
205 return (
unsigned char)(c -
'a' + 10);
219 #define isasciilower(c) (((char)(c)) >= 'a' && ((char)(c)) <= 'z') 229 #define isasciiupper(c) (((char)(c)) >= 'A' && ((char)(c)) <= 'Z') 239 #define isasciialpha(c) (isasciilower(c) || isasciiupper(c)) 249 #define isasciidigit(c) (((char)(c)) >= '0' && ((char)(c)) <= '9') 259 #define isasciixdigit(c) (isasciidigit((c)) || \ 260 (((char)(c)) >= 'A' && ((char)(c)) <= 'F') || \ 261 (((char)(c)) >= 'a' && ((char)(c)) <= 'f') ) 271 #define isasciialnum(c) (isasciialpha(c) || isasciidigit(c)) 283 #define toasciilower(c) ((isasciiupper(c)) ? (((char)(c)) - 'A' + 'a') : ((char)(c))) 295 #define toasciiupper(c) ((isasciilower(c)) ? (((char)(c)) - 'a' + 'A') : ((char)(c))) 304 #define todigitvalue(c) (isasciidigit(c) ? (int)(((char)(c)) - '0') : (int)(-1)) 312 #define toxdigitvalue(c) ( isasciidigit(c) ? (int)(((char)(c)) - '0') : \ 313 ( (((char)(c)) >= 'A' && ((char)(c)) <= 'F') ? \ 314 (int)(((unsigned char)(c)) - 'A' + 10) : \ 315 ( (((char)(c)) >= 'a' && ((char)(c)) <= 'f') ? \ 316 (int)(((unsigned char)(c)) - 'a' + 10) : (int)(-1) ))) 320 #ifndef MHD_FAVOR_SMALL_CODE 334 const char c1 = *str1;
335 const char c2 = *str2;
360 const char *
const str2,
365 for (i = 0; i < maxlen; ++i)
367 const char c1 = str1[i];
368 const char c2 = str2[i];
394 const char *
const token,
404 while (
' ' == *str ||
'\t' == *str ||
',' == *str) str++;
410 const char sc = *(str++);
411 const char tc = token[i++];
422 while (
' ' == *str ||
'\t' == *str) str++;
424 if (0 == *str ||
',' == *str)
431 while (0 != *str &&
',' != *str) str++;
436 #ifndef MHD_FAVOR_SMALL_CODE 453 const char *
const start = str;
462 const int digit = (
unsigned char)(*str) -
'0';
499 if (!str || !maxlen || !out_val || !
isasciidigit (str[0]))
506 const int digit = (
unsigned char)str[i] -
'0';
516 }
while ( (i < maxlen) &&
538 const char *
const start = str;
542 if (!str || !out_val)
588 if (!str || !out_val)
624 const char *
const start = str;
627 if (!str || !out_val)
673 if (!str || !out_val)
714 MHD_str_to_uvalue_n_ (
const char *str,
724 const uint64_t max_v_div_b = max_val / base;
725 const uint64_t max_v_mod_b = max_val % base;
727 int (*
const dfunc)(char) = (base == 16) ?
730 if ( !str || !out_val ||
731 (base != 16 && base != 10) )
736 while (maxlen > i && 0 <= (digit = dfunc (str[i])))
738 if ( ((max_v_div_b) < res) ||
739 ((max_v_div_b) == res && (max_v_mod_b) < (uint64_t)digit) )
750 *(uint64_t*)out_val = res;
751 else if (4 == val_size)
752 *(uint32_t*)out_val = (uint32_t)res;
size_t MHD_strx_to_uint64_(const char *str, uint64_t *out_val)
int MHD_str_equal_caseless_n_(const char *const str1, const char *const str2, size_t maxlen)
size_t MHD_strx_to_uint32_n_(const char *str, size_t maxlen, uint32_t *out_val)
size_t MHD_strx_to_uint32_(const char *str, uint32_t *out_val)
limits values definitions
Header for string manipulating helpers.
bool MHD_str_has_token_caseless_(const char *str, const char *const token, size_t token_len)
int MHD_str_equal_caseless_(const char *str1, const char *str2)
size_t MHD_strx_to_uint64_n_(const char *str, size_t maxlen, uint64_t *out_val)
size_t MHD_str_to_uint64_n_(const char *str, size_t maxlen, uint64_t *out_val)
size_t MHD_str_to_uint64_(const char *str, uint64_t *out_val)