JULEA
Data Structures | Typedefs | Functions
List

Data Structures

struct  JListElement
 
struct  JList
 

Typedefs

typedef struct JListElement JListElement
 
typedef struct JList JList
 
typedef void(* JListFreeFunc) (gpointer)
 

Functions

JListj_list_new (JListFreeFunc free_func)
 
JListj_list_ref (JList *list)
 
void j_list_unref (JList *list)
 
guint j_list_length (JList *list)
 
void j_list_append (JList *list, gpointer data)
 
void j_list_prepend (JList *list, gpointer data)
 
gpointer j_list_get_first (JList *list)
 
gpointer j_list_get_last (JList *list)
 
void j_list_delete_all (JList *list)
 

Detailed Description

Typedef Documentation

◆ JList

typedef struct JList JList

◆ JListElement

typedef struct JListElement JListElement

◆ JListFreeFunc

typedef void(* JListFreeFunc) (gpointer)

Function Documentation

◆ j_list_append()

void j_list_append ( JList list,
gpointer  data 
)

Appends a new list element to a list.

Parameters
listA list.
dataA list element.

◆ j_list_delete_all()

void j_list_delete_all ( JList list)

Deletes all list elements.

Parameters
listA list.

◆ j_list_get_first()

gpointer j_list_get_first ( JList list)

Returns the first list element.

Parameters
listA list.
Returns
A list element, or NULL.

◆ j_list_get_last()

gpointer j_list_get_last ( JList list)

Returns the last list element.

Parameters
listA list.
Returns
A list element, or NULL.

◆ j_list_length()

guint j_list_length ( JList list)

Returns the list's length.

Parameters
listA list.
Returns
The list's length.

◆ j_list_new()

JList * j_list_new ( JListFreeFunc  free_func)

Creates a new list.

Parameters
free_funcA function to free the element data, or NULL.
Returns
A new list.

◆ j_list_prepend()

void j_list_prepend ( JList list,
gpointer  data 
)

Prepends a new list element to a list.

Parameters
listA list.
dataA list element.

◆ j_list_ref()

JList * j_list_ref ( JList list)

Increases the list's reference count.

Parameters
listA list.
Returns
The list.

◆ j_list_unref()

void j_list_unref ( JList list)

Decreases the list's reference count. When the reference count reaches zero, frees the memory allocated for the list.

Parameters
listA list.