]> git.sur5r.net Git - cc65/blobdiff - src/common/chartype.c
Merge remote-tracking branch 'upstream/master' into a5200
[cc65] / src / common / chartype.c
index 31412948ee81648474775cffc114a33e1c24c3be..b1571f3f7f6d6cab9d54d87813d3269e8d3a42bb 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                               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                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -49,7 +49,7 @@
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -79,9 +79,17 @@ int IsAscii (char C)
 
 
 int IsBlank (char C)
-/* Check for a space, tab or newline */
+/* Check for a space or tab */
 {
-    return (C == ' ' || C == '\t' || C == '\n');
+    return (C == ' ' || C == '\t');
+}
+
+
+
+int IsSpace (char C)
+/* Check for any white space characters */
+{
+    return (C == ' ' || C == '\n' || C == '\r' || C == '\t' || C == '\v' || C == '\f');
 }
 
 
@@ -110,6 +118,22 @@ int IsUpper (char C)
 
 
 
+int IsBDigit (char C)
+/* Check for binary digits (0/1) */
+{
+    return (C == '0' || C == '1');
+}
+
+
+
+int IsODigit (char C)
+/* Check for octal digits (0..7) */
+{
+    return (C >= '0' && C <= '7');
+}
+
+
+
 int IsXDigit (char C)
 /* Check for hexadecimal digits */
 {
@@ -123,6 +147,3 @@ int IsQuote (char C)
 {
     return (C == '"' || C == '\'');
 }
-
-
-