(chise_feature_sync): New function.
authortomo <tomo>
Sun, 5 Oct 2003 04:46:22 +0000 (04:46 +0000)
committertomo <tomo>
Sun, 5 Oct 2003 04:46:22 +0000 (04:46 +0000)
(chise_char_set_feature_value): New function.

chise.c

diff --git a/chise.c b/chise.c
index b5ede8a..04678c8 100644 (file)
--- 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)