aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
authorKenichi Handa2014-07-05 23:07:57 +0900
committerKenichi Handa2014-07-05 23:07:57 +0900
commitaeb894a9a06d84d29b93ca04432d7cbed366e665 (patch)
treee2b73f9a76bc826c7a443e9a8d4fb3b49bdf7332 /src/lisp.h
parent763a11d0d0dcf543e89a22c98f55ea07c40ceefa (diff)
parenta984543a4488ed08778eb775d62f7091db117945 (diff)
downloademacs-aeb894a9a06d84d29b93ca04432d7cbed366e665.tar.gz
emacs-aeb894a9a06d84d29b93ca04432d7cbed366e665.zip
merge trunk
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h47
1 files changed, 35 insertions, 12 deletions
diff --git a/src/lisp.h b/src/lisp.h
index fb832b80940..6af390604d6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1407,10 +1407,11 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
1407 sense to handle a char-table with type struct Lisp_Vector. An 1407 sense to handle a char-table with type struct Lisp_Vector. An
1408 element of a char table can be any Lisp objects, but if it is a sub 1408 element of a char table can be any Lisp objects, but if it is a sub
1409 char-table, we treat it a table that contains information of a 1409 char-table, we treat it a table that contains information of a
1410 specific range of characters. A sub char-table has the same 1410 specific range of characters. A sub char-table is like a vector but
1411 structure as a vector. A sub char table appears only in an element 1411 with two integer fields between the header and Lisp data, which means
1412 of a char-table, and there's no way to access it directly from 1412 that it has to be marked with some precautions (see mark_char_table
1413 Emacs Lisp program. */ 1413 in alloc.c). A sub char-table appears only in an element of a char-table,
1414 and there's no way to access it directly from Emacs Lisp program. */
1414 1415
1415enum CHARTAB_SIZE_BITS 1416enum CHARTAB_SIZE_BITS
1416 { 1417 {
@@ -1465,10 +1466,10 @@ struct Lisp_Sub_Char_Table
1465 contains 32 elements, and each element covers 128 characters. A 1466 contains 32 elements, and each element covers 128 characters. A
1466 sub char-table of depth 3 contains 128 elements, and each element 1467 sub char-table of depth 3 contains 128 elements, and each element
1467 is for one character. */ 1468 is for one character. */
1468 Lisp_Object depth; 1469 int depth;
1469 1470
1470 /* Minimum character covered by the sub char-table. */ 1471 /* Minimum character covered by the sub char-table. */
1471 Lisp_Object min_char; 1472 int min_char;
1472 1473
1473 /* Use set_sub_char_table_contents to set this. */ 1474 /* Use set_sub_char_table_contents to set this. */
1474 Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; 1475 Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER];
@@ -1539,12 +1540,16 @@ struct Lisp_Subr
1539 const char *doc; 1540 const char *doc;
1540 }; 1541 };
1541 1542
1542/* This is the number of slots that every char table must have. This 1543enum char_table_specials
1543 counts the ordinary slots and the top, defalt, parent, and purpose
1544 slots. */
1545enum CHAR_TABLE_STANDARD_SLOTS
1546 { 1544 {
1547 CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras) 1545 /* This is the number of slots that every char table must have. This
1546 counts the ordinary slots and the top, defalt, parent, and purpose
1547 slots. */
1548 CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras),
1549
1550 /* This is an index of first Lisp_Object field in Lisp_Sub_Char_Table
1551 when the latter is treated as an ordinary Lisp_Vector. */
1552 SUB_CHAR_TABLE_OFFSET = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents)
1548 }; 1553 };
1549 1554
1550/* Return the number of "extra" slots in the char table CT. */ 1555/* Return the number of "extra" slots in the char table CT. */
@@ -1556,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct)
1556 - CHAR_TABLE_STANDARD_SLOTS); 1561 - CHAR_TABLE_STANDARD_SLOTS);
1557} 1562}
1558 1563
1559 1564/* Make sure that sub char-table contents slot
1565 is aligned on a multiple of Lisp_Objects. */
1566verify ((offsetof (struct Lisp_Sub_Char_Table, contents)
1567 - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0);
1568
1560/*********************************************************************** 1569/***********************************************************************
1561 Symbols 1570 Symbols
1562 ***********************************************************************/ 1571 ***********************************************************************/
@@ -3723,6 +3732,20 @@ make_uninit_vector (ptrdiff_t size)
3723 return v; 3732 return v;
3724} 3733}
3725 3734
3735/* Like above, but special for sub char-tables. */
3736
3737INLINE Lisp_Object
3738make_uninit_sub_char_table (int depth, int min_char)
3739{
3740 int slots = SUB_CHAR_TABLE_OFFSET + chartab_size[depth];
3741 Lisp_Object v = make_uninit_vector (slots);
3742
3743 XSETPVECTYPE (XVECTOR (v), PVEC_SUB_CHAR_TABLE);
3744 XSUB_CHAR_TABLE (v)->depth = depth;
3745 XSUB_CHAR_TABLE (v)->min_char = min_char;
3746 return v;
3747}
3748
3726extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type); 3749extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
3727#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ 3750#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
3728 ((typ*) \ 3751 ((typ*) \