return -1;
}
+int
+chise_dt_put_char (CHISE_Decoding_Table *db,
+ int code_point, CHISE_Char_ID cid)
+{
+ CHISE_Value valdatum;
+ char key_buf[16], val_buf[8];
+
+ sprintf(key_buf, "%d", code_point);
+ chise_format_char_id (cid, val_buf, 8);
+ return chise_put_attribute_table (db, key_buf, val_buf);
+}
+
int
status = db->get (db, NULL, &keydatum, valdatum, 0);
return status;
}
+
+int
+chise_put_attribute_table (CHISE_Attribute_Table *db,
+ char *key, char *value)
+{
+ DBT keydatum, valdatum;
+ int status = 0;
+
+ /* DB Version 2 requires DBT's to be zeroed before use. */
+ xzero (keydatum);
+ xzero (valdatum);
+
+ keydatum.data = key;
+ keydatum.size = strlen (key);
+
+ valdatum.data = value;
+ valdatum.size = strlen (value);
+
+ status = db->put (db, NULL, &keydatum, &valdatum, 0);
+ return status;
+}