1 /* Copyright (C) 2003,2004,2005 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
31 typedef DBT CONCORD_String_Tank;
32 typedef CONCORD_String_Tank* CONCORD_String;
34 int CONCORD_String_size (const CONCORD_String s);
35 unsigned char* CONCORD_String_data (const CONCORD_String s);
38 typedef void* CONCORD_Object;
40 typedef enum CONCORD_Backend_Type
43 CONCORD_Backend_Berkeley_DB
44 } CONCORD_Backend_Type;
47 typedef struct CONCORD_DS_Table CONCORD_DS_Table;
48 typedef CONCORD_DS_Table* CONCORD_DS;
51 concord_open_ds (CONCORD_Backend_Type type, const unsigned char* location,
52 int subtype, int modemask);
54 int concord_close_ds (CONCORD_DS ds);
56 unsigned char* concord_ds_location (CONCORD_DS ds);
59 concord_ds_set_object_failure (CONCORD_DS ds, CONCORD_Object object_nil);
61 concord_ds_set_read_object_function (CONCORD_DS ds,
62 CONCORD_Object (*read_object)
63 (const unsigned char* str,
67 concord_ds_foreach_genre_name (CONCORD_DS ds,
68 int (*func) (CONCORD_DS ds,
69 unsigned char* name));
72 typedef struct CONCORD_Genre_Table CONCORD_Genre_Table;
73 typedef CONCORD_Genre_Table* CONCORD_Genre;
76 concord_ds_get_genre (CONCORD_DS ds, const unsigned char* name);
78 unsigned char* concord_genre_get_name (CONCORD_Genre genre);
80 CONCORD_DS concord_genre_get_data_source (CONCORD_Genre genre);
83 concord_genre_foreach_feature_name (CONCORD_Genre genre,
84 int (*func) (CONCORD_Genre genre,
85 unsigned char* name));
88 typedef struct CONCORD_Feature_Table CONCORD_Feature_Table;
89 typedef CONCORD_Feature_Table* CONCORD_Feature;
92 concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name);
95 concord_feature_get_name (CONCORD_Feature feature);
97 CONCORD_Genre concord_feature_get_genre (CONCORD_Feature feature);
99 int concord_feature_setup_db (CONCORD_Feature feature, int writable);
101 int concord_feature_sync (CONCORD_Feature feature);
104 concord_obj_put_feature_value_str (const unsigned char* object_id,
105 CONCORD_Feature feature,
106 unsigned char* value);
109 concord_obj_get_feature_value (const unsigned char* object_id,
110 CONCORD_Feature feature);
112 concord_obj_get_feature_value_string (const unsigned char* object_id,
113 CONCORD_Feature feature,
114 CONCORD_String value);
116 concord_obj_gets_feature_value (const unsigned char* object_id,
117 CONCORD_Feature feature,
118 unsigned char* dst, size_t size);
121 concord_feature_foreach_obj_string (CONCORD_Feature feature,
123 (CONCORD_String object_id,
124 CONCORD_Feature feature,
125 CONCORD_String valdatum));
128 typedef struct CONCORD_INDEX_Table CONCORD_INDEX_Table;
129 typedef CONCORD_INDEX_Table* CONCORD_INDEX;
132 concord_genre_get_index (CONCORD_Genre genre, const unsigned char* name);
134 int concord_index_setup_db (CONCORD_INDEX index, int writable);
136 int concord_index_sync (CONCORD_INDEX index);
138 int concord_index_strid_put_obj (CONCORD_INDEX index,
139 const unsigned char* strid,
140 unsigned char* object_id);
142 int concord_index_strid_get_obj_string (CONCORD_INDEX index,
143 const unsigned char* strid,
144 CONCORD_String object_id);
153 #endif /* !_CONCORD_H */