(Qcomposition): Add extern if external-DB feature is supported.
authortomo <tomo>
Tue, 16 Jul 2002 03:01:54 +0000 (03:01 +0000)
committertomo <tomo>
Tue, 16 Jul 2002 03:01:54 +0000 (03:01 +0000)
(Vcharacter_composition_table): Don't add extern if external-DB
feature is supported.
(COMPOSE_ADD_CHAR): Modify for new data-representation of character
composition rule if external-DB feature is supported.

src/text-coding.c

index 53ec90c..0baa923 100644 (file)
@@ -2260,7 +2260,11 @@ struct decoding_stream
 };
 
 #ifdef UTF2000
+#ifdef HAVE_DATABASE
+extern Lisp_Object Qcomposition;
+#else
 extern Lisp_Object Vcharacter_composition_table;
+#endif
 
 INLINE_HEADER void
 decode_flush_er_chars (struct decoding_stream *str, unsigned_char_dynarr* dst);
@@ -2405,11 +2409,22 @@ COMPOSE_ADD_CHAR (struct decoding_stream *str,
 {
   if (CODING_SYSTEM_DISABLE_COMPOSITION (str->codesys))
     decode_add_er_char (str, character, dst);
-  else if (!CHAR_TABLEP (str->combining_table))
+  else if (
+#ifdef HAVE_DATABASE
+          !CONSP (str->combining_table)
+#else
+          !CHAR_TABLEP (str->combining_table)
+#endif
+          )
     {
-      Lisp_Object ret
-       = get_char_id_table (XCHAR_TABLE(Vcharacter_composition_table),
-                            character);
+      Lisp_Object ret =
+#ifdef HAVE_DATABASE
+       Fget_char_attribute (make_char (character), Qcomposition, Qnil)
+#else
+       get_char_id_table (XCHAR_TABLE(Vcharacter_composition_table),
+                          character)
+#endif
+       ;
 
       if (NILP (ret))
        decode_add_er_char (str, character, dst);
@@ -2422,16 +2437,26 @@ COMPOSE_ADD_CHAR (struct decoding_stream *str,
     }
   else
     {
-      Lisp_Object ret
-       = get_char_id_table (XCHAR_TABLE(str->combining_table),
-                            character);
+      Lisp_Object ret =
+#ifdef HAVE_DATABASE
+       Fcdr (Fassq (make_char (character), str->combining_table))
+#else
+       get_char_id_table (XCHAR_TABLE(str->combining_table),
+                          character)
+#endif
+       ;
 
       if (CHARP (ret))
        {
          Emchar char2 = XCHARVAL (ret);
          ret =
+#ifdef HAVE_DATABASE
+           Fget_char_attribute (make_char (character), Qcomposition, Qnil)
+#else
            get_char_id_table (XCHAR_TABLE(Vcharacter_composition_table),
-                              char2);
+                              char2)
+#endif
+           ;
          if (NILP (ret))
            {
              decode_add_er_char (str, character, dst);
@@ -2445,11 +2470,13 @@ COMPOSE_ADD_CHAR (struct decoding_stream *str,
              str->combining_table = ret;
            }
        }
+#ifndef HAVE_DATABASE
       else if (CHAR_TABLEP (ret))
        {
          str->combined_chars[str->combined_char_count++] = character;
          str->combining_table = ret;
        }
+#endif
       else
        {
          COMPOSE_FLUSH_CHARS (str, dst);