X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fmule-charset.c;h=91376d7f242574ab819526af348b4e33a1c3d441;hb=2cbece6401b2279497293e6dc54cda607f49db2f;hp=e58ff517495af50b43670802f9b8f228521d9900;hpb=db6151db83fb17cb7992d85ab80d3669eff34920;p=chise%2Fxemacs-chise.git- diff --git a/src/mule-charset.c b/src/mule-charset.c index e58ff51..91376d7 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -426,6 +426,7 @@ Lisp_Object Vcharacter_name_table; Lisp_Object Vcharacter_ideographic_radical_table; Lisp_Object Vcharacter_ideographic_strokes_table; Lisp_Object Vcharacter_total_strokes_table; +Lisp_Object Vcharacter_morohashi_daikanwa_table; Lisp_Object Vcharacter_decomposition_table; Lisp_Object Vcharacter_composition_table; Lisp_Object Vcharacter_variant_table; @@ -433,6 +434,8 @@ Lisp_Object Vcharacter_variant_table; Lisp_Object Qname; Lisp_Object Qideographic_radical, Qideographic_strokes; Lisp_Object Qtotal_strokes; +Lisp_Object Qmorohashi_daikanwa; +Lisp_Object Qideograph_daikanwa; Lisp_Object Q_decomposition; Lisp_Object Qucs; Lisp_Object Q_ucs; @@ -558,6 +561,7 @@ Return the alist of attributes of CHARACTER. (character)) { Lisp_Object alist, ret; + int i; CHECK_CHAR (character); alist = Fcopy_alist (get_char_id_table (XCHAR (character), @@ -582,10 +586,41 @@ Return the alist of attributes of CHARACTER. alist = Fcons (Fcons (Qtotal_strokes, ret), alist); ret = get_char_id_table (XCHAR (character), + Vcharacter_morohashi_daikanwa_table); + if (!NILP (ret)) + alist = Fcons (Fcons (Qmorohashi_daikanwa, ret), alist); + + ret = get_char_id_table (XCHAR (character), Vcharacter_decomposition_table); if (!NILP (ret)) alist = Fcons (Fcons (Q_decomposition, ret), alist); + for (i = 0; i < countof (chlook->charset_by_leading_byte); i++) + { + Lisp_Object ccs = chlook->charset_by_leading_byte[i]; + + if (!NILP (ccs)) + { +#if 0 + int code_point = charset_code_point (ccs, XCHAR (character)); + + if (code_point >= 0) + { + alist = Fcons (Fcons (ccs, make_int (code_point)), alist); + } +#else + Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (ccs); + Lisp_Object cpos; + + if ( CHAR_ID_TABLE_P (encoding_table) + && INTP (cpos = get_char_id_table (XCHAR (character), + encoding_table)) ) + { + alist = Fcons (Fcons (ccs, cpos), alist); + } +#endif + } + } return alist; } @@ -625,6 +660,11 @@ Return the value of CHARACTER's ATTRIBUTE. return get_char_id_table (XCHAR (character), Vcharacter_total_strokes_table); } + else if (EQ (attribute, Qmorohashi_daikanwa)) + { + return get_char_id_table (XCHAR (character), + Vcharacter_morohashi_daikanwa_table); + } else if (EQ (attribute, Q_decomposition)) { return get_char_id_table (XCHAR (character), @@ -682,6 +722,13 @@ Store CHARACTER's ATTRIBUTE with VALUE. Vcharacter_total_strokes_table); return value; } + else if (EQ (attribute, Qmorohashi_daikanwa)) + { + CHECK_LIST (value); + put_char_id_table (XCHAR (character), value, + Vcharacter_morohashi_daikanwa_table); + return value; + } else if (EQ (attribute, Q_decomposition)) { Lisp_Object seq; @@ -1052,6 +1099,7 @@ Store character's ATTRIBUTES. Lisp_Object rest = attributes; Lisp_Object code = Fcdr (Fassq (Qucs, attributes)); Lisp_Object character; + Lisp_Object daikanwa = Qnil; if (NILP (code)) { @@ -1095,10 +1143,30 @@ Store character's ATTRIBUTES. while (CONSP (rest)) { Lisp_Object cell = Fcar (rest); + Lisp_Object key = Fcar (cell); + Lisp_Object value = Fcdr (cell); if (!LISTP (cell)) signal_simple_error ("Invalid argument", attributes); + + if (EQ (key, Qmorohashi_daikanwa)) + { + size_t len; + GET_EXTERNAL_LIST_LENGTH (value, len); + + if (len == 1) + { + if (NILP (daikanwa)) + daikanwa = Fcdr (Fassq (Qideograph_daikanwa, rest)); + if (EQ (Fcar (value), daikanwa)) + goto ignored; + } + } + else if (EQ (key, Qideograph_daikanwa)) + daikanwa = value; + Fput_char_attribute (character, Fcar (cell), Fcdr (cell)); + ignored: rest = Fcdr (rest); } return @@ -1151,7 +1219,6 @@ Lisp_Object Qascii, Qlatin_viscii_upper, Qvietnamese_viscii_lower, Qvietnamese_viscii_upper, - Qideograph_daikanwa, Qmojikyo, Qmojikyo_pj_1, Qmojikyo_pj_2, @@ -2113,7 +2180,7 @@ add_charset_to_list_mapper (Lisp_Object key, Lisp_Object value, (struct charset_list_closure*) charset_list_closure; Lisp_Object *charset_list = chcl->charset_list; - *charset_list = Fcons (XCHARSET_NAME (value), *charset_list); + *charset_list = Fcons (key /* XCHARSET_NAME (value) */, *charset_list); return 0; } @@ -3030,6 +3097,7 @@ syms_of_mule_charset (void) defsymbol (&Qideographic_radical, "ideographic-radical"); defsymbol (&Qideographic_strokes, "ideographic-strokes"); defsymbol (&Qtotal_strokes, "total-strokes"); + defsymbol (&Qmorohashi_daikanwa, "morohashi-daikanwa"); defsymbol (&Q_ucs, "->ucs"); defsymbol (&Q_decomposition, "->decomposition"); defsymbol (&Qcompat, "compat"); @@ -3131,7 +3199,7 @@ Leading-code of private TYPE9N charset of column-width 1. #endif #ifdef UTF2000 - Vutf_2000_version = build_string("0.15 (Sangō)"); + Vutf_2000_version = build_string("0.16 (Ōji)"); DEFVAR_LISP ("utf-2000-version", &Vutf_2000_version /* Version number of UTF-2000. */ ); @@ -3151,6 +3219,9 @@ Version number of UTF-2000. /* staticpro (&Vcharacter_total_strokes_table); */ Vcharacter_total_strokes_table = make_char_id_table (Qnil, -1); + staticpro (&Vcharacter_morohashi_daikanwa_table); + Vcharacter_morohashi_daikanwa_table = make_char_id_table (Qnil, 0); + /* staticpro (&Vcharacter_decomposition_table); */ Vcharacter_decomposition_table = make_char_id_table (Qnil, -1);