19 #ifndef _libpbd_system_exec_h_
20 #define _libpbd_system_exec_h_
23 #define STDIN_FILENO 0
26 #define STDOUT_FILENO 1
29 #define STDERR_FILENO 2
32 #ifdef PLATFORM_WINDOWS
40 #include <sys/types.h>
50 #include <sigc++/bind.h>
51 #include <sigc++/signal.h>
89 SystemExec (std::string cmd, std::string argv =
"",
bool supress_ld_env =
false);
101 SystemExec (std::string cmd,
char **argv,
bool supress_ld_env =
false);
117 SystemExec (std::string command,
const std::map<char, std::string> subs,
bool supress_ld_env =
false);
203 sigc::signal<void, std::string,size_t> ReadStdout;
210 sigc::signal<void> Terminated;
240 #ifdef PLATFORM_WINDOWS
241 PROCESS_INFORMATION *pid;
246 void make_wargs(
char **);
execute an external command
SystemExec(std::string cmd, char **argv, bool supress_ld_env=false)
std::string cmd
path to command - set when creating the class
void make_argp(std::string)
size_t write_to_stdin(const char *d, size_t len=0)
size_t write_to_stdin(const void *data, size_t bytes=0)
void make_argp_escaped(std::string command, const std::map< char, std::string > subs)
pthread_mutex_t write_lock
SystemExec(std::string command, const std::map< char, std::string > subs, bool supress_ld_env=false)
PBD::Signal< void()> Terminated
PBD::Signal< void(std::string, size_t)> ReadStdout
size_t write_to_stdin(std::string const &d, size_t len=0)
int nicelevel
process nice level - defaults to 0
static char * format_key_value_parameter(std::string, std::string)
SystemExec(std::string cmd, std::string argv="", bool supress_ld_env=false)
int start(StdErrMode stderr_mode, const char *_vfork_exec_wrapper)
void make_envp(bool supress_ld_env)