GnuCash 2.4.99
gncmod-backend-xml.c
00001 /*********************************************************************
00002  * gncmod-backend-xml.c
00003  * module definition/initialization for the file backend module
00004  *
00005  * Copyright (c) 2001 Linux Developers Group, Inc.
00006  *********************************************************************/
00007 
00008 #include <stdio.h>
00009 #include <gmodule.h>
00010 /* #include <glib-gobject.h> */
00011 
00012 #include "gnc-module.h"
00013 #include "gnc-module-api.h"
00014 
00015 GNC_MODULE_API_DECL(libgncmod_backend_file)
00016 
00017 /* version of the gnc module system interface we require */
00018 int libgnc_backend_file_utils_gnc_module_system_interface = 0;
00019 
00020 /* module versioning uses libtool semantics. */
00021 int libgncmod_backend_file_gnc_module_current  = 0;
00022 int libgncmod_backend_file_gnc_module_revision = 0;
00023 int libgncmod_backend_file_gnc_module_age      = 0;
00024 
00025 static GNCModule engine;
00026 
00027 
00028 char *
00029 libgncmod_backend_file_gnc_module_path(void)
00030 {
00031     return g_strdup("gnucash/backend/file");
00032 }
00033 
00034 char *
00035 libgncmod_backend_file_gnc_module_description(void)
00036 {
00037     return g_strdup("The binary and XML (v1 and v2) backends for GnuCash");
00038 }
00039 
00040 int
00041 libgncmod_backend_file_gnc_module_init(int refcount)
00042 {
00043     engine = gnc_module_load("gnucash/engine", 0);
00044     if (!engine) return FALSE;
00045 
00046     /* Need to initialize g-type engine for gconf */
00047     if (refcount == 0)
00048         g_type_init();
00049 
00050     return TRUE;
00051 }
00052 
00053 int
00054 libgncmod_backend_file_gnc_module_end(int refcount)
00055 {
00056     int unload = TRUE;
00057 
00058     if (engine)
00059         unload = libgnc_backend_file_utils_gnc_module_unload(engine);
00060 
00061     if (refcount == 0)
00062         engine = NULL;
00063 
00064     return unload;
00065 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines