GnuCash 2.4.99
gnc-mod-foo.c
00001 /* gnc-mod-foo.c : the Gnucash plugin that wraps the library
00002  * 'libfoo.so'. it does this by being linked against libfoo.so */
00003 
00004 #include "config.h"
00005 #include <stdio.h>
00006 #include <gmodule.h>
00007 #include <libguile.h>
00008 
00009 #include "gnc-module-api.h"
00010 #include "swig-foo.c"
00011 
00012 GNC_MODULE_API_DECL(libgncmodfoo)
00013 
00014 int libgncmodfoo_gnc_module_system_interface = 0;
00015 
00016 int libgncmodfoo_gnc_module_current = 0;
00017 int libgncmodfoo_gnc_module_age = 0;
00018 int libgncmodfoo_gnc_module_revision = 0;
00019 
00020 char *
00021 libgncmodfoo_gnc_module_path(void)
00022 {
00023     return g_strdup("gnucash/foo");
00024 }
00025 
00026 char *
00027 libgncmodfoo_gnc_module_description(void)
00028 {
00029     return g_strdup("this is a foo module");
00030 }
00031 
00032 int
00033 libgncmodfoo_gnc_module_init(int refcount)
00034 {
00035     /* publish the wrapped Scheme bindings for libfoo */
00036     scm_init_sw_foo_module();
00037     scm_c_eval_string("(use-modules (sw_foo))");
00038 
00039     /* use the Scheme "foo" module */
00040     scm_c_eval_string("(use-modules (gnucash foo))");
00041 
00042     return TRUE;
00043 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines