_s_d_l__visualtest__process_8h.tex 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. \hypertarget{_s_d_l__visualtest__process_8h}{\section{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/include/\-S\-D\-L\-\_\-visualtest\-\_\-process.h File Reference}
  2. \label{_s_d_l__visualtest__process_8h}\index{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/include/\-S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/include/\-S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  3. }
  4. {\ttfamily \#include $<$S\-D\-L\-\_\-platform.\-h$>$}\\*
  5. \subsection*{Data Structures}
  6. \begin{DoxyCompactItemize}
  7. \item
  8. struct \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info}
  9. \item
  10. struct \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status}
  11. \end{DoxyCompactItemize}
  12. \subsection*{Typedefs}
  13. \begin{DoxyCompactItemize}
  14. \item
  15. typedef struct \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} \hyperlink{_s_d_l__visualtest__process_8h_a94bc9e0b0b563a527ea50ef2eecd5402}{S\-D\-L\-\_\-\-Process\-Info}
  16. \item
  17. typedef struct \\*
  18. \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status} \hyperlink{_s_d_l__visualtest__process_8h_a5b7d5262f85e78bf4d53d88f3c509342}{S\-D\-L\-\_\-\-Process\-Exit\-Status}
  19. \end{DoxyCompactItemize}
  20. \subsection*{Functions}
  21. \begin{DoxyCompactItemize}
  22. \item
  23. int \hyperlink{_s_d_l__visualtest__process_8h_a12c16e5b870e2794d6bd5a1a3bb4582f}{S\-D\-L\-\_\-\-Launch\-Process} (char $\ast$file, char $\ast$args, \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} $\ast$pinfo)
  24. \item
  25. int \hyperlink{_s_d_l__visualtest__process_8h_a3a131140a71bf68fa68a900f06872239}{S\-D\-L\-\_\-\-Is\-Process\-Running} (\hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} $\ast$pinfo)
  26. \item
  27. int \hyperlink{_s_d_l__visualtest__process_8h_ae66242e44a004831ab231693fd11c8d0}{S\-D\-L\-\_\-\-Kill\-Process} (\hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} $\ast$pinfo, \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$ps)
  28. \item
  29. int \hyperlink{_s_d_l__visualtest__process_8h_ad8a5b6725ad1f0e1bac623cf4b6fc28d}{S\-D\-L\-\_\-\-Quit\-Process} (\hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} $\ast$pinfo, \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$ps)
  30. \item
  31. int \hyperlink{_s_d_l__visualtest__process_8h_a54545d6b9f737a14030b4ce55ddd4a62}{S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status} (\hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} $\ast$pinfo, \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$ps)
  32. \end{DoxyCompactItemize}
  33. \subsection{Detailed Description}
  34. Provides cross-\/platfrom process launching and termination functionality.
  35. \subsection{Typedef Documentation}
  36. \hypertarget{_s_d_l__visualtest__process_8h_a5b7d5262f85e78bf4d53d88f3c509342}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Process\-Exit\-Status@{S\-D\-L\-\_\-\-Process\-Exit\-Status}}
  37. \index{S\-D\-L\-\_\-\-Process\-Exit\-Status@{S\-D\-L\-\_\-\-Process\-Exit\-Status}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  38. \subsubsection[{S\-D\-L\-\_\-\-Process\-Exit\-Status}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} {\bf S\-D\-L\-\_\-\-Process\-Exit\-Status}}}\label{_s_d_l__visualtest__process_8h_a5b7d5262f85e78bf4d53d88f3c509342}
  39. This structure stores the exit status (value returned by \hyperlink{testharness_8c_a0ddf1224851353fc92bfbff6f499fa97}{main()}) and whether the process exited sucessfully or not. \hypertarget{_s_d_l__visualtest__process_8h_a94bc9e0b0b563a527ea50ef2eecd5402}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Process\-Info@{S\-D\-L\-\_\-\-Process\-Info}}
  40. \index{S\-D\-L\-\_\-\-Process\-Info@{S\-D\-L\-\_\-\-Process\-Info}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  41. \subsubsection[{S\-D\-L\-\_\-\-Process\-Info}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf S\-D\-L\-\_\-\-Process\-Info} {\bf S\-D\-L\-\_\-\-Process\-Info}}}\label{_s_d_l__visualtest__process_8h_a94bc9e0b0b563a527ea50ef2eecd5402}
  42. Struct to store a platform specific handle to a process.
  43. \subsection{Function Documentation}
  44. \hypertarget{_s_d_l__visualtest__process_8h_a54545d6b9f737a14030b4ce55ddd4a62}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status@{S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status}}
  45. \index{S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status@{S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  46. \subsubsection[{S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status (
  47. \begin{DoxyParamCaption}
  48. \item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo, }
  49. \item[{{\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$}]{ps}
  50. \end{DoxyParamCaption}
  51. )}}\label{_s_d_l__visualtest__process_8h_a54545d6b9f737a14030b4ce55ddd4a62}
  52. Gets the exit status of a process. If the exit status is -\/1, the process is still running.
  53. \begin{DoxyParams}{Parameters}
  54. {\em pinfo} & Pointer to a \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} object of the process to be checked. \\
  55. \hline
  56. {\em ps} & Pointer to a \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status} object which will be populated with the exit status.\\
  57. \hline
  58. \end{DoxyParams}
  59. \begin{DoxyReturn}{Returns}
  60. 1 on success, 0 on failure.
  61. \end{DoxyReturn}
  62. \hypertarget{_s_d_l__visualtest__process_8h_a3a131140a71bf68fa68a900f06872239}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Is\-Process\-Running@{S\-D\-L\-\_\-\-Is\-Process\-Running}}
  63. \index{S\-D\-L\-\_\-\-Is\-Process\-Running@{S\-D\-L\-\_\-\-Is\-Process\-Running}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  64. \subsubsection[{S\-D\-L\-\_\-\-Is\-Process\-Running}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Is\-Process\-Running (
  65. \begin{DoxyParamCaption}
  66. \item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo}
  67. \end{DoxyParamCaption}
  68. )}}\label{_s_d_l__visualtest__process_8h_a3a131140a71bf68fa68a900f06872239}
  69. Checks if a process is running or not.
  70. \begin{DoxyParams}{Parameters}
  71. {\em pinfo} & Pointer to \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} object of the process that needs to be checked.\\
  72. \hline
  73. \end{DoxyParams}
  74. \begin{DoxyReturn}{Returns}
  75. 1 if the process is still running; zero if it is not and -\/1 if the status could not be retrieved.
  76. \end{DoxyReturn}
  77. \hypertarget{_s_d_l__visualtest__process_8h_ae66242e44a004831ab231693fd11c8d0}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Kill\-Process@{S\-D\-L\-\_\-\-Kill\-Process}}
  78. \index{S\-D\-L\-\_\-\-Kill\-Process@{S\-D\-L\-\_\-\-Kill\-Process}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  79. \subsubsection[{S\-D\-L\-\_\-\-Kill\-Process}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Kill\-Process (
  80. \begin{DoxyParamCaption}
  81. \item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo, }
  82. \item[{{\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$}]{ps}
  83. \end{DoxyParamCaption}
  84. )}}\label{_s_d_l__visualtest__process_8h_ae66242e44a004831ab231693fd11c8d0}
  85. Kills a currently running process.
  86. \begin{DoxyParams}{Parameters}
  87. {\em pinfo} & Pointer to a \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} object of the process to be terminated. \\
  88. \hline
  89. {\em ps} & Pointer to a \hyperlink{struct_s_d_l___process_exit_status}{S\-D\-L\-\_\-\-Process\-Exit\-Status} object which will be populated with the exit status.\\
  90. \hline
  91. \end{DoxyParams}
  92. \begin{DoxyReturn}{Returns}
  93. 1 on success, 0 on failure.
  94. \end{DoxyReturn}
  95. \hypertarget{_s_d_l__visualtest__process_8h_a12c16e5b870e2794d6bd5a1a3bb4582f}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Launch\-Process@{S\-D\-L\-\_\-\-Launch\-Process}}
  96. \index{S\-D\-L\-\_\-\-Launch\-Process@{S\-D\-L\-\_\-\-Launch\-Process}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  97. \subsubsection[{S\-D\-L\-\_\-\-Launch\-Process}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Launch\-Process (
  98. \begin{DoxyParamCaption}
  99. \item[{char $\ast$}]{file, }
  100. \item[{char $\ast$}]{args, }
  101. \item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo}
  102. \end{DoxyParamCaption}
  103. )}}\label{_s_d_l__visualtest__process_8h_a12c16e5b870e2794d6bd5a1a3bb4582f}
  104. Launches a process with the given commandline arguments.
  105. \begin{DoxyParams}{Parameters}
  106. {\em file} & The path to the executable to be launched. \\
  107. \hline
  108. {\em args} & The command line arguments to be passed to the process. \\
  109. \hline
  110. {\em pinfo} & Pointer to an \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} object to be populated with platform specific information about the launched process.\\
  111. \hline
  112. \end{DoxyParams}
  113. \begin{DoxyReturn}{Returns}
  114. Non-\/zero on success, zero on failure.
  115. \end{DoxyReturn}
  116. \hypertarget{_s_d_l__visualtest__process_8h_ad8a5b6725ad1f0e1bac623cf4b6fc28d}{\index{S\-D\-L\-\_\-visualtest\-\_\-process.\-h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}!S\-D\-L\-\_\-\-Quit\-Process@{S\-D\-L\-\_\-\-Quit\-Process}}
  117. \index{S\-D\-L\-\_\-\-Quit\-Process@{S\-D\-L\-\_\-\-Quit\-Process}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
  118. \subsubsection[{S\-D\-L\-\_\-\-Quit\-Process}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Quit\-Process (
  119. \begin{DoxyParamCaption}
  120. \item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo, }
  121. \item[{{\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$}]{ps}
  122. \end{DoxyParamCaption}
  123. )}}\label{_s_d_l__visualtest__process_8h_ad8a5b6725ad1f0e1bac623cf4b6fc28d}
  124. Cleanly exits the process represented by {\ttfamily pinfo} and stores the exit status in the exit status object pointed to by {\ttfamily ps}.
  125. \begin{DoxyReturn}{Returns}
  126. 1 on success, 0 on failure.
  127. \end{DoxyReturn}