<refentry id="xmlsec-buffered">
<refmeta>
<refentrytitle>buffered.h</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>XMLSEC Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>buffered.h</refname><refpurpose>The buffered transform.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>



struct      <link linkend="xmlSecBufferedTransform">xmlSecBufferedTransform</link>;
typedef     <link linkend="xmlSecBufferedTransformId">xmlSecBufferedTransformId</link>;
int         (<link linkend="xmlSecBufferedProcessMethod">*xmlSecBufferedProcessMethod</link>)  (<link linkend="xmlSecBufferedTransformPtr">xmlSecBufferedTransformPtr</link> transform,
                                             <link linkend="xmlBufferPtr">xmlBufferPtr</link> buffer);
int         <link linkend="xmlSecBufferedTransformRead">xmlSecBufferedTransformRead</link>     (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform,
                                             unsigned char *buf,
                                             <link linkend="size-t">size_t</link> size);
int         <link linkend="xmlSecBufferedTransformWrite">xmlSecBufferedTransformWrite</link>    (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform,
                                             unsigned char *buf,
                                             <link linkend="size-t">size_t</link> size);
int         <link linkend="xmlSecBufferedTransformFlush">xmlSecBufferedTransformFlush</link>    (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform);
void        <link linkend="xmlSecBufferedDestroy">xmlSecBufferedDestroy</link>           (<link linkend="xmlSecBufferedTransformPtr">xmlSecBufferedTransformPtr</link> buffered);
int         <link linkend="xmlSecBufferedProcess">xmlSecBufferedProcess</link>           (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform,
                                             <link linkend="xmlBufferPtr">xmlBufferPtr</link> buffer);
</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>

</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="xmlSecBufferedTransform">struct xmlSecBufferedTransform</title>
<programlisting>struct xmlSecBufferedTransform {	
    /* same as for xmlSecTransform but id type changed */
    xmlSecBufferedTransformId		id;    
    xmlSecTransformStatus		status;
    int					dontDestroy;
    void				*data;
    
    /* xmlSecBinTransform specific */
    int					encode;
    xmlSecBinTransformPtr		next;
    xmlSecBinTransformPtr		prev;   
    void				*binData;
    
    /* xmlSecBufferedTransform specific */
    xmlBufferPtr			buffer;
};
</programlisting>
<para>
The buffered transform.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="struct">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row>
<entry><link linkend="xmlSecBufferedTransformId">xmlSecBufferedTransformId</link> <structfield>id</structfield></entry>
<entry> the transform id (pointer to <link linkend="xmlSecBinTransformId">xmlSecBinTransformId</link>).
</entry>
</row>
<row>
<entry><link linkend="xmlSecTransformStatus">xmlSecTransformStatus</link> <structfield>status</structfield></entry>
<entry> the transform status (ok/fail/unknown).
</entry>
</row>
<row>
<entry>int <structfield>dontDestroy</structfield></entry>
<entry> the don't automatically destroy flag.
</entry>
</row>
<row>
<entry>void *<structfield>data</structfield></entry>
<entry> the pointer to transform specific data.
</entry>
</row>
<row>
<entry>int <structfield>encode</structfield></entry>
<entry> encode/decode (encrypt/decrypt) flag.
</entry>
</row>
<row>
<entry><link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> <structfield>next</structfield></entry>
<entry> next binary transform in the chain.
</entry>
</row>
<row>
<entry><link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> <structfield>prev</structfield></entry>
<entry> previous binary transform in the chain.
</entry>
</row>
<row>
<entry>void *<structfield>binData</structfield></entry>
<entry> the pointer to binary transform speific data.
</entry>
</row>
<row>
<entry><link linkend="xmlBufferPtr">xmlBufferPtr</link> <structfield>buffer</structfield></entry>
<entry> the internal buffer.
</entry>
</row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedTransformId">xmlSecBufferedTransformId</title>
<programlisting>typedef const struct _xmlSecBufferedTransformIdStruct	*xmlSecBufferedTransformId;
</programlisting>
<para>
The buffered transform id.</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedProcessMethod">xmlSecBufferedProcessMethod ()</title>
<programlisting>int         (*xmlSecBufferedProcessMethod)  (<link linkend="xmlSecBufferedTransformPtr">xmlSecBufferedTransformPtr</link> transform,
                                             <link linkend="xmlBufferPtr">xmlBufferPtr</link> buffer);</programlisting>
<para>
Processes the data in the buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the pointer to buffered transform.
</entry></row>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> the pointer to input/output buffer.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 in success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedTransformRead">xmlSecBufferedTransformRead ()</title>
<programlisting>int         xmlSecBufferedTransformRead     (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform,
                                             unsigned char *buf,
                                             <link linkend="size-t">size_t</link> size);</programlisting>
<para>
Reads the all data from previous transform and returns 
to the caller.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the pointer to a buffered transform.
</entry></row>
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
<entry> the output buffer.
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> the output buffer size.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>the number of bytes in the buffer or negative value
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedTransformWrite">xmlSecBufferedTransformWrite ()</title>
<programlisting>int         xmlSecBufferedTransformWrite    (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform,
                                             unsigned char *buf,
                                             <link linkend="size-t">size_t</link> size);</programlisting>
<para>
Adds the data to the internal buffer.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the poiter to a buffered transform.
</entry></row>
<row><entry align="right"><parameter>buf</parameter>&nbsp;:</entry>
<entry> the input data buffer.
</entry></row>
<row><entry align="right"><parameter>size</parameter>&nbsp;:</entry>
<entry> the input data size.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 if success or a negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedTransformFlush">xmlSecBufferedTransformFlush ()</title>
<programlisting>int         xmlSecBufferedTransformFlush    (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform);</programlisting>
<para>
Writes internal data to previous transform.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the pointer to a buffered transform.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 if success or negative value otherwise.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedDestroy">xmlSecBufferedDestroy ()</title>
<programlisting>void        xmlSecBufferedDestroy           (<link linkend="xmlSecBufferedTransformPtr">xmlSecBufferedTransformPtr</link> buffered);</programlisting>
<para>
Destroys the buffered transform.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>buffered</parameter>&nbsp;:</entry>
<entry> the pointer to a buffered transform.
</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="xmlSecBufferedProcess">xmlSecBufferedProcess ()</title>
<programlisting>int         xmlSecBufferedProcess           (<link linkend="xmlSecBinTransformPtr">xmlSecBinTransformPtr</link> transform,
                                             <link linkend="xmlBufferPtr">xmlBufferPtr</link> buffer);</programlisting>
<para>
Executes buffered transform.</para>
<para>

</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>transform</parameter>&nbsp;:</entry>
<entry> the pointer to a buffered transform.
</entry></row>
<row><entry align="right"><parameter>buffer</parameter>&nbsp;:</entry>
<entry> the buffered transform result,
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>number of bytes processed or a negative value
if an error occurs.
</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
