Simple C Expat Wrapper (SCEW)  1.1.7
Files | Functions
Modifiers

Add and remove items from lists. More...

Files

file  list.h
 SCEW general list implementation.
 

Functions

SCEW_API scew_listscew_list_append (scew_list *list, void *data)
 Creates a new list item with the given data and appends it to list. More...
 
SCEW_API scew_listscew_list_prepend (scew_list *list, void *data)
 Creates a new list item with the given data and prepends it to list. More...
 
SCEW_API scew_listscew_list_delete (scew_list *list, void *data)
 Deletes the first item pointing to data from the given list. More...
 
SCEW_API scew_listscew_list_delete_item (scew_list *list, scew_list *item)
 Deletes the given list item from list. More...
 

Detailed Description

Add and remove items from lists.

Function Documentation

SCEW_API scew_list* scew_list_append ( scew_list list,
void *  data 
)

Creates a new list item with the given data and appends it to list.

If the given list is NULL this function acts like scew_list_create.

Precondition
data != NULL
Returns
the item appended to list or NULL if an item could not be created.
SCEW_API scew_list* scew_list_prepend ( scew_list list,
void *  data 
)

Creates a new list item with the given data and prepends it to list.

If the given list is NULL this function acts like scew_list_create.

Precondition
data != NULL
Returns
the item prepended to list or NULL if an item could not be created.
SCEW_API scew_list* scew_list_delete ( scew_list list,
void *  data 
)

Deletes the first item pointing to data from the given list.

This function will search from the given item list, not from the beginning.

Precondition
list != NULL
data != NULL
Returns
list if the item found was not the first list item, or the new first item otherwise.
SCEW_API scew_list* scew_list_delete_item ( scew_list list,
scew_list item 
)

Deletes the given list item from list.

Precondition
list != NULL
Returns
list if item was not the first list item, or the new first item otherwise.