/*****************************************************************************/
/* */
-/* chartype.c */
+/* chartype.c */
/* */
-/* Character classification functions */
+/* Character classification functions */
/* */
/* */
/* */
-/* (C) 2000 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 2000-2004 Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* 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.
- * So on platforms where a char is signed, this may give problems or at
- * least warnings. The wrapper functions below will have an "char" parameter
- * but handle it correctly. They will NOT work for EOF, but this is not a
- * problem, since EOF is always handled separately.
- */
+** functions. There is a problem with using ctype.h directly:
+** The parameter must have a value of "unsigned char" or EOF.
+** So on platforms where a char is signed, this may give problems or at
+** least warnings. The wrapper functions below will have an "char" parameter
+** but handle it correctly. They will NOT work for EOF, but this is not a
+** problem, since EOF is always handled separately.
+*/
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
+int IsSpace (char C)
+/* Check for any white space characters */
+{
+ return (C == ' ' || C == '\n' || C == '\r' || C == '\t' || C == '\v' || C == '\f');
+}
+
+
+
int IsDigit (char C)
/* Check for a digit */
{
+int IsODigit (char C)
+/* Check for octal digits (0..7) */
+{
+ return (C >= '0' && C <= '7');
+}
+
+
+
int IsXDigit (char C)
/* Check for hexadecimal digits */
{
{
return (C == '"' || C == '\'');
}
-
-
-