]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - VtoyTool/BabyISO/biso_list.h
1 /******************************************************************************
4 * Copyright (c) 2020, longpanda <admin@ventoy.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef __BISO_LIST_H__
22 #define __BISO_LIST_H__
25 typedef struct tagBISO_DLL_NODE
{
26 struct tagBISO_DLL_NODE
*pstPre
; /* Points to The Previous Node In The List */
27 struct tagBISO_DLL_NODE
*pstNext
; /* Points to The Next Node In The List */
30 typedef struct tagBISO_DLL
{
31 BISO_DLL_NODE_S stHead
; /* 链表头 */
32 BISO_DLL_NODE_S
*pstTail
; /* 链表尾 */
33 UINT uiCount
; /* 链表节点个数 */
36 #define BISO_DLL_Count(pList) ((pList)->uiCount)
37 #define BISO_DLL_First(pList) ((BISO_DLL_Count((pList)) == 0) ? NULL: (pList)->stHead.pstNext)
38 #define BISO_DLL_Last(pList) ((BISO_DLL_Count((pList)) == 0) ? NULL : (pList)->pstTail)
40 #define BISO_DLL_Next(pList, pNode) \
41 (((pNode) == NULL) ? BISO_DLL_First(pList) : \
42 (((pNode)->pstNext == &(pList)->stHead) ? NULL : (pNode)->pstNext))
44 VOID
BISO_DLL_Init(OUT BISO_DLL_S
*pstList
);
47 IN BISO_DLL_S
*pstList
,
48 IN BISO_DLL_NODE_S
*pstNode
50 VOID
BISO_DLL_DelHead(IN BISO_DLL_S
*pstList
);
51 VOID
BISO_DLL_DelTail(IN BISO_DLL_S
*pstList
);
52 VOID
BISO_DLL_Free(IN BISO_DLL_S
*pstList
);
54 #endif /* __BISO_LIST_H__ */