cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

_s_d_l__visualtest__process_8h.tex (10255B)


      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 
      8struct \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info}
      9\item 
     10struct \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 
     15typedef 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 
     17typedef 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 
     23int \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 
     25int \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 
     27int \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 
     29int \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 
     31int \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
     34
     35\subsection{Detailed Description}
     36Provides cross-\/platfrom process launching and termination functionality. 
     37
     38\subsection{Typedef Documentation}
     39\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}}
     40\index{S\-D\-L\-\_\-\-Process\-Exit\-Status@{S\-D\-L\-\_\-\-Process\-Exit\-Status}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
     41\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}
     42This 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}}
     43\index{S\-D\-L\-\_\-\-Process\-Info@{S\-D\-L\-\_\-\-Process\-Info}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
     44\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}
     45Struct to store a platform specific handle to a process. 
     46
     47\subsection{Function Documentation}
     48\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}}
     49\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}}
     50\subsubsection[{S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Get\-Process\-Exit\-Status (
     51\begin{DoxyParamCaption}
     52\item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo, }
     53\item[{{\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$}]{ps}
     54\end{DoxyParamCaption}
     55)}}\label{_s_d_l__visualtest__process_8h_a54545d6b9f737a14030b4ce55ddd4a62}
     56Gets the exit status of a process. If the exit status is -\/1, the process is still running.
     57
     58
     59\begin{DoxyParams}{Parameters}
     60{\em pinfo} & Pointer to a \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} object of the process to be checked. \\
     61\hline
     62{\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.\\
     63\hline
     64\end{DoxyParams}
     65\begin{DoxyReturn}{Returns}
     661 on success, 0 on failure. 
     67\end{DoxyReturn}
     68\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}}
     69\index{S\-D\-L\-\_\-\-Is\-Process\-Running@{S\-D\-L\-\_\-\-Is\-Process\-Running}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
     70\subsubsection[{S\-D\-L\-\_\-\-Is\-Process\-Running}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Is\-Process\-Running (
     71\begin{DoxyParamCaption}
     72\item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo}
     73\end{DoxyParamCaption}
     74)}}\label{_s_d_l__visualtest__process_8h_a3a131140a71bf68fa68a900f06872239}
     75Checks if a process is running or not.
     76
     77
     78\begin{DoxyParams}{Parameters}
     79{\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.\\
     80\hline
     81\end{DoxyParams}
     82\begin{DoxyReturn}{Returns}
     831 if the process is still running; zero if it is not and -\/1 if the status could not be retrieved. 
     84\end{DoxyReturn}
     85\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}}
     86\index{S\-D\-L\-\_\-\-Kill\-Process@{S\-D\-L\-\_\-\-Kill\-Process}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
     87\subsubsection[{S\-D\-L\-\_\-\-Kill\-Process}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Kill\-Process (
     88\begin{DoxyParamCaption}
     89\item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo, }
     90\item[{{\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$}]{ps}
     91\end{DoxyParamCaption}
     92)}}\label{_s_d_l__visualtest__process_8h_ae66242e44a004831ab231693fd11c8d0}
     93Kills a currently running process.
     94
     95
     96\begin{DoxyParams}{Parameters}
     97{\em pinfo} & Pointer to a \hyperlink{struct_s_d_l___process_info}{S\-D\-L\-\_\-\-Process\-Info} object of the process to be terminated. \\
     98\hline
     99{\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.\\
    100\hline
    101\end{DoxyParams}
    102\begin{DoxyReturn}{Returns}
    1031 on success, 0 on failure. 
    104\end{DoxyReturn}
    105\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}}
    106\index{S\-D\-L\-\_\-\-Launch\-Process@{S\-D\-L\-\_\-\-Launch\-Process}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
    107\subsubsection[{S\-D\-L\-\_\-\-Launch\-Process}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Launch\-Process (
    108\begin{DoxyParamCaption}
    109\item[{char $\ast$}]{file, }
    110\item[{char $\ast$}]{args, }
    111\item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo}
    112\end{DoxyParamCaption}
    113)}}\label{_s_d_l__visualtest__process_8h_a12c16e5b870e2794d6bd5a1a3bb4582f}
    114Launches a process with the given commandline arguments.
    115
    116
    117\begin{DoxyParams}{Parameters}
    118{\em file} & The path to the executable to be launched. \\
    119\hline
    120{\em args} & The command line arguments to be passed to the process. \\
    121\hline
    122{\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.\\
    123\hline
    124\end{DoxyParams}
    125\begin{DoxyReturn}{Returns}
    126Non-\/zero on success, zero on failure. 
    127\end{DoxyReturn}
    128\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}}
    129\index{S\-D\-L\-\_\-\-Quit\-Process@{S\-D\-L\-\_\-\-Quit\-Process}!SDL_visualtest_process.h@{S\-D\-L\-\_\-visualtest\-\_\-process.\-h}}
    130\subsubsection[{S\-D\-L\-\_\-\-Quit\-Process}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-\_\-\-Quit\-Process (
    131\begin{DoxyParamCaption}
    132\item[{{\bf S\-D\-L\-\_\-\-Process\-Info} $\ast$}]{pinfo, }
    133\item[{{\bf S\-D\-L\-\_\-\-Process\-Exit\-Status} $\ast$}]{ps}
    134\end{DoxyParamCaption}
    135)}}\label{_s_d_l__visualtest__process_8h_ad8a5b6725ad1f0e1bac623cf4b6fc28d}
    136Cleanly exits the process represented by {\ttfamily pinfo} and stores the exit status in the exit status object pointed to by {\ttfamily ps}.
    137
    138\begin{DoxyReturn}{Returns}
    1391 on success, 0 on failure. 
    140\end{DoxyReturn}