monotone

monotone Mtn Source Tree

Root/botan/init_def.cpp

1/*************************************************
2* Default Initialization Function Source File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#include <botan/init.h>
7#include <botan/libstate.h>
8#include <botan/modules.h>
9
10namespace Botan {
11
12/*************************************************
13* Library Initialization *
14*************************************************/
15void LibraryInitializer::initialize(const InitializerOptions& args,
16 Modules& modules)
17 {
18 try
19 {
20 set_global_state(new Library_State);
21
22 global_state().initialize(args, modules);
23 }
24 catch(...)
25 {
26 deinitialize();
27 throw;
28 }
29 }
30
31/*************************************************
32* Library Shutdown *
33*************************************************/
34void LibraryInitializer::deinitialize()
35 {
36 set_global_state(0);
37 }
38
39/*************************************************
40* Library Initialization *
41*************************************************/
42void LibraryInitializer::initialize(const std::string& arg_string)
43 {
44 InitializerOptions args(arg_string);
45 Builtin_Modules modules(args);
46
47 initialize(args, modules);
48 }
49
50/*************************************************
51* Library Initialization *
52*************************************************/
53void LibraryInitializer::initialize(const InitializerOptions& args)
54 {
55 Builtin_Modules modules(args);
56
57 initialize(args, modules);
58 }
59
60}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status