diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-11-06 13:19:26 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-11-09 11:05:19 +0000 |
commit | d714547ab361962ca6f76ec07736f1515595b2df (patch) | |
tree | 6c1b88fca00962343b82d735ef584a38edb9cd58 /daemon/daemon.h | |
parent | 49e85f8cda664819d0f73c476f1596d1ecc128c8 (diff) | |
download | libguestfs-d714547ab361962ca6f76ec07736f1515595b2df.tar.gz libguestfs-d714547ab361962ca6f76ec07736f1515595b2df.tar.xz libguestfs-d714547ab361962ca6f76ec07736f1515595b2df.zip |
daemon: Add flags argument to command*() functions.
This adds new variations of the command*() functions which
take a 'flags' argument. Currently the only flag available
is defined as follows:
COMMAND_FLAG_FOLD_STDOUT_ON_STDERR: For broken external commands
that send error messages to stdout (hello, parted) but that don't
have any useful stdout information, use this flag to capture the
error messages in the *stderror buffer. If using this flag,
you should pass stdoutput as NULL because nothing could ever be
captured in that buffer.
This patch also adds some documentation for command*()
function.
Diffstat (limited to 'daemon/daemon.h')
-rw-r--r-- | daemon/daemon.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h index 86c68769..f0826904 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -47,12 +47,21 @@ extern void sort_strings (char **argv, int len); extern void free_strings (char **argv); extern void free_stringslen (char **argv, int len); -extern int command (char **stdoutput, char **stderror, const char *name, ...); -extern int commandr (char **stdoutput, char **stderror, const char *name, ...); -extern int commandv (char **stdoutput, char **stderror, - char *const *argv); -extern int commandrv (char **stdoutput, char **stderror, - char const* const *argv); +#define command(out,err,name,...) commandf((out),(err),0,(name),__VA_ARGS__) +#define commandr(out,err,name,...) commandrf((out),(err),0,(name),__VA_ARGS__) +#define commandv(out,err,argv) commandvf((out),(err),0,(argv)) +#define commandrv(out,err,argv) commandrvf((out),(err),0,(argv)) + +#define COMMAND_FLAG_FOLD_STDOUT_ON_STDERR 1 + +extern int commandf (char **stdoutput, char **stderror, int flags, + const char *name, ...); +extern int commandrf (char **stdoutput, char **stderror, int flags, + const char *name, ...); +extern int commandvf (char **stdoutput, char **stderror, int flags, + char *const *argv); +extern int commandrvf (char **stdoutput, char **stderror, int flags, + char const* const *argv); extern char **split_lines (char *str); |