From ac2bd0256183fe4255e5fcccf37f860f037d43a6 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 16 Jul 2015 23:10:15 -0300 Subject: 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. --- src/nvim/os/pty_process.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/os/pty_process.h') diff --git a/src/nvim/os/pty_process.h b/src/nvim/os/pty_process.h index 62fcd1671f..b5a2eba8b3 100644 --- a/src/nvim/os/pty_process.h +++ b/src/nvim/os/pty_process.h @@ -1,6 +1,16 @@ #ifndef NVIM_OS_PTY_PROCESS_H #define NVIM_OS_PTY_PROCESS_H +#include + +#include + +typedef struct { + struct winsize winsize; + uv_pipe_t proc_stdin, proc_stdout, proc_stderr; + int tty_fd; +} PtyProcess; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "os/pty_process.h.generated.h" #endif -- cgit From aa9cb48bf08af14068178619414590254b263882 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 17 Jul 2015 00:32:07 -0300 Subject: job: Replace by a better process abstraction layer - New libuv/pty process abstraction with simplified API and no globals. - Remove nvim/os/job*. Jobs are now a concept that apply only to programs spawned by vimscript job* functions. - Refactor shell.c/channel.c to use the new module, which brings a number of advantages: - Simplified API, less code - No slots in the user job table are used - Not possible to acidentally receive data from vimscript - Implement job table in eval.c, which is now a hash table with unilimited job slots and unique job ids. --- src/nvim/os/pty_process.h | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/nvim/os/pty_process.h (limited to 'src/nvim/os/pty_process.h') diff --git a/src/nvim/os/pty_process.h b/src/nvim/os/pty_process.h deleted file mode 100644 index b5a2eba8b3..0000000000 --- a/src/nvim/os/pty_process.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef NVIM_OS_PTY_PROCESS_H -#define NVIM_OS_PTY_PROCESS_H - -#include - -#include - -typedef struct { - struct winsize winsize; - uv_pipe_t proc_stdin, proc_stdout, proc_stderr; - int tty_fd; -} PtyProcess; - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/pty_process.h.generated.h" -#endif -#endif // NVIM_OS_PTY_PROCESS_H -- cgit