Added a new init.h to make the initialization a less code.

This commit is contained in:
Relintai 2022-02-05 16:50:25 +01:00
parent ffd1f7eb68
commit 6182dfeda9

33
init.h Normal file
View File

@ -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