typedef typedefG_BEGIN_DECLS struct _GQueue | GQueue |
IMPORT_C void | g_queue_free | ( | GQueue * | queue | ) |
g_queue_free: : a GQueue.
Frees the memory allocated for the GQueue. Only call this function if was created with g_queue_new(). If queue elements contain dynamically-allocated memory, they should be freed first.
IMPORT_C void | g_queue_init | ( | GQueue * | queue | ) |
g_queue_init: : an uninitialized GQueue
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().
Since: 2.14
IMPORT_C void | g_queue_clear | ( | GQueue * | queue | ) |
g_queue_clear: : a GQueue
Removes all the elements in . If queue elements contain dynamically-allocated memory, they should be freed first.
Since: 2.14
g_queue_is_empty: : a GQueue.
Returns TRUE if the queue is empty.
Returns: TRUE if the queue is empty.
g_queue_get_length: : a GQueue
Returns the number of items in .
Return value: The number of items in .
Since: 2.4
IMPORT_C void | g_queue_reverse | ( | GQueue * | queue | ) |
g_queue_copy: : a GQueue
Copies a . Note that is a shallow copy. If the elements in the queue consist of pointers to data, the pointers are copied, but the actual data is not.
Return value: A copy of
Since: 2.4
g_queue_foreach: : a GQueue : the function to call for each element's data : user data to pass to
Calls for each element in the queue passing to the function.
Since: 2.4
IMPORT_C GList * | g_queue_find | ( | GQueue * | queue, |
gconstpointer | data | |||
) |
g_queue_find: : a GQueue : data to find
Finds the first link in which contains .
Return value: The first link in which contains .
Since: 2.4
IMPORT_C GList * | g_queue_find_custom | ( | GQueue * | queue, |
gconstpointer | data, | |||
GCompareFunc | func | |||
) |
g_queue_find_custom: : a GQueue : user data passed to : a GCompareFunc to call for each element. It should return 0 when the desired element is found
Finds an element in a GQueue, using a supplied function to find the desired element. It iterates over the queue, calling the given function which should return 0 when the desired element is found. The function takes two gconstpointer arguments, the GQueue element's data as the first argument and the given user data as the second argument.
Return value: The found link, or NULL if it wasn't found
Since: 2.4
IMPORT_C void | g_queue_sort | ( | GQueue * | queue, |
GCompareDataFunc | compare_func, | |||
gpointer | user_data | |||
) |
g_queue_sort: : a GQueue : the GCompareDataFunc used to sort . This function is passed two elements of the queue and should return 0 if they are equal, a negative value if the first comes before the second, and a positive value if the second comes before the first. : user data passed to
Sorts using .
Since: 2.4
g_queue_push_head: : a GQueue. : the data for the new element.
Adds a new element at the head of the queue.
g_queue_push_tail: : a GQueue. : the data for the new element.
Adds a new element at the tail of the queue.
g_queue_push_nth: : a GQueue : the data for the new element : the position to insert the new element. If is negative or larger than the number of elements in the , the element is added to the end of the queue.
Inserts a new element into at the given position
Since: 2.4
g_queue_pop_head: : a GQueue.
Removes the first element of the queue.
Returns: the data of the first element in the queue, or NULL if the queue is empty.
g_queue_pop_tail: : a GQueue.
Removes the last element of the queue.
Returns: the data of the last element in the queue, or NULL if the queue is empty.
g_queue_pop_nth: : a GQueue : the position of the element.
Removes the 'th element of .
Return value: the element's data, or NULL if is off the end of .
Since: 2.4
g_queue_peek_head: : a GQueue.
Returns the first element of the queue.
Returns: the data of the first element in the queue, or NULL if the queue is empty.
g_queue_peek_tail: : a GQueue.
Returns the last element of the queue.
Returns: the data of the last element in the queue, or NULL if the queue is empty.
g_queue_peek_nth: : a GQueue : the position of the element.
Returns the 'th element of .
Return value: The data for the 'th element of , or NULL if is off the end of .
Since: 2.4
IMPORT_C gint | g_queue_index | ( | GQueue * | queue, |
gconstpointer | data | |||
) |
g_queue_index: : a GQueue : the data to find.
Returns the position of the first element in which contains .
Return value: The position of the first element in which contains , or -1 if no element in contains .
Since: 2.4
IMPORT_C void | g_queue_remove | ( | GQueue * | queue, |
gconstpointer | data | |||
) |
g_queue_remove: : a GQueue : data to remove.
Removes the first element in that contains .
Since: 2.4
IMPORT_C void | g_queue_remove_all | ( | GQueue * | queue, |
gconstpointer | data | |||
) |
g_queue_insert_before: : a GQueue : a GList link that <emphasis>must</emphasis> be part of : the data to insert
Inserts into before .
must be part of .
Since: 2.4
g_queue_insert_after: : a GQueue : a GList link that <emphasis>must</emphasis> be part of : the data to insert
Inserts into after
must be part of
Since: 2.4
IMPORT_C void | g_queue_insert_sorted | ( | GQueue * | queue, |
gpointer | data, | |||
GCompareDataFunc | func, | |||
gpointer | user_data | |||
) |
g_queue_insert_sorted: : a GQueue : the data to insert : the GCompareDataFunc used to compare elements in the queue. It is called with two elements of the and . It should return 0 if the elements are equal, a negative value if the first element comes before the second, and a positive value if the second element comes before the first. : user data passed to .
Inserts into using to determine the new position.
Since: 2.4
g_queue_push_head_link: : a GQueue. : a single GList element, <emphasis>not</emphasis> a list with more than one element.
Adds a new element at the head of the queue.
g_queue_push_tail_link: : a GQueue. : a single GList element, <emphasis>not</emphasis> a list with more than one element.
Adds a new element at the tail of the queue.
g_queue_push_nth_link: : a GQueue : the position to insert the link. If this is negative or larger than the number of elements in , the link is added to the end of . : the link to add to
Inserts at the given position. Since: 2.4
g_queue_pop_head_link: : a GQueue.
Removes the first element of the queue.
Returns: the GList element at the head of the queue, or NULL if the queue is empty.
g_queue_pop_tail_link: : a GQueue.
Removes the last element of the queue.
Returns: the GList element at the tail of the queue, or NULL if the queue is empty.
g_queue_pop_nth_link: : a GQueue : the link's position
Removes and returns the link at the given position.
Return value: The 'th link, or NULL if is off the end of .
Since: 2.4
g_queue_peek_head_link: : a GQueue
Returns the first link in
Return value: the first link in , or NULL if is empty
Since: 2.4
g_queue_peek_tail_link: : a GQueue
Returns the last link .
Return value: the last link in , or NULL if is empty
Since: 2.4
g_queue_peek_nth_link: : a GQueue : the position of the link
Returns the link at the given position
Return value: The link at the 'th position, or NULL if is off the end of the list
Since: 2.4
g_queue_link_index: : a #Gqueue : A GList link
Returns the position of in .
Return value: The position of , or -1 if the link is not part of
Since: 2.4