#define wxMax(a,b) (((a) > (b)) ? (a) : (b))
#define wxMin(a,b) (((a) < (b)) ? (a) : (b))
+// wxGetFreeMemory can return huge amount of memory on 64-bit platforms
+// define wxMemorySize according to the type which best fits your platform
+#if wxUSE_LONGLONG && defined(__WIN64__)
+ // 64 bit Windowses have sizeof(long) only 32 bit long
+ // we need to use wxLongLong to express memory sizes
+ #define wxMemorySize wxLongLong
+#else
+ // 64 bit UNIX has sizeof(long) = 64
+ // assume 32 bit platforms cannnot return more than 32bits of
+ #define wxMemorySize long
+#endif
+
// ----------------------------------------------------------------------------
// String functions (deprecated, use wxString)
// ----------------------------------------------------------------------------
// Process management
// ----------------------------------------------------------------------------
-// NB: for backwars compatibility reasons the values of wxEXEC_[A]SYNC *must*
+// NB: for backwards compatibility reasons the values of wxEXEC_[A]SYNC *must*
// be 0 and 1, don't change!
enum
// is done by default)
wxEXEC_NOHIDE = 2,
- // under Unix, if the process is the group leader then killing -pid kills
- // all children as well as pid
- wxEXEC_MAKE_GROUP_LEADER = 4
+ // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
+ // kills all children as well as pid
+ 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
};
// Execute another program.
// 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);
+ wxArrayString& output,
+ int flags = 0);
// also capture stderr (also synchronous)
WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
- wxArrayString& output,
- wxArrayString& error);
+ wxArrayString& output,
+ wxArrayString& error,
+ int flags = 0);
enum wxSignal
{
wxKILL_ERROR // another, unspecified error
};
+enum wxKillFlags
+{
+ wxKILL_NOCHILDREN = 0, // don't kill children
+ wxKILL_CHILDREN = 1 // kill children
+};
+
enum wxShutdownFlags
{
wxSHUTDOWN_POWEROFF, // power off the computer
// return detailed error in rc if not NULL
WXDLLIMPEXP_BASE int wxKill(long pid,
wxSignal sig = wxSIGTERM,
- wxKillError *rc = NULL);
+ wxKillError *rc = NULL,
+ int flags = wxKILL_NOCHILDREN);
// Execute a command in an interactive shell window (always synchronously)
// If no command then just the shell
WXDLLIMPEXP_BASE unsigned long wxGetProcessId();
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
-WXDLLIMPEXP_BASE long wxGetFreeMemory();
+WXDLLIMPEXP_BASE wxMemorySize wxGetFreeMemory();
// should wxApp::OnFatalException() be called?
WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true);