EXFUN (Fmap_char_attribute, 3);
-#if defined(HAVE_CHISE_CLIENT)
+#ifdef HAVE_CHISE
EXFUN (Fload_char_attribute_table, 1);
Lisp_Object Vchar_db_stingy_mode;
return retval;
}
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
static void
save_uint8_byte_table (Lisp_Uint8_Byte_Table *ct, Lisp_Char_Table* root,
#ifdef HAVE_LIBCHISE
return retval;
}
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
static void
save_uint16_byte_table (Lisp_Uint16_Byte_Table *ct, Lisp_Char_Table* root,
#ifdef HAVE_LIBCHISE
return retval;
}
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
static void
save_byte_table (Lisp_Byte_Table *ct, Lisp_Char_Table* root,
#ifdef HAVE_LIBCHISE
{
Lisp_Object ret = get_char_id_table (ct, ch);
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
if (NILP (ret))
{
if (EQ (CHAR_TABLE_NAME (ct), Qdowncase))
struct chartab_range rainj;
struct map_char_table_for_charset_arg mcarg;
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
if (XCHAR_TABLE_UNLOADED(encoding_table))
Fload_char_attribute_table (XCHAR_TABLE_NAME (encoding_table));
#endif
{
table = make_char_id_table (Qunbound);
Fputhash (attribute, table, Vchar_attribute_hash_table);
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
XCHAR_TABLE_NAME (table) = attribute;
#endif
}
return Qnil;
}
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
int char_table_open_db_maybe (Lisp_Char_Table* cit);
void char_table_close_db_maybe (Lisp_Char_Table* cit);
Lisp_Object char_table_get_db (Lisp_Char_Table* cit, Emchar ch);
+#ifdef HAVE_LIBCHISE
int
open_chise_data_source_maybe ()
{
}
return 0;
}
+#endif /* HAVE_LIBCHISE */
DEFUN ("close-char-data-source", Fclose_char_data_source, 0, 0, 0, /*
Close data-source of CHISE.
default_chise_data_source = NULL;
if (status)
return Qt;
-#endif
+#endif /* HAVE_LIBCHISE */
return Qnil;
}
#ifdef HAVE_LIBCHISE
if ( open_chise_data_source_maybe () )
return -1;
-#else
+#else /* HAVE_LIBCHISE */
if (NILP (Fdatabase_live_p (cit->db)))
{
Lisp_Object db_file
if (NILP (cit->db))
return -1;
}
-#endif
+#endif /* not HAVE_LIBCHISE */
return 0;
}
else
Fclose_database (cit->db);
cit->db = Qnil;
}
-#endif
+#endif /* not HAVE_LIBCHISE */
}
Lisp_Object
}
else
val = Qunbound;
-#else
+#else /* HAVE_LIBCHISE */
val = Fget_database (Fprin1_to_string (make_char (ch), Qnil),
cit->db, Qunbound);
if (!UNBOUNDP (val))
val = Fread (val);
else
val = Qunbound;
-#endif
+#endif /* not HAVE_LIBCHISE */
return val;
}
*/
(attribute))
{
-#ifdef HAVE_CHISE_CLIENT
Lisp_Object table = Fgethash (attribute,
Vchar_attribute_hash_table, Qunbound);
Lisp_Char_Table *ct;
#ifdef HAVE_LIBCHISE
CHISE_Feature feature;
-#else
+#else /* HAVE_LIBCHISE */
Lisp_Object db_file;
Lisp_Object db;
-#endif
+#endif /* not HAVE_LIBCHISE */
if (CHAR_TABLEP (table))
ct = XCHAR_TABLE (table);
feature
= chise_ds_get_feature (default_chise_data_source,
XSTRING_DATA (Fsymbol_name (attribute)));
-#else
+#else /* HAVE_LIBCHISE */
db_file = char_attribute_system_db_file (Qsystem_char_id, attribute, 1);
db = Fopen_database (db_file, Qnil, Qnil, build_string ("w+"), Qnil);
-#endif
+#endif /* not HAVE_LIBCHISE */
if (
#ifdef HAVE_LIBCHISE
feature != NULL
-#else
+#else /* HAVE_LIBCHISE */
!NILP (db)
-#endif
+#endif /* not HAVE_LIBCHISE */
)
{
Lisp_Object (*filter)(Lisp_Object value);
save_uint8_byte_table (XUINT8_BYTE_TABLE(ct->table), ct,
#ifdef HAVE_LIBCHISE
feature,
-#else
+#else /* HAVE_LIBCHISE */
db,
-#endif
+#endif /* not HAVE_LIBCHISE */
0, 3, filter);
else if (UINT16_BYTE_TABLE_P (ct->table))
save_uint16_byte_table (XUINT16_BYTE_TABLE(ct->table), ct,
#ifdef HAVE_LIBCHISE
feature,
-#else
+#else /* HAVE_LIBCHISE */
db,
-#endif
+#endif /* not HAVE_LIBCHISE */
0, 3, filter);
else if (BYTE_TABLE_P (ct->table))
save_byte_table (XBYTE_TABLE(ct->table), ct,
#ifdef HAVE_LIBCHISE
feature,
-#else
+#else /* HAVE_LIBCHISE */
db,
-#endif
+#endif /* not HAVE_LIBCHISE */
0, 3, filter);
#ifdef HAVE_LIBCHISE
chise_feature_sync (feature);
-#else
+#else /* HAVE_LIBCHISE */
Fclose_database (db);
-#endif
+#endif /* not HAVE_LIBCHISE */
return Qt;
}
else
return Qnil;
-#else
- return Qnil;
-#endif
}
DEFUN ("mount-char-attribute-table", Fmount_char_attribute_table, 1, 1, 0, /*
*/
(attribute))
{
-#ifdef HAVE_CHISE_CLIENT
Lisp_Object table = Fgethash (attribute,
Vchar_attribute_hash_table, Qunbound);
XCHAR_TABLE_UNLOADED(table) = 1;
#ifndef HAVE_LIBCHISE
ct->db = Qnil;
-#endif
+#endif /* not HAVE_LIBCHISE */
return Qt;
}
-#endif
return Qnil;
}
*/
(attribute))
{
-#ifdef HAVE_CHISE_CLIENT
Lisp_Object table = Fgethash (attribute,
Vchar_attribute_hash_table, Qunbound);
Lisp_Char_Table *ct;
else
return Qnil;
char_table_close_db_maybe (ct);
-#endif
return Qnil;
}
*/
(attribute))
{
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
+ CHISE_Feature feature
+ = chise_ds_get_feature (default_chise_data_source,
+ XSTRING_DATA (Fsymbol_name
+ (attribute)));
+
+ if (feature == NULL)
+ return Qnil;
+
+ if (chise_feature_setup_db (feature, 0) == 0)
+ {
+ Lisp_Object table = Fgethash (attribute,
+ Vchar_attribute_hash_table, Qunbound);
+ Lisp_Char_Table *ct;
+
+ chise_feature_sync (feature);
+ 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;
+ char_table_close_db_maybe (ct);
+ XCHAR_TABLE_UNLOADED(table) = 1;
+ return Qt;
+ }
+#else
Lisp_Object table = Fgethash (attribute,
Vchar_attribute_hash_table, Qunbound);
Lisp_Char_Table *ct;
value->size)));
return 0;
}
-#else
+#else /* HAVE_LIBCHISE */
Lisp_Object Qload_char_attribute_table_map_function;
DEFUN ("load-char-attribute-table-map-function",
put_char_id_table_0 (char_attribute_table_to_load, code, Fread (value));
return Qnil;
}
-#endif
+#endif /* not HAVE_LIBCHISE */
DEFUN ("load-char-attribute-table", Fload_char_attribute_table, 1, 1, 0, /*
Load values of ATTRIBUTE into database file.
(chise_ds_get_feature (default_chise_data_source,
XSTRING_DATA (Fsymbol_name (cit->name))),
&load_char_attribute_table_map_func);
-#else
+#else /* HAVE_LIBCHISE */
Fmap_database (Qload_char_attribute_table_map_function, cit->db);
-#endif
+#endif /* not HAVE_LIBCHISE */
UNGCPRO;
}
char_table_close_db_maybe (cit);
}
return Qnil;
}
-#endif
+#endif /* HAVE_CHISE */
DEFUN ("map-char-attribute", Fmap_char_attribute, 2, 3, 0, /*
Map FUNCTION over entries in ATTRIBUTE, calling it with two args,
if (NILP (range))
range = Qt;
decode_char_table_range (range, &rainj);
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
if (CHAR_TABLE_UNLOADED(ct))
Fload_char_attribute_table (attribute);
#endif
DEFSUBR (Ffind_char_attribute_table);
defsymbol (&Qput_char_table_map_function, "put-char-table-map-function");
DEFSUBR (Fput_char_table_map_function);
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
DEFSUBR (Fsave_char_attribute_table);
DEFSUBR (Fmount_char_attribute_table);
DEFSUBR (Freset_char_attribute_table);
void
vars_of_chartab (void)
{
-#ifdef UTF2000
-#ifdef HAVE_CHISE_CLIENT
+#ifdef HAVE_CHISE
DEFVAR_LISP ("char-db-stingy-mode", &Vchar_db_stingy_mode /*
*/ );
Vchar_db_stingy_mode = Qt;
-#endif /* HAVE_CHISE_CLIENT */
-#endif
+#endif /* HAVE_CHISE */
/* DO NOT staticpro this. It works just like Vweak_hash_tables. */
Vall_syntax_tables = Qnil;
dump_add_weak_object_chain (&Vall_syntax_tables);