From: tomo Date: Sun, 5 Oct 2003 04:46:22 +0000 (+0000) Subject: (chise_feature_sync): New function. X-Git-Tag: b1-r0_2_0-pre7~7 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2859354855fe74cafc91f10bd804b67cbd2afb26;p=chise%2Flibchise.git (chise_feature_sync): New function. (chise_char_set_feature_value): New function. --- diff --git a/chise.c b/chise.c index b5ede8a..04678c8 100644 --- a/chise.c +++ b/chise.c @@ -244,6 +244,35 @@ chise_feature_setup_db (CHISE_Feature feature, int writable) } int +chise_feature_sync (CHISE_Feature feature) +{ + int status; + + if (feature->db == NULL) + status = 0; + else + status = CHISE_Attribute_Table_close (feature->db); + feature->db = NULL; + feature->access = 0; + return status; +} + +int +chise_char_set_feature_value (CHISE_Char_ID cid, + CHISE_Feature feature, + unsigned char *value) +{ + unsigned char key_buf[8]; + + if (feature == NULL) + return -1; + if (chise_feature_setup_db (feature, 1)) + return -1; + chise_format_char_id (cid, key_buf, 8); + return chise_attribute_table_put (feature->db, key_buf, value); +} + +int chise_char_load_feature_value (CHISE_Char_ID cid, CHISE_Feature_Table *table, CHISE_Value *valdatum)