499
<td class="listing_code"><pre class="programlisting"><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value3</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value4</span><span class="symbol">;</span>
501
<span class="normal">value1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"y"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">200</span><span class="symbol">);</span>
502
<span class="normal">value2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"b"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">);</span>
503
<span class="normal">value3 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"d"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">37.5</span><span class="symbol">):</span>
504
<span class="normal">value4 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"x"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="glib-Basic-Types.html#G-GINT64-CONSTANT:CAPS">G_GINT64_CONSTANT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="number">998877665544332211</span><span class="symbol">));</span>
506
<span class="cbracket">{</span>
507
<span class="normal"> </span><span class="usertype">gdouble</span><span class="normal"> floating</span><span class="symbol">;</span>
508
<span class="normal"> </span><span class="usertype">gboolean</span><span class="normal"> truth</span><span class="symbol">;</span>
509
<span class="normal"> </span><span class="usertype">gint64</span><span class="normal"> bignum</span><span class="symbol">;</span>
512
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"y"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span><span class="normal"> </span><span class="comment">/* ignore the value. */</span>
513
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"b"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">truth</span><span class="symbol">);</span>
514
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value3</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"d"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">floating</span><span class="symbol">);</span>
515
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value4</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"x"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">bignum</span><span class="symbol">);</span>
516
<span class="cbracket">}</span></pre></td>
499
<td class="listing_code"><pre class="programlisting">GVariant <span class="gtkdoc opt">*</span>value1<span class="gtkdoc opt">, *</span>value2<span class="gtkdoc opt">, *</span>value3<span class="gtkdoc opt">, *</span>value4<span class="gtkdoc opt">;</span>
501
value1 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"y"</span><span class="gtkdoc opt">,</span> <span class="number">200</span><span class="gtkdoc opt">);</span>
502
value2 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"b"</span><span class="gtkdoc opt">,</span> TRUE<span class="gtkdoc opt">);</span>
503
value3 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"d"</span><span class="gtkdoc opt">,</span> <span class="number">37.5</span><span class="gtkdoc opt">):</span>
504
value4 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"x"</span><span class="gtkdoc opt">,</span> <span class="function"><a href="glib-Basic-Types.html#G-GINT64-CONSTANT:CAPS">G_GINT64_CONSTANT</a></span> <span class="gtkdoc opt">(</span><span class="number">998877665544332211</span><span class="gtkdoc opt">));</span>
506
<span class="gtkdoc opt">{</span>
507
gdouble floating<span class="gtkdoc opt">;</span>
508
gboolean truth<span class="gtkdoc opt">;</span>
509
gint64 bignum<span class="gtkdoc opt">;</span>
512
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value1<span class="gtkdoc opt">,</span> <span class="string">"y"</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">);</span> <span class="comment">/* ignore the value. */</span>
513
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value2<span class="gtkdoc opt">,</span> <span class="string">"b"</span><span class="gtkdoc opt">, &</span>truth<span class="gtkdoc opt">);</span>
514
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value3<span class="gtkdoc opt">,</span> <span class="string">"d"</span><span class="gtkdoc opt">, &</span>floating<span class="gtkdoc opt">);</span>
515
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value4<span class="gtkdoc opt">,</span> <span class="string">"x"</span><span class="gtkdoc opt">, &</span>bignum<span class="gtkdoc opt">);</span>
516
<span class="gtkdoc opt">}</span></pre></td>
572
<td class="listing_code"><pre class="programlisting"><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value3</span><span class="symbol">;</span>
574
<span class="normal">value1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"hello world!"</span><span class="symbol">);</span>
575
<span class="normal">value2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"o"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"/must/be/a/valid/path"</span><span class="symbol">);</span>
576
<span class="normal">value3 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"g"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"iias"</span><span class="symbol">);</span>
578
<span class="preproc">#if</span><span class="normal"> </span><span class="number">0</span>
579
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span><span class="normal"> </span><span class="comment">/* not valid: NULL is not a string. */</span>
580
<span class="preproc">#endif</span>
582
<span class="cbracket">{</span>
583
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">result</span><span class="symbol">;</span>
585
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">result</span><span class="symbol">);</span>
586
<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">"It was '%s'</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> result</span><span class="symbol">);</span>
587
<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">result</span><span class="symbol">);</span>
588
<span class="cbracket">}</span></pre></td>
572
<td class="listing_code"><pre class="programlisting">GVariant <span class="gtkdoc opt">*</span>value1<span class="gtkdoc opt">, *</span>value2<span class="gtkdoc opt">, *</span>value3<span class="gtkdoc opt">;</span>
574
value1 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"s"</span><span class="gtkdoc opt">,</span> <span class="string">"hello world!"</span><span class="gtkdoc opt">);</span>
575
value2 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"o"</span><span class="gtkdoc opt">,</span> <span class="string">"/must/be/a/valid/path"</span><span class="gtkdoc opt">);</span>
576
value3 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"g"</span><span class="gtkdoc opt">,</span> <span class="string">"iias"</span><span class="gtkdoc opt">);</span>
578
<span class="gtkdoc ppc">#if 0</span>
579
<span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"s"</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">);</span> <span class="comment">/* not valid: NULL is not a string. */</span>
580
<span class="gtkdoc ppc">#endif</span>
582
<span class="gtkdoc opt">{</span>
583
gchar <span class="gtkdoc opt">*</span>result<span class="gtkdoc opt">;</span>
585
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value1<span class="gtkdoc opt">,</span> <span class="string">"s"</span><span class="gtkdoc opt">, &</span>result<span class="gtkdoc opt">);</span>
586
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"It was '%s'</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> result<span class="gtkdoc opt">);</span>
587
<span class="function"><a href="glib-Memory-Allocation.html#g-free">g_free</a></span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">);</span>
588
<span class="gtkdoc opt">}</span></pre></td>
705
<td class="listing_code"><pre class="programlisting"><span class="usertype">GVariantBuilder</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">builder</span><span class="symbol">;</span>
706
<span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
708
<span class="normal">builder </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-builder-new">g_variant_builder_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="glib-GVariantType.html#G-VARIANT-TYPE:CAPS">G_VARIANT_TYPE</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"as"</span><span class="symbol">));</span>
709
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">builder</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"when"</span><span class="symbol">);</span>
710
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">builder</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"in"</span><span class="symbol">);</span>
711
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">builder</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"the"</span><span class="symbol">);</span>
712
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">builder</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"course"</span><span class="symbol">);</span>
713
<span class="normal">value </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"as"</span><span class="symbol">,</span><span class="normal"> builder</span><span class="symbol">);</span>
714
<span class="function"><a href="glib-GVariant.html#g-variant-builder-unref">g_variant_builder_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">builder</span><span class="symbol">);</span>
716
<span class="cbracket">{</span>
717
<span class="normal"> </span><span class="usertype">GVariantIter</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">iter</span><span class="symbol">;</span>
718
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">str</span><span class="symbol">;</span>
720
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"as"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">iter</span><span class="symbol">);</span>
721
<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">"s"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">str</span><span class="symbol">))</span>
722
<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">"%s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> str</span><span class="symbol">);</span>
723
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-iter-free">g_variant_iter_free</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">iter</span><span class="symbol">);</span>
724
<span class="cbracket">}</span>
726
<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></pre></td>
705
<td class="listing_code"><pre class="programlisting">GVariantBuilder <span class="gtkdoc opt">*</span>builder<span class="gtkdoc opt">;</span>
706
GVariant <span class="gtkdoc opt">*</span>value<span class="gtkdoc opt">;</span>
708
builder <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-builder-new">g_variant_builder_new</a></span> <span class="gtkdoc opt">(</span><span class="function"><a href="glib-GVariantType.html#G-VARIANT-TYPE:CAPS">G_VARIANT_TYPE</a></span> <span class="gtkdoc opt">(</span><span class="string">"as"</span><span class="gtkdoc opt">));</span>
709
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">,</span> <span class="string">"s"</span><span class="gtkdoc opt">,</span> <span class="string">"when"</span><span class="gtkdoc opt">);</span>
710
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">,</span> <span class="string">"s"</span><span class="gtkdoc opt">,</span> <span class="string">"in"</span><span class="gtkdoc opt">);</span>
711
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">,</span> <span class="string">"s"</span><span class="gtkdoc opt">,</span> <span class="string">"the"</span><span class="gtkdoc opt">);</span>
712
<span class="function"><a href="glib-GVariant.html#g-variant-builder-add">g_variant_builder_add</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">,</span> <span class="string">"s"</span><span class="gtkdoc opt">,</span> <span class="string">"course"</span><span class="gtkdoc opt">);</span>
713
value <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"as"</span><span class="gtkdoc opt">,</span> builder<span class="gtkdoc opt">);</span>
714
<span class="function"><a href="glib-GVariant.html#g-variant-builder-unref">g_variant_builder_unref</a></span> <span class="gtkdoc opt">(</span>builder<span class="gtkdoc opt">);</span>
716
<span class="gtkdoc opt">{</span>
717
GVariantIter <span class="gtkdoc opt">*</span>iter<span class="gtkdoc opt">;</span>
718
gchar <span class="gtkdoc opt">*</span>str<span class="gtkdoc opt">;</span>
720
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value<span class="gtkdoc opt">,</span> <span class="string">"as"</span><span class="gtkdoc opt">, &</span>iter<span class="gtkdoc opt">);</span>
721
<span class="keyword">while</span> <span class="gtkdoc opt">(</span><span class="function"><a href="glib-GVariant.html#g-variant-iter-loop">g_variant_iter_loop</a></span> <span class="gtkdoc opt">(</span>iter<span class="gtkdoc opt">,</span> <span class="string">"s"</span><span class="gtkdoc opt">, &</span>str<span class="gtkdoc opt">))</span>
722
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"%s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> str<span class="gtkdoc opt">);</span>
723
<span class="function"><a href="glib-GVariant.html#g-variant-iter-free">g_variant_iter_free</a></span> <span class="gtkdoc opt">(</span>iter<span class="gtkdoc opt">);</span>
724
<span class="gtkdoc opt">}</span>
726
<span class="function"><a href="glib-GVariant.html#g-variant-unref">g_variant_unref</a></span> <span class="gtkdoc opt">(</span>value<span class="gtkdoc opt">);</span></pre></td>
850
<td class="listing_code"><pre class="programlisting"><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value3</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value4</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value5</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value6</span><span class="symbol">;</span>
851
<span class="normal">value1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"ms"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Hello world"</span><span class="symbol">);</span>
852
<span class="normal">value2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"ms"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span>
853
<span class="normal">value3 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(m(ii)s)"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">,</span><span class="normal"> </span><span class="number">123</span><span class="symbol">,</span><span class="normal"> </span><span class="number">456</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Done"</span><span class="symbol">);</span>
854
<span class="normal">value4 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(m(ii)s)"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#FALSE:CAPS">FALSE</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Done"</span><span class="symbol">);</span><span class="normal"> </span><span class="comment">/* both '-1' are ignored. */</span>
855
<span class="normal">value5 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(m@(ii)s)"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Done"</span><span class="symbol">);</span>
857
<span class="cbracket">{</span>
858
<span class="normal"> </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">contents</span><span class="symbol">;</span>
859
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">cstr</span><span class="symbol">;</span>
860
<span class="normal"> </span><span class="usertype">gboolean</span><span class="normal"> just</span><span class="symbol">;</span>
861
<span class="normal"> </span><span class="usertype">gint32</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">;</span>
862
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">str</span><span class="symbol">;</span>
864
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"ms"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">str</span><span class="symbol">);</span>
865
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">str </span><span class="symbol">!=</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
866
<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">"str: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> str</span><span class="symbol">);</span>
867
<span class="normal"> </span><span class="keyword">else</span>
868
<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">"it was null</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">);</span>
869
<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">str</span><span class="symbol">);</span>
872
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"m&s"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">cstr</span><span class="symbol">);</span>
873
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">cstr </span><span class="symbol">!=</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
874
<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">"str: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> cstr</span><span class="symbol">);</span>
875
<span class="normal"> </span><span class="keyword">else</span>
876
<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">"it was null</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">);</span>
877
<span class="normal"> </span><span class="comment">/* don't free 'cstr' */</span>
880
<span class="normal"> </span><span class="comment">/* NULL passed for the gboolean *, but two 'gint32 *' still collected */</span>
881
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value3</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(m(ii)s)"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">str</span><span class="symbol">);</span>
882
<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">"string is %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> str</span><span class="symbol">);</span>
883
<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">str</span><span class="symbol">);</span>
885
<span class="normal"> </span><span class="comment">/* note: &s used, so g_free() not needed */</span>
886
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value4</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(m(ii)&s)"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">just</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">x</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">y</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">cstr</span><span class="symbol">);</span>
887
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">just</span><span class="symbol">)</span>
888
<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">"it was (%d, %d)</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">);</span>
889
<span class="normal"> </span><span class="keyword">else</span>
890
<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">"it was null</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">);</span>
891
<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">"string is %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> cstr</span><span class="symbol">);</span>
892
<span class="normal"> </span><span class="comment">/* don't free 'cstr' */</span>
895
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value5</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(m*s)"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">contents</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span><span class="normal"> </span><span class="comment">/* ignore the string. */</span>
896
<span class="normal"> </span><span class="keyword">if</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">contents </span><span class="symbol">!=</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">)</span>
897
<span class="normal"> </span><span class="cbracket">{</span>
898
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">contents</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(ii)"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">x</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">y</span><span class="symbol">);</span>
899
<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">"it was (%d, %d)</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">);</span>
900
<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">contents</span><span class="symbol">);</span>
901
<span class="normal"> </span><span class="cbracket">}</span>
902
<span class="normal"> </span><span class="keyword">else</span>
903
<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">"it was null</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">);</span>
904
<span class="cbracket">}</span></pre></td>
850
<td class="listing_code"><pre class="programlisting">GVariant <span class="gtkdoc opt">*</span>value1<span class="gtkdoc opt">, *</span>value2<span class="gtkdoc opt">, *</span>value3<span class="gtkdoc opt">, *</span>value4<span class="gtkdoc opt">, *</span>value5<span class="gtkdoc opt">, *</span>value6<span class="gtkdoc opt">;</span>
851
value1 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"ms"</span><span class="gtkdoc opt">,</span> <span class="string">"Hello world"</span><span class="gtkdoc opt">);</span>
852
value2 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"ms"</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">);</span>
853
value3 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"(m(ii)s)"</span><span class="gtkdoc opt">,</span> TRUE<span class="gtkdoc opt">,</span> <span class="number">123</span><span class="gtkdoc opt">,</span> <span class="number">456</span><span class="gtkdoc opt">,</span> <span class="string">"Done"</span><span class="gtkdoc opt">);</span>
854
value4 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"(m(ii)s)"</span><span class="gtkdoc opt">,</span> FALSE<span class="gtkdoc opt">, -</span><span class="number">1</span><span class="gtkdoc opt">, -</span><span class="number">1</span><span class="gtkdoc opt">,</span> <span class="string">"Done"</span><span class="gtkdoc opt">);</span> <span class="comment">/* both '-1' are ignored. */</span>
855
value5 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"(m@(ii)s)"</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">,</span> <span class="string">"Done"</span><span class="gtkdoc opt">);</span>
857
<span class="gtkdoc opt">{</span>
858
GVariant <span class="gtkdoc opt">*</span>contents<span class="gtkdoc opt">;</span>
859
<span class="gtkdoc kwb">const</span> gchar <span class="gtkdoc opt">*</span>cstr<span class="gtkdoc opt">;</span>
860
gboolean just<span class="gtkdoc opt">;</span>
861
gint32 x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">;</span>
862
gchar <span class="gtkdoc opt">*</span>str<span class="gtkdoc opt">;</span>
864
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value1<span class="gtkdoc opt">,</span> <span class="string">"ms"</span><span class="gtkdoc opt">, &</span>str<span class="gtkdoc opt">);</span>
865
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>str <span class="gtkdoc opt">!=</span> NULL<span class="gtkdoc opt">)</span>
866
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"str: %s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> str<span class="gtkdoc opt">);</span>
867
<span class="keyword">else</span>
868
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it was null</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">);</span>
869
<span class="function"><a href="glib-Memory-Allocation.html#g-free">g_free</a></span> <span class="gtkdoc opt">(</span>str<span class="gtkdoc opt">);</span>
872
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value2<span class="gtkdoc opt">,</span> <span class="string">"m&s"</span><span class="gtkdoc opt">, &</span>cstr<span class="gtkdoc opt">);</span>
873
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>cstr <span class="gtkdoc opt">!=</span> NULL<span class="gtkdoc opt">)</span>
874
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"str: %s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> cstr<span class="gtkdoc opt">);</span>
875
<span class="keyword">else</span>
876
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it was null</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">);</span>
877
<span class="comment">/* don't free 'cstr' */</span>
880
<span class="comment">/* NULL passed for the gboolean *, but two 'gint32 *' still collected */</span>
881
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value3<span class="gtkdoc opt">,</span> <span class="string">"(m(ii)s)"</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">, &</span>str<span class="gtkdoc opt">);</span>
882
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"string is %s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> str<span class="gtkdoc opt">);</span>
883
<span class="function"><a href="glib-Memory-Allocation.html#g-free">g_free</a></span> <span class="gtkdoc opt">(</span>str<span class="gtkdoc opt">);</span>
885
<span class="comment">/* note: &s used, so g_free() not needed */</span>
886
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value4<span class="gtkdoc opt">,</span> <span class="string">"(m(ii)&s)"</span><span class="gtkdoc opt">, &</span>just<span class="gtkdoc opt">, &</span>x<span class="gtkdoc opt">, &</span>y<span class="gtkdoc opt">, &</span>cstr<span class="gtkdoc opt">);</span>
887
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>just<span class="gtkdoc opt">)</span>
888
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it was (%d, %d)</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">);</span>
889
<span class="keyword">else</span>
890
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it was null</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">);</span>
891
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"string is %s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> cstr<span class="gtkdoc opt">);</span>
892
<span class="comment">/* don't free 'cstr' */</span>
895
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value5<span class="gtkdoc opt">,</span> <span class="string">"(m*s)"</span><span class="gtkdoc opt">, &</span>contents<span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">);</span> <span class="comment">/* ignore the string. */</span>
896
<span class="keyword">if</span> <span class="gtkdoc opt">(</span>contents <span class="gtkdoc opt">!=</span> NULL<span class="gtkdoc opt">)</span>
897
<span class="gtkdoc opt">{</span>
898
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>contents<span class="gtkdoc opt">,</span> <span class="string">"(ii)"</span><span class="gtkdoc opt">, &</span>x<span class="gtkdoc opt">, &</span>y<span class="gtkdoc opt">);</span>
899
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it was (%d, %d)</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">);</span>
900
<span class="function"><a href="glib-GVariant.html#g-variant-unref">g_variant_unref</a></span> <span class="gtkdoc opt">(</span>contents<span class="gtkdoc opt">);</span>
901
<span class="gtkdoc opt">}</span>
902
<span class="keyword">else</span>
903
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it was null</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">);</span>
904
<span class="gtkdoc opt">}</span></pre></td>
944
<td class="listing_code"><pre class="programlisting"><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value2</span><span class="symbol">;</span>
946
<span class="normal">value1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(s(ii))"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Hello"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">55</span><span class="symbol">,</span><span class="normal"> </span><span class="number">77</span><span class="symbol">);</span>
947
<span class="normal">value2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"()"</span><span class="symbol">);</span>
949
<span class="cbracket">{</span>
950
<span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">string</span><span class="symbol">;</span>
951
<span class="normal"> </span><span class="usertype">gint</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">;</span>
953
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(s(ii))"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">string</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">x</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">y</span><span class="symbol">);</span>
954
<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">"%s, %d, %d</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> string</span><span class="symbol">,</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">);</span>
955
<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">string</span><span class="symbol">);</span>
957
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"()"</span><span class="symbol">);</span><span class="normal"> </span><span class="comment">/* do nothing... */</span>
958
<span class="cbracket">}</span></pre></td>
944
<td class="listing_code"><pre class="programlisting">GVariant <span class="gtkdoc opt">*</span>value1<span class="gtkdoc opt">, *</span>value2<span class="gtkdoc opt">;</span>
946
value1 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"(s(ii))"</span><span class="gtkdoc opt">,</span> <span class="string">"Hello"</span><span class="gtkdoc opt">,</span> <span class="number">55</span><span class="gtkdoc opt">,</span> <span class="number">77</span><span class="gtkdoc opt">);</span>
947
value2 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"()"</span><span class="gtkdoc opt">);</span>
949
<span class="gtkdoc opt">{</span>
950
gchar <span class="gtkdoc opt">*</span>string<span class="gtkdoc opt">;</span>
951
gint x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">;</span>
953
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value1<span class="gtkdoc opt">,</span> <span class="string">"(s(ii))"</span><span class="gtkdoc opt">, &</span>string<span class="gtkdoc opt">, &</span>x<span class="gtkdoc opt">, &</span>y<span class="gtkdoc opt">);</span>
954
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"%s, %d, %d</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> string<span class="gtkdoc opt">,</span> x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">);</span>
955
<span class="function"><a href="glib-Memory-Allocation.html#g-free">g_free</a></span> <span class="gtkdoc opt">(</span>string<span class="gtkdoc opt">);</span>
957
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value2<span class="gtkdoc opt">,</span> <span class="string">"()"</span><span class="gtkdoc opt">);</span> <span class="comment">/* do nothing... */</span>
958
<span class="gtkdoc opt">}</span></pre></td>
1069
<td class="listing_code"><pre class="programlisting"><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value1</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value2</span><span class="symbol">;</span>
1069
<td class="listing_code"><pre class="programlisting">GVariant <span class="gtkdoc opt">*</span>value1<span class="gtkdoc opt">, *</span>value2<span class="gtkdoc opt">;</span>
1071
<span class="normal">value1 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(i@ii)"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">44</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new-int32">g_variant_new_int32</a></span><span class="normal"> </span><span class="symbol">(</span><span class="number">55</span><span class="symbol">),</span><span class="normal"> </span><span class="number">66</span><span class="symbol">);</span>
1071
value1 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"(i@ii)"</span><span class="gtkdoc opt">,</span> <span class="number">44</span><span class="gtkdoc opt">,</span> <span class="function"><a href="glib-GVariant.html#g-variant-new-int32">g_variant_new_int32</a></span> <span class="gtkdoc opt">(</span><span class="number">55</span><span class="gtkdoc opt">),</span> <span class="number">66</span><span class="gtkdoc opt">);</span>
1073
1073
<span class="comment">/* note: consumes floating reference count on 'value1' */</span>
1074
<span class="normal">value2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"(@(iii)*)"</span><span class="symbol">,</span><span class="normal"> value1</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-new-string">g_variant_new_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"foo"</span><span class="symbol">));</span>
1076
<span class="cbracket">{</span>
1077
<span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">gchar</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">string</span><span class="symbol">;</span>
1078
<span class="normal"> </span><span class="usertype">GVariant</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">tmp</span><span class="symbol">;</span>
1079
<span class="normal"> </span><span class="usertype">gsize</span><span class="normal"> length</span><span class="symbol">;</span>
1080
<span class="normal"> </span><span class="usertype">gint</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">,</span><span class="normal"> z</span><span class="symbol">;</span>
1082
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"((iii)*)"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">x</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">y</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">z</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">tmp</span><span class="symbol">);</span>
1083
<span class="normal"> string </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get-string">g_variant_get_string</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">tmp</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">length</span><span class="symbol">);</span>
1084
<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">"it is %d %d %d %s (length=%d)</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> x</span><span class="symbol">,</span><span class="normal"> y</span><span class="symbol">,</span><span class="normal"> z</span><span class="symbol">,</span><span class="normal"> string</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="symbol">)</span><span class="normal"> length</span><span class="symbol">);</span>
1085
<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">tmp</span><span class="symbol">);</span>
1087
<span class="normal"> </span><span class="comment">/* quick way to skip all the values in a tuple */</span>
1088
<span class="normal"> </span><span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">value2</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"(rs)"</span><span class="symbol">,</span><span class="normal"> <a href="glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">string</span><span class="symbol">);</span><span class="normal"> </span><span class="comment">/* or "(@(iii)s)" */</span>
1089
<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">"i only got the string: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> string</span><span class="symbol">);</span>
1090
<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">string</span><span class="symbol">);</span>
1091
<span class="cbracket">}</span></pre></td>
1074
value2 <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-new">g_variant_new</a></span> <span class="gtkdoc opt">(</span><span class="string">"(@(iii)*)"</span><span class="gtkdoc opt">,</span> value1<span class="gtkdoc opt">,</span> <span class="function"><a href="glib-GVariant.html#g-variant-new-string">g_variant_new_string</a></span> <span class="gtkdoc opt">(</span><span class="string">"foo"</span><span class="gtkdoc opt">));</span>
1076
<span class="gtkdoc opt">{</span>
1077
<span class="gtkdoc kwb">const</span> gchar <span class="gtkdoc opt">*</span>string<span class="gtkdoc opt">;</span>
1078
GVariant <span class="gtkdoc opt">*</span>tmp<span class="gtkdoc opt">;</span>
1079
gsize length<span class="gtkdoc opt">;</span>
1080
gint x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">,</span> z<span class="gtkdoc opt">;</span>
1082
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value2<span class="gtkdoc opt">,</span> <span class="string">"((iii)*)"</span><span class="gtkdoc opt">, &</span>x<span class="gtkdoc opt">, &</span>y<span class="gtkdoc opt">, &</span>z<span class="gtkdoc opt">, &</span>tmp<span class="gtkdoc opt">);</span>
1083
string <span class="gtkdoc opt">=</span> <span class="function"><a href="glib-GVariant.html#g-variant-get-string">g_variant_get_string</a></span> <span class="gtkdoc opt">(</span>tmp<span class="gtkdoc opt">, &</span>length<span class="gtkdoc opt">);</span>
1084
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"it is %d %d %d %s (length=%d)</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> x<span class="gtkdoc opt">,</span> y<span class="gtkdoc opt">,</span> z<span class="gtkdoc opt">,</span> string<span class="gtkdoc opt">, (</span><span class="gtkdoc kwb">int</span><span class="gtkdoc opt">)</span> length<span class="gtkdoc opt">);</span>
1085
<span class="function"><a href="glib-GVariant.html#g-variant-unref">g_variant_unref</a></span> <span class="gtkdoc opt">(</span>tmp<span class="gtkdoc opt">);</span>
1087
<span class="comment">/* quick way to skip all the values in a tuple */</span>
1088
<span class="function"><a href="glib-GVariant.html#g-variant-get">g_variant_get</a></span> <span class="gtkdoc opt">(</span>value2<span class="gtkdoc opt">,</span> <span class="string">"(rs)"</span><span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">, &</span>string<span class="gtkdoc opt">);</span> <span class="comment">/* or "(@(iii)s)" */</span>
1089
<span class="function"><a href="glib-Warnings-and-Assertions.html#g-print">g_print</a></span> <span class="gtkdoc opt">(</span><span class="string">"i only got the string: %s</span><span class="gtkdoc esc">\n</span><span class="string">"</span><span class="gtkdoc opt">,</span> string<span class="gtkdoc opt">);</span>
1090
<span class="function"><a href="glib-Memory-Allocation.html#g-free">g_free</a></span> <span class="gtkdoc opt">(</span>string<span class="gtkdoc opt">);</span>
1091
<span class="gtkdoc opt">}</span></pre></td>