2 This file is part of SXEmacs
4 SXEmacs is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 SXEmacs is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* Synched up with: Not in FSF. */
20 #ifndef INCLUDED_iso_wide_h_
21 #define INCLUDED_iso_wide_h_
23 /* The following macros are designed for SunOS 5.0 wide characters,
24 in which the single byte ISO Latin-1 character 1xxxxxxx are represented
26 00110000 00000000 00000000 0xxxxxxx
28 For wide character systems which maintain the numeric value of all
29 single-byte characters, IN_TABLE_DOMAIN can simply be defined
31 (0 <= (c) && (c) <= 0xff)
33 and no funky ISO_WIDE_TO_BYTE conversions are needed. */
35 /* Can't use isascii() because we want wide char argument */
36 #define IS_ASCII(c) (0 <= (c) && (c) <= 0x7f)
38 #define IS_ISO_WIDE(c) (0x30000000 <= (c) && (c) <= 0x3000007f)
39 #define IS_ISO_BYTE(c) (0x80 <= (c) && (c) <= 0xff)
41 #define IN_TABLE_DOMAIN(c) (IS_ASCII (c) || IS_ISO_WIDE (c))
43 #define ISO_WIDE_TO_BYTE(c) ((c) & 0x0000007f | 0x80)
44 #define ISO_BYTE_TO_WIDE(c) ((c) & 0x7f | 0x30000000)
46 #define WIDE_TO_BYTE(c) (IS_ISO_WIDE (c) ? ISO_WIDE_TO_BYTE (c) : (c))
47 #define BYTE_TO_WIDE(c) (IS_ISO_BYTE (c) ? ISO_BYTE_TO_WIDE (c) : (c))
49 #endif /* INCLUDED_iso_wide_h_ */