--- pgAgent-NG/pgAgent.h	2013-09-11 13:21:51.851711496 +0200
+++ pgagent/include/pgAgent.h	2013-09-11 12:02:08.412191487 +0200
@@ -13,29 +13,26 @@
 #ifndef PGAGENT_H
 #define PGAGENT_H
 
-#include <fstream>
-#include <iostream>
-#include <stdlib.h>
-#include <sstream>
-#include <thread>
-#include <atomic>
-#include <mutex>
-#include <set>
-#include <algorithm>
-#include <functional>
-#include <cctype>
-#include <locale>
+// Disable all the GUI classes that might get pulled in through the headers
+#define wxUSE_GUI 0
+
+#include <wx/wx.h>
+
+#include "misc.h"
+#include "connection.h"
+#include "job.h"
 
 extern long longWait;
 extern long shortWait;
 extern long minLogLevel;
+extern wxString connectString;
+extern wxString serviceDBname;
+extern wxString backendPid;
 
-#define PGAGENT_VERSION_MAJOR "3"
-
-//#ifndef __WXMSW__
+#ifndef __WXMSW__
 extern bool runInForeground;
-extern std::string logFile;
-//#endif
+extern wxString logFile;
+#endif
 
 // Log levels
 enum
@@ -51,41 +48,14 @@
 };
 
 // Prototypes
-class connInfo;
-void LogMessage(std::string msg, int level);
-std::string CreateTempFileName(std::string prefix);
-int Mkdir(std::string dirname, mode_t rights);
-int RemoveFile(std::string filename);
-int Rmdir(std::string dirname);
-int Chmod(std::string dirname, mode_t rights);
-void MainLoop(connInfo *serviceConnInfo);
+void LogMessage(wxString msg, int level);
+void MainLoop();
 
 #ifdef __WIN32__
 #include <windows.h>
 void CheckForInterrupt();
-HANDLE win32_popen_r(const TCHAR *command);
+HANDLE win32_popen_r(const TCHAR *command, HANDLE &handle);
 #endif
 
-// trim from start
-inline std::string &ltrim(std::string &s) {
-        s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
-        return s;
-}
-
-// trim from end
-inline std::string &rtrim(std::string &s) {
-        s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
-        return s;
-}
-
-// trim from both ends
-inline std::string &trim(std::string &s) {
-        return ltrim(rtrim(s));
-}
-
-#include "misc.h"
-#include "connection.h"
-#include "job.h"
-
 #endif // PGAGENT_H
 
