X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=pipe.h;h=ad01c185c1fcd8c88b84c3866e7e33f3fea10174;hb=07265afaa167049a447b4c5f43e5ef90c7451a49;hp=eecfb1ccd7e87850e04d3977babdac4672bf2746;hpb=5cd5185613348b13625e257efcd7b2f11ca85276;p=polyglot.git diff --git a/pipe.h b/pipe.h index eecfb1c..ad01c18 100644 --- a/pipe.h +++ b/pipe.h @@ -4,10 +4,15 @@ // includes #include +#include +#include +#include // constants -const int LINE_INPUT_MAX_CHAR = 10*4096; +// This should be bigger than the maximum length of an engine output or GUI +// input line. +const int LINE_INPUT_MAX_CHAR = 40960; // defines @@ -19,6 +24,7 @@ const int LINE_INPUT_MAX_CHAR = 10*4096; struct PipeStruct { HANDLE hInput, hOutput; + FILE *fpInput; HANDLE hProcess; HANDLE hThread; HANDLE hEvent; @@ -28,6 +34,7 @@ struct PipeStruct { CRITICAL_SECTION CriticalSection; volatile DWORD state; + volatile char * lpFeedEnd; volatile int nReadEnd; char lpBuffer[LINE_INPUT_MAX_CHAR]; char lpReadBuffer[LINE_INPUT_MAX_CHAR]; @@ -40,8 +47,7 @@ struct PipeStruct { bool Active(void); void set_Active(void); void ReadInput(void); - int ReadLine(void); - bool CheckInput(void); + int ReadData(void); bool GetBuffer(char *szLineStr); void LineInput(char *szLineStr); void LineOutput(const char *szLineStr) const;