gnucash maint: Define SET_ENUM in core-utils.i as well
Geert Janssens
gjanssens at code.gnucash.org
Wed Jan 15 03:29:34 EST 2020
Updated via https://github.com/Gnucash/gnucash/commit/08d685f4 (commit)
from https://github.com/Gnucash/gnucash/commit/5ac7f1be (commit)
commit 08d685f4aad9bea3f057963c6d59201d98082463
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Jan 15 09:29:27 2020 +0100
Define SET_ENUM in core-utils.i as well
Will be used to expose our settings related constants to guile
diff --git a/libgnucash/core-utils/core-utils.i b/libgnucash/core-utils/core-utils.i
index 63a108a09..54558fc2b 100644
--- a/libgnucash/core-utils/core-utils.i
+++ b/libgnucash/core-utils/core-utils.i
@@ -85,6 +85,20 @@ gchar * gnc_locale_to_utf8(const gchar *);
const char * gnc_locale_default_iso_currency_code (void);
#if defined(SWIGGUILE)
+%init {
+ {
+ char tmp[100];
+
+#define SET_ENUM(e) snprintf(tmp, 100, "(set! %s (%s))", (e), (e)); \
+ scm_c_eval_string(tmp);
+
+ /* Enum conversions go here */
+
+#undef SET_ENUM
+ }
+
+}
+
%rename ("gnc-utf8?") wrap_gnc_utf8_validate;
%inline %{
/* This helper function wraps gnc_utf8_validate() into a predicate. */
Summary of changes:
libgnucash/core-utils/core-utils.i | 14 ++++++++++++++
1 file changed, 14 insertions(+)
More information about the gnucash-changes
mailing list