-Lisp_Object
-get_char_id_table (Emchar ch, Lisp_Object table)
-{
- unsigned int code = ch;
-
- return
- get_byte_table
- (get_byte_table
- (get_byte_table
- (get_byte_table
- (XCHAR_ID_TABLE (table)->table,
- (unsigned char)(code >> 24)),
- (unsigned char) (code >> 16)),
- (unsigned char) (code >> 8)),
- (unsigned char) code);
-}
-
-void
-put_char_id_table (Emchar ch, Lisp_Object value, Lisp_Object table)
-{
- unsigned int code = ch;
- Lisp_Object table1, table2, table3, table4;
-
- table1 = XCHAR_ID_TABLE (table)->table;
- table2 = get_byte_table (table1, (unsigned char)(code >> 24));
- table3 = get_byte_table (table2, (unsigned char)(code >> 16));
- table4 = get_byte_table (table3, (unsigned char)(code >> 8));
-
- table4 = put_byte_table (table4, (unsigned char)code, value);
- table3 = put_byte_table (table3, (unsigned char)(code >> 8), table4);
- table2 = put_byte_table (table2, (unsigned char)(code >> 16), table3);
- XCHAR_ID_TABLE (table)->table
- = put_byte_table (table1, (unsigned char)(code >> 24), table2);
-}
-
-/* Map FN (with client data ARG) in char table CT.
- Mapping stops the first time FN returns non-zero, and that value
- becomes the return value of map_char_id_table(). */
-int
-map_char_id_table (Lisp_Char_ID_Table *ct,
- int (*fn) (struct chartab_range *range,
- Lisp_Object val, void *arg),
- void *arg);
-int
-map_char_id_table (Lisp_Char_ID_Table *ct,
- int (*fn) (struct chartab_range *range,
- Lisp_Object val, void *arg),
- void *arg)
-{
- Lisp_Object v = ct->table;
-
- if (UINT8_BYTE_TABLE_P (v))
- return map_over_uint8_byte_table (XUINT8_BYTE_TABLE(v), fn, arg, 0, 3);
- else if (UINT16_BYTE_TABLE_P (v))
- return map_over_uint16_byte_table (XUINT16_BYTE_TABLE(v), fn, arg, 0, 3);
- else if (BYTE_TABLE_P (v))
- return map_over_byte_table (XBYTE_TABLE(v), fn, arg, 0, 3);
- else if (!UNBOUNDP (v))
- {
- struct chartab_range rainj;
- int unit = 1 << 24;
- Emchar c = 0;
- Emchar c1 = c + unit;
- int retval;
-
- rainj.type = CHARTAB_RANGE_CHAR;
-
- for (retval = 0; c < c1 && retval == 0; c++)
- {
- rainj.ch = c;
- retval = (fn) (&rainj, v, arg);
- }
- }
- return 0;
-}
-
-