summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/HttpServ.h2
-rw-r--r--include/Input.h11
-rw-r--r--include/Makefile.am4
-rw-r--r--include/Output.h21
-rw-r--r--include/String.h4
-rw-r--r--include/Task.h3
-rw-r--r--include/TaskMan.h13
7 files changed, 45 insertions, 13 deletions
diff --git a/include/HttpServ.h b/include/HttpServ.h
index 5074639..7ac40e2 100644
--- a/include/HttpServ.h
+++ b/include/HttpServ.h
@@ -18,7 +18,7 @@
class HttpServ : public Base {
public:
- HttpServ(int = 1500, const String & = String("GruiK Server v0.1"));
+ HttpServ(int = 1500, const String & = String("GruiK Server v0.1")) throw (GeneralException);
~HttpServ() {}
void MainLoop(Action *);
private:
diff --git a/include/Input.h b/include/Input.h
index f9a3df5..682cee1 100644
--- a/include/Input.h
+++ b/include/Input.h
@@ -20,6 +20,17 @@ class Input : public Handle {
String n;
};
+class Stdin_t : public Handle {
+ public:
+ Stdin_t();
+ virtual ~Stdin_t() {}
+ virtual bool CanWrite();
+ virtual bool CanRead();
+ virtual String GetName();
+};
+
+extern Stdin_t Stdin;
+
#else
#error This only works with a C++ compiler
#endif
diff --git a/include/Makefile.am b/include/Makefile.am
index ac1f63c..bc93b8d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,5 +1,5 @@
-includedir = $(prefix)/include/@PACKAGE@
-include_HEADERS = \
+#includedir = $(prefix)/include/@PACKAGE@
+pkginclude_HEADERS = \
Exceptions.h Handle.h String.h Output.h Socket.h HttpServ.h Variables.h Menu.h \
Action.h Message.h Form.h Confirm.h Table.h IRC.h Task.h Buffer.h General.h \
CopyJob.h ReadJob.h Regex.h TaskMan.h
diff --git a/include/Output.h b/include/Output.h
index ef76012..4e1e092 100644
--- a/include/Output.h
+++ b/include/Output.h
@@ -20,6 +20,27 @@ class Output : public Handle {
String n;
};
+class Stdout_t : public Handle {
+ public:
+ Stdout_t();
+ virtual ~Stdout_t() {}
+ virtual bool CanWrite();
+ virtual bool CanRead();
+ virtual String GetName();
+};
+
+class Stderr_t : public Handle {
+ public:
+ Stderr_t();
+ virtual ~Stderr_t() {}
+ virtual bool CanWrite();
+ virtual bool CanRead();
+ virtual String GetName();
+};
+
+extern Stdout_t Stdout;
+extern Stderr_t Stderr;
+
#else
#error This only works with a C++ compiler
#endif
diff --git a/include/String.h b/include/String.h
index c6afdb2..ddb0cde 100644
--- a/include/String.h
+++ b/include/String.h
@@ -47,8 +47,8 @@ class String : public Base {
String(int);
String(double);
~String();
- char * set(char *, ...);
- char * to_charp(size_t = 0, ssize_t = -1) const;
+ const char * set(char *, ...);
+ const char * to_charp(size_t = 0, ssize_t = -1) const;
String extract(size_t = 0, ssize_t = -1) const;
char * strdup(size_t = 0, ssize_t = -1) const;
int to_int() const;
diff --git a/include/Task.h b/include/Task.h
index 675b2ed..f2d4b0b 100644
--- a/include/Task.h
+++ b/include/Task.h
@@ -3,6 +3,7 @@
#ifdef __cplusplus
#include <unistd.h>
+#include <sys/time.h>
#include <vector.h>
#include <Exceptions.h>
#include <Handle.h>
@@ -31,7 +32,7 @@ class Task : public Base {
vector<Handle *> w4ha;
vector<Task *> w4ta;
vector<pid_t> w4pr;
- vector<struct timeval> w4to;
+ vector<timeval> w4to;
};
#else
diff --git a/include/TaskMan.h b/include/TaskMan.h
index dc8c913..16bc0ee 100644
--- a/include/TaskMan.h
+++ b/include/TaskMan.h
@@ -7,14 +7,13 @@
class TaskMan : public Base {
public:
- TaskMan() throw (GeneralException);
- int AddTask(Task *);
- int TaskMan::RemoveTask(Task *);
- void Init() throw (GeneralException);
- void MainLoop() throw (GeneralException);
+ static int AddTask(Task *);
+ static int RemoveTask(Task *);
+ static void Init() throw (GeneralException);
+ static void MainLoop() throw (GeneralException);
private:
- vector<Task *> TaskList;
- int number;
+ static vector<Task *> TaskList;
+ static int number;
static bool inited;
};