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.
145 lines
5.9 KiB
145 lines
5.9 KiB
<refentry id="gsf-GsfBlob">
|
|
<refmeta>
|
|
<refentrytitle>GsfBlob</refentrytitle>
|
|
<manvolnum>3</manvolnum>
|
|
<refmiscinfo>GSF Library</refmiscinfo>
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
<refname>GsfBlob</refname><refpurpose>A generic, unstructured block of binary data</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv><title>Synopsis</title>
|
|
|
|
<synopsis>
|
|
|
|
|
|
|
|
<link linkend="GsfBlob">GsfBlob</link>;
|
|
<link linkend="GsfBlobClass">GsfBlobClass</link>;
|
|
<link linkend="GsfBlob">GsfBlob</link>* <link linkend="gsf-blob-new">gsf_blob_new</link> (<link linkend="gsize">gsize</link> size,
|
|
<link linkend="gconstpointer">gconstpointer</link> data_to_copy,
|
|
<link linkend="GError">GError</link> **error);
|
|
<link linkend="gsize">gsize</link> <link linkend="gsf-blob-get-size">gsf_blob_get_size</link> (<link linkend="GsfBlob">GsfBlob</link> *blob);
|
|
<link linkend="gconstpointer">gconstpointer</link> <link linkend="gsf-blob-peek-data">gsf_blob_peek_data</link> (<link linkend="GsfBlob">GsfBlob</link> *blob);
|
|
|
|
|
|
</synopsis>
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>
|
|
Some libgsf functions, in particular the <link
|
|
linkend="GsfDocMetaData">metadata</link> functions, can generate
|
|
unstructured blocks of data, or <firstterm>blobs</firstterm>.
|
|
Libgsf represents these blobs using a
|
|
<classname>GsfBlob</classname> object.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1>
|
|
<title>Details</title>
|
|
<refsect2>
|
|
<title><anchor id="GsfBlob"/>GsfBlob</title>
|
|
<indexterm><primary>GsfBlob</primary></indexterm><programlisting>typedef struct {
|
|
GObject object;
|
|
GsfBlobPrivate *priv;
|
|
} GsfBlob;
|
|
</programlisting>
|
|
<para>
|
|
Represents an unstructured block of binary data, that is, a
|
|
sequence of bytes and an integer specifying the size of the
|
|
sequence.
|
|
</para></refsect2>
|
|
<refsect2>
|
|
<title><anchor id="GsfBlobClass"/>GsfBlobClass</title>
|
|
<indexterm><primary>GsfBlobClass</primary></indexterm><programlisting>typedef struct {
|
|
GObjectClass parent_class;
|
|
} GsfBlobClass;
|
|
</programlisting>
|
|
<para>
|
|
|
|
</para></refsect2>
|
|
<refsect2>
|
|
<title><anchor id="gsf-blob-new"/>gsf_blob_new ()</title>
|
|
<indexterm><primary>gsf_blob_new</primary></indexterm><programlisting><link linkend="GsfBlob">GsfBlob</link>* gsf_blob_new (<link linkend="gsize">gsize</link> size,
|
|
<link linkend="gconstpointer">gconstpointer</link> data_to_copy,
|
|
<link linkend="GError">GError</link> **error);</programlisting>
|
|
<para>
|
|
Creates a new <link linkend="GsfBlob"><type>GsfBlob</type></link> 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.</para>
|
|
<para>
|
|
|
|
</para><variablelist role="params">
|
|
<varlistentry><term><parameter>size</parameter> :</term>
|
|
<listitem><simpara> Size of the data in bytes.
|
|
</simpara></listitem></varlistentry>
|
|
<varlistentry><term><parameter>data_to_copy</parameter> :</term>
|
|
<listitem><simpara> Data which will be copied into the blob, or <literal>NULL</literal> if <parameter>size</parameter> is zero.
|
|
</simpara></listitem></varlistentry>
|
|
<varlistentry><term><parameter>error</parameter> :</term>
|
|
<listitem><simpara> location to store error, or <literal>NULL</literal>.
|
|
</simpara></listitem></varlistentry>
|
|
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A newly-created <link linkend="GsfBlob"><type>GsfBlob</type></link>, or <literal>NULL</literal> if the data could not be copied.
|
|
|
|
Error domain: <link linkend="GSF-ERROR:CAPS"><type>GSF_ERROR</type></link>
|
|
|
|
Possible errors: <link linkend="GSF-ERROR-OUT-OF-MEMORY:CAPS"><type>GSF_ERROR_OUT_OF_MEMORY</type></link> if the <parameter>data_to_copy</parameter> could not be copied.
|
|
</simpara></listitem></varlistentry>
|
|
</variablelist></refsect2>
|
|
<refsect2>
|
|
<title><anchor id="gsf-blob-get-size"/>gsf_blob_get_size ()</title>
|
|
<indexterm><primary>gsf_blob_get_size</primary></indexterm><programlisting><link linkend="gsize">gsize</link> gsf_blob_get_size (<link linkend="GsfBlob">GsfBlob</link> *blob);</programlisting>
|
|
<para>
|
|
Queries the size in bytes of the data stored in the blob.</para>
|
|
<para>
|
|
|
|
</para><variablelist role="params">
|
|
<varlistentry><term><parameter>blob</parameter> :</term>
|
|
<listitem><simpara> A <link linkend="GsfBlob"><type>GsfBlob</type></link>.
|
|
</simpara></listitem></varlistentry>
|
|
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Size in bytes, or 0 if the data is <literal>NULL</literal>.
|
|
</simpara></listitem></varlistentry>
|
|
</variablelist></refsect2>
|
|
<refsect2>
|
|
<title><anchor id="gsf-blob-peek-data"/>gsf_blob_peek_data ()</title>
|
|
<indexterm><primary>gsf_blob_peek_data</primary></indexterm><programlisting><link linkend="gconstpointer">gconstpointer</link> gsf_blob_peek_data (<link linkend="GsfBlob">GsfBlob</link> *blob);</programlisting>
|
|
<para>
|
|
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.</para>
|
|
<para>
|
|
|
|
</para><variablelist role="params">
|
|
<varlistentry><term><parameter>blob</parameter> :</term>
|
|
<listitem><simpara> A <link linkend="GsfBlob"><type>GsfBlob</type></link>.
|
|
</simpara></listitem></varlistentry>
|
|
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Pointer to the data stored in the blob, or <literal>NULL</literal> if the size
|
|
of the data is zero.
|
|
</simpara></listitem></varlistentry>
|
|
</variablelist></refsect2>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1>
|
|
<title>See Also</title>
|
|
<para>
|
|
<link linkend="GsfClipData"><type>GsfClipData</type></link>, <link linkend="GsfMetadata"><type>GsfMetadata</type></link>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|