[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_99-18-gcc1cf76
Rémi Cardona
nobody at users.sourceforge.net
Sun Jan 30 13:42:36 CET 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, master has been updated
via cc1cf763ecd3abb74f2eb0b77423a2aad096e872 (commit)
from 4872d7f9b370e047d39b68e1e977eccdf00e3654 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cc1cf763ecd3abb74f2eb0b77423a2aad096e872
Author: Rémi Cardona <remi at gentoo.org>
Date: Sun Jan 30 13:02:19 2011 +0100
plugins: merge gsb_plugins_static.c back in to gsb_plugins.c
-----------------------------------------------------------------------
Changes:
diff --git a/src/Makefile.am b/src/Makefile.am
index 4ef3bd4..21ace8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -104,6 +104,7 @@ libgrisbi_la_SOURCES = \
gsb_fyear_config.c \
gsb_payment_method.c \
gsb_payment_method_config.c \
+ gsb_plugins.c \
gsb_real.c \
gsb_reconcile.c \
gsb_reconcile_config.c \
@@ -303,12 +304,6 @@ libgrisbi_la_SOURCES = \
utils_operations.h \
utils_str.h
-if ENABLE_STATIC
-libgrisbi_la_SOURCES += gsb_plugins_static.c
-else
-libgrisbi_la_SOURCES += gsb_plugins.c
-endif
-
grisbi_SOURCES = \
main.c \
main.h
diff --git a/src/gsb_plugins.c b/src/gsb_plugins.c
index ae086f1..a523ac6 100644
--- a/src/gsb_plugins.c
+++ b/src/gsb_plugins.c
@@ -25,6 +25,11 @@
#include "gsb_plugins.h"
#include "dialog.h"
#include "include.h"
+#ifdef ENABLE_STATIC
+#include "plugins/gnucash/gnucash.h"
+#include "plugins/ofx/ofx.h"
+#include "plugins/openssl/openssl.h"
+#endif /* ENABLE_STATIC */
/*END_INCLUDE*/
/*START_EXTERN*/
@@ -43,6 +48,30 @@ static GSList * plugins = NULL;
*/
void gsb_plugins_scan_dir ( const char *dirname )
{
+#ifdef ENABLE_STATIC
+ gsb_plugin *plugin = NULL;
+
+ plugin = g_malloc0 ( sizeof ( gsb_plugin ) );
+ plugin -> name = "gnucash";
+ plugin -> plugin_register = &gnucash_plugin_register;
+ plugin -> plugin_run = &gnucash_plugin_run;
+ plugin -> plugin_register ();
+ plugins = g_slist_append ( plugins, plugin );
+
+ plugin = g_malloc0 ( sizeof ( gsb_plugin ) );
+ plugin -> name = "ofx";
+ plugin -> plugin_register = &ofx_plugin_register;
+ plugin -> plugin_run = &ofx_plugin_run;
+ plugin -> plugin_register ();
+ plugins = g_slist_append ( plugins, plugin );
+
+ plugin = g_malloc0 ( sizeof ( gsb_plugin ) );
+ plugin -> name = "openssl";
+ plugin -> plugin_register = &openssl_plugin_register;
+ plugin -> plugin_run = &openssl_plugin_run;
+ plugin -> plugin_register ();
+ plugins = g_slist_append ( plugins, plugin );
+#else /* ENABLE_STATIC */
GDir * plugin_dir;
const gchar * filename;
gchar * plugin_name;
@@ -125,6 +154,7 @@ void gsb_plugins_scan_dir ( const char *dirname )
}
g_dir_close ( plugin_dir );
+#endif /* ENABLE_STATIC */
}
diff --git a/src/gsb_plugins_static.c b/src/gsb_plugins_static.c
deleted file mode 100644
index 1afdaa4..0000000
--- a/src/gsb_plugins_static.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* Copyright (C) 2006-2006 Benjamin Drieu (bdrieu at april.org) */
-/* http://www.grisbi.org */
-/* */
-/* 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, write to the Free Software */
-/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* */
-/* ************************************************************************** */
-
-#include "include.h"
-
-/*START_INCLUDE*/
-#include "gsb_plugins.h"
-#include "dialog.h"
-#include "include.h"
-#include "plugins/gnucash/gnucash.h"
-#include "plugins/ofx/ofx.h"
-#include "plugins/openssl/openssl.h"
-/*END_INCLUDE*/
-
-/*START_EXTERN*/
-/*END_EXTERN*/
-
-/*START_STATIC*/
-/*END_STATIC*/
-
-
-/** List of registered plugins. It should contain gsb_plugin structures. */
-static GSList * plugins = NULL;
-
-/**
- *
- *
- */
-void gsb_plugins_scan_dir ( const char *dirname )
-{
- gsb_plugin *plugin = NULL;
-
- plugin = g_malloc0 ( sizeof ( gsb_plugin ) );
- plugin -> name = "gnucash";
- plugin -> plugin_register = &gnucash_plugin_register;
- plugin -> plugin_run = &gnucash_plugin_run;
- plugin -> plugin_register ();
- plugins = g_slist_append ( plugins, plugin );
-
- plugin = g_malloc0 ( sizeof ( gsb_plugin ) );
- plugin -> name = "ofx";
- plugin -> plugin_register = &ofx_plugin_register;
- plugin -> plugin_run = &ofx_plugin_run;
- plugin -> plugin_register ();
- plugins = g_slist_append ( plugins, plugin );
-
- plugin = g_malloc0 ( sizeof ( gsb_plugin ) );
- plugin -> name = "openssl";
- plugin -> plugin_register = &openssl_plugin_register;
- plugin -> plugin_run = &openssl_plugin_run;
- plugin -> plugin_register ();
- plugins = g_slist_append ( plugins, plugin );
-}
-
-
-
-/**
- *
- *
- *
- */
-gsb_plugin * gsb_plugin_find ( gchar * plugin_name )
-{
- GSList * tmp = plugins;
-
- g_return_val_if_fail ( plugin_name, NULL );
-
- while ( tmp )
- {
- gsb_plugin * plugin = (gsb_plugin *) tmp -> data;
-
- if ( ! strcmp ( plugin_name, plugin -> name ) )
- {
- return plugin;
- }
-
- tmp = tmp -> next;
- }
-
- return NULL;
-}
-
-
-
-/**
- * Get activated plugins.
- *
- * \return A newly-allocated string representing activated plugins.
- */
-gchar * gsb_plugin_get_list ()
-{
- gchar * list = NULL;
- gchar * old_list = NULL;
- GSList * tmp = plugins;
-
- while ( tmp )
- {
- gsb_plugin * plugin = (gsb_plugin *) tmp -> data;
-
- if ( ! list )
- {
- list = g_strconcat ( _("with plugins"), " ", plugin -> name, NULL );
- }
- else
- {
- old_list = list;
- list = g_strconcat ( list, ", ", plugin -> name, NULL );
- g_free(old_list);
- }
-
- tmp = tmp -> next;
- }
- if (! list)
- list = g_strdup("no plugin");
-
- return list;
-}
-
-
-
-/* Local Variables: */
-/* c-basic-offset: 4 */
-/* End: */
hooks/post-receive
--
grisbi
More information about the cvs
mailing list