2001-08-08 Dave Peticolas <dave@krondo.com>

* src/engine/engine-helpers.[ch]: remove cruft

	* src/guile/gnc-helpers.c: fix warnings

	* src/import-export/qif-import/gncmod-qif-import.c: include api
	header

	* src/register/register-gnome/gncmod-register-gnome.c: include api
	header

	* src/register/register-core/gncmod-register-core.c: include api
	header

	* src/register/ledger-core/gncmod-ledger-core.c: include api header

	* src/backend/postgres/gncmod-backend-postgres.c: include api header

	* src/backend/rpc/gncmod-backend-rpc.c: include api header

	* src/backend/file/gnc-pricedb-xml-v1.c: fix warning

	* src/backend/file/Makefile.am (SUBDIRS): fix includes

	* src/backend/file/gncmod-backend-file.c: include api header

	* src/engine/gncmod-engine.c: include api header

	* src/gnc-module/test/test-dynload.c: fix warning

	* src/gnc-module/test/misc-mods/agedver.c: include api header

	* src/gnc-module/test/misc-mods/incompatdep.c: include api header

	* src/gnc-module/test/misc-mods/futuremodsys.c: include api header

	* src/gnc-module/test/mod-baz/gnc-mod-baz.c: include api header

	* src/gnc-module/test/mod-bar/gnc-mod-bar.c: include api header

	* src/gnc-module/test/mod-bar/Makefile.am: fix includes

	* src/gnc-module/test/mod-foo/gnc-mod-foo.c: include api header

	* src/gnc-module/test/mod-foo/Makefile.am: fix includes

	* src/gnc-module/gnc-module-api.h: new file. public module api

	* src/gnc-module/Makefile.am: add headers


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5088 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-08-08 11:11:54 +00:00
parent aa78390c19
commit 2e0cea3a65
30 changed files with 166 additions and 64 deletions

View File

@ -1,3 +1,54 @@
2001-08-08 Dave Peticolas <dave@krondo.com>
* src/engine/engine-helpers.[ch]: remove cruft
* src/guile/gnc-helpers.c: fix warnings
* src/import-export/qif-import/gncmod-qif-import.c: include api
header
* src/register/register-gnome/gncmod-register-gnome.c: include api
header
* src/register/register-core/gncmod-register-core.c: include api
header
* src/register/ledger-core/gncmod-ledger-core.c: include api header
* src/backend/postgres/gncmod-backend-postgres.c: include api header
* src/backend/rpc/gncmod-backend-rpc.c: include api header
* src/backend/file/gnc-pricedb-xml-v1.c: fix warning
* src/backend/file/Makefile.am (SUBDIRS): fix includes
* src/backend/file/gncmod-backend-file.c: include api header
* src/engine/gncmod-engine.c: include api header
* src/gnc-module/test/test-dynload.c: fix warning
* src/gnc-module/test/misc-mods/agedver.c: include api header
* src/gnc-module/test/misc-mods/incompatdep.c: include api header
* src/gnc-module/test/misc-mods/futuremodsys.c: include api header
* src/gnc-module/test/mod-baz/gnc-mod-baz.c: include api header
* src/gnc-module/test/mod-bar/gnc-mod-bar.c: include api header
* src/gnc-module/test/mod-bar/Makefile.am: fix includes
* src/gnc-module/test/mod-foo/gnc-mod-foo.c: include api header
* src/gnc-module/test/mod-foo/Makefile.am: fix includes
* src/gnc-module/gnc-module-api.h: new file. public module api
* src/gnc-module/Makefile.am: add headers
2001-08-06 Bill Gribble <grib@billgribble.com>
* Added module/plugin system (src/gnc-module/*)

View File

@ -2,3 +2,4 @@ SUBDIRS=file ${SQL_DIR} ${RPC_DIR}
DIST_SUBDIRS=file postgres rpc
noinst_HEADERS = gnc-backend-api.h

View File

@ -2,7 +2,7 @@ SUBDIRS=. test
lib_LTLIBRARIES=libgncmod-backend-file.la
INCLUDES= -I../../engine -I../../gnc-module ${GLIB_CFLAGS} -I../..
INCLUDES= -I.. -I../../engine -I../../gnc-module ${GLIB_CFLAGS} -I../..
libgncmod_backend_file_la_SOURCES= gncmod-backend-file.c \
gnc-account-xml-v2.c gnc-backend-file.c gnc-commodity-xml-v2.c \

View File

@ -23,6 +23,7 @@
#include "io-gncbin.h"
#include "io-gncxml-v2.h"
#include "gnc-backend-api.h"
#include "gnc-book.h"
#include "gnc-book-p.h"
#include "gnc-engine.h"
@ -39,8 +40,6 @@ struct FileBackend_struct
char *linkfile;
int lockfd;
const char *id;
GNCBook *book;
};
@ -171,9 +170,6 @@ file_book_end(Backend *be_start)
if (be->lockfile)
unlink (be->lockfile);
/* g_free (be->id); */
/* be->id = NULL; */
g_free (be->fullpath);
be->fullpath = NULL;
@ -197,7 +193,7 @@ file_all_sync(Backend* be, AccountGroup *ag, GNCPriceDB *pricedb)
}
Backend *
gnc_backend_new(const char *book_id, void *data)
gnc_backend_new(void)
{
FileBackend *fbe;
Backend *be;
@ -232,8 +228,6 @@ gnc_backend_new(const char *book_id, void *data)
fbe->linkfile = NULL;
fbe->lockfd = -1;
fbe->id = book_id;
fbe->book = NULL;
return be;
@ -353,7 +347,7 @@ is_gzipped_file(const gchar *name)
return FALSE;
}
GNCBookFileType
static GNCBookFileType
gnc_file_be_determine_file_type(const char *path)
{
if(gnc_is_xml_data_file_v2(path)) {

View File

@ -302,6 +302,8 @@ pricedb_v2_end_handler(
return TRUE;
}
sixtp* gnc_pricedb_parser_new(void);
sixtp*
gnc_pricedb_parser_new(void)
{

View File

@ -9,6 +9,7 @@
#include <glib.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;

View File

@ -0,0 +1,31 @@
/********************************************************************\
* gnc-backend-api.h -- public functions needed by gnucash backends *
* Copyright (C) 2001 Linux Developers Group, Inc. *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
* *
\********************************************************************/
#ifndef GNC_BACKEND_API_H
#define GNC_BACKEND_API_H
#include "Backend.h"
Backend * gnc_backend_new (void);
#endif

View File

@ -47,7 +47,7 @@ EXTRA_DIST = \
table-drop.sql \
demo.c
INCLUDES = -I../.. -I../../engine -I../../gnc-module
INCLUDES = -I.. -I../.. -I../../engine -I../../gnc-module
CFLAGS = @CFLAGS@ ${GLIB_CFLAGS}
# Some of the required C files are built with the m4 pre-processor

View File

@ -11,7 +11,9 @@
#include "Backend.h"
#include "PostgresBackend.h"
#include "gnc-backend-api.h"
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;

View File

@ -42,7 +42,7 @@ EXTRA_DIST = \
README \
$(RPCGEN_SRCS)
INCLUDES = -I../../engine -I../../gnc-module
INCLUDES = -I.. -I../../engine -I../../gnc-module
LDADD = -lpthread
CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} -DGNCACCT_COMMODITY

View File

@ -11,7 +11,9 @@
#include "Backend.h"
#include "RpcBackend.h"
#include "gnc-backend-api.h"
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;

View File

@ -39,42 +39,6 @@
#include <g-wrap-runtime-guile.h>
int
gnc_guid_type(GUID guid)
{
return xaccGUIDType(&guid);
}
GUID
gnc_account_get_guid(Account *account) {
return *xaccAccountGetGUID(account);
}
Account *
gnc_account_lookup(GUID guid) {
return xaccAccountLookup(&guid);
}
GUID
gnc_trans_get_guid(Transaction *trans) {
return *xaccTransGetGUID(trans);
}
Transaction *
gnc_trans_lookup(GUID guid) {
return xaccTransLookup(&guid);
}
GUID
gnc_split_get_guid(Split *split) {
return *xaccSplitGetGUID(split);
}
Split *
gnc_split_lookup(GUID guid) {
return xaccSplitLookup(&guid);
}
Timespec
gnc_transaction_get_date_posted(Transaction *t) {
Timespec result;

View File

@ -34,16 +34,6 @@
#include <guile/gh.h>
#include <glib.h>
int gnc_guid_type(GUID guid);
GUID gnc_account_get_guid(Account *account);
Account * gnc_account_lookup(GUID guid);
GUID gnc_trans_get_guid(Transaction *trans);
Transaction * gnc_trans_lookup(GUID guid);
GUID gnc_split_get_guid(Split *split);
Split * gnc_split_lookup(GUID guid);
Timespec gnc_transaction_get_date_posted(Transaction *t);
Timespec gnc_transaction_get_date_entered(Transaction *t);

View File

@ -8,8 +8,9 @@
#include <stdio.h>
#include <guile/gh.h>
#include <glib.h>
#include "gnc-engine.h"
#include "gnc-engine.h"
#include "gnc-module-api.h"
#include "gw-engine.h"
/* version of the gnc module system interface we require */

View File

@ -19,6 +19,10 @@ gwmoddir=${GNC_SHAREDIR}/guile-modules/g-wrapped
gwmod_LTLIBRARIES=libgw-gnc-module.la
gwmod_DATA=gw-gnc-module-spec.scm
noinst_HEADERS = \
gnc-module-api.h \
gnc-module.h
noinst_DATA=.scm-links
.scm-links:

View File

@ -0,0 +1,32 @@
/********************************************************************\
* gnc-module-api.h -- public functions needed by gnucash modules *
* Copyright (C) 2001 Linux Developers Group, Inc. *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License*
* along with this program; if not, contact: *
* *
* Free Software Foundation Voice: +1-617-542-5942 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
* *
\********************************************************************/
#ifndef GNC_MODULE_API_H
#define GNC_MODULE_API_H
char * gnc_module_path (void);
char * gnc_module_description (void);
int gnc_module_init (int refcount);
int gnc_module_end(int refcount);
#endif

View File

@ -3,6 +3,9 @@
* Copyright 2001 Linux Developers Group, Inc.
*************************************************************/
#ifndef GNC_MODULE_H
#define GNC_MODULE_H
#include <glib.h>
#include <ltdl.h>
@ -40,3 +43,4 @@ int gnc_module_use_scm_module(gchar * module_path);
* 'mod'. 'mod' must be previously loaded. */
void * gnc_module_lookup(GNCModule mod, gchar * symbol);
#endif

View File

@ -1,9 +1,10 @@
/* incompatdep.c : a gnucash module that depends on an incompatible
* version of another module. the initialization should fail. */
/* agedver.c : testing module age? */
#include <stdio.h>
#include <glib.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
int gnc_module_system_interface = 0;
@ -22,7 +23,7 @@ gnc_module_description(void) {
}
int
gnc_module_init(void) {
gnc_module_init(int refcount) {
return TRUE;
}

View File

@ -1,11 +1,13 @@
/* futuremodsys.c : a gnucash module compiled with a future version of
* the module system. gnucash should not be able to load it. but if
* it doesn't motice that, the actual interface is compatible with
* it doesn't notice that, the actual interface is compatible with
* version 0 so it will load all the way before failing. */
#include <stdio.h>
#include <glib.h>
#include "gnc-module-api.h"
int gnc_module_system_interface = 123456;
int gnc_module_current = 0;

View File

@ -3,7 +3,9 @@
#include <stdio.h>
#include <glib.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
int gnc_module_system_interface = 0;

View File

@ -1,5 +1,7 @@
CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS}
INCLUDES=-I${top_srcdir}/src/gnc-module
checklibdir=${PWD}
checklib_LTLIBRARIES = libbar.la libgncmodbar.la

View File

@ -4,7 +4,9 @@
#include <stdio.h>
#include <guile/gh.h>
#include <glib.h>
#include "bar-gwrap.h"
#include "gnc-module-api.h"
int gnc_module_system_interface = 0;

View File

@ -3,7 +3,9 @@
#include <stdio.h>
#include <guile/gh.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
#include "baz-gwrap.h"
int gnc_module_system_interface = 0;

View File

@ -1,5 +1,7 @@
CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS}
INCLUDES=-I${top_srcdir}/src/gnc-module
checklibdir=${PWD}
checklib_LTLIBRARIES=libfoo.la libgncmodfoo.la

View File

@ -4,7 +4,9 @@
#include <stdio.h>
#include <guile/gh.h>
#include <glib.h>
#include "foo-gwrap.h"
#include "gnc-module-api.h"
int gnc_module_system_interface = 0;

View File

@ -10,7 +10,7 @@
#include "gnc-module.h"
void
static void
guile_main(int argc, char ** argv) {
lt_dlhandle handle;

View File

@ -7,7 +7,9 @@
#include <glib.h>
#include <guile/gh.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;

View File

@ -6,7 +6,9 @@
*********************************************************************/
#include <glib.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;

View File

@ -6,7 +6,9 @@
*********************************************************************/
#include <glib.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;

View File

@ -6,7 +6,9 @@
*********************************************************************/
#include <glib.h>
#include "gnc-module.h"
#include "gnc-module-api.h"
/* version of the gnc module system interface we require */
int gnc_module_system_interface = 0;