diff options
author | lloyd <[email protected]> | 2010-08-06 15:38:55 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-08-06 15:38:55 +0000 |
commit | 22718fa6526bf5c9923d0091d662cd2def75c605 (patch) | |
tree | 74136557e7b945ed3a5ee64e980613c3325f633e /src/libstate/init.cpp | |
parent | 5d9eecf1646facfff9b20e9932894fce0d0ff39c (diff) |
Move the functions that directly manipulate the global state singleton
into global_state.{h,cpp}. Move all of the functions into a new
namespace Global_State_Management, though exposing global_state() into
the Botan namespace for compatability.
Also add new functions global_state_exists and
set_global_state_unless_set which may be helpful in certain tricky
initialization scenarios (eg when an application using botan also uses
a library which may or may not itself use botan).
Diffstat (limited to 'src/libstate/init.cpp')
-rw-r--r-- | src/libstate/init.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstate/init.cpp b/src/libstate/init.cpp index 386767b04..e2139f42e 100644 --- a/src/libstate/init.cpp +++ b/src/libstate/init.cpp @@ -8,6 +8,7 @@ #include <botan/init.h> #include <botan/parsing.h> #include <botan/libstate.h> +#include <botan/global_state.h> namespace Botan { @@ -53,7 +54,7 @@ void LibraryInitializer::initialize(const std::string& arg_string) 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_Management::set_global_state(new Library_State); global_state().initialize(thread_safe); } @@ -69,7 +70,7 @@ void LibraryInitializer::initialize(const std::string& arg_string) */ void LibraryInitializer::deinitialize() { - set_global_state(0); + Global_State_Management::set_global_state(0); } } |