1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GITypeInfo</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="GObject Introspection Reference Manual">
8 <link rel="up" href="ch01.html" title="GIRepository">
9 <link rel="prev" href="gi-GIPropertyInfo.html" title="GIPropertyInfo">
10 <link rel="next" href="gi-GIValueInfo.html" title="GIValueInfo">
11 <meta name="generator" content="GTK-Doc V1.19 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17 <td><a accesskey="p" href="gi-GIPropertyInfo.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GObject Introspection Reference Manual</th>
21 <td><a accesskey="n" href="gi-GIValueInfo.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gi-GITypeInfo.synopsis" class="shortcut">Top</a>
26 <a href="#gi-GITypeInfo.description" class="shortcut">Description</a>
29 <div class="refentry">
30 <a name="gi-GITypeInfo"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
33 <h2><span class="refentrytitle"><a name="gi-GITypeInfo.top_of_page"></a>GITypeInfo</span></h2>
34 <p>GITypeInfo — Struct representing a type</p>
36 <td valign="top" align="right"></td>
38 <div class="refsynopsisdiv">
39 <a name="gi-GITypeInfo.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">#define <a class="link" href="gi-GITypeInfo.html#GI-IS-TYPE-INFO:CAPS" title="GI_IS_TYPE_INFO()">GI_IS_TYPE_INFO</a> (info)
41 typedef <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo">GITypeInfo</a>;
42 const <span class="returnvalue">gchar</span> * <a class="link" href="gi-GITypeInfo.html#g-type-tag-to-string" title="g_type_tag_to_string ()">g_type_tag_to_string</a> (<em class="parameter"><code><a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="type">GITypeTag</span></a> type</code></em>);
43 const <span class="returnvalue">gchar</span> * <a class="link" href="gi-GITypeInfo.html#g-info-type-to-string" title="g_info_type_to_string ()">g_info_type_to_string</a> (<em class="parameter"><code><a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType"><span class="type">GIInfoType</span></a> type</code></em>);
44 <span class="returnvalue">gboolean</span> <a class="link" href="gi-GITypeInfo.html#g-type-info-is-pointer" title="g_type_info_is_pointer ()">g_type_info_is_pointer</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
45 <a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="returnvalue">GITypeTag</span></a> <a class="link" href="gi-GITypeInfo.html#g-type-info-get-tag" title="g_type_info_get_tag ()">g_type_info_get_tag</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
46 <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="returnvalue">GITypeInfo</span></a> * <a class="link" href="gi-GITypeInfo.html#g-type-info-get-param-type" title="g_type_info_get_param_type ()">g_type_info_get_param_type</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>,
47 <em class="parameter"><code><span class="type">gint</span> n</code></em>);
48 <span class="returnvalue">GIBaseInfo</span> * <a class="link" href="gi-GITypeInfo.html#g-type-info-get-interface" title="g_type_info_get_interface ()">g_type_info_get_interface</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
49 <span class="returnvalue">gint</span> <a class="link" href="gi-GITypeInfo.html#g-type-info-get-array-length" title="g_type_info_get_array_length ()">g_type_info_get_array_length</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
50 <span class="returnvalue">gint</span> <a class="link" href="gi-GITypeInfo.html#g-type-info-get-array-fixed-size" title="g_type_info_get_array_fixed_size ()">g_type_info_get_array_fixed_size</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
51 <span class="returnvalue">gboolean</span> <a class="link" href="gi-GITypeInfo.html#g-type-info-is-zero-terminated" title="g_type_info_is_zero_terminated ()">g_type_info_is_zero_terminated</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
52 <a class="link" href="gi-common-types.html#GIArrayType" title="enum GIArrayType"><span class="returnvalue">GIArrayType</span></a> <a class="link" href="gi-GITypeInfo.html#g-type-info-get-array-type" title="g_type_info_get_array_type ()">g_type_info_get_array_type</a> (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);
55 <div class="refsect1">
56 <a name="gi-GITypeInfo.description"></a><h2>Description</h2>
58 GITypeInfo represents a type. You can retrieve a type info from
59 an argument (see <a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="type">GIArgInfo</span></a>), a functions return value (see <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a>),
60 a field (see <a class="link" href="gi-GIFieldInfo.html#GIFieldInfo" title="GIFieldInfo"><span class="type">GIFieldInfo</span></a>), a property (see <a class="link" href="gi-GIPropertyInfo.html#GIPropertyInfo" title="GIPropertyInfo"><span class="type">GIPropertyInfo</span></a>), a constant
61 (see <a class="link" href="gi-GIConstantInfo.html#GIConstantInfo" title="GIConstantInfo"><span class="type">GIConstantInfo</span></a>) or for a union discriminator (see <a class="link" href="gi-GIUnionInfo.html#GIUnionInfo" title="GIUnionInfo"><span class="type">GIUnionInfo</span></a>).
64 A type can either be a of a basic type which is a standard C primitive
65 type or an interface type. For interface types you need to call
66 <a class="link" href="gi-GITypeInfo.html#g-type-info-get-interface" title="g_type_info_get_interface ()"><code class="function">g_type_info_get_interface()</code></a> to get a reference to the base info for that
71 <div class="refsect1">
72 <a name="gi-gitypeinfo.struct-hierarchy"></a><h2>Struct hierarchy</h2>
73 <pre class="synopsis">
74 <a class="link" href="gi-GIBaseInfo.html" title="GIBaseInfo">GIBaseInfo</a>
81 <div class="refsect1">
82 <a name="gi-GITypeInfo.details"></a><h2>Details</h2>
83 <div class="refsect2">
84 <a name="GI-IS-TYPE-INFO:CAPS"></a><h3>GI_IS_TYPE_INFO()</h3>
85 <pre class="programlisting">#define GI_IS_TYPE_INFO(info)</pre>
87 Checks if <em class="parameter"><code>info</code></em> is a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>.
89 <div class="variablelist"><table border="0" class="variablelist">
91 <col align="left" valign="top">
95 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
96 <td>an info structure</td>
101 <div class="refsect2">
102 <a name="GITypeInfo"></a><h3>GITypeInfo</h3>
103 <pre class="programlisting">typedef GIBaseInfo GITypeInfo;
106 Represents type information, direction, transfer etc.
110 <div class="refsect2">
111 <a name="g-type-tag-to-string"></a><h3>g_type_tag_to_string ()</h3>
112 <pre class="programlisting">const <span class="returnvalue">gchar</span> * g_type_tag_to_string (<em class="parameter"><code><a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="type">GITypeTag</span></a> type</code></em>);</pre>
114 Obtain a string representation of <em class="parameter"><code>type</code></em>
116 <div class="variablelist"><table border="0" class="variablelist">
118 <col align="left" valign="top">
123 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
124 <td>the type_tag</td>
127 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
134 <div class="refsect2">
135 <a name="g-info-type-to-string"></a><h3>g_info_type_to_string ()</h3>
136 <pre class="programlisting">const <span class="returnvalue">gchar</span> * g_info_type_to_string (<em class="parameter"><code><a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType"><span class="type">GIInfoType</span></a> type</code></em>);</pre>
138 Obtain a string representation of <em class="parameter"><code>type</code></em>
140 <div class="variablelist"><table border="0" class="variablelist">
142 <col align="left" valign="top">
147 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
148 <td>the info type</td>
151 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
158 <div class="refsect2">
159 <a name="g-type-info-is-pointer"></a><h3>g_type_info_is_pointer ()</h3>
160 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_type_info_is_pointer (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
162 Obtain if the type is passed as a reference.
165 Note that the types of <a class="link" href="gi-GIArgInfo.html#GI-DIRECTION-OUT:CAPS"><code class="literal">GI_DIRECTION_OUT</code></a> and <a class="link" href="gi-GIArgInfo.html#GI-DIRECTION-INOUT:CAPS"><code class="literal">GI_DIRECTION_INOUT</code></a> parameters
166 will only be pointers if the underlying type being transferred is a pointer
167 (i.e. only if the type of the C function’s formal parameter is a pointer to a
170 <div class="variablelist"><table border="0" class="variablelist">
172 <col align="left" valign="top">
177 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
178 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
182 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
184 <code class="literal">TRUE</code> if it is a pointer</td>
190 <div class="refsect2">
191 <a name="g-type-info-get-tag"></a><h3>g_type_info_get_tag ()</h3>
192 <pre class="programlisting"><a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="returnvalue">GITypeTag</span></a> g_type_info_get_tag (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
194 Obtain the type tag for the type. See <a class="link" href="gi-common-types.html#GITypeTag" title="enum GITypeTag"><span class="type">GITypeTag</span></a> for a list
197 <div class="variablelist"><table border="0" class="variablelist">
199 <col align="left" valign="top">
204 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
205 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
209 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
210 <td>the type tag</td>
216 <div class="refsect2">
217 <a name="g-type-info-get-param-type"></a><h3>g_type_info_get_param_type ()</h3>
218 <pre class="programlisting"><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="returnvalue">GITypeInfo</span></a> * g_type_info_get_param_type (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>,
219 <em class="parameter"><code><span class="type">gint</span> n</code></em>);</pre>
221 Obtain the parameter type <em class="parameter"><code>n</code></em>.
223 <div class="variablelist"><table border="0" class="variablelist">
225 <col align="left" valign="top">
230 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
231 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
235 <td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
236 <td>index of the parameter</td>
239 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
240 <td>the param type info. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
247 <div class="refsect2">
248 <a name="g-type-info-get-interface"></a><h3>g_type_info_get_interface ()</h3>
249 <pre class="programlisting"><span class="returnvalue">GIBaseInfo</span> * g_type_info_get_interface (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
251 For types which have <a class="link" href="gi-common-types.html#GI-TYPE-TAG-INTERFACE:CAPS"><span class="type">GI_TYPE_TAG_INTERFACE</span></a> such as GObjects and boxed values,
252 this function returns full information about the referenced type. You can then
253 inspect the type of the returned <span class="type">GIBaseInfo</span> to further query whether it is
254 a concrete GObject, a GInterface, a structure, etc. using <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-type" title="g_base_info_get_type ()"><code class="function">g_base_info_get_type()</code></a>.
256 <div class="variablelist"><table border="0" class="variablelist">
258 <col align="left" valign="top">
263 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
264 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
268 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
269 <td>the <span class="type">GIBaseInfo</span>, or <code class="literal">NULL</code>. Free it with
270 <a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()"><code class="function">g_base_info_unref()</code></a> when done. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
277 <div class="refsect2">
278 <a name="g-type-info-get-array-length"></a><h3>g_type_info_get_array_length ()</h3>
279 <pre class="programlisting"><span class="returnvalue">gint</span> g_type_info_get_array_length (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
281 Obtain the array length of the type. The type tag must be a
282 <a class="link" href="gi-common-types.html#GI-TYPE-TAG-ARRAY:CAPS"><span class="type">GI_TYPE_TAG_ARRAY</span></a> or -1 will returned.
284 <div class="variablelist"><table border="0" class="variablelist">
286 <col align="left" valign="top">
291 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
292 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
296 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
297 <td>the array length, or -1 if the type is not an array</td>
303 <div class="refsect2">
304 <a name="g-type-info-get-array-fixed-size"></a><h3>g_type_info_get_array_fixed_size ()</h3>
305 <pre class="programlisting"><span class="returnvalue">gint</span> g_type_info_get_array_fixed_size (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
307 Obtain the fixed array size of the type. The type tag must be a
308 <a class="link" href="gi-common-types.html#GI-TYPE-TAG-ARRAY:CAPS"><span class="type">GI_TYPE_TAG_ARRAY</span></a> or -1 will returned.
310 <div class="variablelist"><table border="0" class="variablelist">
312 <col align="left" valign="top">
317 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
318 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
322 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
323 <td>the size or -1 if it's not an array</td>
329 <div class="refsect2">
330 <a name="g-type-info-is-zero-terminated"></a><h3>g_type_info_is_zero_terminated ()</h3>
331 <pre class="programlisting"><span class="returnvalue">gboolean</span> g_type_info_is_zero_terminated (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
333 Obtain if the last element of the array is <code class="literal">NULL</code>. The type tag must be a
334 <a class="link" href="gi-common-types.html#GI-TYPE-TAG-ARRAY:CAPS"><span class="type">GI_TYPE_TAG_ARRAY</span></a> or <code class="literal">FALSE</code> will returned.
336 <div class="variablelist"><table border="0" class="variablelist">
338 <col align="left" valign="top">
343 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
344 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
348 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
350 <code class="literal">TRUE</code> if zero terminated</td>
356 <div class="refsect2">
357 <a name="g-type-info-get-array-type"></a><h3>g_type_info_get_array_type ()</h3>
358 <pre class="programlisting"><a class="link" href="gi-common-types.html#GIArrayType" title="enum GIArrayType"><span class="returnvalue">GIArrayType</span></a> g_type_info_get_array_type (<em class="parameter"><code><a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a> *info</code></em>);</pre>
360 Obtain the array type for this type. See <a class="link" href="gi-common-types.html#GIArrayType" title="enum GIArrayType"><span class="type">GIArrayType</span></a> for a list of
361 possible values. If the type tag of this type is not array, -1 will be
364 <div class="variablelist"><table border="0" class="variablelist">
366 <col align="left" valign="top">
371 <td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td>
372 <td>a <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a>
376 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
377 <td>the array type or -1</td>
386 Generated by GTK-Doc V1.19</div>