From 826be3072ad3ce475ea39d80e5a6606a896d98c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 17 May 2016 18:06:13 +0200 Subject: vis: introduce vis_pipe_collect utility function --- vis.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vis.h') diff --git a/vis.h b/vis.h index ab7eade..0b819a9 100644 --- a/vis.h +++ b/vis.h @@ -422,6 +422,11 @@ int vis_pipe(Vis *vis, Filerange *range, const char *argv[], void *stdout_context, ssize_t (*read_stdout)(void *stdout_context, char *data, size_t len), void *stderr_context, ssize_t (*read_stderr)(void *stderr_context, char *data, size_t len)); +/* pipe a range to an external application, return its exit status and store + * everything that is written to stdout/stderr in the gitven char pointers + * which have to be free(3)-ed by the caller */ +int vis_pipe_collect(Vis *vis, Filerange *range, const char *argv[], char **out, char **err); + /* given the start of a key, returns a pointer to the start of the one immediately * following as will be processed by the input system. skips over special keys * such as as well as pseudo keys registered via vis_action_register. */ -- cgit v1.2.3