where is gnc_module_system_init() called?

Derek Atkins warlord@MIT.EDU
11 Jun 2002 18:25:12 -0400


Michele Ravani <Michele.Ravani@swissonline.ch> writes:

> Hi
> 
> reading the design doc in gnc-module, it is mentioned that
> gnc_module_system_init() should be called to initialize the module system.
> I've tried to find where it is called in the code, but all the locations I
> have found are in tests.

Check out src/scm/main.scm, in particular the function gnc:startup,
where it calls gnc:module-system-init (which is the g-wrapped
gnc_module_system_init() call).

> I am a bit confused, but may be I am starting to understand what Derek
> meant by 
> 'Unfortunately at this time there is no way to get a plug-in module to
> actually get loaded at runtime without modifying existing code.'
> 
> Is it so that the module system is currently used to load modules from
> other modules needing the functionality, but there isn't a centralized
> mechanism to initialize the module system at startup and load a number of
> predifined or configured modules?

Yes.  Right now the gnucash application is "defined" by main.scm.  It
loads all the gnc-modules (by name), and their dependencies.  However,
if main.scm does not know about a file/module, and it's not a
dependency of another file/module, there is no way (currently) to get
it loaded into the system.

> If this is the case, where is the code loading the core modules, i.e. the
> ones that 'make' the application?

main.scm :)

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available