]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Merge pull request #1084 from SaberUK/insp20+fix-parallel-debug-install
[user/henk/code/inspircd.git] / include / inspircd.h
index 78e0c1b3eccede838f4966369d3586ba0a8cadf9..e2eaf82927171fd7b8cec3bb9bc23cb3987caa7b 100644 (file)
 #define _LARGEFILE_SOURCE
 #endif
 
-#ifndef WIN32
+#ifndef _WIN32
 #define DllExport
 #define CoreExport
-#define printf_c printf
 #else
 #include "inspircd_win32wrapper.h"
 /** Windows defines these already */
@@ -48,6 +47,7 @@
 #endif
 
 // Required system headers.
+#include <csignal>
 #include <ctime>
 #include <cstdarg>
 #include <algorithm>
@@ -55,7 +55,7 @@
 #include <cstring>
 #include <climits>
 #include <cstdio>
-#ifndef WIN32
+#ifndef _WIN32
 #include <unistd.h>
 #endif
 
@@ -71,6 +71,7 @@
 #include "inspircd_config.h"
 #include "inspircd_version.h"
 #include "typedefs.h"
+#include "consolecolors.h"
 
 CoreExport extern InspIRCd* ServerInstance;
 
@@ -169,7 +170,7 @@ inline std::string ConvToStr(const bool in)
  */
 inline std::string ConvToStr(char in)
 {
-       return std::string(in,1);
+       return std::string(1, in);
 }
 
 /** Template function to convert any input type to std::string
@@ -232,12 +233,24 @@ class serverstats
        /** Total bytes of data received
         */
        unsigned long statsRecv;
+#ifdef _WIN32
+       /** Cpu usage at last sample
+       */
+       FILETIME LastCPU;
+       /** Time QP sample was read
+       */
+       LARGE_INTEGER LastSampled;
+       /** QP frequency
+       */
+       LARGE_INTEGER QPFrequency;
+#else
        /** Cpu usage at last sample
         */
        timeval LastCPU;
        /** Time last sample was read
         */
        timespec LastSampled;
+#endif
        /** The constructor initializes all the counts to zero
         */
        serverstats()
@@ -308,10 +321,6 @@ class CoreExport InspIRCd
         */
        char ReadBuffer[65535];
 
-#ifdef WIN32
-       IPC* WindowsIPC;
-#endif
-
  public:
 
        /** Global cull list, will be processed on next iteration
@@ -446,7 +455,7 @@ class CoreExport InspIRCd
 
        /** Set to the current signal recieved
         */
-       int s_signal;
+       static sig_atomic_t s_signal;
 
        /** Protocol interface, overridden by server protocol modules
         */
@@ -698,6 +707,16 @@ class CoreExport InspIRCd
         */
        bool IsValidMask(const std::string &mask);
 
+       /** Strips all color codes from the given string
+        * @param sentence The string to strip from
+        */
+       static void StripColor(std::string &sentence);
+
+       /** Parses color codes from string values to actual color codes
+        * @param input The data to process
+        */
+       static void ProcessColors(file_cache& input);
+
        /** Rehash the local server
         */
        void RehashServer();
@@ -790,10 +809,6 @@ class CoreExport InspIRCd
         */
        void SendWhoisLine(User* user, User* dest, int numeric, const char* format, ...) CUSTOM_PRINTF(5, 6);
 
-       /** Handle /STATS
-        */
-       void DoStats(char statschar, User* user, string_list &results);
-
        /** Handle /WHOIS
         */
        void DoWhois(User* user, User* dest,unsigned long signon, unsigned long idle, const char* nick);