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
28 CPL_C_START
29
31 typedef struct _CPLList CPLList;
32
34 struct _CPLList
35{
39 void *pData;
43 struct _CPLList *psNext;
44};
45
46 CPLList CPL_DLL *CPLListAppend(CPLList *psList, void *pData);
47 CPLList CPL_DLL *CPLListInsert(CPLList *psList, void *pData, int nPosition);
48 CPLList CPL_DLL *CPLListGetLast(CPLList *psList);
49 CPLList CPL_DLL *CPLListGet(CPLList *const psList, int nPosition);
50 int CPL_DLL CPLListCount(const CPLList *psList);
51 CPLList CPL_DLL *CPLListRemove(CPLList *psList, int nPosition);
52 void CPL_DLL CPLListDestroy(CPLList *psList);
53 CPLList CPL_DLL *CPLListGetNext(const CPLList *psElement);
54 void CPL_DLL *CPLListGetData(const CPLList *psElement);
55
56 CPL_C_END
57
58#endif /* CPL_LIST_H_INCLUDED */
CPLListDestroy
void CPLListDestroy(CPLList *psList)
Destroy a list.
Definition cpl_list.cpp:271
CPLListCount
int CPLListCount(const CPLList *psList)
Return the number of elements in a list.
Definition cpl_list.cpp:196
CPLListAppend
CPLList * CPLListAppend(CPLList *psList, void *pData)
Append an object list and return a pointer to the modified list.
Definition cpl_list.cpp:39
CPLListGetNext
CPLList * CPLListGetNext(const CPLList *psElement)
Return the pointer to next element in a list.
Definition cpl_list.cpp:295
CPLListRemove
CPLList * CPLListRemove(CPLList *psList, int nPosition)
Remove the element from the specified position (zero based) in a list.
Definition cpl_list.cpp:224
CPLListGetData
void * CPLListGetData(const CPLList *psElement)
Return pointer to the data object contained in given list element.
Definition cpl_list.cpp:315
CPLListInsert
CPLList * CPLListInsert(CPLList *psList, void *pData, int nPosition)
Insert an object into list at specified position (zero based).
Definition cpl_list.cpp:78
CPLListGetLast
CPLList * CPLListGetLast(CPLList *psList)
Return the pointer to last element in a list.
Definition cpl_list.cpp:142
CPLListGet
CPLList * CPLListGet(CPLList *const psList, int nPosition)
Return the pointer to the specified element in a list.
Definition cpl_list.cpp:168
cpl_port.h
Core portability definitions for CPL.
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
_CPLList
List element structure.
Definition cpl_list.h:35
_CPLList::pData
void * pData
Definition cpl_list.h:39
_CPLList::psNext
struct _CPLList * psNext
Definition cpl_list.h:43