From a42ff4d79fc0a10305ce024b0d7b3125e366fc28 Mon Sep 17 00:00:00 2001 From: tomo Date: Tue, 2 Jul 2002 08:26:50 +0000 Subject: [PATCH] Add an EXFUN for `Fmap_char_attribute'. (Fsave_char_attribute_table): Don't check `ct->db_file' if `ct->db' is living. (load_char_attribute_maybe): Likewise. (Fload_char_attribute_table): Likewise. --- src/chartab.c | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/src/chartab.c b/src/chartab.c index 632589f..b95bad8 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -64,6 +64,11 @@ Lisp_Object Vword_combining_categories, Vword_separating_categories; #ifdef UTF2000 +#if defined(HAVE_DATABASE) +EXFUN (Fload_char_attribute_table, 1); +EXFUN (Fmap_char_attribute, 3); +#endif + #define BT_UINT8_MIN 0 #define BT_UINT8_MAX (UCHAR_MAX - 4) #define BT_UINT8_t (UCHAR_MAX - 3) @@ -2729,10 +2734,6 @@ 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. @@ -3381,11 +3382,13 @@ Save values of ATTRIBUTE into database file. else return Qnil; - if (NILP (ct->db_file)) - ct->db_file - = char_attribute_system_db_file (Qsystem_char_id, attribute, 1); if (NILP (Fdatabase_live_p (ct->db))) - ct->db = Fopen_database (ct->db_file, Qnil, Qnil, Qnil, Qnil); + { + if (NILP (ct->db_file)) + ct->db_file + = char_attribute_system_db_file (Qsystem_char_id, attribute, 1); + ct->db = Fopen_database (ct->db_file, Qnil, Qnil, Qnil, Qnil); + } if (!NILP (ct->db)) { if (UINT8_BYTE_TABLE_P (ct->table)) @@ -3472,11 +3475,14 @@ load_char_attribute_maybe (Lisp_Char_Table* cit, Emchar ch) if (!NILP (attribute)) { - if (NILP (cit->db_file)) - cit->db_file - = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); if (NILP (Fdatabase_live_p (cit->db))) - cit->db = Fopen_database (cit->db_file, Qnil, Qnil, Qnil, Qnil); + { + if (NILP (cit->db_file)) + cit->db_file + = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); + cit->db = Fopen_database (cit->db_file, Qnil, Qnil, Qnil, Qnil); + cit->db_file = Qnil; + } if (!NILP (cit->db)) { Lisp_Object val @@ -3525,11 +3531,14 @@ Load values of ATTRIBUTE into database file. { Lisp_Char_Table *ct = XCHAR_TABLE (table); - if (NILP (ct->db_file)) - ct->db_file - = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); if (NILP (Fdatabase_live_p (ct->db))) - ct->db = Fopen_database (ct->db_file, Qnil, Qnil, Qnil, Qnil); + { + if (NILP (ct->db_file)) + ct->db_file + = char_attribute_system_db_file (Qsystem_char_id, attribute, 0); + ct->db = Fopen_database (ct->db_file, Qnil, Qnil, Qnil, Qnil); + ct->db_file = Qnil; + } if (!NILP (ct->db)) { struct gcpro gcpro1; -- 1.7.10.4