diff options
author | lloyd <[email protected]> | 2006-12-14 11:12:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-12-14 11:12:32 +0000 |
commit | 2b32d88fabd0cf45cb42981dd03258b39d1828c4 (patch) | |
tree | db8549290d367b6eef4ff62ff4bc62357135afe4 /include | |
parent | 780243495bda65e52f8f1797a3db0a25e420998b (diff) |
Move the UI pulse functions into the global library state. That is (as best
as I can tell) the last of the global data, with the exception of the single
global_lib_state pointer in libstate.cpp
Diffstat (limited to 'include')
-rw-r--r-- | include/enums.h | 15 | ||||
-rw-r--r-- | include/libstate.h | 12 | ||||
-rw-r--r-- | include/ui.h | 30 |
3 files changed, 27 insertions, 30 deletions
diff --git a/include/enums.h b/include/enums.h index bc939aba1..c5ffeff24 100644 --- a/include/enums.h +++ b/include/enums.h @@ -99,6 +99,21 @@ enum Character_Set { LATIN1_CHARSET }; +/************************************************* +* Pulse Function * +*************************************************/ +enum Pulse_Type { + GENERAL_PULSE, + + PIPE_WRITE, + + PRIME_SEARCHING, + PRIME_SIEVING, + PRIME_PASSED_SIEVE, + PRIME_TESTING, + PRIME_FOUND +}; + static const u32bit NO_CERT_PATH_LIMIT = 0xFFFFFFF0; } diff --git a/include/libstate.h b/include/libstate.h index c2e217df7..8cf700220 100644 --- a/include/libstate.h +++ b/include/libstate.h @@ -8,6 +8,7 @@ #include <botan/base.h> #include <botan/enums.h> +#include <botan/ui.h> #include <string> #include <vector> #include <map> @@ -31,6 +32,13 @@ class Library_State }; friend class Engine_Iterator; + class UI + { + public: + virtual void pulse(Pulse_Type) {} + virtual ~UI() {} + }; + Allocator* get_allocator(const std::string& = "") const; void add_allocator(Allocator*); void set_default_allocator(const std::string&) const; @@ -59,6 +67,9 @@ class Library_State void set_x509_state(class X509_GlobalState*); class X509_GlobalState& x509_state(); + void pulse(Pulse_Type) const; + void set_ui(UI*); + void set_transcoder(class Charset_Transcoder*); std::string transcode(const std::string, Character_Set, Character_Set) const; @@ -80,6 +91,7 @@ class Library_State std::map<std::string, Allocator*> alloc_factory; mutable Allocator* cached_default_allocator; + UI* ui; class Charset_Transcoder* transcoder; RandomNumberGenerator* rng; std::vector<Allocator*> allocators; diff --git a/include/ui.h b/include/ui.h index a956518d6..888d92c48 100644 --- a/include/ui.h +++ b/include/ui.h @@ -28,36 +28,6 @@ class User_Interface mutable bool first_try; }; -namespace UI { - -/************************************************* -* Pulse Function * -*************************************************/ -enum Pulse_Type { - GENERAL_PULSE, - - PIPE_WRITE, - - PRIME_SEARCHING, - PRIME_SIEVING, - PRIME_PASSED_SIEVE, - PRIME_TESTING, - PRIME_FOUND -}; -typedef void (*pulse_func)(Pulse_Type, void*); - -/************************************************* -* Set the UI pulse function * -*************************************************/ -void set_pulse(pulse_func, void* = 0); - -/************************************************* -* Call the UI pulse function * -*************************************************/ -void pulse(Pulse_Type = GENERAL_PULSE); - -} - } #endif |