mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
add basic support of isxdigit
This commit is contained in:
parent
cbb34022a0
commit
34c6fb83ef
1 changed files with 17 additions and 0 deletions
|
@ -144,6 +144,23 @@ static inline int atoi(const char *str)
|
|||
return (int)_strtol(str, (char **)NULL, 10);
|
||||
}
|
||||
|
||||
/** @brief Checks whether c is a hexdecimal digit character.
|
||||
*
|
||||
* @return A value different from zero if indeed c is a hexadecimal digit.
|
||||
* Zero otherwise.
|
||||
*/
|
||||
static inline int isxdigit(int c)
|
||||
{
|
||||
if ((c >= '0') && (c <= '9'))
|
||||
return 1;
|
||||
else if ((c >= 'A') && (c <= 'F'))
|
||||
return 1;
|
||||
else if ((c >= 'a') && (c <= 'f'))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue