+enum
+{
+ // execute the process asynchronously
+ wxEXEC_ASYNC = 0,
+
+ // execute it synchronously, i.e. wait until it finishes
+ wxEXEC_SYNC = 1,
+
+ // under Windows, don't hide the child even if it's IO is redirected (this
+ // is done by default)
+ wxEXEC_SHOW_CONSOLE = 2,
+
+ // deprecated synonym for wxEXEC_SHOW_CONSOLE, use the new name as it's
+ // more clear
+ wxEXEC_NOHIDE = wxEXEC_SHOW_CONSOLE,
+
+ // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
+ // kills all children as well as pid
+ // under Windows (NT family only), sets the CREATE_NEW_PROCESS_GROUP flag,
+ // which allows to target Ctrl-Break signal to the spawned process.
+ // applies to console processes only.
+ wxEXEC_MAKE_GROUP_LEADER = 4,
+
+ // by default synchronous execution disables all program windows to avoid
+ // that the user interacts with the program while the child process is
+ // running, you can use this flag to prevent this from happening
+ wxEXEC_NODISABLE = 8,
+
+ // by default, the event loop is run while waiting for synchronous execution
+ // to complete and this flag can be used to simply block the main process
+ // until the child process finishes
+ wxEXEC_NOEVENTS = 16,
+
+ // under Windows, hide the console of the child process if it has one, even
+ // if its IO is not redirected
+ wxEXEC_HIDE_CONSOLE = 32,
+
+ // convenient synonym for flags given system()-like behaviour
+ wxEXEC_BLOCK = wxEXEC_SYNC | wxEXEC_NOEVENTS
+};
+
+// Map storing environment variables.
+typedef wxStringToStringHashMap wxEnvVariableHashMap;
+
+// Used to pass additional parameters for child process to wxExecute(). Could
+// be extended with other fields later.
+struct wxExecuteEnv
+{
+ wxString cwd; // If empty, CWD is not changed.
+ wxEnvVariableHashMap env; // If empty, environment is unchanged.
+};
+
+// Execute another program.
+//
+// If flags contain wxEXEC_SYNC, return -1 on failure and the exit code of the
+// process if everything was ok. Otherwise (i.e. if wxEXEC_ASYNC), return 0 on
+// failure and the PID of the launched process if ok.
+WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
+ int flags = wxEXEC_ASYNC,
+ wxProcess *process = NULL,
+ const wxExecuteEnv *env = NULL);
+WXDLLIMPEXP_BASE long wxExecute(char **argv,
+ int flags = wxEXEC_ASYNC,
+ wxProcess *process = NULL,
+ const wxExecuteEnv *env = NULL);
+#if wxUSE_UNICODE
+WXDLLIMPEXP_BASE long wxExecute(wchar_t **argv,
+ int flags = wxEXEC_ASYNC,
+ wxProcess *process = NULL,
+ const wxExecuteEnv *env = NULL);
+#endif // wxUSE_UNICODE
+
+// execute the command capturing its output into an array line by line, this is
+// always synchronous
+WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
+ wxArrayString& output,
+ int flags = 0,
+ const wxExecuteEnv *env = NULL);
+
+// also capture stderr (also synchronous)
+WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
+ wxArrayString& output,
+ wxArrayString& error,
+ int flags = 0,
+ const wxExecuteEnv *env = NULL);
+
+#if defined(__WXMSW__) && wxUSE_IPC
+// ask a DDE server to execute the DDE request with given parameters
+WXDLLIMPEXP_BASE bool wxExecuteDDE(const wxString& ddeServer,
+ const wxString& ddeTopic,
+ const wxString& ddeCommand);
+#endif // __WXMSW__ && wxUSE_IPC
+
+enum wxSignal
+{
+ wxSIGNONE = 0, // verify if the process exists under Unix
+ wxSIGHUP,
+ wxSIGINT,
+ wxSIGQUIT,
+ wxSIGILL,
+ wxSIGTRAP,
+ wxSIGABRT,
+ wxSIGIOT = wxSIGABRT, // another name
+ wxSIGEMT,
+ wxSIGFPE,
+ wxSIGKILL,
+ wxSIGBUS,
+ wxSIGSEGV,
+ wxSIGSYS,
+ wxSIGPIPE,
+ wxSIGALRM,
+ wxSIGTERM
+
+ // further signals are different in meaning between different Unix systems
+};
+
+enum wxKillError
+{
+ wxKILL_OK, // no error
+ wxKILL_BAD_SIGNAL, // no such signal
+ wxKILL_ACCESS_DENIED, // permission denied
+ wxKILL_NO_PROCESS, // no such process
+ wxKILL_ERROR // another, unspecified error
+};