GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncmod-html.c
1 /*********************************************************************
2  * gncmod-html.c
3  * module definition/initialization for the html utilities
4  *
5  * Copyright (c) 2001 Linux Developers Group, Inc.
6  *********************************************************************/
7 
8 #include "config.h"
9 
10 #include <gmodule.h>
11 #include <libguile.h>
12 #include <gtk/gtk.h>
13 
14 #include "gnc-module.h"
15 #include "gnc-module-api.h"
16 
17 #include "gnc-html.h"
18 #include "qof.h"
19 
20 GNC_MODULE_API_DECL(libgncmod_html)
21 
22 /* version of the gnc module system interface we require */
23 int libgncmod_html_gnc_module_system_interface = 0;
24 
25 /* module versioning uses libtool semantics. */
26 int libgncmod_html_gnc_module_current = 0;
27 int libgncmod_html_gnc_module_revision = 0;
28 int libgncmod_html_gnc_module_age = 0;
29 
30 
31 char *
32 libgncmod_html_gnc_module_path( void )
33 {
34  return g_strdup( "gnucash/html" );
35 }
36 
37 char *
38 libgncmod_html_gnc_module_description( void )
39 {
40  return g_strdup( "Utilities for using HTML with GnuCash" );
41 }
42 
43 static void
44 lmod( char* mn )
45 {
46  char* form = g_strdup_printf( "(use-modules %s)\n", mn );
47  scm_c_eval_string( form );
48  g_free( form );
49 }
50 
51 extern SCM scm_init_sw_gnc_html_module( void );
52 
53 int
54 libgncmod_html_gnc_module_init( int refcount )
55 {
56  /* load the engine (we depend on it) */
57  if ( !gnc_module_load( "gnucash/engine", 0 ) )
58  {
59  return FALSE;
60  }
61 
62  if ( !gnc_module_load( "gnucash/app-utils", 0 ) )
63  {
64  return FALSE;
65  }
66 
67  scm_init_sw_gnc_html_module();
68  gnc_html_initialize();
69  lmod( "(sw_gnc_html)" );
70 // lmod( "(gnucash gnc_html)" );
71 
72  return TRUE;
73 }
74 
75 int
76 libgncmod_html_gnc_module_end( int refcount )
77 {
78  return TRUE;
79 }