diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-07-16 23:10:15 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-07-17 00:19:55 -0300 |
commit | ac2bd0256183fe4255e5fcccf37f860f037d43a6 (patch) | |
tree | 09bcdf6eefd9b18a58159f06a20b97c938d4f367 /src/nvim/os/shell.c | |
parent | 991d3ec1e679bb6407f2a5820910d2968424183c (diff) | |
download | rneovim-ac2bd0256183fe4255e5fcccf37f860f037d43a6.tar.gz rneovim-ac2bd0256183fe4255e5fcccf37f860f037d43a6.tar.bz2 rneovim-ac2bd0256183fe4255e5fcccf37f860f037d43a6.zip |
rstream/wstream: Unify structures and simplify API
- Simplify RStream/WStream API and make it more consistent with libuv.
- Move into the event loop layer(event subdirectory)
- Remove uv_helpers module.
- Simplify job/process internal modules/API.
- Unify RStream and WStream into a single structure. This is necessary because
libuv streams can be readable and writable at the same time(and because the
uv_helpers.c hack to associate multiple streams with libuv handle was removed)
- Make struct definition public, allowing more flexible/simple memory
management by users of the module.
- Adapt channel/job modules to cope with the changes.
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r-- | src/nvim/os/shell.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 9c0d5fca67..04ac9f1c03 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -10,7 +10,7 @@ #include "nvim/log.h" #include "nvim/event/loop.h" #include "nvim/os/job.h" -#include "nvim/os/rstream.h" +#include "nvim/event/rstream.h" #include "nvim/os/shell.h" #include "nvim/os/signal.h" #include "nvim/types.h" @@ -189,7 +189,7 @@ static int do_os_system(char **argv, { // the output buffer DynamicBuffer buf = DYNAMIC_BUFFER_INIT; - rstream_cb data_cb = system_data_cb; + stream_read_cb data_cb = system_data_cb; if (nread) { *nread = 0; } @@ -283,7 +283,7 @@ static void dynamic_buffer_ensure(DynamicBuffer *buf, size_t desired) buf->data = xrealloc(buf->data, buf->cap); } -static void system_data_cb(RStream *rstream, RBuffer *buf, void *data, bool eof) +static void system_data_cb(Stream *stream, RBuffer *buf, void *data, bool eof) { Job *job = data; DynamicBuffer *dbuf = job_data(job); @@ -294,7 +294,7 @@ static void system_data_cb(RStream *rstream, RBuffer *buf, void *data, bool eof) dbuf->len += nread; } -static void out_data_cb(RStream *rstream, RBuffer *buf, void *data, bool eof) +static void out_data_cb(Stream *stream, RBuffer *buf, void *data, bool eof) { RBUFFER_UNTIL_EMPTY(buf, ptr, len) { size_t written = write_output(ptr, len, false, @@ -470,7 +470,7 @@ static size_t write_output(char *output, size_t remaining, bool to_buffer, return (size_t)(output - start); } -static void shell_write_cb(WStream *wstream, void *data, int status) +static void shell_write_cb(Stream *stream, void *data, int status) { Job *job = data; job_close_in(job); |