+#ifdef HAVE_DATABASE
+extern Lisp_Object Qsystem_char_id;
+
+Lisp_Object
+char_attribute_system_db_file (Lisp_Object key_type, Lisp_Object attribute,
+ int writing_mode);
+
+Lisp_Object load_char_attribute_maybe (Emchar ch, Lisp_Object attribute);
+#endif
+
+INLINE_HEADER Lisp_Object get_char_id_table (Lisp_Char_Table* cit, Emchar ch);
+INLINE_HEADER Lisp_Object
+get_char_id_table (Lisp_Char_Table* cit, Emchar ch)
+{
+ Lisp_Object val = get_byte_table (get_byte_table
+ (get_byte_table
+ (get_byte_table
+ (cit->table,
+ (unsigned char)(ch >> 24)),
+ (unsigned char) (ch >> 16)),
+ (unsigned char) (ch >> 8)),
+ (unsigned char) ch);
+#ifdef HAVE_DATABASE
+ if (EQ (val, Qunloaded))
+ {
+ Lisp_Object attribute = CHAR_TABLE_NAME (cit);
+
+ if (!NILP (attribute))
+ val = load_char_attribute_maybe (ch, attribute);
+ else
+ val = Qunbound;
+ put_char_id_table_0 (cit, ch, val);
+ }
+#endif
+ if (UNBOUNDP (val))
+ return cit->default_value;
+ else
+ return val;
+}
+