# HG changeset patch # User Kenichi Handa # Date 1029896827 0 # Node ID f60ed671d6e44e10fc884f9c7f752dac624edb01 # Parent a706555725da4b9c13f6894a3e89cb45bc597bf6 (BYTE8_STRING): New macro. diff -r a706555725da -r f60ed671d6e4 src/character.h --- a/src/character.h Wed Aug 21 01:32:03 2002 +0000 +++ b/src/character.h Wed Aug 21 02:27:07 2002 +0000 @@ -149,6 +149,15 @@ (p)[1] = (0x80 | ((c) & 0x3F)), \ 2)) +/* Store multibyte form of eight-bit char B in P. The caller should + allocate at least MAX_MULTIBYTE_LENGTH bytes area at P in advance. + Returns the length of the multibyte form. */ + +#define BYTE8_STRING(b, p) \ + ((p)[0] = (0xC0 | (((b) >> 6) & 0x01)), \ + (p)[1] = (0x80 | ((c) & 0x3F)), \ + 2) + /* Store multibyte form of the character C in P. The caller should allocate at least MAX_MULTIBYTE_LENGTH bytes area at P in advance.