Add `AC_CANONICAL_TARGET'; use `AC_PROG_LIBTOOL' instead of
[chise/libchise.git] / chise.h
diff --git a/chise.h b/chise.h
index ce2ea62..f6c55f5 100644 (file)
--- a/chise.h
+++ b/chise.h
@@ -4,6 +4,8 @@
 #include <db.h>
 #include <errno.h>
 
+extern const unsigned char chise_db_dir[];
+
 typedef enum CHISE_DS_Type
 {
   CHISE_DS_NONE,
@@ -13,11 +15,16 @@ typedef enum CHISE_DS_Type
 typedef struct CHISE_DS CHISE_DS;
 
 CHISE_DS*
-CHISE_DS_open (CHISE_DS_Type type, char *location,
-              DBTYPE subtype, int modemask);
+CHISE_DS_open (CHISE_DS_Type type, const unsigned char *location,
+              int subtype, int modemask);
 
 int CHISE_DS_close (CHISE_DS *ds);
 
+int
+chise_ds_foreach_char_feature_name (CHISE_DS *ds,
+                                   int (*func) (CHISE_DS *ds,
+                                                unsigned char *name));
+
 
 typedef int CHISE_Char_ID;
 
@@ -55,6 +62,8 @@ chise_ds_load_char_feature_value (CHISE_DS *ds,
                                  const unsigned char *name,
                                  CHISE_Value *valdatum);
 
+int chise_feature_setup_db (CHISE_Feature feature, int writable);
+
 int chise_feature_sync (CHISE_Feature feature);
 
 int chise_char_set_feature_value (CHISE_Char_ID cid,
@@ -82,17 +91,17 @@ chise_char_gets_feature_value (CHISE_Char_ID cid,
                               unsigned char *dst, size_t size);
 
 int
-chise_char_feature_value_iterate (CHISE_Feature feature,
-                                 int (*func) (CHISE_Char_ID cid,
-                                              CHISE_Feature feature,
-                                              CHISE_Value *valdatum));
+chise_feature_foreach_char_with_value (CHISE_Feature feature,
+                                      int (*func) (CHISE_Char_ID cid,
+                                                   CHISE_Feature feature,
+                                                   CHISE_Value *valdatum));
 
 #if 0
 int
-chise_char_feature_str_iterate (CHISE_Feature feature,
-                               int (*func) (CHISE_Char_ID cid,
-                                            CHISE_Feature feature,
-                                            unsigned char *str));
+chise_feature_foreach_char_with_str (CHISE_Feature feature,
+                                    int (*func) (CHISE_Char_ID cid,
+                                                 CHISE_Feature feature,
+                                                 unsigned char *str));
 #endif
 
 
@@ -106,11 +115,13 @@ static inline CHISE_Char_ID
 chise_ds_decode_char (CHISE_DS *ds,
                      const unsigned char *ccs, int code_point);
 
-int chise_ccs_set_decoded_char (CHISE_CCS ccs,
-                               int code_point, CHISE_Char_ID cid);
+int chise_ccs_setup_db (CHISE_CCS ccs, int writable);
 
 int chise_ccs_sync (CHISE_CCS ccs);
 
+int chise_ccs_set_decoded_char (CHISE_CCS ccs,
+                               int code_point, CHISE_Char_ID cid);
+
 CHISE_Char_ID chise_ccs_decode (CHISE_CCS ccs, int code_point);
 
 static inline CHISE_Char_ID