X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fconcord.git;a=blobdiff_plain;f=concord.h;h=04f821b339700aff5d15da0a7d1fc4d528b61257;hp=b557b6a72d9cac2bdadc57e9e542c6f1a6e9e736;hb=2a9f3267270e17def505e553192d7a3f74add9d3;hpb=5c2921c89a396501676b45c8440ca57b49104c7c diff --git a/concord.h b/concord.h index b557b6a..04f821b 100644 --- a/concord.h +++ b/concord.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003,2004,2005 MORIOKA Tomohiko +/* Copyright (C) 2003, 2004, 2005, 2006, 2013 MORIOKA Tomohiko This file is part of the CONCORD Library. The CONCORD Library is free software; you can redistribute it and/or @@ -27,6 +27,7 @@ extern "C" { #endif #include +#include typedef DBT CONCORD_String_Tank; typedef CONCORD_String_Tank* CONCORD_String; @@ -35,7 +36,7 @@ int CONCORD_String_size (const CONCORD_String s); unsigned char* CONCORD_String_data (const CONCORD_String s); -typedef void* CONCORD_Object; +typedef COS_Object CONCORD_Object; typedef enum CONCORD_Backend_Type { @@ -44,19 +45,22 @@ typedef enum CONCORD_Backend_Type } CONCORD_Backend_Type; -typedef struct CONCORD_DS_Table CONCORD_DS_Table; -typedef CONCORD_DS_Table* CONCORD_DS; +typedef struct COS_DS_ent COS_DS_ent; +typedef COS_DS_ent* COS_DS; +typedef COS_DS CONCORD_DS; CONCORD_DS -concord_open_ds (CONCORD_Backend_Type type, const unsigned char* location, +concord_open_ds (CONCORD_Backend_Type type, const char* location, int subtype, int modemask); +COS_DS concord_open_env (COS_object ds); + int concord_close_ds (CONCORD_DS ds); -unsigned char* concord_ds_location (CONCORD_DS ds); +char* concord_ds_location (CONCORD_DS ds); int -concord_ds_set_object_nil (CONCORD_DS ds, CONCORD_Object object_nil); +concord_ds_set_object_failure (CONCORD_DS ds, CONCORD_Object object_nil); int concord_ds_set_read_object_function (CONCORD_DS ds, CONCORD_Object (*read_object) @@ -65,79 +69,104 @@ concord_ds_set_read_object_function (CONCORD_DS ds, int concord_ds_foreach_genre_name (CONCORD_DS ds, - int (*func) (CONCORD_DS ds, - unsigned char* name)); + int (*func) (CONCORD_DS ds, char* name)); -typedef struct CONCORD_Genre_Table CONCORD_Genre_Table; -typedef CONCORD_Genre_Table* CONCORD_Genre; +typedef struct COS_Genre_ent COS_Genre_ent; +typedef COS_Genre_ent* COS_Genre; +typedef COS_Genre CONCORD_Genre; CONCORD_Genre -concord_ds_get_genre (CONCORD_DS ds, const unsigned char* name); +concord_ds_get_genre (CONCORD_DS ds, const char* name); + +COS_Genre +concord_get_genre (COS_object ds, COS_object genre); + +char* concord_genre_get_name (CONCORD_Genre genre); CONCORD_DS concord_genre_get_data_source (CONCORD_Genre genre); int concord_genre_foreach_feature_name (CONCORD_Genre genre, int (*func) (CONCORD_Genre genre, - unsigned char* name)); + char* name)); -typedef struct CONCORD_Feature_Table CONCORD_Feature_Table; -typedef CONCORD_Feature_Table* CONCORD_Feature; +typedef struct COS_Feature_ent COS_Feature_ent; +typedef COS_Feature_ent* COS_Feature; +typedef COS_Feature CONCORD_Feature; CONCORD_Feature -concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name); +concord_genre_get_feature (CONCORD_Genre genre, const char* name); -unsigned char* -concord_feature_get_name (CONCORD_Feature feature); +COS_Feature +concord_get_feature (COS_object ds, + COS_object genre, COS_object feature); + +char* concord_feature_get_name (CONCORD_Feature feature); + +CONCORD_Genre concord_feature_get_genre (CONCORD_Feature feature); int concord_feature_setup_db (CONCORD_Feature feature, int writable); int concord_feature_sync (CONCORD_Feature feature); int -concord_stroid_set_feature_str (const unsigned char* object_id, - CONCORD_Feature feature, - unsigned char* value); - -int -concord_stroid_get_feature_string (const unsigned char* object_id, +concord_obj_put_feature_value_str (const char* object_id, CONCORD_Feature feature, - CONCORD_String value); + unsigned char* value); + CONCORD_Object -concord_stroid_get_feature_object (const unsigned char* object_id, - CONCORD_Feature feature); +concord_obj_get_feature_value (const char* object_id, + CONCORD_Feature feature); +int +concord_obj_get_feature_value_string (const char* object_id, + CONCORD_Feature feature, + CONCORD_String value); unsigned char* -concord_stroid_gets_feature (const unsigned char* object_id, - CONCORD_Feature feature, - unsigned char* dst, size_t size); +concord_obj_gets_feature_value (const char* object_id, + CONCORD_Feature feature, + unsigned char* dst, size_t size); int -concord_feature_foreach_object_string (CONCORD_Feature feature, - int (*func) - (CONCORD_String object_id, - CONCORD_Feature feature, - CONCORD_String valdatum)); +concord_feature_foreach_obj_string (CONCORD_Feature feature, + int (*func) + (CONCORD_String object_id, + CONCORD_Feature feature, + CONCORD_String valdatum)); -typedef struct CONCORD_INDEX_Table CONCORD_INDEX_Table; -typedef CONCORD_INDEX_Table* CONCORD_INDEX; +typedef struct COS_Feature_INDEX_ent COS_Feature_INDEX_ent; +typedef COS_Feature_INDEX_ent* COS_Feature_INDEX; +typedef COS_Feature_INDEX CONCORD_INDEX; CONCORD_INDEX -concord_genre_get_index (CONCORD_Genre genre, const unsigned char* name); +concord_genre_get_index (CONCORD_Genre genre, const char* name); + +COS_Feature_INDEX +concord_get_feature_index (COS_object ds, + COS_object genre, COS_object feature); + +char* concord_index_get_name (CONCORD_INDEX index); + +CONCORD_Genre concord_index_get_genre (CONCORD_INDEX index); int concord_index_setup_db (CONCORD_INDEX index, int writable); int concord_index_sync (CONCORD_INDEX index); -int concord_index_strid_get_object_string (CONCORD_INDEX index, - const unsigned char* strid, - CONCORD_String object_id); +int concord_index_strid_put_obj (CONCORD_INDEX index, + const char* strid, + char* object_id); + +int concord_index_strid_get_obj_string (CONCORD_INDEX index, + const char* strid, + CONCORD_String object_id); + -int concord_index_strid_set_object_str (CONCORD_INDEX index, - const unsigned char* strid, - unsigned char* object_id); +COS_object +concord_decode_object (COS_object ds, COS_object genre, + COS_object feature, COS_object id); #if 0 {