gfsmArray.h File Reference

various array utilities More...

#include <glib.h>
Include dependency graph for gfsmArray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GArray Methods
gpointer gfsm_array_lower_bound (GArray *array, guint element_size, gconstpointer key, GCompareDataFunc compare_func, gpointer data)
GPtrArray Methods
gpointer * gfsm_ptr_array_lower_bound (GPtrArray *parray, gconstpointer key, GCompareDataFunc compare_func, gpointer data)
gpointer * gfsm_ptr_array_insert_sorted (GPtrArray *parray, gpointer elt, GCompareDataFunc compare_func, gpointer data)

Detailed Description

Function Documentation

gpointer gfsm_array_lower_bound ( GArray *  array,
guint  element_size,
gconstpointer  key,
GCompareDataFunc  compare_func,
gpointer  data 
)

Search a ::GArray array of elements of size element_size sorted according to compare_func for the first element not less-than or equal to key, using data as comparison data.

Parameters
array::GArray to search
element_sizesize of elements in array
keykey element to search for
compare_funccomparison function for search (array should be sorted consistently with compare_func)
datacomparison data
Returns
a pointer to the desired element or NULL if no such element is found.
gpointer* gfsm_ptr_array_lower_bound ( GPtrArray *  parray,
gconstpointer  key,
GCompareDataFunc  compare_func,
gpointer  data 
)

Search a ::GPtrArray parray sorted according to compare_func for the first element not less-than or equal to key, using data as comparison data.

Returns
a pointer (gpointer*) to the desired element or NULL if no such element is found.
gpointer* gfsm_ptr_array_insert_sorted ( GPtrArray *  parray,
gpointer  elt,
GCompareDataFunc  compare_func,
gpointer  data 
)

Insert an element into a sorted ::GPtrArray.