From bf558fd824c7ab8c794448f718b364ad403a706a Mon Sep 17 00:00:00 2001 From: horchi Date: Sun, 5 Mar 2017 16:48:30 +0100 Subject: git init --- talk.h | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 talk.h (limited to 'talk.h') diff --git a/talk.h b/talk.h new file mode 100644 index 0000000..94cb1db --- /dev/null +++ b/talk.h @@ -0,0 +1,97 @@ +//*************************************************************************** +/* + * fskcheck.c: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: talk.h,v 1.1 2007/01/13 07:52:27 root Exp $ + */ +//*************************************************************************** + +//*************************************************************************** +// Includes +//*************************************************************************** + +#include "def.h" + +//*************************************************************************** +// Class Talk +//*************************************************************************** + +class Talk +{ + public: + + // declarations + + enum Error + { + errMessageServiceFirst = -1000, + + errMessageToBig, + + wrnSysInterrupt, + wrnNoMessage + }; + + enum Size + { + sizeBuffer = 1000 + }; + + enum Event + { + evtUnknown = na, + + evtCheck, // = 0 + evtShow, // = 1 + evtAsk, // = 2 + evtConfirm, // = 3 + evtAbort, // = 4 + evtAnswer, // = 5 + evtExit // = 6 + }; + + struct Header + { + long sender; + long receiver; + int event; + int type; // eMessageType + }; + + // object + + Talk(); + ~Talk(); + + // functions + + int wait(); + int init(); + int send(long to, int event, const char* msg = 0); + int open(long port); + + int isOpen() { return opened; } + long getTimeout() { return timeout; } + int getEvent() { return event; } + long getFrom() { return from; } + const char* getMessage() { return message; } + + void setTimeout(long t) { timeout = t; } + + protected: + + // data + + int receiverID; + int msgID; + char buffer[sizeBuffer]; + char* message; + Header* header; + long timeout; + int opened; + + int event; + long from; +}; -- cgit v1.2.3