summaryrefslogtreecommitdiffstats
path: root/Process.h.in
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2017-05-16 15:38:28 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-16 15:39:00 (GMT)
commit7be70ca6cc888df532d2f1560e74d13642730ee5 (patch)
tree2867838cfed035918c1de0556ac0b2b08ddef340 /Process.h.in
parent2dec4695b7711126832f61f5e86cc3120cb419d4 (diff)
downloadCMake-7be70ca6cc888df532d2f1560e74d13642730ee5.zip
CMake-7be70ca6cc888df532d2f1560e74d13642730ee5.tar.gz
CMake-7be70ca6cc888df532d2f1560e74d13642730ee5.tar.bz2
KWSys 2017-05-16 (fe1f22ce)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit fe1f22ceefdae18df33e5bab8483fec7a82d4cee (master). Upstream Shortlog ----------------- Adam Weisi (3): 8a799e36 Process: Improve definition ordering in header file 7d56ef24 Process: Save results from all children internally b7eba998 Process: Add APIs to get results of individual processes Ben Boeckel (2): cea71543 style: remove separator comments 874dc559 style: help clang-format near macros
Diffstat (limited to 'Process.h.in')
-rw-r--r--Process.h.in73
1 files changed, 71 insertions, 2 deletions
diff --git a/Process.h.in b/Process.h.in
index b8349a6..237001c 100644
--- a/Process.h.in
+++ b/Process.h.in
@@ -42,7 +42,6 @@
#define kwsysProcess_State_Expired kwsys_ns(Process_State_Expired)
#define kwsysProcess_State_Killed kwsys_ns(Process_State_Killed)
#define kwsysProcess_State_Disowned kwsys_ns(Process_State_Disowned)
-#define kwsysProcess_GetState kwsys_ns(Process_GetState)
#define kwsysProcess_State_e kwsys_ns(Process_State_e)
#define kwsysProcess_Exception_None kwsys_ns(Process_Exception_None)
#define kwsysProcess_Exception_Fault kwsys_ns(Process_Exception_Fault)
@@ -50,12 +49,21 @@
#define kwsysProcess_Exception_Interrupt kwsys_ns(Process_Exception_Interrupt)
#define kwsysProcess_Exception_Numerical kwsys_ns(Process_Exception_Numerical)
#define kwsysProcess_Exception_Other kwsys_ns(Process_Exception_Other)
-#define kwsysProcess_GetExitException kwsys_ns(Process_GetExitException)
#define kwsysProcess_Exception_e kwsys_ns(Process_Exception_e)
+#define kwsysProcess_GetState kwsys_ns(Process_GetState)
+#define kwsysProcess_GetExitException kwsys_ns(Process_GetExitException)
#define kwsysProcess_GetExitCode kwsys_ns(Process_GetExitCode)
#define kwsysProcess_GetExitValue kwsys_ns(Process_GetExitValue)
#define kwsysProcess_GetErrorString kwsys_ns(Process_GetErrorString)
#define kwsysProcess_GetExceptionString kwsys_ns(Process_GetExceptionString)
+#define kwsysProcess_GetStateByIndex kwsys_ns(Process_GetStateByIndex)
+#define kwsysProcess_GetExitExceptionByIndex \
+ kwsys_ns(Process_GetExitExceptionByIndex)
+#define kwsysProcess_GetExitCodeByIndex kwsys_ns(Process_GetExitCodeByIndex)
+#define kwsysProcess_GetExitValueByIndex kwsys_ns(Process_GetExitValueByIndex)
+#define kwsysProcess_GetExceptionStringByIndex \
+ kwsys_ns(Process_GetExceptionStringByIndex)
+#define kwsysProcess_GetExitCodeByIndex kwsys_ns(Process_GetExitCodeByIndex)
#define kwsysProcess_Execute kwsys_ns(Process_Execute)
#define kwsysProcess_Disown kwsys_ns(Process_Disown)
#define kwsysProcess_WaitForData kwsys_ns(Process_WaitForData)
@@ -298,6 +306,67 @@ kwsysEXPORT const char* kwsysProcess_GetErrorString(kwsysProcess* cp);
kwsysEXPORT const char* kwsysProcess_GetExceptionString(kwsysProcess* cp);
/**
+* Get the current state of the Process instance. Possible states are:
+*
+* kwsysProcess_StateByIndex_Starting = Execute has not yet been called.
+* kwsysProcess_StateByIndex_Exception = Child process exited abnormally.
+* kwsysProcess_StateByIndex_Exited = Child process exited normally.
+* kwsysProcess_StateByIndex_Error = Error getting the child return code.
+*/
+kwsysEXPORT int kwsysProcess_GetStateByIndex(kwsysProcess* cp, int idx);
+enum kwsysProcess_StateByIndex_e
+{
+ kwsysProcess_StateByIndex_Starting = kwsysProcess_State_Starting,
+ kwsysProcess_StateByIndex_Exception = kwsysProcess_State_Exception,
+ kwsysProcess_StateByIndex_Exited = kwsysProcess_State_Exited,
+ kwsysProcess_StateByIndex_Error = kwsysProcess_State_Error
+};
+
+/**
+* When GetState returns "Exception", this method returns a
+* platform-independent description of the exceptional behavior that
+* caused the child to terminate abnormally. Possible exceptions are:
+*
+* kwsysProcess_Exception_None = No exceptional behavior occurred.
+* kwsysProcess_Exception_Fault = Child crashed with a memory fault.
+* kwsysProcess_Exception_Illegal = Child crashed with an illegal
+* instruction.
+* kwsysProcess_Exception_Interrupt = Child was interrupted by user
+* (Cntl-C/Break).
+* kwsysProcess_Exception_Numerical = Child crashed with a numerical
+* exception.
+* kwsysProcess_Exception_Other = Child terminated for another reason.
+*/
+kwsysEXPORT int kwsysProcess_GetExitExceptionByIndex(kwsysProcess* cp,
+ int idx);
+
+/**
+* When GetState returns "Exited" or "Exception", this method returns
+* the platform-specific raw exit code of the process. UNIX platforms
+* should use WIFEXITED/WEXITSTATUS and WIFSIGNALED/WTERMSIG to access
+* this value. Windows users should compare the value to the various
+* EXCEPTION_* values.
+*
+* If GetState returns "Exited", use GetExitValue to get the
+* platform-independent child return value.
+*/
+kwsysEXPORT int kwsysProcess_GetExitCodeByIndex(kwsysProcess* cp, int idx);
+
+/**
+* When GetState returns "Exited", this method returns the child's
+* platform-independent exit code (such as the value returned by the
+* child's main).
+*/
+kwsysEXPORT int kwsysProcess_GetExitValueByIndex(kwsysProcess* cp, int idx);
+
+/**
+* When GetState returns "Exception", this method returns a string
+* describing the problem. Otherwise, it returns NULL.
+*/
+kwsysEXPORT const char* kwsysProcess_GetExceptionStringByIndex(
+ kwsysProcess* cp, int idx);
+
+/**
* Start executing the child process.
*/
kwsysEXPORT void kwsysProcess_Execute(kwsysProcess* cp);