diff options
author | Kenichi Handa <handa@m17n.org> | 1997-03-18 23:31:34 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 1997-03-18 23:31:34 +0000 |
commit | cceabb17821d5b898784328d9a7376ed192ad32b (patch) | |
tree | 684299b072a40731fcd6803b6812ab7e37d6c1a4 /src/lisp.h | |
parent | 9aff3f4a6da4ae00fbd1af3a3f3f5c7c8a96570d (diff) | |
download | emacs-cceabb17821d5b898784328d9a7376ed192ad32b.tar.gz |
(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.
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/lisp.h b/src/lisp.h index 69f0d2ffd9c..d8232501bcc 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -568,19 +568,43 @@ struct Lisp_Vector 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 @@ typedef unsigned char UCHAR; #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 |