Check in polyglot-1.4w10UCIb15
[polyglot.git] / pipe.h
1 #ifndef PIPE_H
2 #define PIPE_H
3 #ifdef _WIN32
4 // includes
5
6 #include <windows.h>
7
8
9 // constants
10
11 const int LINE_INPUT_MAX_CHAR = 4096;
12
13 // types
14
15 struct PipeStruct {
16   HANDLE hInput, hOutput;
17     HANDLE hProcess;
18   BOOL bConsole;
19   int nBytesLeft;
20   int nReadEnd;
21   char szBuffer[LINE_INPUT_MAX_CHAR];
22
23   void Open(const char *szExecFile = NULL);
24   void Close(void) const;
25   void ReadInput(void);
26   bool CheckInput(void);
27   bool GetBuffer(char *szLineStr);
28   bool LineInput(char *szLineStr);
29   void LineOutput(const char *szLineStr) const;
30 }; // pipe
31
32 #endif
33 #endif