GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncmod-report-system.c
1 /*********************************************************************
2  * gncmod-report-system.c
3  * module definition/initialization for the report infrastructure
4  *
5  * Copyright (c) 2001 Linux Developers Group, Inc.
6  *********************************************************************/
7 
8 #include "config.h"
9 #include <gmodule.h>
10 #include <libguile.h>
11 
12 #include "gnc-module.h"
13 #include "gnc-module-api.h"
14 
15 GNC_MODULE_API_DECL(libgncmod_report_system)
16 
17 /* version of the gnc module system interface we require */
18 int libgncmod_report_system_gnc_module_system_interface = 0;
19 
20 /* module versioning uses libtool semantics. */
21 int libgncmod_report_system_gnc_module_current = 0;
22 int libgncmod_report_system_gnc_module_revision = 0;
23 int libgncmod_report_system_gnc_module_age = 0;
24 
25 
26 char *
27 libgncmod_report_system_gnc_module_path(void)
28 {
29  return g_strdup("gnucash/report/report-system");
30 }
31 
32 char *
33 libgncmod_report_system_gnc_module_description(void)
34 {
35  return g_strdup("Core components of GnuCash report generation system");
36 }
37 
38 extern SCM scm_init_sw_report_system_module(void);
39 
40 int
41 libgncmod_report_system_gnc_module_init(int refcount)
42 {
43  /* load the engine (we depend on it) */
44  if (!gnc_module_load("gnucash/engine", 0))
45  {
46  return FALSE;
47  }
48 
49  if (!gnc_module_load("gnucash/app-utils", 0))
50  {
51  return FALSE;
52  }
53  scm_init_sw_report_system_module();
54 
55  scm_c_eval_string("(use-modules (gnucash report report-system))");
56 
57  /* if this is the first time the module's being loaded, initialize
58  * the relative date system */
59  if (refcount == 0)
60  {
61  scm_c_eval_string("(gnc:reldate-initialize)");
62  }
63 
64  return TRUE;
65 }
66 
67 int
68 libgncmod_report_system_gnc_module_end(int refcount)
69 {
70  return TRUE;
71 }