Method

GLibQueuefind_custom

since: 2.4

Declaration

GList*
g_queue_find_custom (
  GQueue* queue,
  gconstpointer data,
  GCompareFunc func
)

Description

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.

Available since: 2.4

This method is not directly available to language bindings.

Parameters

data

Type: gconstpointer

User data passed to func.

The argument can be NULL.
The data is owned by the caller of the function.
func

Type: GCompareFunc

A GCompareFunc to call for each element. It should return 0 when the desired element is found.

Return value

Type: A list of gpointer

The found link, or NULL if it wasn’t found.

The data is owned by the instance.