mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
force-exit gnucash if a required library can't be loaded.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14206 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
177b31b397
commit
5d1ee59cfa
@ -2,6 +2,9 @@
|
||||
|
||||
* src/engine/gnc-engine.c: load the qsf backend from the right place.
|
||||
|
||||
* src/engine/gnc-engine.c:
|
||||
force-exit gnucash if a required library can't be loaded.
|
||||
|
||||
2006-05-26 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/import-export/hbci/druid-hbci-initial.c: Simplify calling
|
||||
|
@ -78,12 +78,13 @@ gnc_engine_init(int argc, char ** argv)
|
||||
static struct {
|
||||
const gchar* dir;
|
||||
const gchar* lib;
|
||||
gboolean required;
|
||||
} libs[] = {
|
||||
{ QOF_LIB_DIR, QSF_BACKEND_LIB },
|
||||
{ GNC_LIBDIR, GNC_LIB_NAME },
|
||||
{ QOF_LIB_DIR, QSF_BACKEND_LIB, FALSE },
|
||||
{ GNC_LIBDIR, GNC_LIB_NAME, TRUE },
|
||||
/* shouldn't the PG gnc-module do this instead of US doing it? */
|
||||
{ GNC_LIBDIR, "gnc-backend-postgres" },
|
||||
{ NULL, NULL } }, *lib;
|
||||
{ GNC_LIBDIR, "gnc-backend-postgres", FALSE },
|
||||
{ NULL, NULL, FALSE } }, *lib;
|
||||
gnc_engine_init_hook_t hook;
|
||||
GList * cur;
|
||||
|
||||
@ -103,11 +104,23 @@ gnc_engine_init(int argc, char ** argv)
|
||||
/* Now register our core types */
|
||||
cashobjects_register();
|
||||
|
||||
for (lib = libs; lib->dir && lib->lib ; lib++) {
|
||||
for (lib = libs; lib->dir && lib->lib ; lib++)
|
||||
{
|
||||
if (qof_load_backend_library(lib->dir, lib->lib))
|
||||
{
|
||||
engine_is_initialized = 1;
|
||||
}
|
||||
else
|
||||
g_message("failed to load %s from %s", lib->lib, lib->dir);
|
||||
{
|
||||
g_message("failed to load %s from %s\n", lib->lib, lib->dir);
|
||||
/* If this is a required library, stop now! */
|
||||
if (lib->required)
|
||||
{
|
||||
g_message("required library %s not found. Exiting.\n",
|
||||
lib->lib);
|
||||
g_assert(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* call any engine hooks */
|
||||
|
Loading…
Reference in New Issue
Block a user