cscg22-gearboy

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

action__configparser_8c.tex (10798B)


      1\hypertarget{action__configparser_8c}{\section{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/action\-\_\-configparser.c File Reference}
      2\label{action__configparser_8c}\index{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/action\-\_\-configparser.\-c@{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/action\-\_\-configparser.\-c}}
      3}
      4{\ttfamily \#include $<$S\-D\-L\-\_\-stdinc.\-h$>$}\\*
      5{\ttfamily \#include $<$S\-D\-L\-\_\-test.\-h$>$}\\*
      6{\ttfamily \#include $<$string.\-h$>$}\\*
      7{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-action\-\_\-configparser.\-h\char`\"{}}\\*
      8{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-rwhelper.\-h\char`\"{}}\\*
      9{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-parsehelper.\-h\char`\"{}}\\*
     10\subsection*{Functions}
     11\begin{DoxyCompactItemize}
     12\item 
     13int \hyperlink{action__configparser_8c_a647d1be8f0f27af2fb1e5d4da2100596}{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue, \hyperlink{struct_s_d_l_visual_test___action}{S\-D\-L\-Visual\-Test\-\_\-\-Action} action)
     14\item 
     15int \hyperlink{action__configparser_8c_a0e7998533e6e10590612a8d5dee7ec0b}{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue)
     16\item 
     17void \hyperlink{action__configparser_8c_ae68c1c80f728e125869882139bec2c9e}{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue)
     18\item 
     19\hyperlink{struct_s_d_l_visual_test___action}{S\-D\-L\-Visual\-Test\-\_\-\-Action} $\ast$ \hyperlink{action__configparser_8c_afb508801942e7c74084480bcdb6f8613}{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue)
     20\item 
     21int \hyperlink{action__configparser_8c_a8484ee36f78952192d4193c85fca2f17}{S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue)
     22\item 
     23void \hyperlink{action__configparser_8c_a677da0d0e4793df342f91974b4559efa}{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue)
     24\item 
     25int \hyperlink{action__configparser_8c_ace5374ef7509e95383929ff185aaf7e6}{S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue} (\hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue, \hyperlink{struct_s_d_l_visual_test___action}{S\-D\-L\-Visual\-Test\-\_\-\-Action} action)
     26\item 
     27int \hyperlink{action__configparser_8c_a8ef9dce4d464d6994596deeace6ffa2d}{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config} (char $\ast$file, \hyperlink{struct_s_d_l_visual_test___action_queue}{S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$queue)
     28\end{DoxyCompactItemize}
     29
     30
     31\subsection{Detailed Description}
     32Source file for the parser for action config files. 
     33
     34\subsection{Function Documentation}
     35\hypertarget{action__configparser_8c_a0e7998533e6e10590612a8d5dee7ec0b}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action@{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action}}
     36\index{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action@{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action}!action_configparser.c@{action\-\_\-configparser.\-c}}
     37\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action (
     38\begin{DoxyParamCaption}
     39\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
     40\end{DoxyParamCaption}
     41)}}\label{action__configparser_8c_a0e7998533e6e10590612a8d5dee7ec0b}
     42Remove an action from the front of the action queue pointed to by {\ttfamily queue}.
     43
     44\begin{DoxyReturn}{Returns}
     451 on success, 0 on failure. 
     46\end{DoxyReturn}
     47\hypertarget{action__configparser_8c_a677da0d0e4793df342f91974b4559efa}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue}}
     48\index{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue}!action_configparser.c@{action\-\_\-configparser.\-c}}
     49\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}void S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue (
     50\begin{DoxyParamCaption}
     51\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
     52\end{DoxyParamCaption}
     53)}}\label{action__configparser_8c_a677da0d0e4793df342f91974b4559efa}
     54Dequeues all the elements in the queque pointed to by {\ttfamily queue}. \hypertarget{action__configparser_8c_a647d1be8f0f27af2fb1e5d4da2100596}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action@{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action}}
     55\index{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action@{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action}!action_configparser.c@{action\-\_\-configparser.\-c}}
     56\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action (
     57\begin{DoxyParamCaption}
     58\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue, }
     59\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action}}]{action}
     60\end{DoxyParamCaption}
     61)}}\label{action__configparser_8c_a647d1be8f0f27af2fb1e5d4da2100596}
     62Add an action pointed to by {\ttfamily action} to the rear of the action queue pointed to by {\ttfamily queue}.
     63
     64\begin{DoxyReturn}{Returns}
     651 on success, 0 on failure. 
     66\end{DoxyReturn}
     67\hypertarget{action__configparser_8c_afb508801942e7c74084480bcdb6f8613}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front@{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front}}
     68\index{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front@{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front}!action_configparser.c@{action\-\_\-configparser.\-c}}
     69\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front}]{\setlength{\rightskip}{0pt plus 5cm}{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action}$\ast$ S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front (
     70\begin{DoxyParamCaption}
     71\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
     72\end{DoxyParamCaption}
     73)}}\label{action__configparser_8c_afb508801942e7c74084480bcdb6f8613}
     74Get the action at the front of the action queue pointed to by {\ttfamily queue}. The returned action pointer may become invalid after subsequent dequeues.
     75
     76\begin{DoxyReturn}{Returns}
     77pointer to the action on success, N\-U\-L\-L on failure. 
     78\end{DoxyReturn}
     79\hypertarget{action__configparser_8c_ae68c1c80f728e125869882139bec2c9e}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue}}
     80\index{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue}!action_configparser.c@{action\-\_\-configparser.\-c}}
     81\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}void S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue (
     82\begin{DoxyParamCaption}
     83\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
     84\end{DoxyParamCaption}
     85)}}\label{action__configparser_8c_ae68c1c80f728e125869882139bec2c9e}
     86Initialize the action queue pointed to by {\ttfamily queue}. \hypertarget{action__configparser_8c_ace5374ef7509e95383929ff185aaf7e6}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue}}
     87\index{S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue}!action_configparser.c@{action\-\_\-configparser.\-c}}
     88\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Insert\-Into\-Action\-Queue (
     89\begin{DoxyParamCaption}
     90\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue, }
     91\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action}}]{action}
     92\end{DoxyParamCaption}
     93)}}\label{action__configparser_8c_ace5374ef7509e95383929ff185aaf7e6}
     94Inserts an action {\ttfamily action} into the queue pointed to by {\ttfamily queue} such that the times of actions in the queue increase as we move from the front to the rear.
     95
     96\begin{DoxyReturn}{Returns}
     971 on success, 0 on failure. 
     98\end{DoxyReturn}
     99\hypertarget{action__configparser_8c_a8484ee36f78952192d4193c85fca2f17}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty@{S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty}}
    100\index{S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty@{S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty}!action_configparser.c@{action\-\_\-configparser.\-c}}
    101\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Is\-Action\-Queue\-Empty (
    102\begin{DoxyParamCaption}
    103\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
    104\end{DoxyParamCaption}
    105)}}\label{action__configparser_8c_a8484ee36f78952192d4193c85fca2f17}
    106Check if the queue pointed to by {\ttfamily queue} is empty or not.
    107
    108\begin{DoxyReturn}{Returns}
    1091 if the queue is empty, 0 otherwise. 
    110\end{DoxyReturn}
    111\hypertarget{action__configparser_8c_a8ef9dce4d464d6994596deeace6ffa2d}{\index{action\-\_\-configparser.\-c@{action\-\_\-configparser.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config@{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config}}
    112\index{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config@{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config}!action_configparser.c@{action\-\_\-configparser.\-c}}
    113\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config (
    114\begin{DoxyParamCaption}
    115\item[{char $\ast$}]{file, }
    116\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
    117\end{DoxyParamCaption}
    118)}}\label{action__configparser_8c_a8ef9dce4d464d6994596deeace6ffa2d}
    119Parses an action config file with path {\ttfamily file} and populates an action queue pointed to by {\ttfamily queue} with actions.
    120
    121\begin{DoxyReturn}{Returns}
    1221 on success, 0 on failure. 
    123\end{DoxyReturn}