SDL/visualtest/docs/latex/rwhelper_8c.tex

76 lines
6.8 KiB
TeX
Raw Normal View History

2013-11-29 06:06:08 -07:00
\hypertarget{rwhelper_8c}{\section{C\-:/\-Users/\-D\-E\-L\-L/\-Work/sdlvisualtest/visualtest/src/rwhelper.c File Reference}
\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}}
}
{\ttfamily \#include $<$S\-D\-L\-\_\-test.\-h$>$}\\*
{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-sut\-\_\-configparser.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}S\-D\-L\-\_\-visualtest\-\_\-rwhelper.\-h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
void \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)
\item
char \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)
\item
char $\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)
\item
int \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)
\end{DoxyCompactItemize}
\subsection{Detailed Description}
Header file with some helper functions for working with S\-D\-L\-\_\-\-R\-Wops.
Source file with some helper functions for working with S\-D\-L\-\_\-\-R\-Wops.
\subsection{Function Documentation}
\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}}
\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}}
\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 (
\begin{DoxyParamCaption}
\item[{S\-D\-L\-\_\-\-R\-Wops $\ast$}]{rw, }
\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer, }
\item[{char}]{comment\-\_\-char}
\end{DoxyParamCaption}
)}}\label{rwhelper_8c_ac7f94417fa973af01a27452acd0043e8}
Counts 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.
\begin{DoxyReturn}{Returns}
Number of lines on success, -\/1 on failure.
\end{DoxyReturn}
\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}}
\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}}
\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 (
\begin{DoxyParamCaption}
\item[{S\-D\-L\-\_\-\-R\-Wops $\ast$}]{rw, }
\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer}
\end{DoxyParamCaption}
)}}\label{rwhelper_8c_a92794c04d5568bde0da9f3020d88f44c}
Reads 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.
\begin{DoxyReturn}{Returns}
The character that was read.
\end{DoxyReturn}
\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}}
\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}}
\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 (
\begin{DoxyParamCaption}
\item[{S\-D\-L\-\_\-\-R\-Wops $\ast$}]{rw, }
\item[{char $\ast$}]{str, }
\item[{int}]{size, }
\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer, }
\item[{char}]{comment\-\_\-char}
\end{DoxyParamCaption}
)}}\label{rwhelper_8c_af97cfdf8d58f716efa8fd9204666df12}
Reads 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.
\begin{DoxyReturn}{Returns}
pointer to the string on success, N\-U\-L\-L on failure or E\-O\-F.
\end{DoxyReturn}
\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}}
\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}}
\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 (
\begin{DoxyParamCaption}
\item[{{\bf S\-D\-L\-Visual\-Test\-\_\-\-R\-W\-Helper\-Buffer} $\ast$}]{buffer}
\end{DoxyParamCaption}
)}}\label{rwhelper_8c_aa7878508e6d851b11dc1d1186324064a}
Resets 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.