From 2205b2fbf6f29d9d7fec8d245d51c0ccd75d2a7f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 25 Feb 2008 00:05:37 +0000 Subject: options is global now kd_prf_ is set to null if cipher_ is null as well --- options.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'options.h') diff --git a/options.h b/options.h index e0c1ac3..b533695 100644 --- a/options.h +++ b/options.h @@ -46,7 +46,8 @@ typedef std::list ConnectToList; class Options { public: - Options(); + static Options& instance(); + bool parse(int argc, char* argv[]); void printUsage(); void printOptions(); @@ -91,6 +92,21 @@ public: ConnectToList getConnectTo(); private: + Options(); + ~Options(); + Options(const Options &l); + void operator=(const Options &l); + + static Options* inst; + static Mutex instMutex; + class instanceCleaner { + public: ~instanceCleaner() { + if(Options::inst != 0) + delete Options::inst; + } + }; + friend class instanceCleaner; + Mutex mutex; ConnectToList connect_to_; @@ -114,4 +130,6 @@ private: std::string auth_algo_; }; +extern Options& gOpt; + #endif -- cgit v1.2.3