27#ifndef _NETSURF_UTILS_ASCII_H_
28#define _NETSURF_UTILS_ASCII_H_
42 return (c ==
' ' || c ==
'\t' ||
43 c ==
'\n' || c ==
'\v' ||
44 c ==
'\f' || c ==
'\r');
55 return (c >=
'a' && c <=
'z');
66 return (c >=
'A' && c <=
'Z');
88 return (c >=
'0' && c <=
'9');
99 return (c ==
'-' || c ==
'+');
121 return (c >=
'a' && c <=
'f');
143 return (c >=
'A' && c <=
'F');
315 const char *s1,
const char *s2)
317 while (*s1 !=
'\0') {
335 const char *s1,
const char *s2)
337 while (*s1 !=
'\0') {
355 const char *s1,
const char *s2)
358 while (*s1 !=
'\0') {
376 const char *s1,
const char *s2)
379 while (*s1 !=
'\0') {
400 long long temp =
strtoll(str, &end, 10);
402 if (end == str || errno == ERANGE ||
403 temp < INT_MIN || temp > INT_MAX) {
static bool ascii_is_hex_lower(char c)
Test whether a character is hexadecimal (lower case).
static size_t ascii_count_alpha_lower(const char *str)
Count consecutive lower case alphabetical characters in string.
static char ascii_to_lower(char c)
Convert an upper case character to lower case.
static char ascii_to_upper(char c)
Convert a lower case character to upper case.
static size_t ascii_count_alpha(const char *str)
Count consecutive alphabetical characters in string (upper or lower case).
static int ascii_hex_to_value_2_chars(char c1, char c2)
Converts two hexadecimal characters to a single number.
static size_t ascii_string_to_int(const char *str, int *res)
Parse an int out of a string.
static size_t ascii_count_digit_or_colon(const char *str)
Count consecutive characters either decimal digit or colon in string.
static bool ascii_is_sign(char c)
Test whether a character is a positive/negative numerical sign.
static bool ascii_is_hex_upper(char c)
Test whether a character is hexadecimal (upper case).
static size_t ascii_count_digit(const char *str)
Count consecutive decial digit characters in string.
static bool ascii_is_alpha(char c)
Test whether a character is alphabetical (upper or lower case).
static bool ascii_is_af_lower(char c)
Test whether a character is 'a' to 'f' (lowercase).
static bool ascii_is_alpha_lower(char c)
Test whether a character is lower-case alphabetical.
static int ascii_hex_to_value(char c)
Convert a hexadecimal character to its value.
static bool ascii_is_space(char c)
Test whether a character is a whitespace character.
static bool ascii_is_alpha_upper(char c)
Test whether a character is upper-case alphabetical.
static bool ascii_is_digit(char c)
Test whether a character is a decimal digit.
static size_t ascii_strings_count_equal_caseless(const char *s1, const char *s2)
Count consecutive equal ascii characters (case insensitive).
static bool ascii_is_af_upper(char c)
Test whether a character is 'A' to 'F' (uppercase).
static size_t ascii_count_alpha_upper(const char *str)
Count consecutive upper case alphabetical characters in string.
static bool ascii_strings_equal_caseless(const char *s1, const char *s2)
Test for string equality (case insensitive).
static bool ascii_is_hex(char c)
Test whether a character is hexadecimal (upper or lower case).
static size_t ascii_strings_count_equal(const char *s1, const char *s2)
Count consecutive equal ascii characters (case sensitive).
static bool ascii_is_alphanumerical(char c)
Test whether a character is alphanumerical (upper or lower case).
static bool ascii_strings_equal(const char *s1, const char *s2)
Test for string equality (case sensitive).
static uint32_t count(const http_directive *list, lwc_string *key)
long long int strtoll(const char *nptr, char **endptr, int base)