diff options
author | lloyd <[email protected]> | 2006-06-26 13:30:05 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-06-26 13:30:05 +0000 |
commit | 864dcbc7b49d8e57b57af594b88f3853523b74da (patch) | |
tree | 29e6ff17688c9b5266ecce25320cf13f25711a22 /src/init_def.cpp | |
parent | ec036e15f63507286d54df7a02a6e5e28aeaff03 (diff) |
Various changes to how library initialization occurs, though I'm still
not completely happy with it.
Diffstat (limited to 'src/init_def.cpp')
-rw-r--r-- | src/init_def.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/init_def.cpp b/src/init_def.cpp index 17d8899e2..6b2e5e66b 100644 --- a/src/init_def.cpp +++ b/src/init_def.cpp @@ -50,28 +50,20 @@ void initialize(const std::string& arg_string) } set_global_state(new Library_State(mutex_factory)); - global_state().set_default_policy(); global_state().set_timer(modules.timer()); - std::vector<Allocator*> allocators = modules.allocators(); - for(u32bit j = 0; j != allocators.size(); ++j) - global_state().add_allocator(allocators[j]); + modules.set_allocators(global_state(), false); if(args.config_file() != "") Config::load(args.config_file(), global_state()); - std::vector<Engine*> engines = modules.engines(); - for(u32bit j = 0; j != engines.size(); ++j) - global_state().add_engine(engines[j]); + modules.set_engines(global_state(), args.use_engines()); global_state().set_transcoder(new Default_Charset_Transcoder); - global_state().set_prng(new ANSI_X931_RNG); - std::vector<EntropySource*> sources = modules.entropy_sources(); - for(u32bit j = 0; j != sources.size(); ++j) - global_state().add_entropy_source(sources[j], true); + modules.set_entropy_sources(global_state()); const u32bit min_entropy = Config::get_u32bit("rng/min_entropy"); |