Sets our main struct and passes it to the parent class
Adds a new element on to the end of the list. Note The return value is the new start of the list, which may have changed, so make sure you store the new value. Note Note that g_list_append() has to traverse the entire list to find the end, which is inefficient when adding multiple elements. A common idiom to avoid the inefficiency is to prepend the elements and reverse the list when all elements have been added.
Adds the second GList onto the end of the first GList. Note that the elements of the second GList are not copied. They are used directly.
Copies a GList. Note Note that this is a "shallow" copy. If the list elements consist of pointers to data, the pointers are copied but the actual data is not. See g_list_copy_deep() if you need to copy the data as well.
Makes a full (deep) copy of a GList. In contrast with g_list_copy(), this function uses func to make a copy of each list element, in addition to copying the list container itself. func, as a GCopyFunc, takes two arguments, the data to be copied and a user pointer. It's safe to pass NULL as user_data, if the copy function takes only one argument. Since 2.34
Removes the node link_ from the list and frees it. Compare this to g_list_remove_link() which removes the node without freeing it.
Finds the element in a GList which contains the given data.
Finds an element in a GList, using a supplied function to find the desired element. It iterates over the list, calling the given function which should return 0 when the desired element is found. The function takes two gconstpointer arguments, the GList element's data as the first argument and the given user data.
Gets the first element in a GList.
Calls a function for each element of a GList.
Frees all of the memory used by a GList. The freed elements are returned to the slice allocator. Note If list elements contain dynamically-allocated memory, you should either use g_list_free_full() or free them manually first.
Frees one GList element. It is usually used after g_list_remove_link().
Convenience method, which frees all the memory used by a GList, and calls the specified destroy function on every element's data. Since 2.28
the main Gtk struct as a void*
Gets the position of the element containing the given data (starting from 0).
Inserts a new element into the list at the given position.
Inserts a new element into the list before the given position.
Inserts a new element into the list, using the given comparison function to determine its position.
Inserts a new element into the list, using the given comparison function to determine its position. Since 2.10
Gets the last element in a GList.
Gets the number of elements in a GList. Note This function iterates over the whole list to count its elements.
Gets the element at the given position in a GList.
Gets the data of the element at the given position.
Gets the element n places before list.
Gets the position of the given element in the GList (starting from 0).
Adds a new element on to the start of the list. Note The return value is the new start of the list, which may have changed, so make sure you store the new value.
Removes an element from a GList. If two elements contain the same data, only the first is removed. If none of the elements contain the data, the GList is unchanged.
Removes all list nodes with data equal to data. Returns the new head of the list. Contrast with g_list_remove() which removes only the first node matching the given data.
Removes an element from a GList, without freeing the element. The removed element's prev and next links are set to NULL, so that it becomes a self-contained list with one element.
Reverses a GList. It simply switches the next and prev pointers of each element.
Sorts a GList using the given comparison function. The algorithm used is a stable sort.
Like g_list_sort(), but the comparison function accepts a user data argument.
Turn the list into a D array of the desiered type. Type T wraps should match the type of the data.
get the next element
get the previous element
Allocates space for one GList element. It is called by g_list_append(), g_list_prepend(), g_list_insert() and g_list_insert_sorted() and so is rarely used on its own.
the main Gtk struct
The GList structure and its associated functions provide a standard doubly-linked list data structure.
Each element in the list contains a piece of data, together with pointers which link to the previous and next elements in the list. Using these pointers it is possible to move through the list in both directions (unlike the Singly-Linked Lists which only allows movement through the list in the forward direction).
The data contained in each element can be either integer values, by using one of the Type Conversion Macros, or simply pointers to any type of data.
List elements are allocated from the slice allocator, which is more efficient than allocating elements individually.
Note that most of the GList functions expect to be passed a pointer to the first element in the list. The functions which insert elements return the new start of the list, which may have changed.
There is no function to create a GList. NULL is considered to be the empty list so you simply set a GList* to NULL.
To add elements, use g_list_append(), g_list_prepend(), g_list_insert() and g_list_insert_sorted().
To remove elements, use g_list_remove().
To find elements in the list use g_list_first(), g_list_last(), g_list_next(), g_list_previous(), g_list_nth(), g_list_nth_data(), g_list_find() and g_list_find_custom().
To find the index of an element use g_list_position() and g_list_index().
To call a function for each element in the list use g_list_foreach().
To free the entire list, use g_list_free().