summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Action.h3
-rw-r--r--include/Buffer.h2
-rw-r--r--include/Confirm.h2
-rw-r--r--include/CopyJob.h4
-rw-r--r--include/Form.h2
-rw-r--r--include/HttpServ.h4
-rw-r--r--include/Menu.h2
-rw-r--r--include/Message.h2
-rw-r--r--include/Socket.h2
-rw-r--r--include/Table.h2
-rw-r--r--include/Task.h10
11 files changed, 23 insertions, 12 deletions
diff --git a/include/Action.h b/include/Action.h
index 185cd1a..bf3dc1a 100644
--- a/include/Action.h
+++ b/include/Action.h
@@ -2,6 +2,7 @@
#define __ACTION_H__
#ifdef __cplusplus
+#include <Task.h>
#include <Handle.h>
#include <Variables.h>
#include <Exceptions.h>
@@ -35,7 +36,7 @@ class Action : public Base {
Action(const String & = "");
virtual ~Action();
Action * Look4URL(const String &);
- virtual void Do(Variables *, Handle *) = 0;
+ virtual Task * Do(Variables *, Handle *) = 0;
virtual void SendHead(Handle *);
virtual void SendFoot(Handle *);
virtual void ShowButton(Handle *, const String & = " Ok ", const String & = "start");
diff --git a/include/Buffer.h b/include/Buffer.h
index cf57cb6..8b1c131 100644
--- a/include/Buffer.h
+++ b/include/Buffer.h
@@ -14,7 +14,7 @@ class Buffer : public Handle {
Buffer();
~Buffer();
virtual ssize_t write(const void *buf, size_t count);
- virtual ssize_t read(void *buf, size_t count);
+ virtual ssize_t read(void *buf, size_t count) throw (GeneralException);
virtual bool CanRead();
virtual bool CanWrite();
virtual String GetName();
diff --git a/include/Confirm.h b/include/Confirm.h
index efd0606..d327f23 100644
--- a/include/Confirm.h
+++ b/include/Confirm.h
@@ -21,7 +21,7 @@ class Confirm : public Action {
Confirm(const String & titre, const String & msg, const String & url, Action * yes, Action * no = 0);
virtual ~Confirm() { }
virtual String GetTitle();
- virtual void Do(Variables *, Handle *);
+ virtual Task * Do(Variables *, Handle *);
private:
String tit, msg;
Action * NYes, * NNo;
diff --git a/include/CopyJob.h b/include/CopyJob.h
index 67cbf36..c4cda81 100644
--- a/include/CopyJob.h
+++ b/include/CopyJob.h
@@ -9,14 +9,16 @@
class CopyJob : public Task {
public:
- CopyJob(Handle *, Handle *, ssize_t = -1);
+ CopyJob(Handle *, Handle *, ssize_t = -1, bool = false);
virtual ~CopyJob();
virtual int Do() throw (GeneralException);
virtual String GetName();
private:
Handle * s, * d;
+ bool ds;
ssize_t siz, cursiz;
char buffer[COPY_BUFSIZ];
+ int r;
};
#else
diff --git a/include/Form.h b/include/Form.h
index 50b7e3c..1b22742 100644
--- a/include/Form.h
+++ b/include/Form.h
@@ -29,7 +29,7 @@ class Form : public Action {
int nb, Action * ok = 0);
virtual ~Form() { }
virtual String GetTitle();
- virtual void Do(Variables *, Handle *);
+ virtual Task * Do(Variables *, Handle *);
private:
String tit, iv, * nms, * ivs, * defs, ** lsts, ** dscs;
int n;
diff --git a/include/HttpServ.h b/include/HttpServ.h
index 18295bc..51511b2 100644
--- a/include/HttpServ.h
+++ b/include/HttpServ.h
@@ -19,7 +19,7 @@
class HttpServ : public Task {
public:
- HttpServ(int = 1500, const String & = String("GruiK Server v0.1")) throw (GeneralException);
+ HttpServ(Action *, int = 1500, const String & = String("GruiK Server v0.1")) throw (GeneralException);
~HttpServ() {}
void SetMenu(Action *);
virtual String GetName();
@@ -27,6 +27,8 @@ class HttpServ : public Task {
virtual int Do();
private:
Socket Listener;
+ Action * p;
+ String name;
int localport;
};
diff --git a/include/Menu.h b/include/Menu.h
index 4167656..e656657 100644
--- a/include/Menu.h
+++ b/include/Menu.h
@@ -21,7 +21,7 @@ class Menu : public Action {
Menu(const String & titre, const String & url, String * labels, Action ** listac, int nb);
virtual ~Menu() {}
virtual String GetTitle();
- virtual void Do(Variables *, Handle *);
+ virtual Task * Do(Variables *, Handle *);
private:
String tit;
String * lt;
diff --git a/include/Message.h b/include/Message.h
index 96b9aa4..77bd62c 100644
--- a/include/Message.h
+++ b/include/Message.h
@@ -20,7 +20,7 @@ class Message : public Action {
Message(const String & titre, const String & msg, const String & url, Action * ok = 0);
virtual ~Message() { }
virtual String GetTitle();
- virtual void Do(Variables *, Handle *);
+ virtual Task * Do(Variables *, Handle *);
private:
String tit, msg;
Action * Next;
diff --git a/include/Socket.h b/include/Socket.h
index 6bd612c..514db43 100644
--- a/include/Socket.h
+++ b/include/Socket.h
@@ -39,8 +39,6 @@ class Socket : public Handle {
Socket Accept() throw (GeneralException);
bool IsConnected();
bool IsListening();
- size_t WriteFile(Output &);
- size_t ReadFile(Input &);
virtual bool CanRead();
virtual bool CanWrite();
virtual String GetName();
diff --git a/include/Table.h b/include/Table.h
index 64cf249..f1ec6c6 100644
--- a/include/Table.h
+++ b/include/Table.h
@@ -23,7 +23,7 @@ class Table : public Action {
Table(const String & titre, const String & url, String * heads, String * cells, int nbcol, int nblgn, Action * ok = 0);
virtual ~Table() { }
virtual String GetTitle();
- virtual void Do(Variables *, Handle *);
+ virtual Task * Do(Variables *, Handle *);
private:
String tit, * hds, * cls;
int nc, nl;
diff --git a/include/Task.h b/include/Task.h
index 1842314..503e0df 100644
--- a/include/Task.h
+++ b/include/Task.h
@@ -10,6 +10,7 @@
#define TASK_ON_HOLD 0
#define TASK_DONE 1
+#define TASK_BURST 2
class Task : public Base {
public:
@@ -23,13 +24,20 @@ class Task : public Base {
void WaitFor(Task *);
void WaitFor(pid_t);
void WaitFor(struct timeval);
+ void SetBurst();
+ void SetCleanUp();
+ bool HasToClean();
+ void Stop();
+ void Restart();
+ bool IsStopped();
protected:
virtual int Do() throw (GeneralException);
-
int current;
private:
int state;
+ bool stopped;
+ bool cleanup;
bool suspended;
vector<Handle *> w4ha;
vector<Task *> w4ta;