2 * The Regina Rexx Interpreter
3 * Copyright (C) 2003 Florian Große-Coosmann <florian@grosse-coosmann.de>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * This header file is needed by some systems which include ctype.h in
21 * system header files. Some of these must be included before rexx.h can be
22 * included. This will lead to warnings or error since this file replaces
23 * the functionality of ctype.h for a seamless support by Regina's own
27 #ifndef REGINA_C_H_INCLUDED
28 #define REGINA_C_H_INCLUDED
30 #define RX_ISLOWER 0x001
31 #define RX_ISUPPER 0x002
32 #define RX_ISALPHA 0x004
33 #define RX_ISALNUM 0x008
34 #define RX_ISDIGIT 0x010
35 #define RX_ISXDIGIT 0x020
36 #define RX_ISPUNCT 0x040
37 #define RX_ISSPACE 0x080
38 #define RX_ISPRINT 0x100
39 #define RX_ISGRAPH 0x200
40 #define RX_ISCNTRL 0x400
42 #ifndef NO_CTYPE_REPLACEMENT
47 * Emulate the inclusion of <ctype.h> by defining popular values.
49 #define _CTYPE_H_INCLUDED
52 #define _CTYPE_DEFINED
53 #define is_expand( c, bit, func ) ( ( char_info[256] & bit ) ? \
54 ( char_info[(unsigned char) c] & bit ) : func( c ) )
58 #define rx_islower( c ) is_expand( c, RX_ISLOWER , Islower )
62 #define rx_isupper( c ) is_expand( c, RX_ISUPPER , Isupper )
66 #define rx_isalpha( c ) is_expand( c, RX_ISALPHA , Isalpha )
70 #define rx_isalnum( c ) is_expand( c, RX_ISALNUM , Isalnum )
74 #define rx_isdigit( c ) is_expand( c, RX_ISDIGIT , Isdigit )
78 #define rx_isxdigit( c ) is_expand( c, RX_ISXDIGIT, Isxdigit )
82 #define rx_ispunct( c ) is_expand( c, RX_ISPUNCT , Ispunct )
86 #define rx_isspace( c ) is_expand( c, RX_ISSPACE , Isspace )
90 #define rx_isprint( c ) is_expand( c, RX_ISPRINT , Isprint )
94 #define rx_isgraph( c ) is_expand( c, RX_ISGRAPH , Isgraph )
98 #define rx_iscntrl( c ) is_expand( c, RX_ISCNTRL , Iscntrl )
103 #define rx_toupper( c ) ( ( char_info[256] & RX_ISUPPER ) ? \
104 l_to_u[(unsigned char) c] : Toupper( c ) )
109 #define rx_tolower( c ) ( ( char_info[256] & RX_ISLOWER ) ? \
110 u_to_l[(unsigned char) c] : Tolower( c ) )
111 int Islower( int c
);
112 int Isupper( int c
);
113 int Isalpha( int c
);
114 int Isalnum( int c
);
115 int Isdigit( int c
);
116 int Isxdigit( int c
);
117 int Ispunct( int c
);
118 int Isspace( int c
);
119 int Isprint( int c
);
120 int Isgraph( int c
);
121 int Iscntrl( int c
);
122 int Toupper( int c
);
123 int Tolower( int c
);
130 #endif /* REGINA_C_H_INCLUDED */