QOF
0.8.0
|
00001 /********************************************************************\ 00002 * qofbackend-p.h -- private api for data storage backend * 00003 * * 00004 * This program is free software; you can redistribute it and/or * 00005 * modify it under the terms of the GNU General Public License as * 00006 * published by the Free Software Foundation; either version 2 of * 00007 * the License, or (at your option) any later version. * 00008 * * 00009 * This program is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU General Public License* 00015 * along with this program; if not, contact: * 00016 * * 00017 * Free Software Foundation Voice: +1-617-542-5942 * 00018 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 00019 * Boston, MA 02110-1301, USA gnu@gnu.org * 00020 * * 00021 \********************************************************************/ 00040 #ifndef QOF_BACKEND_P_H 00041 #define QOF_BACKEND_P_H 00042 00043 #include "qofinstance-p.h" 00044 #include "qofquery.h" 00045 #include "qofsession.h" 00046 00238 struct QofBackendProvider_s 00239 { 00241 const gchar *provider_name; 00242 00247 const gchar *access_method; 00248 00254 gboolean partial_book_supported; 00255 00260 QofBackend *(*backend_new) (void); 00261 00277 gboolean (*check_data_type) (const gchar *); 00278 00280 void (*provider_free) (QofBackendProvider *); 00281 }; 00282 00283 struct QofBackend_s 00284 { 00285 void (*session_begin) (QofBackend * be, 00286 QofSession * session, 00287 const gchar * book_id, 00288 gboolean ignore_lock, 00289 gboolean create_if_nonexistent); 00290 void (*session_end) (QofBackend *); 00291 void (*destroy_backend) (QofBackend *); 00292 void (*load) (QofBackend *, QofBook *); 00293 void (*begin) (QofBackend *, QofInstance *); 00294 void (*commit) (QofBackend *, QofInstance *); 00295 void (*rollback) (QofBackend *, QofInstance *); 00296 gpointer (*compile_query) (QofBackend *, QofQuery *); 00297 void (*free_query) (QofBackend *, gpointer); 00298 void (*run_query) (QofBackend *, gpointer); 00299 void (*sync) (QofBackend *, QofBook *); 00300 void (*load_config) (QofBackend *, KvpFrame *); 00301 KvpFrame *(*get_config) (QofBackend *); 00302 gint64 (*counter) (QofBackend *, const gchar * counter_name); 00303 gboolean (*events_pending) (QofBackend *); 00304 gboolean (*process_events) (QofBackend *); 00305 QofBePercentageFunc percentage; 00306 QofBackendProvider *provider; 00307 00320 gboolean (*save_may_clobber_data) (QofBackend *); 00321 00322 /* stack of previous errors. 00323 Similar errors can repeat within the stack. */ 00324 GList * error_stack; 00325 00326 00327 KvpFrame *backend_configuration; 00328 gint config_count; 00332 gchar *fullpath; 00333 00334 }; 00335 00343 void 00344 qof_backend_register_provider (QofBackendProvider *); 00345 00346 void qof_backend_init (QofBackend * be); 00347 00352 gchar qof_book_get_open_marker (QofBook * book); 00353 00361 gint32 qof_book_get_version (QofBook * book); 00362 00367 guint32 qof_book_get_idata (QofBook * book); 00368 00369 void qof_book_set_version (QofBook * book, gint32 version); 00370 00371 void qof_book_set_idata (QofBook * book, guint32 idata); 00372 00376 #endif /* QOF_BACKEND_P_H */