Use concord.h.
authortomo <tomo>
Thu, 23 Jun 2005 22:38:14 +0000 (22:38 +0000)
committertomo <tomo>
Thu, 23 Jun 2005 22:38:14 +0000 (22:38 +0000)
(CHISE_DS_Type): Use `enum CONCORD_Backend_Type' instead of `enum
CHISE_DS_Type'.
(CHISE_DS_Berkeley_DB): New macro to wrap
`CONCORD_Backend_Berkeley_DB'.
(CHISE_DS): Use `CONCORD_Genre_Table' instead of `struct CHISE_DS'.
(CHISE_Value): Use `CONCORD_String_Tank' instead of `DBT'.
(chise_value_size): Changed to non-inline function.
(chise_value_data): Likewise.
(chise_value_to_c_string): Likewise.
(struct CHISE_Feature_Table): Abolished.
(CHISE_Feature): Use `CONCORD_Feature' instead of
`CHISE_Feature_Table*'.
(struct CHISE_CCS_Table): Abolished.
(CHISE_CCS): Use `CONCORD_INDEX' instead of `CHISE_CCS_Table*'.
(struct CHISE_Property_Table): Abolished.
(CHISE_Property): Use `CONCORD_Feature' instead of
`CHISE_Property_Table*'.

chise.h

diff --git a/chise.h b/chise.h
index 696620b..dfb3c68 100644 (file)
--- a/chise.h
+++ b/chise.h
 #ifdef __cplusplus
 extern "C" {
 #endif
+#if 0
+}
+#endif
 
 #include <db.h>
 #include <errno.h>
+#include <concord.h>
 
 extern const unsigned char chise_db_dir[];
 extern const unsigned char chise_system_db_dir[];
 
-typedef enum CHISE_DS_Type
-{
-  CHISE_DS_NONE,
-  CHISE_DS_Berkeley_DB
-} CHISE_DS_Type;
+typedef enum CONCORD_Backend_Type CHISE_DS_Type;
+#define CHISE_DS_Berkeley_DB CONCORD_Backend_Berkeley_DB
 
-typedef struct CHISE_DS CHISE_DS;
+typedef CONCORD_Genre_Table CHISE_DS;
 
 CHISE_DS*
 CHISE_DS_open (CHISE_DS_Type type, const unsigned char *location,
@@ -54,32 +55,21 @@ chise_ds_foreach_char_feature_name (CHISE_DS *ds,
 typedef int CHISE_Char_ID;
 
 
-typedef DBT CHISE_Value;
-
-static inline int
-chise_value_size (const CHISE_Value *s)
-{
-  return s->size;
-}
-
-static inline char *
-chise_value_data (const CHISE_Value *s)
-{
-  return (char *)s->data;
-}
-
-static inline char *
-chise_value_to_c_string (const CHISE_Value *s)
-{
-  return (char *)s->data;
-}
+typedef CONCORD_String_Tank CHISE_Value;
+int chise_value_size (const CHISE_Value* s);
+unsigned char* chise_value_data (const CHISE_Value* s);
+unsigned char* chise_value_to_c_string (const CHISE_Value* s);
 
 
+#if 0
 typedef struct CHISE_Feature_Table CHISE_Feature_Table;
 typedef CHISE_Feature_Table* CHISE_Feature;
+#else
+typedef CONCORD_Feature CHISE_Feature;
+#endif
 
 CHISE_Feature
-chise_ds_get_feature (CHISE_DS *ds, const unsigned char *name);
+chise_ds_get_feature (CHISE_DS* ds, const unsigned char* name);
 
 static inline int
 chise_ds_load_char_feature_value (CHISE_DS *ds,
@@ -130,8 +120,12 @@ chise_feature_foreach_char_with_str (CHISE_Feature feature,
 #endif
 
 
+#if 0
 typedef struct CHISE_CCS_Table CHISE_CCS_Table;
 typedef CHISE_CCS_Table* CHISE_CCS;
+#else
+typedef CONCORD_INDEX CHISE_CCS;
+#endif
 
 CHISE_CCS
 chise_ds_get_ccs (CHISE_DS *ds, const unsigned char *name);
@@ -158,11 +152,15 @@ chise_ds_decode_char (CHISE_DS *ds,
 }
 
 
+#if 0
 typedef struct CHISE_Property_Table CHISE_Property_Table;
 typedef CHISE_Property_Table* CHISE_Property;
+#else
+typedef CONCORD_Feature CHISE_Property;
+#endif
 
-CHISE_Property_Table*
-chise_ds_get_property (CHISE_DS *ds, const unsigned char *property);
+CHISE_Property
+chise_ds_get_property (CHISE_DS* ds, const unsigned char* name);
 
 int chise_property_setup_db (CHISE_Property property, int writable);
 
@@ -170,17 +168,20 @@ int chise_property_sync (CHISE_Property property);
 
 int chise_feature_set_property_value (CHISE_Feature feature,
                                      CHISE_Property property,
-                                     unsigned char *value);
+                                     unsigned char* value);
 
 int chise_feature_load_property_value (CHISE_Feature feature,
-                                      CHISE_Property_Table *table,
-                                      CHISE_Value *valdatum);
+                                      CHISE_Property property,
+                                      CHISE_Value* valdatum);
 
 unsigned char*
 chise_feature_gets_property_value (CHISE_Feature feature,
-                                  CHISE_Property_Table *table,
-                                  unsigned char *buf, size_t size);
+                                  CHISE_Property property,
+                                  unsigned char* buf, size_t size);
 
+#if 0
+{
+#endif
 #ifdef __cplusplus
 }
 #endif