mark_object (ct->table);
mark_object (ct->name);
- mark_object (ct->db_file);
mark_object (ct->db);
#else
int i;
{ 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) },
- { XD_LISP_OBJECT, offsetof(Lisp_Char_Table, db_file) },
{ XD_LISP_OBJECT, offsetof(Lisp_Char_Table, db) },
#else
{ XD_LISP_OBJECT_ARRAY, offsetof (Lisp_Char_Table, ascii), NUM_ASCII_CHARS },
ct->mirror_table = Qnil;
#else
ct->name = Qnil;
- ct->db_file = Qnil;
ct->db = Qnil;
#endif
ct->next_table = Qnil;
ctnew->default_value = ct->default_value;
/* [tomo:2002-01-21] Perhaps this code seems wrong */
ctnew->name = ct->name;
- ctnew->db_file = ct->db_file;
ctnew->db = ct->db;
if (UINT8_BYTE_TABLE_P (ct->table))
Lisp_Object table = Fgethash (attribute,
Vchar_attribute_hash_table, Qunbound);
Lisp_Char_Table *ct;
+ Lisp_Object db_file;
+ Lisp_Object db;
if (CHAR_TABLEP (table))
ct = XCHAR_TABLE (table);
else
return Qnil;
- if (NILP (Fdatabase_live_p (ct->db)))
- {
- 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))
+ db_file = char_attribute_system_db_file (Qsystem_char_id, attribute, 1);
+ db = Fopen_database (db_file, Qnil, Qnil, build_string ("w+"), Qnil);
+ if (!NILP (db))
{
if (UINT8_BYTE_TABLE_P (ct->table))
- save_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table), ct, ct->db, 0, 3);
+ 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, ct->db, 0, 3);
+ 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, ct->db, 0, 3);
- Fclose_database (ct->db);
- ct->db = Qnil;
+ save_byte_table (XBYTE_TABLE(ct->table), ct, db, 0, 3);
+ Fclose_database (db);
return Qt;
}
else
Fclose_database (ct->db);
ct->db = Qnil;
}
- ct->db_file = Qnil;
#endif
return Qnil;
}
}
ct = XCHAR_TABLE (table);
ct->table = Qunloaded;
- ct->db_file = db_file;
if (!NILP (Fdatabase_live_p (ct->db)))
Fclose_database (ct->db);
ct->db = Qnil;
{
if (NILP (Fdatabase_live_p (cit->db)))
{
- 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;
+ Lisp_Object db_file
+ = char_attribute_system_db_file (Qsystem_char_id, attribute, 0);
+
+ cit->db = Fopen_database (db_file, Qnil, Qnil, build_string ("r"), Qnil);
}
if (!NILP (cit->db))
{
if (NILP (Fdatabase_live_p (ct->db)))
{
- if (NILP (ct->db_file))
- ct->db_file
+ Lisp_Object 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;
+
+ ct->db = Fopen_database (db_file, Qnil, Qnil, build_string ("r"), Qnil);
}
if (!NILP (ct->db))
{