]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Unneeded
[user/henk/code/inspircd.git] / include / inspircd.h
index 5f528c16b82b9ec91d09f4219c5799b387f1cd7b..edf8cd854c2d038d3914bc905b6efeb8917b1013 100644 (file)
 #undef ERROR
 #endif
 
+#ifdef __GNUC__
+#define CUSTOM_PRINTF(STRING, FIRST) __attribute__((format(printf, STRING, FIRST)))
+#else
+#define CUSTOM_PRINTF(STRING, FIRST)
+#endif
+
 // Required system headers.
 #include <time.h>
 #include <stdarg.h>
@@ -232,6 +238,23 @@ DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
 class XLineManager;
 class BanCacheManager;
 
+class CoreExport ConfigReaderThread : public Thread
+{
+       InspIRCd* ServerInstance;
+       bool do_bail;
+       User* TheUser;
+ public:
+       ConfigReaderThread(InspIRCd* Instance, bool bail, User* user) : Thread(), ServerInstance(Instance), do_bail(bail), TheUser(user)
+       {
+       }
+
+       virtual ~ConfigReaderThread()
+       {
+       }
+
+       void Run();
+};
+
 /** The main class of the irc server.
  * This class contains instances of all the other classes
  * in this software, with the exception of the base class,
@@ -381,6 +404,14 @@ class CoreExport InspIRCd : public classbase
         */
        SocketEngine* SE;
 
+       /** Thread engine, Handles threading where required
+        */
+       ThreadEngine* Threads;
+
+       /** The thread/class used to read config files in REHASH and on startup
+        */
+       ConfigReaderThread* ConfigThread;
+
        /** LogManager handles logging.
         */
        LogManager *Logs;
@@ -771,7 +802,7 @@ class CoreExport InspIRCd : public classbase
         * @param text Format string of to write to the log
         * @param ... Format arguments of text to write to the log
         */
-       void Log(int level, const char* text, ...);
+       void Log(int level, const char* text, ...) CUSTOM_PRINTF(3, 4);
 
        /** Output a log message to the ircd.log file
         * The text will only be output if the current loglevel
@@ -796,7 +827,7 @@ class CoreExport InspIRCd : public classbase
         * @param format Format string for the numeric
         * @param ... Parameters for the format string
         */
-       void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...);
+       void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
 
        /** Quit a user for excess flood, and if they are not
         * fully registered yet, temporarily zline their IP.