businessmod-core.c

00001 /*********************************************************************
00002  * businessmod-core.c
00003  * module definition/initialization for the core Business module
00004  * 
00005  * Copyright (c) 2001 Derek Atkins <warlord@MIT.EDU>
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, contact:
00019  *
00020  * Free Software Foundation           Voice:  +1-617-542-5942
00021  * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
00022  * Boston, MA  02111-1307,  USA       gnu@gnu.org
00023  *
00024  *********************************************************************/
00025 
00026 #include "config.h"
00027 #include <stdio.h>
00028 #include <glib.h>
00029 #include <libguile.h>
00030 
00031 #include "gnc-module.h"
00032 #include "gnc-module-api.h"
00033 #include "gw-business-core.h"
00034 
00035 #include "gncAddressP.h"
00036 #include "gncBillTermP.h"
00037 #include "gncCustomerP.h"
00038 #include "gncEmployeeP.h"
00039 #include "gncEntryP.h"
00040 #include "gncInvoiceP.h"
00041 #include "gncJobP.h"
00042 #include "gncOrderP.h"
00043 #include "gncOwnerP.h"
00044 #include "gncTaxTableP.h"
00045 #include "gncVendorP.h"
00046 
00047 /* version of the gnc module system interface we require */
00048 int libgncmod_business_core_LTX_gnc_module_system_interface = 0;
00049 
00050 /* module versioning uses libtool semantics. */
00051 int libgncmod_business_core_LTX_gnc_module_current  = 0;
00052 int libgncmod_business_core_LTX_gnc_module_revision = 0;
00053 int libgncmod_business_core_LTX_gnc_module_age      = 0;
00054 
00055 /* forward references */
00056 char *libgncmod_business_core_LTX_gnc_module_path(void);
00057 char *libgncmod_business_core_LTX_gnc_module_description(void);
00058 int libgncmod_business_core_LTX_gnc_module_init(int refcount);
00059 int libgncmod_business_core_LTX_gnc_module_end(int refcount);
00060 
00061 char *
00062 libgncmod_business_core_LTX_gnc_module_path(void) 
00063 {
00064   return g_strdup("gnucash/business-core");
00065 }
00066 
00067 char * 
00068 libgncmod_business_core_LTX_gnc_module_description(void) 
00069 {
00070   return g_strdup("The Gnucash business core");
00071 }
00072 
00073 int
00074 libgncmod_business_core_LTX_gnc_module_init(int refcount) 
00075 {
00076   /* load the engine (we depend on it) */
00077   if(!gnc_module_load("gnucash/engine", 0)) {
00078     return FALSE;
00079   }
00080 
00081   if(refcount == 0) 
00082   {
00083     /* initialize known types */
00084     gncInvoiceRegister ();
00085     gncJobRegister ();
00086     gncBillTermRegister ();
00087     gncCustomerRegister ();
00088     gncAddressRegister ();
00089     gncEmployeeRegister ();
00090     gncEntryRegister ();
00091     gncOrderRegister ();
00092     gncOwnerRegister ();
00093     gncTaxTableRegister ();
00094     gncVendorRegister ();
00095   }
00096   
00097   scm_c_eval_string("(use-modules (g-wrapped gw-business-core))");
00098   scm_c_eval_string("(use-modules (gnucash business-core))");
00099 
00100   return TRUE;
00101 }
00102 
00103 int
00104 libgncmod_business_core_LTX_gnc_module_end(int refcount) {
00105   return TRUE;
00106 }

Generated on Sun Sep 4 18:07:33 2005 for GnuCash by  doxygen 1.4.3-20050530