75
75
<td class="function_type">
76
<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
76
<a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
78
78
<td class="function_name">
79
79
<a class="link" href="gio-GResource.html#g-resource-lookup-data" title="g_resource_lookup_data ()">g_resource_lookup_data</a> <span class="c_punctuation">()</span>
99
99
<td class="function_type">
100
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
100
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
102
102
<td class="function_name">
103
103
<a class="link" href="gio-GResource.html#g-resource-get-info" title="g_resource_get_info ()">g_resource_get_info</a> <span class="c_punctuation">()</span>
147
147
<td class="function_type">
148
<a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
148
<a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
150
150
<td class="function_name">
151
151
<a class="link" href="gio-GResource.html#g-resources-lookup-data" title="g_resources_lookup_data ()">g_resources_lookup_data</a> <span class="c_punctuation">()</span>
171
171
<td class="function_type">
172
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
172
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
174
174
<td class="function_name">
175
175
<a class="link" href="gio-GResource.html#g-resources-get-info" title="g_resources_get_info ()">g_resources_get_info</a> <span class="c_punctuation">()</span>
218
218
<a name="gio-GResource.description"></a><h2>Description</h2>
219
219
<p>Applications and libraries often contain binary or textual data that is
220
220
really part of the application, rather than user data. For instance
221
<a href="http://developer.gnome.org/gtk2/GtkBuilder.html"><span class="type">GtkBuilder</span></a> .ui files, splashscreen images, GMenu markup xml, CSS files,
221
<span class="type">GtkBuilder</span> .ui files, splashscreen images, GMenu markup xml, CSS files,
222
222
icons, etc. These are often shipped as files in <code class="literal">$datadir/appname</code>, or
223
223
manually included as literal strings in the code.</p>
224
224
<p>The <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> API and the <a href="glib-compile-resources.html">glib-compile-resources</a> program
264
<td class="listing_code"><pre class="programlisting"><span class="symbol"><?</span><span class="usertype">xml</span><span class="normal"> version</span><span class="symbol">=</span><span class="string">"1.0"</span><span class="normal"> encoding</span><span class="symbol">=</span><span class="string">"UTF-8"</span><span class="symbol">?></span>
265
<span class="symbol"><</span><span class="normal">gresources</span><span class="symbol">></span>
266
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">gresource</span><span class="normal"> prefix</span><span class="symbol">=</span><span class="string">"/org/gtk/Example"</span><span class="symbol">></span>
267
<span class="normal"> </span><span class="symbol"><</span><span class="normal">file</span><span class="symbol">></span><span class="normal">data</span><span class="symbol">/</span><span class="normal">splashscreen</span><span class="symbol">.</span><span class="normal">png</span><span class="symbol"></</span><span class="normal">file</span><span class="symbol">></span>
268
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">file</span><span class="normal"> compressed</span><span class="symbol">=</span><span class="string">"true"</span><span class="symbol">></span><span class="normal">dialog</span><span class="symbol">.</span><span class="normal">ui</span><span class="symbol"></</span><span class="normal">file</span><span class="symbol">></span>
269
<span class="normal"> </span><span class="symbol"><</span><span class="usertype">file</span><span class="normal"> preprocess</span><span class="symbol">=</span><span class="string">"xml-stripblanks"</span><span class="symbol">></span><span class="normal">menumarkup</span><span class="symbol">.</span><span class="normal">xml</span><span class="symbol"></</span><span class="normal">file</span><span class="symbol">></span>
270
<span class="normal"> </span><span class="symbol"></</span><span class="normal">gresource</span><span class="symbol">></span>
271
<span class="symbol"></</span><span class="normal">gresources</span><span class="symbol">></span></pre></td>
264
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc opt"><</span>?xml version<span class="gtkdoc opt">=</span><span class="string">"1.0"</span> encoding<span class="gtkdoc opt">=</span><span class="string">"UTF-8"</span>?<span class="gtkdoc opt">></span>
265
<span class="gtkdoc opt"><</span>gresources<span class="gtkdoc opt">></span>
266
<span class="gtkdoc opt"><</span>gresource prefix<span class="gtkdoc opt">=</span><span class="string">"/org/gtk/Example"</span><span class="gtkdoc opt">></span>
267
<span class="gtkdoc opt"><</span>file<span class="gtkdoc opt">></span>data<span class="gtkdoc opt">/</span>splashscreen<span class="gtkdoc opt">.</span>png<span class="gtkdoc opt"></</span>file<span class="gtkdoc opt">></span>
268
<span class="gtkdoc opt"><</span>file compressed<span class="gtkdoc opt">=</span><span class="string">"true"</span><span class="gtkdoc opt">></span>dialog<span class="gtkdoc opt">.</span>ui<span class="gtkdoc opt"></</span>file<span class="gtkdoc opt">></span>
269
<span class="gtkdoc opt"><</span>file preprocess<span class="gtkdoc opt">=</span><span class="string">"xml-stripblanks"</span><span class="gtkdoc opt">></span>menumarkup<span class="gtkdoc opt">.</span>xml<span class="gtkdoc opt"></</span>file<span class="gtkdoc opt">></span>
270
<span class="gtkdoc opt"></</span>gresource<span class="gtkdoc opt">></span>
271
<span class="gtkdoc opt"></</span>gresources<span class="gtkdoc opt">></span></pre></td>
283
283
<td class="listing_lines" align="right"><pre>1
286
<td class="listing_code"><pre class="programlisting"><span class="symbol">/</span><span class="normal">org</span><span class="symbol">/</span><span class="normal">gtk</span><span class="symbol">/</span><span class="normal">Example</span><span class="symbol">/</span><span class="normal">data</span><span class="symbol">/</span><span class="normal">splashscreen</span><span class="symbol">.</span><span class="normal">png</span>
287
<span class="symbol">/</span><span class="normal">org</span><span class="symbol">/</span><span class="normal">gtk</span><span class="symbol">/</span><span class="normal">Example</span><span class="symbol">/</span><span class="normal">dialog</span><span class="symbol">.</span><span class="normal">ui</span>
288
<span class="symbol">/</span><span class="normal">org</span><span class="symbol">/</span><span class="normal">gtk</span><span class="symbol">/</span><span class="normal">Example</span><span class="symbol">/</span><span class="normal">menumarkup</span><span class="symbol">.</span><span class="normal">xml</span></pre></td>
286
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc opt">/</span>org<span class="gtkdoc opt">/</span>gtk<span class="gtkdoc opt">/</span>Example<span class="gtkdoc opt">/</span>data<span class="gtkdoc opt">/</span>splashscreen<span class="gtkdoc opt">.</span>png
287
<span class="gtkdoc opt">/</span>org<span class="gtkdoc opt">/</span>gtk<span class="gtkdoc opt">/</span>Example<span class="gtkdoc opt">/</span>dialog<span class="gtkdoc opt">.</span>ui
288
<span class="gtkdoc opt">/</span>org<span class="gtkdoc opt">/</span>gtk<span class="gtkdoc opt">/</span>Example<span class="gtkdoc opt">/</span>menumarkup<span class="gtkdoc opt">.</span>xml</pre></td>
316
316
<div class="refsect2">
317
317
<a name="g-resource-load"></a><h3>g_resource_load ()</h3>
318
318
<pre class="programlisting"><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> *
319
g_resource_load (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
320
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
319
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>,
320
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
321
321
<p>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
322
322
you to query it for data.</p>
323
323
<p>If you want to use this resource in the global resource namespace you need
340
340
<td class="parameter_name"><p>error</p></td>
341
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
341
<td class="parameter_description"><p>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></p></td>
342
342
<td class="parameter_annotations"> </td>
347
347
<div class="refsect3">
348
348
<a name="id-1.4.20.2.7.2.7"></a><h4>Returns</h4>
349
<p> a new <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
349
<p> 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. </p>
350
350
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
352
352
<p class="since">Since 2.32</p>
355
355
<div class="refsect2">
356
356
<a name="g-resource-new-from-data"></a><h3>g_resource_new_from_data ()</h3>
357
357
<pre class="programlisting"><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="returnvalue">GResource</span></a> *
358
g_resource_new_from_data (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> *data</code></em>,
359
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
358
g_resource_new_from_data (<em class="parameter"><code><a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> *data</code></em>,
359
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
360
360
<p>Creates a GResource from a reference to the binary resource bundle.
361
361
This will keep a reference to <em class="parameter"><code>data</code></em>
362
362
while the resource lives, so
376
376
<td class="parameter_name"><p>data</p></td>
377
<td class="parameter_description"><p>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a></p></td>
377
<td class="parameter_description"><p>A <a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a></p></td>
378
378
<td class="parameter_annotations"> </td>
381
381
<td class="parameter_name"><p>error</p></td>
382
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
382
<td class="parameter_description"><p>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></p></td>
383
383
<td class="parameter_annotations"> </td>
388
388
<div class="refsect3">
389
389
<a name="id-1.4.20.2.7.3.7"></a><h4>Returns</h4>
390
<p> a new <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
390
<p> 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. </p>
391
391
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
393
393
<p class="since">Since 2.32</p>
453
453
<div class="refsect2">
454
454
<a name="g-resource-lookup-data"></a><h3>g_resource_lookup_data ()</h3>
455
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
455
<pre class="programlisting"><a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
456
456
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>,
457
457
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
458
458
<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>,
459
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
459
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
460
460
<p>Looks for a file at the specified <em class="parameter"><code>path</code></em>
461
461
in the resource and
462
returns a <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that lets you directly access the data in
462
returns a <a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that lets you directly access the data in
464
464
<p>The data is always followed by a zero byte, so you
465
465
can safely use the data as a C string. However, that byte
498
498
<td class="parameter_name"><p>error</p></td>
499
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
499
<td class="parameter_description"><p>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></p></td>
500
500
<td class="parameter_annotations"> </td>
505
505
<div class="refsect3">
506
506
<a name="id-1.4.20.2.7.6.9"></a><h4>Returns</h4>
507
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
508
Free the returned object with <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. </p>
507
<p> <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.
508
Free the returned object with <a href="../glib/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. </p>
509
509
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
511
511
<p class="since">Since 2.32</p>
517
517
g_resource_open_stream (<em class="parameter"><code><a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> *resource</code></em>,
518
518
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
519
519
<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>,
520
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
520
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
521
521
<p>Looks for a file at the specified <em class="parameter"><code>path</code></em>
522
522
in the resource and
523
523
returns a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> that lets you read the data.</p>
551
551
<td class="parameter_name"><p>error</p></td>
552
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
552
<td class="parameter_description"><p>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></p></td>
553
553
<td class="parameter_annotations"> </td>
558
558
<div class="refsect3">
559
559
<a name="id-1.4.20.2.7.7.7"></a><h4>Returns</h4>
560
<p> <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
561
Free the returned object with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
560
<p> <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.
561
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>. </p>
562
562
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
564
564
<p class="since">Since 2.32</p>
570
570
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>,
571
571
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
572
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>,
573
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
573
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
574
574
<p>Returns all the names of children at the specified <em class="parameter"><code>path</code></em>
576
The return result is a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of strings which should
577
be released with <a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.</p>
576
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
577
be released with <a href="../glib/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.</p>
578
578
<p><em class="parameter"><code>lookup_flags</code></em>
579
579
controls the behaviour of the lookup.</p>
580
580
<div class="refsect3">
605
605
<td class="parameter_name"><p>error</p></td>
606
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
606
<td class="parameter_description"><p>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></p></td>
607
607
<td class="parameter_annotations"> </td>
620
620
<div class="refsect2">
621
621
<a name="g-resource-get-info"></a><h3>g_resource_get_info ()</h3>
622
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
622
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
623
623
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>,
624
624
<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
625
625
<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>,
626
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
627
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
628
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
626
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
627
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
628
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
629
629
<p>Looks for a file at the specified <em class="parameter"><code>path</code></em>
630
630
in the resource and
631
631
if found returns information about it.</p>
659
659
<td class="parameter_name"><p>size</p></td>
660
660
<td class="parameter_description"><p> a location to place the length of the contents of the file,
661
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
661
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
662
662
<td class="parameter_annotations"><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></td>
665
665
<td class="parameter_name"><p>flags</p></td>
666
666
<td class="parameter_description"><p> a location to place the flags about the file,
667
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
667
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
668
668
<td class="parameter_annotations"><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></td>
671
671
<td class="parameter_name"><p>error</p></td>
672
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
672
<td class="parameter_description"><p>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></p></td>
673
673
<td class="parameter_annotations"> </td>
678
678
<div class="refsect3">
679
679
<a name="id-1.4.20.2.7.9.7"></a><h4>Returns</h4>
680
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file was found. <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there were errors</p>
680
<p> <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</p>
683
683
<p class="since">Since 2.32</p>
818
818
<div class="refsect2">
819
819
<a name="g-resources-lookup-data"></a><h3>g_resources_lookup_data ()</h3>
820
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
820
<pre class="programlisting"><a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="returnvalue">GBytes</span></a> *
821
821
g_resources_lookup_data (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
822
822
<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>,
823
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
823
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
824
824
<p>Looks for a file at the specified <em class="parameter"><code>path</code></em>
826
globally registered resources and returns a <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that
826
globally registered resources and returns a <a href="../glib/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> that
827
827
lets you directly access the data in memory.</p>
828
828
<p>The data is always followed by a zero byte, so you
829
829
can safely use the data as a C string. However, that byte
857
857
<td class="parameter_name"><p>error</p></td>
858
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
858
<td class="parameter_description"><p>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></p></td>
859
859
<td class="parameter_annotations"> </td>
864
864
<div class="refsect3">
865
865
<a name="id-1.4.20.2.7.15.9"></a><h4>Returns</h4>
866
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#GBytes"><span class="type">GBytes</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
867
Free the returned object with <a href="http://library.gnome.org/devel/glib/unstable/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. </p>
866
<p> <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.
867
Free the returned object with <a href="../glib/glib-Byte-Arrays.html#g-bytes-unref"><code class="function">g_bytes_unref()</code></a>. </p>
868
868
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
870
870
<p class="since">Since 2.32</p>
875
875
<pre class="programlisting"><a class="link" href="GInputStream.html" title="GInputStream"><span class="returnvalue">GInputStream</span></a> *
876
876
g_resources_open_stream (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
877
877
<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>,
878
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
878
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
879
879
<p>Looks for a file at the specified <em class="parameter"><code>path</code></em>
881
881
globally registered resources and returns a <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a>
905
905
<td class="parameter_name"><p>error</p></td>
906
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
906
<td class="parameter_description"><p>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></p></td>
907
907
<td class="parameter_annotations"> </td>
912
912
<div class="refsect3">
913
913
<a name="id-1.4.20.2.7.16.7"></a><h4>Returns</h4>
914
<p> <a class="link" href="GInputStream.html" title="GInputStream"><span class="type">GInputStream</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
915
Free the returned object with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
914
<p> <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.
915
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>. </p>
916
916
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
918
918
<p class="since">Since 2.32</p>
923
923
<pre class="programlisting"><span class="returnvalue">char</span> **
924
924
g_resources_enumerate_children (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
925
925
<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>,
926
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
926
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
927
927
<p>Returns all the names of children at the specified <em class="parameter"><code>path</code></em>
929
929
globally registered resources.
930
The return result is a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminated list of strings which should
931
be released with <a href="http://library.gnome.org/devel/glib/unstable/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.</p>
930
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
931
be released with <a href="../glib/glib-String-Utility-Functions.html#g-strfreev"><code class="function">g_strfreev()</code></a>.</p>
932
932
<p><em class="parameter"><code>lookup_flags</code></em>
933
933
controls the behaviour of the lookup.</p>
934
934
<div class="refsect3">
954
954
<td class="parameter_name"><p>error</p></td>
955
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
955
<td class="parameter_description"><p>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></p></td>
956
956
<td class="parameter_annotations"> </td>
969
969
<div class="refsect2">
970
970
<a name="g-resources-get-info"></a><h3>g_resources_get_info ()</h3>
971
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
971
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
972
972
g_resources_get_info (<em class="parameter"><code>const <span class="type">char</span> *path</code></em>,
973
973
<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>,
974
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
975
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
976
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
974
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *size</code></em>,
975
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> *flags</code></em>,
976
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
977
977
<p>Looks for a file at the specified <em class="parameter"><code>path</code></em>
979
979
globally registered resources and if found returns information about it.</p>
1002
1002
<td class="parameter_name"><p>size</p></td>
1003
1003
<td class="parameter_description"><p> a location to place the length of the contents of the file,
1004
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
1004
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
1005
1005
<td class="parameter_annotations"><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></td>
1008
1008
<td class="parameter_name"><p>flags</p></td>
1009
1009
<td class="parameter_description"><p> a location to place the flags about the file,
1010
or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
1010
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the length is not needed. </p></td>
1011
1011
<td class="parameter_annotations"><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></td>
1014
1014
<td class="parameter_name"><p>error</p></td>
1015
<td class="parameter_description"><p>return location for a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1015
<td class="parameter_description"><p>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></p></td>
1016
1016
<td class="parameter_annotations"> </td>
1021
1021
<div class="refsect3">
1022
1022
<a name="id-1.4.20.2.7.18.7"></a><h4>Returns</h4>
1023
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the file was found. <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if there were errors</p>
1023
<p> <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</p>
1026
1026
<p class="since">Since 2.32</p>
1031
1031
<pre class="programlisting">#define G_RESOURCE_ERROR (g_resource_error_quark ())
1033
1033
<p>Error domain for <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a>. Errors in this domain will be from the
1034
<a class="link" href="gio-GResource.html#GResourceError" title="enum GResourceError"><span class="type">GResourceError</span></a> enumeration. See <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for more information on
1034
<a class="link" href="gio-GResource.html#GResourceError" title="enum GResourceError"><span class="type">GResourceError</span></a> enumeration. See <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for more information on
1035
1035
error domains.</p>
1103
1103
<div class="refsect2">
1104
1104
<a name="GResourceError"></a><h3>enum GResourceError</h3>
1105
<p>An error code used with <a class="link" href="gio-GResource.html#G-RESOURCE-ERROR:CAPS" title="G_RESOURCE_ERROR"><code class="literal">G_RESOURCE_ERROR</code></a> in a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> returned
1105
<p>An error code used with <a class="link" href="gio-GResource.html#G-RESOURCE-ERROR:CAPS" title="G_RESOURCE_ERROR"><code class="literal">G_RESOURCE_ERROR</code></a> in a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> returned
1106
1106
from a <a class="link" href="gio-GResource.html#GResource" title="GResource"><span class="type">GResource</span></a> routine.</p>
1107
1107
<div class="refsect3">
1108
1108
<a name="id-1.4.20.2.8.5.4"></a><h4>Members</h4>