From: Kenichi Handa Date: Tue, 20 Aug 2002 03:59:11 +0000 (+0000) Subject: (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE): New macros. X-Git-Tag: emacs-pretest-23.0.90~8295^2~1864^2~420 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3e411074503a75b3cb85da2bdb6d5b42bbf64a38;p=emacs.git (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE): New macros. --- diff --git a/src/character.h b/src/character.h index c2ac15bfc80..f193dcd6906 100644 --- a/src/character.h +++ b/src/character.h @@ -68,6 +68,22 @@ Boston, MA 02111-1307, USA. */ that corresponds to a raw 8-bit byte. */ #define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1) +/* If C is not ASCII, make it unibyte. */ + +#define MAKE_CHAR_UNIBYTE(c) \ + if (! ASCII_CHAR_P (c)) \ + c = multibyte_char_to_unibyte (c, Qnil); \ + else + + +/* If C is not ASCII, make it multibyte. */ + +#define MAKE_CHAR_MULTIBYTE(c) \ + if (! ASCII_CHAR_P (c)) \ + c = unibyte_char_to_multibyte (c); \ + else + + /* This is the maximum byte length of multibyte form. */ #define MAX_MULTIBYTE_LENGTH 5