X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pipe.h;h=a8b086bd55783bc2142efc292adeff20a869c6b0;hb=8c255c15cc55a2e5254152c8e07a8ab45b22b7af;hp=ced06d7b09b1d46b9a294dd42816fdf518845bfd;hpb=6442b61046f46f65bfc4bf0b3727abe2dc27acb8;p=polyglot.git diff --git a/pipe.h b/pipe.h index ced06d7..a8b086b 100644 --- a/pipe.h +++ b/pipe.h @@ -4,10 +4,13 @@ // includes #include +#include +#include +#include // constants -const int LINE_INPUT_MAX_CHAR = 4096; +const int LINE_INPUT_MAX_CHAR = 10*4096; // defines @@ -19,24 +22,37 @@ const int LINE_INPUT_MAX_CHAR = 4096; struct PipeStruct { HANDLE hInput, hOutput; + FILE *fpInput; HANDLE hProcess; - DWORD state; + HANDLE hThread; + HANDLE hEvent; BOOL bConsole; - int nBytesLeft; - int nReadEnd; - char szBuffer[LINE_INPUT_MAX_CHAR]; + BOOL bPipe; + + CRITICAL_SECTION CriticalSection; + + volatile DWORD state; + volatile char * lpFeedEnd; + volatile int nReadEnd; + 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); + void set_Active(void); void ReadInput(void); - bool CheckInput(void); + int ReadData(void); bool GetBuffer(char *szLineStr); - bool LineInput(char *szLineStr); + void LineInput(char *szLineStr); void LineOutput(const char *szLineStr) const; -}; // pipe + +}; + +// pipe #endif #endif