a pointer to the first element of the queue
the number of elements in the queue
a pointer to the last element of the queue
Removes all the elements in queue
. If queue elements contain
dynamically-allocated memory, they should be freed first.
Convenience method, which frees all the memory used by a #GQueue,
and calls the provided free_func
on each item in the #GQueue.
the function to be called to free memory allocated
Frees the memory allocated for the #GQueue. Only call this function
if queue
was created with g_queue_new(). If queue elements contain
dynamically-allocated memory, they should be freed first.
If queue elements contain dynamically-allocated memory, you should either use g_queue_free_full() or free them manually first.
Convenience method, which frees all the memory used by a #GQueue, and calls the specified destroy function on every element's data.
free_func
should not modify the queue (eg, by removing the freed
element from it).
the function to be called to free each element's data
Returns the number of items in queue
.
Returns the position of the first element in queue
which contains data
.
the data to find
A statically-allocated #GQueue must be initialized with this function before it can be used. Alternatively you can initialize it with %G_QUEUE_INIT. It is not necessary to initialize queues created with g_queue_new().
Returns %TRUE if the queue is empty.
Returns the first element of the queue.
Returns the n'
th element of queue
.
the position of the element
Returns the last element of the queue.
Removes the first element of the queue and returns its data.
Removes the n'
th element of queue
and returns its data.
the position of the element
Removes the last element of the queue and returns its data.
Adds a new element at the head of the queue.
the data for the new element.
Inserts a new element into queue
at the given position.
the data for the new element
the position to insert the new element. If n
is negative or larger than the number of elements in the queue,
the element is added to the end of the queue.
Adds a new element at the tail of the queue.
the data for the new element
Removes the first element in queue
that contains data
.
the data to remove
Remove all elements whose data equals data
from queue
.
the data to remove
Reverses the order of the items in queue
.
Contains the public fields of a [Queue][glib-Double-ended-Queues].