diff --git a/src/lumiera/config_interface.h b/src/lumiera/config_interface.h index 8429cd4ee..374af50c5 100644 --- a/src/lumiera/config_interface.h +++ b/src/lumiera/config_interface.h @@ -33,16 +33,12 @@ * Declares the interface for the lumiera configuration system */ -#ifndef LUMIERA_PLUGIN - void lumiera_config_interface_init (void); void lumiera_config_interface_destroy (void); -#endif - /* Note that some interfaces return ints rather than underlying opaque pointers, this is then the truth value of the pointer */ diff --git a/src/lumiera/lumiera.c b/src/lumiera/lumiera.c index 295e81052..3499e795b 100644 --- a/src/lumiera/lumiera.c +++ b/src/lumiera/lumiera.c @@ -52,7 +52,7 @@ main (int argc, char** argv) { (void) argc; (void) argv; - lumiera_init (); + lumiera_preinit (); TODO ("commandline parser"); lumiera_config_init (LUMIERA_CONFIG_PATH); @@ -61,14 +61,15 @@ main (int argc, char** argv) TODO ("plugindb support instead loading all plugins at once"); lumiera_plugin_discover (lumiera_plugin_load, lumiera_plugin_register); + lumiera_init (); TRACE (lumiera, "Lumiera is alive"); TODO ("video editing"); TRACE (lumiera, "initiating shutdown sequence"); + lumiera_shutdown (); lumiera_interfaceregistry_destroy (); lumiera_config_destroy (); - lumiera_shutdown (); } diff --git a/src/lumiera/lumiera.h b/src/lumiera/lumiera.h index c262cc9e5..ebbd33d5b 100644 --- a/src/lumiera/lumiera.h +++ b/src/lumiera/lumiera.h @@ -45,6 +45,9 @@ NOBUG_DECLARE_FLAG (lumiera); */ //TODO: declarations go here// +void +lumiera_preinit (void); + void lumiera_init (void); diff --git a/src/lumiera/lumiera_init.c b/src/lumiera/lumiera_init.c index 8476d69a7..87f7d55d3 100644 --- a/src/lumiera/lumiera_init.c +++ b/src/lumiera/lumiera_init.c @@ -24,6 +24,7 @@ //TODO: Lumiera header includes// #include "lumiera/lumiera.h" +#include "lumiera/config_interface.h" //TODO: internal/static forward declarations// @@ -42,25 +43,55 @@ NOBUG_DEFINE_FLAG_PARENT (lumiera, lumiera_all); //code goes here// +/** + * Early initialization + * Sets up some important basic stuff, this is run as *very* first before anything + * else got initialized. Used for NoBug and other kinds of hooks. There is no matching + * shutdown function for this, consider moving as much as possible to lumiera_init() + */ void -lumiera_init (void) +lumiera_preinit (void) { NOBUG_INIT; NOBUG_INIT_FLAG (all); NOBUG_INIT_FLAG (lumiera_all); NOBUG_INIT_FLAG (lumiera); - TRACE (lumiera, "initializing"); + TRACE (lumiera, "booting up"); } +/** + * Standard initialization procedure + * Boots all buildin subsystems up as described in DesignProcess/GlobalInitilaization. + * The configuration and interfaces/plugin subsystems are already started at this point and + * commandline arguments are parsed. + */ +void +lumiera_init (void) +{ + TRACE (lumiera, "initializing"); + + lumiera_config_interface_init (); +} + + +/** + * Shutdown procedure + * This shuts all subsystem which got initialized in lumiera_init down. + * Shutdowns should be arranged in reverse initialization order. + */ void lumiera_shutdown (void) { TRACE (lumiera, "shutdown"); + + lumiera_config_interface_destroy (); } + + /* // Local Variables: // mode: C