~ubuntu-branches/ubuntu/utopic/glib2.0/utopic

« back to all changes in this revision

Viewing changes to docs/reference/gobject/html/gobject-Varargs-Value-Collection.html

Tags: upstream-2.12.12
ImportĀ upstreamĀ versionĀ 2.12.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
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&#160;I.&#160;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&#160;IV.&#160;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&#160;V.&#160;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">
 
38
</head>
 
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">
 
41
<tr valign="middle">
 
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>
 
47
</tr>
 
48
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3140228" class="shortcut">Top</a>
 
49
                  &#160;|&#160;
 
50
                  <a href="#id3140280" class="shortcut">Description</a></nobr></td></tr>
 
51
</table>
 
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>
 
55
<td valign="top">
 
56
<h2>
 
57
<a name="id3140228"></a><span class="refentrytitle">Varargs Value Collection</span>
 
58
</h2>
 
59
<p>Varargs Value Collection &#8212; Converting varargs to generic values</p>
 
60
</td>
 
61
<td valign="top" align="right"></td>
 
62
</tr></table></div>
 
63
<div class="refsynopsisdiv">
 
64
<h2>Synopsis</h2>
 
65
<pre class="synopsis">
 
66
 
 
67
#include &lt;glib-object.h&gt;
 
68
#include &lt;gobject/gvaluecollector.h&gt;
 
69
 
 
70
 
 
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>
 
75
</pre>
 
76
</div>
 
77
<div class="refsect1" lang="en">
 
78
<a name="id3140280"></a><h2>Description</h2>
 
79
<p>
 
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 
 
83
types and pointers.
 
84
</p>
 
85
</div>
 
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
 
92
{
 
93
  gint     v_int;
 
94
  glong    v_long;
 
95
  gint64   v_int64;
 
96
  gdouble  v_double;
 
97
  gpointer v_pointer;
 
98
};
 
99
</pre>
 
100
<p>
 
101
A union holding one collected value.
 
102
</p>
 
103
</div>
 
104
<hr>
 
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>
 
109
<p>
 
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.
 
113
</p>
 
114
<div class="variablelist"><table border="0">
 
115
<col align="left" valign="top">
 
116
<tbody>
 
117
<tr>
 
118
<td><span class="term"><em class="parameter"><code>value</code></em>&#160;:</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
 
121
</td>
 
122
</tr>
 
123
<tr>
 
124
<td><span class="term"><em class="parameter"><code>var_args</code></em>&#160;:</span></td>
 
125
<td>the va_list variable; it may be evaluated multiple times
 
126
</td>
 
127
</tr>
 
128
<tr>
 
129
<td><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</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>.
 
132
</td>
 
133
</tr>
 
134
<tr>
 
135
<td><span class="term"><em class="parameter"><code>__error</code></em>&#160;:</span></td>
 
136
<td>a <a
 
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
 
142
 
 
143
 
 
144
</td>
 
145
</tr>
 
146
</tbody>
 
147
</table></div>
 
148
</div>
 
149
<hr>
 
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>
 
154
<p>
 
155
Collects a value's variable argument locations from a va_list. 
 
156
</p>
 
157
<div class="variablelist"><table border="0">
 
158
<col align="left" valign="top">
 
159
<tbody>
 
160
<tr>
 
161
<td><span class="term"><em class="parameter"><code>value</code></em>&#160;:</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
 
164
</td>
 
165
</tr>
 
166
<tr>
 
167
<td><span class="term"><em class="parameter"><code>var_args</code></em>&#160;:</span></td>
 
168
<td>the va_list variable; it may be evaluated multiple times
 
169
</td>
 
170
</tr>
 
171
<tr>
 
172
<td><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</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>.
 
175
</td>
 
176
</tr>
 
177
<tr>
 
178
<td><span class="term"><em class="parameter"><code>__error</code></em>&#160;:</span></td>
 
179
<td>a <a
 
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
 
185
 
 
186
 
 
187
</td>
 
188
</tr>
 
189
</tbody>
 
190
</table></div>
 
191
</div>
 
192
<hr>
 
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)
 
197
</pre>
 
198
<p>
 
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>.
 
201
</p>
 
202
</div>
 
203
</div>
 
204
<div class="refsect1" lang="en">
 
205
<a name="id3140711"></a><h2>See Also</h2>
 
206
<p>
 
207
<span class="type">GValueTable</span>
 
208
</p>
 
209
</div>
 
210
</div>
 
211
</body>
 
212
</html>