GDAL
cpl_list.h
Go to the documentation of this file.
1/**********************************************************************
2 *
3 * Name: cpl_list.h
4 * Project: CPL - Common Portability Library
5 * Purpose: List functions.
6 * Author: Andrey Kiselev, dron@remotesensing.org
7 *
8 **********************************************************************
9 * Copyright (c) 2003, Andrey Kiselev <dron@remotesensing.org>
10 *
11 * SPDX-License-Identifier: MIT
12 ****************************************************************************/
13
14#ifndef CPL_LIST_H_INCLUDED
15#define CPL_LIST_H_INCLUDED
16
17#include "cpl_port.h"
18
27
29
31typedef struct _CPLList CPLList;
32
35{
39 void *pData;
44};
45
46CPLList CPL_DLL *CPLListAppend(CPLList *psList, void *pData);
47CPLList CPL_DLL *CPLListInsert(CPLList *psList, void *pData, int nPosition);
48CPLList CPL_DLL *CPLListGetLast(CPLList *psList);
49CPLList CPL_DLL *CPLListGet(CPLList *const psList, int nPosition);
50int CPL_DLL CPLListCount(const CPLList *psList);
51CPLList CPL_DLL *CPLListRemove(CPLList *psList, int nPosition);
52void CPL_DLL CPLListDestroy(CPLList *psList);
53CPLList CPL_DLL *CPLListGetNext(const CPLList *psElement);
54void CPL_DLL *CPLListGetData(const CPLList *psElement);
55
57
58#endif /* CPL_LIST_H_INCLUDED */
void CPLListDestroy(CPLList *psList)
Destroy a list.
Definition cpl_list.cpp:271
int CPLListCount(const CPLList *psList)
Return the number of elements in a list.
Definition cpl_list.cpp:196
CPLList * CPLListAppend(CPLList *psList, void *pData)
Append an object list and return a pointer to the modified list.
Definition cpl_list.cpp:39
CPLList * CPLListGetNext(const CPLList *psElement)
Return the pointer to next element in a list.
Definition cpl_list.cpp:295
CPLList * CPLListRemove(CPLList *psList, int nPosition)
Remove the element from the specified position (zero based) in a list.
Definition cpl_list.cpp:224
struct _CPLList CPLList
List element structure.
Definition cpl_list.h:31
void * CPLListGetData(const CPLList *psElement)
Return pointer to the data object contained in given list element.
Definition cpl_list.cpp:315
CPLList * CPLListInsert(CPLList *psList, void *pData, int nPosition)
Insert an object into list at specified position (zero based).
Definition cpl_list.cpp:78
CPLList * CPLListGetLast(CPLList *psList)
Return the pointer to last element in a list.
Definition cpl_list.cpp:142
CPLList * CPLListGet(CPLList *const psList, int nPosition)
Return the pointer to the specified element in a list.
Definition cpl_list.cpp:168
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
List element structure.
Definition cpl_list.h:35
void * pData
Definition cpl_list.h:39
struct _CPLList * psNext
Definition cpl_list.h:43