1 /*****************************************************************************/
5 /* Character classification functions */
9 /* (C) 2000-2004 Ullrich von Bassewitz */
10 /* Roemerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
47 /* This module contains replacements for functions in ctype.h besides other
48 ** functions. There is a problem with using ctype.h directly:
49 ** The parameter must have a value of "unsigned char" or EOF.
50 ** So on platforms where a char is signed, this may give problems or at
51 ** least warnings. The wrapper functions below will have an "char" parameter
52 ** but handle it correctly. They will NOT work for EOF, but this is not a
53 ** problem, since EOF is always handled separately.
58 /*****************************************************************************/
60 /*****************************************************************************/
65 /* Check for a letter */
68 /* Check for letter or digit */
71 /* Check for an ASCII character */
74 /* Check for a space or tab */
76 #if defined(HAVE_INLINE)
77 INLINE int IsControl (char C)
78 /* Check for control chars */
80 return iscntrl ((unsigned char) C);
83 # define IsControl(C) iscntrl (C)
87 /* Check for any white space characters */
90 /* Check for a digit */
93 /* Check for a lower case char */
96 /* Check for upper case characters */
98 int IsBDigit (char C);
99 /* Check for binary digits (0/1) */
101 int IsODigit (char C);
102 /* Check for octal digits (0..7) */
104 int IsXDigit (char C);
105 /* Check for hexadecimal digits */
107 int IsQuote (char C);
108 /* Check for a single or double quote */
112 /* End of chartype.h */