From c1381f5ca4abc79d89330f138c9050a33915cd7e Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 18 Nov 2011 21:53:28 +0000 Subject: [PATCH] Minor reverts of "[Cruft Reduction] Remove unused functions from src/engine" Those two functions are in use in the C++ code. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21581 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/Split.c | 16 ++++++++++++++++ src/engine/Split.h | 2 ++ src/engine/gnc-engine.c | 8 ++++++++ src/engine/gnc-engine.h | 7 +++++++ 4 files changed, 33 insertions(+) diff --git a/src/engine/Split.c b/src/engine/Split.c index c34a2ddc5c..c47fd1df99 100644 --- a/src/engine/Split.c +++ b/src/engine/Split.c @@ -1415,6 +1415,22 @@ get_corr_account_split(const Split *sa, const Split **retval) } /* TODO: these static consts can be shared. */ +const char * +xaccSplitGetCorrAccountName(const Split *sa) +{ + static const char *split_const = NULL; + const Split *other_split; + + if (!get_corr_account_split(sa, &other_split)) + { + if (!split_const) + split_const = _("-- Split Transaction --"); + + return split_const; + } + + return xaccAccountGetName(other_split->acc); +} char * xaccSplitGetCorrAccountFullName(const Split *sa) diff --git a/src/engine/Split.h b/src/engine/Split.h index c9475b767b..f9bf797a10 100644 --- a/src/engine/Split.h +++ b/src/engine/Split.h @@ -417,6 +417,8 @@ int xaccSplitCompareOtherAccountCodes(const Split *sa, const Split *sb); char * xaccSplitGetCorrAccountFullName(const Split *sa); /** document me */ +const char * xaccSplitGetCorrAccountName(const Split *sa); +/** document me */ const char * xaccSplitGetCorrAccountCode(const Split *sa); #ifdef DUMP_FUNCTIONS diff --git a/src/engine/gnc-engine.c b/src/engine/gnc-engine.c index 4bdda9e87a..e374ccfee1 100644 --- a/src/engine/gnc-engine.c +++ b/src/engine/gnc-engine.c @@ -124,6 +124,14 @@ gnc_engine_init(int argc, char ** argv) gnc_engine_init_part3(argc, argv); } +void +gnc_engine_init_static(int argc, char ** argv) +{ + gnc_engine_init_part1(); + gnc_engine_init_part3(argc, argv); +} + + /******************************************************************** * gnc_engine_shutdown * shutdown backend, destroy any global data, etc. diff --git a/src/engine/gnc-engine.h b/src/engine/gnc-engine.h index b2b697339a..992f96d309 100644 --- a/src/engine/gnc-engine.h +++ b/src/engine/gnc-engine.h @@ -225,6 +225,13 @@ typedef void (* gnc_engine_init_hook_t)(int, char **); * method that does not require Guile. */ void gnc_engine_init(int argc, char ** argv); +/** This is the statically linked-in version of gnc_engine_init. It is + * identically to that function except that it doesn't load the + * loadable shared module, which means this function will not load the + * "(gnucash engine)" scheme module. + */ +void gnc_engine_init_static(int argc, char ** argv); + /** Called to shutdown the engine, see also ::qof_close * for use without Guile. */ void gnc_engine_shutdown (void);