1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
<refentry id="gsf-blobs">
<refmeta>
<refentrytitle role="top_of_page">GsfBlob</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GSF Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GsfBlob</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="GsfBlob"/><anchor id="GsfStructuredBlob"/>
<synopsis>
<link linkend="GsfBlob-struct">GsfBlob</link>;
<link linkend="GsfBlobClass">GsfBlobClass</link>;
<link linkend="GsfStructuredBlob-struct">GsfStructuredBlob</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> const *blob);
<link linkend="gconstpointer">gconstpointer</link> <link linkend="gsf-blob-peek-data">gsf_blob_peek_data</link> (<link linkend="GsfBlob">GsfBlob</link> const *blob);
<link linkend="gboolean">gboolean</link> <link linkend="gsf-structured-blob-write">gsf_structured_blob_write</link> (<link linkend="GsfStructuredBlob">GsfStructuredBlob</link> *blob,
<link linkend="GsfOutfile">GsfOutfile</link> *container);
<link linkend="GsfStructuredBlob">GsfStructuredBlob</link>* <link linkend="gsf-structured-blob-read">gsf_structured_blob_read</link> (<link linkend="GsfInput">GsfInput</link> *input);
</synopsis>
</refsynopsisdiv>
<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
</para>
</refsect1>
<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="GsfBlob-struct" role="struct"/>GsfBlob</title>
<indexterm><primary>GsfBlob</primary></indexterm><programlisting>typedef struct _GsfBlob GsfBlob;</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="GsfBlobClass" role="struct"/>GsfBlobClass</title>
<indexterm><primary>GsfBlobClass</primary></indexterm><programlisting>typedef struct {
GObjectClass parent_class;
} GsfBlobClass;
</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="GsfStructuredBlob-struct" role="struct"/>GsfStructuredBlob</title>
<indexterm><primary>GsfStructuredBlob</primary></indexterm><programlisting>typedef struct _GsfStructuredBlob GsfStructuredBlob;</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="gsf-blob-new" role="function"/>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 <link linkend="NULL:CAPS"><literal>NULL</literal></link> if <parameter>size</parameter> is zero.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara> location to store error, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A newly-created <link linkend="GsfBlob"><type>GsfBlob</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> 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" role="function"/>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> const *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 <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gsf-blob-peek-data" role="function"/>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> const *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 <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the size
of the data is zero.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gsf-structured-blob-write" role="function"/>gsf_structured_blob_write ()</title>
<indexterm><primary>gsf_structured_blob_write</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gsf_structured_blob_write (<link linkend="GsfStructuredBlob">GsfStructuredBlob</link> *blob,
<link linkend="GsfOutfile">GsfOutfile</link> *container);</programlisting>
<para>
Dumps structured blob <parameter>blob</parameter> onto the <parameter>container</parameter>. Will fail if the output is
not an Outfile and blob has multiple streams.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>blob</parameter> :</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>container</parameter> :</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gsf-structured-blob-read" role="function"/>gsf_structured_blob_read ()</title>
<indexterm><primary>gsf_structured_blob_read</primary></indexterm><programlisting><link linkend="GsfStructuredBlob">GsfStructuredBlob</link>* gsf_structured_blob_read (<link linkend="GsfInput">GsfInput</link> *input);</programlisting>
<para>
</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>input</parameter> :</term>
<listitem><simpara> An input (potentially a GsfInfile) holding the blob
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a freshly created tree of blobs
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|