mirror of https://github.com/Gnucash/gnucash
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
213 lines
8.2 KiB
213 lines
8.2 KiB
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>GsfBlob</title>
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
|
|
<link rel="start" href="index.html" title="GSF Reference Manual">
|
|
<link rel="up" href="parsers.html" title="Stream Parsers">
|
|
<link rel="prev" href="gsf-metadata.html" title="metadata">
|
|
<link rel="next" href="gsf-GsfClipData.html" title="GsfClipData">
|
|
<meta name="generator" content="GTK-Doc V1.4 (XML mode)">
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
<link rel="part" href="into.html" title="Part I. GSF Overview">
|
|
<link rel="part" href="api.html" title="Part II. API Reference">
|
|
<link rel="chapter" href="io.html" title="Basic Input/Output">
|
|
<link rel="chapter" href="sources.html" title="Stream Sources">
|
|
<link rel="chapter" href="parsers.html" title="Stream Parsers">
|
|
<link rel="chapter" href="misc.html" title="Miscellaneous">
|
|
<link rel="index" href="ix01.html" title="Index">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
|
|
<td><a accesskey="p" href="gsf-metadata.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
|
|
<td><a accesskey="u" href="parsers.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">GSF Reference Manual</th>
|
|
<td><a accesskey="n" href="gsf-GsfClipData.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
|
|
</tr></table>
|
|
<div class="refentry" lang="en">
|
|
<a name="gsf-GsfBlob"></a><div class="titlepage"></div>
|
|
<div class="refnamediv"><table width="100%"><tr>
|
|
<td valign="top">
|
|
<h2><span class="refentrytitle">GsfBlob</span></h2>
|
|
<p>GsfBlob — A generic, unstructured block of binary data</p>
|
|
</td>
|
|
<td valign="top" align="right"></td>
|
|
</tr></table></div>
|
|
<div class="refsynopsisdiv">
|
|
<h2>Synopsis</h2>
|
|
<pre class="synopsis">
|
|
|
|
|
|
|
|
<a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a>;
|
|
<a href="gsf-GsfBlob.html#GsfBlobClass">GsfBlobClass</a>;
|
|
<a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a>* <a href="gsf-GsfBlob.html#gsf-blob-new">gsf_blob_new</a> (gsize size,
|
|
gconstpointer data_to_copy,
|
|
GError **error);
|
|
gsize <a href="gsf-GsfBlob.html#gsf-blob-get-size">gsf_blob_get_size</a> (<a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a> *blob);
|
|
gconstpointer <a href="gsf-GsfBlob.html#gsf-blob-peek-data">gsf_blob_peek_data</a> (<a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a> *blob);
|
|
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2573238"></a><h2>Description</h2>
|
|
<p>
|
|
Some libgsf functions, in particular the <a href="gsf-metadata.html#GsfDocMetaData">metadata</a> functions, can generate
|
|
unstructured blocks of data, or <em class="firstterm">blobs</em>.
|
|
Libgsf represents these blobs using a
|
|
<code class="classname">GsfBlob</code> object.
|
|
</p>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2573266"></a><h2>Details</h2>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2573272"></a><h3>
|
|
<a name="GsfBlob"></a>GsfBlob</h3>
|
|
<a class="indexterm" name="id2573282"></a><pre class="programlisting">typedef struct {
|
|
GObject object;
|
|
GsfBlobPrivate *priv;
|
|
} GsfBlob;
|
|
</pre>
|
|
<p>
|
|
Represents an unstructured block of binary data, that is, a
|
|
sequence of bytes and an integer specifying the size of the
|
|
sequence.
|
|
</p>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2573300"></a><h3>
|
|
<a name="GsfBlobClass"></a>GsfBlobClass</h3>
|
|
<a class="indexterm" name="id2573310"></a><pre class="programlisting">typedef struct {
|
|
GObjectClass parent_class;
|
|
} GsfBlobClass;
|
|
</pre>
|
|
<p>
|
|
|
|
</p>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2573326"></a><h3>
|
|
<a name="gsf-blob-new"></a>gsf_blob_new ()</h3>
|
|
<a class="indexterm" name="id2573337"></a><pre class="programlisting"><a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a>* gsf_blob_new (gsize size,
|
|
gconstpointer data_to_copy,
|
|
GError **error);</pre>
|
|
<p>
|
|
Creates a new <a href="gsf-GsfBlob.html#GsfBlob"><span class="type">GsfBlob</span></a> object to hold the specified data. The blob can then
|
|
be used as a facility for reference-counting for the data. The data is
|
|
copied internally, so the blob does not hold references to external chunks
|
|
of memory.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>size</code></em> :</span></td>
|
|
<td> Size of the data in bytes.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>data_to_copy</code></em> :</span></td>
|
|
<td> Data which will be copied into the blob, or <code class="literal">NULL</code> if <em class="parameter"><code>size</code></em> is zero.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
|
|
<td> location to store error, or <code class="literal">NULL</code>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> A newly-created <a href="gsf-GsfBlob.html#GsfBlob"><span class="type">GsfBlob</span></a>, or <code class="literal">NULL</code> if the data could not be copied.
|
|
|
|
Error domain: <a href="gsf-utils.html#GSF-ERROR:CAPS"><span class="type">GSF_ERROR</span></a>
|
|
|
|
Possible errors: <span class="type">GSF_ERROR_OUT_OF_MEMORY</span> if the <em class="parameter"><code>data_to_copy</code></em> could not be copied.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2573513"></a><h3>
|
|
<a name="gsf-blob-get-size"></a>gsf_blob_get_size ()</h3>
|
|
<a class="indexterm" name="id2573524"></a><pre class="programlisting">gsize gsf_blob_get_size (<a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a> *blob);</pre>
|
|
<p>
|
|
Queries the size in bytes of the data stored in the blob.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>blob</code></em> :</span></td>
|
|
<td> A <a href="gsf-GsfBlob.html#GsfBlob"><span class="type">GsfBlob</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> Size in bytes, or 0 if the data is <code class="literal">NULL</code>.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2573598"></a><h3>
|
|
<a name="gsf-blob-peek-data"></a>gsf_blob_peek_data ()</h3>
|
|
<a class="indexterm" name="id2573609"></a><pre class="programlisting">gconstpointer gsf_blob_peek_data (<a href="gsf-GsfBlob.html#GsfBlob">GsfBlob</a> *blob);</pre>
|
|
<p>
|
|
Queries a pointer to the data stored in the blob. This does not copy the data
|
|
for you; it returns a pointer to the actual buffer which the blob uses internally,
|
|
so you should not free this buffer on your own.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>blob</code></em> :</span></td>
|
|
<td> A <a href="gsf-GsfBlob.html#GsfBlob"><span class="type">GsfBlob</span></a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> Pointer to the data stored in the blob, or <code class="literal">NULL</code> if the size
|
|
of the data is zero.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2573688"></a><h2>See Also</h2>
|
|
<p>
|
|
<a href="gsf-GsfClipData.html#GsfClipData"><span class="type">GsfClipData</span></a>, <span class="type">GsfMetadata</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
|
|
<td align="left"><a accesskey="p" href="gsf-metadata.html"><b><< metadata</b></a></td>
|
|
<td align="right"><a accesskey="n" href="gsf-GsfClipData.html"><b>GsfClipData >></b></a></td>
|
|
</tr></table>
|
|
</body>
|
|
</html>
|