From: tomo Date: Tue, 12 Feb 2002 15:38:20 +0000 (+0000) Subject: (Fsave_charset_mapping_table): Fixed. X-Git-Tag: r21-2-44-lazy-n7c~118 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=22683c840c94442b9c8d0453d43afe21f0540177;p=chise%2Fxemacs-chise.git (Fsave_charset_mapping_table): Fixed. (load_char_decoding_entry_maybe): New function. --- diff --git a/src/mule-charset.c b/src/mule-charset.c index 0abf730..c072f4a 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -2140,6 +2140,7 @@ Save mapping-table of CHARSET. } } } + break; default: { Lisp_Object table_g = XCHARSET_DECODING_TABLE (charset); @@ -2188,6 +2189,39 @@ Save mapping-table of CHARSET. return Qnil; #endif } + +Emchar +load_char_decoding_entry_maybe (Lisp_Object ccs, int code_point) +{ + Lisp_Object db; + Lisp_Object db_dir = Vexec_directory; + Lisp_Object db_file; + + if (NILP (db_dir)) + db_dir = build_string ("../lib-src"); + db_dir = Fexpand_file_name (build_string ("char-db"), db_dir); + db_dir = Fexpand_file_name (Fsymbol_name (XCHARSET_NAME (ccs)), db_dir); + db_file = Fexpand_file_name (build_string ("system-char-id"), db_dir); + db = Fopen_database (db_file, Qnil, Qnil, Qnil, Qnil); + if (!NILP (db)) + { + Lisp_Object ret + = Fget_database (Fprin1_to_string (make_int (code_point), Qnil), + db, Qnil); + if (!NILP (ret)) + { + ret = Fread (ret); + if (CHARP (ret)) + { + decoding_table_put_char (ccs, code_point, ret); + Fclose_database (db); + return XCHAR (ret); + } + } + Fclose_database (db); + } + return -1; +} #endif