list.h File Reference

Header file of a singulary linked list. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

list * newList ()
 Creates a new list.
void deleteList (list *src)
 Frees the memory for the list structure.
void listAdd (list *src, const void *data)
 Adds a new datum after the current position.
void listRemove (list *src)
 Removes the currently selected item.
void listSet (list *src, const void *data)
 Sets the datum at the currently selected index.
void * listGet (list *src)
 Returns the currently selected element.
int listNext (list *src)
 Advances the list one position and returns 0, if the end was reached.
void listStart (list *src)
 Sets the current element to the top.
int listCount (list *src)
 Counts the list.
int listIsEmpty (list *src)
 Returns 1, if this list is empty, else 0.


Detailed Description

Header file of a singulary linked list.

Author:
Dorian Weber
See also:
list.c

Definition in file list.h.


Function Documentation

void deleteList ( list *  src  ) 

Frees the memory for the list structure.

Parameters:
[in] src list to free

Definition at line 34 of file list.c.

void listAdd ( list *  src,
const void *  data 
)

Adds a new datum after the current position.

Parameters:
[in] src list to append
[in] data pointer to store

Definition at line 48 of file list.c.

int listCount ( list *  src  ) 

Counts the list.

Parameters:
[in] src list to count
Returns:
number of items currently stored

Definition at line 107 of file list.c.

void* listGet ( list *  src  ) 

Returns the currently selected element.

Precondition:
A valid element is selected.
Parameters:
[in] src list to retrieve data from
Returns:
data pointer

Definition at line 84 of file list.c.

int listIsEmpty ( list *  src  ) 

Returns 1, if this list is empty, else 0.

Definition at line 122 of file list.c.

int listNext ( list *  src  ) 

Advances the list one position and returns 0, if the end was reached.

Parameters:
[in] src list to advance

Definition at line 90 of file list.c.

void listRemove ( list *  src  ) 

Removes the currently selected item.

Precondition:
A valid element is selected.
Parameters:
[in] src list to remove from

Definition at line 59 of file list.c.

void listSet ( list *  src,
const void *  data 
)

Sets the datum at the currently selected index.

Precondition:
A valid element is selected.
Parameters:
[in] src list to set
[in] data pointer to store

Definition at line 76 of file list.c.

void listStart ( list *  src  ) 

Sets the current element to the top.

Note:
This is always one element before the first one.
Parameters:
[in] src list to reset

Definition at line 101 of file list.c.

list* newList (  ) 

Creates a new list.

Returns:
pointer to a new list

Definition at line 27 of file list.c.


Generated on Fri Jun 5 15:31:57 2009 for DeadStrip Utility by  doxygen 1.5.8