summaryrefslogtreecommitdiff
path: root/tests/doctool/GIRepository-2.0-Python-expected/GIRepository.BaseInfo.iterate_attributes.page
blob: 9ef317d0a151337a5f5144c3f595122274aa2dd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0"?>

<page id="GIRepository.BaseInfo.iterate_attributes"
      type="topic"
      style="function"
      xmlns="http://projectmallard.org/1.0/"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/">
  <info>
    <link type="guide" xref="GIRepository.BaseInfo" group="function"/>
    <api:function>
      <api:returns>
        <api:type>gboolean</api:type>
      </api:returns>
      <api:name>g_base_info_iterate_attributes</api:name>
      <api:arg>
        <api:type>GIRepository.AttributeIter</api:type>
        <api:name>iterator</api:name>
      </api:arg>
      <api:arg>
        <api:type>utf8</api:type>
        <api:name>name</api:name>
      </api:arg>
      <api:arg>
        <api:type>utf8</api:type>
        <api:name>value</api:name>
      </api:arg>
    </api:function>
  </info>
  <title>iterate_attributes</title>
<synopsis><code mime="text/x-python">
@accepts(GIRepository.AttributeIter, utf8, utf8)
@returns(gboolean)
def iterate_attributes(iterator, name, value)
</code></synopsis>
<p>Iterate over all attributes associated with this node.  The iterator
structure is typically stack allocated, and must have its first
member initialized to None.</p><p>Both the @name and @value should be treated as constants
and must not be freed.</p><p>&lt;example&gt;
&lt;title&gt;Iterating over attributes&lt;/title&gt;
&lt;programlisting&gt;
void
print_attributes (GIBaseInfo *info)
{
GIAttributeIter iter = { 0, };
char *name;
char *value;
while (g_base_info_iterate_attributes (info, &amp;iter, &amp;name, &amp;value))
{
g_print ("attribute name: %s value: %s", name, value);
}
}
&lt;/programlisting&gt;
&lt;/example&gt;</p>

<table>
<tr>
<td><p>iterator :</p></td>
<td><p>a <link xref="GIRepository.AttributeIter">GIRepository.AttributeIter</link> structure, must be initialized; see below</p></td>
</tr>
<tr>
<td><p>name :</p></td>
<td><p>Returned name, must not be freed</p></td>
</tr>
<tr>
<td><p>value :</p></td>
<td><p>Returned name, must not be freed</p></td>
</tr>
<tr>
<td><p>Returns :</p></td>
<td><p>True if there are more attributes</p></td>
</tr>
</table>
</page>