version 1.4w10UCIb24
[polyglot.git] / pipe.h
diff --git a/pipe.h b/pipe.h
index eecfb1c..ad01c18 100644 (file)
--- a/pipe.h
+++ b/pipe.h
@@ -4,10 +4,15 @@
 // includes
 
 #include <windows.h>
+#include <io.h>
+#include <fcntl.h>
+#include <stdio.h>
 
 // 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;