Add forgotten files 1.4.70b
[polyglot.git] / pipe.h
diff --git a/pipe.h b/pipe.h
index a8b086b..d24ed8c 100644 (file)
--- a/pipe.h
+++ b/pipe.h
@@ -10,7 +10,9 @@
 
 // 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,13 +21,23 @@ const int LINE_INPUT_MAX_CHAR = 10*4096;
 
 // 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;
 
@@ -37,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;
 
 };