# HG changeset patch # User Kenichi Handa # Date 1029815951 0 # Node ID a9f683a73092acc7fecafd4ed0a6ad6a786c89b5 # Parent 6a9e0cb7368b49179a27854fc11a9ae129201da9 (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE): New macros. diff -r 6a9e0cb7368b -r a9f683a73092 src/character.h --- a/src/character.h Tue Aug 20 03:58:53 2002 +0000 +++ b/src/character.h Tue Aug 20 03:59:11 2002 +0000 @@ -68,6 +68,22 @@ 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