From 217126c9872dc5a6e867603ad618bb85ceaa3c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 3 Apr 2016 15:13:43 +0200 Subject: vis: change vis_pipe API and cleanup related code --- vis.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index c5f0908..3701228 100644 --- a/vis.c +++ b/vis.c @@ -1118,9 +1118,9 @@ Regex *vis_regex(Vis *vis, const char *pattern) { return regex; } -int vis_pipe(Vis *vis, void *context, Filerange *range, const char *argv[], - ssize_t (*read_stdout)(void *context, char *data, size_t len), - ssize_t (*read_stderr)(void *context, char *data, size_t len)) { +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)) { /* if an invalid range was given, stdin (i.e. key board input) is passed * through the external command. */ @@ -1239,7 +1239,7 @@ int vis_pipe(Vis *vis, void *context, Filerange *range, const char *argv[], ssize_t len = read(pout[0], buf, sizeof buf); if (len > 0) { if (read_stdout) - (*read_stdout)(context, buf, len); + (*read_stdout)(stdout_context, buf, len); } else if (len == 0) { close(pout[0]); pout[0] = -1; @@ -1255,7 +1255,7 @@ int vis_pipe(Vis *vis, void *context, Filerange *range, const char *argv[], ssize_t len = read(perr[0], buf, sizeof buf); if (len > 0) { if (read_stderr) - (*read_stderr)(context, buf, len); + (*read_stderr)(stderr_context, buf, len); } else if (len == 0) { close(perr[0]); perr[0] = -1; -- cgit v1.2.3