2001-08-07 23:29:04 +00:00
|
|
|
/*********************************************************************
|
|
|
|
|
* gnc-mod-engine.c
|
|
|
|
|
* module definition/initialization for the Engine module
|
2007-01-06 00:41:51 +00:00
|
|
|
*
|
|
|
|
|
* Copyright (c) 2001 Linux Developers Group, Inc.
|
2001-08-07 23:29:04 +00:00
|
|
|
*********************************************************************/
|
2015-09-29 12:08:48 -07:00
|
|
|
/********************************************************************\
|
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
|
* along with this program; if not, contact: *
|
|
|
|
|
* *
|
|
|
|
|
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
|
|
|
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
|
|
|
|
|
* Boston, MA 02110-1301, USA gnu@gnu.org *
|
|
|
|
|
* *
|
|
|
|
|
\********************************************************************/
|
|
|
|
|
|
2001-08-07 23:29:04 +00:00
|
|
|
|
2017-10-26 11:14:21 +02:00
|
|
|
#include <config.h>
|
2007-01-06 00:41:51 +00:00
|
|
|
#include <gmodule.h>
|
2003-02-22 08:15:53 +00:00
|
|
|
#include <libguile.h>
|
2001-08-07 23:29:04 +00:00
|
|
|
|
2001-08-08 11:11:54 +00:00
|
|
|
#include "gnc-engine.h"
|
|
|
|
|
#include "gnc-module-api.h"
|
2001-08-07 23:29:04 +00:00
|
|
|
|
2007-04-18 23:23:04 +00:00
|
|
|
GNC_MODULE_API_DECL(libgncmod_engine)
|
|
|
|
|
|
2001-08-07 23:29:04 +00:00
|
|
|
/* version of the gnc module system interface we require */
|
2007-04-18 23:23:04 +00:00
|
|
|
int libgncmod_engine_gnc_module_system_interface = 0;
|
2001-08-07 23:29:04 +00:00
|
|
|
|
|
|
|
|
/* module versioning uses libtool semantics. */
|
2007-04-18 23:23:04 +00:00
|
|
|
int libgncmod_engine_gnc_module_current = 0;
|
|
|
|
|
int libgncmod_engine_gnc_module_revision = 0;
|
|
|
|
|
int libgncmod_engine_gnc_module_age = 0;
|
2002-06-24 05:58:58 +00:00
|
|
|
|
|
|
|
|
|
2001-08-07 23:29:04 +00:00
|
|
|
char *
|
2007-04-18 23:23:04 +00:00
|
|
|
libgncmod_engine_gnc_module_path(void)
|
2001-08-07 23:29:04 +00:00
|
|
|
{
|
2010-02-18 05:31:54 +00:00
|
|
|
return g_strdup("gnucash/engine");
|
2001-08-07 23:29:04 +00:00
|
|
|
}
|
|
|
|
|
|
2007-01-06 00:41:51 +00:00
|
|
|
char *
|
2007-04-18 23:23:04 +00:00
|
|
|
libgncmod_engine_gnc_module_description(void)
|
2001-08-07 23:29:04 +00:00
|
|
|
{
|
2010-02-18 05:31:54 +00:00
|
|
|
return g_strdup("The GnuCash accounting engine");
|
2001-08-07 23:29:04 +00:00
|
|
|
}
|
|
|
|
|
|
2006-10-15 19:02:05 +00:00
|
|
|
extern SCM scm_init_sw_engine_module(void);
|
|
|
|
|
|
2001-08-07 23:29:04 +00:00
|
|
|
int
|
2007-04-18 23:23:04 +00:00
|
|
|
libgncmod_engine_gnc_module_init(int refcount)
|
2001-08-07 23:29:04 +00:00
|
|
|
{
|
2010-02-18 05:31:54 +00:00
|
|
|
if (refcount == 0)
|
|
|
|
|
{
|
|
|
|
|
/* initialize the engine on the first load */
|
|
|
|
|
gnc_engine_init(0, NULL);
|
|
|
|
|
}
|
2007-01-06 00:41:51 +00:00
|
|
|
|
2010-02-18 05:31:54 +00:00
|
|
|
scm_init_sw_engine_module();
|
|
|
|
|
scm_c_eval_string("(use-modules (sw_engine))");
|
|
|
|
|
scm_c_eval_string("(use-modules (gnucash engine))");
|
2011-11-21 10:40:17 +00:00
|
|
|
scm_c_eval_string("(use-modules (gnucash business-core))");
|
2002-01-09 21:42:29 +00:00
|
|
|
|
2010-02-18 05:31:54 +00:00
|
|
|
return TRUE;
|
2001-08-07 23:29:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
2010-02-18 05:31:54 +00:00
|
|
|
libgncmod_engine_gnc_module_end(int refcount)
|
|
|
|
|
{
|
|
|
|
|
return TRUE;
|
2001-08-07 23:29:04 +00:00
|
|
|
}
|