Companion

object Companion

Functions

Link copied to clipboard
fun alloc(): SList

Allocates space for one #GSList element. It is called by the g_slist_append(), g_slist_prepend(), g_slist_insert() and g_slist_insert_sorted() functions and so is rarely used on its own.

Link copied to clipboard
fun append(list: SList, data: <Error class: unknown class>? = null): SList

Adds a new element on to the end of the list.

Link copied to clipboard
fun concat(list1: SList, list2: SList): SList

Adds the second #GSList onto the end of the first #GSList. Note that the elements of the second #GSList are not copied. They are used directly.

Link copied to clipboard
fun copy(list: SList): SList

Copies a #GSList.

Link copied to clipboard
fun copyDeep(list: SList, func: CopyFunc): SList

Makes a full (deep) copy of a #GSList.

Link copied to clipboard
fun deleteLink(list: SList, link: SList): SList

Removes the node link_ from the list and frees it. Compare this to g_slist_remove_link() which removes the node without freeing it.

Link copied to clipboard
fun find(list: SList, data: <Error class: unknown class>? = null): SList

Finds the element in a #GSList which contains the given data.

Link copied to clipboard
fun foreach(list: SList, func: Func)

Calls a function for each element of a #GSList.

Link copied to clipboard
fun free(list: SList)

Frees all of the memory used by a #GSList. The freed elements are returned to the slice allocator.

Link copied to clipboard
fun free1(list: SList)

Frees one #GSList element. It is usually used after g_slist_remove_link().

Link copied to clipboard
fun index(list: SList, data: <Error class: unknown class>? = null): <Error class: unknown class>

Gets the position of the element containing the given data (starting from 0).

Link copied to clipboard
fun insert(list: SList, data: <Error class: unknown class>? = null, position: <Error class: unknown class>): SList

Inserts a new element into the list at the given position.

Link copied to clipboard
fun insertBefore(slist: SList, sibling: SList, data: <Error class: unknown class>? = null): SList

Inserts a node before @sibling containing @data.

Link copied to clipboard
fun insertSortedWithData(list: SList, data: <Error class: unknown class>? = null, func: CompareDataFunc): SList

Inserts a new element into the list, using the given comparison function to determine its position.

Link copied to clipboard
fun last(list: SList): SList

Gets the last element in a #GSList.

Link copied to clipboard
fun length(list: SList): <Error class: unknown class>

Gets the number of elements in a #GSList.

Link copied to clipboard
fun nth(list: SList, n: <Error class: unknown class>): SList

Gets the element at the given position in a #GSList.

Link copied to clipboard
fun nthData(list: SList, n: <Error class: unknown class>): <Error class: unknown class>?

Gets the data of the element at the given position.

Link copied to clipboard
Link copied to clipboard
fun position(list: SList, llink: SList): <Error class: unknown class>

Gets the position of the given element in the #GSList (starting from 0).

Link copied to clipboard
fun prepend(list: SList, data: <Error class: unknown class>? = null): SList

Adds a new element on to the start of the list.

Link copied to clipboard
fun remove(list: SList, data: <Error class: unknown class>? = null): SList

Removes an element from a #GSList. If two elements contain the same data, only the first is removed. If none of the elements contain the data, the #GSList is unchanged.

Link copied to clipboard
fun removeAll(list: SList, data: <Error class: unknown class>? = null): SList

Removes all list nodes with data equal to @data. Returns the new head of the list. Contrast with g_slist_remove() which removes only the first node matching the given data.

Link copied to clipboard
fun removeLink(list: SList, link: SList): SList

Removes an element from a #GSList, without freeing the element. The removed element's next link is set to null, so that it becomes a self-contained list with one element.

Link copied to clipboard
fun reverse(list: SList): SList

Reverses a #GSList.

Link copied to clipboard
fun sortWithData(list: SList, compareFunc: CompareDataFunc): SList

Like g_slist_sort(), but the sort function accepts a user data argument.