]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd_io.h
Align names that are output on startup using \t htabs
[user/henk/code/inspircd.git] / include / inspircd_io.h
index 86ab543a5c1e35b4691acdf2a129e47133c0aa56..89b6300dea563b27b985cb7a52e899140496beb4 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
 #define SPARSE 40
 #define NONE 50
 
+typedef bool (*Validator)(const char*, const char*, void*);
+
+enum ConfigDataType { DT_NOTHING, DT_INTEGER, DT_CHARPTR, DT_BOOLEAN };
+
+struct InitialConfig {
+       char* tag;
+       char* value;
+       void* val;
+       int datatype;
+       Validator validation_function;
+};
+
 /** 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
@@ -61,6 +73,10 @@ class ServerConfig : public classbase
         */
        std::string ConfProcess(char* buffer, long linenumber, std::stringstream* errorstream, bool &error, std::string filename);
 
+       /** Check that there is only one of each configuration item
+        */
+       bool CheckOnce(char* tag, bool bail, userrec* user);
+
   public:
 
        /** Holds the server name of the local server
@@ -138,6 +154,10 @@ class ServerConfig : public classbase
         */
         char ModPath[1024];
 
+       /** The temporary directory where modules are copied
+        */
+       char TempDir[1024];
+
        /** The full pathname to the executable, as
         * given in argv[0] when the program starts.
         */
@@ -193,6 +213,11 @@ class ServerConfig : public classbase
         */
         unsigned int SoftLimit;
 
+       /** Maximum number of targets for a multi target command
+        * such as PRIVMSG or KICK
+        */
+       unsigned int MaxTargets;
+
        /** The maximum number of /WHO results allowed
         * in any single /WHO command.
         */
@@ -211,6 +236,19 @@ class ServerConfig : public classbase
         */
         int DieDelay;
 
+       /** True if we're going to hide netsplits as *.net *.split for non-opers
+        */
+       bool HideSplits;
+
+       /** True if we're going to hide ban reasons for non-opers (e.g. G-Lines,
+        * K-Lines, Z-Lines)
+        */
+       bool HideBans;
+
+       /** Set to a non-empty string to obfuscate the server name of users in WHOIS
+        */
+       char HideWhoisServer[MAXBUF];
+
        /** A list of IP addresses the server is listening
         * on.
         */
@@ -255,10 +293,41 @@ class ServerConfig : public classbase
         */
        char implement_lists[255][255];
 
+       /** Global implementation list
+        */
+       char global_implementation[255];
+
        /** A list of ports claimed by IO Modules
         */
        std::map<int,Module*> IOHookModule;
 
+       /** The 005 tokens of this server (ISUPPORT)
+        * populated/repopulated upon loading or unloading
+        * modules.
+        */
+       std::string data005;
+
+       /** STATS characters in this list are available
+        * only to operators.
+        */
+       char OperOnlyStats[MAXBUF];
+
+       /** The path and filename of the ircd.log file
+        */
+       std::string logpath;
+
+       /** Custom version string, which if defined can replace the system info in VERSION.
+        */
+       char CustomVersion[MAXBUF];
+
+       /** List of u-lined servers
+        */
+       std::vector<irc::string> ulines;
+
+       /** Max banlist sizes for channels (the std::string is a glob)
+        */
+       std::map<std::string,int> maxbans;
+
        ServerConfig();
 
        /** Clears the include stack in preperation for
@@ -274,6 +343,7 @@ class ServerConfig : public classbase
 
        bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
        int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
+       int ConfValueInteger(char* tag, char* var, int index, std::stringstream *config);
        int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result);
        int ConfValueEnum(char* tag,std::stringstream *config);
        int EnumConf(std::stringstream *config_f,const char* tag);
@@ -286,11 +356,13 @@ class ServerConfig : public classbase
 
 void Exit (int); 
 void Start (void); 
+void SetSignals();
 int DaemonSeed (void); 
 bool FileExists (const char* file);
 int OpenTCPSocket (void); 
 int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr);
 void WritePID(std::string filename);
 int BindPorts();
+char* CleanFilename(char* name);
 
 #endif