projects
/
chise
/
libchise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(chise_dt_put_char): New function.
[chise/libchise.git]
/
sample.c
diff --git
a/sample.c
b/sample.c
index
e2b9bad
..
b6b567f
100644
(file)
--- a/
sample.c
+++ b/
sample.c
@@
-3,11
+3,21
@@
char db_dir[] = "/usr/local/lib/chise/char-db";
int
char db_dir[] = "/usr/local/lib/chise/char-db";
int
+test_map_func (CHISE_Feature_Table *db,
+ CHISE_Char_ID cid, CHISE_Value *valdatum)
+{
+ printf ("#x%04X\t(%c)\t%s\n",
+ cid, cid, chise_value_to_c_string (valdatum));
+ return 0;
+}
+
+int
main (int argc, char* argv[])
{
CHISE_DS ds;
CHISE_Decoding_Table *dt_daikanwa;
CHISE_Feature_Table *ft_ideographic_structure;
main (int argc, char* argv[])
{
CHISE_DS ds;
CHISE_Decoding_Table *dt_daikanwa;
CHISE_Feature_Table *ft_ideographic_structure;
+ CHISE_Feature_Table *ft_ascii;
int modemask;
int accessmask = 0;
DBTYPE real_subtype;
int modemask;
int accessmask = 0;
DBTYPE real_subtype;
@@
-66,6
+76,17
@@
main (int argc, char* argv[])
return -1;
}
return -1;
}
+ /* setup a feature-table */
+ status = chise_open_feature_table (&ft_ascii, &ds,
+ "ascii",
+ real_subtype, accessmask, modemask);
+ if (status)
+ {
+ chise_close_feature_table (ft_ascii);
+ chise_close_data_source (&ds);
+ return -1;
+ }
+
/* get a feature-value of the character */
status = chise_ft_get_value (ft_ideographic_structure, char_id, &value);
/* get a feature-value of the character */
status = chise_ft_get_value (ft_ideographic_structure, char_id, &value);
@@
-74,9
+95,14
@@
main (int argc, char* argv[])
else
printf ("#x%X (%d)\n", char_id, status);
else
printf ("#x%X (%d)\n", char_id, status);
+ chise_ft_iterate (ft_ascii, &test_map_func);
+ chise_ft_iterate (ft_ideographic_structure, &test_map_func);
+
/* close the feature-table */
chise_close_feature_table (ft_ideographic_structure);
/* close the feature-table */
chise_close_feature_table (ft_ideographic_structure);
+ chise_close_feature_table (ft_ascii);
+
/* close the data-source */
chise_close_data_source (&ds);
/* close the data-source */
chise_close_data_source (&ds);