diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-08-17 20:47:23 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-08-17 20:47:23 (GMT) |
commit | 4a0320f107f294d1b870d44b10ae4b5ebd73f924 (patch) | |
tree | 0ed5715723a4dad99f9b75d6207353d1e3ec19af /src/core | |
parent | 7b90c29f1fd7f685d883ef6c0be75c46ec495a34 (diff) |
Made sure the server has everything required to run.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.c | 64 | ||||
-rw-r--r-- | src/core/core.h | 4 |
2 files changed, 38 insertions, 30 deletions
diff --git a/src/core/core.c b/src/core/core.c index 7be81b2..a72122c 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -49,7 +49,7 @@ /****************************************************************************** * * -* Paramètres : - * +* Paramètres : cs = précise si l'appel est réalisé du côté client. * * * * Description : Charge les éléments de base du programme. * * * @@ -59,7 +59,7 @@ * * ******************************************************************************/ -bool load_all_basic_components(void) +bool load_all_core_components(bool cs) { static bool result = false; /* Bilan à retourner */ char *cfgdir; /* Répertoire de configuration */ @@ -79,33 +79,37 @@ bool load_all_basic_components(void) result &= (ensure_path_exists(cfgdir) == 0); free(cfgdir); - g_boxed_type_register_static("vmpa_t", - (GBoxedCopyFunc)dup_vmpa, - (GBoxedFreeFunc)delete_vmpa); - ERR_load_crypto_strings(); SSL_load_error_strings(); SSL_library_init(); - result &= init_chrysalide_dynamic_types(); + if (result) result = init_global_works(); + + if (result) result = load_hard_coded_collection_definitions(); + + if (cs) + { + g_boxed_type_register_static("vmpa_t", + (GBoxedCopyFunc)dup_vmpa, + (GBoxedFreeFunc)delete_vmpa); - result &= load_main_config_parameters(); + if (result) result = load_main_config_parameters(); - result &= g_generic_config_read(get_main_configuration()); + if (result) result = g_generic_config_read(get_main_configuration()); - result &= init_global_works(); + explorer = g_content_explorer_new(); + set_current_content_explorer(explorer); - explorer = g_content_explorer_new(); - set_current_content_explorer(explorer); + resolver = g_content_resolver_new(); + set_current_content_resolver(resolver); - resolver = g_content_resolver_new(); - set_current_content_resolver(resolver); + if (result) result = init_segment_content_hash_table(); - result &= init_segment_content_hash_table(); + register_arch_gtypes(); - register_arch_gtypes(); + if (result) result = init_chrysalide_dynamic_types(); - result &= load_hard_coded_collection_definitions(); + } } @@ -116,7 +120,7 @@ bool load_all_basic_components(void) /****************************************************************************** * * -* Paramètres : - * +* Paramètres : cs = précise si l'appel est réalisé du côté client. * * * * Description : Décharge les éléments de base du programme. * * * @@ -126,25 +130,29 @@ bool load_all_basic_components(void) * * ******************************************************************************/ -void unload_all_basic_components(void) +void unload_all_core_components(bool cs) { - unload_collection_definitions(); + if (cs) + { + exit_chrysalide_dynamic_types(); - unload_demanglers_definitions(); + unload_demanglers_definitions(); - unload_processors_definitions(); + unload_processors_definitions(); - set_current_content_explorer(NULL); + set_current_content_resolver(NULL); - set_current_content_resolver(NULL); + set_current_content_explorer(NULL); - exit_global_works(); + g_generic_config_write(get_main_configuration()); - g_generic_config_write(get_main_configuration()); + unload_main_config_parameters(); - unload_main_config_parameters(); + } - exit_chrysalide_dynamic_types(); + unload_collection_definitions(); + + exit_global_works(); ERR_free_strings(); diff --git a/src/core/core.h b/src/core/core.h index 627531c..0221f56 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -30,10 +30,10 @@ /* Charge les éléments de base du programme. */ -bool load_all_basic_components(void); +bool load_all_core_components(bool); /* Décharge les éléments de base du programme. */ -void unload_all_basic_components(void); +void unload_all_core_components(bool); |