~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Arrays.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Arrays</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GLib Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
9
9
<link rel="prev" href="glib-String-Chunks.html" title="String Chunks">
10
10
<link rel="next" href="glib-Pointer-Arrays.html" title="Pointer Arrays">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
26
26
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
27
27
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
28
28
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
 
29
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
29
30
</head>
30
31
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
31
32
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Pointer-Arrays.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
39
</tr>
39
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3371634" class="shortcut">Top</a>
40
 
                  &#160;|&#160;
41
 
                  <a href="#id3372134" class="shortcut">Description</a></nobr></td></tr>
 
40
<tr><td colspan="5" class="shortcuts">
 
41
<a href="#glib-Arrays.synopsis" class="shortcut">Top</a>
 
42
                 | 
 
43
                <a href="#glib-Arrays.description" class="shortcut">Description</a>
 
44
</td></tr>
42
45
</table>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Arrays"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
46
49
<td valign="top">
47
 
<h2>
48
 
<a name="id3371634"></a><span class="refentrytitle">Arrays</span>
49
 
</h2>
50
 
<p>Arrays &#8212; arrays of arbitrary elements which grow automatically as elements are added</p>
 
50
<h2><span class="refentrytitle"><a name="glib-Arrays.top_of_page"></a>Arrays</span></h2>
 
51
<p>Arrays — arrays of arbitrary elements which grow automatically as elements are added</p>
51
52
</td>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
55
 
<h2>Synopsis</h2>
 
56
<a name="glib-Arrays.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
57
58
 
58
59
#include &lt;glib.h&gt;
59
60
 
60
 
 
61
 
                    <a class="link" href="glib-Arrays.html#GArray">GArray</a>;
62
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-new">g_array_new</a>                         (<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> zero_terminated,
63
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> clear_,
64
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> element_size);
65
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-sized-new">g_array_sized_new</a>                   (<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> zero_terminated,
66
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> clear_,
67
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> element_size,
68
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> reserved_size);
69
 
#define             <a class="link" href="glib-Arrays.html#g-array-append-val">g_array_append_val</a>                  (a,v)
70
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-append-vals">g_array_append_vals</a>                 (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
71
 
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,
72
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> len);
73
 
#define             <a class="link" href="glib-Arrays.html#g-array-prepend-val">g_array_prepend_val</a>                 (a,v)
74
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-prepend-vals">g_array_prepend_vals</a>                (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
75
 
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,
76
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> len);
77
 
#define             <a class="link" href="glib-Arrays.html#g-array-insert-val">g_array_insert_val</a>                  (a,i,v)
78
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-insert-vals">g_array_insert_vals</a>                 (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
79
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_,
80
 
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,
81
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> len);
82
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-remove-index">g_array_remove_index</a>                (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
83
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_);
84
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-remove-index-fast">g_array_remove_index_fast</a>           (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
85
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_);
86
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-remove-range">g_array_remove_range</a>                (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
87
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_,
88
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> length);
89
 
void                <a class="link" href="glib-Arrays.html#g-array-sort">g_array_sort</a>                        (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
90
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc">GCompareFunc</a> compare_func);
91
 
void                <a class="link" href="glib-Arrays.html#g-array-sort-with-data">g_array_sort_with_data</a>              (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
92
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> compare_func,
93
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
94
 
#define             <a class="link" href="glib-Arrays.html#g-array-index">g_array_index</a>                       (a,t,i)
95
 
<a class="link" href="glib-Arrays.html#GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-set-size">g_array_set_size</a>                    (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
96
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> length);
97
 
<a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              <a class="link" href="glib-Arrays.html#g-array-free">g_array_free</a>                        (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
98
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> free_segment);
 
61
                    <a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>;
 
62
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-new" title="g_array_new ()">g_array_new</a>                         (<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> zero_terminated,
 
63
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> clear_,
 
64
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> element_size);
 
65
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-sized-new" title="g_array_sized_new ()">g_array_sized_new</a>                   (<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> zero_terminated,
 
66
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> clear_,
 
67
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> element_size,
 
68
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> reserved_size);
 
69
#define             <a class="link" href="glib-Arrays.html#g-array-append-val" title="g_array_append_val()">g_array_append_val</a>                  (a,v)
 
70
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-append-vals" title="g_array_append_vals ()">g_array_append_vals</a>                 (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
71
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> data,
 
72
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> len);
 
73
#define             <a class="link" href="glib-Arrays.html#g-array-prepend-val" title="g_array_prepend_val()">g_array_prepend_val</a>                 (a,v)
 
74
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-prepend-vals" title="g_array_prepend_vals ()">g_array_prepend_vals</a>                (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
75
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> data,
 
76
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> len);
 
77
#define             <a class="link" href="glib-Arrays.html#g-array-insert-val" title="g_array_insert_val()">g_array_insert_val</a>                  (a,i,v)
 
78
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-insert-vals" title="g_array_insert_vals ()">g_array_insert_vals</a>                 (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
79
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_,
 
80
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> data,
 
81
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> len);
 
82
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-remove-index" title="g_array_remove_index ()">g_array_remove_index</a>                (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
83
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_);
 
84
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-remove-index-fast" title="g_array_remove_index_fast ()">g_array_remove_index_fast</a>           (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
85
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_);
 
86
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-remove-range" title="g_array_remove_range ()">g_array_remove_range</a>                (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
87
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_,
 
88
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> length);
 
89
void                <a class="link" href="glib-Arrays.html#g-array-sort" title="g_array_sort ()">g_array_sort</a>                        (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
90
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc" title="GCompareFunc ()">GCompareFunc</a> compare_func);
 
91
void                <a class="link" href="glib-Arrays.html#g-array-sort-with-data" title="g_array_sort_with_data ()">g_array_sort_with_data</a>              (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
92
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> compare_func,
 
93
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
 
94
#define             <a class="link" href="glib-Arrays.html#g-array-index" title="g_array_index()">g_array_index</a>                       (a,t,i)
 
95
<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             <a class="link" href="glib-Arrays.html#g-array-set-size" title="g_array_set_size ()">g_array_set_size</a>                    (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
96
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> length);
 
97
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>*              <a class="link" href="glib-Arrays.html#g-array-free" title="g_array_free ()">g_array_free</a>                        (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
98
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> free_segment);
99
99
</pre>
100
100
</div>
101
101
<div class="refsect1" lang="en">
102
 
<a name="id3372134"></a><h2>Description</h2>
 
102
<a name="glib-Arrays.description"></a><h2>Description</h2>
103
103
<p>
104
104
Arrays are similar to standard C arrays, except that they grow automatically
105
105
as elements are added.
110
110
zero-terminated.
111
111
</p>
112
112
<p>
113
 
To create a new array use <a class="link" href="glib-Arrays.html#g-array-new"><code class="function">g_array_new()</code></a>.
114
 
</p>
115
 
<p>
116
 
To add elements to an array, use <a class="link" href="glib-Arrays.html#g-array-append-val"><code class="function">g_array_append_val()</code></a>, <a class="link" href="glib-Arrays.html#g-array-append-vals"><code class="function">g_array_append_vals()</code></a>,
117
 
<a class="link" href="glib-Arrays.html#g-array-prepend-val"><code class="function">g_array_prepend_val()</code></a>, and <a class="link" href="glib-Arrays.html#g-array-prepend-vals"><code class="function">g_array_prepend_vals()</code></a>.
118
 
</p>
119
 
<p>
120
 
To access an element of an array, use <a class="link" href="glib-Arrays.html#g-array-index"><code class="function">g_array_index()</code></a>.
121
 
</p>
122
 
<p>
123
 
To set the size of an array, use <a class="link" href="glib-Arrays.html#g-array-set-size"><code class="function">g_array_set_size()</code></a>.
124
 
</p>
125
 
<p>
126
 
To free an array, use <a class="link" href="glib-Arrays.html#g-array-free"><code class="function">g_array_free()</code></a>.
 
113
To create a new array use <a class="link" href="glib-Arrays.html#g-array-new" title="g_array_new ()"><code class="function">g_array_new()</code></a>.
 
114
</p>
 
115
<p>
 
116
To add elements to an array, use <a class="link" href="glib-Arrays.html#g-array-append-val" title="g_array_append_val()"><code class="function">g_array_append_val()</code></a>, <a class="link" href="glib-Arrays.html#g-array-append-vals" title="g_array_append_vals ()"><code class="function">g_array_append_vals()</code></a>,
 
117
<a class="link" href="glib-Arrays.html#g-array-prepend-val" title="g_array_prepend_val()"><code class="function">g_array_prepend_val()</code></a>, and <a class="link" href="glib-Arrays.html#g-array-prepend-vals" title="g_array_prepend_vals ()"><code class="function">g_array_prepend_vals()</code></a>.
 
118
</p>
 
119
<p>
 
120
To access an element of an array, use <a class="link" href="glib-Arrays.html#g-array-index" title="g_array_index()"><code class="function">g_array_index()</code></a>.
 
121
</p>
 
122
<p>
 
123
To set the size of an array, use <a class="link" href="glib-Arrays.html#g-array-set-size" title="g_array_set_size ()"><code class="function">g_array_set_size()</code></a>.
 
124
</p>
 
125
<p>
 
126
To free an array, use <a class="link" href="glib-Arrays.html#g-array-free" title="g_array_free ()"><code class="function">g_array_free()</code></a>.
127
127
</p>
128
128
<div class="example">
129
 
<a name="id3372259"></a><p class="title"><b>Example&#160;19.&#160;Using a <span class="structname">GArray</span> to store <span class="type">gint</span> values</b></p>
 
129
<a name="id3426081"></a><p class="title"><b>Example 19. Using a <span class="structname">GArray</span> to store <span class="type">gint</span> values</b></p>
130
130
<div class="example-contents"><pre class="programlisting">
131
131
  GArray *garray;
132
132
  gint i;
133
 
 
134
133
  /* We create a new array to store gint values.
135
134
     We don't want it zero-terminated or cleared to 0's. */
136
135
  garray = g_array_new (FALSE, FALSE, sizeof (gint));
137
136
  for (i = 0; i &lt; 10000; i++)
138
137
    g_array_append_val (garray, i);
139
 
 
140
138
  for (i = 0; i &lt; 10000; i++)
141
139
    if (g_array_index (garray, gint, i) != i)
142
140
      g_print ("ERROR: got %d instead of %d\n",
143
141
               g_array_index (garray, gint, i), i);
144
 
 
145
142
  g_array_free (garray, TRUE);
146
143
</pre></div>
147
144
</div>
148
145
<br class="example-break">
149
146
</div>
150
147
<div class="refsect1" lang="en">
151
 
<a name="id3372277"></a><h2>Details</h2>
 
148
<a name="glib-Arrays.details"></a><h2>Details</h2>
152
149
<div class="refsect2" lang="en">
153
 
<a name="id3372297"></a><h3>
154
 
<a name="GArray"></a>GArray</h3>
155
 
<a class="indexterm" name="id3372309"></a><pre class="programlisting">typedef struct {
 
150
<a name="GArray"></a><h3>GArray</h3>
 
151
<pre class="programlisting">typedef struct {
156
152
  gchar *data;
157
153
  guint len;
158
154
} GArray;
164
160
<col align="left" valign="top">
165
161
<tbody>
166
162
<tr>
167
 
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>&#160;*<em class="structfield"><code>data</code></em>;</span></p></td>
 
163
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a> *<em class="structfield"><code>data</code></em>;</span></p></td>
168
164
<td>a pointer to the element data. The data may be moved as elements are
169
 
added to the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
165
added to the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
170
166
</td>
171
167
</tr>
172
168
<tr>
173
 
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint">guint</a>&#160;<em class="structfield"><code>len</code></em>;</span></p></td>
174
 
<td>the number of elements in the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
175
 
 
 
169
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <em class="structfield"><code>len</code></em>;</span></p></td>
 
170
<td>the number of elements in the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
176
171
</td>
177
172
</tr>
178
173
</tbody>
180
175
</div>
181
176
<hr>
182
177
<div class="refsect2" lang="en">
183
 
<a name="id3372395"></a><h3>
184
 
<a name="g-array-new"></a>g_array_new ()</h3>
185
 
<a class="indexterm" name="id3372407"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_new                         (<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> zero_terminated,
186
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> clear_,
187
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> element_size);</pre>
 
178
<a name="g-array-new"></a><h3>g_array_new ()</h3>
 
179
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_new                         (<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> zero_terminated,
 
180
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> clear_,
 
181
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> element_size);</pre>
188
182
<p>
189
 
Creates a new <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
183
Creates a new <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
190
184
</p>
191
185
<div class="variablelist"><table border="0">
192
186
<col align="left" valign="top">
193
187
<tbody>
194
188
<tr>
195
 
<td><p><span class="term"><em class="parameter"><code>zero_terminated</code></em>&#160;:</span></p></td>
196
 
<td>
197
 
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the array should have an extra element at the end
 
189
<td><p><span class="term"><em class="parameter"><code>zero_terminated</code></em> :</span></p></td>
 
190
<td>%TRUE if the array should have an extra element at the end
198
191
which is set to 0.
199
192
</td>
200
193
</tr>
201
194
<tr>
202
 
<td><p><span class="term"><em class="parameter"><code>clear_</code></em>&#160;:</span></p></td>
203
 
<td>
204
 
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> elements should be automatically cleared to 0
 
195
<td><p><span class="term"><em class="parameter"><code>clear_</code></em> :</span></p></td>
 
196
<td>%TRUE if <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> elements should be automatically cleared to 0
205
197
when they are allocated.
206
198
</td>
207
199
</tr>
208
200
<tr>
209
 
<td><p><span class="term"><em class="parameter"><code>element_size</code></em>&#160;:</span></p></td>
 
201
<td><p><span class="term"><em class="parameter"><code>element_size</code></em> :</span></p></td>
210
202
<td>the size of each element in bytes.
211
203
</td>
212
204
</tr>
213
205
<tr>
214
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
215
 
<td>the new <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
216
 
 
217
 
 
 
206
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
207
<td>the new <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
218
208
</td>
219
209
</tr>
220
210
</tbody>
222
212
</div>
223
213
<hr>
224
214
<div class="refsect2" lang="en">
225
 
<a name="id3372552"></a><h3>
226
 
<a name="g-array-sized-new"></a>g_array_sized_new ()</h3>
227
 
<a class="indexterm" name="id3372565"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_sized_new                   (<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> zero_terminated,
228
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> clear_,
229
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> element_size,
230
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> reserved_size);</pre>
 
215
<a name="g-array-sized-new"></a><h3>g_array_sized_new ()</h3>
 
216
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_sized_new                   (<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> zero_terminated,
 
217
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> clear_,
 
218
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> element_size,
 
219
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> reserved_size);</pre>
231
220
<p>
232
 
Creates a new <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> with <em class="parameter"><code>reserved_size</code></em> elements
 
221
Creates a new <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> with <em class="parameter"><code>reserved_size</code></em> elements
233
222
preallocated. This avoids frequent reallocation, if you are going to
234
223
add many elements to the array. Note however that the size of the
235
224
array is still 0.
238
227
<col align="left" valign="top">
239
228
<tbody>
240
229
<tr>
241
 
<td><p><span class="term"><em class="parameter"><code>zero_terminated</code></em>&#160;:</span></p></td>
242
 
<td>
243
 
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the array should have an extra element at the end with all bits cleared.
244
 
</td>
245
 
</tr>
246
 
<tr>
247
 
<td><p><span class="term"><em class="parameter"><code>clear_</code></em>&#160;:</span></p></td>
248
 
<td>
249
 
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if all bits in the array should be cleared to 0 on allocation.
250
 
</td>
251
 
</tr>
252
 
<tr>
253
 
<td><p><span class="term"><em class="parameter"><code>element_size</code></em>&#160;:</span></p></td>
 
230
<td><p><span class="term"><em class="parameter"><code>zero_terminated</code></em> :</span></p></td>
 
231
<td>%TRUE if the array should have an extra element at the end with all bits cleared.
 
232
</td>
 
233
</tr>
 
234
<tr>
 
235
<td><p><span class="term"><em class="parameter"><code>clear_</code></em> :</span></p></td>
 
236
<td>%TRUE if all bits in the array should be cleared to 0 on allocation.
 
237
</td>
 
238
</tr>
 
239
<tr>
 
240
<td><p><span class="term"><em class="parameter"><code>element_size</code></em> :</span></p></td>
254
241
<td>size of each element in the array.
255
242
</td>
256
243
</tr>
257
244
<tr>
258
 
<td><p><span class="term"><em class="parameter"><code>reserved_size</code></em>&#160;:</span></p></td>
 
245
<td><p><span class="term"><em class="parameter"><code>reserved_size</code></em> :</span></p></td>
259
246
<td>number of elements preallocated.
260
247
</td>
261
248
</tr>
262
249
<tr>
263
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
264
 
<td>the new <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
265
 
 
266
 
 
 
250
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
251
<td>the new <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
267
252
</td>
268
253
</tr>
269
254
</tbody>
271
256
</div>
272
257
<hr>
273
258
<div class="refsect2" lang="en">
274
 
<a name="id3372733"></a><h3>
275
 
<a name="g-array-append-val"></a>g_array_append_val()</h3>
276
 
<a class="indexterm" name="id3372746"></a><pre class="programlisting">#define             g_array_append_val(a,v)</pre>
 
259
<a name="g-array-append-val"></a><h3>g_array_append_val()</h3>
 
260
<pre class="programlisting">#define             g_array_append_val(a,v)</pre>
277
261
<p>
278
262
Adds the value on to the end of the array.
279
263
The array will grow in size automatically if necessary.
281
265
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
282
266
<h3 class="title">Note</h3>
283
267
<p>
284
 
<a class="link" href="glib-Arrays.html#g-array-append-val"><code class="function">g_array_append_val()</code></a> is a macro which uses a reference to the value
 
268
<a class="link" href="glib-Arrays.html#g-array-append-val" title="g_array_append_val()"><code class="function">g_array_append_val()</code></a> is a macro which uses a reference to the value
285
269
parameter <em class="parameter"><code>v</code></em>. This means that you cannot use it with literal values
286
270
such as "27". You must use variables.
287
271
</p>
290
274
<col align="left" valign="top">
291
275
<tbody>
292
276
<tr>
293
 
<td><p><span class="term"><em class="parameter"><code>a</code></em>&#160;:</span></p></td>
294
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
295
 
</td>
296
 
</tr>
297
 
<tr>
298
 
<td><p><span class="term"><em class="parameter"><code>v</code></em>&#160;:</span></p></td>
299
 
<td>the value to append to the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
300
 
</td>
301
 
</tr>
302
 
<tr>
303
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
304
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
305
 
 
306
 
 
 
277
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
 
278
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
279
</td>
 
280
</tr>
 
281
<tr>
 
282
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
 
283
<td>the value to append to the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
284
</td>
 
285
</tr>
 
286
<tr>
 
287
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
288
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
307
289
</td>
308
290
</tr>
309
291
</tbody>
311
293
</div>
312
294
<hr>
313
295
<div class="refsect2" lang="en">
314
 
<a name="id3372854"></a><h3>
315
 
<a name="g-array-append-vals"></a>g_array_append_vals ()</h3>
316
 
<a class="indexterm" name="id3372867"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_append_vals                 (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
317
 
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,
318
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> len);</pre>
 
296
<a name="g-array-append-vals"></a><h3>g_array_append_vals ()</h3>
 
297
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_append_vals                 (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
298
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> data,
 
299
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> len);</pre>
319
300
<p>
320
301
Adds <em class="parameter"><code>len</code></em> elements onto the end of the array.
321
302
</p>
323
304
<col align="left" valign="top">
324
305
<tbody>
325
306
<tr>
326
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
327
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
307
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
308
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
328
309
</td>
329
310
</tr>
330
311
<tr>
331
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
312
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
332
313
<td>a pointer to the elements to append to the end of the array.
333
314
</td>
334
315
</tr>
335
316
<tr>
336
 
<td><p><span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></p></td>
 
317
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
337
318
<td>the number of elements to append.
338
319
</td>
339
320
</tr>
340
321
<tr>
341
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
342
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
343
 
 
344
 
 
 
322
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
323
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
345
324
</td>
346
325
</tr>
347
326
</tbody>
349
328
</div>
350
329
<hr>
351
330
<div class="refsect2" lang="en">
352
 
<a name="id3372990"></a><h3>
353
 
<a name="g-array-prepend-val"></a>g_array_prepend_val()</h3>
354
 
<a class="indexterm" name="id3373003"></a><pre class="programlisting">#define             g_array_prepend_val(a,v)</pre>
 
331
<a name="g-array-prepend-val"></a><h3>g_array_prepend_val()</h3>
 
332
<pre class="programlisting">#define             g_array_prepend_val(a,v)</pre>
355
333
<p>
356
334
Adds the value on to the start of the array.
357
335
The array will grow in size automatically if necessary.
358
336
</p>
359
337
<p>
360
 
This operation is slower than <a class="link" href="glib-Arrays.html#g-array-append-val"><code class="function">g_array_append_val()</code></a> since the existing elements
 
338
This operation is slower than <a class="link" href="glib-Arrays.html#g-array-append-val" title="g_array_append_val()"><code class="function">g_array_append_val()</code></a> since the existing elements
361
339
in the array have to be moved to make space for the new element.
362
340
</p>
363
341
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
364
342
<h3 class="title">Note</h3>
365
343
<p>
366
 
<a class="link" href="glib-Arrays.html#g-array-prepend-val"><code class="function">g_array_prepend_val()</code></a> is a macro which uses a reference to the value
 
344
<a class="link" href="glib-Arrays.html#g-array-prepend-val" title="g_array_prepend_val()"><code class="function">g_array_prepend_val()</code></a> is a macro which uses a reference to the value
367
345
parameter <em class="parameter"><code>v</code></em>. This means that you cannot use it with literal values
368
346
such as "27". You must use variables.
369
347
</p>
372
350
<col align="left" valign="top">
373
351
<tbody>
374
352
<tr>
375
 
<td><p><span class="term"><em class="parameter"><code>a</code></em>&#160;:</span></p></td>
376
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
377
 
</td>
378
 
</tr>
379
 
<tr>
380
 
<td><p><span class="term"><em class="parameter"><code>v</code></em>&#160;:</span></p></td>
381
 
<td>the value to prepend to the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
382
 
</td>
383
 
</tr>
384
 
<tr>
385
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
386
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
387
 
 
388
 
 
 
353
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
 
354
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
355
</td>
 
356
</tr>
 
357
<tr>
 
358
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
 
359
<td>the value to prepend to the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
360
</td>
 
361
</tr>
 
362
<tr>
 
363
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
364
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
389
365
</td>
390
366
</tr>
391
367
</tbody>
393
369
</div>
394
370
<hr>
395
371
<div class="refsect2" lang="en">
396
 
<a name="id3373127"></a><h3>
397
 
<a name="g-array-prepend-vals"></a>g_array_prepend_vals ()</h3>
398
 
<a class="indexterm" name="id3373140"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_prepend_vals                (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
399
 
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,
400
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> len);</pre>
 
372
<a name="g-array-prepend-vals"></a><h3>g_array_prepend_vals ()</h3>
 
373
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_prepend_vals                (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
374
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> data,
 
375
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> len);</pre>
401
376
<p>
402
377
Adds <em class="parameter"><code>len</code></em> elements onto the start of the array.
403
378
</p>
404
379
<p>
405
 
This operation is slower than <a class="link" href="glib-Arrays.html#g-array-append-vals"><code class="function">g_array_append_vals()</code></a> since the existing elements
 
380
This operation is slower than <a class="link" href="glib-Arrays.html#g-array-append-vals" title="g_array_append_vals ()"><code class="function">g_array_append_vals()</code></a> since the existing elements
406
381
in the array have to be moved to make space for the new elements.
407
382
</p>
408
383
<div class="variablelist"><table border="0">
409
384
<col align="left" valign="top">
410
385
<tbody>
411
386
<tr>
412
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
413
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
387
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
388
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
414
389
</td>
415
390
</tr>
416
391
<tr>
417
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
392
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
418
393
<td>a pointer to the elements to prepend to the start of the array.
419
394
</td>
420
395
</tr>
421
396
<tr>
422
 
<td><p><span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></p></td>
 
397
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
423
398
<td>the number of elements to prepend.
424
399
</td>
425
400
</tr>
426
401
<tr>
427
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
428
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
429
 
 
430
 
 
 
402
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
403
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
431
404
</td>
432
405
</tr>
433
406
</tbody>
435
408
</div>
436
409
<hr>
437
410
<div class="refsect2" lang="en">
438
 
<a name="id3373280"></a><h3>
439
 
<a name="g-array-insert-val"></a>g_array_insert_val()</h3>
440
 
<a class="indexterm" name="id3373293"></a><pre class="programlisting">#define             g_array_insert_val(a,i,v)</pre>
 
411
<a name="g-array-insert-val"></a><h3>g_array_insert_val()</h3>
 
412
<pre class="programlisting">#define             g_array_insert_val(a,i,v)</pre>
441
413
<p>
442
414
Inserts an element into an array at the given index.
443
415
</p>
444
416
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
445
417
<h3 class="title">Note</h3>
446
418
<p>
447
 
<a class="link" href="glib-Arrays.html#g-array-insert-val"><code class="function">g_array_insert_val()</code></a> is a macro which uses a reference to the value
 
419
<a class="link" href="glib-Arrays.html#g-array-insert-val" title="g_array_insert_val()"><code class="function">g_array_insert_val()</code></a> is a macro which uses a reference to the value
448
420
parameter <em class="parameter"><code>v</code></em>. This means that you cannot use it with literal values
449
421
such as "27". You must use variables.
450
422
</p>
453
425
<col align="left" valign="top">
454
426
<tbody>
455
427
<tr>
456
 
<td><p><span class="term"><em class="parameter"><code>a</code></em>&#160;:</span></p></td>
457
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
428
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
 
429
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
458
430
</td>
459
431
</tr>
460
432
<tr>
461
 
<td><p><span class="term"><em class="parameter"><code>i</code></em>&#160;:</span></p></td>
 
433
<td><p><span class="term"><em class="parameter"><code>i</code></em> :</span></p></td>
462
434
<td>the index to place the element at.
463
435
</td>
464
436
</tr>
465
437
<tr>
466
 
<td><p><span class="term"><em class="parameter"><code>v</code></em>&#160;:</span></p></td>
 
438
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
467
439
<td>the value to insert into the array.
468
440
</td>
469
441
</tr>
470
442
<tr>
471
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
472
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
473
 
 
474
 
 
 
443
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
444
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
475
445
</td>
476
446
</tr>
477
447
</tbody>
479
449
</div>
480
450
<hr>
481
451
<div class="refsect2" lang="en">
482
 
<a name="id3373406"></a><h3>
483
 
<a name="g-array-insert-vals"></a>g_array_insert_vals ()</h3>
484
 
<a class="indexterm" name="id3373419"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_insert_vals                 (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
485
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_,
486
 
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> data,
487
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> len);</pre>
 
452
<a name="g-array-insert-vals"></a><h3>g_array_insert_vals ()</h3>
 
453
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_insert_vals                 (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
454
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_,
 
455
                                                         <a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> data,
 
456
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> len);</pre>
488
457
<p>
489
 
Inserts <em class="parameter"><code>len</code></em> elements into a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> at the given index.
 
458
Inserts <em class="parameter"><code>len</code></em> elements into a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> at the given index.
490
459
</p>
491
460
<div class="variablelist"><table border="0">
492
461
<col align="left" valign="top">
493
462
<tbody>
494
463
<tr>
495
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
496
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
464
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
465
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
497
466
</td>
498
467
</tr>
499
468
<tr>
500
 
<td><p><span class="term"><em class="parameter"><code>index_</code></em>&#160;:</span></p></td>
 
469
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
501
470
<td>the index to place the elements at.
502
471
</td>
503
472
</tr>
504
473
<tr>
505
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
474
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
506
475
<td>a pointer to the elements to insert.
507
476
</td>
508
477
</tr>
509
478
<tr>
510
 
<td><p><span class="term"><em class="parameter"><code>len</code></em>&#160;:</span></p></td>
 
479
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
511
480
<td>the number of elements to insert.
512
481
</td>
513
482
</tr>
514
483
<tr>
515
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
516
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
517
 
 
518
 
 
 
484
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
485
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
519
486
</td>
520
487
</tr>
521
488
</tbody>
523
490
</div>
524
491
<hr>
525
492
<div class="refsect2" lang="en">
526
 
<a name="id3373571"></a><h3>
527
 
<a name="g-array-remove-index"></a>g_array_remove_index ()</h3>
528
 
<a class="indexterm" name="id3373585"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_remove_index                (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
529
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_);</pre>
 
493
<a name="g-array-remove-index"></a><h3>g_array_remove_index ()</h3>
 
494
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_remove_index                (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
495
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_);</pre>
530
496
<p>
531
 
Removes the element at the given index from a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
497
Removes the element at the given index from a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
532
498
The following elements are moved down one place.
533
499
</p>
534
500
<div class="variablelist"><table border="0">
535
501
<col align="left" valign="top">
536
502
<tbody>
537
503
<tr>
538
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
539
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
504
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
505
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
540
506
</td>
541
507
</tr>
542
508
<tr>
543
 
<td><p><span class="term"><em class="parameter"><code>index_</code></em>&#160;:</span></p></td>
 
509
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
544
510
<td>the index of the element to remove.
545
511
</td>
546
512
</tr>
547
513
<tr>
548
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
549
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
550
 
 
551
 
 
 
514
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
515
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
552
516
</td>
553
517
</tr>
554
518
</tbody>
556
520
</div>
557
521
<hr>
558
522
<div class="refsect2" lang="en">
559
 
<a name="id3373689"></a><h3>
560
 
<a name="g-array-remove-index-fast"></a>g_array_remove_index_fast ()</h3>
561
 
<a class="indexterm" name="id3373703"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_remove_index_fast           (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
562
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_);</pre>
 
523
<a name="g-array-remove-index-fast"></a><h3>g_array_remove_index_fast ()</h3>
 
524
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_remove_index_fast           (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
525
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_);</pre>
563
526
<p>
564
 
Removes the element at the given index from a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
527
Removes the element at the given index from a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
565
528
The last element in the array is used to fill in the space, so this function
566
 
does not preserve the order of the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>. But it is faster than
567
 
<a class="link" href="glib-Arrays.html#g-array-remove-index"><code class="function">g_array_remove_index()</code></a>.
 
529
does not preserve the order of the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>. But it is faster than
 
530
<a class="link" href="glib-Arrays.html#g-array-remove-index" title="g_array_remove_index ()"><code class="function">g_array_remove_index()</code></a>.
568
531
</p>
569
532
<div class="variablelist"><table border="0">
570
533
<col align="left" valign="top">
571
534
<tbody>
572
535
<tr>
573
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
 
536
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
574
537
<td>a <em class="parameter"><code>GArray</code></em>.
575
538
</td>
576
539
</tr>
577
540
<tr>
578
 
<td><p><span class="term"><em class="parameter"><code>index_</code></em>&#160;:</span></p></td>
 
541
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
579
542
<td>the index of the element to remove.
580
543
</td>
581
544
</tr>
582
545
<tr>
583
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
584
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
585
 
 
586
 
 
 
546
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
547
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
587
548
</td>
588
549
</tr>
589
550
</tbody>
591
552
</div>
592
553
<hr>
593
554
<div class="refsect2" lang="en">
594
 
<a name="id3373824"></a><h3>
595
 
<a name="g-array-remove-range"></a>g_array_remove_range ()</h3>
596
 
<a class="indexterm" name="id3373839"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_remove_range                (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
597
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> index_,
598
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> length);</pre>
 
555
<a name="g-array-remove-range"></a><h3>g_array_remove_range ()</h3>
 
556
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_remove_range                (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
557
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> index_,
 
558
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> length);</pre>
599
559
<p>
600
560
Removes the given number of elements starting at the given index from a
601
 
<a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.  The following elements are moved to close the gap.
 
561
<a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.  The following elements are moved to close the gap.
602
562
</p>
603
563
<div class="variablelist"><table border="0">
604
564
<col align="left" valign="top">
605
565
<tbody>
606
566
<tr>
607
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
 
567
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
608
568
<td>a <em class="parameter"><code>GArray</code></em>.
609
569
</td>
610
570
</tr>
611
571
<tr>
612
 
<td><p><span class="term"><em class="parameter"><code>index_</code></em>&#160;:</span></p></td>
 
572
<td><p><span class="term"><em class="parameter"><code>index_</code></em> :</span></p></td>
613
573
<td>the index of the first element to remove.
614
574
</td>
615
575
</tr>
616
576
<tr>
617
 
<td><p><span class="term"><em class="parameter"><code>length</code></em>&#160;:</span></p></td>
 
577
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
618
578
<td>the number of elements to remove.
619
579
</td>
620
580
</tr>
621
581
<tr>
622
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
623
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
582
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
583
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
624
584
</td>
625
585
</tr>
626
586
</tbody>
627
587
</table></div>
628
 
<p class="since">Since 2.4
629
 
 
630
 
 
631
 
</p>
 
588
<p class="since">Since 2.4</p>
632
589
</div>
633
590
<hr>
634
591
<div class="refsect2" lang="en">
635
 
<a name="id3373970"></a><h3>
636
 
<a name="g-array-sort"></a>g_array_sort ()</h3>
637
 
<a class="indexterm" name="id3373983"></a><pre class="programlisting">void                g_array_sort                        (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
638
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc">GCompareFunc</a> compare_func);</pre>
 
592
<a name="g-array-sort"></a><h3>g_array_sort ()</h3>
 
593
<pre class="programlisting">void                g_array_sort                        (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
594
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc" title="GCompareFunc ()">GCompareFunc</a> compare_func);</pre>
639
595
<p>
640
 
Sorts a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> using <em class="parameter"><code>compare_func</code></em> which should be a <code class="function">qsort()</code>-style comparison
641
 
function (returns less than zero for first arg is less than second arg, 
 
596
Sorts a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> using <em class="parameter"><code>compare_func</code></em> which should be a <code class="function">qsort()</code>-style comparison
 
597
function (returns less than zero for first arg is less than second arg,
642
598
zero for equal, greater zero if first arg is greater than second arg).
643
599
</p>
644
600
<p>
649
605
<col align="left" valign="top">
650
606
<tbody>
651
607
<tr>
652
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
653
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
608
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
609
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
654
610
</td>
655
611
</tr>
656
612
<tr>
657
 
<td><p><span class="term"><em class="parameter"><code>compare_func</code></em>&#160;:</span></p></td>
 
613
<td><p><span class="term"><em class="parameter"><code>compare_func</code></em> :</span></p></td>
658
614
<td>comparison function.
659
 
 
660
 
 
661
615
</td>
662
616
</tr>
663
617
</tbody>
665
619
</div>
666
620
<hr>
667
621
<div class="refsect2" lang="en">
668
 
<a name="id3374092"></a><h3>
669
 
<a name="g-array-sort-with-data"></a>g_array_sort_with_data ()</h3>
670
 
<a class="indexterm" name="id3374105"></a><pre class="programlisting">void                g_array_sort_with_data              (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
671
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> compare_func,
672
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
 
622
<a name="g-array-sort-with-data"></a><h3>g_array_sort_with_data ()</h3>
 
623
<pre class="programlisting">void                g_array_sort_with_data              (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
624
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> compare_func,
 
625
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
673
626
<p>
674
 
Like <a class="link" href="glib-Arrays.html#g-array-sort"><code class="function">g_array_sort()</code></a>, but the comparison function receives an extra user data
 
627
Like <a class="link" href="glib-Arrays.html#g-array-sort" title="g_array_sort ()"><code class="function">g_array_sort()</code></a>, but the comparison function receives an extra user data
675
628
argument.
676
629
</p>
677
630
<div class="variablelist"><table border="0">
678
631
<col align="left" valign="top">
679
632
<tbody>
680
633
<tr>
681
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
682
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
634
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
635
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
683
636
</td>
684
637
</tr>
685
638
<tr>
686
 
<td><p><span class="term"><em class="parameter"><code>compare_func</code></em>&#160;:</span></p></td>
 
639
<td><p><span class="term"><em class="parameter"><code>compare_func</code></em> :</span></p></td>
687
640
<td>comparison function.
688
641
</td>
689
642
</tr>
690
643
<tr>
691
 
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
 
644
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
692
645
<td>data to pass to <em class="parameter"><code>compare_func</code></em>.
693
 
 
694
 
 
695
646
</td>
696
647
</tr>
697
648
</tbody>
699
650
</div>
700
651
<hr>
701
652
<div class="refsect2" lang="en">
702
 
<a name="id3374222"></a><h3>
703
 
<a name="g-array-index"></a>g_array_index()</h3>
704
 
<a class="indexterm" name="id3374235"></a><pre class="programlisting">#define             g_array_index(a,t,i)</pre>
 
653
<a name="g-array-index"></a><h3>g_array_index()</h3>
 
654
<pre class="programlisting">#define             g_array_index(a,t,i)</pre>
705
655
<p>
706
 
Returns the element of a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> at the given index.
 
656
Returns the element of a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> at the given index.
707
657
The return value is cast to the given type.
708
 
 
709
658
</p>
710
659
<div class="example">
711
 
<a name="id3374258"></a><p class="title"><b>Example&#160;20.&#160;Getting a pointer to an element in a <span class="structname">GArray</span></b></p>
 
660
<a name="id3428120"></a><p class="title"><b>Example 20. Getting a pointer to an element in a <span class="structname">GArray</span></b></p>
712
661
<div class="example-contents"><pre class="programlisting">
713
662
  EDayViewEvent *event;
714
 
 
715
 
  /* This gets a pointer to the 3rd element in the array of EDayViewEvent
 
663
  /* This gets a pointer to the 4th element in the array of EDayViewEvent
716
664
     structs. */
717
665
  event = &amp;g_array_index (events, EDayViewEvent, 3);
718
666
</pre></div>
723
671
<col align="left" valign="top">
724
672
<tbody>
725
673
<tr>
726
 
<td><p><span class="term"><em class="parameter"><code>a</code></em>&#160;:</span></p></td>
727
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
 
674
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
 
675
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
728
676
</td>
729
677
</tr>
730
678
<tr>
731
 
<td><p><span class="term"><em class="parameter"><code>t</code></em>&#160;:</span></p></td>
 
679
<td><p><span class="term"><em class="parameter"><code>t</code></em> :</span></p></td>
732
680
<td>the type of the elements.
733
681
</td>
734
682
</tr>
735
683
<tr>
736
 
<td><p><span class="term"><em class="parameter"><code>i</code></em>&#160;:</span></p></td>
 
684
<td><p><span class="term"><em class="parameter"><code>i</code></em> :</span></p></td>
737
685
<td>the index of the element to return.
738
686
</td>
739
687
</tr>
740
688
<tr>
741
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
742
 
<td>the element of the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> at the index given by <em class="parameter"><code>i</code></em>.
743
 
 
744
 
 
 
689
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
690
<td>the element of the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> at the index given by <em class="parameter"><code>i</code></em>.
745
691
</td>
746
692
</tr>
747
693
</tbody>
749
695
</div>
750
696
<hr>
751
697
<div class="refsect2" lang="en">
752
 
<a name="id3374357"></a><h3>
753
 
<a name="g-array-set-size"></a>g_array_set_size ()</h3>
754
 
<a class="indexterm" name="id3374370"></a><pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray">GArray</a>*             g_array_set_size                    (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
755
 
                                                         <a class="link" href="glib-Basic-Types.html#guint">guint</a> length);</pre>
 
698
<a name="g-array-set-size"></a><h3>g_array_set_size ()</h3>
 
699
<pre class="programlisting"><a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a>*             g_array_set_size                    (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
700
                                                         <a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> length);</pre>
756
701
<p>
757
702
Sets the size of the array, expanding it if necessary.
758
 
If the array was created with <em class="parameter"><code>clear_</code></em> set to <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the new elements are set to 0.
 
703
If the array was created with <em class="parameter"><code>clear_</code></em> set to <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>, the new elements are set to 0.
759
704
</p>
760
705
<div class="variablelist"><table border="0">
761
706
<col align="left" valign="top">
762
707
<tbody>
763
708
<tr>
764
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
765
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
766
 
</td>
767
 
</tr>
768
 
<tr>
769
 
<td><p><span class="term"><em class="parameter"><code>length</code></em>&#160;:</span></p></td>
770
 
<td>the new size of the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
771
 
</td>
772
 
</tr>
773
 
<tr>
774
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
775
 
<td>the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
776
 
 
777
 
 
 
709
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
710
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
711
</td>
 
712
</tr>
 
713
<tr>
 
714
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
 
715
<td>the new size of the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
716
</td>
 
717
</tr>
 
718
<tr>
 
719
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
720
<td>the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
778
721
</td>
779
722
</tr>
780
723
</tbody>
782
725
</div>
783
726
<hr>
784
727
<div class="refsect2" lang="en">
785
 
<a name="id3374490"></a><h3>
786
 
<a name="g-array-free"></a>g_array_free ()</h3>
787
 
<a class="indexterm" name="id3374503"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_array_free                        (<a class="link" href="glib-Arrays.html#GArray">GArray</a> *array,
788
 
                                                         <a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> free_segment);</pre>
 
728
<a name="g-array-free"></a><h3>g_array_free ()</h3>
 
729
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar">gchar</a>*              g_array_free                        (<a class="link" href="glib-Arrays.html#GArray" title="GArray">GArray</a> *array,
 
730
                                                         <a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> free_segment);</pre>
789
731
<p>
790
 
Frees the memory allocated for the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
791
 
If <em class="parameter"><code>free_segment</code></em> is <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> it frees the memory block holding the elements
792
 
as well. Pass <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if you want to free the <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a> wrapper but preserve
 
732
Frees the memory allocated for the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
733
If <em class="parameter"><code>free_segment</code></em> is <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> it frees the memory block holding the elements
 
734
as well. Pass <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if you want to free the <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a> wrapper but preserve
793
735
the underlying array for use elsewhere.
794
736
</p>
795
737
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
803
745
<col align="left" valign="top">
804
746
<tbody>
805
747
<tr>
806
 
<td><p><span class="term"><em class="parameter"><code>array</code></em>&#160;:</span></p></td>
807
 
<td>a <a class="link" href="glib-Arrays.html#GArray"><span class="type">GArray</span></a>.
808
 
</td>
809
 
</tr>
810
 
<tr>
811
 
<td><p><span class="term"><em class="parameter"><code>free_segment</code></em>&#160;:</span></p></td>
812
 
<td>if <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> the actual element data is freed as well.
813
 
</td>
814
 
</tr>
815
 
<tr>
816
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
817
 
<td>the element data if <em class="parameter"><code>free_segment</code></em> is <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, otherwise <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
818
 
        The element data should be freed using <a class="link" href="glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.
819
 
 
820
 
 
 
748
<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
 
749
<td>a <a class="link" href="glib-Arrays.html#GArray" title="GArray"><span class="type">GArray</span></a>.
 
750
</td>
 
751
</tr>
 
752
<tr>
 
753
<td><p><span class="term"><em class="parameter"><code>free_segment</code></em> :</span></p></td>
 
754
<td>if <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> the actual element data is freed as well.
 
755
</td>
 
756
</tr>
 
757
<tr>
 
758
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
759
<td>the element data if <em class="parameter"><code>free_segment</code></em> is <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a>, otherwise <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.
 
760
        The element data should be freed using <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.
821
761
</td>
822
762
</tr>
823
763
</tbody>
824
764
</table></div>
825
765
</div>
826
766
</div>
827
 
<div class="refsect1" lang="en">
828
 
<a name="id3374692"></a><div class="refsect2" lang="en"><a name="id3374693"></a></div>
 
767
</div>
 
768
<div class="footer">
829
769
<hr>
830
 
<div class="refsect2" lang="en"><a name="id3374694"></a></div>
831
 
</div>
832
 
</div>
 
770
          Generated by GTK-Doc V1.11</div>
833
771
</body>
834
772
</html>