1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
<title>Varargs Value Collection</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
7
<link rel="start" href="index.html" title="GObject Reference Manual">
8
<link rel="up" href="rn01.html" title="API Reference">
9
<link rel="prev" href="gobject-Standard-Parameter-and-Value-Types.html" title="Parameters and Values">
10
<link rel="next" href="gobject-GParamSpec.html" title="GParamSpec">
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="preface" href="pr01.html" title="Introduction">
14
<link rel="part" href="pt01.html" title="Part I. Concepts">
15
<link rel="chapter" href="ch01.html" title="Background">
16
<link rel="chapter" href="ch02.html" title="The Glib Dynamic Type System">
17
<link rel="chapter" href="chapter-gobject.html" title="The GObject base class">
18
<link rel="chapter" href="chapter-signal.html" title="The GObject messaging system">
19
<link rel="reference" href="rn01.html" title="API Reference">
20
<link rel="reference" href="rn02.html" title="Tools Reference">
21
<link rel="part" href="pt02.html" title="Part IV. Tutorial">
22
<link rel="chapter" href="howto-gobject.html" title="How To define and implement a new GObject?">
23
<link rel="chapter" href="howto-interface.html" title="How To define and implement Interfaces?">
24
<link rel="chapter" href="howto-signals.html" title="Howto create and use signals">
25
<link rel="part" href="pt03.html" title="Part V. Related Tools">
26
<link rel="chapter" href="tools-gob.html" title="GObject builder">
27
<link rel="chapter" href="tools-ginspector.html" title="Graphical inspection of Gobjects">
28
<link rel="chapter" href="tools-refdb.html" title="Debugging reference count problems">
29
<link rel="chapter" href="tools-gtkdoc.html" title="Writing API docs">
30
<link rel="index" href="ix01.html" title="Index">
31
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
32
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
33
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
34
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
35
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
36
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
37
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
39
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
40
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
42
<td><a accesskey="p" href="gobject-Standard-Parameter-and-Value-Types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
43
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
44
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
45
<th width="100%" align="center">GObject Reference Manual</th>
46
<td><a accesskey="n" href="gobject-GParamSpec.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
48
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3140228" class="shortcut">Top</a>
50
<a href="#id3140280" class="shortcut">Description</a></nobr></td></tr>
52
<div class="refentry" lang="en">
53
<a name="gobject-Varargs-Value-Collection"></a><div class="titlepage"></div>
54
<div class="refnamediv"><table width="100%"><tr>
57
<a name="id3140228"></a><span class="refentrytitle">Varargs Value Collection</span>
59
<p>Varargs Value Collection — Converting varargs to generic values</p>
61
<td valign="top" align="right"></td>
63
<div class="refsynopsisdiv">
65
<pre class="synopsis">
67
#include <glib-object.h>
68
#include <gobject/gvaluecollector.h>
71
union <a href="gobject-Varargs-Value-Collection.html#GTypeCValue">GTypeCValue</a>;
72
#define <a href="gobject-Varargs-Value-Collection.html#G-VALUE-COLLECT:CAPS">G_VALUE_COLLECT</a> (value, var_args, flags, __error)
73
#define <a href="gobject-Varargs-Value-Collection.html#G-VALUE-LCOPY:CAPS">G_VALUE_LCOPY</a> (value, var_args, flags, __error)
74
#define <a href="gobject-Varargs-Value-Collection.html#G-VALUE-COLLECT-FORMAT-MAX-LENGTH:CAPS">G_VALUE_COLLECT_FORMAT_MAX_LENGTH</a>
77
<div class="refsect1" lang="en">
78
<a name="id3140280"></a><h2>Description</h2>
80
The macros in this section provide the varargs parsing support needed
81
in variadic GObject functions such as <a href="gobject-The-Base-Object-Type.html#g-object-new"><code class="function">g_object_new()</code></a> or <a href="gobject-The-Base-Object-Type.html#g-object-set"><code class="function">g_object_set()</code></a>.
82
They currently support the collection of integral types, floating point
86
<div class="refsect1" lang="en">
87
<a name="id3140319"></a><h2>Details</h2>
88
<div class="refsect2" lang="en">
89
<a name="id3140329"></a><h3>
90
<a name="GTypeCValue"></a>union GTypeCValue</h3>
91
<a class="indexterm" name="id3140342"></a><pre class="programlisting">union GTypeCValue
101
A union holding one collected value.
105
<div class="refsect2" lang="en">
106
<a name="id3140359"></a><h3>
107
<a name="G-VALUE-COLLECT:CAPS"></a>G_VALUE_COLLECT()</h3>
108
<a class="indexterm" name="id3140372"></a><pre class="programlisting">#define G_VALUE_COLLECT(value, var_args, flags, __error)</pre>
110
Collects a variable argument value from a va_list. We have to
111
implement the varargs collection as a macro, because on some systems
112
va_list variables cannot be passed by reference.
114
<div class="variablelist"><table border="0">
115
<col align="left" valign="top">
118
<td><span class="term"><em class="parameter"><code>value</code></em> :</span></td>
119
<td>a <a href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> return location. <em class="parameter"><code>value</code></em> is supposed to be initialized
120
according to the value type to be collected
124
<td><span class="term"><em class="parameter"><code>var_args</code></em> :</span></td>
125
<td>the va_list variable; it may be evaluated multiple times
129
<td><span class="term"><em class="parameter"><code>flags</code></em> :</span></td>
130
<td>flags which are passed on to the <code class="function">collect_value()</code> function of
131
the <a href="gobject-Type-Information.html#GTypeValueTable"><span class="type">GTypeValueTable</span></a> of <em class="parameter"><code>value</code></em>.
135
<td><span class="term"><em class="parameter"><code>__error</code></em> :</span></td>
137
href="../glib/glib-Basic-Types.html#gchar"
138
><span class="type">gchar</span></a>** variable that will be modified to hold a <a
139
href="../glib/glib-Memory-Allocation.html#g-new"
140
><code class="function">g_new()</code></a>
141
allocated error messages if something fails
150
<div class="refsect2" lang="en">
151
<a name="id3140512"></a><h3>
152
<a name="G-VALUE-LCOPY:CAPS"></a>G_VALUE_LCOPY()</h3>
153
<a class="indexterm" name="id3140525"></a><pre class="programlisting">#define G_VALUE_LCOPY(value, var_args, flags, __error)</pre>
155
Collects a value's variable argument locations from a va_list.
157
<div class="variablelist"><table border="0">
158
<col align="left" valign="top">
161
<td><span class="term"><em class="parameter"><code>value</code></em> :</span></td>
162
<td>a <a href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> return location. <em class="parameter"><code>value</code></em> is supposed to be initialized
163
according to the value type to be collected
167
<td><span class="term"><em class="parameter"><code>var_args</code></em> :</span></td>
168
<td>the va_list variable; it may be evaluated multiple times
172
<td><span class="term"><em class="parameter"><code>flags</code></em> :</span></td>
173
<td>flags which are passed on to the <code class="function">lcopy_value()</code> function of
174
the <a href="gobject-Type-Information.html#GTypeValueTable"><span class="type">GTypeValueTable</span></a> of <em class="parameter"><code>value</code></em>.
178
<td><span class="term"><em class="parameter"><code>__error</code></em> :</span></td>
180
href="../glib/glib-Basic-Types.html#gchar"
181
><span class="type">gchar</span></a>** variable that will be modified to hold a <a
182
href="../glib/glib-Memory-Allocation.html#g-new"
183
><code class="function">g_new()</code></a>
184
allocated error messages if something fails
193
<div class="refsect2" lang="en">
194
<a name="id3140662"></a><h3>
195
<a name="G-VALUE-COLLECT-FORMAT-MAX-LENGTH:CAPS"></a>G_VALUE_COLLECT_FORMAT_MAX_LENGTH</h3>
196
<a class="indexterm" name="id3140677"></a><pre class="programlisting">#define G_VALUE_COLLECT_FORMAT_MAX_LENGTH (8)
199
The maximal number of <a href="gobject-Varargs-Value-Collection.html#GTypeCValue"><span class="type">GTypeCValue</span></a>s which can be collected for a
200
single <a href="gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>.
204
<div class="refsect1" lang="en">
205
<a name="id3140711"></a><h2>See Also</h2>
207
<span class="type">GValueTable</span>