diff options
| author | Kenichi Handa | 1997-04-07 07:12:13 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-04-07 07:12:13 +0000 |
| commit | ea724a01827c263afb64e8b627da6b005757518d (patch) | |
| tree | 0af0171131e0b77155913cef21a233e94093926a /src | |
| parent | 3701b5de07a2998b089ef9e4f65bebedbb554039 (diff) | |
| download | emacs-ea724a01827c263afb64e8b627da6b005757518d.tar.gz emacs-ea724a01827c263afb64e8b627da6b005757518d.zip | |
(CHAR_TABLE_STANDARD_SLOTS): Now 4 more slots than
CHAR_TABLE_ORDINARY_SLOTS for top, defalt, parent, and purpose.
(SUB_CHAR_TABLE_ORDINARY_SLOTS, SUB_CHAR_TABLE_STANDARD_SLOTS):
New macros.
(struct Lisp_Char_Table): New member `top'. The member `defalt'
is moved before `contents' so that XCHAT_TABLE (val)->defalt can
also be used for a sub char table.
(SUB_CHAR_TABLE_P): New macro.
(make_sub_char_table): Extern it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/src/lisp.h b/src/lisp.h index ac351d88af9..54af82be6e1 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -564,22 +564,41 @@ struct Lisp_Vector | |||
| 564 | Lisp_Object contents[1]; | 564 | Lisp_Object contents[1]; |
| 565 | }; | 565 | }; |
| 566 | 566 | ||
| 567 | /* A char table is a kind of vectorlike, with contents are like a vector | 567 | /* A char table is a kind of vectorlike, with contents are like a |
| 568 | but with a few other slots. For some purposes, it makes sense | 568 | vector but with a few other slots. For some purposes, it makes |
| 569 | to handle a chartable with type struct Lisp_Vector. */ | 569 | sense to handle a chartable with type struct Lisp_Vector. An |
| 570 | 570 | element of a char table can be any Lisp objects, but if it is a sub | |
| 571 | char-table, we treat it a table that contains information of a | ||
| 572 | group of characters of the same charsets or a specific character of | ||
| 573 | a charset. A sub char-table has the same structure as a char table | ||
| 574 | except for that the former omits several slots at the tail. A sub | ||
| 575 | char table appears only in an element of a char table, and there's | ||
| 576 | no way to access it directly from Emacs Lisp program. */ | ||
| 577 | |||
| 571 | /* This is the number of slots that apply to characters or character | 578 | /* This is the number of slots that apply to characters or character |
| 572 | sets. The first 128 are for ASCII, the next 128 are for 8-bit | 579 | sets. The first 128 are for ASCII, the next 128 are for 8-bit |
| 573 | European characters, and the last 128 are for multibyte characters. */ | 580 | European characters, and the last 128 are for multibyte characters. |
| 581 | The first 256 are indexed by the code itself, but the last 128 are | ||
| 582 | indexed by (charset-id + 128). */ | ||
| 574 | #define CHAR_TABLE_ORDINARY_SLOTS 384 | 583 | #define CHAR_TABLE_ORDINARY_SLOTS 384 |
| 575 | 584 | ||
| 576 | /* This is the number of slots that apply to characters of ASCII and | 585 | /* This is the number of slots that apply to characters of ASCII and |
| 577 | 8-bit Europeans only. */ | 586 | 8-bit Europeans only. */ |
| 578 | #define CHAR_TABLE_SINGLE_BYTE_SLOTS 256 | 587 | #define CHAR_TABLE_SINGLE_BYTE_SLOTS 256 |
| 579 | 588 | ||
| 580 | /* This is the number of slots that every char table must have. | 589 | /* This is the number of slots that every char table must have. This |
| 581 | This counts the ordinary slots and the parent and defalt slots. */ | 590 | counts the ordinary slots and the top, defalt, parent, and purpose |
| 582 | #define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 3) | 591 | slots. */ |
| 592 | #define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 4) | ||
| 593 | |||
| 594 | /* This is the number of slots that apply to position-code-1 and | ||
| 595 | position-code-2 of a multibyte character at the 2nd and 3rd level | ||
| 596 | sub char tables respectively. */ | ||
| 597 | #define SUB_CHAR_TABLE_ORDINARY_SLOTS 128 | ||
| 598 | |||
| 599 | /* This is the number of slots that every sub char table must have. | ||
| 600 | This counts the ordinary slots and the top and defalt slot. */ | ||
| 601 | #define SUB_CHAR_TABLE_STANDARD_SLOTS (SUB_CHAR_TABLE_ORDINARY_SLOTS + 2) | ||
| 583 | 602 | ||
| 584 | /* Return the number of "extra" slots in the char table CT. */ | 603 | /* Return the number of "extra" slots in the char table CT. */ |
| 585 | 604 | ||
| @@ -609,13 +628,22 @@ struct Lisp_Char_Table | |||
| 609 | { | 628 | { |
| 610 | /* This is the vector's size field, which also holds the | 629 | /* This is the vector's size field, which also holds the |
| 611 | pseudovector type information. It holds the size, too. | 630 | pseudovector type information. It holds the size, too. |
| 612 | The size counts the defalt and parent slots. */ | 631 | The size counts the top, defalt, purpose, and parent slots. |
| 632 | The last three are not counted if this is a sub char table. */ | ||
| 613 | EMACS_INT size; | 633 | EMACS_INT size; |
| 614 | struct Lisp_Vector *next; | 634 | struct Lisp_Vector *next; |
| 615 | Lisp_Object contents[CHAR_TABLE_ORDINARY_SLOTS]; | 635 | /* This holds a flag to tell if this is a top level char table (t) |
| 636 | or a sub char table (nil). */ | ||
| 637 | Lisp_Object top; | ||
| 616 | /* This holds a default value, | 638 | /* This holds a default value, |
| 617 | which is used whenever the value for a specific character is nil. */ | 639 | which is used whenever the value for a specific character is nil. */ |
| 618 | Lisp_Object defalt; | 640 | Lisp_Object defalt; |
| 641 | /* This holds an actual value of each element. A sub char table | ||
| 642 | has only SUB_CHAR_TABLE_ORDINARY_SLOTS number of elements. */ | ||
| 643 | Lisp_Object contents[CHAR_TABLE_ORDINARY_SLOTS]; | ||
| 644 | |||
| 645 | /* A sub char table doesn't has the following slots. */ | ||
| 646 | |||
| 619 | /* This points to another char table, which we inherit from | 647 | /* This points to another char table, which we inherit from |
| 620 | when the value for a specific character is nil. | 648 | when the value for a specific character is nil. |
| 621 | The `defalt' slot takes precedence over this. */ | 649 | The `defalt' slot takes precedence over this. */ |
| @@ -1034,6 +1062,8 @@ typedef unsigned char UCHAR; | |||
| 1034 | #define GC_BOOL_VECTOR_P(x) GC_PSEUDOVECTORP (x, PVEC_BOOL_VECTOR) | 1062 | #define GC_BOOL_VECTOR_P(x) GC_PSEUDOVECTORP (x, PVEC_BOOL_VECTOR) |
| 1035 | #define FRAMEP(x) PSEUDOVECTORP (x, PVEC_FRAME) | 1063 | #define FRAMEP(x) PSEUDOVECTORP (x, PVEC_FRAME) |
| 1036 | #define GC_FRAMEP(x) GC_PSEUDOVECTORP (x, PVEC_FRAME) | 1064 | #define GC_FRAMEP(x) GC_PSEUDOVECTORP (x, PVEC_FRAME) |
| 1065 | |||
| 1066 | #define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top)) | ||
| 1037 | 1067 | ||
| 1038 | #define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) | 1068 | #define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) |
| 1039 | #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) | 1069 | #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) |
| @@ -1544,6 +1574,7 @@ extern Lisp_Object pure_cons (), make_pure_vector (); | |||
| 1544 | extern Lisp_Object Fgarbage_collect (); | 1574 | extern Lisp_Object Fgarbage_collect (); |
| 1545 | extern Lisp_Object Fmake_byte_code (); | 1575 | extern Lisp_Object Fmake_byte_code (); |
| 1546 | extern Lisp_Object Fmake_bool_vector (), Fmake_char_table (); | 1576 | extern Lisp_Object Fmake_bool_vector (), Fmake_char_table (); |
| 1577 | extern Lisp_Object make_sub_char_table (); | ||
| 1547 | extern Lisp_Object Qchar_table_extra_slots; | 1578 | extern Lisp_Object Qchar_table_extra_slots; |
| 1548 | extern struct Lisp_Vector *allocate_vectorlike (); | 1579 | extern struct Lisp_Vector *allocate_vectorlike (); |
| 1549 | extern int gc_in_progress; | 1580 | extern int gc_in_progress; |