+static Lisp_Object
+find_char_feature_in_family (Lisp_Object character,
+ Lisp_Object con_feature,
+ Lisp_Object feature,
+ Lisp_Object feature_rel_max)
+{
+ Lisp_Object ancestors
+ = Fget_char_attribute (character, con_feature, Qnil);
+#if 0
+
+ while (!NILP (ancestors))
+ {
+ Lisp_Object ancestor = XCAR (ancestors);
+ Lisp_Object ret;
+
+ if (EQ (ancestor, character))
+ return Qunbound;
+
+ ret = Fchar_feature (ancestor, feature, Qunbound,
+ Qnil, make_int (0));
+ if (!UNBOUNDP (ret))
+ return ret;
+
+ ancestors = XCDR (ancestors);
+
+ ret = Fget_char_attribute (ancestor, Q_subsumptive_from, Qnil);
+ if (!NILP (ret))
+ ancestors = nconc2 (Fcopy_sequence (ancestors), ret);
+
+ ret = Fget_char_attribute (ancestor, Q_denotational_from, Qnil);
+ if (!NILP (ret))
+ ancestors = nconc2 (Fcopy_sequence (ancestors), ret);
+ }
+#else
+ Lisp_Object ancestor;
+
+ if (CONSP (ancestors))
+ ancestor = XCAR (ancestors);
+ else
+ ancestor = ancestors;
+
+ if (!NILP (ancestor))
+ {
+ Lisp_Object ret;
+ Lisp_Object anc;
+
+ if (EQ (ancestor, character))
+ return Qunbound;
+
+ ret = Fchar_feature (ancestor, feature, Qunbound,
+ Qnil, make_int (0));
+ if (!UNBOUNDP (ret))
+ return ret;
+
+ ret = find_char_feature_in_family (ancestor, Q_subsumptive_from,
+ feature, feature_rel_max);
+ if (!UNBOUNDP (ret))
+ return ret;
+
+ ret = find_char_feature_in_family (ancestor, Q_denotational_from,
+ feature, feature_rel_max);
+ if (!UNBOUNDP (ret))
+ return ret;
+ }
+#endif
+ return Qunbound;
+}
+
+DEFUN ("char-feature", Fchar_feature, 2, 5, 0, /*
+Return the value of CHARACTER's FEATURE.
+Return DEFAULT-VALUE if the value is not exist.
+*/
+ (character, attribute, default_value,
+ feature_rel_max, char_rel_max))
+{
+ Lisp_Object ret
+ = Fget_char_attribute (character, attribute, Qunbound);
+
+ if (!UNBOUNDP (ret))
+ return ret;
+
+#if 0
+ if (NILP (feature_rel_max)
+ || (INTP (feature_rel_max) &&
+ XINT (feature_rel_max) > 0))
+ {
+ Lisp_String* name = symbol_name (XSYMBOL (attribute));
+ Bufbyte *name_str = string_data (name);
+
+ if (name_str[0] == '=' && name_str[1] == '>')
+ {
+ Bytecount length = string_length (name) - 1;
+ Lisp_Object map_to = make_uninit_string (length);
+
+ memcpy (XSTRING_DATA (map_to) + 1, name_str + 2, length - 1);
+ XSTRING_DATA(map_to)[0] = '=';
+ ret = Fchar_feature (character, Fintern (map_to, Qnil),
+ Qunbound,
+ NILP (feature_rel_max)
+ ? feature_rel_max
+ : make_int (XINT (feature_rel_max) - 1),
+ char_rel_max);
+ if (!UNBOUNDP (ret))
+ return ret;
+ }
+ }
+#endif
+
+ if ( !(EQ (attribute, Q_identical)) &&
+ !(EQ (attribute, Q_subsumptive_from)) &&
+ !(EQ (attribute, Q_denotational_from)) &&
+ ( (NILP (char_rel_max)
+ || (INTP (char_rel_max) &&
+ XINT (char_rel_max) > 0)) ) )
+ {
+#if 0
+ Lisp_String* name = symbol_name (XSYMBOL (attribute));
+ Bufbyte *name_str = string_data (name);
+
+ if ( (name_str[0] != '=') || (name_str[1] == '>') )
+ {
+#endif
+ ret = find_char_feature_in_family (character, Q_identical,
+ attribute, feature_rel_max);
+ if (!UNBOUNDP (ret))
+ return ret;
+
+ ret = find_char_feature_in_family (character, Q_subsumptive_from,
+ attribute, feature_rel_max);
+ if (!UNBOUNDP (ret))
+ return ret;
+
+ ret = find_char_feature_in_family (character, Q_denotational_from,
+ attribute, feature_rel_max);
+ if (!UNBOUNDP (ret))
+ return ret;
+#if 0
+ }
+#endif
+ }
+ return default_value;
+}
+
+Lisp_Object
+put_char_composition (Lisp_Object character, Lisp_Object value);
+Lisp_Object