|
GDAL
|
Simplest list implementation. More...
#include "cpl_port.h"Go to the source code of this file.
Classes | |
| struct | _CPLList |
| List element structure. More... | |
Typedefs | |
| typedef struct _CPLList | CPLList |
| List element structure. | |
Functions | |
| CPLList * | CPLListAppend (CPLList *psList, void *pData) |
| Append an object list and return a pointer to the modified list. | |
| CPLList * | CPLListInsert (CPLList *psList, void *pData, int nPosition) |
| Insert an object into list at specified position (zero based). | |
| CPLList * | CPLListGetLast (CPLList *psList) |
| Return the pointer to last element in a list. | |
| CPLList * | CPLListGet (CPLList *const psList, int nPosition) |
| Return the pointer to the specified element in a list. | |
| int | CPLListCount (const CPLList *psList) |
| Return the number of elements in a list. | |
| CPLList * | CPLListRemove (CPLList *psList, int nPosition) |
| Remove the element from the specified position (zero based) in a list. | |
| void | CPLListDestroy (CPLList *psList) |
| Destroy a list. | |
| CPLList * | CPLListGetNext (const CPLList *psElement) |
| Return the pointer to next element in a list. | |
| void * | CPLListGetData (const CPLList *psElement) |
| Return pointer to the data object contained in given list element. | |
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.
| CPLList* 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.
| psList | pointer to list head. |
| pData | pointer to inserted data object. May be NULL. |
| int CPLListCount | ( | const CPLList * | psList | ) |
Return the number of elements in a list.
| psList | pointer to list head. |
| void CPLListDestroy | ( | CPLList * | psList | ) |
Destroy a list.
Caller responsible for freeing data objects contained in list elements.
| psList | pointer to list head. |
| CPLList* CPLListGet | ( | CPLList * | psList, |
| int | nPosition | ||
| ) |
Return the pointer to the specified element in a list.
| psList | pointer to list head. |
| nPosition | the index of the element in the list, 0 being the first element. |
| void* CPLListGetData | ( | const CPLList * | psElement | ) |
Return pointer to the data object contained in given list element.
| psElement | pointer to list element. |
| CPLList* CPLListGetLast | ( | CPLList *const | psList | ) |
Return the pointer to last element in a list.
| psList | pointer to list head. |
| CPLList* CPLListGetNext | ( | const CPLList * | psElement | ) |
Return the pointer to next element in a list.
| psElement | pointer to list element. |
| CPLList* 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.
| psList | pointer to list head. |
| pData | pointer to inserted data object. May be NULL. |
| nPosition | position number to insert an object. |
| CPLList* CPLListRemove | ( | CPLList * | psList, |
| int | nPosition | ||
| ) |
Remove the element from the specified position (zero based) in a list.
Data object contained in removed element must be freed by the caller first.
| psList | pointer to list head. |
| nPosition | position number to delete an element. |
1.7.6.1.