changeset 20719:78d95f2a9d92

(BCOPY_SHORT): New macro. (MAX_CHAR_COMPOSITION): New macro. (CHAR_CHARSET): Check more strictly. (CODING_FLAG_ISO_DESIGNATION): New macro. (Vcharacter_unification_table_vector): Extern it. (UNIFICATION_ID_TABLE): New macro.
author Kenichi Handa <handa@m17n.org>
date Thu, 22 Jan 1998 01:26:45 +0000
parents c600dea3b06b
children f084bb8d535f
files src/charset.h
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.h	Thu Jan 22 01:26:45 1998 +0000
+++ b/src/charset.h	Thu Jan 22 01:26:45 1998 +0000
@@ -244,6 +244,7 @@
   ((MIN_CHARSET_PRIVATE_DIMENSION2 - 0xE0) << 14)
 #define MIN_CHAR_COMPOSITION \
   (0x1F << 14)
+#define MAX_CHAR_COMPOSITION GLYPH_MASK_CHAR
 
 /* 1 if C is an ASCII character, else 0.  */
 #define SINGLE_BYTE_CHAR_P(c) ((c) < 0x100)
@@ -404,7 +405,9 @@
 	 ? CHAR_FIELD1 (c) + 0x8F	 	\
 	 : ((c) < MIN_CHAR_COMPOSITION	 	\
 	    ? CHAR_FIELD1 (c) + 0xE0	 	\
-	    : CHARSET_COMPOSITION))))
+	    : ((c) <= MAX_CHAR_COMPOSITION	\
+	       ? CHARSET_COMPOSITION		\
+	       : CHARSET_ASCII)))))
 
 /* Return charset at the place pointed by P.  */
 #define CHARSET_AT(p)			   	\
@@ -763,4 +766,19 @@
 extern int find_charset_in_str P_ ((unsigned char *, int, int *, Lisp_Object));
 extern int strwidth P_ ((unsigned char *, int));
 
+extern Lisp_Object Vcharacter_unification_table_vector;
+#define UNIFICATION_ID_TABLE(id) \
+  (XCONS(XVECTOR(Vcharacter_unification_table_vector)->contents[(id)])->cdr)
+
+/* Copy LEN bytes from FROM to TO.  This macro should be used only
+   when a caller knows that LEN is short and the obvious copy loop is
+   faster than calling bcopy which has some overhead.  */
+
+#define BCOPY_SHORT(from, to, len)		\
+  do {						\
+    int i = len;				\
+    unsigined char *from_p = from, *to_p = to;	\
+    while (i--) *from_p++ = *to_p++;		\
+  } while (0)
+
 #endif /* _CHARSET_H */