From 6182dfeda971fe5bfb37763e1e396186e9d12093 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 5 Feb 2022 16:50:25 +0100 Subject: [PATCH] Added a new init.h to make the initialization a less code. --- init.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 init.h diff --git a/init.h b/init.h new file mode 100644 index 0000000..c7184ab --- /dev/null +++ b/init.h @@ -0,0 +1,33 @@ +#ifndef FRAMEWORK_INIT_H +#define FRAMEWORK_INIT_H + +#if DATABASES_ENABLED +#include "database_backends/db_init.h" +#endif + +#include "platform/platform_initializer.h" + +// Backends +#include "crypto_backends/hash_hashlib/setup.h" + +void initialize_framework() { +#if DATABASES_ENABLED + initialize_database_backends(); +#endif + + backend_hash_hashlib_install_providers(); + + PlatformInitializer::allocate_all(); +} + +void initialize_framework_args(int argc, char **argv, char **envp) { + initialize_framework(); + + PlatformInitializer::arg_setup(argc, argv, envp); +} + +void uninitialize_framework() { + PlatformInitializer::free_all(); +} + +#endif \ No newline at end of file