#ifdef MULE
static Lisp_Object
-mark_char_table_entry (Lisp_Object obj, void (*markobj) (Lisp_Object))
+mark_char_table_entry (Lisp_Object obj)
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj);
int i;
for (i = 0; i < 96; i++)
{
- markobj (cte->level2[i]);
+ mark_object (cte->level2[i]);
}
return Qnil;
}
static int
char_table_entry_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Char_Table_Entry *cte1 = XCHAR_TABLE_ENTRY (obj1);
- struct Lisp_Char_Table_Entry *cte2 = XCHAR_TABLE_ENTRY (obj2);
+ Lisp_Char_Table_Entry *cte1 = XCHAR_TABLE_ENTRY (obj1);
+ Lisp_Char_Table_Entry *cte2 = XCHAR_TABLE_ENTRY (obj2);
int i;
for (i = 0; i < 96; i++)
static unsigned long
char_table_entry_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (obj);
return internal_array_hash (cte->level2, 96, depth);
}
static const struct lrecord_description char_table_entry_description[] = {
- { XD_LISP_OBJECT, offsetof(struct Lisp_Char_Table_Entry, level2), 96 },
+ { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table_Entry, level2), 96 },
{ XD_END }
};
0, char_table_entry_equal,
char_table_entry_hash,
char_table_entry_description,
- struct Lisp_Char_Table_Entry);
+ Lisp_Char_Table_Entry);
#endif /* MULE */
static Lisp_Object
-mark_char_table (Lisp_Object obj, void (*markobj) (Lisp_Object))
+mark_char_table (Lisp_Object obj)
{
- struct Lisp_Char_Table *ct = XCHAR_TABLE (obj);
+ Lisp_Char_Table *ct = XCHAR_TABLE (obj);
int i;
for (i = 0; i < NUM_ASCII_CHARS; i++)
- markobj (ct->ascii[i]);
+ mark_object (ct->ascii[i]);
#ifdef MULE
for (i = 0; i < NUM_LEADING_BYTES; i++)
- markobj (ct->level1[i]);
+ mark_object (ct->level1[i]);
#endif
return ct->mirror_table;
}
and prune_weak_hash_tables(). */
void
-prune_syntax_tables (int (*obj_marked_p) (Lisp_Object))
+prune_syntax_tables (void)
{
Lisp_Object rest, prev = Qnil;
for (rest = Vall_syntax_tables;
- !GC_NILP (rest);
+ !NILP (rest);
rest = XCHAR_TABLE (rest)->next_table)
{
- if (! obj_marked_p (rest))
+ if (! marked_p (rest))
{
/* This table is garbage. Remove it from the list. */
- if (GC_NILP (prev))
+ if (NILP (prev))
Vall_syntax_tables = XCHAR_TABLE (rest)->next_table;
else
XCHAR_TABLE (prev)->next_table =
static void
print_chartab_charset_row (Lisp_Object charset,
int row,
- struct Lisp_Char_Table_Entry *cte,
+ Lisp_Char_Table_Entry *cte,
Lisp_Object printcharfun)
{
int i;
static void
print_chartab_two_byte_charset (Lisp_Object charset,
- struct Lisp_Char_Table_Entry *cte,
+ Lisp_Char_Table_Entry *cte,
Lisp_Object printcharfun)
{
int i;
static void
print_char_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_Char_Table *ct = XCHAR_TABLE (obj);
+ Lisp_Char_Table *ct = XCHAR_TABLE (obj);
char buf[200];
sprintf (buf, "#s(char-table type %s data (",
}
else
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (ann);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (ann);
if (XCHARSET_DIMENSION (charset) == 1)
print_chartab_charset_row (charset, -1, cte, printcharfun);
else
static int
char_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Char_Table *ct1 = XCHAR_TABLE (obj1);
- struct Lisp_Char_Table *ct2 = XCHAR_TABLE (obj2);
+ Lisp_Char_Table *ct1 = XCHAR_TABLE (obj1);
+ Lisp_Char_Table *ct2 = XCHAR_TABLE (obj2);
int i;
if (CHAR_TABLE_TYPE (ct1) != CHAR_TABLE_TYPE (ct2))
static unsigned long
char_table_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Char_Table *ct = XCHAR_TABLE (obj);
+ Lisp_Char_Table *ct = XCHAR_TABLE (obj);
unsigned long hashval = internal_array_hash (ct->ascii, NUM_ASCII_CHARS,
depth);
#ifdef MULE
}
static const struct lrecord_description char_table_description[] = {
- { XD_LISP_OBJECT, offsetof(struct Lisp_Char_Table, ascii), NUM_ASCII_CHARS },
+ { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, ascii), NUM_ASCII_CHARS },
#ifdef MULE
- { XD_LISP_OBJECT, offsetof(struct Lisp_Char_Table, level1), NUM_LEADING_BYTES },
+ { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, level1), NUM_LEADING_BYTES },
#endif
+ { XD_LISP_OBJECT, offsetof (Lisp_Char_Table, mirror_table) },
+ { XD_LO_LINK, offsetof (Lisp_Char_Table, next_table) },
{ XD_END }
};
mark_char_table, print_char_table, 0,
char_table_equal, char_table_hash,
char_table_description,
- struct Lisp_Char_Table);
+ Lisp_Char_Table);
DEFUN ("char-table-p", Fchar_table_p, 1, 1, 0, /*
Return non-nil if OBJECT is a char table.
}
void
-fill_char_table (struct Lisp_Char_Table *ct, Lisp_Object value)
+fill_char_table (Lisp_Char_Table *ct, Lisp_Object value)
{
int i;
*/
(table))
{
- struct Lisp_Char_Table *ct;
+ Lisp_Char_Table *ct;
CHECK_CHAR_TABLE (table);
ct = XCHAR_TABLE (table);
*/
(type))
{
- struct Lisp_Char_Table *ct;
+ Lisp_Char_Table *ct;
Lisp_Object obj;
enum char_table_type ty = symbol_to_char_table_type (type);
- ct = alloc_lcrecord_type (struct Lisp_Char_Table, &lrecord_char_table);
+ ct = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table);
ct->type = ty;
if (ty == CHAR_TABLE_TYPE_SYNTAX)
{
{
Lisp_Object obj;
int i;
- struct Lisp_Char_Table_Entry *cte =
- alloc_lcrecord_type (struct Lisp_Char_Table_Entry,
- &lrecord_char_table_entry);
+ Lisp_Char_Table_Entry *cte =
+ alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
for (i = 0; i < 96; i++)
cte->level2[i] = initval;
static Lisp_Object
copy_char_table_entry (Lisp_Object entry)
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (entry);
Lisp_Object obj;
int i;
- struct Lisp_Char_Table_Entry *ctenew =
- alloc_lcrecord_type (struct Lisp_Char_Table_Entry,
- &lrecord_char_table_entry);
+ Lisp_Char_Table_Entry *ctenew =
+ alloc_lcrecord_type (Lisp_Char_Table_Entry, &lrecord_char_table_entry);
for (i = 0; i < 96; i++)
{
*/
(old_table))
{
- struct Lisp_Char_Table *ct, *ctnew;
+ Lisp_Char_Table *ct, *ctnew;
Lisp_Object obj;
int i;
CHECK_CHAR_TABLE (old_table);
ct = XCHAR_TABLE (old_table);
- ctnew = alloc_lcrecord_type (struct Lisp_Char_Table, &lrecord_char_table);
+ ctnew = alloc_lcrecord_type (Lisp_Char_Table, &lrecord_char_table);
ctnew->type = ct->type;
for (i = 0; i < NUM_ASCII_CHARS; i++)
ctnew->mirror_table = Fcopy_char_table (ct->mirror_table);
else
ctnew->mirror_table = ct->mirror_table;
+ ctnew->next_table = Qnil;
XSETCHAR_TABLE (obj, ctnew);
+ if (ctnew->type == CHAR_TABLE_TYPE_SYNTAX)
+ {
+ ctnew->next_table = Vall_syntax_tables;
+ Vall_syntax_tables = obj;
+ }
return obj;
}
#else /* MULE */
else if (VECTORP (range))
{
- struct Lisp_Vector *vec = XVECTOR (range);
+ Lisp_Vector *vec = XVECTOR (range);
Lisp_Object *elts = vector_data (vec);
if (vector_length (vec) != 2)
signal_simple_error ("Length of charset row vector must be 2",
outrange->charset = Fget_charset (elts[0]);
CHECK_INT (elts[1]);
outrange->row = XINT (elts[1]);
- switch (XCHARSET_TYPE (outrange->charset))
+ if (XCHARSET_DIMENSION (outrange->charset) >= 2)
{
- case CHARSET_TYPE_94:
- case CHARSET_TYPE_96:
- signal_simple_error ("Charset in row vector must be multi-byte",
- outrange->charset);
- case CHARSET_TYPE_94X94:
- check_int_range (outrange->row, 33, 126);
- break;
- case CHARSET_TYPE_96X96:
- check_int_range (outrange->row, 32, 127);
- break;
- default:
- abort ();
+ switch (XCHARSET_CHARS (outrange->charset))
+ {
+ case 94:
+ check_int_range (outrange->row, 33, 126);
+ break;
+ case 96:
+ check_int_range (outrange->row, 32, 127);
+ break;
+ default:
+ abort ();
+ }
}
+ else
+ signal_simple_error ("Charset in row vector must be multi-byte",
+ outrange->charset);
}
else
{
/* called from CHAR_TABLE_VALUE(). */
Lisp_Object
-get_non_ascii_char_table_value (struct Lisp_Char_Table *ct,
- Charset_ID leading_byte, Emchar c)
+get_non_ascii_char_table_value (Lisp_Char_Table *ct, Charset_ID leading_byte,
+ Emchar c)
{
Lisp_Object val;
#ifdef UTF2000
val = ct->level1[leading_byte - MIN_LEADING_BYTE];
if (CHAR_TABLE_ENTRYP (val))
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
val = cte->level2[byte1 - 32];
if (CHAR_TABLE_ENTRYP (val))
{
#endif /* MULE */
Lisp_Object
-get_char_table (Emchar ch, struct Lisp_Char_Table *ct)
+get_char_table (Emchar ch, Lisp_Char_Table *ct)
{
#ifdef MULE
{
val = ct->level1[lb];
if (CHAR_TABLE_ENTRYP (val))
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
val = cte->level2[byte1 - 32];
if (CHAR_TABLE_ENTRYP (val))
{
*/
(ch, table))
{
- struct Lisp_Char_Table *ct;
+ Lisp_Char_Table *ct;
CHECK_CHAR_TABLE (table);
ct = XCHAR_TABLE (table);
*/
(range, table, multi))
{
- struct Lisp_Char_Table *ct;
+ Lisp_Char_Table *ct;
struct chartab_range rainj;
if (CHAR_OR_CHAR_INTP (range))
/* Assign VAL to all characters in RANGE in char table CT. */
void
-put_char_table (struct Lisp_Char_Table *ct, struct chartab_range *range,
+put_char_table (Lisp_Char_Table *ct, struct chartab_range *range,
Lisp_Object val)
{
switch (range->type)
case CHARTAB_RANGE_ROW:
{
- struct Lisp_Char_Table_Entry *cte;
+ Lisp_Char_Table_Entry *cte;
int lb = XCHARSET_LEADING_BYTE (range->charset) - MIN_LEADING_BYTE;
/* make sure that there is a separate entry for the row. */
if (!CHAR_TABLE_ENTRYP (ct->level1[lb]))
ct->ascii[byte1 + 128] = val;
else
{
- struct Lisp_Char_Table_Entry *cte;
+ Lisp_Char_Table_Entry *cte;
int lb = XCHARSET_LEADING_BYTE (charset) - MIN_LEADING_BYTE;
/* make sure that there is a separate entry for the row. */
if (!CHAR_TABLE_ENTRYP (ct->level1[lb]))
*/
(range, val, table))
{
- struct Lisp_Char_Table *ct;
+ Lisp_Char_Table *ct;
struct chartab_range rainj;
CHECK_CHAR_TABLE (table);
/* Map FN over the ASCII chars in CT. */
static int
-map_over_charset_ascii (struct Lisp_Char_Table *ct,
+map_over_charset_ascii (Lisp_Char_Table *ct,
int (*fn) (struct chartab_range *range,
Lisp_Object val, void *arg),
void *arg)
/* Map FN over the Control-1 chars in CT. */
static int
-map_over_charset_control_1 (struct Lisp_Char_Table *ct,
+map_over_charset_control_1 (Lisp_Char_Table *ct,
int (*fn) (struct chartab_range *range,
Lisp_Object val, void *arg),
void *arg)
CTE specifies the char table entry for CHARSET. */
static int
-map_over_charset_row (struct Lisp_Char_Table_Entry *cte,
+map_over_charset_row (Lisp_Char_Table_Entry *cte,
Lisp_Object charset, int row,
int (*fn) (struct chartab_range *range,
Lisp_Object val, void *arg),
static int
-map_over_other_charset (struct Lisp_Char_Table *ct, Charset_ID lb,
+map_over_other_charset (Lisp_Char_Table *ct, Charset_ID lb,
int (*fn) (struct chartab_range *range,
Lisp_Object val, void *arg),
void *arg)
}
{
- struct Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
+ Lisp_Char_Table_Entry *cte = XCHAR_TABLE_ENTRY (val);
int charset94_p = (XCHARSET_CHARS (charset) == 94);
int start = charset94_p ? 33 : 32;
int stop = charset94_p ? 127 : 128;
becomes the return value of map_char_table(). */
int
-map_char_table (struct Lisp_Char_Table *ct,
+map_char_table (Lisp_Char_Table *ct,
struct chartab_range *range,
int (*fn) (struct chartab_range *range,
Lisp_Object val, void *arg),
*/
(function, table, range))
{
- struct Lisp_Char_Table *ct;
+ Lisp_Char_Table *ct;
struct slow_map_char_table_arg slarg;
struct gcpro gcpro1, gcpro2;
struct chartab_range rainj;
unsigned int designator, unsigned int not)
{
REGISTER Lisp_Object temp;
- struct Lisp_Char_Table *ctbl;
+ Lisp_Char_Table *ctbl;
#ifdef ERROR_CHECK_TYPECHECK
if (NILP (Fcategory_table_p (table)))
signal_simple_error ("Expected category table", table);
#define CATEGORYP(x) \
- (CHARP ((x)) && XCHAR ((x)) >= 0x20 && XCHAR ((x)) <= 0x7E)
+ (CHARP (x) && XCHAR (x) >= 0x20 && XCHAR (x) <= 0x7E)
#define CATEGORY_SET(c) \
(get_char_table(c, XCHAR_TABLE(current_buffer->category_table)))
Use the macro WORD_BOUNDARY_P instead of calling this function
directly. */
+int word_boundary_p (Emchar c1, Emchar c2);
int
word_boundary_p (Emchar c1, Emchar c2)
{
void
syms_of_chartab (void)
{
+ INIT_LRECORD_IMPLEMENTATION (char_table);
+
#ifdef MULE
+ INIT_LRECORD_IMPLEMENTATION (char_table_entry);
+
defsymbol (&Qcategory_table_p, "category-table-p");
defsymbol (&Qcategory_designator_p, "category-designator-p");
defsymbol (&Qcategory_table_value_p, "category-table-value-p");
{
/* DO NOT staticpro this. It works just like Vweak_hash_tables. */
Vall_syntax_tables = Qnil;
+ pdump_wire_list (&Vall_syntax_tables);
}
void