aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-06-30 02:28:47 +0000
committerlloyd <[email protected]>2008-06-30 02:28:47 +0000
commita01d19fd314804f3466737b3c6314bec0d511990 (patch)
tree7d8e24004d0d9c7a8852a2faa1f8c0612eee90dd /include
parent954e01df3c99836d13f2a188193b0bdbf660856a (diff)
Remove the Config class.
In reality, Config was a singleton, with the only owner being the Library_State object. Theoretically one could create and use another Config instance, but in practice it was never done. Reflect the reality and inline the members and public functions of Config in Library_State, removing Config entirely.
Diffstat (limited to 'include')
-rw-r--r--include/botan.h1
-rw-r--r--include/config.h47
-rw-r--r--include/libstate.h17
3 files changed, 14 insertions, 51 deletions
diff --git a/include/botan.h b/include/botan.h
index 74a6628a0..70261398a 100644
--- a/include/botan.h
+++ b/include/botan.h
@@ -5,7 +5,6 @@
#include <botan/base.h>
#include <botan/rng.h>
-#include <botan/config.h>
#include <botan/init.h>
#include <botan/lookup.h>
#include <botan/version.h>
diff --git a/include/config.h b/include/config.h
deleted file mode 100644
index 65147e3e6..000000000
--- a/include/config.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*************************************************
-* Configuration Handling Header File *
-* (C) 1999-2008 Jack Lloyd *
-*************************************************/
-
-#ifndef BOTAN_POLICY_CONF_H__
-#define BOTAN_POLICY_CONF_H__
-
-#include <botan/mutex.h>
-#include <string>
-#include <map>
-
-namespace Botan {
-
-/*************************************************
-* Library Configuration Settings *
-*************************************************/
-class BOTAN_DLL Config
- {
- public:
- Config();
- ~Config();
-
- void load_defaults();
-
- std::string get(const std::string&, const std::string&) const;
- bool is_set(const std::string&, const std::string&) const;
- void set(const std::string&, const std::string&,
- const std::string&, bool = true);
-
- std::string option(const std::string&) const;
-
- void set_option(const std::string, const std::string&);
-
- void add_alias(const std::string&, const std::string&);
- std::string deref_alias(const std::string&) const;
- private:
- Config(const Config&) {}
- Config& operator=(const Config&) { return (*this); }
-
- std::map<std::string, std::string> settings;
- Mutex* mutex;
- };
-
-}
-
-#endif
diff --git a/include/libstate.h b/include/libstate.h
index 63c01d270..f6a616bba 100644
--- a/include/libstate.h
+++ b/include/libstate.h
@@ -43,13 +43,23 @@ class BOTAN_DLL Library_State
Allocator* get_allocator(const std::string& = "") const;
void add_allocator(Allocator*);
- void set_default_allocator(const std::string&) const;
+ void set_default_allocator(const std::string&);
+
+ std::string get(const std::string&, const std::string&) const;
+ bool is_set(const std::string&, const std::string&) const;
+ void set(const std::string&, const std::string&,
+ const std::string&, bool = true);
- class Config& config() const;
std::string option(const std::string&) const;
+ void set_option(const std::string, const std::string&);
+
+ void add_alias(const std::string&, const std::string&);
+ std::string deref_alias(const std::string&) const;
class Mutex* get_mutex() const;
private:
+ void load_default_config();
+
Library_State(const Library_State&) {}
Library_State& operator=(const Library_State&) { return (*this); }
@@ -57,7 +67,8 @@ class BOTAN_DLL Library_State
class Mutex_Factory* mutex_factory;
- mutable class Config* config_obj;
+ std::map<std::string, std::string> config;
+ class Mutex* config_lock;
class Mutex* allocator_lock;
std::map<std::string, Allocator*> alloc_factory;