+static int
+char_id_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+{
+ Lisp_Object table1 = XCHAR_ID_TABLE (obj1)->table;
+ Lisp_Object table2 = XCHAR_ID_TABLE (obj2)->table;
+ int i;
+
+ for (i = 0; i < 256; i++)
+ {
+ if (!internal_equal (get_byte_table (table1, i),
+ get_byte_table (table2, i), 0))
+ return 0;
+ }
+ return -1;
+}
+
+static unsigned long
+char_id_table_hash (Lisp_Object obj, int depth)
+{
+ Lisp_Char_ID_Table *cte = XCHAR_ID_TABLE (obj);
+
+ return char_id_table_hash (cte->table, depth + 1);
+}
+
+static const struct lrecord_description char_id_table_description[] = {
+ { XD_LISP_OBJECT, offsetof(Lisp_Char_ID_Table, table) },
+ { XD_END }
+};
+
+DEFINE_LRECORD_IMPLEMENTATION ("char-id-table", char_id_table,
+ mark_char_id_table,
+ print_char_id_table,
+ 0, char_id_table_equal,
+ char_id_table_hash,
+ char_id_table_description,
+ Lisp_Char_ID_Table);
+
+static Lisp_Object
+make_char_id_table (Lisp_Object initval)
+{
+ Lisp_Object obj;
+ Lisp_Char_ID_Table *cte;
+
+ cte = alloc_lcrecord_type (Lisp_Char_ID_Table, &lrecord_char_id_table);
+
+ cte->table = make_byte_table (initval);
+
+ XSETCHAR_ID_TABLE (obj, cte);
+ return obj;
+}
+
+
+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);
+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);
+}
+
+
+Lisp_Object Vchar_attribute_hash_table;