list.h File Reference

Include file for expendable lists. More...

#include "list.c"

Data Structures

struct  LIST
 Definition of a list. More...

Defines

#define LIST_ACTIVE
 This define can be evaluated to check if this module is included and active.
Configuration Data
The values of these parameters can be overwritten by defining them before including this file.

#define LIST_ARRAY_STEPS   20
 Choosing higher values results in less copying but requires more memory from beginning.

Functions

LISTLIST_create ()
 creates new list.
void LIST_remove (LIST *psHost)
 Removes a list from memory.
void LIST_removeAll (LIST *psHost)
 Removes a list from memory.
void LIST_removeItem (LIST *psHost, int iIndex)
 Remove item from LIST by index.
void LIST_append (LIST *psHost, void *psNewItem)
 Append new item to LIST.
void * LIST_getItem (LIST *psHost, int iIndex)
 Get item from list by index.
int LIST_items (LIST *psHost)
 Get amount of stored items.


Detailed Description

Include file for expendable lists.


Function Documentation

void LIST_append ( LIST psHost,
void *  psNewItem 
)

Append new item to LIST.

Parameters:
psHost Pointer to host LIST
psNewItem Pointer to item to be added (casted to void*)

LIST* LIST_create (  ) 

creates new list.

Returns:
pointer to newly created LIST

void* LIST_getItem ( LIST psHost,
int  iIndex 
)

Get item from list by index.

Parameters:
psHost Pointer to host LIST
iIndex List index for stored item
Returns:
Pointer to item or NULL

int LIST_items ( LIST psHost  ) 

Get amount of stored items.

Parameters:
psHost Pointer to host LIST
Returns:
Amount of stored items

void LIST_remove ( LIST psHost  ) 

Removes a list from memory.

Caution: Contained items are not affected and remain in memory!

Parameters:
psHost Pointer to host LIST

void LIST_removeAll ( LIST psHost  ) 

Removes a list from memory.

Contained items are deleted - use with care!! DO NOT USE with stored engine objects!! Take care when storing structs containing pointers to allocated memory!!

Parameters:
psHost Pointer to host LIST

void LIST_removeItem ( LIST psHost,
int  iIndex 
)

Remove item from LIST by index.

Memory occupied by item is NOT freed! Indices of follow-up items are NOT affected

Parameters:
psHost Pointer to host LIST
iIndex List index for stored item


Generated on Wed Feb 10 23:23:43 2010 for Toolbox by  doxygen 1.5.9