QOF: qofbackend-p.h Source File

QOF 0.7.5

qofbackend-p.h
Go to the documentation of this file.
1 /********************************************************************\
2 * qofbackend-p.h -- private api for data storage backend *
3 * *
4 * This program is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation; either version 2 of *
7 * the License, or (at your option) any later version. *
8 * *
9 * This program 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 *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License*
15 * along with this program; if not, contact: *
16 * *
17 * Free Software Foundation Voice: +1-617-542-5942 *
18 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
19 * Boston, MA 02110-1301, USA gnu@gnu.org *
20 * *
21 \********************************************************************/
40 #ifndef QOF_BACKEND_P_H
41 #define QOF_BACKEND_P_H
42
43 #include "qofinstance-p.h"
44 #include "qofquery.h"
45 #include "qofsession.h"
46
238 struct QofBackendProvider_s
239 {
241 const gchar *provider_name;
242
247 const gchar *access_method;
248
254 gboolean partial_book_supported;
255
260 QofBackend *(*backend_new) (void);
261
277 gboolean (*check_data_type) (const gchar *);
278
280 void (*provider_free) (QofBackendProvider *);
281 };
282
283 struct QofBackend_s
284 {
285 void (*session_begin) (QofBackend * be,
286 QofSession * session,
287 const gchar * book_id,
288 gboolean ignore_lock,
289 gboolean create_if_nonexistent);
290 void (*session_end) (QofBackend *);
291 void (*destroy_backend) (QofBackend *);
292 void (*load) (QofBackend *, QofBook *);
293 void (*begin) (QofBackend *, QofInstance *);
294 void (*commit) (QofBackend *, QofInstance *);
295 void (*rollback) (QofBackend *, QofInstance *);
296 gpointer (*compile_query) (QofBackend *, QofQuery *);
297 void (*free_query) (QofBackend *, gpointer);
298 void (*run_query) (QofBackend *, gpointer);
299 void (*sync) (QofBackend *, QofBook *);
300 void (*load_config) (QofBackend *, KvpFrame *);
301 KvpFrame *(*get_config) (QofBackend *);
302 gint64 (*counter) (QofBackend *, const gchar * counter_name);
303 gboolean (*events_pending) (QofBackend *);
304 gboolean (*process_events) (QofBackend *);
305 QofBePercentageFunc percentage;
306 QofBackendProvider *provider;
307
320 gboolean (*save_may_clobber_data) (QofBackend *);
321
322 #ifndef QOF_DISABLE_DEPRECATED
323
324 QofErrorId last_err;
326 gchar *error_msg;
327 #endif
328 /* stack of previous errors.
329 Similar errors can repeat within the stack. */
330 GList * error_stack;
331
332
333 KvpFrame *backend_configuration;
334 gint config_count;
338 gchar *fullpath;
339
341 void (*price_lookup) (QofBackend *, gpointer);
342
344 void (*export) (QofBackend *, QofBook *);
345
346 };
347
355 void
356 qof_backend_register_provider (QofBackendProvider *);
357
358 void qof_backend_init (QofBackend * be);
359
364 gchar qof_book_get_open_marker (QofBook * book);
365
373 gint32 qof_book_get_version (QofBook * book);
374
379 guint32 qof_book_get_idata (QofBook * book);
380
381 void qof_book_set_version (QofBook * book, gint32 version);
382
383 void qof_book_set_idata (QofBook * book, guint32 idata);
384
388 #endif /* QOF_BACKEND_P_H */
QofBackend_s::fullpath
gchar * fullpath
Definition: qofbackend-p.h:338
QofBackend_s::save_may_clobber_data
gboolean(* save_may_clobber_data)(QofBackend *)
Definition: qofbackend-p.h:320
qofsession.h
Encapsulates a connection to a backend (persistent store)
qof_book_get_version
gint32 qof_book_get_version(QofBook *book)
Definition: qofbook.c:285
QofInstance_s
Definition: qofinstance-p.h:35
qof_backend_register_provider
void qof_backend_register_provider(QofBackendProvider *)
Definition: qofsession.c:59
_QofSession
Definition: qofsession-p.h:35
QofBackendProvider_s
Definition: qofbackend-p.h:238
QofBackendProvider_s::partial_book_supported
gboolean partial_book_supported
Partial QofBook handler.
Definition: qofbackend-p.h:254
QofErrorId
gint32 QofErrorId
The ID of this error.
Definition: qofbackend.h:54
KvpFrame
struct _KvpFrame KvpFrame
Definition: kvpframe.h:74
QofBackend_s::price_lookup
void(* price_lookup)(QofBackend *, gpointer)
Definition: qofbackend-p.h:341
QofQuery
struct _QofQuery QofQuery
Definition: qofquery.h:85
QofBackend_s::export
void(* export)(QofBackend *, QofBook *)
Definition: qofbackend-p.h:344
qofquery.h
find objects that match a certain expression.
QofBackend_s::last_err
QofErrorId last_err
Definition: qofbackend-p.h:324
qof_book_get_idata
guint32 qof_book_get_idata(QofBook *book)
Definition: qofbook.c:295
qof_backend_init
void qof_backend_init(QofBackend *be)
Definition: qofbackend.c:37
QofBePercentageFunc
void(* QofBePercentageFunc)(const gchar *message, double percent)
DOCUMENT ME!
Definition: qofbackend.h:72
QofBackendProvider_s::provider_free
void(* provider_free)(QofBackendProvider *)
Definition: qofbackend-p.h:280
qof_book_get_open_marker
gchar qof_book_get_open_marker(QofBook *book)
Definition: qofbook.c:275
QofBackendProvider_s::access_method
const gchar * access_method
Definition: qofbackend-p.h:247
QofBackendProvider_s::check_data_type
gboolean(* check_data_type)(const gchar *)
Distinguish two providers with same access method.
Definition: qofbackend-p.h:277
QofBackend_s::error_msg
gchar * error_msg
Definition: qofbackend-p.h:326
_QofBook
Definition: qofbook-p.h:48
QofBackendProvider_s::provider_name
const gchar * provider_name
Definition: qofbackend-p.h:241
QofBackend_s
Definition: qofbackend-p.h:283