]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/configreader.h
Replace most usages of "GECOS" with "real" or "real name".
[user/henk/code/inspircd.git] / include / configreader.h
index 85ce21f141a748f8be965765d0fa0e5bd1933704..81ec014a029e60c9919f92ecc5bf4bb13c07186c 100644 (file)
@@ -42,12 +42,16 @@ class CoreExport ConfigTag : public refcountbase
        const std::string src_name;
        const int src_line;
 
+       /** Get the value of an option, using def if it does not exist */
+       std::string getString(const std::string& key, const std::string& def, const TR1NS::function<bool(const std::string&)>& validator);
        /** Get the value of an option, using def if it does not exist */
        std::string getString(const std::string& key, const std::string& def = "", size_t minlen = 0, size_t maxlen = UINT32_MAX);
        /** Get the value of an option, using def if it does not exist */
        long getInt(const std::string& key, long def, long min = LONG_MIN, long max = LONG_MAX);
        /** Get the value of an option, using def if it does not exist */
-       double getFloat(const std::string& key, double def);
+       unsigned long getUInt(const std::string& key, unsigned long def, unsigned long min = 0, unsigned long max = ULONG_MAX);
+       /** Get the value of an option, using def if it does not exist */
+       double getFloat(const std::string& key, double def, double min = DBL_MIN, double max = DBL_MAX);
        /** Get the value of an option, using def if it does not exist */
        bool getBool(const std::string& key, bool def = false);
 
@@ -99,8 +103,8 @@ class ServerLimits
        size_t MaxTopic;
        /** Maximum kick message length */
        size_t MaxKick;
-       /** Maximum GECOS (real name) length */
-       size_t MaxGecos;
+       /** Maximum real name length */
+       size_t MaxReal;
        /** Maximum away message length */
        size_t MaxAway;
        /** Maximum line length */
@@ -144,6 +148,18 @@ struct CommandLineConf
         */
        bool writelog;
 
+       /** If this is true, a PID file will be written
+        * to the file given in the "file" variable of
+        * the <pid> tag in the config file. This is
+        * the default.
+        * Passing --nopid as a command line argument
+        * sets this to false; in this case, a PID file
+        * will not be written, even the default PID
+        * file that is usually written when the <pid>
+        * tag is not defined in the config file.
+        */
+       bool writepid;
+
        /** Saved argc from startup
         */
        int argc;
@@ -196,6 +212,19 @@ class CoreExport ServerConfig
        void CrossCheckConnectBlocks(ServerConfig* current);
 
  public:
+       /** How to treat a user in a channel who is banned. */
+       enum BannedUserTreatment
+       {
+               /** Don't treat a banned user any different to normal. */
+               BUT_NORMAL,
+
+               /** Restrict the actions of a banned user. */
+               BUT_RESTRICT_SILENT,
+
+               /** Restrict the actions of a banned user and notify them of their treatment. */
+               BUT_RESTRICT_NOTIFY
+       };
+
        class ServerPaths
        {
         public:
@@ -316,10 +345,8 @@ class CoreExport ServerConfig
         */
        bool GenericOper;
 
-       /** If this value is true, banned users (+b, not extbans) will not be able to change nick
-        * if banned on any channel, nor to message them.
-        */
-       bool RestrictBannedUsers;
+       /** How to treat a user in a channel who is banned. */
+       BannedUserTreatment RestrictBannedUsers;
 
        /** The size of the read() buffer in the user
         * handling code, used to read data into a user's