31 #define QOF_CONFIG_DESC "desc"
32 #define QOF_CONFIG_TIP "tip"
39 be->session_begin = NULL;
40 be->session_end = NULL;
41 be->destroy_backend = NULL;
46 be->compile_query = NULL;
47 be->free_query = NULL;
50 be->load_config = NULL;
51 be->events_pending = NULL;
52 be->process_events = NULL;
53 be->percentage = NULL;
55 #ifndef QOF_DISABLE_DEPRECATED
74 (be->begin) (be, inst);
93 (be->commit) (be, inst);
101 g_return_if_fail (be);
107 be->config_count = 0;
118 g_return_if_fail (be || option);
119 count = be->config_count;
122 switch (option->
type)
126 value = kvp_value_new_gint64 (*(gint64 *) option->
value);
131 value = kvp_value_new_double (*(gdouble *) option->
value);
141 value = kvp_value_new_string ((
const gchar *) option->
value);
157 #ifndef QOF_DISABLE_DEPRECATED
160 value = kvp_value_new_timespec (*(
Timespec *) option->
value);
179 temp = g_strdup_printf (
"/%s", option->
option_name);
183 g_strdup_printf (
"/%s/%s", QOF_CONFIG_DESC,
189 g_strdup_printf (
"/%s/%s", QOF_CONFIG_TIP,
195 be->config_count = count;
202 g_return_val_if_fail (be, NULL);
203 be->config_count = 0;
204 return be->backend_configuration;
207 struct config_iterate
220 config_foreach_cb (
const gchar * key,
KvpValue * value, gpointer data)
227 struct config_iterate *helper;
229 g_return_if_fail (key || value || data);
230 helper = (
struct config_iterate *) data;
231 if (!helper->recursive)
233 PERR (
" no parent frame");
245 ENTER (
" key=%s", key);
247 option.
type = kvp_value_get_type (value);
255 option.
value = (gpointer) & int64;
260 db = kvp_value_get_double (value);
261 option.
value = (gpointer) & db;
266 num = kvp_value_get_numeric (value);
267 option.
value = (gpointer) & num;
277 option.
value = (gpointer) kvp_value_get_time (value);
279 #ifndef QOF_DISABLE_DEPRECATED
283 ts = kvp_value_get_timespec (value);
284 option.
value = (gpointer) & ts;
309 parent = g_strdup_printf (
"/%s/%s", QOF_CONFIG_DESC, key);
310 option.
description = kvp_frame_get_string (helper->recursive, parent);
312 parent = g_strdup_printf (
"/%s/%s", QOF_CONFIG_TIP, key);
313 option.
tooltip = kvp_frame_get_string (helper->recursive, parent);
317 helper->fcn (&option, helper->data);
323 (*(gint64 *) option.
value));
329 (*(gdouble *) option.
value));
341 (gchar *) option.
value);
350 #ifndef QOF_DISABLE_DEPRECATED
386 struct config_iterate helper;
394 helper.recursive = config;
404 if (!be->load_config)
406 (be->load_config) (be, config);
416 return (be->get_config) (be);
432 const gchar * filename,
const gchar * init_fcn)
435 typedef void (*backend_init) (void);
437 backend_init gmod_init;
440 g_return_val_if_fail (g_module_supported (), FALSE);
441 fullpath = g_module_build_path (directory, filename);
442 backend = g_module_open (fullpath, G_MODULE_BIND_LAZY);
445 PERR (
" No backend found. %s", g_module_error ());
449 if (!g_module_symbol (backend, init_fcn, g))
451 PERR (
" Backend did not initialise. %s", g_module_error ());
454 g_module_make_resident (backend);