Files
pcp/man/html/pcpstream_8h_source.html

132 lines
16 KiB
HTML
Raw Normal View History

2014-02-20 20:09:24 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>libpcp: pcpstream.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">libpcp
&#160;<span id="projectnumber">0.2.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_76e3dfa7802a76391b3a5cc4012b4dd7.html">pcp</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">pcpstream.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> This file is part of Pretty Curved Privacy (pcp1).</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> Copyright (C) 2013-2014 T.v.Dein.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> This program is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> (at your option) any later version.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> This program is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> GNU General Public License for more details.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> You can contact me by mail: &lt;tom AT vondein DOT org&gt;.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef HAVE_PCP_PCPSTEAM_H</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define HAVE_PCP_PCPSTEAM_H</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;stdarg.h&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;mem.h&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;util.h&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;defines.h&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;buffer.h&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;</div>
2014-02-20 21:02:52 +01:00
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html"> 58</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">_pcp_stream_t</a> {</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#ab3be4b7b5c57f456ed996cb0b5d53f27"> 59</a></span>&#160; FILE *<a class="code" href="struct__pcp__stream__t.html#ab3be4b7b5c57f456ed996cb0b5d53f27" title="The backend FILE stream.">fd</a>; </div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#a320a3c593ebcf0a651700f9263e5d9b4"> 60</a></span>&#160; <a class="code" href="struct__pcp__buffer.html" title="A flexible buffer object wich automatically resizes, if neccessary.">Buffer</a> *<a class="code" href="struct__pcp__stream__t.html#a320a3c593ebcf0a651700f9263e5d9b4" title="The backend Buffer object.">b</a>; </div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#a5fc108c71fb18d9835f7083e1b2ff5fa"> 61</a></span>&#160; uint8_t <a class="code" href="struct__pcp__stream__t.html#a5fc108c71fb18d9835f7083e1b2ff5fa" title="Set to 1 if the backend is a Buffer.">is_buffer</a>; </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#a4b0242f83eec494ee19ad41e08e924af"> 62</a></span>&#160; uint8_t <a class="code" href="struct__pcp__stream__t.html#a4b0242f83eec494ee19ad41e08e924af" title="Set to 1 if EOF reached.">eof</a>; </div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#aaed1bd389ba84b3cd87839088b4057ea"> 63</a></span>&#160; uint8_t <a class="code" href="struct__pcp__stream__t.html#aaed1bd389ba84b3cd87839088b4057ea" title="Set to 1 if an error occured.">err</a>; </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;};</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="group__Pcpstream.html#gaec72241f86d5391d5cae7477c66cdd73"> 67</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">_pcp_stream_t</a> <a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="comment">/* initialize a new empty stream */</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *ps_init(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *<a class="code" href="group__Pcpstream.html#ga6733979d79704b2e3ce914662b0cebc8" title="Create a new stream, backed with an open file.">ps_new_file</a>(FILE *backendfd);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *<a class="code" href="group__Pcpstream.html#ga1b50c92fdad290e59317af2404460662" title="Create a new input stream, backed with filled a buffer.">ps_new_inbuffer</a>(<a class="code" href="struct__pcp__buffer.html" title="A flexible buffer object wich automatically resizes, if neccessary.">Buffer</a> *<a class="code" href="struct__pcp__stream__t.html#a320a3c593ebcf0a651700f9263e5d9b4" title="The backend Buffer object.">b</a>);</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *<a class="code" href="group__Pcpstream.html#ga13ec0245b579949e6d586e1817615d2e" title="Create a new output stream, backed with a buffer.">ps_new_outbuffer</a>();</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="group__Pcpstream.html#gacfede4b1e9fa1ce0ccd7a55379ff6f15" title="Read bytes into the given buffer from the current stream.">ps_read</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream, <span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> readbytes);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="group__Pcpstream.html#gab8e98ef81e802a242fbdb788b4387873" title="Write bytes from the given buffer into the current stream.">ps_write</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream, <span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> writebytes);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="group__Pcpstream.html#gafd50eb5e9c8ba399e133b6029eca8856" title="Write a formatted string to the stream.">ps_print</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream, <span class="keyword">const</span> <span class="keywordtype">char</span> * fmt, ...);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="group__Pcpstream.html#ga72812698d6b6aca964c7289be41eccf8" title="Tell the current read or write offset.">ps_tell</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<a class="code" href="struct__pcp__buffer.html" title="A flexible buffer object wich automatically resizes, if neccessary.">Buffer</a> *<a class="code" href="group__Pcpstream.html#ga64bc34dfbc1b3951c3d62e82a1ae8c34" title="Access the Buffer backend pointer.">ps_buffer</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream);</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__Pcpstream.html#ga4a68da22eca6e9bd854d54467a071d0a" title="Close the stream and frees allocated memory.">ps_close</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream);</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__Pcpstream.html#gac845e4dc3677aeef5e4de343d3f8033d" title="Check if EOF have been reached.">ps_end</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream);</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group__Pcpstream.html#ga97b83164ecda8fd66897863ec7976890" title="Check if an error occurred during a read or write operation.">ps_err</a>(<a class="code" href="struct__pcp__stream__t.html" title="An I/O wrapper object backed by a file or a buffer.">Pcpstream</a> *stream);</div>
2014-02-20 20:09:24 +01:00
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160;</div>
2014-02-20 21:02:52 +01:00
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;<span class="preprocessor">#endif // HAVE_PCP_PCPSTEAM_H</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;</div>
2014-02-20 20:09:24 +01:00
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
2014-02-20 21:02:52 +01:00
Generated on Thu Feb 20 2014 20:58:12 for libpcp by &#160;<a href="http://www.doxygen.org/index.html">
2014-02-20 20:09:24 +01:00
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.2
</small></address>
</body>
</html>