r21581 - gnucash/trunk/src/engine - Minor reverts of "[Cruft Reduction] Remove unused functions from src/engine"
Christian Stimming
cstim at code.gnucash.org
Fri Nov 18 16:53:28 EST 2011
Author: cstim
Date: 2011-11-18 16:53:28 -0500 (Fri, 18 Nov 2011)
New Revision: 21581
Trac: http://svn.gnucash.org/trac/changeset/21581
Modified:
gnucash/trunk/src/engine/Split.c
gnucash/trunk/src/engine/Split.h
gnucash/trunk/src/engine/gnc-engine.c
gnucash/trunk/src/engine/gnc-engine.h
Log:
Minor reverts of "[Cruft Reduction] Remove unused functions from src/engine"
Those two functions are in use in the C++ code.
Modified: gnucash/trunk/src/engine/Split.c
===================================================================
--- gnucash/trunk/src/engine/Split.c 2011-11-18 21:53:13 UTC (rev 21580)
+++ gnucash/trunk/src/engine/Split.c 2011-11-18 21:53:28 UTC (rev 21581)
@@ -1415,7 +1415,23 @@
}
/* 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)
{
Modified: gnucash/trunk/src/engine/Split.h
===================================================================
--- gnucash/trunk/src/engine/Split.h 2011-11-18 21:53:13 UTC (rev 21580)
+++ gnucash/trunk/src/engine/Split.h 2011-11-18 21:53:28 UTC (rev 21581)
@@ -417,6 +417,8 @@
char * xaccSplitGetCorrAccountFullName(const Split *sa);
/** document me */
+const char * xaccSplitGetCorrAccountName(const Split *sa);
+/** document me */
const char * xaccSplitGetCorrAccountCode(const Split *sa);
#ifdef DUMP_FUNCTIONS
Modified: gnucash/trunk/src/engine/gnc-engine.c
===================================================================
--- gnucash/trunk/src/engine/gnc-engine.c 2011-11-18 21:53:13 UTC (rev 21580)
+++ gnucash/trunk/src/engine/gnc-engine.c 2011-11-18 21:53:28 UTC (rev 21581)
@@ -124,6 +124,14 @@
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.
Modified: gnucash/trunk/src/engine/gnc-engine.h
===================================================================
--- gnucash/trunk/src/engine/gnc-engine.h 2011-11-18 21:53:13 UTC (rev 21580)
+++ gnucash/trunk/src/engine/gnc-engine.h 2011-11-18 21:53:28 UTC (rev 21581)
@@ -225,6 +225,13 @@
* 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);
More information about the gnucash-changes
mailing list