<refentry id="GMimeStream">
<refmeta>
<refentrytitle role="top_of_page" id="GMimeStream.top_of_page">GMimeStream</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  GMIME Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GMimeStream</refname>
<refpurpose>Abstract stream class</refpurpose>
</refnamediv>

<refsynopsisdiv id="GMimeStream.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>enum                <link linkend="GMimeSeekWhence">GMimeSeekWhence</link>;
                    <link linkend="GMimeStreamIOVector">GMimeStreamIOVector</link>;
                    <link linkend="GMimeStream-struct">GMimeStream</link>;
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-stream-construct">g_mime_stream_construct</link>             (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-stream-read">g_mime_stream_read</link>                  (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> *buf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> len</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-stream-write">g_mime_stream_write</link>                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *buf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> len</parameter>);
<link linkend="int"><returnvalue>int</returnvalue></link>                 <link linkend="g-mime-stream-flush">g_mime_stream_flush</link>                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-stream-seek">g_mime_stream_seek</link>                  (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> offset</parameter>,
                                                         <parameter><link linkend="GMimeSeekWhence"><type>GMimeSeekWhence</type></link> whence</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-stream-tell">g_mime_stream_tell</link>                  (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="int"><returnvalue>int</returnvalue></link>                 <link linkend="g-mime-stream-reset">g_mime_stream_reset</link>                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="g-mime-stream-eos">g_mime_stream_eos</link>                   (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="int"><returnvalue>int</returnvalue></link>                 <link linkend="g-mime-stream-close">g_mime_stream_close</link>                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="gint64"><returnvalue>gint64</returnvalue></link>              <link linkend="g-mime-stream-length">g_mime_stream_length</link>                (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);
<link linkend="GMimeStream"><returnvalue>GMimeStream</returnvalue></link> *       <link linkend="g-mime-stream-substream">g_mime_stream_substream</link>             (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="g-mime-stream-set-bounds">g_mime_stream_set_bounds</link>            (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-stream-write-string">g_mime_stream_write_string</link>          (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-stream-printf">g_mime_stream_printf</link>                (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *fmt</parameter>,
                                                         <parameter>...</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-stream-write-to-stream">g_mime_stream_write_to_stream</link>       (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *src</parameter>,
                                                         <parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *dest</parameter>);
<link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             <link linkend="g-mime-stream-writev">g_mime_stream_writev</link>                (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="GMimeStreamIOVector"><type>GMimeStreamIOVector</type></link> *vector</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> count</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GMimeStream.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GMimeStream
         +----<link linkend="GMimeStreamBuffer">GMimeStreamBuffer</link>
         +----<link linkend="GMimeStreamCat">GMimeStreamCat</link>
         +----<link linkend="GMimeStreamFile">GMimeStreamFile</link>
         +----<link linkend="GMimeStreamFilter">GMimeStreamFilter</link>
         +----<link linkend="GMimeStreamFs">GMimeStreamFs</link>
         +----<link linkend="GMimeStreamMem">GMimeStreamMem</link>
         +----<link linkend="GMimeStreamMmap">GMimeStreamMmap</link>
         +----<link linkend="GMimeStreamNull">GMimeStreamNull</link>
         +----<link linkend="GMimeStreamPipe">GMimeStreamPipe</link>
</synopsis>
</refsect1>

<refsect1 id="GMimeStream.description" role="desc">
<title role="desc.title">Description</title>
<para>
Streams are the fundamental method for reading and writing data
used by GMime. You'll probably notice that the basic API is similar
to that of the low-level Unix I/O layer (<link linkend="read"><function>read()</function></link>, <link linkend="write"><function>write()</function></link>, <link linkend="lseek"><function>lseek()</function></link>,
etc) with some additional nicities such as a printf-like function.
</para>
</refsect1>
<refsect1 id="GMimeStream.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GMimeSeekWhence" role="enum">
<title>enum GMimeSeekWhence</title>
<indexterm zone="GMimeSeekWhence"><primary>GMimeSeekWhence</primary></indexterm>
<programlisting>typedef enum {
	GMIME_STREAM_SEEK_SET = SEEK_SET,
	GMIME_STREAM_SEEK_CUR = SEEK_CUR,
	GMIME_STREAM_SEEK_END = SEEK_END
} GMimeSeekWhence;
</programlisting>
<para>
Relative seek position.
</para><variablelist role="enum">
<varlistentry id="GMIME-STREAM-SEEK-SET:CAPS" role="constant">
<term><literal>GMIME_STREAM_SEEK_SET</literal></term>
<listitem><simpara>Seek relative to the beginning of the stream.
</simpara></listitem>
</varlistentry>
<varlistentry id="GMIME-STREAM-SEEK-CUR:CAPS" role="constant">
<term><literal>GMIME_STREAM_SEEK_CUR</literal></term>
<listitem><simpara>Seek relative to the current position in the stream.
</simpara></listitem>
</varlistentry>
<varlistentry id="GMIME-STREAM-SEEK-END:CAPS" role="constant">
<term><literal>GMIME_STREAM_SEEK_END</literal></term>
<listitem><simpara>Seek relative to the end of the stream.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GMimeStreamIOVector" role="struct">
<title>GMimeStreamIOVector</title>
<indexterm zone="GMimeStreamIOVector"><primary>GMimeStreamIOVector</primary></indexterm>
<programlisting>typedef struct {
	void *data;
	size_t len;
} GMimeStreamIOVector;
</programlisting>
<para>
An I/O vector for use with <link linkend="g-mime-stream-writev"><function>g_mime_stream_writev()</function></link>.
</para><variablelist role="struct">
<varlistentry><term><link linkend="void"><type>void</type></link>&#160;*<structfield id="GMimeStreamIOVector.data">data</structfield>;</term>
<listitem><simpara>data to pass to the I/O function.
</simpara></listitem>
</varlistentry>
<varlistentry><term><link linkend="size-t"><type>size_t</type></link>&#160;<structfield id="GMimeStreamIOVector.len">len</structfield>;</term>
<listitem><simpara>length of the data, in bytes.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GMimeStream-struct" role="struct">
<title>GMimeStream</title>
<indexterm zone="GMimeStream-struct"><primary>GMimeStream</primary></indexterm>
<programlisting>typedef struct _GMimeStream GMimeStream;</programlisting>
<para>
Abstract I/O stream class.
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="g-mime-stream-construct" role="function">
<title>g_mime_stream_construct ()</title>
<indexterm zone="g-mime-stream-construct"><primary>g_mime_stream_construct</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_stream_construct             (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);</programlisting>
<para>
Initializes a new stream with bounds <parameter>start</parameter> and <parameter>end</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara>start boundary
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara>end boundary
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-read" role="function">
<title>g_mime_stream_read ()</title>
<indexterm zone="g-mime-stream-read"><primary>g_mime_stream_read</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_stream_read                  (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="char"><type>char</type></link> *buf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> len</parameter>);</programlisting>
<para>
Attempts to read up to <parameter>len</parameter> bytes from <parameter>stream</parameter> into <parameter>buf</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara>buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara>buffer length
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes read or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-write" role="function">
<title>g_mime_stream_write ()</title>
<indexterm zone="g-mime-stream-write"><primary>g_mime_stream_write</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_stream_write                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *buf</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> len</parameter>);</programlisting>
<para>
Attempts to write up to <parameter>len</parameter> bytes of <parameter>buf</parameter> to <parameter>stream</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buf</parameter>&#160;:</term>
<listitem><simpara>buffer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&#160;:</term>
<listitem><simpara>buffer length
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes written or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-flush" role="function">
<title>g_mime_stream_flush ()</title>
<indexterm zone="g-mime-stream-flush"><primary>g_mime_stream_flush</primary></indexterm>
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link>                 g_mime_stream_flush                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Sync's the stream to disk.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="0:CAPS"><literal>0</literal></link> on success or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-seek" role="function">
<title>g_mime_stream_seek ()</title>
<indexterm zone="g-mime-stream-seek"><primary>g_mime_stream_seek</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_stream_seek                  (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> offset</parameter>,
                                                         <parameter><link linkend="GMimeSeekWhence"><type>GMimeSeekWhence</type></link> whence</parameter>);</programlisting>
<para>
Repositions the offset of the stream <parameter>stream</parameter> to
the argument <parameter>offset</parameter> according to the
directive <parameter>whence</parameter> as follows:
</para>
<para>
    <link linkend="GMIME-STREAM-SEEK-SET:CAPS"><type>GMIME_STREAM_SEEK_SET</type></link>: Seek <parameter>offset</parameter> bytes relative to
    the beginning (bound_start) of the stream.
</para>
<para>
    <link linkend="GMIME-STREAM-SEEK-CUR:CAPS"><type>GMIME_STREAM_SEEK_CUR</type></link>: Seek <parameter>offset</parameter> bytes relative to the
    current offset of the stream.
</para>
<para>
    <link linkend="GMIME-STREAM-SEEK-END:CAPS"><type>GMIME_STREAM_SEEK_END</type></link>: Seek <parameter>offset</parameter> bytes relative to the
    end of the stream (bound_end if non-negative).
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>offset</parameter>&#160;:</term>
<listitem><simpara>positional offset
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>whence</parameter>&#160;:</term>
<listitem><simpara>seek directive
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the resultant position on success or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-tell" role="function">
<title>g_mime_stream_tell ()</title>
<indexterm zone="g-mime-stream-tell"><primary>g_mime_stream_tell</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_stream_tell                  (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Gets the current offset within the stream.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the current position within the stream or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-reset" role="function">
<title>g_mime_stream_reset ()</title>
<indexterm zone="g-mime-stream-reset"><primary>g_mime_stream_reset</primary></indexterm>
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link>                 g_mime_stream_reset                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Resets the stream.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="0:CAPS"><literal>0</literal></link> on success or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-eos" role="function">
<title>g_mime_stream_eos ()</title>
<indexterm zone="g-mime-stream-eos"><primary>g_mime_stream_eos</primary></indexterm>
<programlisting><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            g_mime_stream_eos                   (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Tests the end-of-stream indicator for <parameter>stream</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> on EOS or <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-close" role="function">
<title>g_mime_stream_close ()</title>
<indexterm zone="g-mime-stream-close"><primary>g_mime_stream_close</primary></indexterm>
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link>                 g_mime_stream_close                 (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Closes the stream.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="0:CAPS"><literal>0</literal></link> on success or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-length" role="function">
<title>g_mime_stream_length ()</title>
<indexterm zone="g-mime-stream-length"><primary>g_mime_stream_length</primary></indexterm>
<programlisting><link linkend="gint64"><returnvalue>gint64</returnvalue></link>              g_mime_stream_length                (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>);</programlisting>
<para>
Gets the length of the stream.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the length of the stream or <link linkend="1:CAPS"><literal>-1</literal></link> if unknown.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-substream" role="function">
<title>g_mime_stream_substream ()</title>
<indexterm zone="g-mime-stream-substream"><primary>g_mime_stream_substream</primary></indexterm>
<programlisting><link linkend="GMimeStream"><returnvalue>GMimeStream</returnvalue></link> *       g_mime_stream_substream             (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);</programlisting>
<para>
Creates a new substream of <parameter>stream</parameter> with bounds <parameter>start</parameter> and <parameter>end</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara>start boundary
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara>end boundary
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a substream of <parameter>stream</parameter> with bounds <parameter>start</parameter> and <parameter>end</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-set-bounds" role="function">
<title>g_mime_stream_set_bounds ()</title>
<indexterm zone="g-mime-stream-set-bounds"><primary>g_mime_stream_set_bounds</primary></indexterm>
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link>                g_mime_stream_set_bounds            (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> start</parameter>,
                                                         <parameter><link linkend="gint64"><type>gint64</type></link> end</parameter>);</programlisting>
<para>
Set the bounds on a stream.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start</parameter>&#160;:</term>
<listitem><simpara>start boundary
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end</parameter>&#160;:</term>
<listitem><simpara>end boundary
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-write-string" role="function">
<title>g_mime_stream_write_string ()</title>
<indexterm zone="g-mime-stream-write-string"><primary>g_mime_stream_write_string</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_stream_write_string          (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *str</parameter>);</programlisting>
<para>
Writes <parameter>string</parameter> to <parameter>stream</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>str</parameter>&#160;:</term>
<listitem><simpara>string to write
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes written or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-printf" role="function">
<title>g_mime_stream_printf ()</title>
<indexterm zone="g-mime-stream-printf"><primary>g_mime_stream_printf</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_stream_printf                (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter>const <link linkend="char"><type>char</type></link> *fmt</parameter>,
                                                         <parameter>...</parameter>);</programlisting>
<para>
Write formatted output to a stream.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fmt</parameter>&#160;:</term>
<listitem><simpara>format
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara>arguments
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes written or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-write-to-stream" role="function">
<title>g_mime_stream_write_to_stream ()</title>
<indexterm zone="g-mime-stream-write-to-stream"><primary>g_mime_stream_write_to_stream</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_stream_write_to_stream       (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *src</parameter>,
                                                         <parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *dest</parameter>);</programlisting>
<para>
Attempts to write the source stream to the destination stream.
</para><variablelist role="params">
<varlistentry><term><parameter>src</parameter>&#160;:</term>
<listitem><simpara>source stream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dest</parameter>&#160;:</term>
<listitem><simpara>destination stream
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes written or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-mime-stream-writev" role="function">
<title>g_mime_stream_writev ()</title>
<indexterm zone="g-mime-stream-writev"><primary>g_mime_stream_writev</primary></indexterm>
<programlisting><link linkend="ssize-t"><returnvalue>ssize_t</returnvalue></link>             g_mime_stream_writev                (<parameter><link linkend="GMimeStream"><type>GMimeStream</type></link> *stream</parameter>,
                                                         <parameter><link linkend="GMimeStreamIOVector"><type>GMimeStreamIOVector</type></link> *vector</parameter>,
                                                         <parameter><link linkend="size-t"><type>size_t</type></link> count</parameter>);</programlisting>
<para>
Writes at most <parameter>count</parameter> blocks described by <parameter>vector</parameter> to <parameter>stream</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>stream</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStream"><type>GMimeStream</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>vector</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GMimeStreamIOVector"><type>GMimeStreamIOVector</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>count</parameter>&#160;:</term>
<listitem><simpara>number of vector elements
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the number of bytes written or <link linkend="1:CAPS"><literal>-1</literal></link> on fail.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

</refentry>
