]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/configreader.h
Remove spanningtree override of /LUSERS
[user/henk/code/inspircd.git] / include / configreader.h
index 54d9f7053d41b329102500bfe7192e66a7b30088..e9bcbdb2c0213e13183ebe0229524807eaa2ec57 100644 (file)
 #include "socketengine.h"
 #include "socket.h"
 
-/* Required forward definitions */
-class ServerConfig;
-class ServerLimits;
-class InspIRCd;
-class BufferedSocket;
-
-/** A cached text file stored with its contents as lines
- */
-typedef std::vector<std::string> file_cache;
-
-/** A configuration key and value pair
- */
-typedef std::pair<std::string, std::string> KeyVal;
-
 /** Structure representing a single <tag> in config */
 class CoreExport ConfigTag : public refcountbase
 {
@@ -65,6 +51,8 @@ class CoreExport ConfigTag : public refcountbase
 
        std::string getTagLocation();
 
+       inline const std::vector<KeyVal>& getItems() const { return items; }
+
        /** Create a new ConfigTag, giving access to the private KeyVal item list */
        static ConfigTag* create(const std::string& Tag, const std::string& file, int line,
                std::vector<KeyVal>*&items);
@@ -72,10 +60,6 @@ class CoreExport ConfigTag : public refcountbase
        ConfigTag(const std::string& Tag, const std::string& file, int line);
 };
 
-/** An entire config file, built up of KeyValLists
- */
-typedef std::multimap<std::string, reference<ConfigTag> > ConfigDataHash;
-
 /** Defines the server's length limits on various length-limited
  * items such as topics, nicknames, channel names etc.
  */
@@ -199,11 +183,6 @@ class CoreExport OperInfo : public refcountbase
        }
 };
 
-typedef std::map<std::string, reference<ConfigTag> > TagIndex;
-typedef std::map<std::string, reference<OperInfo> > OperIndex;
-typedef ConfigDataHash::iterator ConfigIter;
-typedef std::pair<ConfigDataHash::iterator, ConfigDataHash::iterator> ConfigTagList;
-
 /** This class holds the bulk of the runtime configuration for the ircd.
  * It allows for reading new config values, accessing configuration files,
  * and storage of the configuration data needed to run the ircd, such as
@@ -397,11 +376,6 @@ class CoreExport ServerConfig
         */
        bool RestrictBannedUsers;
 
-       /** If this value is true, halfops have been
-        * enabled in the configuration file.
-        */
-       bool AllowHalfop;
-
        /** If this is set to true, then mode lists (e.g
         * MODE #chan b) are hidden from unprivileged
         * users.
@@ -440,11 +414,6 @@ class CoreExport ServerConfig
         */
        int MaxWhoResults;
 
-       /** How many seconds to wait before exiting
-        * the program when /DIE is correctly issued.
-        */
-       int DieDelay;
-
        /** True if we're going to hide netsplits as *.net *.split for non-opers
         */
        bool HideSplits;
@@ -619,4 +588,29 @@ class CoreExport ServerConfig
 
 };
 
+/** The background thread for config reading, so that reading from executable includes
+ * does not block.
+ */
+class CoreExport ConfigReaderThread : public Thread
+{
+       ServerConfig* Config;
+       volatile bool done;
+ public:
+       const std::string TheUserUID;
+       ConfigReaderThread(const std::string &useruid)
+               : Config(new ServerConfig), done(false), TheUserUID(useruid)
+       {
+       }
+
+       virtual ~ConfigReaderThread()
+       {
+               delete Config;
+       }
+
+       void Run();
+       /** Run in the main thread to apply the configuration */
+       void Finish();
+       bool IsDone() { return done; }
+};
+
 #endif