4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>GVariant</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
9
9
<link rel="prev" href="glib-GVariantType.html" title="GVariantType">
10
10
<link rel="next" href="gvariant-format-strings.html" title="GVariant Format Strings">
11
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.18 (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">
268
268
<a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> is largely compatible with D-Bus. Almost all types of
269
269
<a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instances can be sent over D-Bus. See <a class="link" href="glib-GVariantType.html#GVariantType" title="GVariantType"><span class="type">GVariantType</span></a> for
270
270
exceptions. (However, <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a>'s serialisation format is not the same
271
as the serialisation format of a D-Bus message body: use <a href="http://library.gnome.org/devel/gio/unstable/GDBusMessage.html"><span class="type">GDBusMessage</span></a>,
271
as the serialisation format of a D-Bus message body: use <a href="./../gio/gio/GDBusMessage.html"><span class="type">GDBusMessage</span></a>,
272
272
in the gio library, for those.)
515
515
Decreases the reference count of <em class="parameter"><code>value</code></em>. When its reference count
516
516
drops to 0, the memory used by the variant is freed.
518
<div class="variablelist"><table border="0" class="variablelist">
518
<div class="variablelist"><table border="0">
520
519
<col align="left" valign="top">
524
521
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
525
522
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a>
744
726
<a class="link" href="glib-GVariantType.html#g-variant-type-peek-string" title="g_variant_type_peek_string ()"><code class="function">g_variant_type_peek_string()</code></a>, this string is nul-terminated. This
745
727
string belongs to <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> and must not be freed.
747
<div class="variablelist"><table border="0" class="variablelist">
729
<div class="variablelist"><table border="0">
749
730
<col align="left" valign="top">
754
733
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
853
826
If you only require an equality comparison, <a class="link" href="glib-GVariant.html#g-variant-equal" title="g_variant_equal ()"><code class="function">g_variant_equal()</code></a> is more
856
<div class="variablelist"><table border="0" class="variablelist">
829
<div class="variablelist"><table border="0">
858
830
<col align="left" valign="top">
863
833
<td><p><span class="term"><em class="parameter"><code>one</code></em> :</span></p></td>
864
<td>a basic-typed <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance. <span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GVariant]</span>
834
<td>a basic-typed <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GVariant]</span>
868
838
<td><p><span class="term"><em class="parameter"><code>two</code></em> :</span></p></td>
869
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance of the same type. <span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GVariant]</span>
839
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance of the same type. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GVariant]</span>
1058
1022
This function is meant to be used by functions that wish to provide
1059
1023
varargs accessors to <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> values of uncertain values (eg:
1060
<a class="link" href="glib-GVariant.html#g-variant-lookup" title="g_variant_lookup ()"><code class="function">g_variant_lookup()</code></a> or <a href="http://library.gnome.org/devel/gio/unstable/GMenuModel.html#g-menu-model-get-item-attribute"><code class="function">g_menu_model_get_item_attribute()</code></a>).
1024
<a class="link" href="glib-GVariant.html#g-variant-lookup" title="g_variant_lookup ()"><code class="function">g_variant_lookup()</code></a> or <a href="./../gio/gio/GMenuModel.html#g-menu-model-get-item-attribute"><code class="function">g_menu_model_get_item_attribute()</code></a>).
1062
<div class="variablelist"><table border="0" class="variablelist">
1026
<div class="variablelist"><table border="0">
1064
1027
<col align="left" valign="top">
1069
1030
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1228
1183
'r'; in essence, a new <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> must always be constructed by this
1229
1184
function (and not merely passed through it unmodified).
1231
<div class="variablelist"><table border="0" class="variablelist">
1186
<div class="variablelist"><table border="0">
1233
1187
<col align="left" valign="top">
1238
1190
<td><p><span class="term"><em class="parameter"><code>format_string</code></em> :</span></p></td>
1297
1249
result. This can also be done by adding the result to a container,
1298
1250
or by passing it to another <a class="link" href="glib-GVariant.html#g-variant-new" title="g_variant_new ()"><code class="function">g_variant_new()</code></a> call.
1300
<div class="variablelist"><table border="0" class="variablelist">
1252
<div class="variablelist"><table border="0">
1302
1253
<col align="left" valign="top">
1307
1256
<td><p><span class="term"><em class="parameter"><code>format_string</code></em> :</span></p></td>
1335
1284
Creates a new boolean <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance -- either <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> or <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a>.
1337
<div class="variablelist"><table border="0" class="variablelist">
1286
<div class="variablelist"><table border="0">
1339
1287
<col align="left" valign="top">
1344
1290
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1547
1472
that are sent alongside a D-Bus message. If you're not interacting
1548
1473
with D-Bus, you probably don't need them.
1550
<div class="variablelist"><table border="0" class="variablelist">
1475
<div class="variablelist"><table border="0">
1552
1476
<col align="left" valign="top">
1557
1479
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1630
1546
<em class="parameter"><code>string</code></em> must be a valid D-Bus object path. Use
1631
1547
<a class="link" href="glib-GVariant.html#g-variant-is-object-path" title="g_variant_is_object_path ()"><code class="function">g_variant_is_object_path()</code></a> if you're not sure.
1633
<div class="variablelist"><table border="0" class="variablelist">
1549
<div class="variablelist"><table border="0">
1635
1550
<col align="left" valign="top">
1640
1553
<td><p><span class="term"><em class="parameter"><code>object_path</code></em> :</span></p></td>
1664
1577
must contain only the characters "[A-Z][a-z][0-9]_". No sequence
1665
1578
(including the one following the final '/' character) may be empty.
1667
<div class="variablelist"><table border="0" class="variablelist">
1580
<div class="variablelist"><table border="0">
1669
1581
<col align="left" valign="top">
1674
1584
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
1692
1602
<em class="parameter"><code>string</code></em>. <em class="parameter"><code>string</code></em> must be a valid D-Bus type signature. Use
1693
1603
<a class="link" href="glib-GVariant.html#g-variant-is-signature" title="g_variant_is_signature ()"><code class="function">g_variant_is_signature()</code></a> if you're not sure.
1695
<div class="variablelist"><table border="0" class="variablelist">
1605
<div class="variablelist"><table border="0">
1697
1606
<col align="left" valign="top">
1702
1609
<td><p><span class="term"><em class="parameter"><code>signature</code></em> :</span></p></td>
1755
1659
If <em class="parameter"><code>child</code></em> is a floating reference (see <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>), the new
1756
1660
instance takes ownership of <em class="parameter"><code>child</code></em>.
1758
<div class="variablelist"><table border="0" class="variablelist">
1662
<div class="variablelist"><table border="0">
1760
1663
<col align="left" valign="top">
1765
1666
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1787
1688
If <em class="parameter"><code>length</code></em> is -1 then <em class="parameter"><code>strv</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated.
1789
<div class="variablelist"><table border="0" class="variablelist">
1690
<div class="variablelist"><table border="0">
1791
1691
<col align="left" valign="top">
1796
1694
<td><p><span class="term"><em class="parameter"><code>strv</code></em> :</span></p></td>
1827
1725
If <em class="parameter"><code>length</code></em> is -1 then <em class="parameter"><code>strv</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated.
1829
<div class="variablelist"><table border="0" class="variablelist">
1727
<div class="variablelist"><table border="0">
1831
1728
<col align="left" valign="top">
1836
1731
<td><p><span class="term"><em class="parameter"><code>strv</code></em> :</span></p></td>
1897
1789
If <em class="parameter"><code>length</code></em> is -1 then <em class="parameter"><code>strv</code></em> is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated.
1899
<div class="variablelist"><table border="0" class="variablelist">
1791
<div class="variablelist"><table border="0">
1901
1792
<col align="left" valign="top">
1906
1795
<td><p><span class="term"><em class="parameter"><code>strv</code></em> :</span></p></td>
1931
1820
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
1932
1821
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-BOOLEAN:CAPS" title="G_VARIANT_TYPE_BOOLEAN"><code class="literal">G_VARIANT_TYPE_BOOLEAN</code></a>.
1934
<div class="variablelist"><table border="0" class="variablelist">
1823
<div class="variablelist"><table border="0">
1936
1824
<col align="left" valign="top">
1941
1827
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1962
1848
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
1963
1849
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-BYTE:CAPS" title="G_VARIANT_TYPE_BYTE"><code class="literal">G_VARIANT_TYPE_BYTE</code></a>.
1965
<div class="variablelist"><table border="0" class="variablelist">
1851
<div class="variablelist"><table border="0">
1967
1852
<col align="left" valign="top">
1972
1855
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1992
1875
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
1993
1876
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-INT16:CAPS" title="G_VARIANT_TYPE_INT16"><code class="literal">G_VARIANT_TYPE_INT16</code></a>.
1995
<div class="variablelist"><table border="0" class="variablelist">
1878
<div class="variablelist"><table border="0">
1997
1879
<col align="left" valign="top">
2002
1882
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2022
1902
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
2023
1903
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-UINT16:CAPS" title="G_VARIANT_TYPE_UINT16"><code class="literal">G_VARIANT_TYPE_UINT16</code></a>.
2025
<div class="variablelist"><table border="0" class="variablelist">
1905
<div class="variablelist"><table border="0">
2027
1906
<col align="left" valign="top">
2032
1909
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2052
1929
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
2053
1930
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-INT32:CAPS" title="G_VARIANT_TYPE_INT32"><code class="literal">G_VARIANT_TYPE_INT32</code></a>.
2055
<div class="variablelist"><table border="0" class="variablelist">
1932
<div class="variablelist"><table border="0">
2057
1933
<col align="left" valign="top">
2062
1936
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2082
1956
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
2083
1957
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-UINT32:CAPS" title="G_VARIANT_TYPE_UINT32"><code class="literal">G_VARIANT_TYPE_UINT32</code></a>.
2085
<div class="variablelist"><table border="0" class="variablelist">
1959
<div class="variablelist"><table border="0">
2087
1960
<col align="left" valign="top">
2092
1963
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2112
1983
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
2113
1984
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-INT64:CAPS" title="G_VARIANT_TYPE_INT64"><code class="literal">G_VARIANT_TYPE_INT64</code></a>.
2115
<div class="variablelist"><table border="0" class="variablelist">
1986
<div class="variablelist"><table border="0">
2117
1987
<col align="left" valign="top">
2122
1990
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2142
2010
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
2143
2011
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-UINT64:CAPS" title="G_VARIANT_TYPE_UINT64"><code class="literal">G_VARIANT_TYPE_UINT64</code></a>.
2145
<div class="variablelist"><table border="0" class="variablelist">
2013
<div class="variablelist"><table border="0">
2147
2014
<col align="left" valign="top">
2152
2017
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2177
2042
that are sent alongside a D-Bus message. If you're not interacting
2178
2043
with D-Bus, you probably don't need them.
2180
<div class="variablelist"><table border="0" class="variablelist">
2045
<div class="variablelist"><table border="0">
2182
2046
<col align="left" valign="top">
2187
2049
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2207
2069
It is an error to call this function with a <em class="parameter"><code>value</code></em> of any type
2208
2070
other than <a class="link" href="glib-GVariantType.html#G-VARIANT-TYPE-DOUBLE:CAPS" title="G_VARIANT_TYPE_DOUBLE"><code class="literal">G_VARIANT_TYPE_DOUBLE</code></a>.
2210
<div class="variablelist"><table border="0" class="variablelist">
2072
<div class="variablelist"><table border="0">
2212
2073
<col align="left" valign="top">
2217
2076
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2323
2176
Unboxes <em class="parameter"><code>value</code></em>. The result is the <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance that was
2324
2177
contained in <em class="parameter"><code>value</code></em>.
2326
<div class="variablelist"><table border="0" class="variablelist">
2179
<div class="variablelist"><table border="0">
2328
2180
<col align="left" valign="top">
2333
2183
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2361
2211
For an empty array, <em class="parameter"><code>length</code></em> will be set to 0 and a pointer to a
2362
2212
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointer will be returned.
2364
<div class="variablelist"><table border="0" class="variablelist">
2214
<div class="variablelist"><table border="0">
2366
2215
<col align="left" valign="top">
2371
2218
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2405
2252
For an empty array, <em class="parameter"><code>length</code></em> will be set to 0 and a pointer to a
2406
2253
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointer will be returned.
2408
<div class="variablelist"><table border="0" class="variablelist">
2255
<div class="variablelist"><table border="0">
2410
2256
<col align="left" valign="top">
2415
2259
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2449
2293
For an empty array, <em class="parameter"><code>length</code></em> will be set to 0 and a pointer to a
2450
2294
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointer will be returned.
2452
<div class="variablelist"><table border="0" class="variablelist">
2296
<div class="variablelist"><table border="0">
2454
2297
<col align="left" valign="top">
2459
2300
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2493
2334
For an empty array, <em class="parameter"><code>length</code></em> will be set to 0 and a pointer to a
2494
2335
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointer will be returned.
2496
<div class="variablelist"><table border="0" class="variablelist">
2337
<div class="variablelist"><table border="0">
2498
2338
<col align="left" valign="top">
2503
2341
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2618
2450
For an empty array, <em class="parameter"><code>length</code></em> will be set to 0 and a pointer to a
2619
2451
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointer will be returned.
2621
<div class="variablelist"><table border="0" class="variablelist">
2453
<div class="variablelist"><table border="0">
2623
2454
<col align="left" valign="top">
2628
2457
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2661
2490
For an empty array, <em class="parameter"><code>length</code></em> will be set to 0 and a pointer to a
2662
2491
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointer will be returned.
2664
<div class="variablelist"><table border="0" class="variablelist">
2493
<div class="variablelist"><table border="0">
2666
2494
<col align="left" valign="top">
2671
2497
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
2704
2530
If <em class="parameter"><code>child</code></em> is a floating reference (see <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>), the new
2705
2531
instance takes ownership of <em class="parameter"><code>child</code></em>.
2707
<div class="variablelist"><table border="0" class="variablelist">
2533
<div class="variablelist"><table border="0">
2709
2534
<col align="left" valign="top">
2714
2537
<td><p><span class="term"><em class="parameter"><code>child_type</code></em> :</span></p></td>
2756
2579
If the <em class="parameter"><code>children</code></em> are floating references (see <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>), the
2757
2580
new instance takes ownership of them as if via <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>.
2759
<div class="variablelist"><table border="0" class="variablelist">
2582
<div class="variablelist"><table border="0">
2761
2583
<col align="left" valign="top">
2766
2586
<td><p><span class="term"><em class="parameter"><code>child_type</code></em> :</span></p></td>
2804
2624
If the <em class="parameter"><code>children</code></em> are floating references (see <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>), the
2805
2625
new instance takes ownership of them as if via <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>.
2807
<div class="variablelist"><table border="0" class="variablelist">
2627
<div class="variablelist"><table border="0">
2809
2628
<col align="left" valign="top">
2814
2631
<td><p><span class="term"><em class="parameter"><code>children</code></em> :</span></p></td>
2842
2659
If the <em class="parameter"><code>key</code></em> or <em class="parameter"><code>value</code></em> are floating references (see <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>),
2843
2660
the new instance takes ownership of them as if via <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>.
2845
<div class="variablelist"><table border="0" class="variablelist">
2662
<div class="variablelist"><table border="0">
2847
2663
<col align="left" valign="top">
2852
2666
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
2891
2705
<em class="parameter"><code>n_elements</code></em>, which must be non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> is set equal to the number of
2892
2706
items in the array.
2894
<div class="variablelist"><table border="0" class="variablelist">
2708
<div class="variablelist"><table border="0">
2896
2709
<col align="left" valign="top">
2901
2712
<td><p><span class="term"><em class="parameter"><code>element_type</code></em> :</span></p></td>
2930
2741
Given a maybe-typed <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance, extract its value. If the
2931
2742
value is Nothing, then this function returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.
2933
<div class="variablelist"><table border="0" class="variablelist">
2744
<div class="variablelist"><table border="0">
2935
2745
<col align="left" valign="top">
2940
2748
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3113
2912
returned. If <em class="parameter"><code>expected_type</code></em> was specified then any non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> return
3114
2913
value will have this type.
3116
<div class="variablelist"><table border="0" class="variablelist">
2915
<div class="variablelist"><table border="0">
3118
2916
<col align="left" valign="top">
3123
2919
<td><p><span class="term"><em class="parameter"><code>dictionary</code></em> :</span></p></td>
3270
3063
<em class="parameter"><code>n_elements</code></em>, which must be non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> is set equal to the number of
3271
3064
items in the array.
3273
<div class="variablelist"><table border="0" class="variablelist">
3066
<div class="variablelist"><table border="0">
3275
3067
<col align="left" valign="top">
3280
3070
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3470
3251
needed. The exact time of this call is unspecified and might even be
3471
3252
before this function returns.
3473
<div class="variablelist"><table border="0" class="variablelist">
3254
<div class="variablelist"><table border="0">
3475
3255
<col align="left" valign="top">
3480
3258
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
3580
3355
data from untrusted sources and you want to ensure your serialised
3581
3356
output is definitely in normal form.
3583
<div class="variablelist"><table border="0" class="variablelist">
3358
<div class="variablelist"><table border="0">
3585
3359
<col align="left" valign="top">
3590
3362
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3618
3390
being trusted. If the value was already marked as being trusted then
3619
3391
this function will immediately return <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a>.
3621
<div class="variablelist"><table border="0" class="variablelist">
3393
<div class="variablelist"><table border="0">
3623
3394
<col align="left" valign="top">
3628
3397
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3654
3423
The type of <em class="parameter"><code>value</code></em> is <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> only to allow use of this
3655
3424
function with <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>. <em class="parameter"><code>value</code></em> must be a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a>.
3657
<div class="variablelist"><table border="0" class="variablelist">
3426
<div class="variablelist"><table border="0">
3659
3427
<col align="left" valign="top">
3664
3430
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3665
<td>a basic <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> value as a <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a>. <span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GVariant]</span>
3431
<td>a basic <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> value as a <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a>. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GVariant]</span>
3686
3452
The types of <em class="parameter"><code>one</code></em> and <em class="parameter"><code>two</code></em> are <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> only to allow use of
3687
3453
this function with <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>. They must each be a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a>.
3689
<div class="variablelist"><table border="0" class="variablelist">
3455
<div class="variablelist"><table border="0">
3691
3456
<col align="left" valign="top">
3696
3459
<td><p><span class="term"><em class="parameter"><code>one</code></em> :</span></p></td>
3697
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance. <span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GVariant]</span>
3460
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GVariant]</span>
3701
3464
<td><p><span class="term"><em class="parameter"><code>two</code></em> :</span></p></td>
3702
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance. <span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GVariant]</span>
3465
<td>a <a class="link" href="glib-GVariant.html#GVariant" title="GVariant"><span class="type">GVariant</span></a> instance. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> GVariant]</span>
3726
3489
If <em class="parameter"><code>type_annotate</code></em> is <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a>, then type information is included in
3729
<div class="variablelist"><table border="0" class="variablelist">
3492
<div class="variablelist"><table border="0">
3731
3493
<col align="left" valign="top">
3736
3496
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3765
3525
If <em class="parameter"><code>string</code></em> is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> then it is appended to and returned. Else,
3766
3526
a new empty <a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="type">GString</span></a> is allocated and it is returned.
3768
<div class="variablelist"><table border="0" class="variablelist">
3528
<div class="variablelist"><table border="0">
3770
3529
<col align="left" valign="top">
3775
3532
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3824
3581
A reference is taken to the container that <em class="parameter"><code>iter</code></em> is iterating over
3825
3582
and will be releated only when <a class="link" href="glib-GVariant.html#g-variant-iter-free" title="g_variant_iter_free ()"><code class="function">g_variant_iter_free()</code></a> is called.
3827
<div class="variablelist"><table border="0" class="variablelist">
3584
<div class="variablelist"><table border="0">
3829
3585
<col align="left" valign="top">
3834
3588
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
3853
3607
iterators that were returned by <a class="link" href="glib-GVariant.html#g-variant-iter-new" title="g_variant_iter_new ()"><code class="function">g_variant_iter_new()</code></a> or
3854
3608
<a class="link" href="glib-GVariant.html#g-variant-iter-copy" title="g_variant_iter_copy ()"><code class="function">g_variant_iter_copy()</code></a>.
3856
<div class="variablelist"><table border="0" class="variablelist">
3610
<div class="variablelist"><table border="0">
3858
3611
<col align="left" valign="top">
3862
3613
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
3863
3614
<td>a heap-allocated <a class="link" href="glib-GVariant.html#GVariantIter" title="struct GVariantIter"><span class="type">GVariantIter</span></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
3952
3697
A reference is taken to <em class="parameter"><code>value</code></em> and will be released only when
3953
3698
<a class="link" href="glib-GVariant.html#g-variant-iter-free" title="g_variant_iter_free ()"><code class="function">g_variant_iter_free()</code></a> is called.
3955
<div class="variablelist"><table border="0" class="variablelist">
3700
<div class="variablelist"><table border="0">
3957
3701
<col align="left" valign="top">
3962
3704
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
3989
3731
<div class="example">
3990
<a name="id1050618"></a><p class="title"><b>Example 18. Iterating with <a class="link" href="glib-GVariant.html#g-variant-iter-next-value" title="g_variant_iter_next_value ()"><code class="function">g_variant_iter_next_value()</code></a></b></p>
3991
<div class="example-contents">
3992
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
3995
<td class="listing_lines" align="right"><pre>1
4013
<td class="listing_code"><pre class="programlisting"><span class="comment">/* recursively iterate a container */</span>
4014
<span class="type">void</span>
4015
<span class="function">iterate_container_recursive</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">container</span><span class="symbol">)</span>
4016
<span class="cbracket">{</span>
4017
<span class="normal"> </span><span class="usertype">GVariantIter</span><span class="normal"> iter</span><span class="symbol">;</span>
4018
<span class="normal"> </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">child</span><span class="symbol">;</span>
4020
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-iter-init">g_variant_iter_init</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> container</span><span class="symbol">);</span>
4021
<span class="normal"> </span><span class="keyword">while</span><span class="normal"> </span><span class="symbol">((</span><span class="normal">child </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-iter-next-value">g_variant_iter_next_value</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">iter</span><span class="symbol">)))</span>
4022
<span class="normal"> </span><span class="cbracket">{</span>
4023
<span class="normal"> </span><span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"type '%s'</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get-type-string">g_variant_get_type_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">child</span><span class="symbol">));</span>
4025
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="glib-GVariant.html#g-variant-is-container">g_variant_is_container</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">child</span><span class="symbol">))</span>
4026
<span class="normal"> </span><span class="function">iterate_container_recursive</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">child</span><span class="symbol">);</span>
4028
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">child</span><span class="symbol">);</span>
4029
<span class="normal"> </span><span class="cbracket">}</span>
4030
<span class="cbracket">}</span></pre></td>
3732
<a name="idp65061328"></a><p class="title"><b>Example 18. Iterating with <a class="link" href="glib-GVariant.html#g-variant-iter-next-value" title="g_variant_iter_next_value ()"><code class="function">g_variant_iter_next_value()</code></a></b></p>
3733
<div class="example-contents"><pre class="programlisting">
3734
/* recursively iterate a container */
3736
iterate_container_recursive (GVariant *container)
3741
g_variant_iter_init (&iter, container);
3742
while ((child = g_variant_iter_next_value (&iter)))
3744
g_print ("type '%s'\n", g_variant_get_type_string (child));
3746
if (g_variant_is_container (child))
3747
iterate_container_recursive (child);
3749
g_variant_unref (child);
4037
3754
<p><br class="example-break">
4039
<div class="variablelist"><table border="0" class="variablelist">
3756
<div class="variablelist"><table border="0">
4041
3757
<col align="left" valign="top">
4046
3760
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
4084
3798
<div class="example">
4085
<a name="id1050855"></a><p class="title"><b>Example 19. Memory management with <a class="link" href="glib-GVariant.html#g-variant-iter-next" title="g_variant_iter_next ()"><code class="function">g_variant_iter_next()</code></a></b></p>
4086
<div class="example-contents">
4087
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
4090
<td class="listing_lines" align="right"><pre>1
4109
<td class="listing_code"><pre class="programlisting"><span class="comment">/* Iterates a dictionary of type 'a{sv}' */</span>
4110
<span class="type">void</span>
4111
<span class="function">iterate_dictionary</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">dictionary</span><span class="symbol">)</span>
4112
<span class="cbracket">{</span>
4113
<span class="normal"> </span><span class="usertype">GVariantIter</span><span class="normal"> iter</span><span class="symbol">;</span>
4114
<span class="normal"> </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
4115
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">key</span><span class="symbol">;</span>
4117
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-iter-init">g_variant_iter_init</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> dictionary</span><span class="symbol">);</span>
4118
<span class="normal"> </span><span class="keyword">while</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="glib-GVariant.html#g-variant-iter-next">g_variant_iter_next</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"{sv}"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">key</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">value</span><span class="symbol">))</span>
4119
<span class="normal"> </span><span class="cbracket">{</span>
4120
<span class="normal"> </span><span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Item '%s' has type '%s'</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> key</span><span class="symbol">,</span>
4121
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get-type-string">g_variant_get_type_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">));</span>
4123
<span class="normal"> </span><span class="comment">/* must free data for ourselves */</span>
4124
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-unref">g_variant_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">);</span>
4125
<span class="normal"> </span><span class="function"><a href="glib-Memory-Allocation.html#g-free">g_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">key</span><span class="symbol">);</span>
4126
<span class="normal"> </span><span class="cbracket">}</span>
4127
<span class="cbracket">}</span></pre></td>
3799
<a name="idp65089792"></a><p class="title"><b>Example 19. Memory management with <a class="link" href="glib-GVariant.html#g-variant-iter-next" title="g_variant_iter_next ()"><code class="function">g_variant_iter_next()</code></a></b></p>
3800
<div class="example-contents"><pre class="programlisting">
3801
/* Iterates a dictionary of type 'a{sv}' */
3803
iterate_dictionary (GVariant *dictionary)
3809
g_variant_iter_init (&iter, dictionary);
3810
while (g_variant_iter_next (&iter, "{sv}", &key, &value))
3812
g_print ("Item '%s' has type '%s'\n", key,
3813
g_variant_get_type_string (value));
3815
/* must free data for ourselves */
3816
g_variant_unref (value);
4134
3822
<p><br class="example-break">
4215
3900
<div class="example">
4216
<a name="id1051207"></a><p class="title"><b>Example 20. Memory management with <a class="link" href="glib-GVariant.html#g-variant-iter-loop" title="g_variant_iter_loop ()"><code class="function">g_variant_iter_loop()</code></a></b></p>
4217
<div class="example-contents">
4218
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
4221
<td class="listing_lines" align="right"><pre>1
4239
<td class="listing_code"><pre class="programlisting"><span class="comment">/* Iterates a dictionary of type 'a{sv}' */</span>
4240
<span class="type">void</span>
4241
<span class="function">iterate_dictionary</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">dictionary</span><span class="symbol">)</span>
4242
<span class="cbracket">{</span>
4243
<span class="normal"> </span><span class="usertype">GVariantIter</span><span class="normal"> iter</span><span class="symbol">;</span>
4244
<span class="normal"> </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
4245
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">key</span><span class="symbol">;</span>
4247
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-iter-init">g_variant_iter_init</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> dictionary</span><span class="symbol">);</span>
4248
<span class="normal"> </span><span class="keyword">while</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="glib-GVariant.html#g-variant-iter-loop">g_variant_iter_loop</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"{sv}"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">key</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">value</span><span class="symbol">))</span>
4249
<span class="normal"> </span><span class="cbracket">{</span>
4250
<span class="normal"> </span><span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Item '%s' has type '%s'</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> key</span><span class="symbol">,</span>
4251
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get-type-string">g_variant_get_type_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">));</span>
4253
<span class="normal"> </span><span class="comment">/* no need to free 'key' and 'value' here */</span>
4254
<span class="normal"> </span><span class="comment">/* unless breaking out of this loop */</span>
4255
<span class="normal"> </span><span class="cbracket">}</span>
4256
<span class="cbracket">}</span></pre></td>
3901
<a name="idp65132000"></a><p class="title"><b>Example 20. Memory management with <a class="link" href="glib-GVariant.html#g-variant-iter-loop" title="g_variant_iter_loop ()"><code class="function">g_variant_iter_loop()</code></a></b></p>
3902
<div class="example-contents"><pre class="programlisting">
3903
/* Iterates a dictionary of type 'a{sv}' */
3905
iterate_dictionary (GVariant *dictionary)
3911
g_variant_iter_init (&iter, dictionary);
3912
while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
3914
g_print ("Item '%s' has type '%s'\n", key,
3915
g_variant_get_type_string (value));
3917
/* no need to free 'key' and 'value' here */
3918
/* unless breaking out of this loop */
4263
3923
<p><br class="example-break">
4344
4001
Don't call this on stack-allocated <a class="link" href="glib-GVariant.html#GVariantBuilder" title="struct GVariantBuilder"><span class="type">GVariantBuilder</span></a> instances or bad
4345
4002
things will happen.
4347
<div class="variablelist"><table border="0" class="variablelist">
4004
<div class="variablelist"><table border="0">
4349
4005
<col align="left" valign="top">
4353
4007
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
4354
4008
<td>a <a class="link" href="glib-GVariant.html#GVariantBuilder" title="struct GVariantBuilder"><span class="type">GVariantBuilder</span></a> allocated by <a class="link" href="glib-GVariant.html#g-variant-builder-new" title="g_variant_builder_new ()"><code class="function">g_variant_builder_new()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
4405
4056
the stack of the calling function and initialise it with
4406
4057
<a class="link" href="glib-GVariant.html#g-variant-builder-init" title="g_variant_builder_init ()"><code class="function">g_variant_builder_init()</code></a>.
4408
<div class="variablelist"><table border="0" class="variablelist">
4059
<div class="variablelist"><table border="0">
4410
4060
<col align="left" valign="top">
4415
4063
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
4506
4151
<a class="link" href="glib-GVariant.html#GVariantBuilder" title="struct GVariantBuilder"><span class="type">GVariantBuilder</span></a> or one that is set to all-zeros but it is not valid
4507
4152
to call this function on uninitialised memory.
4509
<div class="variablelist"><table border="0" class="variablelist">
4154
<div class="variablelist"><table border="0">
4511
4155
<col align="left" valign="top">
4515
4157
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
4516
4158
<td>a <a class="link" href="glib-GVariant.html#GVariantBuilder" title="struct GVariantBuilder"><span class="type">GVariantBuilder</span></a>
4538
4180
If <em class="parameter"><code>value</code></em> is a floating reference (see <a class="link" href="glib-GVariant.html#g-variant-ref-sink" title="g_variant_ref_sink ()"><code class="function">g_variant_ref_sink()</code></a>),
4539
4181
the <em class="parameter"><code>builder</code></em> instance takes ownership of <em class="parameter"><code>value</code></em>.
4541
<div class="variablelist"><table border="0" class="variablelist">
4183
<div class="variablelist"><table border="0">
4543
4184
<col align="left" valign="top">
4548
4187
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
4737
4367
inconsistent value to be constructed (ie: adding too many values or
4738
4368
a value of an incorrect type).
4740
<div class="variablelist"><table border="0" class="variablelist">
4370
<div class="variablelist"><table border="0">
4742
4371
<col align="left" valign="top">
4747
4374
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
4770
4397
inconsistent value to be constructed (ie: too few values added to the
4773
<div class="variablelist"><table border="0" class="variablelist">
4400
<div class="variablelist"><table border="0">
4775
4401
<col align="left" valign="top">
4779
4403
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
4780
4404
<td>a <a class="link" href="glib-GVariant.html#GVariantBuilder" title="struct GVariantBuilder"><span class="type">GVariantBuilder</span></a>
4968
4589
Officially, the language understood by the parser is "any string
4969
4590
produced by <a class="link" href="glib-GVariant.html#g-variant-print" title="g_variant_print ()"><code class="function">g_variant_print()</code></a>".
4971
<div class="variablelist"><table border="0" class="variablelist">
4592
<div class="variablelist"><table border="0">
4973
4593
<col align="left" valign="top">
4978
4596
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
5033
4651
result. This can also be done by adding the result to a container,
5034
4652
or by passing it to another <a class="link" href="glib-GVariant.html#g-variant-new" title="g_variant_new ()"><code class="function">g_variant_new()</code></a> call.
5036
<div class="variablelist"><table border="0" class="variablelist">
4654
<div class="variablelist"><table border="0">
5038
4655
<col align="left" valign="top">
5043
4658
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
5080
<div class="informalexample">
5081
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
5084
<td class="listing_lines" align="right"><pre>1</pre></td>
5085
<td class="listing_code"><pre class="programlisting"><span class="function"><a href="glib-GVariant.html#g-variant-new-parsed">g_variant_new_parsed</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"[('one', 1), ('two', %i), (%s, 3)]"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"three"</span><span class="symbol">);</span></pre></td>
4695
<div class="informalexample"><pre class="programlisting">
4696
g_variant_new_parsed ("[('one', 1), ('two', %i), (%s, 3)]", 2, "three");
5106
4713
be anything along the lines of "%*", "%?", "%r", or anything starting
5109
<div class="variablelist"><table border="0" class="variablelist">
4716
<div class="variablelist"><table border="0">
5111
4717
<col align="left" valign="top">
5116
4720
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>