diff options
Diffstat (limited to 'src')
| -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 | |||
| 568 | but with a few other slots. For some purposes, it makes sense | 568 | but with a few other slots. For some purposes, it makes sense |
| 569 | to handle a chartable with type struct Lisp_Vector. */ | 569 | to handle a chartable with type struct Lisp_Vector. */ |
| 570 | 570 | ||
| 571 | /* This is the number of slots that apply to characters | 571 | /* This is the number of slots that apply to characters or character |
| 572 | or character sets. */ | 572 | sets. The first 128 are for ASCII, the next 128 are for 8-bit |
| 573 | #define CHAR_TABLE_ORDINARY_SLOTS 256 | 573 | European characters, and the last 128 are for multibyte characters. */ |
| 574 | #define CHAR_TABLE_ORDINARY_SLOTS 384 | ||
| 575 | |||
| 576 | /* This is the number of slots that apply to characters of ASCII and | ||
| 577 | 8-bit Europeans only. */ | ||
| 578 | #define CHAR_TABLE_SINGLE_BYTE_SLOTS 256 | ||
| 574 | 579 | ||
| 575 | /* This is the number of slots that every char table must have. | 580 | /* This is the number of slots that every char table must have. |
| 576 | This counts the ordinary slots and the parent and defalt slots. */ | 581 | This counts the ordinary slots and the parent and defalt slots. */ |
| 577 | #define CHAR_TABLE_STANDARD_SLOTS (256+3) | 582 | #define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 3) |
| 578 | 583 | ||
| 579 | /* Return the number of "extra" slots in the char table CT. */ | 584 | /* Return the number of "extra" slots in the char table CT. */ |
| 580 | 585 | ||
| 581 | #define CHAR_TABLE_EXTRA_SLOTS(CT) \ | 586 | #define CHAR_TABLE_EXTRA_SLOTS(CT) \ |
| 582 | (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) | 587 | (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS) |
| 583 | 588 | ||
| 589 | /* Almost equivalent to Faref (CT, IDX) with optimization for ASCII | ||
| 590 | and 8-bit Europeans characters. Do not follow parent. */ | ||
| 591 | #define CHAR_TABLE_REF(CT, IDX) \ | ||
| 592 | (CHAR_TABLE_P (CT) && IDX >= 0 && IDX < CHAR_TABLE_SINGLE_BYTE_SLOTS \ | ||
| 593 | ? (!NILP (XCHAR_TABLE (CT)->contents[IDX]) \ | ||
| 594 | ? XCHAR_TABLE (CT)->contents[IDX] \ | ||
| 595 | : XCHAR_TABLE (CT)->default) \ | ||
| 596 | : Faref (CT, IDX)) | ||
| 597 | |||
| 598 | /* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and | ||
| 599 | 8-bit Europeans characters. */ | ||
| 600 | #define CHAR_TABLE_SET(CT, IDX, VAL) \ | ||
| 601 | do { \ | ||
| 602 | if (CHAR_TABLE_P (CT) && IDX >= 0 && IDX < CHAR_TABLE_SINGLE_BYTE_SLOTS) \ | ||
| 603 | XCHAR_TABLE (CT)->contents[IDX] = VAL; \ | ||
| 604 | else \ | ||
| 605 | Faset (CT, IDX, VAL); \ | ||
| 606 | } while (0) | ||
| 607 | |||
| 584 | struct Lisp_Char_Table | 608 | struct Lisp_Char_Table |
| 585 | { | 609 | { |
| 586 | /* This is the vector's size field, which also holds the | 610 | /* This is the vector's size field, which also holds the |
| @@ -914,6 +938,10 @@ typedef unsigned char UCHAR; | |||
| 914 | #define FAST_GLYPH_FACE(g) ((g) & GLYPH_MASK_FACE) | 938 | #define FAST_GLYPH_FACE(g) ((g) & GLYPH_MASK_FACE) |
| 915 | #endif /* not HAVE_FACES */ | 939 | #endif /* not HAVE_FACES */ |
| 916 | 940 | ||
| 941 | /* Return 1 iff GLYPH contains valid character code. */ | ||
| 942 | #define GLYPH_CHAR_VALID_P(glyph) \ | ||
| 943 | ((GLYPH) (FAST_GLYPH_CHAR (glyph)) <= MAX_CHAR) | ||
| 944 | |||
| 917 | /* The ID of the mode line highlighting face. */ | 945 | /* The ID of the mode line highlighting face. */ |
| 918 | #define GLYPH_MODE_LINE_FACE 1 | 946 | #define GLYPH_MODE_LINE_FACE 1 |
| 919 | 947 | ||