3 char db_dir[] = "/usr/local/lib/chise/char-db";
6 main (int argc, char* argv[])
9 CHISE_Decoding_Table *dt_daikanwa;
10 CHISE_Feature_Table *ft_ideographic_structure;
15 CHISE_Char_ID char_id;
18 /* open a data-source */
19 status = chise_open_data_source (&ds, CHISE_DS_Berkeley_DB, db_dir);
22 chise_close_data_source (&ds);
28 * get a character corresponding with Daikanwa number 364
31 modemask = 0755; /* rwxr-xr-x */
32 real_subtype = DB_HASH;
33 accessmask = DB_RDONLY;
35 /* setup a decoding-table */
36 status = chise_open_decoding_table (&dt_daikanwa, &ds,
39 accessmask, modemask);
42 chise_close_decoding_table (dt_daikanwa);
43 chise_close_data_source (&ds);
47 /* get a character from the decoding-table */
48 char_id = chise_dt_get_char (dt_daikanwa, 364);
50 /* close the decoding-table */
51 chise_close_decoding_table (dt_daikanwa);
55 * get a ideographic-structure feature of the character
58 /* setup a feature-table */
59 status = chise_open_feature_table (&ft_ideographic_structure, &ds,
60 "ideographic-structure",
61 real_subtype, accessmask, modemask);
64 chise_close_feature_table (ft_ideographic_structure);
65 chise_close_data_source (&ds);
69 /* get a feature-value of the character */
70 status = chise_ft_get_value (ft_ideographic_structure, char_id, &value);
73 printf ("#x%X => %s\n", char_id, chise_value_to_c_string(&value));
75 printf ("#x%X (%d)\n", char_id, status);
77 /* close the feature-table */
78 chise_close_feature_table (ft_ideographic_structure);
81 /* close the data-source */
82 chise_close_data_source (&ds);