Add G_QUEUE_INIT, g_queue_init(), and g_queue_clear() to better support

2007-03-06  Matthew Barnes  <mbarnes@redhat.com>

	* glib/gqueue.h:
	* glib/gqueue.c: Add G_QUEUE_INIT, g_queue_init(), and
	g_queue_clear() to better support statically allocated
	queues.  (#413244)


svn path=/trunk/; revision=5378
This commit is contained in:
Matthew Barnes
2007-03-06 18:43:10 +00:00
committed by Matthew Barnes
parent 6ebc6d7382
commit cc3e80c26a
6 changed files with 93 additions and 1 deletions

View File

@@ -1785,6 +1785,9 @@ g_slist_pop_allocator
GQueue
g_queue_new
g_queue_free
G_QUEUE_INIT
g_queue_init
g_queue_clear
g_queue_is_empty
g_queue_get_length
g_queue_reverse

View File

@@ -20,6 +20,10 @@ or simply pointers to any type of data.
To create a new #GQueue, use g_queue_new().
</para>
<para>
To initialize a statically-allocated #GQueue, use #G_QUEUE_INIT or
g_queue_init().
</para>
<para>
To add elements, use g_queue_push_head(), g_queue_push_head_link(),
g_queue_push_tail() and g_queue_push_tail_link().
</para>
@@ -63,6 +67,38 @@ Contains the public fields of a <link linkend="glib-queues">Queue</link>.
@queue:
<!-- ##### MACRO G_QUEUE_INIT ##### -->
<para>
A statically-allocated #GQueue must be initialized with this macro before it
can be used. This macro can be used to initialize a variable, but it cannot
be assigned to a variable. In that case you have to use g_queue_init().
</para>
<informalexample>
<programlisting>
GQueue my_queue = G_QUEUE_INIT;
</programlisting>
</informalexample>
@Since: 2.14
<!-- ##### FUNCTION g_queue_init ##### -->
<para>
</para>
@queue:
<!-- ##### FUNCTION g_queue_clear ##### -->
<para>
</para>
@queue:
<!-- ##### FUNCTION g_queue_is_empty ##### -->
<para>