4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>GResource</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
7
<link rel="home" href="index.html" title="GIO Reference Manual">
8
8
<link rel="up" href="resources.html" title="Resources">
9
9
<link rel="prev" href="resources.html" title="Resources">
10
10
<link rel="next" href="permissions.html" title="Permissions">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
14
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
43
43
<a class="link" href="gio-GResource.html#GResource" title="GResource">GResource</a>;
44
44
enum <a class="link" href="gio-GResource.html#GResourceFlags" title="enum GResourceFlags">GResourceFlags</a>;
45
45
enum <a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags">GResourceLookupFlags</a>;
46
<a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * <a class="link" href="gio-GResource.html#g-resource-load" title="g_resource_load ()">g_resource_load</a> (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
47
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
48
<a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * <a class="link" href="gio-GResource.html#g-resource-new-from-data" title="g_resource_new_from_data ()">g_resource_new_from_data</a> (<em class="parameter"><code><a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> *data</code></em>,
49
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
46
<a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * <a class="link" href="gio-GResource.html#g-resource-load" title="g_resource_load ()">g_resource_load</a> (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
47
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
48
<a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * <a class="link" href="gio-GResource.html#g-resource-new-from-data" title="g_resource_new_from_data ()">g_resource_new_from_data</a> (<em class="parameter"><code><a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> *data</code></em>,
49
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
50
50
<a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * <a class="link" href="gio-GResource.html#g-resource-ref" title="g_resource_ref ()">g_resource_ref</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>);
51
51
<span class="returnvalue">void</span> <a class="link" href="gio-GResource.html#g-resource-unref" title="g_resource_unref ()">g_resource_unref</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>);
52
<a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * <a class="link" href="gio-GResource.html#g-resource-lookup-data" title="g_resource_lookup_data ()">g_resource_lookup_data</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
52
<a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * <a class="link" href="gio-GResource.html#g-resource-lookup-data" title="g_resource_lookup_data ()">g_resource_lookup_data</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
53
53
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
54
54
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
55
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
55
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
56
56
<a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> * <a class="link" href="gio-GResource.html#g-resource-open-stream" title="g_resource_open_stream ()">g_resource_open_stream</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
57
57
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
58
58
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
59
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
59
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
60
60
<span class="returnvalue">char</span> ** <a class="link" href="gio-GResource.html#g-resource-enumerate-children" title="g_resource_enumerate_children ()">g_resource_enumerate_children</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
61
61
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
62
62
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
63
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
64
<a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gio-GResource.html#g-resource-get-info" title="g_resource_get_info ()">g_resource_get_info</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
63
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
64
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gio-GResource.html#g-resource-get-info" title="g_resource_get_info ()">g_resource_get_info</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
65
65
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
66
66
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
67
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
68
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
69
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
67
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
68
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
69
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
71
71
<span class="returnvalue">void</span> <a class="link" href="gio-GResource.html#g-static-resource-init" title="g_static_resource_init ()">g_static_resource_init</a> (<em class="parameter"><code><span class="type">GStaticResource</span> *static_resource</code></em>);
72
72
<span class="returnvalue">void</span> <a class="link" href="gio-GResource.html#g-static-resource-fini" title="g_static_resource_fini ()">g_static_resource_fini</a> (<em class="parameter"><code><span class="type">GStaticResource</span> *static_resource</code></em>);
75
75
<span class="returnvalue">void</span> <a class="link" href="gio-GResource.html#g-resources-register" title="g_resources_register ()">g_resources_register</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>);
76
76
<span class="returnvalue">void</span> <a class="link" href="gio-GResource.html#g-resources-unregister" title="g_resources_unregister ()">g_resources_unregister</a> (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>);
77
<a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * <a class="link" href="gio-GResource.html#g-resources-lookup-data" title="g_resources_lookup_data ()">g_resources_lookup_data</a> (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
77
<a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * <a class="link" href="gio-GResource.html#g-resources-lookup-data" title="g_resources_lookup_data ()">g_resources_lookup_data</a> (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
78
78
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
79
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
79
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
80
80
<a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> * <a class="link" href="gio-GResource.html#g-resources-open-stream" title="g_resources_open_stream ()">g_resources_open_stream</a> (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
81
81
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
82
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
82
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
83
83
<span class="returnvalue">char</span> ** <a class="link" href="gio-GResource.html#g-resources-enumerate-children" title="g_resources_enumerate_children ()">g_resources_enumerate_children</a> (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
84
84
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
85
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
86
<a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gio-GResource.html#g-resources-get-info" title="g_resources_get_info ()">g_resources_get_info</a> (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
85
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
86
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gio-GResource.html#g-resources-get-info" title="g_resources_get_info ()">g_resources_get_info</a> (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
87
87
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
88
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
89
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
90
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
88
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
89
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
90
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
92
92
#define <a class="link" href="gio-GResource.html#G-RESOURCE-ERROR:CAPS" title="G_RESOURCE_ERROR">G_RESOURCE_ERROR</a>
93
93
enum <a class="link" href="gio-GResource.html#GResourceError" title="enum GResourceError">GResourceError</a>;
144
144
<div class="example">
145
145
<a name="resource-example"></a><p class="title"><b>Example 17. Example resource description</b></p>
146
<div class="example-contents"><pre class="programlisting">
147
<?xml version="1.0" encoding="UTF-8"?>
146
<div class="example-contents">
147
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
150
<td class="listing_lines" align="right"><pre>1
158
<td class="listing_code"><pre class="programlisting"><?xml version=<span class="number">"1.0"</span> encoding=<span class="number">"UTF-8"</span>?>
148
159
<gresources>
149
<gresource prefix="/org/gtk/Example">
160
<gresource prefix=<span class="number">"/org/gtk/Example"</span>>
150
161
<file>data/splashscreen.png</file>
151
<file compressed="true">dialog.ui</file>
152
<file preprocess="xml-stripblanks">menumarkup.xml</file>
162
<file compressed=<span class="number">"true"</span>>dialog.ui</file>
163
<file preprocess=<span class="number">"xml-stripblanks"</span>>menumarkup.xml</file>
153
164
</gresource>
165
</gresources></pre></td>
157
172
<p><br class="example-break">
258
279
<div class="refsect2">
259
280
<a name="g-resource-load"></a><h3>g_resource_load ()</h3>
260
<pre class="programlisting"><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * g_resource_load (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
261
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
281
<pre class="programlisting"><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> * g_resource_load (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
282
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
263
284
Loads a binary resource bundle and creates a <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> representation of it, allowing
264
285
you to query it for data.
267
288
If you want to use this resource in the global resource namespace you need
268
289
to register it with <a class="link" href="gio-GResource.html#g-resources-register" title="g_resources_register ()"><code class="function">g_resources_register()</code></a>.
270
<div class="variablelist"><table border="0">
291
<div class="variablelist"><table border="0" class="variablelist">
271
293
<col align="left" valign="top">
274
298
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
275
<td>the path of a filename to load, in the GLib filename encoding. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> filename]</span>
299
<td>the path of a filename to load, in the GLib filename encoding. <span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span>
279
303
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
280
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
304
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
284
308
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
285
<td>a new <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
309
<td>a new <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
303
327
If you want to use this resource in the global resource namespace you need
304
328
to register it with <a class="link" href="gio-GResource.html#g-resources-register" title="g_resources_register ()"><code class="function">g_resources_register()</code></a>.
306
<div class="variablelist"><table border="0">
330
<div class="variablelist"><table border="0" class="variablelist">
307
332
<col align="left" valign="top">
310
337
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
311
<td>A <a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a>
338
<td>A <a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a>
315
342
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
316
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
343
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
320
347
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
321
<td>a new <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
348
<td>a new <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
374
407
<div class="refsect2">
375
408
<a name="g-resource-lookup-data"></a><h3>g_resource_lookup_data ()</h3>
376
<pre class="programlisting"><a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * g_resource_lookup_data (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
409
<pre class="programlisting"><a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * g_resource_lookup_data (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
377
410
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
378
411
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
379
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
412
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
381
414
Looks for a file at the specified <em class="parameter"><code>path</code></em> in the resource and
382
returns a <a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that lets you directly access the data in
415
returns a <a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that lets you directly access the data in
417
453
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
418
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
454
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
422
458
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
424
<a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
425
Free the returned object with <a href="./../glib/glib/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
460
<a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
461
Free the returned object with <a href="../glib/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
464
503
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
465
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
504
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
469
508
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
471
<a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
472
Free the returned object with <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
510
<a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
511
Free the returned object with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
482
521
<pre class="programlisting"><span class="returnvalue">char</span> ** g_resource_enumerate_children (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
483
522
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
484
523
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
485
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
524
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
487
526
Returns all the names of children at the specified <em class="parameter"><code>path</code></em> in the resource.
488
The return result is a <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of strings which should
489
be released with <a href="./../glib/glib/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.
527
The return result is a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of strings which should
528
be released with <a href="../glib/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.
492
531
<em class="parameter"><code>lookup_flags</code></em> controls the behaviour of the lookup.
494
<div class="variablelist"><table border="0">
533
<div class="variablelist"><table border="0" class="variablelist">
495
535
<col align="left" valign="top">
498
540
<td><p><span class="term"><em class="parameter"><code>resource</code></em> :</span></p></td>
526
568
<div class="refsect2">
527
569
<a name="g-resource-get-info"></a><h3>g_resource_get_info ()</h3>
528
<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_resource_get_info (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
570
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_resource_get_info (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
529
571
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
530
572
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
531
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
532
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
533
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
573
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
574
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
575
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
535
577
Looks for a file at the specified <em class="parameter"><code>path</code></em> in the resource and
536
578
if found returns information about it.
559
604
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
560
605
<td>a location to place the length of the contents of the file,
561
or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
606
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
565
610
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
566
611
<td>a location to place the flags about the file,
567
or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
612
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
571
616
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
572
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
617
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
576
621
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
578
<a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file was found. <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there were errors</td>
623
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file was found. <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there were errors</td>
695
755
<div class="refsect2">
696
756
<a name="g-resources-lookup-data"></a><h3>g_resources_lookup_data ()</h3>
697
<pre class="programlisting"><a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * g_resources_lookup_data (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
757
<pre class="programlisting"><a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> * g_resources_lookup_data (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
698
758
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
699
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
759
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
701
761
Looks for a file at the specified <em class="parameter"><code>path</code></em> in the set of
702
globally registered resources and returns a <a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that
762
globally registered resources and returns a <a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that
703
763
lets you directly access the data in memory.
732
795
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
733
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
796
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
737
800
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
739
<a href="./../glib/glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
740
Free the returned object with <a href="./../glib/glib/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
802
<a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
803
Free the returned object with <a href="../glib/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
774
840
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
775
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
841
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
779
845
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
781
<a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
782
Free the returned object with <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
847
<a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
848
Free the returned object with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
791
857
<a name="g-resources-enumerate-children"></a><h3>g_resources_enumerate_children ()</h3>
792
858
<pre class="programlisting"><span class="returnvalue">char</span> ** g_resources_enumerate_children (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
793
859
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
794
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
860
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
796
862
Returns all the names of children at the specified <em class="parameter"><code>path</code></em> in the set of
797
863
globally registered resources.
798
The return result is a <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of strings which should
799
be released with <a href="./../glib/glib/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.
864
The return result is a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of strings which should
865
be released with <a href="../glib/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.
802
868
<em class="parameter"><code>lookup_flags</code></em> controls the behaviour of the lookup.
804
<div class="variablelist"><table border="0">
870
<div class="variablelist"><table border="0" class="variablelist">
805
872
<col align="left" valign="top">
808
877
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
831
900
<div class="refsect2">
832
901
<a name="g-resources-get-info"></a><h3>g_resources_get_info ()</h3>
833
<pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_resources_get_info (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
902
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_resources_get_info (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
834
903
<em class="parameter"><code><a class="link" href="gio-GResource.html#GResourceLookupFlags" title="enum GResourceLookupFlags"><span class="type">GResourceLookupFlags</span></a> lookup_flags</code></em>,
835
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
836
<em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
837
<em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
904
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
905
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
906
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
839
908
Looks for a file at the specified <em class="parameter"><code>path</code></em> in the set of
840
909
globally registered resources and if found returns information about it.
858
930
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
859
931
<td>a location to place the length of the contents of the file,
860
or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
932
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
864
936
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
865
937
<td>a location to place the flags about the file,
866
or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
938
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
870
942
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
871
<td>return location for a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
943
<td>return location for a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
875
947
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
877
<a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file was found. <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there were errors</td>
949
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file was found. <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there were errors</td>