changeset 89038:f60ed671d6e4

(BYTE8_STRING): New macro.
author Kenichi Handa <handa@m17n.org>
date Wed, 21 Aug 2002 02:27:07 +0000
parents a706555725da
children 2383f41c7b8a
files src/character.h
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.