From 2859354855fe74cafc91f10bd804b67cbd2afb26 Mon Sep 17 00:00:00 2001 From: tomo Date: Sun, 5 Oct 2003 04:46:22 +0000 Subject: [PATCH] (chise_feature_sync): New function. (chise_char_set_feature_value): New function. --- chise.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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) -- 1.7.10.4