orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxLinkList.h
Go to the documentation of this file.
1/* Orx - Portable Game Engine
2 *
3 * Copyright (c) 2008- Orx-Project
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source
22 * distribution.
23 */
24
32
81
82
83#ifndef _orxLINKLIST_H_
84#define _orxLINKLIST_H_
85
86
87#include "orxInclude.h"
88
89#include "debug/orxDebug.h"
90
91
94typedef struct __orxLINKLIST_NODE_t
95{
96 struct __orxLINKLIST_NODE_t *pstNext;
97 struct __orxLINKLIST_NODE_t *pstPrevious;
98 struct __orxLINKLIST_t *pstList;
99
101
104typedef struct __orxLINKLIST_t
105{
108 orxU32 u32Count;
109
111
112
117extern orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_Clean(orxLINKLIST *_pstList);
118
119
125extern orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_AddStart(orxLINKLIST *_pstList, orxLINKLIST_NODE *_pstNode);
126
132extern orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_AddEnd(orxLINKLIST *_pstList, orxLINKLIST_NODE *_pstNode);
133
140
147
153
154
155/* *** LinkList inlined accessors *** */
156
157
162static orxINLINE orxLINKLIST * orxLinkList_GetList(const orxLINKLIST_NODE *_pstNode)
163{
164 /* Checks */
165 orxASSERT(_pstNode != orxNULL);
166
167 /* Returns it */
168 return(_pstNode->pstList);
169}
170
176{
177 /* Checks */
178 orxASSERT(_pstNode != orxNULL);
179
180 /* Returns it */
181 return((_pstNode->pstList != orxNULL) ? _pstNode->pstPrevious : (orxLINKLIST_NODE *)orxNULL);
182}
183
188static orxINLINE orxLINKLIST_NODE * orxLinkList_GetNext(const orxLINKLIST_NODE *_pstNode)
189{
190 /* Checks */
191 orxASSERT(_pstNode != orxNULL);
192
193 /* Returns it */
194 return((_pstNode->pstList != orxNULL) ? _pstNode->pstNext : (orxLINKLIST_NODE *)orxNULL);
195}
196
197
202static orxINLINE orxLINKLIST_NODE * orxLinkList_GetFirst(const orxLINKLIST *_pstList)
203{
204 /* Checks */
205 orxASSERT(_pstList != orxNULL);
206
207 /* Returns it */
208 return(_pstList->pstFirst);
209}
210
215static orxINLINE orxLINKLIST_NODE * orxLinkList_GetLast(const orxLINKLIST *_pstList)
216{
217 /* Checks */
218 orxASSERT(_pstList != orxNULL);
219
220 /* Returns it */
221 return(_pstList->pstLast);
222}
223
228static orxINLINE orxU32 orxLinkList_GetCount(const orxLINKLIST *_pstList)
229{
230 /* Checks */
231 orxASSERT(_pstList != orxNULL);
232
233 /* Returns it */
234 return(_pstList->u32Count);
235}
236
237#endif /* _orxLINKLIST_H_ */
238
#define orxASSERT(TEST,...)
Definition orxDebug.h:378
#define orxDLLAPI
Definition orxDecl.h:381
orxSTATUS
Definition orxType.h:270
struct __orxLINKLIST_t * pstList
Definition orxLinkList.h:98
struct __orxLINKLIST_NODE_t * pstNext
Definition orxLinkList.h:96
struct __orxLINKLIST_NODE_t * pstPrevious
Definition orxLinkList.h:97
orxU32 u32Count
orxLINKLIST_NODE * pstFirst
orxLINKLIST_NODE * pstLast

Generated for orx by doxygen 1.8.11