1 /* Copyright (C) 2003, 2004, 2005, 2006, 2013 MORIOKA Tomohiko
2 This file is part of the CONCORD Library.
4 The CONCORD Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The CONCORD Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the CONCORD Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
32 typedef DBT CONCORD_String_Tank;
33 typedef CONCORD_String_Tank* CONCORD_String;
35 int CONCORD_String_size (const CONCORD_String s);
36 unsigned char* CONCORD_String_data (const CONCORD_String s);
39 typedef COS_Object CONCORD_Object;
41 typedef enum CONCORD_Backend_Type
44 CONCORD_Backend_Berkeley_DB
45 } CONCORD_Backend_Type;
48 typedef struct COS_DS_ent COS_DS_ent;
49 typedef COS_DS_ent* COS_DS;
50 typedef COS_DS CONCORD_DS;
53 concord_open_ds (CONCORD_Backend_Type type, const char* location,
54 int subtype, int modemask);
56 COS_DS concord_open_env (COS_object ds);
58 int concord_close_ds (CONCORD_DS ds);
60 int concord_ds_p (COS_object obj);
62 char* concord_ds_location (CONCORD_DS ds);
65 concord_ds_set_object_failure (CONCORD_DS ds, CONCORD_Object object_nil);
67 concord_ds_set_read_object_function (CONCORD_DS ds,
68 CONCORD_Object (*read_object)
69 (const unsigned char* str,
73 concord_ds_foreach_genre_name (CONCORD_DS ds,
74 int (*func) (CONCORD_DS ds, char* name));
77 typedef struct COS_Genre_ent COS_Genre_ent;
78 typedef COS_Genre_ent* COS_Genre;
79 typedef COS_Genre_ent CONCORD_Genre_Table;
80 typedef COS_Genre CONCORD_Genre;
83 concord_ds_get_genre (CONCORD_DS ds, const char* name);
86 concord_get_genre (COS_object ds, COS_object genre);
88 char* concord_genre_get_name (CONCORD_Genre genre);
90 CONCORD_DS concord_genre_get_data_source (CONCORD_Genre genre);
93 concord_genre_foreach_feature_name (CONCORD_Genre genre,
94 int (*func) (CONCORD_Genre genre,
98 typedef struct COS_Feature_ent COS_Feature_ent;
99 typedef COS_Feature_ent* COS_Feature;
100 typedef COS_Feature CONCORD_Feature;
103 concord_genre_get_feature (CONCORD_Genre genre, const char* name);
106 concord_get_feature (COS_object ds,
107 COS_object genre, COS_object feature);
109 char* concord_feature_get_name (CONCORD_Feature feature);
111 CONCORD_Genre concord_feature_get_genre (CONCORD_Feature feature);
113 int concord_feature_setup_db (CONCORD_Feature feature, int writable);
115 int concord_feature_sync (CONCORD_Feature feature);
118 concord_obj_put_feature_value_str (const char* object_id,
119 CONCORD_Feature feature,
120 unsigned char* value);
123 concord_obj_get_feature_value (const char* object_id,
124 CONCORD_Feature feature);
126 concord_obj_get_feature_value_string (const char* object_id,
127 CONCORD_Feature feature,
128 CONCORD_String value);
130 concord_obj_gets_feature_value (const char* object_id,
131 CONCORD_Feature feature,
132 unsigned char* dst, size_t size);
135 concord_object_get_feature_value (COS_object object, COS_object feature);
138 concord_feature_foreach_obj_string (CONCORD_Feature feature,
140 (CONCORD_String object_id,
141 CONCORD_Feature feature,
142 CONCORD_String valdatum));
145 typedef struct COS_Feature_INDEX_ent COS_Feature_INDEX_ent;
146 typedef COS_Feature_INDEX_ent* COS_Feature_INDEX;
147 typedef COS_Feature_INDEX CONCORD_INDEX;
150 concord_genre_get_index (CONCORD_Genre genre, const char* name);
153 concord_get_feature_index (COS_object ds,
154 COS_object genre, COS_object feature);
156 char* concord_index_get_name (CONCORD_INDEX index);
158 CONCORD_Genre concord_index_get_genre (CONCORD_INDEX index);
160 int concord_index_setup_db (CONCORD_INDEX index, int writable);
162 int concord_index_sync (CONCORD_INDEX index);
164 int concord_index_strid_put_obj (CONCORD_INDEX index,
168 int concord_index_strid_get_obj_string (CONCORD_INDEX index,
170 CONCORD_String object_id);
174 concord_decode_object (COS_object ds, COS_object genre,
175 COS_object feature, COS_object id);
184 #endif /* !_CONCORD_H */