Commit Graph

59 Commits

Author SHA1 Message Date
Christopher Lam
4910b532e0 [modularise] (gnucash engine) 2020-12-09 06:39:51 +08:00
Christopher Lam
c17ce5251c [modularise] (gnucash core-utils) 2020-12-09 06:39:51 +08:00
Christopher Lam
096be60860 [modularise] (gnucash utilities) 2020-12-09 06:39:51 +08:00
Christopher Lam
da32fb0dae [utilities] simplify addto! 2020-12-04 21:33:31 +08:00
Christopher Lam
82d3bcd394 [core-utils] N_ is identity function
N_ is mapped to the identity function. Previously N_ was defined as a
macro, which is more tricky to export.
2020-12-04 21:33:01 +08:00
Christopher Lam
a1c517b4ba [gnc_scm_to_numeric] create NaN gnc_numeric instead of runtime error
If guile calls a C function which expects gnc_numeric but sends a
non-number, it will create a gnc_numeric_error object. This will allow
error gnc_numeric to be handled elsewhere.

Also the overflow gnc_numeric was incorrectly created.
2020-11-23 21:50:05 +08:00
Christopher Lam
8f32992100 [gnc-engine-guile.c] return #f when gnc_numeric has error
otherwise it'd throw guile div/0 exception
2020-11-23 08:08:27 +08:00
Christopher Lam
6d6eff6b70 Expose ngettext as gnc:ngettext 2020-11-02 22:24:05 +08:00
Christopher Lam
8628ffa957 3/3 [engine.scm] deprecate scheme utility functions 2020-11-01 08:30:56 +08:00
Christopher Lam
25e4efc2b7 [core-utils.scm][API] gnc:string-locale<? gnc:string-locale>?
locale-sensitive string-sorting functions -- currently mirrors guile's
(ice-9 i18n) functions -- may be modified to call C code if guile code
is not reliable.
2020-11-01 08:30:56 +08:00
Geert Janssens
dae2ea8356 Expose C_ function (gettext with context string) to guile code
First use is for the document link short code (L)
2020-09-17 22:20:02 +02:00
Christopher Lam
cbbca47013 [test-engine-extras] Use more efficient gnc:list-flatten 2020-08-19 07:19:38 +08:00
Christopher Lam
f35a26882d Addendnum to ad20f859c -- _ must be exported 2020-08-03 23:26:29 +08:00
Christopher Lam
ad20f859cc [core-utils] define _ for guile-2.2 2020-08-03 07:11:27 +08:00
Christopher Lam
fe3787c427 [gnc-numeric] use srfi-9 records for :gnc-monetary 2020-07-14 22:48:19 +08:00
Christopher Lam
428c8c501c [guile-3] change _ to G_
In guile-3 _ is a reserved symbol. Change to G_ by guile gettext
convention.
2020-07-12 19:03:26 +08:00
Christopher Lam
851bc7f8d9 deprecations: clarify functions deprecated in 4.x. 2020-06-22 19:53:29 +08:00
Geert Janssens
1d3164bfdb Build depedency fix - build backend libararies before the guile bindings
Compiling our guile scripts will run loaded libraries. One of the libraries to
load is the engine library which expects to find the enabled backends (xml and or dbi).
If those aren't built yet, this will result in error messages printed in the build output.
2020-06-21 21:45:57 +02:00
Christopher Lam
0b386157a1 [business-core] string-hash doesn't not guarantee unique hash
subtle bug here-- used string-hash to convert guid-string to a number
which is faster to use as hash key. but string-hash does not guarantee
that there are no hash collisions. it is best to use guid string
instead which is guaranteed to uniquely define a split.
2020-06-17 08:08:51 +08:00
John Ralls
b5aeca94b6 Bug 797746 - [reports] German umlauts not escaped
Resume using libintl directly. Guile apparently passes gettext msgstrs
through scm_from_locale_string instead of scm_from_utf8_string.
2020-06-07 10:46:01 -07:00
John Ralls
54859eaf5b Add scm-core-utils as dependency of scm-engine-1.
Fixes build failure reported on gnucash-devel.
2020-06-01 13:43:28 -07:00
Christopher Lam
c434239b7d Upgrade split->owner to gnc:split->owner 2020-05-29 21:32:23 +08:00
John Ralls
8ff5af4c19 Decouple QofBook creation from QofSession.
So that we don't create two books when loading a session.
Step 1 to not having a dirty book when we think we should have no
book at all.
2020-05-08 15:59:41 -07:00
Geert Janssens
bbeb9a2b62 Drop all gnc-module dependencies and includes from compilation units that no longer use it
This also drops the python wrapper for gnc-module. As for the guile wrappers,
python should use other means of loading our shared libraries.

This commit required a few tweaks to the dependency chain as some units
inherited dependency information from gnc-module's public dependency
interface.
2020-04-24 22:16:24 +02:00
Geert Janssens
abf29aa196 Drop the gnc-module wrapper around the test-engine library
It's not adding anything
2020-04-24 21:29:20 +02:00
Geert Janssens
e78313147c Cmake - rework gnc_add_scheme_deprecated_module to use keyword parameters
Update all invocations accordingly
2020-03-30 08:41:29 +02:00
Geert Janssens
06ff8a292d Use new keyword parameters for all calls to gnc_add_scheme_test_targets 2020-03-30 08:41:29 +02:00
Geert Janssens
c05281c582 Use new keyword parameters for all calls to gnc_add_scheme_targets 2020-03-30 08:41:29 +02:00
Christopher Lam
1fa5fd0a14 Merge remote-tracking branch 'upstream/maint' 2020-03-14 11:48:10 +08:00
Christopher Lam
fd76a31104 [utilities] deprecate gnc:substring-replace-from-to
with jqplot gone, no need to use this function anymore.
2020-02-19 06:19:27 +08:00
Christopher Lam
907bff34c3 [gnc-module] clean up deprecation warnings
* use reasonable max-width
* compact code
* use (ice-9 match)
2020-02-09 11:34:43 +08:00
Geert Janssens
ab5b7155af CMake - remove parameter repetition in else() and endif() statements
Fix leftovers after the maint branch merge
2020-02-06 17:01:26 +01:00
Geert Janssens
3b1b78d54c Drop a few left-over references to the deprecated gnc-module scheme wrapper 2019-12-07 21:05:58 +01:00
Geert Janssens
7f6367410e price quotes - move scm file from bindings to gnucash
This isn't wrapping anything really.
As discussed with John on PR#611
2019-12-06 20:38:21 +01:00
Geert Janssens
88706e5657 bindings/guile - remove gnc-module wrapper
Emit appropriate deprecation warnings in case code tries to invoke the removed functions.
Only for gnc:module-load a more elaborate compat function has
been written which should allow code using this obsolete function
to continue to function. The emitted deprecation warning will
guide the user to update his/her code for future compatibility.
2019-12-06 20:38:21 +01:00
Geert Janssens
0de3dc6bf1 guile/bindings cleanup - only load module gnome-modules when really in use 2019-12-06 20:38:21 +01:00
Geert Janssens
4c77f7670e engine - remove gncmod boilerplate
engine is now an ordinary shared library

This requires a few more places to run gnc_engine_init as
this is no longer done as part of module loading.
2019-12-06 20:38:21 +01:00
Geert Janssens
25cce83f29 gnome-utils - expose wrapped api directly from gnome-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/gnome-utils" 0)
the gnome-utils gncmodule. An ordinary (use-modules (gnucash gnome-utils)) suffices
2019-12-06 20:38:20 +01:00
Geert Janssens
ee722b85c1 bindings/guile cleanup - fold engine-utilities.scm into engine.scm
It was only exposed via engine.scm anyway and combining them
in one file eliminates one explicit load_extension and sw_engine call.
2019-12-06 20:38:20 +01:00
Geert Janssens
c00bf6bcdb app-utils - expose wrapped api directly from app-utils.scm
With that in place we no longer need to (gnc:module-load "gnucash/app-utils" 0)
the app-utils gncmodule. An ordinary (use-modules (gnucash app-utils)) suffices
2019-12-06 20:38:20 +01:00
Geert Janssens
043c6367a5 gnc-module test updates
- move test modules into a subdirectory on Windows as well
- move the futuremod module into its own subdirectory
  to avoid its load warnings each time gnc_module_init is called
  That also tends to happen when building guile modules.
- remove the log handlers filtering out the futuremodsys warnings
  They didn't match the actual warning signature anyway and
  they're no longer emitted during testing
2019-12-06 19:59:12 +01:00
Geert Janssens
fbd73c83cf gnc-module - move most of scm tests to bindings/guile
This is a first rudimentary separation of gnc-module tests
based on whether they require guile or not. Needs plenty of refinement
which will be applied in followup commits.
2019-12-06 19:59:12 +01:00
Geert Janssens
6eb0ccfa11 gnc-module - move guile wrappers to bindings/guile 2019-12-06 19:59:12 +01:00
Geert Janssens
096a515154 bindings/guile - fix typos in error messages
These were imported verbatim from libgnucash/app-utils/guile-util.c
2019-12-06 19:59:12 +01:00
Geert Janssens
6a3505d01f app-utils - move price-quotes support functions directly into bindings
- wrappers for glib functions go into glib-guile
- engine convenience functions go into gnc-engine-guile
2019-12-06 19:59:12 +01:00
Geert Janssens
d777128e6f app-utils - simplify and move gettext wrappers
1. Instead of creating a C wrapper around gettext to then wrap in
guile, use guile's builtin gettext support directly.

The code still defines the _ and N_ shorthands. However it doesn't
really warant a separate module just for these two shorthands.
Instead define them in core-utils. So all code wanting to use
_ or N_ in guile should now use the (gnucash core-utils) module.

The bulk of this commit is actually deleting the scm-gettext
target and using (gnucash core-utils) instead of (gnucash gettext).

2. As the definition of _ and N_ is removed from app-utils.scm,
the app-utils test for a functional N_ macro has been moved to a
new test file in the guile bindinds tests.

3. The (gnucash gettext) module has been deprecated. Use
(gnucash core-utils) from now on.
2019-12-06 19:59:12 +01:00
Geert Janssens
c46c9682eb engine/test - move guile related tests to bindings 2019-12-06 19:59:11 +01:00
Geert Janssens
02511401b7 bindings/guile cosmetic - rename source files for consistency 2019-12-06 19:59:11 +01:00
Geert Janssens
77f669f123 bindings/guile cosmetic - move price-quotes target lower down
This is just a cosmetic. This way the scm targets in the CMakeLists.txt
file are ordered according to their dependencies (targets later in the
file can depend on targets earlier in the file).
2019-12-06 19:59:11 +01:00
Geert Janssens
48f3195e5c bindings - make business-core scm module part of the engine module
There's no reason to expose it as an individual module as what it exports
are support functions for first class engine objects.
2019-12-06 19:59:11 +01:00