+
+static Lisp_Object
+mark_char_code_table (Lisp_Object obj, void (*markobj) (Lisp_Object))
+{
+ struct Lisp_Char_Code_Table *cte = XCHAR_CODE_TABLE (obj);
+
+ return cte->table;
+}
+
+static int
+char_code_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+{
+ struct Lisp_Char_Code_Table *cte1 = XCHAR_CODE_TABLE (obj1);
+ struct Lisp_Char_Code_Table *cte2 = XCHAR_CODE_TABLE (obj2);
+
+ return char_byte_table_equal (cte1->table, cte2->table, depth + 1);
+}
+
+static unsigned long
+char_code_table_hash (Lisp_Object obj, int depth)
+{
+ struct Lisp_Char_Code_Table *cte = XCHAR_CODE_TABLE (obj);
+
+ return char_code_table_hash (cte->table, depth + 1);
+}
+
+static const struct lrecord_description char_code_table_description[] = {
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Char_Code_Table, table), 1 },
+ { XD_END }
+};
+
+DEFINE_LRECORD_IMPLEMENTATION ("char-code-table", char_code_table,
+ mark_char_code_table,
+ internal_object_printer,
+ 0, char_code_table_equal,
+ char_code_table_hash,
+ char_code_table_description,
+ struct Lisp_Char_Code_Table);
+
+static Lisp_Object
+make_char_code_table (Lisp_Object initval)
+{
+ Lisp_Object obj;
+ struct Lisp_Char_Code_Table *cte =
+ alloc_lcrecord_type (struct Lisp_Char_Code_Table,
+ &lrecord_char_code_table);
+
+ cte->table = make_char_byte_table (initval);
+
+ XSETCHAR_CODE_TABLE (obj, cte);
+ return obj;
+}
+
+static Lisp_Object
+copy_char_code_table (Lisp_Object entry)
+{
+ struct Lisp_Char_Code_Table *cte = XCHAR_CODE_TABLE (entry);
+ Lisp_Object obj;
+ struct Lisp_Char_Code_Table *ctenew =
+ alloc_lcrecord_type (struct Lisp_Char_Code_Table,
+ &lrecord_char_code_table);
+
+ ctenew->table = copy_char_byte_table (cte->table);
+ XSETCHAR_CODE_TABLE (obj, ctenew);
+ return obj;
+}
+