mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 12:00:56 +01:00
132 lines
16 KiB
HTML
132 lines
16 KiB
HTML
<!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
|
|
 <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 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 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> <span class="comment">/*</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <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> <span class="comment"></span></div>
|
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Copyright (C) 2013-2014 T.v.Dein.</span></div>
|
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span></div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <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> <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> <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> <span class="comment"> (at your option) any later version.</span></div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"></span></div>
|
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <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> <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> <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> <span class="comment"> GNU General Public License for more details.</span></div>
|
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"></span></div>
|
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <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> <span class="comment"> along with this program. If not, see <http://www.gnu.org/licenses/>.</span></div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"></span></div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> You can contact me by mail: <tom AT vondein DOT org>.</span></div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">*/</span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef HAVE_PCP_PCPSTEAM_H</span></div>
|
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <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> <span class="preprocessor"></span></div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <stdarg.h></span></div>
|
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <stdio.h></span></div>
|
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "mem.h"</span></div>
|
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "util.h"</span></div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "defines.h"</span></div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "buffer.h"</span></div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html"> 54</a></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> {</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#ab3be4b7b5c57f456ed996cb0b5d53f27"> 55</a></span>  FILE *<a class="code" href="struct__pcp__stream__t.html#ab3be4b7b5c57f456ed996cb0b5d53f27" title="The backend FILE stream.">fd</a>; </div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#a320a3c593ebcf0a651700f9263e5d9b4"> 56</a></span>  <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="l00057"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#a5fc108c71fb18d9835f7083e1b2ff5fa"> 57</a></span>  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="l00058"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#a4b0242f83eec494ee19ad41e08e924af"> 58</a></span>  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="l00059"></a><span class="lineno"><a class="code" href="struct__pcp__stream__t.html#aaed1bd389ba84b3cd87839088b4057ea"> 59</a></span>  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="l00060"></a><span class="lineno"> 60</span> };</div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="group__Pcpstream.html#gaec72241f86d5391d5cae7477c66cdd73"> 63</a></span> <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="l00064"></a><span class="lineno"> 64</span> </div>
|
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment">/* initialize a new empty stream */</span></div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <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="l00067"></a><span class="lineno"> 67</span> </div>
|
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <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="l00077"></a><span class="lineno"> 77</span> </div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <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="l00087"></a><span class="lineno"> 87</span> </div>
|
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <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="l00096"></a><span class="lineno"> 96</span> </div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <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="l00119"></a><span class="lineno"> 119</span> </div>
|
|
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <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="l00136"></a><span class="lineno"> 136</span> </div>
|
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <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="l00153"></a><span class="lineno"> 153</span> </div>
|
|
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <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="l00164"></a><span class="lineno"> 164</span> </div>
|
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <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="l00177"></a><span class="lineno"> 177</span> </div>
|
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <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="l00188"></a><span class="lineno"> 188</span> </div>
|
|
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span> <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="l00201"></a><span class="lineno"> 201</span> </div>
|
|
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span> <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>
|
|
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span> </div>
|
|
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div>
|
|
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span> <span class="preprocessor">#endif // HAVE_PCP_PCPSTEAM_H</span></div>
|
|
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="preprocessor"></span></div>
|
|
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Thu Feb 20 2014 19:59:14 for libpcp by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.2
|
|
</small></address>
|
|
</body>
|
|
</html>
|