aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libstate/init.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-01 21:20:55 +0000
committerlloyd <[email protected]>2014-01-01 21:20:55 +0000
commit197dc467dec28a04c3b2f30da7cef122dfbb13e9 (patch)
treecdbd3ddaec051c72f0a757db461973d90c37b97a /lib/libstate/init.h
parent62faac373c07cfe10bc8c309e89ebdd30d8e5eaa (diff)
Shuffle things around. Add NIST X.509 test to build.
Diffstat (limited to 'lib/libstate/init.h')
-rw-r--r--lib/libstate/init.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/libstate/init.h b/lib/libstate/init.h
new file mode 100644
index 000000000..2d70e4370
--- /dev/null
+++ b/lib/libstate/init.h
@@ -0,0 +1,48 @@
+/*
+* Library Initialization
+* (C) 1999-2008 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_LIBRARY_INITIALIZER_H__
+#define BOTAN_LIBRARY_INITIALIZER_H__
+
+#include <botan/build.h>
+#include <string>
+
+namespace Botan {
+
+/**
+* This class represents the Library Initialization/Shutdown Object. It
+* has to exceed the lifetime of any Botan object used in an
+* application. You can call initialize/deinitialize or use
+* LibraryInitializer in the RAII style.
+*/
+class BOTAN_DLL LibraryInitializer
+ {
+ public:
+ /**
+ * Initialize the library
+ * @param options a string listing initialization options
+ */
+ static void initialize(const std::string& options = "");
+
+ /**
+ * Shutdown the library
+ */
+ static void deinitialize();
+
+ /**
+ * Initialize the library
+ * @param options a string listing initialization options
+ */
+ LibraryInitializer(const std::string& options = "")
+ { LibraryInitializer::initialize(options); }
+
+ ~LibraryInitializer() { LibraryInitializer::deinitialize(); }
+ };
+
+}
+
+#endif