aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/shell.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-05-30 12:59:02 +0200
committerbfredl <bjorn.linse@gmail.com>2024-05-31 15:01:13 +0200
commitc13c50b752dca322a5ec77dea6188c9e3694549b (patch)
tree048342b08d13f6df0b9c29b9b0b5d470322e6a0c /src/nvim/os/shell.c
parent6566a59b3a6c8dabfa40f8debd0de96d875825e9 (diff)
downloadrneovim-c13c50b752dca322a5ec77dea6188c9e3694549b.tar.gz
rneovim-c13c50b752dca322a5ec77dea6188c9e3694549b.tar.bz2
rneovim-c13c50b752dca322a5ec77dea6188c9e3694549b.zip
refactor(io): separate types for read and write streams
This is a structural refactor with no logical changes, yet. Done in preparation for simplifying rstream/rbuffer which will require more state inline in RStream. The initial idea was to have RStream and WStream as sub-types symetrically but that doesn't work, as sockets are both reading and writing. Also there is very little write-specific state to start with, so the benefit of a separate WStream struct is a lot smaller. Just document what fields in `Stream` are write specific.
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r--src/nvim/os/shell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 2a10510b0f..958faa4d22 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -987,7 +987,7 @@ static void dynamic_buffer_ensure(DynamicBuffer *buf, size_t desired)
buf->data = xrealloc(buf->data, buf->cap);
}
-static void system_data_cb(Stream *stream, RBuffer *buf, size_t count, void *data, bool eof)
+static void system_data_cb(RStream *stream, RBuffer *buf, size_t count, void *data, bool eof)
{
DynamicBuffer *dbuf = data;
@@ -1151,7 +1151,7 @@ end:
ui_flush();
}
-static void out_data_cb(Stream *stream, RBuffer *buf, size_t count, void *data, bool eof)
+static void out_data_cb(RStream *stream, RBuffer *buf, size_t count, void *data, bool eof)
{
size_t cnt;
char *ptr = rbuffer_read_ptr(buf, &cnt);
@@ -1331,7 +1331,7 @@ static void shell_write_cb(Stream *stream, void *data, int status)
msg_schedule_semsg(_("E5677: Error writing input to shell-command: %s"),
uv_err_name(status));
}
- stream_close(stream, NULL, NULL);
+ stream_close(stream, NULL, NULL, false);
}
/// Applies 'shellxescape' (p_sxe) and 'shellxquote' (p_sxq) to a command.