File: gsf-blobs.html

package info (click to toggle)
libgsf 1.14.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,644 kB
  • ctags: 3,140
  • sloc: ansic: 16,511; sh: 9,076; xml: 6,155; makefile: 454; perl: 35; python: 13
file content (268 lines) | stat: -rw-r--r-- 10,860 bytes parent folder | download
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>GsfBlob</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.0">
<link rel="start" href="index.html" title="GSF Reference Manual">
<link rel="up" href="parsers.html" title="Stream Parsers">
<link rel="prev" href="gsf-OASIS-Open-Document.html" title="OASIS Open Document">
<link rel="next" href="GsfClipData.html" title="GsfClipData">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="intro.html" title="Part&#160;I.&#160;GSF: Introduction">
<link rel="part" href="history.html" title="Part&#160;II.&#160;GSF: History">
<link rel="part" href="dependencies.html" title="Part&#160;III.&#160;GSF: Dependencies">
<link rel="part" href="gsf-users.html" title="Part&#160;IV.&#160;Projects using GSF">
<link rel="part" href="api.html" title="Part&#160;V.&#160;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" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gsf-OASIS-Open-Document.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="GsfClipData.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2603026" class="shortcut">Top</a>
                  &#160;|&#160;
                  <a href="#id2604386" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gsf-blobs"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2603026"></a><span class="refentrytitle">GsfBlob</span>
</h2>
<p>GsfBlob</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<a name="GsfBlob"></a><a name="GsfStructuredBlob"></a><pre class="synopsis">



            <a href="gsf-blobs.html#GsfBlob-struct">GsfBlob</a>;
            <a href="gsf-blobs.html#GsfBlobClass">GsfBlobClass</a>;
            <a href="gsf-blobs.html#GsfStructuredBlob-struct">GsfStructuredBlob</a>;
<a href="gsf-blobs.html#GsfBlob">GsfBlob</a>*    <a href="gsf-blobs.html#gsf-blob-new">gsf_blob_new</a>                    (gsize size,
                                             gconstpointer data_to_copy,
                                             GError **error);
gsize       <a href="gsf-blobs.html#gsf-blob-get-size">gsf_blob_get_size</a>               (<a href="gsf-blobs.html#GsfBlob">GsfBlob</a> *blob);
gconstpointer <a href="gsf-blobs.html#gsf-blob-peek-data">gsf_blob_peek_data</a>            (<a href="gsf-blobs.html#GsfBlob">GsfBlob</a> *blob);
gboolean    <a href="gsf-blobs.html#gsf-structured-blob-write">gsf_structured_blob_write</a>       (<a href="gsf-blobs.html#GsfStructuredBlob">GsfStructuredBlob</a> *blob,
                                             <a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a> *container);
<a href="gsf-blobs.html#GsfStructuredBlob">GsfStructuredBlob</a>* <a href="gsf-blobs.html#gsf-structured-blob-read">gsf_structured_blob_read</a> (<a href="gsf-Input-from-unstructured-files.html#GsfInput">GsfInput</a> *input);


</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2604386"></a><h2>Description</h2>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="id2604400"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2604410"></a><h3>
<a name="GsfBlob-struct"></a>GsfBlob</h3>
<a class="indexterm" name="id2604423"></a><pre class="programlisting">typedef struct _GsfBlob GsfBlob;</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2604438"></a><h3>
<a name="GsfBlobClass"></a>GsfBlobClass</h3>
<a class="indexterm" name="id2604451"></a><pre class="programlisting">typedef struct {
	GObjectClass parent_class;
} GsfBlobClass;
</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2604467"></a><h3>
<a name="GsfStructuredBlob-struct"></a>GsfStructuredBlob</h3>
<a class="indexterm" name="id2604481"></a><pre class="programlisting">typedef struct _GsfStructuredBlob GsfStructuredBlob;</pre>
<p>

</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2604496"></a><h3>
<a name="gsf-blob-new"></a>gsf_blob_new ()</h3>
<a class="indexterm" name="id2604509"></a><pre class="programlisting"><a href="gsf-blobs.html#GsfBlob">GsfBlob</a>*    gsf_blob_new                    (gsize size,
                                             gconstpointer data_to_copy,
                                             GError **error);</pre>
<p>
Creates a new <a href="gsf-blobs.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>&#160;:</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>&#160;:</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>&#160;:</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>&#160;:</span></td>
<td> A newly-created <a href="gsf-blobs.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="id2604698"></a><h3>
<a name="gsf-blob-get-size"></a>gsf_blob_get_size ()</h3>
<a class="indexterm" name="id2604711"></a><pre class="programlisting">gsize       gsf_blob_get_size               (<a href="gsf-blobs.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>&#160;:</span></td>
<td> A <a href="gsf-blobs.html#GsfBlob"><span class="type">GsfBlob</span></a>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</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="id2604789"></a><h3>
<a name="gsf-blob-peek-data"></a>gsf_blob_peek_data ()</h3>
<a class="indexterm" name="id2604803"></a><pre class="programlisting">gconstpointer gsf_blob_peek_data            (<a href="gsf-blobs.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>&#160;:</span></td>
<td> A <a href="gsf-blobs.html#GsfBlob"><span class="type">GsfBlob</span></a>.
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</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>
<hr>
<div class="refsect2" lang="en">
<a name="id2604884"></a><h3>
<a name="gsf-structured-blob-write"></a>gsf_structured_blob_write ()</h3>
<a class="indexterm" name="id2604898"></a><pre class="programlisting">gboolean    gsf_structured_blob_write       (<a href="gsf-blobs.html#GsfStructuredBlob">GsfStructuredBlob</a> *blob,
                                             <a href="gsf-Outfile-writing-structed-files.html#GsfOutfile">GsfOutfile</a> *container);</pre>
<p>
Dumps structured blob <em class="parameter"><code>blob</code></em> onto the <em class="parameter"><code>container</code></em>.  Will fail if the output is
not an Outfile and blob has multiple streams.</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>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>container</code></em>&#160;:</span></td>
<td>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> TRUE on success.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2604993"></a><h3>
<a name="gsf-structured-blob-read"></a>gsf_structured_blob_read ()</h3>
<a class="indexterm" name="id2605006"></a><pre class="programlisting"><a href="gsf-blobs.html#GsfStructuredBlob">GsfStructuredBlob</a>* gsf_structured_blob_read (<a href="gsf-Input-from-unstructured-files.html#GsfInput">GsfInput</a> *input);</pre>
<p>
</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>input</code></em>&#160;:</span></td>
<td> An input (potentially a GsfInfile) holding the blob
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a freshly created tree of blobs
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>