diff options
author | Paul Gilbert | 2019-05-17 13:51:43 -1000 |
---|---|---|
committer | Paul Gilbert | 2019-05-24 18:21:06 -0700 |
commit | 105a1b94bd9d5a0f10752e135671f4e9a4b0d8da (patch) | |
tree | 14a535ad171084e1908882a87b29fbd085ea93af /common | |
parent | e83972f502142b4e6191b962a7be89829bd8d708 (diff) | |
download | scummvm-rg350-105a1b94bd9d5a0f10752e135671f4e9a4b0d8da.tar.gz scummvm-rg350-105a1b94bd9d5a0f10752e135671f4e9a4b0d8da.tar.bz2 scummvm-rg350-105a1b94bd9d5a0f10752e135671f4e9a4b0d8da.zip |
GLK: TADS2: Added code for output, run, various miscellaneous
Diffstat (limited to 'common')
-rw-r--r-- | common/util.cpp | 6 | ||||
-rw-r--r-- | common/util.h | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/common/util.cpp b/common/util.cpp index 62a1baf6ac..a6c7958a0d 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -23,6 +23,7 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_isalnum #define FORBIDDEN_SYMBOL_EXCEPTION_isalpha #define FORBIDDEN_SYMBOL_EXCEPTION_isdigit +#define FORBIDDEN_SYMBOL_EXCEPTION_isxdigit #define FORBIDDEN_SYMBOL_EXCEPTION_isnumber #define FORBIDDEN_SYMBOL_EXCEPTION_islower #define FORBIDDEN_SYMBOL_EXCEPTION_isspace @@ -132,6 +133,11 @@ bool isDigit(int c) { return isdigit((byte)c); } +bool isXDigit(int c) { + ENSURE_ASCII_CHAR(c); + return isxdigit((byte)c); +} + bool isLower(int c) { ENSURE_ASCII_CHAR(c); return islower((byte)c); diff --git a/common/util.h b/common/util.h index 77d7523034..5f853da43a 100644 --- a/common/util.h +++ b/common/util.h @@ -142,6 +142,16 @@ bool isAlpha(int c); bool isDigit(int c); /** + * Test whether the given character is a hwzadecimal-digit (0-9 or A-F). + * If the parameter is outside the range of a signed or unsigned char, then + * false is returned. + * + * @param c the character to test + * @return true if the character is a hexadecimal-digit, false otherwise. + */ +bool isXDigit(int c); + +/** * Test whether the given character is a lower-case letter (a-z). * If the parameter is outside the range of a signed or unsigned char, then * false is returned. |