rwhelper_8c.html (13588B)
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.4"/> 7<title>SDL Visual Test: C:/Users/DELL/Work/sdlvisualtest/visualtest/src/rwhelper.c File Reference</title> 8<link href="tabs.css" rel="stylesheet" type="text/css"/> 9<script type="text/javascript" src="jquery.js"></script> 10<script type="text/javascript" src="dynsections.js"></script> 11<link href="search/search.css" rel="stylesheet" type="text/css"/> 12<script type="text/javascript" src="search/search.js"></script> 13<script type="text/javascript"> 14 $(document).ready(function() { searchBox.OnSelectItem(0); }); 15</script> 16<link href="doxygen.css" rel="stylesheet" type="text/css" /> 17</head> 18<body> 19<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 20<div id="titlearea"> 21<table cellspacing="0" cellpadding="0"> 22 <tbody> 23 <tr style="height: 56px;"> 24 <td style="padding-left: 0.5em;"> 25 <div id="projectname">SDL Visual Test 26 </div> 27 </td> 28 </tr> 29 </tbody> 30</table> 31</div> 32<!-- end header part --> 33<!-- Generated by Doxygen 1.8.4 --> 34<script type="text/javascript"> 35var searchBox = new SearchBox("searchBox", "search",false,'Search'); 36</script> 37 <div id="navrow1" class="tabs"> 38 <ul class="tablist"> 39 <li><a href="index.html"><span>Main Page</span></a></li> 40 <li><a href="annotated.html"><span>Data Structures</span></a></li> 41 <li class="current"><a href="files.html"><span>Files</span></a></li> 42 <li> 43 <div id="MSearchBox" class="MSearchBoxInactive"> 44 <span class="left"> 45 <img id="MSearchSelect" src="search/mag_sel.png" 46 onmouseover="return searchBox.OnSearchSelectShow()" 47 onmouseout="return searchBox.OnSearchSelectHide()" 48 alt=""/> 49 <input type="text" id="MSearchField" value="Search" accesskey="S" 50 onfocus="searchBox.OnSearchFieldFocus(true)" 51 onblur="searchBox.OnSearchFieldFocus(false)" 52 onkeyup="searchBox.OnSearchFieldChange(event)"/> 53 </span><span class="right"> 54 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> 55 </span> 56 </div> 57 </li> 58 </ul> 59 </div> 60 <div id="navrow2" class="tabs2"> 61 <ul class="tablist"> 62 <li><a href="files.html"><span>File List</span></a></li> 63 <li><a href="globals.html"><span>Globals</span></a></li> 64 </ul> 65 </div> 66<!-- window showing the filter options --> 67<div id="MSearchSelectWindow" 68 onmouseover="return searchBox.OnSearchSelectShow()" 69 onmouseout="return searchBox.OnSearchSelectHide()" 70 onkeydown="return searchBox.OnSearchSelectKey(event)"> 71<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Pages</a></div> 72 73<!-- iframe showing the search results (closed by default) --> 74<div id="MSearchResultsWindow"> 75<iframe src="javascript:void(0)" frameborder="0" 76 name="MSearchResults" id="MSearchResults"> 77</iframe> 78</div> 79 80<div id="nav-path" class="navpath"> 81 <ul> 82<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul> 83</div> 84</div><!-- top --> 85<div class="header"> 86 <div class="summary"> 87<a href="#func-members">Functions</a> </div> 88 <div class="headertitle"> 89<div class="title">rwhelper.c File Reference</div> </div> 90</div><!--header--> 91<div class="contents"> 92<div class="textblock"><code>#include <SDL_test.h></code><br/> 93<code>#include "<a class="el" href="_s_d_l__visualtest__sut__configparser_8h_source.html">SDL_visualtest_sut_configparser.h</a>"</code><br/> 94<code>#include "SDL_visualtest_rwhelper.h"</code><br/> 95</div><table class="memberdecls"> 96<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 97Functions</h2></td></tr> 98<tr class="memitem:aa7878508e6d851b11dc1d1186324064a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="rwhelper_8c.html#aa7878508e6d851b11dc1d1186324064a">SDLVisualTest_RWHelperResetBuffer</a> (<a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> *buffer)</td></tr> 99<tr class="separator:aa7878508e6d851b11dc1d1186324064a"><td class="memSeparator" colspan="2"> </td></tr> 100<tr class="memitem:a92794c04d5568bde0da9f3020d88f44c"><td class="memItemLeft" align="right" valign="top">char </td><td class="memItemRight" valign="bottom"><a class="el" href="rwhelper_8c.html#a92794c04d5568bde0da9f3020d88f44c">SDLVisualTest_RWHelperReadChar</a> (SDL_RWops *rw, <a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> *buffer)</td></tr> 101<tr class="separator:a92794c04d5568bde0da9f3020d88f44c"><td class="memSeparator" colspan="2"> </td></tr> 102<tr class="memitem:af97cfdf8d58f716efa8fd9204666df12"><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="rwhelper_8c.html#af97cfdf8d58f716efa8fd9204666df12">SDLVisualTest_RWHelperReadLine</a> (SDL_RWops *rw, char *str, int size, <a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> *buffer, char comment_char)</td></tr> 103<tr class="separator:af97cfdf8d58f716efa8fd9204666df12"><td class="memSeparator" colspan="2"> </td></tr> 104<tr class="memitem:ac7f94417fa973af01a27452acd0043e8"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="rwhelper_8c.html#ac7f94417fa973af01a27452acd0043e8">SDLVisualTest_RWHelperCountNonEmptyLines</a> (SDL_RWops *rw, <a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> *buffer, char comment_char)</td></tr> 105<tr class="separator:ac7f94417fa973af01a27452acd0043e8"><td class="memSeparator" colspan="2"> </td></tr> 106</table> 107<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 108<div class="textblock"><p>Header file with some helper functions for working with SDL_RWops.</p> 109<p>Source file with some helper functions for working with SDL_RWops. </p> 110</div><h2 class="groupheader">Function Documentation</h2> 111<a class="anchor" id="ac7f94417fa973af01a27452acd0043e8"></a> 112<div class="memitem"> 113<div class="memproto"> 114 <table class="memname"> 115 <tr> 116 <td class="memname">int SDLVisualTest_RWHelperCountNonEmptyLines </td> 117 <td>(</td> 118 <td class="paramtype">SDL_RWops * </td> 119 <td class="paramname"><em>rw</em>, </td> 120 </tr> 121 <tr> 122 <td class="paramkey"></td> 123 <td></td> 124 <td class="paramtype"><a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> * </td> 125 <td class="paramname"><em>buffer</em>, </td> 126 </tr> 127 <tr> 128 <td class="paramkey"></td> 129 <td></td> 130 <td class="paramtype">char </td> 131 <td class="paramname"><em>comment_char</em> </td> 132 </tr> 133 <tr> 134 <td></td> 135 <td>)</td> 136 <td></td><td></td> 137 </tr> 138 </table> 139</div><div class="memdoc"> 140<p>Counts the number of lines that are not all whitespace and comments using the SDL_RWops object pointed to by <code>rw</code>. <code>comment_char</code> indicates the character used for comments. Uses the buffer pointed to by <code>buffer</code> to read data in blocks.</p> 141<dl class="section return"><dt>Returns</dt><dd>Number of lines on success, -1 on failure. </dd></dl> 142 143</div> 144</div> 145<a class="anchor" id="a92794c04d5568bde0da9f3020d88f44c"></a> 146<div class="memitem"> 147<div class="memproto"> 148 <table class="memname"> 149 <tr> 150 <td class="memname">char SDLVisualTest_RWHelperReadChar </td> 151 <td>(</td> 152 <td class="paramtype">SDL_RWops * </td> 153 <td class="paramname"><em>rw</em>, </td> 154 </tr> 155 <tr> 156 <td class="paramkey"></td> 157 <td></td> 158 <td class="paramtype"><a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> * </td> 159 <td class="paramname"><em>buffer</em> </td> 160 </tr> 161 <tr> 162 <td></td> 163 <td>)</td> 164 <td></td><td></td> 165 </tr> 166 </table> 167</div><div class="memdoc"> 168<p>Reads a single character using the SDL_RWops object pointed to by <code>rw</code>. This function reads data in blocks and stores them in the buffer pointed to by <code>buffer</code>, so other SDL_RWops functions should not be used in conjunction with this function.</p> 169<dl class="section return"><dt>Returns</dt><dd>The character that was read. </dd></dl> 170 171</div> 172</div> 173<a class="anchor" id="af97cfdf8d58f716efa8fd9204666df12"></a> 174<div class="memitem"> 175<div class="memproto"> 176 <table class="memname"> 177 <tr> 178 <td class="memname">char* SDLVisualTest_RWHelperReadLine </td> 179 <td>(</td> 180 <td class="paramtype">SDL_RWops * </td> 181 <td class="paramname"><em>rw</em>, </td> 182 </tr> 183 <tr> 184 <td class="paramkey"></td> 185 <td></td> 186 <td class="paramtype">char * </td> 187 <td class="paramname"><em>str</em>, </td> 188 </tr> 189 <tr> 190 <td class="paramkey"></td> 191 <td></td> 192 <td class="paramtype">int </td> 193 <td class="paramname"><em>size</em>, </td> 194 </tr> 195 <tr> 196 <td class="paramkey"></td> 197 <td></td> 198 <td class="paramtype"><a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> * </td> 199 <td class="paramname"><em>buffer</em>, </td> 200 </tr> 201 <tr> 202 <td class="paramkey"></td> 203 <td></td> 204 <td class="paramtype">char </td> 205 <td class="paramname"><em>comment_char</em> </td> 206 </tr> 207 <tr> 208 <td></td> 209 <td>)</td> 210 <td></td><td></td> 211 </tr> 212 </table> 213</div><div class="memdoc"> 214<p>Reads characters using the SDL_RWops object pointed to by <code>rw</code> into the character array pointed to by <code>str</code> (of size <code>size</code>) until either the array is full or a new line is encountered. If <code>comment_char</code> 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 <code>buffer</code>, so other SDL_RWops functions should not be used in conjunction with this function.</p> 215<dl class="section return"><dt>Returns</dt><dd>pointer to the string on success, NULL on failure or EOF. </dd></dl> 216 217</div> 218</div> 219<a class="anchor" id="aa7878508e6d851b11dc1d1186324064a"></a> 220<div class="memitem"> 221<div class="memproto"> 222 <table class="memname"> 223 <tr> 224 <td class="memname">void SDLVisualTest_RWHelperResetBuffer </td> 225 <td>(</td> 226 <td class="paramtype"><a class="el" href="struct_s_d_l_visual_test___r_w_helper_buffer.html">SDLVisualTest_RWHelperBuffer</a> * </td> 227 <td class="paramname"><em>buffer</em>)</td><td></td> 228 <td></td> 229 </tr> 230 </table> 231</div><div class="memdoc"> 232<p>Resets the buffer pointed to by <code>buffer</code> used by some of the helper functions. This function should be called when you're using one of the helper functions with a new SDL_RWops object. </p> 233 234</div> 235</div> 236</div><!-- contents --> 237<!-- start footer part --> 238<hr class="footer"/><address class="footer"><small> 239Generated on Thu Sep 26 2013 00:18:24 for SDL Visual Test by  <a href="http://www.doxygen.org/index.html"> 240<img class="footer" src="doxygen.png" alt="doxygen"/> 241</a> 1.8.4 242</small></address> 243</body> 244</html>