X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=pipe.h;h=d24ed8ca7386b0e55ec6c14a03dd2a6a010df457;hp=ad01c185c1fcd8c88b84c3866e7e33f3fea10174;hb=92a5061fe11dab6ef0bb339cbe7798e6ccb35626;hpb=07265afaa167049a447b4c5f43e5ef90c7451a49 diff --git a/pipe.h b/pipe.h index ad01c18..d24ed8c 100644 --- a/pipe.h +++ b/pipe.h @@ -21,13 +21,23 @@ const int LINE_INPUT_MAX_CHAR = 40960; // types -struct PipeStruct { - +class PipeStruct { + friend DWORD WINAPI ThreadProc(LPVOID lpParam); + public: + HANDLE hProcess; + HANDLE hEvent; + bool GetBuffer(char *szLineStr); + void LineInput(char *szLineStr); + void LineOutput(const char *szLineStr) const; + void Open(const char *szExecFile = NULL); + void Close(void) const; + void Kill(void) const; + bool Active(void); + bool EOF_(void); + private: HANDLE hInput, hOutput; FILE *fpInput; - HANDLE hProcess; HANDLE hThread; - HANDLE hEvent; BOOL bConsole; BOOL bPipe; @@ -39,18 +49,11 @@ struct PipeStruct { char lpBuffer[LINE_INPUT_MAX_CHAR]; char lpReadBuffer[LINE_INPUT_MAX_CHAR]; - void Open(const char *szExecFile = NULL); - void Close(void) const; - void Kill(void) const; - bool EOF_(void); - void set_EOF_(void); - bool Active(void); + bool EOF_input(void); + void set_EOF_input(void); void set_Active(void); void ReadInput(void); int ReadData(void); - bool GetBuffer(char *szLineStr); - void LineInput(char *szLineStr); - void LineOutput(const char *szLineStr) const; };