From c85646be9e6961fe9a569f774421de07d30ba77d Mon Sep 17 00:00:00 2001 From: tomo Date: Fri, 15 Mar 2002 08:41:52 +0000 Subject: [PATCH] Merge r21-2-44-lazy-n7c. --- ChangeLog | 10 + Makefile.in.in | 5 + configure | 86 +++--- configure.in | 3 + lisp/ChangeLog | 21 ++ lisp/dumped-lisp.el | 304 +--------------------- lisp/update-elc.el | 5 + lisp/utf-2000/ChangeLog | 74 ++++++ lisp/utf-2000/char-db-util.el | 70 ++--- lisp/utf-2000/dumped-chars.el | 301 +++++++++++++++++++++ lisp/utf-2000/update-cdb.el | 93 +++++++ src/ChangeLog | 267 +++++++++++++++++++ src/char-ucs.h | 183 ++++++++++--- src/chartab.c | 576 ++++++++++++++++++++++++++++++++++++++--- src/chartab.h | 72 ++++-- src/config.h.in | 5 + src/data.c | 3 + src/database.c | 4 +- src/database.h | 6 + src/lisp.h | 3 + src/mule-charset.c | 205 +++++++++++++-- src/mule.c | 4 + src/symbols.c | 5 + 23 files changed, 1810 insertions(+), 495 deletions(-) create mode 100644 lisp/utf-2000/dumped-chars.el create mode 100644 lisp/utf-2000/update-cdb.el diff --git a/ChangeLog b/ChangeLog index 5b8514c..260edeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-03-11 MORIOKA Tomohiko + + * Makefile.in.in (COPYDIR): Add ${srcdir}/lib-src/char-db if + HAVE_CHISE_CLIENT is defined. + (COPYDESTS): Add ${archlibdir}/char-db if HAVE_CHISE_CLIENT is + defined. + + * configure.in: Define HAVE_CHISE_CLIENT when HAVE_DATABASE and + UTF2000 are defined. + 2001-12-09 MORIOKA Tomohiko * configure.in: Don't define `HAVE_GGC' in XEmacs UTF-2000. diff --git a/Makefile.in.in b/Makefile.in.in index c81def8..31e8ce8 100644 --- a/Makefile.in.in +++ b/Makefile.in.in @@ -239,8 +239,13 @@ INSTALL_ARCH_DEP_SUBDIR = @INSTALL_ARCH_DEP_SUBDIR@ ## When installing the info files, we need to do special things to ## avoid nuking an existing dir file, so we don't do that here; ## instead, we have written out explicit code in the `install' targets. +#ifdef HAVE_CHISE_CLIENT +COPYDIR = ${srcdir}/etc ${srcdir}/lisp ${srcdir}/lib-src/char-db +COPYDESTS = ${etcdir} ${lispdir} ${archlibdir}/char-db +#else COPYDIR = ${srcdir}/etc ${srcdir}/lisp COPYDESTS = ${etcdir} ${lispdir} +#endif GENERATED_HEADERS = src/paths.h src/Emacs.ad.h src/config.h lwlib/config.h src/sheap-adjust.h GENERATED_LISP = lisp/finder-inf.el diff --git a/configure b/configure index b1f640a..29d61d5 100755 --- a/configure +++ b/configure @@ -13528,17 +13528,27 @@ EOF extra_objs="$extra_objs database.o" && if test "$extra_verbose" = "yes"; then echo " xemacs will be linked with \"database.o\"" fi + if test "$with_utf_2000" = "yes"; then + { test "$extra_verbose" = "yes" && cat << \EOF + Defining HAVE_CHISE_CLIENT +EOF +cat >> confdefs.h <<\EOF +#define HAVE_CHISE_CLIENT 1 +EOF +} + + fi fi if test "$with_socks" = "yes"; then echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6 -echo "configure:13537: checking for SOCKSinit in -lsocks" >&5 +echo "configure:13547: checking for SOCKSinit in -lsocks" >&5 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'` xe_check_libs=" -lsocks " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13604,22 +13614,22 @@ fi if test "$with_modules" != "no"; then echo "checking for module support" 1>&6 -echo "configure:13608: checking for module support" >&5 +echo "configure:13618: checking for module support" >&5 if test "$with_msw" = "yes"; then have_dl=yes; else ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:13615: checking for dlfcn.h" >&5 +echo "configure:13625: checking for dlfcn.h" >&5 cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13636,16 +13646,16 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 -echo "configure:13640: checking for dlopen in -lc" >&5 +echo "configure:13650: checking for dlopen in -lc" >&5 cat > conftest.$ac_ext < int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:13649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -13654,18 +13664,18 @@ else rm -rf conftest* echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:13658: checking for dlopen in -ldl" >&5 +echo "configure:13668: checking for dlopen in -ldl" >&5 ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext < int main() { dlopen ("", 0); ; return 0; } EOF -if { (eval echo configure:13669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* have_dl=yes else @@ -13694,12 +13704,12 @@ EOF else echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:13698: checking for shl_load in -ldld" >&5 +echo "configure:13708: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13737,12 +13747,12 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 -echo "configure:13741: checking for dld_init in -ldld" >&5 +echo "configure:13751: checking for dld_init in -ldld" >&5 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` xe_check_libs=" -ldld " cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -13798,7 +13808,7 @@ xehost=$canonical xealias=$internal_configuration echo "checking how to build dynamic libraries for ${xehost}" 1>&6 -echo "configure:13802: checking how to build dynamic libraries for ${xehost}" >&5 +echo "configure:13812: checking how to build dynamic libraries for ${xehost}" >&5 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. case "$xehost" in *-*-linux-gnu*) ;; @@ -13826,9 +13836,9 @@ if test "$GCC" = "yes"; then XEGCC=yes else echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:13830: checking checking whether we are using GNU C" >&5 +echo "configure:13840: checking checking whether we are using GNU C" >&5 cat > conftest.$ac_ext <&6 -echo "configure:13854: checking how to produce PIC code" >&5 +echo "configure:13864: checking how to produce PIC code" >&5 wl= can_build_shared=yes @@ -13946,18 +13956,18 @@ if test -n "$dll_cflags"; then # Check to make sure the dll_cflags actually works. echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6 -echo "configure:13950: checking if PIC flag ${dll_cflags} really works" >&5 +echo "configure:13960: checking if PIC flag ${dll_cflags} really works" >&5 save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $dll_cflags -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also @@ -13988,7 +13998,7 @@ cc_produces_so=no xldf= xcldf= echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6 -echo "configure:13992: checking if C compiler can produce shared libraries" >&5 +echo "configure:14002: checking if C compiler can produce shared libraries" >&5 if test "$XEGCC" = yes; then xcldf="-shared" xldf="-shared" @@ -14039,14 +14049,14 @@ if test -n "$xcldf"; then xe_libs= ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5' cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cc_produces_so=yes else @@ -14071,7 +14081,7 @@ if test -z "$LTLD"; then if test "$XEGCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:14075: checking for ld used by GCC" >&5 +echo "configure:14085: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -14096,7 +14106,7 @@ echo "configure:14075: checking for ld used by GCC" >&5 esac else echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:14100: checking for GNU ld" >&5 +echo "configure:14110: checking for GNU ld" >&5 fi if test -z "$LTLD"; then @@ -14134,7 +14144,7 @@ ld_dynamic_link_flags= # Check to see if it really is or isn't GNU ld. echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6 -echo "configure:14138: checking if the linker is GNU ld" >&5 +echo "configure:14148: checking if the linker is GNU ld" >&5 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LTLD -v 2>&1 &5; then xe_gnu_ld=yes @@ -14162,7 +14172,7 @@ else # OK - only NOW do we futz about with ld. # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6 -echo "configure:14166: checking whether the linker supports shared libraries" >&5 +echo "configure:14176: checking whether the linker supports shared libraries" >&5 dll_ld=$CC dll_ldflags=$LDFLAGS ld_shlibs=yes @@ -14377,10 +14387,10 @@ EOF for ac_func in dlerror _dlerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14381: checking for $ac_func" >&5 +echo "configure:14391: checking for $ac_func" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14442,11 +14452,11 @@ done fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 +if { (eval echo configure:14460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5 then : else diff --git a/configure.in b/configure.in index 6485deb..df8b701 100644 --- a/configure.in +++ b/configure.in @@ -4156,6 +4156,9 @@ if test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \ != "no no no"; then AC_DEFINE(HAVE_DATABASE) XE_ADD_OBJS(database.o) + if test "$with_utf_2000" = "yes"; then + AC_DEFINE(HAVE_CHISE_CLIENT) + fi fi dnl Socks support diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f4d6f0e..2817f4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2002-02-26 MORIOKA Tomohiko + + * dumped-lisp.el (preloaded-file-list): Rename + utf-2000/make-cdbs.el -> utf-2000/update-cdb.el. + +2002-02-14 MORIOKA Tomohiko + + * update-elc.el: Load lisp/utf-2000/dumped-chars.el in UTF-2000; + append `system-char-db-source-file-list' into + `preloaded-file-list' in UTF-2000. + +2002-02-12 MORIOKA Tomohiko + + * dumped-lisp.el (preloaded-file-list): Delete + character-definition files. + +2002-02-04 MORIOKA Tomohiko + + * dumped-lisp.el (preloaded-file-list): Add `make-cdbs' in + UTF-2000. + 2001-12-31 MORIOKA Tomohiko * mule/mule-charset.el (default-coded-charset-priority-list): diff --git a/lisp/dumped-lisp.el b/lisp/dumped-lisp.el index 0064fd6..c1e7c50 100644 --- a/lisp/dumped-lisp.el +++ b/lisp/dumped-lisp.el @@ -123,308 +123,7 @@ ;;;;;;;;;;;;;;;;;; MULE support (when-feature mule "mule-conf") (when-feature mule "arabic") - (when-feature utf-2000 "isolated-char") - (when-feature utf-2000 "u00000-C0") - (when-feature utf-2000 "u00020-Basic-Latin") - (when-feature utf-2000 "u00080-C1") - (when-feature utf-2000 "u000A0-Latin-1-Supplement") - (when-feature utf-2000 "u00100-Latin-Extended-A") - (when-feature utf-2000 "u00180-Latin-Extended-B") - (when-feature utf-2000 "u00250-IPA-Extensions") - (when-feature utf-2000 "u002B0-Spacing-Modifier-Letters") - (when-feature utf-2000 "u00300-Combining-Diacritical-Marks") - (when-feature utf-2000 "u00370-Greek") - (when-feature utf-2000 "u00400-Cyrillic") - (when-feature utf-2000 "u00530-Armenian") - (when-feature utf-2000 "u00590-Hebrew") - (when-feature utf-2000 "u00600-Arabic") - (when-feature utf-2000 "u00700-Syriac") - (when-feature utf-2000 "u00780-Thaana") - (when-feature utf-2000 "u00900-Devanagari") - (when-feature utf-2000 "u00980-Bengali") - (when-feature utf-2000 "u00A00-Gurmukhi") - (when-feature utf-2000 "u00A80-Gujarati") - (when-feature utf-2000 "u00B00-Oriya") - (when-feature utf-2000 "u00B80-Tamil") - (when-feature utf-2000 "u00C00-Telugu") - (when-feature utf-2000 "u00C80-Kannada") - (when-feature utf-2000 "u00D00-Malayalam") - (when-feature utf-2000 "u00D80-Sinhala") - (when-feature utf-2000 "u00E00-Thai") - (when-feature utf-2000 "u00E80-Lao") - (when-feature utf-2000 "u00F00-Tibetan") - (when-feature utf-2000 "u01000-Myanmar") - (when-feature utf-2000 "u010A0-Georgian") - (when-feature utf-2000 "u01100-Hangul-Jamo") - (when-feature utf-2000 "u01200-Ethiopic") - (when-feature utf-2000 "u013A0-Cherokee") - (when-feature utf-2000 "u01400-Canadian") - (when-feature utf-2000 "u01680-Ogham") - (when-feature utf-2000 "u016A0-Runic") - (when-feature utf-2000 "u01780-Khmer") - (when-feature utf-2000 "u01800-Mongolian") - (when-feature utf-2000 "u01E00-Latin-Extended-Additional") - (when-feature utf-2000 "u01F00-Greek-Extended") - (when-feature utf-2000 "u02000-General-Punctuation") - (when-feature utf-2000 "u02070-Superscripts") - (when-feature utf-2000 "u02080-Subscripts") - (when-feature utf-2000 "u020A0-Currency-Symbols") - (when-feature utf-2000 - "u020D0-Combining-Diacritical-Marks-for-Symbols") - (when-feature utf-2000 "u02100-Letterlike-Symbols") - (when-feature utf-2000 "u02150-Number-Forms") - (when-feature utf-2000 "u02190-Arrows") - (when-feature utf-2000 "u02200-Mathematical-Operators") - (when-feature utf-2000 "u02300-Miscellaneous-Technical") - (when-feature utf-2000 "u02400-Control-Pictures") - (when-feature utf-2000 "u02440-OCR") - (when-feature utf-2000 "u02460-Enclosed-Alphanumerics") - (when-feature utf-2000 "u02500-Box-Drawing") - (when-feature utf-2000 "u02580-Block-Elements") - (when-feature utf-2000 "u025A0-Geometric-Shapes") - (when-feature utf-2000 "u02600-Miscellaneous-Symbols") - (when-feature utf-2000 "u02700-Dingbats") - (when-feature utf-2000 "u02800-Braille-Patterns") - (when-feature utf-2000 "u02E00-CJK-Radical-Supplement") - (when-feature utf-2000 "u02F00-Kangxi-Radicals") - (when-feature utf-2000 "u02FF0-Ideographic-Description-Characters") - (when-feature utf-2000 "u03000-CJK-Symbols-and-Punctuation") - (when-feature utf-2000 "u03040-Hiragana") - (when-feature utf-2000 "u030A0-Katakana") - (when-feature utf-2000 "u03100-Bopomofo") - (when-feature utf-2000 "u03130-Hangul-Compatibility-Jamo") - (when-feature utf-2000 "u03190-Kanbun") - (when-feature utf-2000 "u031A0-Bopomofo-Extended") - (when-feature utf-2000 "u03200-Enclosed-CJK-Letters-and-Months") - (when-feature utf-2000 "u03300-CJK-Compatibility") - (when-feature utf-2000 "Ideograph-R001-One") - (when-feature utf-2000 "Ideograph-R002-Line") - (when-feature utf-2000 "Ideograph-R003-Dot") - (when-feature utf-2000 "Ideograph-R004-Slash") - (when-feature utf-2000 "Ideograph-R005-Second") - (when-feature utf-2000 "Ideograph-R006-Hook") - (when-feature utf-2000 "Ideograph-R007-Two") - (when-feature utf-2000 "Ideograph-R008-Lid") - (when-feature utf-2000 "Ideograph-R009-Man") - (when-feature utf-2000 "Ideograph-R010-Legs") - (when-feature utf-2000 "Ideograph-R011-Enter") - (when-feature utf-2000 "Ideograph-R012-Eight") - (when-feature utf-2000 "Ideograph-R013-Down-Box") - (when-feature utf-2000 "Ideograph-R014-Cover") - (when-feature utf-2000 "Ideograph-R015-Ice") - (when-feature utf-2000 "Ideograph-R016-Table") - (when-feature utf-2000 "Ideograph-R017-Open-Box") - (when-feature utf-2000 "Ideograph-R018-Knife") - (when-feature utf-2000 "Ideograph-R019-Power") - (when-feature utf-2000 "Ideograph-R020-Wrap") - (when-feature utf-2000 "Ideograph-R021-Spoon") - (when-feature utf-2000 "Ideograph-R022-Right-Open-Box") - (when-feature utf-2000 "Ideograph-R023-Hiding-Enclosure") - (when-feature utf-2000 "Ideograph-R024-Ten") - (when-feature utf-2000 "Ideograph-R025-Divination") - (when-feature utf-2000 "Ideograph-R026-Seal") - (when-feature utf-2000 "Ideograph-R027-Cliff") - (when-feature utf-2000 "Ideograph-R028-Private") - (when-feature utf-2000 "Ideograph-R029-Again") - (when-feature utf-2000 "Ideograph-R030-Mouth") - (when-feature utf-2000 "Ideograph-R031-Enclosure") - (when-feature utf-2000 "Ideograph-R032-Earth") - (when-feature utf-2000 "Ideograph-R033-Scholar") - (when-feature utf-2000 "Ideograph-R034-Go") - (when-feature utf-2000 "Ideograph-R035-Go-Slowly") - (when-feature utf-2000 "Ideograph-R036-Evening") - (when-feature utf-2000 "Ideograph-R037-Big") - (when-feature utf-2000 "Ideograph-R038-Woman") - (when-feature utf-2000 "Ideograph-R039-Child") - (when-feature utf-2000 "Ideograph-R040-Roof") - (when-feature utf-2000 "Ideograph-R041-Inch") - (when-feature utf-2000 "Ideograph-R042-Small") - (when-feature utf-2000 "Ideograph-R043-Lame") - (when-feature utf-2000 "Ideograph-R044-Corpse") - (when-feature utf-2000 "Ideograph-R045-Sprout") - (when-feature utf-2000 "Ideograph-R046-Mountain") - (when-feature utf-2000 "Ideograph-R047-River") - (when-feature utf-2000 "Ideograph-R048-Work") - (when-feature utf-2000 "Ideograph-R049-Oneself") - (when-feature utf-2000 "Ideograph-R050-Turban") - (when-feature utf-2000 "Ideograph-R051-Dry") - (when-feature utf-2000 "Ideograph-R052-Short-Thread") - (when-feature utf-2000 "Ideograph-R053-Dotted-Cliff") - (when-feature utf-2000 "Ideograph-R054-Long-Stride") - (when-feature utf-2000 "Ideograph-R055-Two-Hands") - (when-feature utf-2000 "Ideograph-R056-Shoot") - (when-feature utf-2000 "Ideograph-R057-Bow") - (when-feature utf-2000 "Ideograph-R058-Snout") - (when-feature utf-2000 "Ideograph-R059-Bristle") - (when-feature utf-2000 "Ideograph-R060-Step") - (when-feature utf-2000 "Ideograph-R061-Heart") - (when-feature utf-2000 "Ideograph-R062-Halberd") - (when-feature utf-2000 "Ideograph-R063-Door") - (when-feature utf-2000 "Ideograph-R064-Hand") - (when-feature utf-2000 "Ideograph-R065-Branch") - (when-feature utf-2000 "Ideograph-R066-Rap") - (when-feature utf-2000 "Ideograph-R067-Script") - (when-feature utf-2000 "Ideograph-R068-Dipper") - (when-feature utf-2000 "Ideograph-R069-Axe") - (when-feature utf-2000 "Ideograph-R070-Square") - (when-feature utf-2000 "Ideograph-R071-Not") - (when-feature utf-2000 "Ideograph-R072-Sun") - (when-feature utf-2000 "Ideograph-R073-Say") - (when-feature utf-2000 "Ideograph-R074-Moon") - (when-feature utf-2000 "Ideograph-R075-Tree") - (when-feature utf-2000 "Ideograph-R076-Lack") - (when-feature utf-2000 "Ideograph-R077-Stop") - (when-feature utf-2000 "Ideograph-R078-Death") - (when-feature utf-2000 "Ideograph-R079-Weapon") - (when-feature utf-2000 "Ideograph-R080-Do-Not") - (when-feature utf-2000 "Ideograph-R081-Compare") - (when-feature utf-2000 "Ideograph-R082-Fur") - (when-feature utf-2000 "Ideograph-R083-Clan") - (when-feature utf-2000 "Ideograph-R084-Steam") - (when-feature utf-2000 "Ideograph-R085-Water") - (when-feature utf-2000 "Ideograph-R086-Fire") - (when-feature utf-2000 "Ideograph-R087-Claw") - (when-feature utf-2000 "Ideograph-R088-Father") - (when-feature utf-2000 "Ideograph-R089-Double-X") - (when-feature utf-2000 "Ideograph-R090-Half-Tree-Trunk") - (when-feature utf-2000 "Ideograph-R091-Slice") - (when-feature utf-2000 "Ideograph-R092-Fang") - (when-feature utf-2000 "Ideograph-R093-Cow") - (when-feature utf-2000 "Ideograph-R094-Dog") - (when-feature utf-2000 "Ideograph-R095-Profound") - (when-feature utf-2000 "Ideograph-R096-Jade") - (when-feature utf-2000 "Ideograph-R097-Melon") - (when-feature utf-2000 "Ideograph-R098-Tile") - (when-feature utf-2000 "Ideograph-R099-Sweet") - (when-feature utf-2000 "Ideograph-R100-Life") - (when-feature utf-2000 "Ideograph-R101-Use") - (when-feature utf-2000 "Ideograph-R102-Field") - (when-feature utf-2000 "Ideograph-R103-Bolt-Of-Cloth") - (when-feature utf-2000 "Ideograph-R104-Sickness") - (when-feature utf-2000 "Ideograph-R105-Dotted-Tent") - (when-feature utf-2000 "Ideograph-R106-White") - (when-feature utf-2000 "Ideograph-R107-Skin") - (when-feature utf-2000 "Ideograph-R108-Dish") - (when-feature utf-2000 "Ideograph-R109-Eye") - (when-feature utf-2000 "Ideograph-R110-Spear") - (when-feature utf-2000 "Ideograph-R111-Arrow") - (when-feature utf-2000 "Ideograph-R112-Stone") - (when-feature utf-2000 "Ideograph-R113-Spirit") - (when-feature utf-2000 "Ideograph-R114-Track") - (when-feature utf-2000 "Ideograph-R115-Grain") - (when-feature utf-2000 "Ideograph-R116-Cave") - (when-feature utf-2000 "Ideograph-R117-Stand") - (when-feature utf-2000 "Ideograph-R118-Bamboo") - (when-feature utf-2000 "Ideograph-R119-Rice") - (when-feature utf-2000 "Ideograph-R120-Silk") - (when-feature utf-2000 "Ideograph-R121-Jar") - (when-feature utf-2000 "Ideograph-R122-Net") - (when-feature utf-2000 "Ideograph-R123-Sheep") - (when-feature utf-2000 "Ideograph-R124-Feather") - (when-feature utf-2000 "Ideograph-R125-Old") - (when-feature utf-2000 "Ideograph-R126-And") - (when-feature utf-2000 "Ideograph-R127-Plow") - (when-feature utf-2000 "Ideograph-R128-Ear") - (when-feature utf-2000 "Ideograph-R129-Brush") - (when-feature utf-2000 "Ideograph-R130-Meat") - (when-feature utf-2000 "Ideograph-R131-Minister") - (when-feature utf-2000 "Ideograph-R132-Self") - (when-feature utf-2000 "Ideograph-R133-Arrive") - (when-feature utf-2000 "Ideograph-R134-Mortar") - (when-feature utf-2000 "Ideograph-R135-Tongue") - (when-feature utf-2000 "Ideograph-R136-Oppose") - (when-feature utf-2000 "Ideograph-R137-Boat") - (when-feature utf-2000 "Ideograph-R138-Stopping") - (when-feature utf-2000 "Ideograph-R139-Color") - (when-feature utf-2000 "Ideograph-R140-Grass") - (when-feature utf-2000 "Ideograph-R141-Tiger") - (when-feature utf-2000 "Ideograph-R142-Insect") - (when-feature utf-2000 "Ideograph-R143-Blood") - (when-feature utf-2000 "Ideograph-R144-Walk-Enclosure") - (when-feature utf-2000 "Ideograph-R145-Clothes") - (when-feature utf-2000 "Ideograph-R146-West") - (when-feature utf-2000 "Ideograph-R147-See") - (when-feature utf-2000 "Ideograph-R148-Horn") - (when-feature utf-2000 "Ideograph-R149-Speech") - (when-feature utf-2000 "Ideograph-R150-Valley") - (when-feature utf-2000 "Ideograph-R151-Bean") - (when-feature utf-2000 "Ideograph-R152-Pig") - (when-feature utf-2000 "Ideograph-R153-Badger") - (when-feature utf-2000 "Ideograph-R154-Shell") - (when-feature utf-2000 "Ideograph-R155-Red") - (when-feature utf-2000 "Ideograph-R156-Run") - (when-feature utf-2000 "Ideograph-R157-Foot") - (when-feature utf-2000 "Ideograph-R158-Body") - (when-feature utf-2000 "Ideograph-R159-Cart") - (when-feature utf-2000 "Ideograph-R160-Bitter") - (when-feature utf-2000 "Ideograph-R161-Morning") - (when-feature utf-2000 "Ideograph-R162-Walk") - (when-feature utf-2000 "Ideograph-R163-City") - (when-feature utf-2000 "Ideograph-R164-Wine") - (when-feature utf-2000 "Ideograph-R165-Distinguish") - (when-feature utf-2000 "Ideograph-R166-Village") - (when-feature utf-2000 "Ideograph-R167-Gold") - (when-feature utf-2000 "Ideograph-R168-Long") - (when-feature utf-2000 "Ideograph-R169-Gate") - (when-feature utf-2000 "Ideograph-R170-Mound") - (when-feature utf-2000 "Ideograph-R171-Slave") - (when-feature utf-2000 "Ideograph-R172-Short-Tailed-Bird") - (when-feature utf-2000 "Ideograph-R173-Rain") - (when-feature utf-2000 "Ideograph-R174-Blue") - (when-feature utf-2000 "Ideograph-R175-Wrong") - (when-feature utf-2000 "Ideograph-R176-Face") - (when-feature utf-2000 "Ideograph-R177-Leather") - (when-feature utf-2000 "Ideograph-R178-Tanned-Leather") - (when-feature utf-2000 "Ideograph-R179-Leek") - (when-feature utf-2000 "Ideograph-R180-Sound") - (when-feature utf-2000 "Ideograph-R181-Leaf") - (when-feature utf-2000 "Ideograph-R182-Wind") - (when-feature utf-2000 "Ideograph-R183-Fly") - (when-feature utf-2000 "Ideograph-R184-Eat") - (when-feature utf-2000 "Ideograph-R185-Head") - (when-feature utf-2000 "Ideograph-R186-Fragrant") - (when-feature utf-2000 "Ideograph-R187-Horse") - (when-feature utf-2000 "Ideograph-R188-Bone") - (when-feature utf-2000 "Ideograph-R189-Tall") - (when-feature utf-2000 "Ideograph-R190-Hair") - (when-feature utf-2000 "Ideograph-R191-Fight") - (when-feature utf-2000 "Ideograph-R192-Sacrificial-Wine") - (when-feature utf-2000 "Ideograph-R193-Cauldron") - (when-feature utf-2000 "Ideograph-R194-Ghost") - (when-feature utf-2000 "Ideograph-R195-Fish") - (when-feature utf-2000 "Ideograph-R196-Bird") - (when-feature utf-2000 "Ideograph-R197-Salt") - (when-feature utf-2000 "Ideograph-R198-Deer") - (when-feature utf-2000 "Ideograph-R199-Wheat") - (when-feature utf-2000 "Ideograph-R200-Hemp") - (when-feature utf-2000 "Ideograph-R201-Yellow") - (when-feature utf-2000 "Ideograph-R202-Millet") - (when-feature utf-2000 "Ideograph-R203-Black") - (when-feature utf-2000 "Ideograph-R204-Embroidery") - (when-feature utf-2000 "Ideograph-R205-Frog") - (when-feature utf-2000 "Ideograph-R206-Tripod") - (when-feature utf-2000 "Ideograph-R207-Drum") - (when-feature utf-2000 "Ideograph-R208-Rat") - (when-feature utf-2000 "Ideograph-R209-Nose") - (when-feature utf-2000 "Ideograph-R210-Even") - (when-feature utf-2000 "Ideograph-R211-Tooth") - (when-feature utf-2000 "Ideograph-R212-Dragon") - (when-feature utf-2000 "Ideograph-R213-Turtle") - (when-feature utf-2000 "Ideograph-R214-Flute") - (when-feature utf-2000 "u0A000-Yi-Syllables") - (when-feature utf-2000 "u0AC00-Hangul-Syllables") - (when-feature utf-2000 "u0E000-Private-Use") - (when-feature utf-2000 "u0FB00-Alphabetic-Presentation-Forms") - (when-feature utf-2000 "u0FB50-Arabic-Presentation-Forms-A") - (when-feature utf-2000 "u0FE20-Combining-Half-Marks") - (when-feature utf-2000 "u0FE30-CJK-Compatibility-Forms") - (when-feature utf-2000 "u0FE50-Small-Form-Variants") - (when-feature utf-2000 "u0FE70-Arabic-Presentation-Forms-B") - (when-feature utf-2000 "u0FF00-Halfwidth-and-Fullwidth-Forms") - (when-feature utf-2000 "u0FFF0-Specials") - ;; (when-feature utf-2000 "mojikyo") - (when-feature utf-2000 "ad-hoc-cdp") - (when-feature utf-2000 "ccs-tcvn5712.el") + (when-feature utf-2000 "update-cdb") (when-feature mule "mule-charset") (when-feature mule "mule-coding") ;; All files after this can have extended characters in them. @@ -541,6 +240,7 @@ ;; (when-feature sparcworks "sun-eos-debugger") ;; (when-feature sparcworks "sun-eos-debugger-extra") ;; (when-feature sparcworks "sun-eos-menubar") + ;; (when-feature utf-2000 "make-cdbs") "loadhist" ; Must be dumped before loaddefs is loaded "loaddefs" ; <=== autoloads get loaded here )) diff --git a/lisp/update-elc.el b/lisp/update-elc.el index 777017a..7207761 100644 --- a/lisp/update-elc.el +++ b/lisp/update-elc.el @@ -87,6 +87,9 @@ (let (preloaded-file-list site-load-packages need-to-dump dumped-exe) (load (expand-file-name "../lisp/dumped-lisp.el")) + (when (featurep 'utf-2000) + (load (expand-file-name "../lisp/utf-2000/dumped-chars.el"))) + (setq dumped-exe (cond ((file-exists-p "../src/xemacs.exe") "../src/xemacs.exe") ((file-exists-p "../src/xemacs") "../src/xemacs") @@ -106,6 +109,8 @@ (setq preloaded-file-list (append packages-hardcoded-lisp preloaded-file-list + (if (featurep 'utf-2000) + system-char-db-source-file-list) packages-useful-lisp site-load-packages)) (while preloaded-file-list diff --git a/lisp/utf-2000/ChangeLog b/lisp/utf-2000/ChangeLog index 6b63ced..c0b4a5d 100644 --- a/lisp/utf-2000/ChangeLog +++ b/lisp/utf-2000/ChangeLog @@ -1,3 +1,77 @@ +2002-03-12 MORIOKA Tomohiko + + * update-cdb.el: When feature `chise' is not provided, just load + up files defined in `system-char-db-source-file-list'. + (system-char-database-directory): Don't define it when feature + `chise' is not provided. + (file-name-char-attribute-name): Likewise. Don't call + `reset-char-attribute-table' for files in + `system-char-database-directory' when feature `chise' is not + provided. + +2002-03-03 MORIOKA Tomohiko + + * update-cdb.el: Delete system-char-database-directory before + loading system-char-db-source-file-list when updating database + files. + +2002-03-01 MORIOKA Tomohiko + + * Ideograph-R007-Two.el (U+4E92): Use char-spec instead of + char-ref in the `ideographic-structure'. + +2002-02-25 MORIOKA Tomohiko + + * update-cdb.el: Renamed from make-cdbs.el. + +2002-02-25 MORIOKA Tomohiko + + * make-cdbs.el: (file-name-char-attribute-name) New function. + - Use `file-name-char-attribute-name' to get character attribute + names. + +2002-02-22 MORIOKA Tomohiko + + * Ideograph-R135-Tongue.el (C1-485F): Fix :char of + `<-original-ideograph'. + +2002-02-19 MORIOKA Tomohiko + + * make-cdbs.el (delete-file-with-children): New function; use it + instead of "rm". + +2002-02-14 MORIOKA Tomohiko + + * make-cdbs.el: Load dumped-chars.el and refer + `system-char-db-source-file-list'. + + * dumped-chars.el: New file. + +2002-02-12 MORIOKA Tomohiko + + * char-db-util.el (insert-char-attributes): Ignore + `->ucs-variants' if optional argument `readable' is not specified; + regard ->FOO and <-FOO as list of char-refs. + +2002-02-12 MORIOKA Tomohiko + + * make-cdbs.el (system-char-database-directory): New variable. + - Load character-definition files if + `system-char-database-directory' is not found or + `load-ignore-elc-files' is non-nil. + - Call `reset-char-attribute-table' for each character-attribute + corresponding with each file in + `system-char-database-directory'/system-char-id. + +2002-02-08 MORIOKA Tomohiko + + * make-cdbs.el: Use `save-charset-mapping-table' for all + coded-charsets. + +2002-02-01 MORIOKA Tomohiko + + * make-cdbs.el: New file. + 2002-02-22 MORIOKA Tomohiko * Ideograph-R170-Mound.el (U+9689): Separate JSP-6664. diff --git a/lisp/utf-2000/char-db-util.el b/lisp/utf-2000/char-db-util.el index 94d17bd..81f60e1 100644 --- a/lisp/utf-2000/char-db-util.el +++ b/lisp/utf-2000/char-db-util.el @@ -673,6 +673,10 @@ value line-breaking)) (setq attributes (delq 'hanyu-dazidian-char attributes)) ) + (when (and (not readable) + (memq '->ucs-variants attributes)) + (setq attributes (delq '->ucs-variants attributes)) + ) (setq rest ccs-attributes) (while (and rest (progn @@ -692,22 +696,24 @@ (insert (format "(%-18s . #x%04X)%s" name value line-breaking))) - ((memq name '(->lowercase - ->uppercase ->titlecase - ->fullwidth <-fullwidth - ->identical - ->vulgar-ideograph <-vulgar-ideograph - ->ancient-ideograph <-ancient-ideograph - ->original-ideograph <-original-ideograph - ->simplified-ideograph <-simplified-ideograph - ->wrong-ideograph <-wrong-ideograph - ->same-ideograph - ->ideographic-variants - ->synonyms - ->radical <-radical - ->bopomofo <-bopomofo - ->ideographic <-ideographic - ideographic-structure)) + ((or (eq name 'ideographic-structure) + (string-match "^\\(->\\|<-\\)" (symbol-name name))) + ;; (memq name '(->lowercase + ;; ->uppercase ->titlecase + ;; ->fullwidth <-fullwidth + ;; ->identical + ;; ->vulgar-ideograph <-vulgar-ideograph + ;; ->ancient-ideograph <-ancient-ideograph + ;; ->original-ideograph <-original-ideograph + ;; ->simplified-ideograph <-simplified-ideograph + ;; ->wrong-ideograph <-wrong-ideograph + ;; ->same-ideograph + ;; ->ideographic-variants + ;; ->synonyms + ;; ->radical <-radical + ;; ->bopomofo <-bopomofo + ;; ->ideographic <-ideographic + ;; ideographic-structure)) (insert (format "(%-18s%s " name line-breaking)) (setq lbs (concat "\n" (make-string (current-column) ?\ )) separator nil) @@ -718,7 +724,9 @@ (cond ((characterp cell) (if separator (insert lbs)) - (char-db-insert-char-spec cell readable) + (if readable + (insert (format "%S" cell)) + (char-db-insert-char-spec cell readable)) (setq separator lbs)) ((consp cell) (if separator @@ -762,20 +770,20 @@ (setq value (cdr value))) (insert ")") (insert line-breaking)) - ((string-match "^->" (symbol-name name)) - (insert - (format "(%-18s %s)%s" - name - (mapconcat (lambda (code) - (cond ((symbolp code) - (symbol-name code)) - ((integerp code) - (format "#x%04X" code)) - (t - (format "%s%S" - line-breaking code)))) - value " ") - line-breaking))) + ;; ((string-match "^->" (symbol-name name)) + ;; (insert + ;; (format "(%-18s %s)%s" + ;; name + ;; (mapconcat (lambda (code) + ;; (cond ((symbolp code) + ;; (symbol-name code)) + ;; ((integerp code) + ;; (format "#x%04X" code)) + ;; (t + ;; (format "%s%S" + ;; line-breaking code)))) + ;; value " ") + ;; line-breaking))) ((consp value) (insert (format "(%-18s " name)) (setq lbs (concat "\n" (make-string (current-column) ?\ )) diff --git a/lisp/utf-2000/dumped-chars.el b/lisp/utf-2000/dumped-chars.el new file mode 100644 index 0000000..39d52e6 --- /dev/null +++ b/lisp/utf-2000/dumped-chars.el @@ -0,0 +1,301 @@ +(setq system-char-db-source-file-list + '("isolated-char" + "u00000-C0" + "u00020-Basic-Latin" + "u00080-C1" + "u000A0-Latin-1-Supplement" + "u00100-Latin-Extended-A" + "u00180-Latin-Extended-B" + "u00250-IPA-Extensions" + "u002B0-Spacing-Modifier-Letters" + "u00300-Combining-Diacritical-Marks" + "u00370-Greek" + "u00400-Cyrillic" + "u00530-Armenian" + "u00590-Hebrew" + "u00600-Arabic" + "u00700-Syriac" + "u00780-Thaana" + "u00900-Devanagari" + "u00980-Bengali" + "u00A00-Gurmukhi" + "u00A80-Gujarati" + "u00B00-Oriya" + "u00B80-Tamil" + "u00C00-Telugu" + "u00C80-Kannada" + "u00D00-Malayalam" + "u00D80-Sinhala" + "u00E00-Thai" + "u00E80-Lao" + "u00F00-Tibetan" + "u01000-Myanmar" + "u010A0-Georgian" + "u01100-Hangul-Jamo" + "u01200-Ethiopic" + "u013A0-Cherokee" + "u01400-Canadian" + "u01680-Ogham" + "u016A0-Runic" + "u01780-Khmer" + "u01800-Mongolian" + "u01E00-Latin-Extended-Additional" + "u01F00-Greek-Extended" + "u02000-General-Punctuation" + "u02070-Superscripts" + "u02080-Subscripts" + "u020A0-Currency-Symbols" + "u020D0-Combining-Diacritical-Marks-for-Symbols" + "u02100-Letterlike-Symbols" + "u02150-Number-Forms" + "u02190-Arrows" + "u02200-Mathematical-Operators" + "u02300-Miscellaneous-Technical" + "u02400-Control-Pictures" + "u02440-OCR" + "u02460-Enclosed-Alphanumerics" + "u02500-Box-Drawing" + "u02580-Block-Elements" + "u025A0-Geometric-Shapes" + "u02600-Miscellaneous-Symbols" + "u02700-Dingbats" + "u02800-Braille-Patterns" + "u02E00-CJK-Radical-Supplement" + "u02F00-Kangxi-Radicals" + "u02FF0-Ideographic-Description-Characters" + "u03000-CJK-Symbols-and-Punctuation" + "u03040-Hiragana" + "u030A0-Katakana" + "u03100-Bopomofo" + "u03130-Hangul-Compatibility-Jamo" + "u03190-Kanbun" + "u031A0-Bopomofo-Extended" + "u03200-Enclosed-CJK-Letters-and-Months" + "u03300-CJK-Compatibility" + "Ideograph-R001-One" + "Ideograph-R002-Line" + "Ideograph-R003-Dot" + "Ideograph-R004-Slash" + "Ideograph-R005-Second" + "Ideograph-R006-Hook" + "Ideograph-R007-Two" + "Ideograph-R008-Lid" + "Ideograph-R009-Man" + "Ideograph-R010-Legs" + "Ideograph-R011-Enter" + "Ideograph-R012-Eight" + "Ideograph-R013-Down-Box" + "Ideograph-R014-Cover" + "Ideograph-R015-Ice" + "Ideograph-R016-Table" + "Ideograph-R017-Open-Box" + "Ideograph-R018-Knife" + "Ideograph-R019-Power" + "Ideograph-R020-Wrap" + "Ideograph-R021-Spoon" + "Ideograph-R022-Right-Open-Box" + "Ideograph-R023-Hiding-Enclosure" + "Ideograph-R024-Ten" + "Ideograph-R025-Divination" + "Ideograph-R026-Seal" + "Ideograph-R027-Cliff" + "Ideograph-R028-Private" + "Ideograph-R029-Again" + "Ideograph-R030-Mouth" + "Ideograph-R031-Enclosure" + "Ideograph-R032-Earth" + "Ideograph-R033-Scholar" + "Ideograph-R034-Go" + "Ideograph-R035-Go-Slowly" + "Ideograph-R036-Evening" + "Ideograph-R037-Big" + "Ideograph-R038-Woman" + "Ideograph-R039-Child" + "Ideograph-R040-Roof" + "Ideograph-R041-Inch" + "Ideograph-R042-Small" + "Ideograph-R043-Lame" + "Ideograph-R044-Corpse" + "Ideograph-R045-Sprout" + "Ideograph-R046-Mountain" + "Ideograph-R047-River" + "Ideograph-R048-Work" + "Ideograph-R049-Oneself" + "Ideograph-R050-Turban" + "Ideograph-R051-Dry" + "Ideograph-R052-Short-Thread" + "Ideograph-R053-Dotted-Cliff" + "Ideograph-R054-Long-Stride" + "Ideograph-R055-Two-Hands" + "Ideograph-R056-Shoot" + "Ideograph-R057-Bow" + "Ideograph-R058-Snout" + "Ideograph-R059-Bristle" + "Ideograph-R060-Step" + "Ideograph-R061-Heart" + "Ideograph-R062-Halberd" + "Ideograph-R063-Door" + "Ideograph-R064-Hand" + "Ideograph-R065-Branch" + "Ideograph-R066-Rap" + "Ideograph-R067-Script" + "Ideograph-R068-Dipper" + "Ideograph-R069-Axe" + "Ideograph-R070-Square" + "Ideograph-R071-Not" + "Ideograph-R072-Sun" + "Ideograph-R073-Say" + "Ideograph-R074-Moon" + "Ideograph-R075-Tree" + "Ideograph-R076-Lack" + "Ideograph-R077-Stop" + "Ideograph-R078-Death" + "Ideograph-R079-Weapon" + "Ideograph-R080-Do-Not" + "Ideograph-R081-Compare" + "Ideograph-R082-Fur" + "Ideograph-R083-Clan" + "Ideograph-R084-Steam" + "Ideograph-R085-Water" + "Ideograph-R086-Fire" + "Ideograph-R087-Claw" + "Ideograph-R088-Father" + "Ideograph-R089-Double-X" + "Ideograph-R090-Half-Tree-Trunk" + "Ideograph-R091-Slice" + "Ideograph-R092-Fang" + "Ideograph-R093-Cow" + "Ideograph-R094-Dog" + "Ideograph-R095-Profound" + "Ideograph-R096-Jade" + "Ideograph-R097-Melon" + "Ideograph-R098-Tile" + "Ideograph-R099-Sweet" + "Ideograph-R100-Life" + "Ideograph-R101-Use" + "Ideograph-R102-Field" + "Ideograph-R103-Bolt-Of-Cloth" + "Ideograph-R104-Sickness" + "Ideograph-R105-Dotted-Tent" + "Ideograph-R106-White" + "Ideograph-R107-Skin" + "Ideograph-R108-Dish" + "Ideograph-R109-Eye" + "Ideograph-R110-Spear" + "Ideograph-R111-Arrow" + "Ideograph-R112-Stone" + "Ideograph-R113-Spirit" + "Ideograph-R114-Track" + "Ideograph-R115-Grain" + "Ideograph-R116-Cave" + "Ideograph-R117-Stand" + "Ideograph-R118-Bamboo" + "Ideograph-R119-Rice" + "Ideograph-R120-Silk" + "Ideograph-R121-Jar" + "Ideograph-R122-Net" + "Ideograph-R123-Sheep" + "Ideograph-R124-Feather" + "Ideograph-R125-Old" + "Ideograph-R126-And" + "Ideograph-R127-Plow" + "Ideograph-R128-Ear" + "Ideograph-R129-Brush" + "Ideograph-R130-Meat" + "Ideograph-R131-Minister" + "Ideograph-R132-Self" + "Ideograph-R133-Arrive" + "Ideograph-R134-Mortar" + "Ideograph-R135-Tongue" + "Ideograph-R136-Oppose" + "Ideograph-R137-Boat" + "Ideograph-R138-Stopping" + "Ideograph-R139-Color" + "Ideograph-R140-Grass" + "Ideograph-R141-Tiger" + "Ideograph-R142-Insect" + "Ideograph-R143-Blood" + "Ideograph-R144-Walk-Enclosure" + "Ideograph-R145-Clothes" + "Ideograph-R146-West" + "Ideograph-R147-See" + "Ideograph-R148-Horn" + "Ideograph-R149-Speech" + "Ideograph-R150-Valley" + "Ideograph-R151-Bean" + "Ideograph-R152-Pig" + "Ideograph-R153-Badger" + "Ideograph-R154-Shell" + "Ideograph-R155-Red" + "Ideograph-R156-Run" + "Ideograph-R157-Foot" + "Ideograph-R158-Body" + "Ideograph-R159-Cart" + "Ideograph-R160-Bitter" + "Ideograph-R161-Morning" + "Ideograph-R162-Walk" + "Ideograph-R163-City" + "Ideograph-R164-Wine" + "Ideograph-R165-Distinguish" + "Ideograph-R166-Village" + "Ideograph-R167-Gold" + "Ideograph-R168-Long" + "Ideograph-R169-Gate" + "Ideograph-R170-Mound" + "Ideograph-R171-Slave" + "Ideograph-R172-Short-Tailed-Bird" + "Ideograph-R173-Rain" + "Ideograph-R174-Blue" + "Ideograph-R175-Wrong" + "Ideograph-R176-Face" + "Ideograph-R177-Leather" + "Ideograph-R178-Tanned-Leather" + "Ideograph-R179-Leek" + "Ideograph-R180-Sound" + "Ideograph-R181-Leaf" + "Ideograph-R182-Wind" + "Ideograph-R183-Fly" + "Ideograph-R184-Eat" + "Ideograph-R185-Head" + "Ideograph-R186-Fragrant" + "Ideograph-R187-Horse" + "Ideograph-R188-Bone" + "Ideograph-R189-Tall" + "Ideograph-R190-Hair" + "Ideograph-R191-Fight" + "Ideograph-R192-Sacrificial-Wine" + "Ideograph-R193-Cauldron" + "Ideograph-R194-Ghost" + "Ideograph-R195-Fish" + "Ideograph-R196-Bird" + "Ideograph-R197-Salt" + "Ideograph-R198-Deer" + "Ideograph-R199-Wheat" + "Ideograph-R200-Hemp" + "Ideograph-R201-Yellow" + "Ideograph-R202-Millet" + "Ideograph-R203-Black" + "Ideograph-R204-Embroidery" + "Ideograph-R205-Frog" + "Ideograph-R206-Tripod" + "Ideograph-R207-Drum" + "Ideograph-R208-Rat" + "Ideograph-R209-Nose" + "Ideograph-R210-Even" + "Ideograph-R211-Tooth" + "Ideograph-R212-Dragon" + "Ideograph-R213-Turtle" + "Ideograph-R214-Flute" + "u0A000-Yi-Syllables" + "u0AC00-Hangul-Syllables" + "u0E000-Private-Use" + "u0FB00-Alphabetic-Presentation-Forms" + "u0FB50-Arabic-Presentation-Forms-A" + "u0FE20-Combining-Half-Marks" + "u0FE30-CJK-Compatibility-Forms" + "u0FE50-Small-Form-Variants" + "u0FE70-Arabic-Presentation-Forms-B" + "u0FF00-Halfwidth-and-Fullwidth-Forms" + "u0FFF0-Specials" + "ad-hoc-cdp" + "ccs-tcvn5712.el")) diff --git a/lisp/utf-2000/update-cdb.el b/lisp/utf-2000/update-cdb.el new file mode 100644 index 0000000..51b98d2 --- /dev/null +++ b/lisp/utf-2000/update-cdb.el @@ -0,0 +1,93 @@ +;;; update-cdb.el --- Update and/or setup character attribute database + +;; Copyright (C) 2002 MORIOKA Tomohiko. + +;; Author: MORIOKA Tomohiko +;; Keywords: Character, Database, UTF-2000, Unicode, UCS-4, MULE. + +;; This file is part of XEmacs UTF-2000. + +;; XEmacs UTF-2000 is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; XEmacs UTF-2000 is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with XEmacs UTF-2000; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Code: + +(defun delete-file-with-children (filename) + (if (file-directory-p filename) + (let ((files + (directory-files filename 'full "^[^.]" 'so-sort))) + (if files + (dolist (file files) + (delete-file-with-children file))) + (remove-directory filename)) + (delete-file filename))) + +(cond + ((featurep 'chise) + (defvar system-char-database-directory + (expand-file-name "char-db" + (or exec-directory + "../lib-src/"))) + + (defun file-name-char-attribute-name (filename) + (let ((i 0) + (base 0) + (len (length filename)) + chr dest) + (while (< i len) + (if (eq (setq chr (aref filename i)) ?%) + (setq dest (concat dest + (substring filename base i) + (char-to-string + (int-char + (string-to-int + (substring filename (1+ i) (+ i 3)) 16)))) + i (+ i 3) + base i) + (setq i (1+ i)))) + (concat dest (substring filename base len)))) + + (when (or load-ignore-elc-files + (not (file-exists-p system-char-database-directory))) + (if (file-exists-p system-char-database-directory) + (delete-file-with-children system-char-database-directory)) + + (load "dumped-chars.el") + (dolist (file system-char-db-source-file-list) + (pureload file)) + + (dolist (attribute (char-attribute-list)) + (save-char-attribute-table attribute)) + + (dolist (ccs (charset-list)) + (save-charset-mapping-table ccs))) + + (mapcar (lambda (file) + (reset-char-attribute-table + (intern (file-name-char-attribute-name file)))) + (directory-files + (expand-file-name "system-char-id" + system-char-database-directory) + nil nil t t)) + ) + (t + (load "dumped-chars.el") + (dolist (file system-char-db-source-file-list) + (pureload file)) + )) + +(garbage-collect) + +;;; update-cdb.el ends here diff --git a/src/ChangeLog b/src/ChangeLog index e9efc20..d97afa3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,270 @@ +2002-03-11 MORIOKA Tomohiko + + * mule-charset.c (load_char_decoding_entry_maybe): Don't define it + when HAVE_CHISE_CLIENT is not defined. + + * mule.c (vars_of_mule): Provide feature `chise' when + HAVE_CHISE_CLIENT is defined. + +2002-03-11 MORIOKA Tomohiko + + * config.h.in (UTF2000): Add comment. + (HAVE_CHISE_CLIENT): New macro. + +2002-02-25 MORIOKA Tomohiko + + * chartab.c (Fchar_variants): Check Vcharacter_variant_table is + CONSP. + (Fput_char_attribute): Likewise. + (char_attribute_system_db_file): Encode file-name of attribute. + (vars_of_chartab): Set Qunbound into Vcharacter_variant_table as + the initial value. + +2002-02-13 MORIOKA Tomohiko + + * mule-charset.c (put_char_ccs_code_point): Delete unused codes. + (Fsave_charset_mapping_table): Use + `char_attribute_system_db_file'. + (load_char_decoding_entry_maybe): Likewise. + + * chartab.h (Qsystem_char_id): New external variable. + (char_attribute_system_db_file): New prototype. + + * chartab.c (Qsystem_char_id): New variable in UTF-2000. + (char_attribute_system_db_file): New function. + (Fsave_char_attribute_table): Use `char_attribute_system_db_file'. + (Freset_char_attribute_table): Likewise. + (load_char_attribute_maybe): Likewise. + (Fload_char_attribute_table): Likewise. + (syms_of_chartab): Add new symbol `system-char-id'. + +2002-02-12 MORIOKA Tomohiko + + * char-ucs.h (DECODE_DEFINED_CHAR): Don't check + `XCHARSET_GRAPHIC(ccs)'. + +2002-02-12 MORIOKA Tomohiko + + * mule-charset.c (Fsave_charset_mapping_table): Fixed. + +2002-02-11 MORIOKA Tomohiko + + * chartab.c (Q_ucs_variants): New variable. + (syms_of_chartab): Add new symbol `->ucs-variants'. + (complex_vars_of_chartab): Set `Vcharacter_variant_table' on + `Vchar_attribute_hash_table' as the value of `->ucs-variants'; set + `->ucs-variants' on `XCHAR_TABLE_NAME (Vcharacter_variant_table)'. + + * mule-charset.c (load_char_decoding_entry_maybe): New function. + + * char-ucs.h (load_char_decoding_entry_maybe): New prototype when + `HAVE_DATABASE' is defined. + (DECODE_DEFINED_CHAR): Use `load_char_decoding_entry_maybe' when + `HAVE_DATABASE' is defined. + +2002-02-11 MORIOKA Tomohiko + + * chartab.c (Fsave_char_attribute_table): Don't clear internal + attribute-table. + (Freset_char_attribute_table): New function. + (syms_of_chartab): Add new builtin function + `reset-char-attribute-table'. + +2002-02-11 MORIOKA Tomohiko + + * chartab.c (load_char_attribute_maybe): Don't make directories. + +2002-02-11 MORIOKA Tomohiko + + * char-ucs.h: Add EXFUN for `Fmake_directory_internal'. + + * mule-charset.c (put_char_ccs_code_point): Don't prepare a vector + for decoding-table. + +2002-02-11 MORIOKA Tomohiko + + * mule-charset.c (Fsave_charset_mapping_table): Use + `XCHARSET_BYTE_SIZE' instead of `XCHARSET_CHARS'. + + * char-ucs.h (put_ccs_octet_table): Use `XCHARSET_BYTE_SIZE' + instead of `XCHARSET_CHARS'. + +2002-02-10 MORIOKA Tomohiko + + * mule-charset.c (CHARSET_BYTE_SIZE): Moved to char-ucs.h. + (XCHARSET_BYTE_SIZE): Likewise. + + * char-ucs.h (CHARSET_BYTE_SIZE): New inline function [moved from + mule-charset.c]. + (XCHARSET_BYTE_SIZE): Likewise. + +2002-02-10 MORIOKA Tomohiko + + * chartab.c (Fput_char_attribute): Use exec-directory instead of + data-directory to store database. + (Fsave_char_attribute_table): Likewise. + (load_char_attribute_maybe): Likewise. + (Fload_char_attribute_table): Likewise. + +2002-02-08 MORIOKA Tomohiko + + * mule-charset.c (Fsave_charset_mapping_table): New function. + (syms_of_mule_charset): Add new builtin function + `save-charset-mapping-table'. + +2002-02-07 MORIOKA Tomohiko + + * char-ucs.h (decoding_table_check_elements): Delete prototype. + (get_ccs_octet_table): New inline function. + (put_ccs_octet_table): Likewise. + (decoding_table_put_char): Use `get_ccs_octet_table' and + `put_ccs_octet_table'. + (decoding_table_remove_char): Use `decoding_table_put_char'. + (DECODE_DEFINED_CHAR): Use `get_ccs_octet_table'. + + * mule-charset.c (remove_char_ccs): Store Qunbound instead of Qnil + into encoding_table. + (make_charset): Use Qunbound instead Qnil as initial value of + decoding_table. + +2002-02-04 MORIOKA Tomohiko + + * chartab.c (map_over_uint8_byte_table): Set Qunbound if an + element is Qunloaded. + (map_over_uint16_byte_table): Likewise. + (map_over_byte_table): Likewise. + (map_char_table): Likewise for CHARTAB_RANGE_ALL in UTF-2000; when + CHARTAB_RANGE_CHARSET is specified in UTF-2000 with external + database support, load encoding-table of the specified + coded-charset if it is not loaded yet. + (save_uint8_byte_table): New function of UTF-2000 with external + database support. + (save_uint16_byte_table): Likewise. + (save_byte_table): Likewise. + (Fput_char_attribute): Don't store value into external database + even if the external database feature is supported in UTF-2000; + set `attribute' as name of char-table if the external database + feature is supported. + (Fsave_char_attribute_table): New function in UTF-2000. + (syms_of_chartab): Add new builtin function + `save-char-attribute-table' in UTF-2000. + +2002-02-03 MORIOKA Tomohiko + + * chartab.c (char_attribute_table_to_put): New variable in + UTF-2000. + (Qput_char_table_map_function): Likewise. + (value_to_put): Likewise. + (Fput_char_table_map_function): New function in UTF-2000. + (put_char_table): Use `Fmap_char_attribute' for + CHARTAB_RANGE_CHARSET in UTF-2000. + (Fput_char_attribute): Store symbol instead of string in + `XCHAR_TABLE_NAME (table)'. + (load_char_attribute_maybe): Likewise. + (syms_of_chartab): Add new symbol/function + `put-char-table-map-function'. + +2002-01-30 MORIOKA Tomohiko + + * database.h: Add new EXFUN for `Fmap_database'. + + * database.c (Fmap_database): Renamed from `Fmapdatabase'. + (syms_of_database): Likewise. + + * chartab.h (struct Lisp_Char_Table): Add new member `unloaded' in + UTF-2000. + (CHAR_TABLE_UNLOADED): New macro of UTF-2000. + (XCHAR_TABLE_UNLOADED): Likewise. + + * chartab.c (fill_char_table): Initialize `ct->unloaded'. + (Fput_char_attribute): Set XCHAR_TABLE_UNLOADED(table) if + HAVE_DATABASE is defined. + (char_attribute_table_to_load): New variable of UTF-2000 with + external database support. + (Qload_char_attribute_table_map_function): Likewise. + (Fload_char_attribute_table_map_function): New function of + UTF-2000 with external database support. + (Fload_char_attribute_table): New function of UTF-2000. + (Fmap_char_attribute): Call Fload_char_attribute_table if + CHAR_TABLE_UNLOADED(ct) is set when HAVE_DATABASE is defined. + (syms_of_chartab): Add new symbol and function + `load-char-attribute-table-map-function' in UTF-2000 with external + database support; add new function `load-char-attribute-table' in + UTF-2000. + +2002-01-29 MORIOKA Tomohiko + + * chartab.h (load_char_attribute_maybe): New prototype for + UTF-2000 with DATABASE support. + (get_char_id_table): Use `load_char_attribute_maybe' if + HAVE_DATABASE is defined. + + * chartab.c (load_char_attribute_maybe): New function in UTF-2000 + with DATABASE support. + +2002-01-29 MORIOKA Tomohiko + + * chartab.c (Fput_char_attribute): Use S-expression as key of + external database. + + * chartab.h (get_char_id_table): Use S-expression as key of + external database. + +2002-01-24 MORIOKA Tomohiko + + * chartab.c (map_over_uint8_byte_table): Add new argument `root'; + if an element is not loaded, load the corresponding attributes + from an external database. + (map_over_uint16_byte_table): Likewise. + (map_over_byte_table): Likewise. + (map_char_table): Modify for `map_over_uint8_byte_table', + `map_over_uint16_byte_table' and `map_over_byte_table'; if an + element is not loaded, load the corresponding attributes from an + external database. + (Fput_char_attribute): Change initial values to Qunloaded. + + * chartab.h (get_char_id_table): If a character attribute is not + loaded and the attribute value is not found in an external + database, store Qunbound as the attribute value. + +2002-01-22 MORIOKA Tomohiko + + * chartab.c (BT_UINT8_unloaded): New macro. + (UINT8_VALUE_P): Accept Qunloaded. + (UINT8_ENCODE): Likewise. + (UINT8_DECODE): Likewise. + (BT_UINT16_unloaded): New macro. + (UINT16_VALUE_P): Accept Qunloaded. + (UINT16_ENCODE): Likewise. + (UINT16_DECODE): Likewise. + (UINT8_TO_UINT16): Convert BT_UINT8_unloaded into + BT_UINT16_unloaded. + (mark_char_table): Mark `ct->name' in UTF-2000. + (char_table_description): Add `name' in UTF-2000. + (Fmake_char_table): Initialize `ct->name'. + (Fcopy_char_table): Copy `ct->name'. + (Fput_char_attribute): Store value into an external database if + HAVE_DATABASE is defined. + + * chartab.h (struct Lisp_Char_Table): Add new member `name' in + UTF-2000. + (CHAR_TABLE_NAME): New macro in UTF-2000. + (XCHAR_TABLE_NAME): New macro in UTF-2000. + (get_char_id_table): Try to read an external database if Qunloaded + is stored in a table. + + * symbols.c (init_symbols_once_early): Assign '# into + Qunloaded. + +2002-01-21 MORIOKA Tomohiko + + * database.h: Add EXFUN definitions for Fopen_database, + Fput_database, Fget_database and Fclose_database. + + * data.c (Qunloaded): New variable in UTF-2000. + + * lisp.h (Qunloaded): New variable in UTF-2000. + 2002-01-10 MORIOKA Tomohiko * mule-charset.c (put_char_ccs_code_point): Modify for diff --git a/src/char-ucs.h b/src/char-ucs.h index efb22a0..dddb82e 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -1,5 +1,5 @@ /* Header for UCS-4 character representation. - Copyright (C) 1999,2000,2001 MORIOKA Tomohiko + Copyright (C) 1999,2000,2001,2002 MORIOKA Tomohiko This file is part of XEmacs. @@ -24,6 +24,8 @@ Boston, MA 02111-1307, USA. */ #include "chartab.h" #include "elhash.h" +EXFUN (Fmake_directory_internal, 1); + extern Lisp_Object Vchar_attribute_hash_table; #define valid_char_p(ch) 1 @@ -327,6 +329,18 @@ DECLARE_LRECORD (charset, Lisp_Charset); #define CHARSET_MOTHER(cs) ((cs)->mother) #define CHARSET_CONVERSION(cs) ((cs)->conversion) +INLINE_HEADER int CHARSET_BYTE_SIZE (Lisp_Charset* cs); +INLINE_HEADER int +CHARSET_BYTE_SIZE (Lisp_Charset* cs) +{ + /* ad-hoc method for `ascii' */ + if ((CHARSET_CHARS (cs) == 94) && + (CHARSET_BYTE_OFFSET (cs) != 33)) + return 128 - CHARSET_BYTE_OFFSET (cs); + else + return CHARSET_CHARS (cs); +} + INLINE_HEADER Lisp_Object CHARSET_ENCODING_TABLE (Lisp_Charset* cs); INLINE_HEADER Lisp_Object CHARSET_ENCODING_TABLE (Lisp_Charset* cs) @@ -353,6 +367,7 @@ CHARSET_ENCODING_TABLE (Lisp_Charset* cs) #define XCHARSET_CCL_PROGRAM(cs) CHARSET_CCL_PROGRAM (XCHARSET (cs)) #define XCHARSET_DIMENSION(cs) CHARSET_DIMENSION (XCHARSET (cs)) #define XCHARSET_CHARS(cs) CHARSET_CHARS (XCHARSET (cs)) +#define XCHARSET_BYTE_SIZE(cs) CHARSET_BYTE_SIZE (XCHARSET (cs)) #define XCHARSET_REVERSE_DIRECTION_CHARSET(cs) \ CHARSET_REVERSE_DIRECTION_CHARSET (XCHARSET (cs)) #define XCHARSET_DECODING_TABLE(cs) CHARSET_DECODING_TABLE(XCHARSET(cs)) @@ -501,31 +516,49 @@ extern Lisp_Object Vcharset_chinese_big5; extern Lisp_Object Vcharset_chinese_big5_1; extern Lisp_Object Vcharset_chinese_big5_2; -int decoding_table_check_elements (Lisp_Object v, int dim, int ccs_len); - -INLINE_HEADER void -decoding_table_remove_char (Lisp_Object ccs, int code_point); -INLINE_HEADER void -decoding_table_remove_char (Lisp_Object ccs, int code_point) +INLINE_HEADER Lisp_Object +get_ccs_octet_table (Lisp_Object table, Lisp_Object ccs, int code); +INLINE_HEADER Lisp_Object +get_ccs_octet_table (Lisp_Object table, Lisp_Object ccs, int code) { - Lisp_Object v = XCHARSET_DECODING_TABLE (ccs); - int dim = XCHARSET_DIMENSION (ccs); int byte_offset = XCHARSET_BYTE_OFFSET (ccs); - int i = -1; - while (dim > 0) + if (VECTORP (table)) { - Lisp_Object nv; + int idx = code - byte_offset; - dim--; - i = ((code_point >> (8 * dim)) & 255) - byte_offset; - nv = XVECTOR_DATA(v)[i]; - if (!VECTORP (nv)) - break; - v = nv; + if (idx < XVECTOR_LENGTH(table)) + return XVECTOR_DATA(table)[idx]; + else + return Qunbound; + } + else + return table; +} + +INLINE_HEADER Lisp_Object +put_ccs_octet_table (Lisp_Object table, Lisp_Object ccs, int code, + Lisp_Object value); +INLINE_HEADER Lisp_Object +put_ccs_octet_table (Lisp_Object table, Lisp_Object ccs, int code, + Lisp_Object value) +{ + int byte_offset = XCHARSET_BYTE_OFFSET (ccs); + int ccs_len = XCHARSET_BYTE_SIZE (ccs); + + if (VECTORP (table)) + { + XVECTOR_DATA(table)[code - byte_offset] = value; + return table; + } + else if (EQ (table, value)) + return table; + else + { + table = make_vector (ccs_len, table); + XVECTOR_DATA(table)[code - byte_offset] = value; + return table; } - if (i >= 0) - XVECTOR_DATA(v)[i] = Qnil; } INLINE_HEADER void @@ -535,6 +568,59 @@ INLINE_HEADER void decoding_table_put_char (Lisp_Object ccs, int code_point, Lisp_Object character) { +#if 1 + Lisp_Object table1 = XCHARSET_DECODING_TABLE (ccs); + int dim = XCHARSET_DIMENSION (ccs); + + if (dim == 1) + XCHARSET_DECODING_TABLE (ccs) + = put_ccs_octet_table (table1, ccs, code_point, character); + else if (dim == 2) + { + Lisp_Object table2 + = get_ccs_octet_table (table1, ccs, (unsigned char)(code_point >> 8)); + + table2 = put_ccs_octet_table (table2, ccs, + (unsigned char)code_point, character); + XCHARSET_DECODING_TABLE (ccs) + = put_ccs_octet_table (table1, ccs, + (unsigned char)(code_point >> 8), table2); + } + else if (dim == 3) + { + Lisp_Object table2 + = get_ccs_octet_table (table1, ccs, (unsigned char)(code_point >> 16)); + Lisp_Object table3 + = get_ccs_octet_table (table2, ccs, (unsigned char)(code_point >> 8)); + + table3 = put_ccs_octet_table (table3, ccs, + (unsigned char)code_point, character); + table2 = put_ccs_octet_table (table2, ccs, + (unsigned char)(code_point >> 8), table3); + XCHARSET_DECODING_TABLE (ccs) + = put_ccs_octet_table (table1, ccs, + (unsigned char)(code_point >> 16), table2); + } + else /* if (dim == 4) */ + { + Lisp_Object table2 + = get_ccs_octet_table (table1, ccs, (unsigned char)(code_point >> 24)); + Lisp_Object table3 + = get_ccs_octet_table (table2, ccs, (unsigned char)(code_point >> 16)); + Lisp_Object table4 + = get_ccs_octet_table (table3, ccs, (unsigned char)(code_point >> 8)); + + table4 = put_ccs_octet_table (table4, ccs, + (unsigned char)code_point, character); + table3 = put_ccs_octet_table (table3, ccs, + (unsigned char)(code_point >> 8), table4); + table2 = put_ccs_octet_table (table2, ccs, + (unsigned char)(code_point >> 16), table3); + XCHARSET_DECODING_TABLE (ccs) + = put_ccs_octet_table (table1, ccs, + (unsigned char)(code_point >> 24), table2); + } +#else Lisp_Object v = XCHARSET_DECODING_TABLE (ccs); int dim = XCHARSET_DIMENSION (ccs); int byte_offset = XCHARSET_BYTE_OFFSET (ccs); @@ -550,43 +636,60 @@ decoding_table_put_char (Lisp_Object ccs, if (dim > 0) { if (!VECTORP (nv)) - nv = (XVECTOR_DATA(v)[i] = make_vector (ccs_len, Qnil)); + { + if (EQ (nv, character)) + return; + else + nv = (XVECTOR_DATA(v)[i] = make_vector (ccs_len, Qnil)); + } v = nv; } else break; } XVECTOR_DATA(v)[i] = character; +#endif } +INLINE_HEADER void +decoding_table_remove_char (Lisp_Object ccs, int code_point); +INLINE_HEADER void +decoding_table_remove_char (Lisp_Object ccs, int code_point) +{ + decoding_table_put_char (ccs, code_point, Qunbound); +} + +#ifdef HAVE_DATABASE +Emchar load_char_decoding_entry_maybe (Lisp_Object ccs, int code_point); +#endif + INLINE_HEADER Emchar DECODE_DEFINED_CHAR (Lisp_Object charset, int code_point); INLINE_HEADER Emchar -DECODE_DEFINED_CHAR (Lisp_Object charset, int code_point) +DECODE_DEFINED_CHAR (Lisp_Object ccs, int code_point) { - int dim = XCHARSET_DIMENSION (charset); - Lisp_Object decoding_table = XCHARSET_DECODING_TABLE (charset); - int idx; - Lisp_Object ch; + int dim = XCHARSET_DIMENSION (ccs); + Lisp_Object decoding_table = XCHARSET_DECODING_TABLE (ccs); while (dim > 0) { dim--; - if ( VECTORP (decoding_table) - && ( 0 <= (idx = ((code_point >> (dim * 8)) - & 255) - XCHARSET_BYTE_OFFSET (charset)) ) - && ( idx < XVECTOR_LENGTH (decoding_table) ) - && !NILP (ch = XVECTOR_DATA(decoding_table)[idx]) ) - { - if (CHARP (ch)) - return XCHAR (ch); - else - decoding_table = ch; - } - else - break; + decoding_table + = get_ccs_octet_table (decoding_table, ccs, + (code_point >> (dim * 8)) & 255); } - return -1; + if (CHARP (decoding_table)) + return XCHAR (decoding_table); +#ifdef HAVE_DATABASE + if (EQ (decoding_table, Qunloaded) || + EQ (decoding_table, Qunbound) || + NILP (decoding_table) ) + { + return load_char_decoding_entry_maybe (ccs, code_point); + } +#endif + else + return -1; } INLINE_HEADER Emchar DECODE_CHAR (Lisp_Object charset, int code_point); diff --git a/src/chartab.c b/src/chartab.c index cd30619..1e97ca2 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -4,7 +4,7 @@ Copyright (C) 1995, 1996 Ben Wing. Copyright (C) 1995, 1997, 1999 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 1999,2000,2001 MORIOKA Tomohiko + Copyright (C) 1999,2000,2001,2002 MORIOKA Tomohiko This file is part of XEmacs. @@ -68,10 +68,11 @@ Lisp_Object Vword_combining_categories, Vword_separating_categories; #ifdef UTF2000 #define BT_UINT8_MIN 0 -#define BT_UINT8_MAX (UCHAR_MAX - 3) -#define BT_UINT8_t (UCHAR_MAX - 2) -#define BT_UINT8_nil (UCHAR_MAX - 1) -#define BT_UINT8_unbound UCHAR_MAX +#define BT_UINT8_MAX (UCHAR_MAX - 4) +#define BT_UINT8_t (UCHAR_MAX - 3) +#define BT_UINT8_nil (UCHAR_MAX - 2) +#define BT_UINT8_unbound (UCHAR_MAX - 1) +#define BT_UINT8_unloaded UCHAR_MAX INLINE_HEADER int INT_UINT8_P (Lisp_Object obj); INLINE_HEADER int UINT8_VALUE_P (Lisp_Object obj); @@ -95,14 +96,16 @@ INT_UINT8_P (Lisp_Object obj) INLINE_HEADER int UINT8_VALUE_P (Lisp_Object obj) { - return EQ (obj, Qunbound) + return EQ (obj, Qunloaded) || EQ (obj, Qunbound) || EQ (obj, Qnil) || EQ (obj, Qt) || INT_UINT8_P (obj); } INLINE_HEADER unsigned char UINT8_ENCODE (Lisp_Object obj) { - if (EQ (obj, Qunbound)) + if (EQ (obj, Qunloaded)) + return BT_UINT8_unloaded; + else if (EQ (obj, Qunbound)) return BT_UINT8_unbound; else if (EQ (obj, Qnil)) return BT_UINT8_nil; @@ -115,7 +118,9 @@ UINT8_ENCODE (Lisp_Object obj) INLINE_HEADER Lisp_Object UINT8_DECODE (unsigned char n) { - if (n == BT_UINT8_unbound) + if (n == BT_UINT8_unloaded) + return Qunloaded; + else if (n == BT_UINT8_unbound) return Qunbound; else if (n == BT_UINT8_nil) return Qnil; @@ -254,7 +259,8 @@ uint8_byte_table_same_value_p (Lisp_Object obj) } static int -map_over_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Emchar ofs, int place, +map_over_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Lisp_Char_Table* root, + Emchar ofs, int place, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg) @@ -269,7 +275,26 @@ map_over_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Emchar ofs, int place, for (i = 0, retval = 0; i < 256 && retval == 0; i++) { - if (ct->property[i] != BT_UINT8_unbound) + if (ct->property[i] == BT_UINT8_unloaded) + { +#if 0 + c1 = c + unit; + for (; c < c1 && retval == 0; c++) + { + Lisp_Object ret = get_char_id_table (root, c); + + if (!UNBOUNDP (ret)) + { + rainj.ch = c; + retval = (fn) (&rainj, ret, arg); + } + } +#else + ct->property[i] = BT_UINT8_unbound; + c += unit; +#endif + } + else if (ct->property[i] != BT_UINT8_unbound) { c1 = c + unit; for (; c < c1 && retval == 0; c++) @@ -284,11 +309,50 @@ map_over_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Emchar ofs, int place, return retval; } +#ifdef HAVE_DATABASE +static void +save_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Lisp_Char_Table* root, + Lisp_Object db, + Emchar ofs, int place) +{ + struct chartab_range rainj; + int i, retval; + int unit = 1 << (8 * place); + Emchar c = ofs; + Emchar c1; + + rainj.type = CHARTAB_RANGE_CHAR; + + for (i = 0, retval = 0; i < 256 && retval == 0; i++) + { + if (ct->property[i] == BT_UINT8_unloaded) + { + c1 = c + unit; + } + else if (ct->property[i] != BT_UINT8_unbound) + { + c1 = c + unit; + for (; c < c1 && retval == 0; c++) + { + Fput_database (Fprin1_to_string (make_char (c), Qnil), + Fprin1_to_string (UINT8_DECODE (ct->property[i]), + Qnil), + db, Qt); + put_char_id_table (root, make_char (c), Qunloaded); + } + } + else + c += unit; + } +} +#endif + #define BT_UINT16_MIN 0 -#define BT_UINT16_MAX (USHRT_MAX - 3) -#define BT_UINT16_t (USHRT_MAX - 2) -#define BT_UINT16_nil (USHRT_MAX - 1) -#define BT_UINT16_unbound USHRT_MAX +#define BT_UINT16_MAX (USHRT_MAX - 4) +#define BT_UINT16_t (USHRT_MAX - 3) +#define BT_UINT16_nil (USHRT_MAX - 2) +#define BT_UINT16_unbound (USHRT_MAX - 1) +#define BT_UINT16_unloaded USHRT_MAX INLINE_HEADER int INT_UINT16_P (Lisp_Object obj); INLINE_HEADER int UINT16_VALUE_P (Lisp_Object obj); @@ -311,14 +375,16 @@ INT_UINT16_P (Lisp_Object obj) INLINE_HEADER int UINT16_VALUE_P (Lisp_Object obj) { - return EQ (obj, Qunbound) + return EQ (obj, Qunloaded) || EQ (obj, Qunbound) || EQ (obj, Qnil) || EQ (obj, Qt) || INT_UINT16_P (obj); } INLINE_HEADER unsigned short UINT16_ENCODE (Lisp_Object obj) { - if (EQ (obj, Qunbound)) + if (EQ (obj, Qunloaded)) + return BT_UINT16_unloaded; + else if (EQ (obj, Qunbound)) return BT_UINT16_unbound; else if (EQ (obj, Qnil)) return BT_UINT16_nil; @@ -331,7 +397,9 @@ UINT16_ENCODE (Lisp_Object obj) INLINE_HEADER Lisp_Object UINT16_DECODE (unsigned short n) { - if (n == BT_UINT16_unbound) + if (n == BT_UINT16_unloaded) + return Qunloaded; + else if (n == BT_UINT16_unbound) return Qunbound; else if (n == BT_UINT16_nil) return Qnil; @@ -344,7 +412,9 @@ UINT16_DECODE (unsigned short n) INLINE_HEADER unsigned short UINT8_TO_UINT16 (unsigned char n) { - if (n == BT_UINT8_unbound) + if (n == BT_UINT8_unloaded) + return BT_UINT16_unloaded; + else if (n == BT_UINT8_unbound) return BT_UINT16_unbound; else if (n == BT_UINT8_nil) return BT_UINT16_nil; @@ -501,7 +571,8 @@ uint16_byte_table_same_value_p (Lisp_Object obj) } static int -map_over_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Emchar ofs, int place, +map_over_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Lisp_Char_Table* root, + Emchar ofs, int place, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg) @@ -516,7 +587,26 @@ map_over_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Emchar ofs, int place, for (i = 0, retval = 0; i < 256 && retval == 0; i++) { - if (ct->property[i] != BT_UINT16_unbound) + if (ct->property[i] == BT_UINT16_unloaded) + { +#if 0 + c1 = c + unit; + for (; c < c1 && retval == 0; c++) + { + Lisp_Object ret = get_char_id_table (root, c); + + if (!UNBOUNDP (ret)) + { + rainj.ch = c; + retval = (fn) (&rainj, ret, arg); + } + } +#else + ct->property[i] = BT_UINT16_unbound; + c += unit; +#endif + } + else if (ct->property[i] != BT_UINT16_unbound) { c1 = c + unit; for (; c < c1 && retval == 0; c++) @@ -531,6 +621,44 @@ map_over_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Emchar ofs, int place, return retval; } +#ifdef HAVE_DATABASE +static void +save_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Lisp_Char_Table* root, + Lisp_Object db, + Emchar ofs, int place) +{ + struct chartab_range rainj; + int i, retval; + int unit = 1 << (8 * place); + Emchar c = ofs; + Emchar c1; + + rainj.type = CHARTAB_RANGE_CHAR; + + for (i = 0, retval = 0; i < 256 && retval == 0; i++) + { + if (ct->property[i] == BT_UINT16_unloaded) + { + c1 = c + unit; + } + else if (ct->property[i] != BT_UINT16_unbound) + { + c1 = c + unit; + for (; c < c1 && retval == 0; c++) + { + Fput_database (Fprin1_to_string (make_char (c), Qnil), + Fprin1_to_string (UINT16_DECODE (ct->property[i]), + Qnil), + db, Qt); + put_char_id_table (root, make_char (c), Qunloaded); + } + } + else + c += unit; + } +} +#endif + static Lisp_Object mark_byte_table (Lisp_Object obj) @@ -678,7 +806,8 @@ byte_table_same_value_p (Lisp_Object obj) } static int -map_over_byte_table (Lisp_Byte_Table *ct, Emchar ofs, int place, +map_over_byte_table (Lisp_Byte_Table *ct, Lisp_Char_Table* root, + Emchar ofs, int place, int (*fn) (struct chartab_range *range, Lisp_Object val, void *arg), void *arg) @@ -694,23 +823,46 @@ map_over_byte_table (Lisp_Byte_Table *ct, Emchar ofs, int place, if (UINT8_BYTE_TABLE_P (v)) { retval - = map_over_uint8_byte_table (XUINT8_BYTE_TABLE(v), + = map_over_uint8_byte_table (XUINT8_BYTE_TABLE(v), root, c, place - 1, fn, arg); c += unit; } else if (UINT16_BYTE_TABLE_P (v)) { retval - = map_over_uint16_byte_table (XUINT16_BYTE_TABLE(v), + = map_over_uint16_byte_table (XUINT16_BYTE_TABLE(v), root, c, place - 1, fn, arg); c += unit; } else if (BYTE_TABLE_P (v)) { - retval = map_over_byte_table (XBYTE_TABLE(v), + retval = map_over_byte_table (XBYTE_TABLE(v), root, c, place - 1, fn, arg); c += unit; } + else if (EQ (v, Qunloaded)) + { +#if 0 + struct chartab_range rainj; + Emchar c1 = c + unit; + + rainj.type = CHARTAB_RANGE_CHAR; + + for (; c < c1 && retval == 0; c++) + { + Lisp_Object ret = get_char_id_table (root, c); + + if (!UNBOUNDP (ret)) + { + rainj.ch = c; + retval = (fn) (&rainj, ret, arg); + } + } +#else + ct->property[i] = Qunbound; + c += unit; +#endif + } else if (!UNBOUNDP (v)) { struct chartab_range rainj; @@ -730,6 +882,62 @@ map_over_byte_table (Lisp_Byte_Table *ct, Emchar ofs, int place, return retval; } +#ifdef HAVE_DATABASE +static void +save_byte_table (Lisp_Byte_Table *ct, Lisp_Char_Table* root, + Lisp_Object db, + Emchar ofs, int place) +{ + int i, retval; + Lisp_Object v; + int unit = 1 << (8 * place); + Emchar c = ofs; + + for (i = 0, retval = 0; i < 256 && retval == 0; i++) + { + v = ct->property[i]; + if (UINT8_BYTE_TABLE_P (v)) + { + save_uint8_byte_table (XUINT8_BYTE_TABLE(v), root, db, + c, place - 1); + c += unit; + } + else if (UINT16_BYTE_TABLE_P (v)) + { + save_uint16_byte_table (XUINT16_BYTE_TABLE(v), root, db, + c, place - 1); + c += unit; + } + else if (BYTE_TABLE_P (v)) + { + save_byte_table (XBYTE_TABLE(v), root, db, + c, place - 1); + c += unit; + } + else if (EQ (v, Qunloaded)) + { + c += unit; + } + else if (!UNBOUNDP (v)) + { + struct chartab_range rainj; + Emchar c1 = c + unit; + + rainj.type = CHARTAB_RANGE_CHAR; + + for (; c < c1 && retval == 0; c++) + { + Fput_database (Fprin1_to_string (make_char (c), Qnil), + Fprin1_to_string (v, Qnil), + db, Qt); + put_char_id_table (root, make_char (c), Qunloaded); + } + } + else + c += unit; + } +} +#endif Lisp_Object get_byte_table (Lisp_Object table, unsigned char idx) @@ -852,9 +1060,12 @@ Lisp_Object Vcharacter_composition_table; Lisp_Object Vcharacter_variant_table; +Lisp_Object Qsystem_char_id; + Lisp_Object Q_decomposition; Lisp_Object Qto_ucs; Lisp_Object Q_ucs; +Lisp_Object Q_ucs_variants; Lisp_Object Qcompat; Lisp_Object Qisolated; Lisp_Object Qinitial; @@ -956,10 +1167,15 @@ Return variants of CHARACTER. */ (character)) { + Lisp_Object ret; + CHECK_CHAR (character); - return Fcopy_list (get_char_id_table - (XCHAR_TABLE(Vcharacter_variant_table), - XCHAR (character))); + ret = get_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), + XCHAR(character)); + if (CONSP (ret)) + return Fcopy_list (ret); + else + return Qnil; } #endif @@ -1056,6 +1272,7 @@ mark_char_table (Lisp_Object obj) #ifdef UTF2000 mark_object (ct->table); + mark_object (ct->name); #else int i; @@ -1384,6 +1601,7 @@ static const struct lrecord_description char_table_description[] = { #ifdef UTF2000 { XD_LISP_OBJECT, offsetof(Lisp_Char_Table, table) }, { XD_LISP_OBJECT, offsetof(Lisp_Char_Table, default_value) }, + { XD_LISP_OBJECT, offsetof(Lisp_Char_Table, name) }, #else { XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, ascii), NUM_ASCII_CHARS }, #ifdef MULE @@ -1509,6 +1727,7 @@ fill_char_table (Lisp_Char_Table *ct, Lisp_Object value) #ifdef UTF2000 ct->table = Qunbound; ct->default_value = value; + ct->unloaded = 0; #else int i; @@ -1582,6 +1801,8 @@ and 'syntax. See `valid-char-table-type-p'. } else ct->mirror_table = Qnil; +#else + ct->name = Qnil; #endif ct->next_table = Qnil; XSETCHAR_TABLE (obj, ct); @@ -1654,6 +1875,8 @@ as CHAR-TABLE. The values will not themselves be copied. ctnew->type = ct->type; #ifdef UTF2000 ctnew->default_value = ct->default_value; + /* [tomo:2002-01-21] Perhaps this code seems wrong */ + ctnew->name = ct->name; if (UINT8_BYTE_TABLE_P (ct->table)) { @@ -2100,6 +2323,22 @@ Signal an error if VALUE is not a valid value for CHAR-TABLE-TYPE. return Qnil; } +#ifdef UTF2000 +Lisp_Char_Table* char_attribute_table_to_put; +Lisp_Object Qput_char_table_map_function; +Lisp_Object value_to_put; + +DEFUN ("put-char-table-map-function", + Fput_char_table_map_function, 2, 2, 0, /* +For internal use. Don't use it. +*/ + (c, value)) +{ + put_char_id_table_0 (char_attribute_table_to_put, c, value_to_put); + return Qnil; +} +#endif + /* Assign VAL to all characters in RANGE in char table CT. */ void @@ -2132,12 +2371,20 @@ put_char_table (Lisp_Char_Table *ct, struct chartab_range *range, */ if ( CHAR_TABLEP (encoding_table) ) { +#if 1 + char_attribute_table_to_put = ct; + value_to_put = val; + Fmap_char_attribute (Qput_char_table_map_function, + XCHAR_TABLE_NAME (encoding_table), + Qnil); +#else for (c = 0; c < 1 << 24; c++) { if ( INTP (get_char_id_table (XCHAR_TABLE(encoding_table), c)) ) put_char_id_table_0 (ct, c, val); } +#endif } else { @@ -2476,6 +2723,11 @@ map_char_table_for_charset_fun (struct chartab_range *range, return 0; } + +#if defined(HAVE_DATABASE) +EXFUN (Fload_char_attribute_table, 1); +#endif + #endif /* Map FN (with client data ARG) over range RANGE in char table CT. @@ -2504,17 +2756,17 @@ map_char_table (Lisp_Char_Table *ct, return retval; } if (UINT8_BYTE_TABLE_P (ct->table)) - return map_over_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table), + return map_over_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table), ct, 0, 3, fn, arg); else if (UINT16_BYTE_TABLE_P (ct->table)) - return map_over_uint16_byte_table (XUINT16_BYTE_TABLE(ct->table), + return map_over_uint16_byte_table (XUINT16_BYTE_TABLE(ct->table), ct, 0, 3, fn, arg); else if (BYTE_TABLE_P (ct->table)) - return map_over_byte_table (XBYTE_TABLE(ct->table), + return map_over_byte_table (XBYTE_TABLE(ct->table), ct, 0, 3, fn, arg); - else if (!UNBOUNDP (ct->table)) -#if 0 + else if (EQ (ct->table, Qunloaded)) { +#if 0 struct chartab_range rainj; int unit = 1 << 30; Emchar c = 0; @@ -2525,14 +2777,21 @@ map_char_table (Lisp_Char_Table *ct, for (retval = 0; c < c1 && retval == 0; c++) { - rainj.ch = c; - retval = (fn) (&rainj, ct->table, arg); + Lisp_Object ret = get_char_id_table (ct, c); + + if (!UNBOUNDP (ret)) + { + rainj.ch = c; + retval = (fn) (&rainj, ct->table, arg); + } } return retval; - } #else - return (fn) (range, ct->table, arg); + ct->table = Qunbound; #endif + } + else if (!UNBOUNDP (ct->table)) + return (fn) (range, ct->table, arg); return 0; #else { @@ -2579,6 +2838,10 @@ map_char_table (Lisp_Char_Table *ct, struct chartab_range rainj; struct map_char_table_for_charset_arg mcarg; +#ifdef HAVE_DATABASE + if (XCHAR_TABLE_UNLOADED(encoding_table)) + Fload_char_attribute_table (XCHAR_TABLE_NAME (encoding_table)); +#endif mcarg.fn = fn; mcarg.ct = ct; mcarg.arg = arg; @@ -2959,7 +3222,12 @@ Store CHARACTER's ATTRIBUTE with VALUE. = get_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), c); - if (NILP (Fmemq (v, ret))) + if (!CONSP (ret)) + { + put_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), + make_char (c), Fcons (character, Qnil)); + } + else if (NILP (Fmemq (v, ret))) { put_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), make_char (c), Fcons (character, ret)); @@ -2981,7 +3249,12 @@ Store CHARACTER's ATTRIBUTE with VALUE. c = XINT (value); ret = get_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), c); - if (NILP (Fmemq (character, ret))) + if (!CONSP (ret)) + { + put_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), + make_char (c), Fcons (character, Qnil)); + } + else if (NILP (Fmemq (character, ret))) { put_char_id_table (XCHAR_TABLE(Vcharacter_variant_table), make_char (c), Fcons (character, ret)); @@ -3000,6 +3273,9 @@ Store CHARACTER's ATTRIBUTE with VALUE. { table = make_char_id_table (Qunbound); Fputhash (attribute, table, Vchar_attribute_hash_table); +#ifdef HAVE_DATABASE + XCHAR_TABLE_NAME (table) = attribute; +#endif } put_char_id_table (XCHAR_TABLE(table), character, value); return value; @@ -3033,6 +3309,206 @@ Remove CHARACTER's ATTRIBUTE. return Qnil; } +Lisp_Object +char_attribute_system_db_file (Lisp_Object key_type, Lisp_Object attribute, + int writing_mode) +{ + Lisp_Object db_dir = Vexec_directory; + + if (NILP (db_dir)) + db_dir = build_string ("../lib-src"); + + db_dir = Fexpand_file_name (build_string ("char-db"), db_dir); + if (writing_mode && NILP (Ffile_exists_p (db_dir))) + Fmake_directory_internal (db_dir); + + db_dir = Fexpand_file_name (Fsymbol_name (key_type), db_dir); + if (writing_mode && NILP (Ffile_exists_p (db_dir))) + Fmake_directory_internal (db_dir); + + { + Lisp_Object attribute_name = Fsymbol_name (attribute); + Lisp_Object dest = Qnil, ret; + int base = 0; + struct gcpro gcpro1, gcpro2; + int len = XSTRING_CHAR_LENGTH (attribute_name); + int i; + + GCPRO2 (dest, ret); + for (i = 0; i < len; i++) + { + Emchar c = string_char (XSTRING (attribute_name), i); + + if ( (c == '/') || (c == '%') ) + { + char str[4]; + + sprintf (str, "%%%02X", c); + dest = concat3 (dest, + Fsubstring (attribute_name, + make_int (base), make_int (i)), + build_string (str)); + base = i + 1; + } + } + ret = Fsubstring (attribute_name, make_int (base), make_int (len)); + dest = concat2 (dest, ret); + UNGCPRO; + return Fexpand_file_name (dest, db_dir); + } +#if 0 + return Fexpand_file_name (Fsymbol_name (attribute), db_dir); +#endif +} + +DEFUN ("save-char-attribute-table", Fsave_char_attribute_table, 1, 1, 0, /* +Save values of ATTRIBUTE into database file. +*/ + (attribute)) +{ +#ifdef HAVE_DATABASE + Lisp_Object table = Fgethash (attribute, + Vchar_attribute_hash_table, Qunbound); + Lisp_Char_Table *ct; + Lisp_Object db; + Lisp_Object db_file; + + if (CHAR_TABLEP (table)) + ct = XCHAR_TABLE (table); + else + return Qnil; + + db_file = char_attribute_system_db_file (Qsystem_char_id, attribute, 1); + db = Fopen_database (db_file, Qnil, Qnil, Qnil, Qnil); + if (!NILP (db)) + { + if (UINT8_BYTE_TABLE_P (ct->table)) + save_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table), ct, db, 0, 3); + else if (UINT16_BYTE_TABLE_P (ct->table)) + save_uint16_byte_table (XUINT16_BYTE_TABLE(ct->table), ct, db, 0, 3); + else if (BYTE_TABLE_P (ct->table)) + save_byte_table (XBYTE_TABLE(ct->table), ct, db, 0, 3); + Fclose_database (db); + return Qt; + } + else + return Qnil; +#else + return Qnil; +#endif +} + +DEFUN ("reset-char-attribute-table", Freset_char_attribute_table, 1, 1, 0, /* +Reset values of ATTRIBUTE with database file. +*/ + (attribute)) +{ +#ifdef HAVE_DATABASE + Lisp_Object table = Fgethash (attribute, + Vchar_attribute_hash_table, Qunbound); + Lisp_Char_Table *ct; + Lisp_Object db_file + = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); + + if (!NILP (Ffile_exists_p (db_file))) + { + if (UNBOUNDP (table)) + { + table = make_char_id_table (Qunbound); + Fputhash (attribute, table, Vchar_attribute_hash_table); + XCHAR_TABLE_NAME(table) = attribute; + } + ct = XCHAR_TABLE (table); + ct->table = Qunloaded; + XCHAR_TABLE_UNLOADED(table) = 1; + return Qt; + } +#endif + return Qnil; +} + +#ifdef HAVE_DATABASE +Lisp_Object +load_char_attribute_maybe (Emchar ch, Lisp_Object attribute) +{ + Lisp_Object db; + Lisp_Object db_file + = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); + + db = Fopen_database (db_file, Qnil, Qnil, Qnil, Qnil); + if (!NILP (db)) + { + Lisp_Object val + = Fget_database (Fprin1_to_string (make_char (ch), Qnil), + db, Qunbound); + if (!UNBOUNDP (val)) + val = Fread (val); + else + val = Qunbound; + Fclose_database (db); + return val; + } + else + return Qunbound; +} + +Lisp_Char_Table* char_attribute_table_to_load; + +Lisp_Object Qload_char_attribute_table_map_function; + +DEFUN ("load-char-attribute-table-map-function", + Fload_char_attribute_table_map_function, 2, 2, 0, /* +For internal use. Don't use it. +*/ + (key, value)) +{ + Lisp_Object c = Fread (key); + Emchar code = XCHAR (c); + Lisp_Object ret = get_char_id_table (char_attribute_table_to_load, code); + + if (EQ (ret, Qunloaded)) + put_char_id_table_0 (char_attribute_table_to_load, code, Fread (value)); + return Qnil; +} +#endif + +DEFUN ("load-char-attribute-table", Fload_char_attribute_table, 1, 1, 0, /* +Load values of ATTRIBUTE into database file. +*/ + (attribute)) +{ +#ifdef HAVE_DATABASE + Lisp_Object db; + Lisp_Object db_file + = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); + + db = Fopen_database (db_file, Qnil, Qnil, Qnil, Qnil); + if (!NILP (db)) + { + Lisp_Object table = Fgethash (attribute, + Vchar_attribute_hash_table, + Qunbound); + struct gcpro gcpro1, gcpro2; + + if (CHAR_TABLEP (table)) + char_attribute_table_to_load = XCHAR_TABLE (table); + else + { + Fclose_database (db); + return Qnil; + } + GCPRO2 (db, table); + Fmap_database (Qload_char_attribute_table_map_function, db); + UNGCPRO; + Fclose_database (db); + XCHAR_TABLE_UNLOADED(table) = 0; + return Qt; + } + else + return Qnil; +#endif +} + DEFUN ("map-char-attribute", Fmap_char_attribute, 2, 3, 0, /* Map FUNCTION over entries in ATTRIBUTE, calling it with two args, each key and value in the table. @@ -3071,6 +3547,10 @@ the entire table. if (NILP (range)) range = Qt; decode_char_table_range (range, &rainj); +#ifdef HAVE_DATABASE + if (CHAR_TABLE_UNLOADED(ct)) + Fload_char_attribute_table (attribute); +#endif slarg.function = function; slarg.retval = Qnil; GCPRO2 (slarg.function, slarg.retval); @@ -3523,8 +4003,11 @@ syms_of_chartab (void) INIT_LRECORD_IMPLEMENTATION (uint16_byte_table); INIT_LRECORD_IMPLEMENTATION (byte_table); + defsymbol (&Qsystem_char_id, "system-char-id"); + defsymbol (&Qto_ucs, "=>ucs"); defsymbol (&Q_ucs, "->ucs"); + defsymbol (&Q_ucs_variants, "->ucs-variants"); defsymbol (&Q_decomposition, "->decomposition"); defsymbol (&Qcompat, "compat"); defsymbol (&Qisolated, "isolated"); @@ -3545,6 +4028,16 @@ syms_of_chartab (void) DEFSUBR (Fchar_attribute_list); DEFSUBR (Ffind_char_attribute_table); + defsymbol (&Qput_char_table_map_function, "put-char-table-map-function"); + DEFSUBR (Fput_char_table_map_function); + DEFSUBR (Fsave_char_attribute_table); + DEFSUBR (Freset_char_attribute_table); +#ifdef HAVE_DATABASE + defsymbol (&Qload_char_attribute_table_map_function, + "load-char-attribute-table-map-function"); + DEFSUBR (Fload_char_attribute_table_map_function); +#endif + DEFSUBR (Fload_char_attribute_table); DEFSUBR (Fchar_attribute_alist); DEFSUBR (Fget_char_attribute); DEFSUBR (Fput_char_attribute); @@ -3613,7 +4106,7 @@ Version number of XEmacs UTF-2000. Vcharacter_composition_table = make_char_id_table (Qnil); staticpro (&Vcharacter_variant_table); - Vcharacter_variant_table = make_char_id_table (Qnil); + Vcharacter_variant_table = make_char_id_table (Qunbound); #endif /* DO NOT staticpro this. It works just like Vweak_hash_tables. */ Vall_syntax_tables = Qnil; @@ -3638,6 +4131,11 @@ complex_vars_of_chartab (void) staticpro (&Vchar_attribute_hash_table); Vchar_attribute_hash_table = make_lisp_hash_table (16, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); +#ifdef HAVE_DATABASE + Fputhash (Q_ucs_variants, Vcharacter_variant_table, + Vchar_attribute_hash_table); + XCHAR_TABLE_NAME (Vcharacter_variant_table) = Q_ucs_variants; +#endif /* HAVE_DATABASE */ #endif /* UTF2000 */ #ifdef MULE /* Set this now, so first buffer creation can refer to it. */ diff --git a/src/chartab.h b/src/chartab.h index ca71025..faae39f 100644 --- a/src/chartab.h +++ b/src/chartab.h @@ -1,7 +1,7 @@ /* Declarations having to do with Mule char tables. Copyright (C) 1992 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1999,2000,2001 MORIOKA Tomohiko + Copyright (C) 1999,2000,2001,2002 MORIOKA Tomohiko This file is part of XEmacs. @@ -31,6 +31,10 @@ Boston, MA 02111-1307, USA. */ #ifdef UTF2000 +#ifdef HAVE_DATABASE +#include "database.h" +#endif + EXFUN (Fmake_char, 3); EXFUN (Fdecode_char, 3); @@ -161,6 +165,8 @@ struct Lisp_Char_Table #ifdef UTF2000 Lisp_Object table; Lisp_Object default_value; + Lisp_Object name; + unsigned char unloaded; #else Lisp_Object ascii[NUM_ASCII_CHARS]; @@ -217,6 +223,12 @@ DECLARE_LRECORD (char_table, Lisp_Char_Table); #ifdef UTF2000 +#define CHAR_TABLE_NAME(ct) ((ct)->name) +#define XCHAR_TABLE_NAME(ct) CHAR_TABLE_NAME (XCHAR_TABLE (ct)) + +#define CHAR_TABLE_UNLOADED(ct) ((ct)->unloaded) +#define XCHAR_TABLE_UNLOADED(ct) CHAR_TABLE_UNLOADED (XCHAR_TABLE (ct)) + INLINE_HEADER Lisp_Object CHAR_TABLE_VALUE_UNSAFE (Lisp_Char_Table *ct, Emchar ch); INLINE_HEADER Lisp_Object @@ -314,24 +326,6 @@ extern Lisp_Object Vall_syntax_tables; #ifdef UTF2000 -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); - if (UNBOUNDP (val)) - return cit->default_value; - else - return val; -} - INLINE_HEADER void put_char_id_table_0 (Lisp_Char_Table* cit, Emchar code, Lisp_Object value); INLINE_HEADER void @@ -350,6 +344,46 @@ put_char_id_table_0 (Lisp_Char_Table* cit, Emchar code, Lisp_Object value) cit->table = put_byte_table (table1, (unsigned char)(code >> 24), table2); } +#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; +} + void decode_char_table_range (Lisp_Object range, struct chartab_range *outrange); diff --git a/src/config.h.in b/src/config.h.in index eb0f45e..ca4037f 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -550,10 +550,15 @@ void *alloca (); if you're working with ASCII files. */ #undef MULE +/* Define this if you want UTF-2000 support (character representation + based on character object model). */ #undef UTF2000 #undef CHAR_IS_UCS4 +/* Compile in support for external character database. */ +#undef HAVE_CHISE_CLIENT + /* Define this if you want file coding support */ #undef FILE_CODING diff --git a/src/data.c b/src/data.c index b90b3ca..7651b02 100644 --- a/src/data.c +++ b/src/data.c @@ -39,6 +39,9 @@ Boston, MA 02111-1307, USA. */ #endif /* LISP_FLOAT_TYPE */ Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; +#ifdef UTF2000 +Lisp_Object Qunloaded; +#endif Lisp_Object Qerror_conditions, Qerror_message; Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; Lisp_Object Qlist_formation_error; diff --git a/src/database.c b/src/database.c index 79dd595..21cf7bc 100644 --- a/src/database.c +++ b/src/database.c @@ -769,7 +769,7 @@ If there is no corresponding value, return DEFAULT (defaults to nil). } } -DEFUN ("map-database", Fmapdatabase, 2, 2, 0, /* +DEFUN ("map-database", Fmap_database, 2, 2, 0, /* Map FUNCTION over entries in DATABASE, calling it with two args, each key and value in the database. */ @@ -804,7 +804,7 @@ syms_of_database (void) DEFSUBR (Fopen_database); DEFSUBR (Fdatabasep); - DEFSUBR (Fmapdatabase); + DEFSUBR (Fmap_database); DEFSUBR (Fput_database); DEFSUBR (Fget_database); DEFSUBR (Fremove_database); diff --git a/src/database.h b/src/database.h index aad2ca5..6fa1f74 100644 --- a/src/database.h +++ b/src/database.h @@ -27,4 +27,10 @@ Boston, MA 02111-1307, USA. */ typedef struct Lisp_Database Lisp_Database; DECLARE_LRECORD (database, Lisp_Database); +EXFUN (Fopen_database, 5); +EXFUN (Fput_database, 4); +EXFUN (Fget_database, 3); +EXFUN (Fclose_database, 1); +EXFUN (Fmap_database, 2); + #endif /* INCLUDED_database_h_ */ diff --git a/src/lisp.h b/src/lisp.h index f949f41..452b89d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3243,6 +3243,9 @@ extern Lisp_Object Qtext_image_instance_p; extern Lisp_Object Qtop_level; extern Lisp_Object Qtrue_list_p; extern Lisp_Object Qunbound, Qunderflow_error; +#ifdef UTF2000 +extern Lisp_Object Qunloaded; +#endif extern Lisp_Object Qunderline, Quser_files_and_directories; extern Lisp_Object Qvalues; extern Lisp_Object Qvariable_documentation, Qvariable_domain; diff --git a/src/mule-charset.c b/src/mule-charset.c index ce536d0..157e12b 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -1,7 +1,7 @@ /* Functions to handle multilingual characters. Copyright (C) 1992, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. - Copyright (C) 1999,2000,2001 MORIOKA Tomohiko + Copyright (C) 1999,2000,2001,2002 MORIOKA Tomohiko This file is part of XEmacs. @@ -176,20 +176,7 @@ const Bytecount rep_bytes_by_first_byte[0xA0] = #ifdef UTF2000 -INLINE_HEADER int CHARSET_BYTE_SIZE (Lisp_Charset* cs); -INLINE_HEADER int -CHARSET_BYTE_SIZE (Lisp_Charset* cs) -{ - /* ad-hoc method for `ascii' */ - if ((CHARSET_CHARS (cs) == 94) && - (CHARSET_BYTE_OFFSET (cs) != 33)) - return 128 - CHARSET_BYTE_OFFSET (cs); - else - return CHARSET_CHARS (cs); -} - -#define XCHARSET_BYTE_SIZE(ccs) CHARSET_BYTE_SIZE (XCHARSET (ccs)) - +int decoding_table_check_elements (Lisp_Object v, int dim, int ccs_len); int decoding_table_check_elements (Lisp_Object v, int dim, int ccs_len) { @@ -226,7 +213,6 @@ put_char_ccs_code_point (Lisp_Object character, || (XCHAR (character) != XINT (value))) { Lisp_Object v = XCHARSET_DECODING_TABLE (ccs); - int ccs_len = XCHARSET_BYTE_SIZE (ccs); int code_point; if (CONSP (value)) @@ -279,12 +265,6 @@ put_char_ccs_code_point (Lisp_Object character, decoding_table_remove_char (ccs, XINT (cpos)); } } - else - { - XCHARSET_DECODING_TABLE (ccs) - = v = make_vector (ccs_len, Qnil); - } - decoding_table_put_char (ccs, code_point, character); } return value; @@ -307,7 +287,7 @@ remove_char_ccs (Lisp_Object character, Lisp_Object ccs) } if (CHAR_TABLEP (encoding_table)) { - put_char_id_table (XCHAR_TABLE(encoding_table), character, Qnil); + put_char_id_table (XCHAR_TABLE(encoding_table), character, Qunbound); } return Qt; } @@ -837,7 +817,7 @@ make_charset (Charset_ID id, Lisp_Object name, CHARSET_CCL_PROGRAM (cs) = Qnil; CHARSET_REVERSE_DIRECTION_CHARSET (cs) = Qnil; #ifdef UTF2000 - CHARSET_DECODING_TABLE(cs) = Qnil; + CHARSET_DECODING_TABLE(cs) = Qunbound; CHARSET_MIN_CODE (cs) = min_code; CHARSET_MAX_CODE (cs) = max_code; CHARSET_CODE_OFFSET (cs) = code_offset; @@ -2043,7 +2023,183 @@ Set mapping-table of CHARSET to TABLE. } return table; } + +DEFUN ("save-charset-mapping-table", Fsave_charset_mapping_table, 1, 1, 0, /* +Save mapping-table of CHARSET. +*/ + (charset)) +{ +#ifdef HAVE_DATABASE + struct Lisp_Charset *cs; + int byte_min, byte_max; + Lisp_Object db; + Lisp_Object db_file; + + charset = Fget_charset (charset); + cs = XCHARSET (charset); + + db_file = char_attribute_system_db_file (CHARSET_NAME (cs), + Qsystem_char_id, 1); + db = Fopen_database (db_file, Qnil, Qnil, Qnil, Qnil); + + byte_min = CHARSET_BYTE_OFFSET (cs); + byte_max = byte_min + CHARSET_BYTE_SIZE (cs); + switch (CHARSET_DIMENSION (cs)) + { + case 1: + { + Lisp_Object table_c = XCHARSET_DECODING_TABLE (charset); + int cell; + + for (cell = byte_min; cell < byte_max; cell++) + { + Lisp_Object c = get_ccs_octet_table (table_c, charset, cell); + + if (CHARP (c)) + Fput_database (Fprin1_to_string (make_int (cell), Qnil), + Fprin1_to_string (c, Qnil), + db, Qt); + } + } + break; + case 2: + { + Lisp_Object table_r = XCHARSET_DECODING_TABLE (charset); + int row; + + for (row = byte_min; row < byte_max; row++) + { + Lisp_Object table_c = get_ccs_octet_table (table_r, charset, row); + int cell; + + for (cell = byte_min; cell < byte_max; cell++) + { + Lisp_Object c = get_ccs_octet_table (table_c, charset, cell); + + if (CHARP (c)) + Fput_database (Fprin1_to_string (make_int ((row << 8) + | cell), + Qnil), + Fprin1_to_string (c, Qnil), + db, Qt); + } + } + } + break; + case 3: + { + Lisp_Object table_p = XCHARSET_DECODING_TABLE (charset); + int plane; + + for (plane = byte_min; plane < byte_max; plane++) + { + Lisp_Object table_r + = get_ccs_octet_table (table_p, charset, plane); + int row; + + for (row = byte_min; row < byte_max; row++) + { + Lisp_Object table_c + = get_ccs_octet_table (table_r, charset, row); + int cell; + + for (cell = byte_min; cell < byte_max; cell++) + { + Lisp_Object c = get_ccs_octet_table (table_c, charset, + cell); + + if (CHARP (c)) + Fput_database (Fprin1_to_string (make_int ((plane << 16) + | (row << 8) + | cell), + Qnil), + Fprin1_to_string (c, Qnil), + db, Qt); + } + } + } + } + break; + default: + { + Lisp_Object table_g = XCHARSET_DECODING_TABLE (charset); + int group; + + for (group = byte_min; group < byte_max; group++) + { + Lisp_Object table_p + = get_ccs_octet_table (table_g, charset, group); + int plane; + + for (plane = byte_min; plane < byte_max; plane++) + { + Lisp_Object table_r + = get_ccs_octet_table (table_p, charset, plane); + int row; + + for (row = byte_min; row < byte_max; row++) + { + Lisp_Object table_c + = get_ccs_octet_table (table_r, charset, row); + int cell; + + for (cell = byte_min; cell < byte_max; cell++) + { + Lisp_Object c + = get_ccs_octet_table (table_c, charset, cell); + + if (CHARP (c)) + Fput_database (Fprin1_to_string + (make_int (( group << 24) + | (plane << 16) + | (row << 8) + | cell), + Qnil), + Fprin1_to_string (c, Qnil), + db, Qt); + } + } + } + } + } + } + return Fclose_database (db); +#else + return Qnil; #endif +} + +#ifdef HAVE_CHISE_CLIENT +Emchar +load_char_decoding_entry_maybe (Lisp_Object ccs, int code_point) +{ + Lisp_Object db; + Lisp_Object db_file + = char_attribute_system_db_file (XCHARSET_NAME(ccs), Qsystem_char_id, + 0); + + 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 /* HAVE_CHISE_CLIENT */ +#endif /* UTF2000 */ /************************************************************************/ @@ -2382,6 +2538,7 @@ syms_of_mule_charset (void) DEFSUBR (Fdecode_char); DEFSUBR (Fdecode_builtin_char); DEFSUBR (Fencode_char); + DEFSUBR (Fsave_charset_mapping_table); #endif DEFSUBR (Fmake_char); DEFSUBR (Fchar_charset); diff --git a/src/mule.c b/src/mule.c index 7e48dad..d790561 100644 --- a/src/mule.c +++ b/src/mule.c @@ -118,6 +118,10 @@ vars_of_mule (void) Fprovide (intern ("utf-2000")); #endif +#ifdef HAVE_CHISE_CLIENT + Fprovide (intern ("chise")); +#endif + #ifdef HAVE_EGG Fprovide (intern ("egg")); #endif diff --git a/src/symbols.c b/src/symbols.c index ae1dc92..c21a986 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -3264,6 +3264,11 @@ init_symbols_once_early (void) XSYMBOL (Qnil)->function = Qunbound; +#ifdef UTF2000 + /* [tomo:2002-01-22] We should not define Qunloaded as a normal symbol */ + defsymbol (&Qunloaded, "#"); +#endif + defsymbol (&Qt, "t"); XSYMBOL (Qt)->value = Qt; /* Veritas aeterna */ Vquit_flag = Qnil; -- 1.7.10.4