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>GIBaseInfo: GObject Introspection Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.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-common-types.html" title="common types">
10 <link rel="next" href="gi-GICallableInfo.html" title="GICallableInfo">
11 <meta name="generator" content="GTK-Doc V1.25.1 (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="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
18 <a href="#gi-GIBaseInfo.description" class="shortcut">Description</a></span>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="gi-common-types.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="gi-GICallableInfo.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
25 <div class="refentry">
26 <a name="gi-GIBaseInfo"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
29 <h2><span class="refentrytitle"><a name="gi-GIBaseInfo.top_of_page"></a>GIBaseInfo</span></h2>
30 <p>GIBaseInfo — Base struct for all GITypelib structs</p>
32 <td class="gallery_image" valign="top" align="right"></td>
34 <div class="refsect1">
35 <a name="gi-GIBaseInfo.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
38 <col width="150px" class="functions_return">
39 <col class="functions_name">
43 <td class="function_type">
44 <span class="returnvalue">GIBaseInfo</span> *
46 <td class="function_name">
47 <a class="link" href="gi-GIBaseInfo.html#g-info-new" title="g_info_new ()">g_info_new</a> <span class="c_punctuation">()</span>
51 <td class="function_type">
52 <span class="returnvalue">GIBaseInfo</span> *
54 <td class="function_name">
55 <a class="link" href="gi-GIBaseInfo.html#g-base-info-ref" title="g_base_info_ref ()">g_base_info_ref</a> <span class="c_punctuation">()</span>
59 <td class="function_type">
60 <span class="returnvalue">void</span>
62 <td class="function_name">
63 <a class="link" href="gi-GIBaseInfo.html#g-base-info-unref" title="g_base_info_unref ()">g_base_info_unref</a> <span class="c_punctuation">()</span>
67 <td class="function_type">
68 <span class="returnvalue">gboolean</span>
70 <td class="function_name">
71 <a class="link" href="gi-GIBaseInfo.html#g-base-info-equal" title="g_base_info_equal ()">g_base_info_equal</a> <span class="c_punctuation">()</span>
75 <td class="function_type">
76 <a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType"><span class="returnvalue">GIInfoType</span></a>
78 <td class="function_name">
79 <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-type" title="g_base_info_get_type ()">g_base_info_get_type</a> <span class="c_punctuation">()</span>
83 <td class="function_type">
84 <a class="link" href="gi-gitypelib.html#GITypelib" title="GITypelib"><span class="returnvalue">GITypelib</span></a> *
86 <td class="function_name">
87 <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-typelib" title="g_base_info_get_typelib ()">g_base_info_get_typelib</a> <span class="c_punctuation">()</span>
91 <td class="function_type">const <span class="returnvalue">gchar</span> *
93 <td class="function_name">
94 <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-namespace" title="g_base_info_get_namespace ()">g_base_info_get_namespace</a> <span class="c_punctuation">()</span>
98 <td class="function_type">const <span class="returnvalue">gchar</span> *
100 <td class="function_name">
101 <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-name" title="g_base_info_get_name ()">g_base_info_get_name</a> <span class="c_punctuation">()</span>
105 <td class="function_type">const <span class="returnvalue">gchar</span> *
107 <td class="function_name">
108 <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-attribute" title="g_base_info_get_attribute ()">g_base_info_get_attribute</a> <span class="c_punctuation">()</span>
112 <td class="function_type">
113 <span class="returnvalue">gboolean</span>
115 <td class="function_name">
116 <a class="link" href="gi-GIBaseInfo.html#g-base-info-iterate-attributes" title="g_base_info_iterate_attributes ()">g_base_info_iterate_attributes</a> <span class="c_punctuation">()</span>
120 <td class="function_type">
121 <span class="returnvalue">GIBaseInfo</span> *
123 <td class="function_name">
124 <a class="link" href="gi-GIBaseInfo.html#g-base-info-get-container" title="g_base_info_get_container ()">g_base_info_get_container</a> <span class="c_punctuation">()</span>
128 <td class="function_type">
129 <span class="returnvalue">gboolean</span>
131 <td class="function_name">
132 <a class="link" href="gi-GIBaseInfo.html#g-base-info-is-deprecated" title="g_base_info_is_deprecated ()">g_base_info_is_deprecated</a> <span class="c_punctuation">()</span>
138 <div class="refsect1">
139 <a name="gi-GIBaseInfo.other"></a><h2>Types and Values</h2>
140 <div class="informaltable"><table class="informaltable" width="100%" border="0">
142 <col width="150px" class="name">
143 <col class="description">
147 <td class="datatype_keyword">enum</td>
148 <td class="function_name"><a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType">GIInfoType</a></td>
151 <td class="datatype_keyword"> </td>
152 <td class="function_name"><a class="link" href="gi-GIBaseInfo.html#GIAttributeIter" title="GIAttributeIter">GIAttributeIter</a></td>
157 <div class="refsect1">
158 <a name="gi-GIBaseInfo.description"></a><h2>Description</h2>
159 <p>GIBaseInfo is the common base struct of all other *Info structs
160 accessible through the <a class="link" href="GIRepository.html" title="GIRepository"><span class="type">GIRepository</span></a> API.
161 All other structs can be casted to a <span class="type">GIBaseInfo</span>, for instance:</p>
162 <div class="example">
163 <a name="id-1.4.2.5.5.3"></a><p class="title"><b>Example 1. Casting a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> to <span class="type">GIBaseInfo</span></b></p>
164 <div class="example-contents">
165 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
168 <td class="listing_lines" align="right"><pre>1
170 <td class="listing_code"><pre class="programlisting"><span class="usertype">GIFunctionInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">function_info </span><span class="symbol">=</span><span class="normal"> </span><span class="symbol">...;</span>
171 <span class="usertype">GIBaseInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">info </span><span class="symbol">=</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GIBaseInfo</span><span class="symbol">*)</span><span class="normal">function_info</span><span class="symbol">;</span></pre></td>
178 <br class="example-break"><p>Most <a class="link" href="GIRepository.html" title="GIRepository"><span class="type">GIRepository</span></a> APIs returning a <span class="type">GIBaseInfo</span> is actually creating a new struct, in other
179 words, <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> has to be called when done accessing the data.
180 GIBaseInfos are normally accessed by calling either
181 <a class="link" href="GIRepository.html#g-irepository-find-by-name" title="g_irepository_find_by_name ()"><code class="function">g_irepository_find_by_name()</code></a>, <a class="link" href="GIRepository.html#g-irepository-find-by-gtype" title="g_irepository_find_by_gtype ()"><code class="function">g_irepository_find_by_gtype()</code></a> or <a class="link" href="GIRepository.html#g-irepository-get-info" title="g_irepository_get_info ()"><code class="function">g_irepository_get_info()</code></a>.</p>
182 <div class="example">
183 <a name="id-1.4.2.5.5.5"></a><p class="title"><b>Example 2. Getting the Button of the Gtk typelib</b></p>
184 <div class="example-contents">
185 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
188 <td class="listing_lines" align="right"><pre>1
191 <td class="listing_code"><pre class="programlisting"><span class="usertype">GIBaseInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">button_info </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GIRepository.html#g-irepository-find-by-name">g_irepository_find_by_name</a></span><span class="symbol">(</span><span class="normal">NULL</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Gtk"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Button"</span><span class="symbol">);</span>
192 <span class="symbol">...</span><span class="normal"> </span><span class="usertype">use</span><span class="normal"> button_info </span><span class="symbol">...</span>
193 <span class="function"><a href="gi-GIBaseInfo.html#g-base-info-unref">g_base_info_unref</a></span><span class="symbol">(</span><span class="normal">button_info</span><span class="symbol">);</span></pre></td>
200 <br class="example-break"><div class="refsect1">
201 <a name="gi-gibaseinfo.struct-hierarchy"></a><h2>Struct hierarchy</h2>
202 <pre class="synopsis">
204 +----<a class="link" href="gi-GIArgInfo.html" title="GIArgInfo">GIArgInfo</a>
205 +----<a class="link" href="gi-GICallableInfo.html" title="GICallableInfo">GICallableInfo</a>
206 +----<a class="link" href="gi-GIConstantInfo.html" title="GIConstantInfo">GIConstantInfo</a>
207 +----<a class="link" href="gi-GIFieldInfo.html" title="GIFieldInfo">GIFieldInfo</a>
208 +----<a class="link" href="gi-GIPropertyInfo.html" title="GIPropertyInfo">GIPropertyInfo</a>
209 +----<a class="link" href="gi-GIRegisteredTypeInfo.html" title="GIRegisteredTypeInfo">GIRegisteredTypeInfo</a>
210 +----<a class="link" href="gi-GITypeInfo.html" title="GITypeInfo">GITypeInfo</a>
214 <div class="refsect1">
215 <a name="gi-GIBaseInfo.functions_details"></a><h2>Functions</h2>
216 <div class="refsect2">
217 <a name="g-info-new"></a><h3>g_info_new ()</h3>
218 <pre class="programlisting"><span class="returnvalue">GIBaseInfo</span> *
219 g_info_new (<em class="parameter"><code><a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType"><span class="type">GIInfoType</span></a> type</code></em>,
220 <em class="parameter"><code><span class="type">GIBaseInfo</span> *container</code></em>,
221 <em class="parameter"><code><a class="link" href="gi-gitypelib.html#GITypelib" title="GITypelib"><span class="type">GITypelib</span></a> *typelib</code></em>,
222 <em class="parameter"><code><span class="type">guint32</span> offset</code></em>);</pre>
224 <div class="refsect3">
225 <a name="g-info-new.parameters"></a><h4>Parameters</h4>
226 <div class="informaltable"><table class="informaltable" width="100%" border="0">
228 <col width="150px" class="parameters_name">
229 <col class="parameters_description">
230 <col width="200px" class="parameters_annotations">
234 <td class="parameter_name"><p>type</p></td>
235 <td class="parameter_description"><p>TODO</p></td>
236 <td class="parameter_annotations"> </td>
239 <td class="parameter_name"><p>container</p></td>
240 <td class="parameter_description"><p>TODO</p></td>
241 <td class="parameter_annotations"> </td>
244 <td class="parameter_name"><p>typelib</p></td>
245 <td class="parameter_description"><p>TODO</p></td>
246 <td class="parameter_annotations"> </td>
249 <td class="parameter_name"><p>offset</p></td>
250 <td class="parameter_description"><p>TODO</p></td>
251 <td class="parameter_annotations"> </td>
256 <div class="refsect3">
257 <a name="g-info-new.returns"></a><h4>Returns</h4>
262 <div class="refsect2">
263 <a name="g-base-info-ref"></a><h3>g_base_info_ref ()</h3>
264 <pre class="programlisting"><span class="returnvalue">GIBaseInfo</span> *
265 g_base_info_ref (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
266 <p>Increases the reference count of <em class="parameter"><code>info</code></em>
268 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
269 <div class="refsect3">
270 <a name="g-base-info-ref.parameters"></a><h4>Parameters</h4>
271 <div class="informaltable"><table class="informaltable" width="100%" border="0">
273 <col width="150px" class="parameters_name">
274 <col class="parameters_description">
275 <col width="200px" class="parameters_annotations">
278 <td class="parameter_name"><p>info</p></td>
279 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
280 <td class="parameter_annotations"> </td>
284 <div class="refsect3">
285 <a name="g-base-info-ref.returns"></a><h4>Returns</h4>
286 <p> the same <em class="parameter"><code>info</code></em>
291 <div class="refsect2">
292 <a name="g-base-info-unref"></a><h3>g_base_info_unref ()</h3>
293 <pre class="programlisting"><span class="returnvalue">void</span>
294 g_base_info_unref (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
295 <p>Decreases the reference count of <em class="parameter"><code>info</code></em>
296 . When its reference count
297 drops to 0, the info is freed.</p>
298 <p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
299 <div class="refsect3">
300 <a name="g-base-info-unref.parameters"></a><h4>Parameters</h4>
301 <div class="informaltable"><table class="informaltable" width="100%" border="0">
303 <col width="150px" class="parameters_name">
304 <col class="parameters_description">
305 <col width="200px" class="parameters_annotations">
308 <td class="parameter_name"><p>info</p></td>
309 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
310 <td class="parameter_annotations"> </td>
316 <div class="refsect2">
317 <a name="g-base-info-equal"></a><h3>g_base_info_equal ()</h3>
318 <pre class="programlisting"><span class="returnvalue">gboolean</span>
319 g_base_info_equal (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info1</code></em>,
320 <em class="parameter"><code><span class="type">GIBaseInfo</span> *info2</code></em>);</pre>
321 <p>Compare two <span class="type">GIBaseInfo</span>.</p>
322 <p>Using pointer comparison is not practical since many functions return
323 different instances of <span class="type">GIBaseInfo</span> that refers to the same part of the
324 TypeLib; use this function instead to do <span class="type">GIBaseInfo</span> comparisons.</p>
325 <div class="refsect3">
326 <a name="g-base-info-equal.parameters"></a><h4>Parameters</h4>
327 <div class="informaltable"><table class="informaltable" width="100%" border="0">
329 <col width="150px" class="parameters_name">
330 <col class="parameters_description">
331 <col width="200px" class="parameters_annotations">
335 <td class="parameter_name"><p>info1</p></td>
336 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
337 <td class="parameter_annotations"> </td>
340 <td class="parameter_name"><p>info2</p></td>
341 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
342 <td class="parameter_annotations"> </td>
347 <div class="refsect3">
348 <a name="g-base-info-equal.returns"></a><h4>Returns</h4>
349 <p> <code class="literal">TRUE</code> if and only if <em class="parameter"><code>info1</code></em>
350 equals <em class="parameter"><code>info2</code></em>
355 <div class="refsect2">
356 <a name="g-base-info-get-type"></a><h3>g_base_info_get_type ()</h3>
357 <pre class="programlisting"><a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType"><span class="returnvalue">GIInfoType</span></a>
358 g_base_info_get_type (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
359 <p>Obtain the info type of the GIBaseInfo.</p>
360 <div class="refsect3">
361 <a name="g-base-info-get-type.parameters"></a><h4>Parameters</h4>
362 <div class="informaltable"><table class="informaltable" width="100%" border="0">
364 <col width="150px" class="parameters_name">
365 <col class="parameters_description">
366 <col width="200px" class="parameters_annotations">
369 <td class="parameter_name"><p>info</p></td>
370 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
371 <td class="parameter_annotations"> </td>
375 <div class="refsect3">
376 <a name="g-base-info-get-type.returns"></a><h4>Returns</h4>
377 <p> the info type of <em class="parameter"><code>info</code></em>
382 <div class="refsect2">
383 <a name="g-base-info-get-typelib"></a><h3>g_base_info_get_typelib ()</h3>
384 <pre class="programlisting"><a class="link" href="gi-gitypelib.html#GITypelib" title="GITypelib"><span class="returnvalue">GITypelib</span></a> *
385 g_base_info_get_typelib (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
386 <p>Obtain the typelib this <em class="parameter"><code>info</code></em>
388 <div class="refsect3">
389 <a name="g-base-info-get-typelib.parameters"></a><h4>Parameters</h4>
390 <div class="informaltable"><table class="informaltable" width="100%" border="0">
392 <col width="150px" class="parameters_name">
393 <col class="parameters_description">
394 <col width="200px" class="parameters_annotations">
397 <td class="parameter_name"><p>info</p></td>
398 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
399 <td class="parameter_annotations"> </td>
403 <div class="refsect3">
404 <a name="g-base-info-get-typelib.returns"></a><h4>Returns</h4>
405 <p> the typelib. </p>
406 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
410 <div class="refsect2">
411 <a name="g-base-info-get-namespace"></a><h3>g_base_info_get_namespace ()</h3>
412 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
413 g_base_info_get_namespace (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
414 <p>Obtain the namespace of <em class="parameter"><code>info</code></em>
416 <div class="refsect3">
417 <a name="g-base-info-get-namespace.parameters"></a><h4>Parameters</h4>
418 <div class="informaltable"><table class="informaltable" width="100%" border="0">
420 <col width="150px" class="parameters_name">
421 <col class="parameters_description">
422 <col width="200px" class="parameters_annotations">
425 <td class="parameter_name"><p>info</p></td>
426 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
427 <td class="parameter_annotations"> </td>
431 <div class="refsect3">
432 <a name="g-base-info-get-namespace.returns"></a><h4>Returns</h4>
433 <p> the namespace</p>
437 <div class="refsect2">
438 <a name="g-base-info-get-name"></a><h3>g_base_info_get_name ()</h3>
439 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
440 g_base_info_get_name (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
441 <p>Obtain the name of the <em class="parameter"><code>info</code></em>
442 . What the name represents depends on
443 the <a class="link" href="gi-GIBaseInfo.html#GIInfoType" title="enum GIInfoType"><span class="type">GIInfoType</span></a> of the <em class="parameter"><code>info</code></em>
444 . For instance for <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> it is
445 the name of the function.</p>
446 <div class="refsect3">
447 <a name="g-base-info-get-name.parameters"></a><h4>Parameters</h4>
448 <div class="informaltable"><table class="informaltable" width="100%" border="0">
450 <col width="150px" class="parameters_name">
451 <col class="parameters_description">
452 <col width="200px" class="parameters_annotations">
455 <td class="parameter_name"><p>info</p></td>
456 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
457 <td class="parameter_annotations"> </td>
461 <div class="refsect3">
462 <a name="g-base-info-get-name.returns"></a><h4>Returns</h4>
463 <p> the name of <em class="parameter"><code>info</code></em>
464 or <code class="literal">NULL</code> if it lacks a name.</p>
468 <div class="refsect2">
469 <a name="g-base-info-get-attribute"></a><h3>g_base_info_get_attribute ()</h3>
470 <pre class="programlisting">const <span class="returnvalue">gchar</span> *
471 g_base_info_get_attribute (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>,
472 <em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
473 <p>Retrieve an arbitrary attribute associated with this node.</p>
474 <div class="refsect3">
475 <a name="g-base-info-get-attribute.parameters"></a><h4>Parameters</h4>
476 <div class="informaltable"><table class="informaltable" width="100%" border="0">
478 <col width="150px" class="parameters_name">
479 <col class="parameters_description">
480 <col width="200px" class="parameters_annotations">
484 <td class="parameter_name"><p>info</p></td>
485 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
486 <td class="parameter_annotations"> </td>
489 <td class="parameter_name"><p>name</p></td>
490 <td class="parameter_description"><p>a freeform string naming an attribute</p></td>
491 <td class="parameter_annotations"> </td>
496 <div class="refsect3">
497 <a name="g-base-info-get-attribute.returns"></a><h4>Returns</h4>
498 <p> The value of the attribute, or <code class="literal">NULL</code> if no such attribute exists</p>
502 <div class="refsect2">
503 <a name="g-base-info-iterate-attributes"></a><h3>g_base_info_iterate_attributes ()</h3>
504 <pre class="programlisting"><span class="returnvalue">gboolean</span>
505 g_base_info_iterate_attributes (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>,
506 <em class="parameter"><code><a class="link" href="gi-GIBaseInfo.html#GIAttributeIter" title="GIAttributeIter"><span class="type">GIAttributeIter</span></a> *iterator</code></em>,
507 <em class="parameter"><code><span class="type">char</span> **name</code></em>,
508 <em class="parameter"><code><span class="type">char</span> **value</code></em>);</pre>
509 <p>Iterate over all attributes associated with this node. The iterator
510 structure is typically stack allocated, and must have its first
511 member initialized to <code class="literal">NULL</code>. Attributes are arbitrary namespaced key–value
512 pairs which can be attached to almost any item. They are intended for use
513 by software higher in the toolchain than bindings, and are distinct from
514 normal GIR annotations.</p>
515 <p>Both the <em class="parameter"><code>name</code></em>
516 and <em class="parameter"><code>value</code></em>
517 should be treated as constants
518 and must not be freed.</p>
519 <div class="example">
520 <a name="id-1.4.2.5.6.11.6"></a><p class="title"><b>Example 3. Iterating over attributes</b></p>
521 <div class="example-contents">
522 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
525 <td class="listing_lines" align="right"><pre>1
536 <td class="listing_code"><pre class="programlisting"><span class="type">void</span>
537 <span class="function">print_attributes</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">GIBaseInfo</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">info</span><span class="symbol">)</span>
538 <span class="cbracket">{</span>
539 <span class="normal"> </span><span class="usertype">GIAttributeIter</span><span class="normal"> iter </span><span class="symbol">=</span><span class="normal"> </span><span class="cbracket">{</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="cbracket">}</span><span class="symbol">;</span>
540 <span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">name</span><span class="symbol">;</span>
541 <span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">value</span><span class="symbol">;</span>
542 <span class="normal"> </span><span class="keyword">while</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="gi-GIBaseInfo.html#g-base-info-iterate-attributes">g_base_info_iterate_attributes</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">info</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">iter</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">name</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">value</span><span class="symbol">))</span>
543 <span class="normal"> </span><span class="cbracket">{</span>
544 <span class="normal"> </span><span class="function">g_print</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"attribute name: %s value: %s"</span><span class="symbol">,</span><span class="normal"> name</span><span class="symbol">,</span><span class="normal"> value</span><span class="symbol">);</span>
545 <span class="normal"> </span><span class="cbracket">}</span>
546 <span class="cbracket">}</span></pre></td>
553 <br class="example-break"><div class="refsect3">
554 <a name="g-base-info-iterate-attributes.parameters"></a><h4>Parameters</h4>
555 <div class="informaltable"><table class="informaltable" width="100%" border="0">
557 <col width="150px" class="parameters_name">
558 <col class="parameters_description">
559 <col width="200px" class="parameters_annotations">
563 <td class="parameter_name"><p>info</p></td>
564 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
565 <td class="parameter_annotations"> </td>
568 <td class="parameter_name"><p>iterator</p></td>
569 <td class="parameter_description"><p>a <a class="link" href="gi-GIBaseInfo.html#GIAttributeIter" title="GIAttributeIter"><span class="type">GIAttributeIter</span></a> structure, must be initialized; see below</p></td>
570 <td class="parameter_annotations"> </td>
573 <td class="parameter_name"><p>name</p></td>
574 <td class="parameter_description"><p> Returned name, must not be freed. </p></td>
575 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
578 <td class="parameter_name"><p>value</p></td>
579 <td class="parameter_description"><p> Returned name, must not be freed. </p></td>
580 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td>
585 <div class="refsect3">
586 <a name="g-base-info-iterate-attributes.returns"></a><h4>Returns</h4>
587 <p> <code class="literal">TRUE</code> if there are more attributes</p>
591 <div class="refsect2">
592 <a name="g-base-info-get-container"></a><h3>g_base_info_get_container ()</h3>
593 <pre class="programlisting"><span class="returnvalue">GIBaseInfo</span> *
594 g_base_info_get_container (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
595 <p>Obtain the container of the <em class="parameter"><code>info</code></em>
596 . The container is the parent
597 GIBaseInfo. For instance, the parent of a <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a> is an
598 <a class="link" href="gi-GIObjectInfo.html#GIObjectInfo" title="GIObjectInfo"><span class="type">GIObjectInfo</span></a> or <a class="link" href="gi-GIInterfaceInfo.html#GIInterfaceInfo" title="GIInterfaceInfo"><span class="type">GIInterfaceInfo</span></a>.</p>
599 <div class="refsect3">
600 <a name="g-base-info-get-container.parameters"></a><h4>Parameters</h4>
601 <div class="informaltable"><table class="informaltable" width="100%" border="0">
603 <col width="150px" class="parameters_name">
604 <col class="parameters_description">
605 <col width="200px" class="parameters_annotations">
608 <td class="parameter_name"><p>info</p></td>
609 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
610 <td class="parameter_annotations"> </td>
614 <div class="refsect3">
615 <a name="g-base-info-get-container.returns"></a><h4>Returns</h4>
616 <p> the container. </p>
617 <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
621 <div class="refsect2">
622 <a name="g-base-info-is-deprecated"></a><h3>g_base_info_is_deprecated ()</h3>
623 <pre class="programlisting"><span class="returnvalue">gboolean</span>
624 g_base_info_is_deprecated (<em class="parameter"><code><span class="type">GIBaseInfo</span> *info</code></em>);</pre>
625 <p>Obtain whether the <em class="parameter"><code>info</code></em>
626 is represents a metadata which is
627 deprecated or not.</p>
628 <div class="refsect3">
629 <a name="g-base-info-is-deprecated.parameters"></a><h4>Parameters</h4>
630 <div class="informaltable"><table class="informaltable" width="100%" border="0">
632 <col width="150px" class="parameters_name">
633 <col class="parameters_description">
634 <col width="200px" class="parameters_annotations">
637 <td class="parameter_name"><p>info</p></td>
638 <td class="parameter_description"><p>a <span class="type">GIBaseInfo</span></p></td>
639 <td class="parameter_annotations"> </td>
643 <div class="refsect3">
644 <a name="g-base-info-is-deprecated.returns"></a><h4>Returns</h4>
645 <p> <code class="literal">TRUE</code> if deprecated</p>
649 <div class="refsect1">
650 <a name="gi-GIBaseInfo.other_details"></a><h2>Types and Values</h2>
651 <div class="refsect2">
652 <a name="GIInfoType"></a><h3>enum GIInfoType</h3>
653 <p>The type of a GIBaseInfo struct.</p>
654 <div class="refsect3">
655 <a name="GIInfoType.members"></a><h4>Members</h4>
656 <div class="informaltable"><table class="informaltable" width="100%" border="0">
658 <col width="300px" class="enum_members_name">
659 <col class="enum_members_description">
660 <col width="200px" class="enum_members_annotations">
664 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-INVALID:CAPS"></a>GI_INFO_TYPE_INVALID</p></td>
665 <td class="enum_member_description">
668 <td class="enum_member_annotations"> </td>
671 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-FUNCTION:CAPS"></a>GI_INFO_TYPE_FUNCTION</p></td>
672 <td class="enum_member_description">
673 <p>function, see <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a></p>
675 <td class="enum_member_annotations"> </td>
678 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-CALLBACK:CAPS"></a>GI_INFO_TYPE_CALLBACK</p></td>
679 <td class="enum_member_description">
680 <p>callback, see <a class="link" href="gi-GIFunctionInfo.html#GIFunctionInfo" title="GIFunctionInfo"><span class="type">GIFunctionInfo</span></a></p>
682 <td class="enum_member_annotations"> </td>
685 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-STRUCT:CAPS"></a>GI_INFO_TYPE_STRUCT</p></td>
686 <td class="enum_member_description">
687 <p>struct, see <a class="link" href="gi-GIStructInfo.html#GIStructInfo" title="GIStructInfo"><span class="type">GIStructInfo</span></a></p>
689 <td class="enum_member_annotations"> </td>
692 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-BOXED:CAPS"></a>GI_INFO_TYPE_BOXED</p></td>
693 <td class="enum_member_description">
694 <p>boxed, see <a class="link" href="gi-GIStructInfo.html#GIStructInfo" title="GIStructInfo"><span class="type">GIStructInfo</span></a> or <a class="link" href="gi-GIUnionInfo.html#GIUnionInfo" title="GIUnionInfo"><span class="type">GIUnionInfo</span></a></p>
696 <td class="enum_member_annotations"> </td>
699 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-ENUM:CAPS"></a>GI_INFO_TYPE_ENUM</p></td>
700 <td class="enum_member_description">
701 <p>enum, see <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p>
703 <td class="enum_member_annotations"> </td>
706 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-FLAGS:CAPS"></a>GI_INFO_TYPE_FLAGS</p></td>
707 <td class="enum_member_description">
708 <p>flags, see <a class="link" href="gi-GIEnumInfo.html#GIEnumInfo" title="GIEnumInfo"><span class="type">GIEnumInfo</span></a></p>
710 <td class="enum_member_annotations"> </td>
713 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-OBJECT:CAPS"></a>GI_INFO_TYPE_OBJECT</p></td>
714 <td class="enum_member_description">
715 <p>object, see <a class="link" href="gi-GIObjectInfo.html#GIObjectInfo" title="GIObjectInfo"><span class="type">GIObjectInfo</span></a></p>
717 <td class="enum_member_annotations"> </td>
720 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-INTERFACE:CAPS"></a>GI_INFO_TYPE_INTERFACE</p></td>
721 <td class="enum_member_description">
722 <p>interface, see <a class="link" href="gi-GIInterfaceInfo.html#GIInterfaceInfo" title="GIInterfaceInfo"><span class="type">GIInterfaceInfo</span></a></p>
724 <td class="enum_member_annotations"> </td>
727 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-CONSTANT:CAPS"></a>GI_INFO_TYPE_CONSTANT</p></td>
728 <td class="enum_member_description">
729 <p>contant, see <a class="link" href="gi-GIConstantInfo.html#GIConstantInfo" title="GIConstantInfo"><span class="type">GIConstantInfo</span></a></p>
731 <td class="enum_member_annotations"> </td>
734 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-INVALID-0:CAPS"></a>GI_INFO_TYPE_INVALID_0</p></td>
735 <td class="enum_member_description">
736 <p>deleted, used to be GI_INFO_TYPE_ERROR_DOMAIN.</p>
738 <td class="enum_member_annotations"> </td>
741 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-UNION:CAPS"></a>GI_INFO_TYPE_UNION</p></td>
742 <td class="enum_member_description">
743 <p>union, see <a class="link" href="gi-GIUnionInfo.html#GIUnionInfo" title="GIUnionInfo"><span class="type">GIUnionInfo</span></a></p>
745 <td class="enum_member_annotations"> </td>
748 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-VALUE:CAPS"></a>GI_INFO_TYPE_VALUE</p></td>
749 <td class="enum_member_description">
750 <p>enum value, see <a class="link" href="gi-GIValueInfo.html#GIValueInfo" title="GIValueInfo"><span class="type">GIValueInfo</span></a></p>
752 <td class="enum_member_annotations"> </td>
755 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-SIGNAL:CAPS"></a>GI_INFO_TYPE_SIGNAL</p></td>
756 <td class="enum_member_description">
757 <p>signal, see <a class="link" href="gi-GISignalInfo.html#GISignalInfo" title="GISignalInfo"><span class="type">GISignalInfo</span></a></p>
759 <td class="enum_member_annotations"> </td>
762 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-VFUNC:CAPS"></a>GI_INFO_TYPE_VFUNC</p></td>
763 <td class="enum_member_description">
764 <p>virtual function, see <a class="link" href="gi-GIVFuncInfo.html#GIVFuncInfo" title="GIVFuncInfo"><span class="type">GIVFuncInfo</span></a></p>
766 <td class="enum_member_annotations"> </td>
769 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-PROPERTY:CAPS"></a>GI_INFO_TYPE_PROPERTY</p></td>
770 <td class="enum_member_description">
771 <p>GObject property, see <a class="link" href="gi-GIPropertyInfo.html#GIPropertyInfo" title="GIPropertyInfo"><span class="type">GIPropertyInfo</span></a></p>
773 <td class="enum_member_annotations"> </td>
776 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-FIELD:CAPS"></a>GI_INFO_TYPE_FIELD</p></td>
777 <td class="enum_member_description">
778 <p>struct or union field, see <a class="link" href="gi-GIFieldInfo.html#GIFieldInfo" title="GIFieldInfo"><span class="type">GIFieldInfo</span></a></p>
780 <td class="enum_member_annotations"> </td>
783 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-ARG:CAPS"></a>GI_INFO_TYPE_ARG</p></td>
784 <td class="enum_member_description">
785 <p>argument of a function or callback, see <a class="link" href="gi-GIArgInfo.html#GIArgInfo" title="GIArgInfo"><span class="type">GIArgInfo</span></a></p>
787 <td class="enum_member_annotations"> </td>
790 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-TYPE:CAPS"></a>GI_INFO_TYPE_TYPE</p></td>
791 <td class="enum_member_description">
792 <p>type information, see <a class="link" href="gi-GITypeInfo.html#GITypeInfo" title="GITypeInfo"><span class="type">GITypeInfo</span></a></p>
794 <td class="enum_member_annotations"> </td>
797 <td class="enum_member_name"><p><a name="GI-INFO-TYPE-UNRESOLVED:CAPS"></a>GI_INFO_TYPE_UNRESOLVED</p></td>
798 <td class="enum_member_description">
799 <p>unresolved type, a type which is not present in
800 the typelib, or any of its dependencies.</p>
802 <td class="enum_member_annotations"> </td>
809 <div class="refsect2">
810 <a name="GIAttributeIter"></a><h3>GIAttributeIter</h3>
811 <pre class="programlisting">typedef struct {
814 <p>An opaque structure used to iterate over attributes
815 in a <span class="type">GIBaseInfo</span> struct.</p>
820 <hr>Generated by GTK-Doc V1.25.1</div>