changeset 17188:e38cc84db8ab

(CHAR_TABLE_ORDINARY_SLOTS): Change to 384 (== 256 + 128). (CHAR_TABLE_STANDARD_SLOTS): Adjusted for the above change. (CHAR_TABLE_SINGLE_BYTE_SLOTS): New macro. (CHAR_TABLE_REF, CHAR_TABLE_SET): New macros.
author Kenichi Handa <handa@m17n.org>
date Tue, 18 Mar 1997 23:31:34 +0000
parents 9ab0c08a3359
children 7c008ec99e97
files src/lisp.h
diffstat 1 files changed, 32 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lisp.h	Tue Mar 18 23:31:34 1997 +0000
+++ b/src/lisp.h	Tue Mar 18 23:31:34 1997 +0000
@@ -568,19 +568,43 @@
    but with a few other slots.  For some purposes, it makes sense
    to handle a chartable with type struct Lisp_Vector.  */
 
-/* This is the number of slots that apply to characters
-   or character sets.  */
-#define CHAR_TABLE_ORDINARY_SLOTS 256
+/* This is the number of slots that apply to characters or character
+   sets.  The first 128 are for ASCII, the next 128 are for 8-bit
+   European characters, and the last 128 are for multibyte characters.  */
+#define CHAR_TABLE_ORDINARY_SLOTS 384
+
+/* This is the number of slots that apply to characters of ASCII and
+   8-bit Europeans only.  */
+#define CHAR_TABLE_SINGLE_BYTE_SLOTS 256
 
 /* This is the number of slots that every char table must have.
    This counts the ordinary slots and the parent and defalt slots.  */
-#define CHAR_TABLE_STANDARD_SLOTS (256+3)
+#define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 3)
 
 /* Return the number of "extra" slots in the char table CT.  */
 
 #define CHAR_TABLE_EXTRA_SLOTS(CT)	\
   (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS)
 
+/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
+   and 8-bit Europeans characters.  Do not follow parent.  */
+#define CHAR_TABLE_REF(CT, IDX)						\
+  (CHAR_TABLE_P (CT) && IDX >= 0 && IDX < CHAR_TABLE_SINGLE_BYTE_SLOTS	\
+   ? (!NILP (XCHAR_TABLE (CT)->contents[IDX])				\
+      ? XCHAR_TABLE (CT)->contents[IDX]					\
+      : XCHAR_TABLE (CT)->default)					\
+   : Faref (CT, IDX))
+
+/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
+   8-bit Europeans characters.  */
+#define CHAR_TABLE_SET(CT, IDX, VAL)					     \
+  do {									     \
+    if (CHAR_TABLE_P (CT) && IDX >= 0 && IDX < CHAR_TABLE_SINGLE_BYTE_SLOTS) \
+      XCHAR_TABLE (CT)->contents[IDX] = VAL;				     \
+    else								     \
+      Faset (CT, IDX, VAL);						     \
+  } while (0)
+
 struct Lisp_Char_Table
   {
     /* This is the vector's size field, which also holds the
@@ -914,6 +938,10 @@
 #define FAST_GLYPH_FACE(g) ((g) & GLYPH_MASK_FACE)
 #endif /* not HAVE_FACES */
 
+/* Return 1 iff GLYPH contains valid character code.  */
+#define GLYPH_CHAR_VALID_P(glyph) \
+  ((GLYPH) (FAST_GLYPH_CHAR (glyph)) <= MAX_CHAR)
+
 /* The ID of the mode line highlighting face.  */
 #define GLYPH_MODE_LINE_FACE 1