aboutsummaryrefslogtreecommitdiffstats
path: root/src/charset.h
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>1998-01-22 01:26:45 +0000
committerKenichi Handa <[email protected]>1998-01-22 01:26:45 +0000
commitc1f6608b5f607be7210ae5651866d6e1643b1ace (patch)
tree422bad1eaab7bc57ac4d90ffa791e58890139a7e /src/charset.h
parentd46c5b12512d9b56b35b1e9bafd6e51535270f77 (diff)
(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.
Diffstat (limited to 'src/charset.h')
-rw-r--r--src/charset.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/charset.h b/src/charset.h
index f8bc1363b7..b4c3e08c53 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -244,6 +244,7 @@ extern int charset_big5_2; /* Big5 Level 2 (Chinese Traditional) */
((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 @@ extern int width_by_char_head[256];
? 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 cmpchar_component P_ ((unsigned int, unsigned int));
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 */