Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

cpl_list.h File Reference

#include "cpl_port.h"

Go to the source code of this file.

Compounds

struct  _CPLList

Typedefs

typedef CPL_C_START struct
_CPLList 
CPLList

Functions

CPLList CPL_DLL * CPLListAppend (CPLList *psList, void *pData)
CPLList CPL_DLL * CPLListInsert (CPLList *psList, void *pData, int nPosition)
CPLList CPL_DLL * CPLListGetLast (CPLList *psList)
CPLList CPL_DLL * CPLListGet (CPLList *psList, int nPosition)
int CPL_DLL CPLListCount (CPLList *psList)
CPLList CPL_DLL * CPLListRemove (CPLList *psList, int nPosition)
void CPL_DLL CPLListDestroy (CPLList *psList)
CPLList CPL_DLL * CPLListGetNext (CPLList *psElement)
void CPL_DLL * CPLListGetData (CPLList *psElement)


Detailed Description

Simplest list implementation. List contains only pointers to stored objects, not objects itself. All operations regarding allocation and freeing memory for objects should be performed by the caller.


Typedef Documentation

typedef CPL_C_START struct _CPLList CPLList
 

List element structure.


Function Documentation

CPLList CPL_DLL* CPLListAppend CPLList   psList,
void *    pData
 

Append an object list and return a pointer to the modified list. If the input list is NULL, then a new list is created.

Parameters:
psList  pointer to list head.
pData  pointer to inserted data object. May be NULL.
Returns:
pointer to the head of modified list.

int CPL_DLL CPLListCount CPLList   psList
 

Return the number of elements in a list.

Parameters:
psList  pointer to list head.
Returns:
number of elements in a list.

void CPL_DLL CPLListDestroy CPLList   psList
 

Destroy a list. Caller responsible for freeing data objects contained in list elements.

Parameters:
psList  pointer to list head.

CPLList CPL_DLL* CPLListGet CPLList   psList,
int    nPosition
 

Return the pointer to the specified element in a list.

Parameters:
psList  pointer to list head.
Returns:
pointer to the specified element in a list.

void CPL_DLL* CPLListGetData CPLList   psElement
 

Return pointer to the data object contained in given list element.

Parameters:
psElement  pointer to list element.
Returns:
pointer to the data object contained in given list element.

CPLList CPL_DLL* CPLListGetLast CPLList   psList
 

Return the pointer to last element in a list.

Parameters:
psList  pointer to list head.
Returns:
pointer to last element in a list.

CPLList CPL_DLL* CPLListGetNext CPLList   psElement
 

Return the pointer to next element in a list.

Parameters:
psElement  pointer to list element.
Returns:
pointer to the list element preceded by the given element.

CPLList CPL_DLL* CPLListInsert CPLList   psList,
void *    pData,
int    nPosition
 

Insert an object into list at specified position (zero based). If the input list is NULL, then a new list is created.

Parameters:
psList  pointer to list head.
pData  pointer to inserted data object. May be NULL.
nPosition  position number to insert an object.
Returns:
pointer to the head of modified list.

CPLList CPL_DLL* CPLListRemove CPLList   psList,
int    nPosition
 

Remone the element from the specified position (zero based) in a list. Data object contained in removed element must be freed by the caller first.

Parameters:
psList  pointer to list head.
nPosition  position number to delet an element.
Returns:
pointer to the head of modified list.


Generated on Mon Oct 6 16:31:38 2003 for SDTS_AL by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002