action__configparser_8c.tex 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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
  13. int \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
  15. int \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
  17. void \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
  21. int \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
  23. void \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
  25. int \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
  27. int \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. \subsection{Detailed Description}
  30. Source file for the parser for action config files.
  31. \subsection{Function Documentation}
  32. \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}}
  33. \index{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action@{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action}!action_configparser.c@{action\-\_\-configparser.\-c}}
  34. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Dequeue\-Action (
  35. \begin{DoxyParamCaption}
  36. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
  37. \end{DoxyParamCaption}
  38. )}}\label{action__configparser_8c_a0e7998533e6e10590612a8d5dee7ec0b}
  39. Remove an action from the front of the action queue pointed to by {\ttfamily queue}.
  40. \begin{DoxyReturn}{Returns}
  41. 1 on success, 0 on failure.
  42. \end{DoxyReturn}
  43. \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}}
  44. \index{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue}!action_configparser.c@{action\-\_\-configparser.\-c}}
  45. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}void S\-D\-L\-Visual\-Test\-\_\-\-Empty\-Action\-Queue (
  46. \begin{DoxyParamCaption}
  47. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
  48. \end{DoxyParamCaption}
  49. )}}\label{action__configparser_8c_a677da0d0e4793df342f91974b4559efa}
  50. Dequeues 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}}
  51. \index{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action@{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action}!action_configparser.c@{action\-\_\-configparser.\-c}}
  52. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Enqueue\-Action (
  53. \begin{DoxyParamCaption}
  54. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue, }
  55. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action}}]{action}
  56. \end{DoxyParamCaption}
  57. )}}\label{action__configparser_8c_a647d1be8f0f27af2fb1e5d4da2100596}
  58. Add an action pointed to by {\ttfamily action} to the rear of the action queue pointed to by {\ttfamily queue}.
  59. \begin{DoxyReturn}{Returns}
  60. 1 on success, 0 on failure.
  61. \end{DoxyReturn}
  62. \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}}
  63. \index{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front@{S\-D\-L\-Visual\-Test\-\_\-\-Get\-Queue\-Front}!action_configparser.c@{action\-\_\-configparser.\-c}}
  64. \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 (
  65. \begin{DoxyParamCaption}
  66. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
  67. \end{DoxyParamCaption}
  68. )}}\label{action__configparser_8c_afb508801942e7c74084480bcdb6f8613}
  69. Get the action at the front of the action queue pointed to by {\ttfamily queue}. The returned action pointer may become invalid after subsequent dequeues.
  70. \begin{DoxyReturn}{Returns}
  71. pointer to the action on success, N\-U\-L\-L on failure.
  72. \end{DoxyReturn}
  73. \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}}
  74. \index{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue@{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue}!action_configparser.c@{action\-\_\-configparser.\-c}}
  75. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue}]{\setlength{\rightskip}{0pt plus 5cm}void S\-D\-L\-Visual\-Test\-\_\-\-Init\-Action\-Queue (
  76. \begin{DoxyParamCaption}
  77. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
  78. \end{DoxyParamCaption}
  79. )}}\label{action__configparser_8c_ae68c1c80f728e125869882139bec2c9e}
  80. Initialize 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}}
  81. \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}}
  82. \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 (
  83. \begin{DoxyParamCaption}
  84. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue, }
  85. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action}}]{action}
  86. \end{DoxyParamCaption}
  87. )}}\label{action__configparser_8c_ace5374ef7509e95383929ff185aaf7e6}
  88. Inserts 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.
  89. \begin{DoxyReturn}{Returns}
  90. 1 on success, 0 on failure.
  91. \end{DoxyReturn}
  92. \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}}
  93. \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}}
  94. \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 (
  95. \begin{DoxyParamCaption}
  96. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
  97. \end{DoxyParamCaption}
  98. )}}\label{action__configparser_8c_a8484ee36f78952192d4193c85fca2f17}
  99. Check if the queue pointed to by {\ttfamily queue} is empty or not.
  100. \begin{DoxyReturn}{Returns}
  101. 1 if the queue is empty, 0 otherwise.
  102. \end{DoxyReturn}
  103. \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}}
  104. \index{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config@{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config}!action_configparser.c@{action\-\_\-configparser.\-c}}
  105. \subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-Parse\-Action\-Config (
  106. \begin{DoxyParamCaption}
  107. \item[{char $\ast$}]{file, }
  108. \item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-Action\-Queue} $\ast$}]{queue}
  109. \end{DoxyParamCaption}
  110. )}}\label{action__configparser_8c_a8ef9dce4d464d6994596deeace6ffa2d}
  111. Parses an action config file with path {\ttfamily file} and populates an action queue pointed to by {\ttfamily queue} with actions.
  112. \begin{DoxyReturn}{Returns}
  113. 1 on success, 0 on failure.
  114. \end{DoxyReturn}