xmlsec1/docs/api/xmlsec-buffer.html

962 lines
39 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>buffer: XML Security Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="XML Security Library Reference Manual">
<link rel="up" href="xmlsec-ref.html" title="XML Security Core Library API Reference.">
<link rel="prev" href="xmlsec-bn.html" title="bn">
<link rel="next" href="xmlsec-dl.html" title="dl">
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#xmlsec-buffer.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="xmlsec-ref.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="xmlsec-bn.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="xmlsec-dl.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="xmlsec-buffer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="xmlsec-buffer.top_of_page"></a>buffer</span></h2>
<p>buffer — Binary memory buffer functions.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="xmlsec-buffer.stability-level"></a><h2>Stability Level</h2>
<a href="http://foldoc.org/Stable"><span class="acronym">Stable</span></a>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="xmlsec-buffer.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="function_type">
<font><span class="returnvalue">void</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferSetDefaultAllocMode" title="xmlSecBufferSetDefaultAllocMode ()">xmlSecBufferSetDefaultAllocMode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="returnvalue">xmlSecBufferPtr</span></a>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferCreate" title="xmlSecBufferCreate ()">xmlSecBufferCreate</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">void</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferDestroy" title="xmlSecBufferDestroy ()">xmlSecBufferDestroy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferInitialize" title="xmlSecBufferInitialize ()">xmlSecBufferInitialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">void</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferFinalize" title="xmlSecBufferFinalize ()">xmlSecBufferFinalize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="xmlsec-xmlsec.html#xmlSecByte" title="xmlSecByte"><span class="returnvalue">xmlSecByte</span></a> *
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferGetData" title="xmlSecBufferGetData ()">xmlSecBufferGetData</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferSetData" title="xmlSecBufferSetData ()">xmlSecBufferSetData</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="returnvalue">xmlSecSize</span></a>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferGetSize" title="xmlSecBufferGetSize ()">xmlSecBufferGetSize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferSetSize" title="xmlSecBufferSetSize ()">xmlSecBufferSetSize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="returnvalue">xmlSecSize</span></a>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferGetMaxSize" title="xmlSecBufferGetMaxSize ()">xmlSecBufferGetMaxSize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferSetMaxSize" title="xmlSecBufferSetMaxSize ()">xmlSecBufferSetMaxSize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">void</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferEmpty" title="xmlSecBufferEmpty ()">xmlSecBufferEmpty</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferAppend" title="xmlSecBufferAppend ()">xmlSecBufferAppend</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferPrepend" title="xmlSecBufferPrepend ()">xmlSecBufferPrepend</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferRemoveHead" title="xmlSecBufferRemoveHead ()">xmlSecBufferRemoveHead</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferRemoveTail" title="xmlSecBufferRemoveTail ()">xmlSecBufferRemoveTail</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferReadFile" title="xmlSecBufferReadFile ()">xmlSecBufferReadFile</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferBase64NodeContentRead" title="xmlSecBufferBase64NodeContentRead ()">xmlSecBufferBase64NodeContentRead</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">int</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferBase64NodeContentWrite" title="xmlSecBufferBase64NodeContentWrite ()">xmlSecBufferBase64NodeContentWrite</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<font><span class="returnvalue">xmlOutputBufferPtr</span></font>
</td>
<td class="function_name">
<a class="link" href="xmlsec-buffer.html#xmlSecBufferCreateOutputBuffer" title="xmlSecBufferCreateOutputBuffer ()">xmlSecBufferCreateOutputBuffer</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="xmlsec-buffer.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="xmlsec-buffer.html#xmlSecAllocMode" title="enum xmlSecAllocMode">xmlSecAllocMode</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer">xmlSecBuffer</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="xmlsec-buffer.description"></a><h2>Description</h2>
<p></p>
</div>
<div class="refsect1">
<a name="xmlsec-buffer.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="xmlSecBufferSetDefaultAllocMode"></a><h3>xmlSecBufferSetDefaultAllocMode ()</h3>
<pre class="programlisting"><font><span class="returnvalue">void</span></font>
xmlSecBufferSetDefaultAllocMode (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecAllocMode" title="enum xmlSecAllocMode"><span class="type">xmlSecAllocMode</span></a> defAllocMode</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> defInitialSize</code></em>);</pre>
<p>Sets new global default allocation mode and minimal intial size.</p>
<div class="refsect3">
<a name="xmlSecBufferSetDefaultAllocMode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>defAllocMode</p></td>
<td class="parameter_description"><p>the new default buffer allocation mode.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>defInitialSize</p></td>
<td class="parameter_description"><p>the new default buffer minimal intial size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferCreate"></a><h3>xmlSecBufferCreate ()</h3>
<pre class="programlisting"><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="returnvalue">xmlSecBufferPtr</span></a>
xmlSecBufferCreate (<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Allocates and initializes new memory buffer with given size.
Caller is responsible for calling <a class="link" href="xmlsec-buffer.html#xmlSecBufferDestroy" title="xmlSecBufferDestroy ()"><span class="type">xmlSecBufferDestroy</span></a> function
to free the buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferCreate.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the intial size.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferCreate.returns"></a><h4>Returns</h4>
<p> pointer to newly allocated buffer or NULL if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferDestroy"></a><h3>xmlSecBufferDestroy ()</h3>
<pre class="programlisting"><font><span class="returnvalue">void</span></font>
xmlSecBufferDestroy (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Destroys buffer object created with <a class="link" href="xmlsec-buffer.html#xmlSecBufferCreate" title="xmlSecBufferCreate ()"><span class="type">xmlSecBufferCreate</span></a> function.</p>
<div class="refsect3">
<a name="xmlSecBufferDestroy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferInitialize"></a><h3>xmlSecBufferInitialize ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferInitialize (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Initializes buffer object <em class="parameter"><code>buf</code></em>
. Caller is responsible for calling
<a class="link" href="xmlsec-buffer.html#xmlSecBufferFinalize" title="xmlSecBufferFinalize ()"><span class="type">xmlSecBufferFinalize</span></a> function to free allocated resources.</p>
<div class="refsect3">
<a name="xmlSecBufferInitialize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the initial buffer size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferInitialize.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferFinalize"></a><h3>xmlSecBufferFinalize ()</h3>
<pre class="programlisting"><font><span class="returnvalue">void</span></font>
xmlSecBufferFinalize (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Frees allocated resource for a buffer initialized with <a class="link" href="xmlsec-buffer.html#xmlSecBufferInitialize" title="xmlSecBufferInitialize ()"><span class="type">xmlSecBufferInitialize</span></a>
function.</p>
<div class="refsect3">
<a name="xmlSecBufferFinalize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferGetData"></a><h3>xmlSecBufferGetData ()</h3>
<pre class="programlisting"><a class="link" href="xmlsec-xmlsec.html#xmlSecByte" title="xmlSecByte"><span class="returnvalue">xmlSecByte</span></a> *
xmlSecBufferGetData (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Gets pointer to buffer's data.</p>
<div class="refsect3">
<a name="xmlSecBufferGetData.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferGetData.returns"></a><h4>Returns</h4>
<p> pointer to buffer's data.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferSetData"></a><h3>xmlSecBufferSetData ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferSetData (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code>const <a class="link" href="xmlsec-xmlsec.html#xmlSecByte" title="xmlSecByte"><span class="type">xmlSecByte</span></a> *data</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Sets the value of the buffer to <em class="parameter"><code>data</code></em>
.</p>
<div class="refsect3">
<a name="xmlSecBufferSetData.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the data size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferSetData.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferGetSize"></a><h3>xmlSecBufferGetSize ()</h3>
<pre class="programlisting"><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="returnvalue">xmlSecSize</span></a>
xmlSecBufferGetSize (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Gets the current buffer data size.</p>
<div class="refsect3">
<a name="xmlSecBufferGetSize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferGetSize.returns"></a><h4>Returns</h4>
<p> the current data size.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferSetSize"></a><h3>xmlSecBufferSetSize ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferSetSize (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Sets new buffer data size. If necessary, buffer grows to
have at least <em class="parameter"><code>size</code></em>
bytes.</p>
<div class="refsect3">
<a name="xmlSecBufferSetSize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the new data size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferSetSize.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferGetMaxSize"></a><h3>xmlSecBufferGetMaxSize ()</h3>
<pre class="programlisting"><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="returnvalue">xmlSecSize</span></a>
xmlSecBufferGetMaxSize (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Gets the maximum (allocated) buffer size.</p>
<div class="refsect3">
<a name="xmlSecBufferGetMaxSize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferGetMaxSize.returns"></a><h4>Returns</h4>
<p> the maximum (allocated) buffer size.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferSetMaxSize"></a><h3>xmlSecBufferSetMaxSize ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferSetMaxSize (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Sets new buffer maximum size. If necessary, buffer grows to
have at least <em class="parameter"><code>size</code></em>
bytes.</p>
<div class="refsect3">
<a name="xmlSecBufferSetMaxSize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the new maximum size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferSetMaxSize.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferEmpty"></a><h3>xmlSecBufferEmpty ()</h3>
<pre class="programlisting"><font><span class="returnvalue">void</span></font>
xmlSecBufferEmpty (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Empties the buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferEmpty.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferAppend"></a><h3>xmlSecBufferAppend ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferAppend (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code>const <a class="link" href="xmlsec-xmlsec.html#xmlSecByte" title="xmlSecByte"><span class="type">xmlSecByte</span></a> *data</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Appends the <em class="parameter"><code>data</code></em>
after the current data stored in the buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferAppend.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the data size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferAppend.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferPrepend"></a><h3>xmlSecBufferPrepend ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferPrepend (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code>const <a class="link" href="xmlsec-xmlsec.html#xmlSecByte" title="xmlSecByte"><span class="type">xmlSecByte</span></a> *data</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Prepends the <em class="parameter"><code>data</code></em>
before the current data stored in the buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferPrepend.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the data size.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferPrepend.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferRemoveHead"></a><h3>xmlSecBufferRemoveHead ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferRemoveHead (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Removes <em class="parameter"><code>size</code></em>
bytes from the beginning of the current buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferRemoveHead.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the number of bytes to be removed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferRemoveHead.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferRemoveTail"></a><h3>xmlSecBufferRemoveTail ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferRemoveTail (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> size</code></em>);</pre>
<p>Removes <em class="parameter"><code>size</code></em>
bytes from the end of current buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferRemoveTail.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>size</p></td>
<td class="parameter_description"><p>the number of bytes to be removed.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferRemoveTail.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferReadFile"></a><h3>xmlSecBufferReadFile ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferReadFile (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code>const <font><span class="type">char</span></font> *filename</code></em>);</pre>
<p>Reads the content of the file <em class="parameter"><code>filename</code></em>
in the buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferReadFile.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>the filename.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferReadFile.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferBase64NodeContentRead"></a><h3>xmlSecBufferBase64NodeContentRead ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferBase64NodeContentRead (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><font><span class="type">xmlNodePtr</span></font> node</code></em>);</pre>
<p>Reads the content of the <em class="parameter"><code>node</code></em>
, base64 decodes it and stores the
result in the buffer.</p>
<div class="refsect3">
<a name="xmlSecBufferBase64NodeContentRead.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>node</p></td>
<td class="parameter_description"><p>the pointer to node.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferBase64NodeContentRead.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferBase64NodeContentWrite"></a><h3>xmlSecBufferBase64NodeContentWrite ()</h3>
<pre class="programlisting"><font><span class="returnvalue">int</span></font>
xmlSecBufferBase64NodeContentWrite (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>,
<em class="parameter"><code><font><span class="type">xmlNodePtr</span></font> node</code></em>,
<em class="parameter"><code><font><span class="type">int</span></font> columns</code></em>);</pre>
<p>Sets the content of the <em class="parameter"><code>node</code></em>
to the base64 encoded buffer data.</p>
<div class="refsect3">
<a name="xmlSecBufferBase64NodeContentWrite.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer object.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>node</p></td>
<td class="parameter_description"><p>the pointer to a node.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>columns</p></td>
<td class="parameter_description"><p>the max line size for base64 encoded data.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferBase64NodeContentWrite.returns"></a><h4>Returns</h4>
<p> 0 on success or a negative value if an error occurs.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBufferCreateOutputBuffer"></a><h3>xmlSecBufferCreateOutputBuffer ()</h3>
<pre class="programlisting"><font><span class="returnvalue">xmlOutputBufferPtr</span></font>
xmlSecBufferCreateOutputBuffer (<em class="parameter"><code><a class="link" href="xmlsec-buffer.html#xmlSecBuffer" title="struct xmlSecBuffer"><span class="type">xmlSecBufferPtr</span></a> buf</code></em>);</pre>
<p>Creates new LibXML output buffer to store data in the <em class="parameter"><code>buf</code></em>
. Caller is
responsible for destroying <em class="parameter"><code>buf</code></em>
when processing is done.</p>
<div class="refsect3">
<a name="xmlSecBufferCreateOutputBuffer.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>buf</p></td>
<td class="parameter_description"><p>the pointer to buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="xmlSecBufferCreateOutputBuffer.returns"></a><h4>Returns</h4>
<p> pointer to newly allocated output buffer or NULL if an error
occurs.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="xmlsec-buffer.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="xmlSecAllocMode"></a><h3>enum xmlSecAllocMode</h3>
<p>The memory allocation mode (used by <em class="parameter"><code>xmlSecBuffer</code></em>
and <em class="parameter"><code>xmlSecList</code></em>
).</p>
<div class="refsect3">
<a name="xmlSecAllocMode.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="xmlSecAllocModeExact"></a>xmlSecAllocModeExact</p></td>
<td class="enum_member_description"><p>the memory allocation mode that minimizes total
allocated memory size.</p></td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="xmlSecAllocModeDouble"></a>xmlSecAllocModeDouble</p></td>
<td class="enum_member_description"><p>the memory allocation mode that tries to minimize
the number of malloc calls.</p></td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="xmlSecBuffer"></a><h3>struct xmlSecBuffer</h3>
<pre class="programlisting">struct xmlSecBuffer {
xmlSecByte* data;
xmlSecSize size;
xmlSecSize maxSize;
xmlSecAllocMode allocMode;
};
</pre>
<p>Binary data buffer.</p>
<div class="refsect3">
<a name="xmlSecBuffer.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col>
<col>
<col>
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a class="link" href="xmlsec-xmlsec.html#xmlSecByte" title="xmlSecByte"><span class="type">xmlSecByte</span></a> *<em class="structfield"><code><a name="xmlSecBuffer.data"></a>data</code></em>;</p></td>
<td class="struct_member_description"><p>the pointer to buffer data.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> <em class="structfield"><code><a name="xmlSecBuffer.size"></a>size</code></em>;</p></td>
<td class="struct_member_description"><p>the current data size.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="xmlsec-xmlsec.html#xmlSecSize" title="xmlSecSize"><span class="type">xmlSecSize</span></a> <em class="structfield"><code><a name="xmlSecBuffer.maxSize"></a>maxSize</code></em>;</p></td>
<td class="struct_member_description"><p>the max data size (allocated buffer size).</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><a class="link" href="xmlsec-buffer.html#xmlSecAllocMode" title="enum xmlSecAllocMode"><span class="type">xmlSecAllocMode</span></a> <em class="structfield"><code><a name="xmlSecBuffer.allocMode"></a>allocMode</code></em>;</p></td>
<td class="struct_member_description"><p>the buffer memory allocation mode.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.27</div>
</body>
</html>