diff options
Diffstat (limited to 'runcap.h')
-rw-r--r-- | runcap.h | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -31,6 +31,7 @@ struct stream_capture void (*sc_linemon)(const char *, size_t, void *); /* Line monitor function */ void *sc_monarg; /* Line monitor argument */ + int sc_nocap; /* If 1, capturing is disabled */ }; #define STRCAP_BUFSIZE 4096 @@ -57,13 +58,12 @@ struct runcap #define RCF_PROGRAM 0x0001 /* rc_program is set */ #define RCF_TIMEOUT 0x0002 /* rc_timeout is set */ #define RCF_STDIN 0x0004 /* rc_cap[RUNCAP_STDIN] is set */ -#define RCF_STDOUT_SIZE 0x0008 -#define RCF_STDOUT_LINEMON 0x0010 -#define RCF_STDERR_SIZE 0x0020 -#define RCF_STDERR_LINEMON 0x0040 - -int stream_capture_init(struct stream_capture *fc, size_t size); -void stream_capture_free(struct stream_capture *fc); +#define RCF_STDOUT_SIZE 0x0008 /* rc_cap[RUNCAP_STDOUT].sc_size is set */ +#define RCF_STDOUT_LINEMON 0x0010 /* rc_cap[RUNCAP_STDOUT].sc_linemon is set */ +#define RCF_STDERR_SIZE 0x0020 /* rc_cap[RUNCAP_STDERR].sc_size is set */ +#define RCF_STDERR_LINEMON 0x0040 /* rc_cap[RUNCAP_STDERR].sc_linemon is set */ +#define RCF_STDOUT_NOCAP 0x0080 /* disable stdout capturing */ +#define RCF_STDERR_NOCAP 0x0100 /* disable stderr capturing */ int runcap(struct runcap *rc, int flags); void runcap_free(struct runcap *rc); @@ -80,7 +80,7 @@ runcap_get_capture(struct runcap *rc, int stream) fp = &rc->rc_cap[stream]; - if (!fp->sc_base || fp->sc_size == 0) { + if (!fp->sc_base || fp->sc_size == 0 || fp->sc_nocap) { errno = EINVAL; return NULL; } |