Mercurial > emacs
comparison src/character.h @ 88946:233c080b5756
(CHAR_TO_BYTE8): If C is not eight-bit char, call
multibyte_char_to_unibyte.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 31 Jul 2002 07:05:33 +0000 |
parents | 94184802d0cc |
children | a9f683a73092 |
comparison
equal
deleted
inserted
replaced
88945:9c97427fb1f6 | 88946:233c080b5756 |
---|---|
49 #define MAX_2_BYTE_CHAR 0x7FF | 49 #define MAX_2_BYTE_CHAR 0x7FF |
50 #define MAX_3_BYTE_CHAR 0xFFFF | 50 #define MAX_3_BYTE_CHAR 0xFFFF |
51 #define MAX_4_BYTE_CHAR 0x1FFFFF | 51 #define MAX_4_BYTE_CHAR 0x1FFFFF |
52 #define MAX_5_BYTE_CHAR 0x3FFF7F | 52 #define MAX_5_BYTE_CHAR 0x3FFF7F |
53 | 53 |
54 /* Return the character code for raw 8-bit byte BYTE. */ | |
55 #define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00) | |
56 | |
57 /* Return the raw 8-bit byte for character C. */ | |
58 #define CHAR_TO_BYTE8(c) ((c) - 0x3FFF00) | |
59 | |
60 /* Nonzero iff C is a character that corresponds to a raw 8-bit | 54 /* Nonzero iff C is a character that corresponds to a raw 8-bit |
61 byte. */ | 55 byte. */ |
62 #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) | 56 #define CHAR_BYTE8_P(c) ((c) > MAX_5_BYTE_CHAR) |
57 | |
58 /* Return the character code for raw 8-bit byte BYTE. */ | |
59 #define BYTE8_TO_CHAR(byte) ((byte) + 0x3FFF00) | |
60 | |
61 /* Return the raw 8-bit byte for character C. */ | |
62 #define CHAR_TO_BYTE8(c) \ | |
63 (CHAR_BYTE8_P (c) \ | |
64 ? (c) - 0x3FFF00 \ | |
65 : multibyte_char_to_unibyte (c, Qnil)) | |
63 | 66 |
64 /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character | 67 /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character |
65 that corresponds to a raw 8-bit byte. */ | 68 that corresponds to a raw 8-bit byte. */ |
66 #define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1) | 69 #define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1) |
67 | 70 |