X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=pipex.h;h=ddc5d1502bacbd5ac045e40c04b376930c95fb63;hp=e1a36186bf409b79c85b7dd2a1bc4f23cedfc572;hb=HEAD;hpb=a0f731f21d6aa26dbf7246039a1c66c2ade0533f diff --git a/pipex.h b/pipex.h index e1a3618..ddc5d15 100644 --- a/pipex.h +++ b/pipex.h @@ -39,6 +39,8 @@ typedef struct { char szWriteBuffer[LINE_INPUT_MAX_CHAR]; DWORD dwWriteIndex; const char *name; + const char *command; + BOOL quit_pending; } pipex_t; @@ -68,29 +70,38 @@ typedef struct { io_t io[1]; pid_t pid; int state; + bool quit_pending; + const char *command; } pipex_t; #endif // part common to WIN32 and POSIX +// macros + +#define PIPEX_MAGIC "!@#$%" +#define WAIT_GRANULARITY 100 + // functions -extern void pipex_open (pipex_t *pipex, - const char *name, - const char *working_dir, - const char *command); -extern bool pipex_active (pipex_t *pipex); -extern bool pipex_readln (pipex_t *pipex, char *string); -extern bool pipex_readln_nb (pipex_t *pipex, char *string); -extern void pipex_writeln (pipex_t *pipex, const char *string); -extern void pipex_write (pipex_t *pipex, const char *string); -extern bool pipex_eof (pipex_t *pipex); -extern void pipex_send_eof (pipex_t *pipex); -extern void pipex_exit (pipex_t *pipex); -extern void pipex_set_priority (pipex_t *pipex, int value); -extern void pipex_set_affinity (pipex_t *pipex, int value); -extern void pipex_wait_event (pipex_t *pipex[]); +extern void pipex_open (pipex_t *pipex, + const char *name, + const char *working_dir, + const char *command); +extern bool pipex_active (pipex_t *pipex); +extern bool pipex_readln (pipex_t *pipex, char *string); +extern bool pipex_readln_nb (pipex_t *pipex, char *string); +extern void pipex_writeln (pipex_t *pipex, const char *string); +extern void pipex_write (pipex_t *pipex, const char *string); +extern char* pipex_get_buffer (pipex_t *pipex); +extern bool pipex_eof (pipex_t *pipex); +extern void pipex_send_eof (pipex_t *pipex); +extern void pipex_exit (pipex_t *pipex, int kill_timeout); +extern void pipex_set_priority (pipex_t *pipex, int value); +extern void pipex_set_affinity (pipex_t *pipex, int value); +extern void pipex_wait_event (pipex_t *pipex[]); + // pipex