annotate src/iso-wide.h @ 314:341dac730539 r21-0b55

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