+#include <alloca.h>
#include <chise.h>
-char db_dir[] = "/usr/local/lib/chise/char-db";
int
test_map_func (CHISE_Char_ID cid, CHISE_Feature_Table *db,
CHISE_Char_ID char_id;
CHISE_Value value;
unsigned char buf[1024];
+ unsigned char *db_dir;
+
+ printf("chise_db_dir = %s\n", chise_db_dir);
+
+ db_dir = (unsigned char*)alloca (strlen (chise_db_dir) + 4);
+ if (db_dir == NULL)
+ {
+ printf ("Can't open data source\n");
+ return -1;
+ }
+ strcpy (db_dir, chise_db_dir);
+ strcat (db_dir, "db/");
+ printf("db_dir = '%s'\n", db_dir);
/* open a data-source */
- ds = chise_open_data_source (CHISE_DS_Berkeley_DB, db_dir,
- real_subtype, modemask);
+ ds = CHISE_DS_open (CHISE_DS_Berkeley_DB, db_dir,
+ real_subtype, modemask);
if (ds == NULL)
{
printf ("Can't open data source\n");
* get a character corresponding with Daikanwa number 364
*/
+#if 1
+ char_id = chise_ds_decode_char (ds, "=daikanwa", 364);
+#else
/* setup a decoding-table */
ccs_daikanwa
= chise_ds_get_ccs (ds, "=daikanwa");
if (ccs_daikanwa == NULL)
{
printf ("Can't open CCS =daikanwa\n");
- chise_ds_close (ds);
+ CHISE_DS_close (ds);
return -1;
}
/* get a character from the decoding-table */
char_id = chise_ccs_decode (ccs_daikanwa, 364);
-
+#endif
/* get a feature-value of the character */
ft_ideographic_structure
chise_char_feature_value_iterate (ft_ideographic_structure, &test_map_func);
/* close the data-source */
- chise_ds_close (ds);
+ CHISE_DS_close (ds);
}