diff options
author | Kenichi Handa <handa@m17n.org> | 2009-07-07 01:41:20 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2009-07-07 01:41:20 +0000 |
commit | cab7a8e29062c9682caeecc875216431785e79dd (patch) | |
tree | 37583bdd32b8afb802b0a49df64969947d6f131a | |
parent | 3bd51dfeabe5f32e9a55b8a47044ec208357e34a (diff) | |
download | emacs-cab7a8e29062c9682caeecc875216431785e79dd.tar.gz |
(unibyte_has_multibyte_table): Delete extern.
(charset_unibyte_decoder): Extern it.
(DECODE_UNIBYTE): New macro.
-rw-r--r-- | src/character.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/character.h b/src/character.h index 075d36bf517..def2a96ff1f 100644 --- a/src/character.h +++ b/src/character.h @@ -87,11 +87,15 @@ extern int unibyte_to_multibyte_table[256]; #define unibyte_char_to_multibyte(c) \ ((c) < 256 ? unibyte_to_multibyte_table[(c)] : (c)) -/* Nth element is 1 iff unibyte char N can be mapped to a multibyte - char. */ -extern char unibyte_has_multibyte_table[256]; - -#define UNIBYTE_CHAR_HAS_MULTIBYTE_P(c) (unibyte_has_multibyte_table[(c)]) +/* Decoding table for 8-bit byte codes of the charset charset_unibyte. + Nth element is for the code (N-0x80). */ +extern int charset_unibyte_decoder[128]; + +/* Return a character correspoinding to the code BYTE of + charset_unibyte. BYTE must be a byte; i.e. less than 0x100. If + BYTE is not a valid code of charset_unibyte, return -1. */ +#define DECODE_UNIBYTE(BYTE) \ + ((BYTE) < 0x80 ? (int) (BYTE) : charset_unibyte_decoder[(BYTE) - 0x80]) /* If C is not ASCII, make it unibyte. */ #define MAKE_CHAR_UNIBYTE(c) \ |