From: Kenichi Handa Date: Tue, 18 Mar 1997 23:31:34 +0000 (+0000) Subject: (CHAR_TABLE_ORDINARY_SLOTS): Change to 384 (== 256 + 128). X-Git-Tag: emacs-20.1~2757 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b96656ce4e29cdead9a1786a5d3f140a8bb95d6d;p=emacs.git (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. --- 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