]> git.sur5r.net Git - cc65/blob - src/common/chartype.h
3f895e4d00f342f81e310e2c48185ff97f7e2a3b
[cc65] / src / common / chartype.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                chartype.h                                 */
4 /*                                                                           */
5 /*                    Character classification functions                     */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2000     Ullrich von Bassewitz                                        */
10 /*              Wacholderweg 14                                              */
11 /*              D-70597 Stuttgart                                            */
12 /* EMail:       uz@musoftware.de                                             */
13 /*                                                                           */
14 /*                                                                           */
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.                                    */
18 /*                                                                           */
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:                            */
22 /*                                                                           */
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              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef CHARTYPE_H
37 #define CHARTYPE_H
38
39
40
41 /* This module contains replacements for functions in ctype.h besides other
42  * functions. There is a problem with using ctype.h directly:
43  * The parameter must have a value of "unsigned char" or EOF.
44  * So on platforms where a char is signed, this may give problems or at
45  * least warnings. The wrapper functions below will have an "char" parameter
46  * but handle it correctly. They will NOT work for EOF, but this is not a
47  * problem, since EOF is always handled separately.
48  */
49
50
51
52 /*****************************************************************************/
53 /*                                   Code                                    */
54 /*****************************************************************************/
55
56
57
58 int IsAlpha (char C);
59 /* Check for a letter */
60
61 int IsAlNum (char C);
62 /* Check for letter or digit */
63
64 int IsAscii (char C);
65 /* Check for an ASCII character */
66
67 int IsBlank (char C);
68 /* Check for a space, tab or newline */
69
70 int IsDigit (char C);
71 /* Check for a digit */
72
73 int IsLower (char C);
74 /* Check for a lower case char */
75
76 int IsSpace (char C);
77 /* Check for white space characters */
78
79 int IsUpper (char C);
80 /* Check for upper case characters */
81
82 int IsXDigit (char C);
83 /* Check for hexadecimal digits */
84
85 int IsQuote (char C);
86 /* Check for a single or double quote */
87
88
89
90 /* End of chartype.h */
91
92 #endif
93
94
95