cscg22-gearboy

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

rwhelper_8c.tex (6936B)


      1\hypertarget{rwhelper_8c}{\section{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/rwhelper.c File Reference}
      2\label{rwhelper_8c}\index{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/rwhelper.\-c@{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/rwhelper.\-c}}
      3}
      4{\ttfamily \#include $<$S\-D\-L\-\_\-test.\-h$>$}\\*
      5{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-sut\-\_\-configparser.\-h\char`\"{}}\\*
      6{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-rwhelper.\-h\char`\"{}}\\*
      7\subsection*{Functions}
      8\begin{DoxyCompactItemize}
      9\item 
     10void \hyperlink{rwhelper_8c_aa7878508e6d851b11dc1d1186324064a}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer} (\hyperlink{struct_s_d_l_visual_test___r_w_helper_buffer}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$buffer)
     11\item 
     12char \hyperlink{rwhelper_8c_a92794c04d5568bde0da9f3020d88f44c}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char} (S\-D\-L\-\_\-\-R\-Wops $\ast$rw, \hyperlink{struct_s_d_l_visual_test___r_w_helper_buffer}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$buffer)
     13\item 
     14char $\ast$ \hyperlink{rwhelper_8c_af97cfdf8d58f716efa8fd9204666df12}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line} (S\-D\-L\-\_\-\-R\-Wops $\ast$rw, char $\ast$str, int size, \hyperlink{struct_s_d_l_visual_test___r_w_helper_buffer}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$buffer, char comment\-\_\-char)
     15\item 
     16int \hyperlink{rwhelper_8c_ac7f94417fa973af01a27452acd0043e8}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines} (S\-D\-L\-\_\-\-R\-Wops $\ast$rw, \hyperlink{struct_s_d_l_visual_test___r_w_helper_buffer}{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$buffer, char comment\-\_\-char)
     17\end{DoxyCompactItemize}
     18
     19
     20\subsection{Detailed Description}
     21Header file with some helper functions for working with S\-D\-L\-\_\-\-R\-Wops.
     22
     23Source file with some helper functions for working with S\-D\-L\-\_\-\-R\-Wops. 
     24
     25\subsection{Function Documentation}
     26\hypertarget{rwhelper_8c_ac7f94417fa973af01a27452acd0043e8}{\index{rwhelper.\-c@{rwhelper.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines}}
     27\index{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines}!rwhelper.c@{rwhelper.\-c}}
     28\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines}]{\setlength{\rightskip}{0pt plus 5cm}int S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Count\-Non\-Empty\-Lines (
     29\begin{DoxyParamCaption}
     30\item[{S\-D\-L\-\_\-\-R\-Wops $\ast$}]{rw, }
     31\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer, }
     32\item[{char}]{comment\-\_\-char}
     33\end{DoxyParamCaption}
     34)}}\label{rwhelper_8c_ac7f94417fa973af01a27452acd0043e8}
     35Counts the number of lines that are not all whitespace and comments using the S\-D\-L\-\_\-\-R\-Wops object pointed to by {\ttfamily rw}. {\ttfamily comment\-\_\-char} indicates the character used for comments. Uses the buffer pointed to by {\ttfamily buffer} to read data in blocks.
     36
     37\begin{DoxyReturn}{Returns}
     38Number of lines on success, -\/1 on failure. 
     39\end{DoxyReturn}
     40\hypertarget{rwhelper_8c_a92794c04d5568bde0da9f3020d88f44c}{\index{rwhelper.\-c@{rwhelper.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char}}
     41\index{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char}!rwhelper.c@{rwhelper.\-c}}
     42\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char}]{\setlength{\rightskip}{0pt plus 5cm}char S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Char (
     43\begin{DoxyParamCaption}
     44\item[{S\-D\-L\-\_\-\-R\-Wops $\ast$}]{rw, }
     45\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer}
     46\end{DoxyParamCaption}
     47)}}\label{rwhelper_8c_a92794c04d5568bde0da9f3020d88f44c}
     48Reads a single character using the S\-D\-L\-\_\-\-R\-Wops object pointed to by {\ttfamily rw}. This function reads data in blocks and stores them in the buffer pointed to by {\ttfamily buffer}, so other S\-D\-L\-\_\-\-R\-Wops functions should not be used in conjunction with this function.
     49
     50\begin{DoxyReturn}{Returns}
     51The character that was read. 
     52\end{DoxyReturn}
     53\hypertarget{rwhelper_8c_af97cfdf8d58f716efa8fd9204666df12}{\index{rwhelper.\-c@{rwhelper.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line}}
     54\index{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line}!rwhelper.c@{rwhelper.\-c}}
     55\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Read\-Line (
     56\begin{DoxyParamCaption}
     57\item[{S\-D\-L\-\_\-\-R\-Wops $\ast$}]{rw, }
     58\item[{char $\ast$}]{str, }
     59\item[{int}]{size, }
     60\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer, }
     61\item[{char}]{comment\-\_\-char}
     62\end{DoxyParamCaption}
     63)}}\label{rwhelper_8c_af97cfdf8d58f716efa8fd9204666df12}
     64Reads characters using the S\-D\-L\-\_\-\-R\-Wops object pointed to by {\ttfamily rw} into the character array pointed to by {\ttfamily str} (of size {\ttfamily size}) until either the array is full or a new line is encountered. If {\ttfamily comment\-\_\-char} is encountered, all characters from that position till the end of the line are ignored. The new line is not included as part of the buffer. Lines with only whitespace and comments are ignored. This function reads data in blocks and stores them in the buffer pointed to by {\ttfamily buffer}, so other S\-D\-L\-\_\-\-R\-Wops functions should not be used in conjunction with this function.
     65
     66\begin{DoxyReturn}{Returns}
     67pointer to the string on success, N\-U\-L\-L on failure or E\-O\-F. 
     68\end{DoxyReturn}
     69\hypertarget{rwhelper_8c_aa7878508e6d851b11dc1d1186324064a}{\index{rwhelper.\-c@{rwhelper.\-c}!S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer}}
     70\index{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer@{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer}!rwhelper.c@{rwhelper.\-c}}
     71\subsubsection[{S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer}]{\setlength{\rightskip}{0pt plus 5cm}void S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Reset\-Buffer (
     72\begin{DoxyParamCaption}
     73\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer}
     74\end{DoxyParamCaption}
     75)}}\label{rwhelper_8c_aa7878508e6d851b11dc1d1186324064a}
     76Resets the buffer pointed to by {\ttfamily buffer} used by some of the helper functions. This function should be called when you're using one of the helper functions with a new S\-D\-L\-\_\-\-R\-Wops object.