aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/process.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/event/process.h')
-rw-r--r--src/nvim/event/process.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h
index 5c00e8e7ec..0897563c83 100644
--- a/src/nvim/event/process.h
+++ b/src/nvim/event/process.h
@@ -23,13 +23,15 @@ struct process {
uint64_t stopped_time;
const char *cwd;
char **argv;
- Stream *in, *out, *err;
+ Stream in, out, err;
process_exit_cb cb;
internal_process_cb internal_exit_cb, internal_close_cb;
+ bool exited; // TODO: redundant
bool closed, detach;
MultiQueue *events;
};
+
static inline Process process_init(Loop *loop, ProcessType type, void *data)
{
return (Process) {
@@ -43,9 +45,9 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data)
.stopped_time = 0,
.cwd = NULL,
.argv = NULL,
- .in = NULL,
- .out = NULL,
- .err = NULL,
+ .in = { .closed = false },
+ .out = { .closed = false },
+ .err = { .closed = false },
.cb = NULL,
.closed = false,
.internal_close_cb = NULL,
@@ -54,6 +56,11 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data)
};
}
+static inline bool process_is_stopped(Process *proc)
+{
+ return proc->stopped_time != 0;
+}
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/process.h.generated.h"
#endif