X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=pipe.h;h=ced06d7b09b1d46b9a294dd42816fdf518845bfd;hp=b13f5135ce0719656df83d5bfa7fa0d0e4d5b49b;hb=6442b61046f46f65bfc4bf0b3727abe2dc27acb8;hpb=e7a2abd9bd4fce9ebbd70793b00d9d5f99886348 diff --git a/pipe.h b/pipe.h index b13f513..ced06d7 100644 --- a/pipe.h +++ b/pipe.h @@ -5,28 +5,37 @@ #include - // constants const int LINE_INPUT_MAX_CHAR = 4096; +// defines + +#define PIPE_EOF 1 +#define PIPE_ACTIVE 2 + // types struct PipeStruct { - HANDLE hInput, hOutput; + + HANDLE hInput, hOutput; HANDLE hProcess; - BOOL bConsole; - int nBytesLeft; - int nReadEnd; - char szBuffer[LINE_INPUT_MAX_CHAR]; - - void Open(const char *szExecFile = NULL); - void Close(void) const; - void ReadInput(void); - bool CheckInput(void); - bool GetBuffer(char *szLineStr); - bool LineInput(char *szLineStr); - void LineOutput(const char *szLineStr) const; + DWORD state; + BOOL bConsole; + int nBytesLeft; + int nReadEnd; + char szBuffer[LINE_INPUT_MAX_CHAR]; + + void Open(const char *szExecFile = NULL); + void Close(void) const; + void Kill(void) const; + bool EOF_(void); + bool Active(void); + void ReadInput(void); + bool CheckInput(void); + bool GetBuffer(char *szLineStr); + bool LineInput(char *szLineStr); + void LineOutput(const char *szLineStr) const; }; // pipe #endif