aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate/init_def.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-10 22:16:13 +0000
committerlloyd <[email protected]>2008-11-10 22:16:13 +0000
commit675aa7bcc476d8445b6eb2bc3c6b0a2f3ce12958 (patch)
treecdcc9c87a1692d62c6b6559aac8254acfe4dfa18 /src/libstate/init_def.cpp
parent88b635f50937f926097b76c7834baead3b936dfe (diff)
Remove Modules class from the initializer code - it just wasn't that useful
as an abstraction. Check #ifdef's for engines and such directly in libstate.cpp
Diffstat (limited to 'src/libstate/init_def.cpp')
-rw-r--r--src/libstate/init_def.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/libstate/init_def.cpp b/src/libstate/init_def.cpp
index 03f97252e..742ca7c0b 100644
--- a/src/libstate/init_def.cpp
+++ b/src/libstate/init_def.cpp
@@ -5,21 +5,25 @@
#include <botan/init.h>
#include <botan/libstate.h>
-#include <botan/modules.h>
namespace Botan {
/*************************************************
* Library Initialization *
*************************************************/
-void LibraryInitializer::initialize(const InitializerOptions& args,
- Modules& modules)
+void LibraryInitializer::initialize(const InitializerOptions& args)
{
try
{
+ /*
+ This two stage initialization process is because Library_State's
+ constructor will implicitly refer to global state through the
+ allocators and so for, so global_state() has to be a valid
+ reference before initialize() can be called. Yeah, gross.
+ */
set_global_state(new Library_State);
- global_state().initialize(args, modules);
+ global_state().initialize(args);
}
catch(...)
{
@@ -42,19 +46,8 @@ void LibraryInitializer::deinitialize()
void LibraryInitializer::initialize(const std::string& arg_string)
{
InitializerOptions args(arg_string);
- Builtin_Modules modules(args);
-
- initialize(args, modules);
- }
-
-/*************************************************
-* Library Initialization *
-*************************************************/
-void LibraryInitializer::initialize(const InitializerOptions& args)
- {
- Builtin_Modules modules(args);
- initialize(args, modules);
+ initialize(args);
}
}