1#ifndef __NCPP_SUBPROC_HH
2#define __NCPP_SUBPROC_HH
19 explicit Subproc (
Plane* plane,
const char* bin,
bool use_path =
true,
20 char*
const arg[] =
nullptr,
char*
const env[] =
nullptr,
22 :
Subproc (plane, bin, nullptr, use_path, arg, env, cbfxn, donecbfxn)
26 char*
const arg[] =
nullptr,
char*
const env[] =
nullptr,
30 ensure_valid_plane (plane);
31 create_subproc (*plane, bin,
opts, use_path, arg, env, cbfxn, donecbfxn);
32 take_plane_ownership (plane);
35 explicit Subproc (
Plane& plane,
const char* bin,
bool use_path =
true,
36 char*
const arg[] =
nullptr,
char*
const env[] =
nullptr,
38 :
Subproc (plane, bin, nullptr, use_path, arg, env, cbfxn, donecbfxn)
42 char*
const arg[] =
nullptr,
char*
const env[] =
nullptr,
46 ensure_valid_plane (plane);
47 create_subproc (plane, bin,
opts, use_path, arg, env, cbfxn, donecbfxn);
48 take_plane_ownership (plane);
53 if (is_notcurses_stopped ())
66 char*
const arg[],
char*
const env[],
73 opts = &default_options;
78 n,
opts, bin, arg, env, cbfxn, donecbfxn
82 n,
opts, bin, arg, cbfxn, donecbfxn
87 n,
opts, bin, arg, cbfxn, donecbfxn
91 if (subproc ==
nullptr)
92 throw init_error (
"Notcurses failed to create ncsubproc instance");
static ncsubproc_options default_options
Subproc(Plane *plane, const char *bin, bool use_path=true, char *const arg[]=nullptr, char *const env[]=nullptr, ncfdplane_callback cbfxn=nullptr, ncfdplane_done_cb donecbfxn=nullptr)
Subproc(Plane &plane, const char *bin, const ncsubproc_options *opts, bool use_path=true, char *const arg[]=nullptr, char *const env[]=nullptr, ncfdplane_callback cbfxn=nullptr, ncfdplane_done_cb donecbfxn=nullptr)
Subproc(Plane &plane, const char *bin, bool use_path=true, char *const arg[]=nullptr, char *const env[]=nullptr, ncfdplane_callback cbfxn=nullptr, ncfdplane_done_cb donecbfxn=nullptr)
Subproc(Plane *plane, const char *bin, const ncsubproc_options *opts, bool use_path=true, char *const arg[]=nullptr, char *const env[]=nullptr, ncfdplane_callback cbfxn=nullptr, ncfdplane_done_cb donecbfxn=nullptr)
Plane * get_plane() const noexcept
ncsubproc * ncsubproc_createv(ncplane *n, const ncsubproc_options *opts, const char *bin, const char *const arg[], ncfdplane_callback cbfxn, ncfdplane_done_cb donecbfxn)
ncsubproc * ncsubproc_createvp(ncplane *n, const ncsubproc_options *opts, const char *bin, const char *const arg[], ncfdplane_callback cbfxn, ncfdplane_done_cb donecbfxn)
ncsubproc * ncsubproc_createvpe(ncplane *n, const ncsubproc_options *opts, const char *bin, const char *const arg[], const char *const env[], ncfdplane_callback cbfxn, ncfdplane_done_cb donecbfxn)
ncplane * ncsubproc_plane(ncsubproc *n)
int ncsubproc_destroy(ncsubproc *n)
const struct ncplane_options * opts
int(* ncfdplane_done_cb)(struct ncfdplane *n, int fderrno, void *curry)
int(* ncfdplane_callback)(struct ncfdplane *n, const void *buf, size_t s, void *curry)