#include <ExternalProgram.h>

Public Types | |
| enum | Stderr_Disposition { Normal_Stderr, Discard_Stderr, Stderr_To_Stdout, Stderr_To_FileDesc } |
| typedef std::map < std::string, std::string > | Environment |
Public Member Functions | |
| ExternalProgram (std::string commandline, Stderr_Disposition stderr_disp=Normal_Stderr, bool use_pty=false, int stderr_fd=-1, bool default_locale=false, const Pathname &root="") | |
| ExternalProgram (const char *const *argv, Stderr_Disposition stderr_disp=Normal_Stderr, bool use_pty=false, int stderr_fd=-1, bool default_locale=false, const Pathname &root="") | |
| ExternalProgram (const char *const *argv, const Environment &environment, Stderr_Disposition stderr_disp=Normal_Stderr, bool use_pty=false, int stderr_fd=-1, bool default_locale=false, const Pathname &root="") | |
| ExternalProgram (const char *binpath, const char *const *argv_1, bool use_pty=false) | |
| ExternalProgram (const char *binpath, const char *const *argv_1, const Environment &environment, bool use_pty=false) | |
| ~ExternalProgram () | |
| int | close () |
| bool | kill () |
| bool | running () |
| pid_t | getpid () |
Static Public Member Functions | |
| static void | renumber_fd (int origfd, int newfd) |
Protected Member Functions | |
| int | checkStatus (int) |
Private Member Functions | |
| void | start_program (const char *const *argv, const Environment &environment, Stderr_Disposition stderr_disp=Normal_Stderr, int stderr_fd=-1, bool default_locale=false, const char *root=NULL) |
Private Attributes | |
| bool | use_pty |
| pid_t | pid |
| int | _exitStatus |
| typedef std::map<std::string,std::string> ExternalProgram::Environment |
For passing additional environment variables to set
| ExternalProgram::ExternalProgram | ( | std::string | commandline, | |
| Stderr_Disposition | stderr_disp = Normal_Stderr, |
|||
| bool | use_pty = false, |
|||
| int | stderr_fd = -1, |
|||
| bool | default_locale = false, |
|||
| const Pathname & | root = "" | |||
| ) |
Start the external program by using the shell /bin/sh
with the option -c. You can use io direction symbols < and >.
commandline a shell commandline that is appended to /bin/sh -c. default_locale whether to set LC_ALL=C before starting root directory to chroot into, / or empty to not chroot
| ExternalProgram::ExternalProgram | ( | const char *const * | argv, | |
| Stderr_Disposition | stderr_disp = Normal_Stderr, |
|||
| bool | use_pty = false, |
|||
| int | stderr_fd = -1, |
|||
| bool | default_locale = false, |
|||
| const Pathname & | root = "" | |||
| ) |
Start an external program by giving the arguments as an arry of char *pointers. If environment is provided, varaiables will be added to the childs environment, overwriting existing ones.
| ExternalProgram::ExternalProgram | ( | const char *const * | argv, | |
| const Environment & | environment, | |||
| Stderr_Disposition | stderr_disp = Normal_Stderr, |
|||
| bool | use_pty = false, |
|||
| int | stderr_fd = -1, |
|||
| bool | default_locale = false, |
|||
| const Pathname & | root = "" | |||
| ) |
| ExternalProgram::ExternalProgram | ( | const char * | binpath, | |
| const char *const * | argv_1, | |||
| bool | use_pty = false | |||
| ) |
| ExternalProgram::ExternalProgram | ( | const char * | binpath, | |
| const char *const * | argv_1, | |||
| const Environment & | environment, | |||
| bool | use_pty = false | |||
| ) |
| ExternalProgram::~ExternalProgram | ( | ) |
| int ExternalProgram::close | ( | ) | [virtual] |
Close the input and output streams.
Reimplemented from ExternalDataSource.
| bool ExternalProgram::kill | ( | ) |
Kill the program
| bool ExternalProgram::running | ( | ) |
Return whether program is running
| pid_t ExternalProgram::getpid | ( | ) | [inline] |
return pid
| static void ExternalProgram::renumber_fd | ( | int | origfd, | |
| int | newfd | |||
| ) | [static] |
origfd will be accessible as newfd and closed (unless they were equal)
| int ExternalProgram::checkStatus | ( | int | ) | [protected] |
| void ExternalProgram::start_program | ( | const char *const * | argv, | |
| const Environment & | environment, | |||
| Stderr_Disposition | stderr_disp = Normal_Stderr, |
|||
| int | stderr_fd = -1, |
|||
| bool | default_locale = false, |
|||
| const char * | root = NULL | |||
| ) | [private] |
bool ExternalProgram::use_pty [private] |
Set to true, if a pair of ttys is used for communication instead of a pair of pipes.
pid_t ExternalProgram::pid [private] |
int ExternalProgram::_exitStatus [private] |
1.5.3