Mercurial > hg > xemacs-beta
comparison src/iso-wide.h @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:376386a54a3c |
---|---|
1 /* This file is part of XEmacs. | |
2 | |
3 XEmacs is free software; you can redistribute it and/or modify it | |
4 under the terms of the GNU General Public License as published by the | |
5 Free Software Foundation; either version 2, or (at your option) any | |
6 later version. | |
7 | |
8 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
11 for more details. | |
12 | |
13 You should have received a copy of the GNU General Public License | |
14 along with XEmacs; see the file COPYING. If not, write to | |
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
16 Boston, MA 02111-1307, USA. */ | |
17 | |
18 /* Synched up with: Not in FSF. */ | |
19 | |
20 #ifndef _XEMACS_ISO_WIDE_H | |
21 #define _XEMACS_ISO_WIDE_H | |
22 | |
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 | |
25 | |
26 00110000 00000000 00000000 0xxxxxxx | |
27 | |
28 For wide character systems which maintain the numeric value of all | |
29 single-byte characters, IN_TABLE_DOMAIN can simply be defined | |
30 | |
31 (0 <= (c) && (c) <= 0xff) | |
32 | |
33 and no funky ISO_WIDE_TO_BYTE conversions are needed. */ | |
34 | |
35 /* Can't use isascii() because we want wide char argument */ | |
36 #define IS_ASCII(c) (0 <= (c) && (c) <= 0x7f) | |
37 | |
38 #define IS_ISO_WIDE(c) (0x30000000 <= (c) && (c) <= 0x3000007f) | |
39 #define IS_ISO_BYTE(c) (0x80 <= (c) && (c) <= 0xff) | |
40 | |
41 #define IN_TABLE_DOMAIN(c) (IS_ASCII (c) || IS_ISO_WIDE (c)) | |
42 | |
43 #define ISO_WIDE_TO_BYTE(c) ((c) & 0x0000007f | 0x80) | |
44 #define ISO_BYTE_TO_WIDE(c) ((c) & 0x7f | 0x30000000) | |
45 | |
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)) | |
48 | |
49 #endif /* _XEMACS_ISO_WIDE_H */ |