Skip to content

Latest commit

 

History

History
executable file
·
76 lines (69 loc) · 6.77 KB

rwhelper_8c.tex

File metadata and controls

executable file
·
76 lines (69 loc) · 6.77 KB
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
\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.