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_nil (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 CONCORD_DS concord_genre_get_data_source (CONCORD_Genre genre);
81 concord_genre_foreach_feature_name (CONCORD_Genre genre,
82 int (*func) (CONCORD_Genre genre,
83 unsigned char* name));
86 typedef struct CONCORD_Feature_Table CONCORD_Feature_Table;
87 typedef CONCORD_Feature_Table* CONCORD_Feature;
90 concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name);
93 concord_feature_get_name (CONCORD_Feature feature);
95 int concord_feature_setup_db (CONCORD_Feature feature, int writable);
97 int concord_feature_sync (CONCORD_Feature feature);
100 concord_obj_put_feature_value_str (const unsigned char* object_id,
101 CONCORD_Feature feature,
102 unsigned char* value);
105 concord_obj_get_feature_value (const unsigned char* object_id,
106 CONCORD_Feature feature);
108 concord_obj_get_feature_value_string (const unsigned char* object_id,
109 CONCORD_Feature feature,
110 CONCORD_String value);
112 concord_obj_gets_feature_value (const unsigned char* object_id,
113 CONCORD_Feature feature,
114 unsigned char* dst, size_t size);
117 concord_feature_foreach_obj_string (CONCORD_Feature feature,
119 (CONCORD_String object_id,
120 CONCORD_Feature feature,
121 CONCORD_String valdatum));
124 typedef struct CONCORD_INDEX_Table CONCORD_INDEX_Table;
125 typedef CONCORD_INDEX_Table* CONCORD_INDEX;
128 concord_genre_get_index (CONCORD_Genre genre, const unsigned char* name);
130 int concord_index_setup_db (CONCORD_INDEX index, int writable);
132 int concord_index_sync (CONCORD_INDEX index);
134 int concord_index_strid_put_obj (CONCORD_INDEX index,
135 const unsigned char* strid,
136 unsigned char* object_id);
138 int concord_index_strid_get_obj_string (CONCORD_INDEX index,
139 const unsigned char* strid,
140 CONCORD_String object_id);
149 #endif /* !_CONCORD_H */