+#endif
+
+#ifdef UTF2000
+static Lisp_Object
+mark_char_byte_table (Lisp_Object obj, void (*markobj) (Lisp_Object))
+{
+ struct Lisp_Char_Byte_Table *cte = XCHAR_BYTE_TABLE (obj);
+ int i;
+
+ for (i = 0; i < 256; i++)
+ {
+ markobj (cte->property[i]);
+ }
+ return Qnil;
+}
+
+static int
+char_byte_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+{
+ struct Lisp_Char_Byte_Table *cte1 = XCHAR_BYTE_TABLE (obj1);
+ struct Lisp_Char_Byte_Table *cte2 = XCHAR_BYTE_TABLE (obj2);
+ int i;
+
+ for (i = 0; i < 256; i++)
+ if (CHAR_BYTE_TABLE_P (cte1->property[i]))
+ {
+ if (CHAR_BYTE_TABLE_P (cte2->property[i]))
+ {
+ if (!char_byte_table_equal (cte1->property[i],
+ cte2->property[i], depth + 1))
+ return 0;
+ }
+ else
+ return 0;
+ }
+ else
+ if (!internal_equal (cte1->property[i], cte2->property[i], depth + 1))
+ return 0;
+ return 1;
+}
+
+static unsigned long
+char_byte_table_hash (Lisp_Object obj, int depth)
+{
+ struct Lisp_Char_Byte_Table *cte = XCHAR_BYTE_TABLE (obj);
+
+ return internal_array_hash (cte->property, 256, depth);
+}
+
+static const struct lrecord_description char_byte_table_description[] = {
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Char_Byte_Table, property), 256 },
+ { XD_END }
+};
+
+DEFINE_LRECORD_IMPLEMENTATION ("char-code-table", char_byte_table,
+ mark_char_byte_table,
+ internal_object_printer,
+ 0, char_byte_table_equal,
+ char_byte_table_hash,
+ char_byte_table_description,
+ struct Lisp_Char_Byte_Table);
+
+
+static Lisp_Object
+make_char_byte_table (Lisp_Object initval)
+{
+ Lisp_Object obj;
+ int i;
+ struct Lisp_Char_Byte_Table *cte =
+ alloc_lcrecord_type (struct Lisp_Char_Byte_Table,
+ &lrecord_char_byte_table);
+
+ for (i = 0; i < 256; i++)
+ cte->property[i] = initval;
+
+ XSETCHAR_BYTE_TABLE (obj, cte);
+ return obj;
+}
+
+static Lisp_Object
+copy_char_byte_table (Lisp_Object entry)
+{
+ struct Lisp_Char_Byte_Table *cte = XCHAR_BYTE_TABLE (entry);
+ Lisp_Object obj;
+ int i;
+ struct Lisp_Char_Byte_Table *ctenew =
+ alloc_lcrecord_type (struct Lisp_Char_Byte_Table,
+ &lrecord_char_byte_table);
+
+ for (i = 0; i < 256; i++)
+ {
+ Lisp_Object new = cte->property[i];
+ if (CHAR_BYTE_TABLE_P (new))
+ ctenew->property[i] = copy_char_byte_table (new);
+ else
+ ctenew->property[i] = new;
+ }
+
+ XSETCHAR_BYTE_TABLE (obj, ctenew);
+ return obj;
+}
+
+#define make_char_code_table(initval) make_char_byte_table(initval)
+
+Lisp_Object
+get_char_code_table (Emchar ch, Lisp_Object table)
+{
+ struct Lisp_Char_Byte_Table* cpt = XCHAR_BYTE_TABLE (table);
+ Lisp_Object ret = cpt->property [ch >> 24];
+
+ if (CHAR_BYTE_TABLE_P (ret))
+ cpt = XCHAR_BYTE_TABLE (ret);
+ else
+ return ret;
+
+ ret = cpt->property [(unsigned char) (ch >> 16)];
+ if (CHAR_BYTE_TABLE_P (ret))
+ cpt = XCHAR_BYTE_TABLE (ret);
+ else
+ return ret;
+
+ ret = cpt->property [(unsigned char) (ch >> 8)];
+ if (CHAR_BYTE_TABLE_P (ret))
+ cpt = XCHAR_BYTE_TABLE (ret);
+ else
+ return ret;
+
+ return cpt->property [(unsigned char) ch];
+}
+
+void
+put_char_code_table (Emchar ch, Lisp_Object value, Lisp_Object table)
+{
+ struct Lisp_Char_Byte_Table* cpt1 = XCHAR_BYTE_TABLE (table);
+ Lisp_Object ret = cpt1->property[ch >> 24];
+
+ if (CHAR_BYTE_TABLE_P (ret))
+ {
+ struct Lisp_Char_Byte_Table* cpt2 = XCHAR_BYTE_TABLE (ret);
+
+ ret = cpt2->property[(unsigned char)(ch >> 16)];
+ if (CHAR_BYTE_TABLE_P (ret))
+ {
+ struct Lisp_Char_Byte_Table* cpt3 = XCHAR_BYTE_TABLE (ret);
+
+ ret = cpt3->property[(unsigned char)(ch >> 8)];
+ if (CHAR_BYTE_TABLE_P (ret))
+ {
+ struct Lisp_Char_Byte_Table* cpt4
+ = XCHAR_BYTE_TABLE (ret);
+
+ cpt4->property[(unsigned char)ch] = value;
+ }
+ else if (!EQ (ret, value))
+ {
+ Lisp_Object cpt4 = make_char_byte_table (ret);
+
+ XCHAR_BYTE_TABLE(cpt4)->property[(unsigned char)ch] = value;
+ cpt3->property[(unsigned char)(ch >> 8)] = cpt4;
+ }
+ }
+ else if (!EQ (ret, value))
+ {
+ Lisp_Object cpt3 = make_char_byte_table (ret);
+ Lisp_Object cpt4 = make_char_byte_table (ret);
+
+ XCHAR_BYTE_TABLE(cpt4)->property[(unsigned char)ch] = value;
+ XCHAR_BYTE_TABLE(cpt3)->property[(unsigned char)(ch >> 8)]
+ = cpt4;
+ cpt2->property[(unsigned char)(ch >> 16)] = cpt3;
+ }
+ }
+ else if (!EQ (ret, value))
+ {
+ Lisp_Object cpt2 = make_char_byte_table (ret);
+ Lisp_Object cpt3 = make_char_byte_table (ret);
+ Lisp_Object cpt4 = make_char_byte_table (ret);
+
+ XCHAR_BYTE_TABLE(cpt4)->property[(unsigned char)ch] = value;
+ XCHAR_BYTE_TABLE(cpt3)->property[(unsigned char)(ch >> 8)] = cpt4;
+ XCHAR_BYTE_TABLE(cpt2)->property[(unsigned char)(ch >> 16)] = cpt3;
+ cpt1->property[(unsigned char)(ch >> 24)] = cpt2;
+ }
+}
+
+
+Lisp_Object Vcharacter_attribute_table;
+
+DEFUN ("char-attribute-alist", Fchar_attribute_alist, 1, 1, 0, /*
+Return the alist of attributes of CHARACTER.
+*/
+ (character))
+{
+ return get_char_code_table (XCHAR (character), Vcharacter_attribute_table);
+}
+
+DEFUN ("get-char-attribute", Fget_char_attribute, 2, 2, 0, /*
+Return the value of CHARACTER's ATTRIBUTE.
+*/
+ (character, attribute))
+{
+ Lisp_Object ret
+ = get_char_code_table (XCHAR (character), Vcharacter_attribute_table);
+
+ if (EQ (ret, Qnil))
+ return Qnil;
+
+ return Fcdr (Fassq (attribute, ret));
+}
+
+DEFUN ("put-char-attribute", Fput_char_attribute, 3, 3, 0, /*
+Store CHARACTER's ATTRIBUTE with VALUE.
+*/
+ (character, attribute, value))
+{
+ Emchar char_code = XCHAR (character);
+ Lisp_Object ret
+ = get_char_code_table (char_code, Vcharacter_attribute_table);
+ Lisp_Object cell = Fassq (attribute, ret);
+
+ if (EQ (cell, Qnil))
+ ret = Fcons (Fcons (attribute, value), ret);
+ else
+ Fsetcdr (cell, value);
+ put_char_code_table (char_code, ret, Vcharacter_attribute_table);
+ return ret;
+}
+
+
+Lisp_Object Vutf_2000_version;
+#endif
+
+#ifndef UTF2000
+int leading_code_private_11;
+#endif