X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcommon%2Fchartype.h;h=72ccf7560890bc0ca4e6c4c0560a668e7279f3e1;hb=6c3720686bbf8fd527ea69838fa797ae46b33f18;hp=3f895e4d00f342f81e310e2c48185ff97f7e2a3b;hpb=37da7dff987fc53058e4bb8cabb5880ebeb45af0;p=cc65 diff --git a/src/common/chartype.h b/src/common/chartype.h index 3f895e4d0..72ccf7560 100644 --- a/src/common/chartype.h +++ b/src/common/chartype.h @@ -38,6 +38,12 @@ +#include + +/* common */ +#include "inline.h" + + /* This module contains replacements for functions in ctype.h besides other * functions. There is a problem with using ctype.h directly: * The parameter must have a value of "unsigned char" or EOF. @@ -65,7 +71,20 @@ int IsAscii (char C); /* Check for an ASCII character */ int IsBlank (char C); -/* Check for a space, tab or newline */ +/* Check for a space or tab */ + +#if defined(HAVE_INLINE) +INLINE int IsControl (char C) +/* Check for control chars */ +{ + return iscntrl ((unsigned char) C); +} +#else +# define IsControl(C) iscntrl (C) +#endif + +int IsSpace (char C); +/* Check for any white space characters */ int IsDigit (char C); /* Check for a digit */ @@ -73,12 +92,12 @@ int IsDigit (char C); int IsLower (char C); /* Check for a lower case char */ -int IsSpace (char C); -/* Check for white space characters */ - int IsUpper (char C); /* Check for upper case characters */ +int IsBDigit (char C); +/* Check for binary digits (0/1) */ + int IsXDigit (char C); /* Check for hexadecimal digits */