Prevent engine's guile dependency from leaking to modules not directly

using guile

For this I have split engine-helpers.h in two headers
- one for conversion functions to and from guile
- one with guile-independent helper functions

The appropriate headers are then included depending on which functions
are required.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22902 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2013-04-13 10:40:55 +00:00
parent 9a4eb83e17
commit 4ae129fb39
16 changed files with 17 additions and 38 deletions

View File

@ -15,7 +15,7 @@
#include <guile-util.h>
#include <app-utils/gnc-sx-instance-model.h>
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
%}
#if defined(SWIGGUILE)

View File

@ -29,7 +29,7 @@
#include "swig-runtime.h"
#include "gnc-engine.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "gnc-helpers.h"
#include "gnc-ui-util.h"

View File

@ -37,7 +37,7 @@
#endif
#include "qof.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "glib-helpers.h"
#include "gnc-gconf-utils.h"
#include "gnc-glib-utils.h"

View File

@ -29,8 +29,9 @@
#include <time.h>
#include <string.h>
#include "Account.h"
#include "option-util.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "glib-helpers.h"
#include "gnc-guile-utils.h"
#include "qof.h"

View File

@ -50,7 +50,7 @@
#include "gnc-gconf-utils.h"
#include "dialog-new-user.h"
#include "gnc-session.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "swig-runtime.h"
/* This static indicates the debugging module that this .o belongs to. */

View File

@ -77,6 +77,7 @@ gncinclude_HEADERS = \
cap-gains.h \
cashobjects.h \
engine-helpers.h \
engine-helpers-guile.h \
glib-helpers.h \
gnc-budget.h \
gnc-commodity.h \

View File

@ -30,6 +30,7 @@
#include "Account.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "glib-helpers.h"
#include "gnc-date.h"
#include "gnc-engine.h"

View File

@ -26,7 +26,6 @@
#define ENGINE_HELPERS_H
#include <glib.h>
#include <libguile.h>
#include "gnc-engine.h"
#include "Account.h"
@ -87,33 +86,4 @@ gnc_book_option_register_cb (gchar *key, GncBOCb func, gpointer user_data);
void
gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data);
/* Helpers for various types */
SCM gnc_timespec2timepair(Timespec t);
Timespec gnc_timepair2timespec(SCM x);
GDate gnc_timepair_to_GDate(SCM x);
int gnc_timepair_p(SCM x);
SCM gnc_guid2scm(GncGUID guid);
GncGUID gnc_scm2guid(SCM guid_scm);
int gnc_guid_p(SCM guid_scm);
/* for a list of strings */
GSList * gnc_query_scm2path (SCM path_scm);
/* These two functions convert a query object into a scheme
* representation of the query and vice-versa. They do not
* simply convert a query pointer to a guile query pointer! */
SCM gnc_query2scm (QofQuery * q);
QofQuery * gnc_scm2query (SCM query_scm);
int gnc_gh_gint64_p(SCM num);
SCM gnc_numeric_to_scm(gnc_numeric arg);
gnc_numeric gnc_scm_to_numeric(SCM arg);
int gnc_numeric_p(SCM arg);
gnc_commodity * gnc_scm_to_commodity(SCM scm);
SCM gnc_commodity_to_scm (const gnc_commodity *commodity);
SCM gnc_book_to_scm (const QofBook *book);
#endif

View File

@ -14,6 +14,7 @@
#include "gnc-lot.h"
#include "gnc-hooks-scm.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "SX-book.h"
#include "kvp-scm.h"
#include "glib-helpers.h"
@ -126,6 +127,7 @@ functions. */
}
%include <engine-helpers.h>
%include <engine-helpers-guile.h>
%typemap(in) Transaction *trans;
%typemap(in) Split *split;
%typemap(in) char * num;

View File

@ -25,6 +25,7 @@
#include "gncBusGuile.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "swig-runtime.h"
#include "guile-mappings.h"
#define FUNC_NAME G_STRFUNC

View File

@ -2,7 +2,7 @@
#include "qof.h"
#include <libguile.h>
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "kvp-scm.h"
#include "guile-mappings.h"

View File

@ -34,7 +34,7 @@
#include "dialog-options.h"
#include "dialog-utils.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "glib-helpers.h"
#include "gnc-account-sel.h"
#include "gnc-tree-view-account.h"

View File

@ -47,6 +47,7 @@
#include "swig-runtime.h"
#include "guile-mappings.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "app-utils/QuickFill.h"

View File

@ -28,6 +28,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdlib.h>
#include <string.h>
#include "gnc-tree-control-split-reg.h"

View File

@ -28,6 +28,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <stdlib.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>

View File

@ -46,7 +46,7 @@
#include "gnc-ui.h"
#include "gnc-ui-util.h"
#include "guile-util.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "swig-runtime.h"