Move GQueue docs inline

This commit is contained in:
Matthias Clasen 2011-07-17 23:38:58 -04:00
parent d3b09eee75
commit 20cd4936b9
2 changed files with 82 additions and 34 deletions

View File

@ -24,6 +24,31 @@
* MT safe
*/
/**
* SECTION:queue
* @Title: Double-ended Queues
* @Short_description: double-ended queue data structure
*
* The #GQueue structure and its associated functions provide a standard
* queue data structure. Internally, GQueue uses the same data structure
* as #GList to store elements.
*
* The data contained in each element can be either integer values, by
* using one of the <link linkend="glib-Type-Conversion-Macros">Type
* Conversion Macros</link>, or simply pointers to any type of data.
*
* To create a new GQueue, use g_queue_new().
*
* To initialize a statically-allocated GQueue, use #G_QUEUE_INIT or
* g_queue_init().
*
* To add elements, use g_queue_push_head(), g_queue_push_head_link(),
* g_queue_push_tail() and g_queue_push_tail_link().
*
* To remove elements, use g_queue_pop_head() and g_queue_pop_tail().
*
* To free the entire queue, use g_queue_free().
*/
#include "config.h"
#include "gqueue.h"

View File

@ -37,6 +37,15 @@ G_BEGIN_DECLS
typedef struct _GQueue GQueue;
/**
* GQueue:
* @head: a pointer to the first element of the queue
* @tail: a pointer to the last element of the queue
* @length: the number of elements in the queue
*
* Contains the public fields of a
* <link linkend="glib-Double-ended-Queues">Queue</link>.
*/
struct _GQueue
{
GList *head;
@ -44,6 +53,20 @@ struct _GQueue
guint length;
};
/**
* G_QUEUE_INIT:
*
* 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().
*
* |[
* GQueue my_queue = G_QUEUE_INIT;
* ]|
*
* Since: 2.14
*/
#define G_QUEUE_INIT { NULL, NULL, 0 }
/* Queues