From: tomo Date: Mon, 13 Oct 2003 06:45:21 +0000 (+0000) Subject: (test_name_map_func): New function. X-Git-Tag: b1-r0_2_0-pre8~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3d8559370dbcaccf874c6af4eef5a8f1536f0325;p=chise%2Flibchise.git (test_name_map_func): New function. (main): Use `chise_ds_foreach_char_feature_name'. --- diff --git a/sample.c b/sample.c index ab4b7a7..aba6940 100644 --- a/sample.c +++ b/sample.c @@ -1,8 +1,16 @@ +#include #include #include -int +static int +test_name_map_func (CHISE_DS *ds, unsigned char *name) +{ + printf ("feature : %s\n", name); + return 0; +} + +static int test_map_func (CHISE_Char_ID cid, CHISE_Feature_Table *db, CHISE_Value *valdatum) { @@ -26,14 +34,14 @@ int main (int argc, char* argv[]) { CHISE_DS *ds; +#if 0 CHISE_CCS ccs_daikanwa; +#endif CHISE_Feature ft_ideographic_structure; CHISE_Feature ft_ascii; int modemask = 0755; /* rwxr-xr-x */ DBTYPE real_subtype = DB_HASH; - int status; CHISE_Char_ID char_id; - CHISE_Value value; unsigned char buf[1024]; unsigned char *db_dir; @@ -89,10 +97,15 @@ main (int argc, char* argv[]) else printf ("#x%X\n", char_id); + chise_ds_foreach_char_feature_name (ds, &test_name_map_func); + ft_ascii = chise_ds_get_feature (ds, "ascii"); - chise_char_feature_value_iterate (ft_ascii, &test_map_func); - chise_char_feature_value_iterate (ft_ideographic_structure, &test_map_func); + chise_feature_foreach_char_with_value (ft_ascii, &test_map_func); + chise_feature_foreach_char_with_value + (ft_ideographic_structure, &test_map_func); /* close the data-source */ CHISE_DS_close (ds); + + return 0; }