Fix for a crash which happened when a document couldn't be opened.
[AROS-Contrib.git] / regina / regina_c.h
blob43394f04b4534a8bee40c9634ba93db6d7c7361e
1 /*
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
24 * routines.
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
44 #include "wrappers.h"
47 * Emulate the inclusion of <ctype.h> by defining popular values.
49 #define _CTYPE_H_INCLUDED
50 #define _CTYPE_H
51 #define _INC_CTYPE
52 #define _CTYPE_DEFINED
53 #define is_expand( c, bit, func ) ( ( char_info[256] & bit ) ? \
54 ( char_info[(unsigned char) c] & bit ) : func( c ) )
55 #ifdef islower
56 # undef islower
57 #endif
58 #define rx_islower( c ) is_expand( c, RX_ISLOWER , Islower )
59 #ifdef isupper
60 # undef isupper
61 #endif
62 #define rx_isupper( c ) is_expand( c, RX_ISUPPER , Isupper )
63 #ifdef isalpha
64 # undef isalpha
65 #endif
66 #define rx_isalpha( c ) is_expand( c, RX_ISALPHA , Isalpha )
67 #ifdef isalnum
68 # undef isalnum
69 #endif
70 #define rx_isalnum( c ) is_expand( c, RX_ISALNUM , Isalnum )
71 #ifdef isdigit
72 # undef isdigit
73 #endif
74 #define rx_isdigit( c ) is_expand( c, RX_ISDIGIT , Isdigit )
75 #ifdef isxdigit
76 # undef isxdigit
77 #endif
78 #define rx_isxdigit( c ) is_expand( c, RX_ISXDIGIT, Isxdigit )
79 #ifdef ispunct
80 # undef ispunct
81 #endif
82 #define rx_ispunct( c ) is_expand( c, RX_ISPUNCT , Ispunct )
83 #ifdef isspace
84 # undef isspace
85 #endif
86 #define rx_isspace( c ) is_expand( c, RX_ISSPACE , Isspace )
87 #ifdef isprint
88 # undef isprint
89 #endif
90 #define rx_isprint( c ) is_expand( c, RX_ISPRINT , Isprint )
91 #ifdef isgraph
92 # undef isgraph
93 #endif
94 #define rx_isgraph( c ) is_expand( c, RX_ISGRAPH , Isgraph )
95 #ifdef iscntrl
96 # undef iscntrl
97 #endif
98 #define rx_iscntrl( c ) is_expand( c, RX_ISCNTRL , Iscntrl )
100 #ifdef toupper
101 # undef toupper
102 #endif
103 #define rx_toupper( c ) ( ( char_info[256] & RX_ISUPPER ) ? \
104 l_to_u[(unsigned char) c] : Toupper( c ) )
106 #ifdef tolower
107 # undef tolower
108 #endif
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 );
125 # ifdef WIN32
126 # include <wchar.h>
127 # endif
128 #endif
130 #endif /* REGINA_C_H_INCLUDED */