| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/gtk-doc/html/camel/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CamelStreamBuffer</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Camel Reference Manual">
<link rel="up" href="Streams.html" title="Streams">
<link rel="prev" href="camel-CamelSeekableSubstream.html" title="CamelSeekableSubstream">
<link rel="next" href="camel-CamelStreamFilter.html" title="CamelStreamFilter">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="classes.html" title="Part I. Camel Classes">
<link rel="chapter" href="ClassTree.html" title="Class Hierarchy">
<link rel="chapter" href="Fundamentals.html" title="Fundamentals">
<link rel="chapter" href="Streams.html" title="Streams">
<link rel="chapter" href="StreamFilters.html" title="Stream Filters">
<link rel="chapter" href="Services.html" title="Services">
<link rel="chapter" href="Filters.html" title="Filters">
<link rel="chapter" href="Folders.html" title="Folders">
<link rel="chapter" href="SearchFolders.html" title="Search Folders">
<link rel="chapter" href="Addresses.html" title="Addresses">
<link rel="chapter" href="Crypto.html" title="Crypto Contexts">
<link rel="chapter" href="MIME.html" title="MIME Objects">
<link rel="chapter" href="Storage.html" title="Metadata Storage">
<link rel="chapter" href="Utilities.html" title="Utilities">
<link rel="chapter" href="Deprecated.html" title="Deprecated Objects">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="camel-CamelSeekableSubstream.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="Streams.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Camel Reference Manual</th>
<td><a accesskey="n" href="camel-CamelStreamFilter.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#camel-CamelStreamBuffer.synopsis" class="shortcut">Top</a>
|
<a href="#camel-CamelStreamBuffer.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="CamelStreamBuffer">
<a name="camel-CamelStreamBuffer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="camel-CamelStreamBuffer.top_of_page"></a>CamelStreamBuffer</span></h2>
<p>CamelStreamBuffer</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="camel-CamelStreamBuffer.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
struct <a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer">CamelStreamBuffer</a>;
enum <a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBufferMode" title="enum CamelStreamBufferMode">CamelStreamBufferMode</a>;
<a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> * <a class="link" href="camel-CamelStreamBuffer.html#camel-stream-buffer-new" title="camel_stream_buffer_new ()">camel_stream_buffer_new</a> (<a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> *stream,
<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBufferMode" title="enum CamelStreamBufferMode">CamelStreamBufferMode</a> mode);
<a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> * <a class="link" href="camel-CamelStreamBuffer.html#camel-stream-buffer-new-with-vbuf" title="camel_stream_buffer_new_with_vbuf ()">camel_stream_buffer_new_with_vbuf</a> (<a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> *stream,
<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBufferMode" title="enum CamelStreamBufferMode">CamelStreamBufferMode</a> mode,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *buf,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"
>guint32</a> size);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> <a class="link" href="camel-CamelStreamBuffer.html#camel-stream-buffer-gets" title="camel_stream_buffer_gets ()">camel_stream_buffer_gets</a> (<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer">CamelStreamBuffer</a> *sbf,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *buf,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> max);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> * <a class="link" href="camel-CamelStreamBuffer.html#camel-stream-buffer-read-line" title="camel_stream_buffer_read_line ()">camel_stream_buffer_read_line</a> (<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer">CamelStreamBuffer</a> *sbf);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="camel-CamelStreamBuffer.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="camel-CamelStreamBuffer.details"></a><h2>Details</h2>
<div class="refsect2" title="struct CamelStreamBuffer">
<a name="CamelStreamBuffer"></a><h3>struct CamelStreamBuffer</h3>
<pre class="programlisting">struct CamelStreamBuffer {
CamelStream parent_object;
/* these are all of course, private */
CamelStream *stream;
guchar *buf, *ptr, *end;
gint size;
guchar *linebuf; /* for reading lines at a time */
gint linesize;
CamelStreamBufferMode mode;
guint flags; /* internal flags */
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="enum CamelStreamBufferMode">
<a name="CamelStreamBufferMode"></a><h3>enum CamelStreamBufferMode</h3>
<pre class="programlisting">typedef enum {
CAMEL_STREAM_BUFFER_BUFFER = 0,
CAMEL_STREAM_BUFFER_NONE,
CAMEL_STREAM_BUFFER_READ = 0x00,
CAMEL_STREAM_BUFFER_WRITE = 0x80,
CAMEL_STREAM_BUFFER_MODE = 0x80
} CamelStreamBufferMode;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="camel_stream_buffer_new ()">
<a name="camel-stream-buffer-new"></a><h3>camel_stream_buffer_new ()</h3>
<pre class="programlisting"><a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> * camel_stream_buffer_new (<a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> *stream,
<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBufferMode" title="enum CamelStreamBufferMode">CamelStreamBufferMode</a> mode);</pre>
<p>
Create a new buffered stream of another stream. A default
buffer size (1024 bytes), automatically managed will be used
for buffering.
</p>
<p>
See <a class="link" href="camel-CamelStreamBuffer.html#camel-stream-buffer-new-with-vbuf" title="camel_stream_buffer_new_with_vbuf ()"><span class="type">camel_stream_buffer_new_with_vbuf</span></a> for details on the
<em class="parameter"><code>mode</code></em> parameter.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td> a <a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream"><span class="type">CamelStream</span></a> object to buffer
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
<td> Operational mode of buffered stream.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created buffered stream.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="camel_stream_buffer_new_with_vbuf ()">
<a name="camel-stream-buffer-new-with-vbuf"></a><h3>camel_stream_buffer_new_with_vbuf ()</h3>
<pre class="programlisting"><a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> * camel_stream_buffer_new_with_vbuf (<a class="link" href="camel-CamelStream.html#CamelStream" title="struct CamelStream">CamelStream</a> *stream,
<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBufferMode" title="enum CamelStreamBufferMode">CamelStreamBufferMode</a> mode,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *buf,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"
>guint32</a> size);</pre>
<p>
Create a new stream which buffers another stream, <em class="parameter"><code>stream</code></em>.
</p>
<p>
The following values are available for <em class="parameter"><code>mode</code></em>:
</p>
<p>
<span class="type">CAMEL_STREAM_BUFFER_BUFFER</span>, Buffer the input/output in blocks.
<span class="type">CAMEL_STREAM_BUFFER_NEWLINE</span>, Buffer on newlines (for output).
<span class="type">CAMEL_STREAM_BUFFER_NONE</span>, Perform no buffering.
</p>
<p>
Note that currently this is ignored and <span class="type">CAMEL_STREAM_BUFFER_BUFFER</span>
is always used.
</p>
<p>
In addition, one of the following mode options should be or'd
together with the buffering mode:
</p>
<p>
<span class="type">CAMEL_STREAM_BUFFER_WRITE</span>, Buffer in write mode.
<span class="type">CAMEL_STREAM_BUFFER_READ</span>, Buffer in read mode.
</p>
<p>
Buffering can only be done in one direction for any
buffer instance.
</p>
<p>
If <em class="parameter"><code>buf</code></em> is non-NULL, then use the memory pointed to
(for upto <em class="parameter"><code>size</code></em> bytes) as the buffer for all buffering
operations. It is upto the application to free this buffer.
If <em class="parameter"><code>buf</code></em> is NULL, then allocate and manage <em class="parameter"><code>size</code></em> bytes
for all buffering.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>stream</code></em> :</span></p></td>
<td> An existing stream to buffer.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
<td> Mode to buffer in.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
<td> Memory to use for buffering.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> Size of buffer to use.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new stream with buffering applied.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="camel_stream_buffer_gets ()">
<a name="camel-stream-buffer-gets"></a><h3>camel_stream_buffer_gets ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a> camel_stream_buffer_gets (<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer">CamelStreamBuffer</a> *sbf,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> *buf,
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> max);</pre>
<p>
Read a line of characters up to the next newline character or
<em class="parameter"><code>max</code></em>-1 characters.
</p>
<p>
If the newline character is encountered, then it will be
included in the buffer <em class="parameter"><code>buf</code></em>. The buffer will be <span class="type">NUL</span> terminated.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sbf</code></em> :</span></p></td>
<td> a <a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer"><span class="type">CamelStreamBuffer</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
<td> Memory to write the string to.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
<td> Maxmimum number of characters to store.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the number of characters read, or <code class="literal">0</code> for end of file,
and <code class="literal">-1</code> on error.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="camel_stream_buffer_read_line ()">
<a name="camel-stream-buffer-read-line"></a><h3>camel_stream_buffer_read_line ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a> * camel_stream_buffer_read_line (<a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer">CamelStreamBuffer</a> *sbf);</pre>
<p>
This function reads a complete newline-terminated line from the stream
and returns it in allocated memory. The trailing newline (and carriage
return if any) are not included in the returned string.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sbf</code></em> :</span></p></td>
<td> a <a class="link" href="camel-CamelStreamBuffer.html#CamelStreamBuffer" title="struct CamelStreamBuffer"><span class="type">CamelStreamBuffer</span></a> object
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the line read, which the caller must free when done with,
or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on eof. If an error occurs, <em class="parameter"><code>ex</code></em> will be set.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.11</div>
</body>
</html>