]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - VtoyTool/BabyISO/biso_list.h
Update German translation (#2612)
[Ventoy.git] / VtoyTool / BabyISO / biso_list.h
1 /******************************************************************************
2 * biso_list.h
3 *
4 * Copyright (c) 2020, longpanda <admin@ventoy.net>
5 *
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.
10 *
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.
15 *
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/>.
18 *
19 */
20
21 #ifndef __BISO_LIST_H__
22 #define __BISO_LIST_H__
23
24 /* 简单链表的实现 */
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 */
28 }BISO_DLL_NODE_S;
29
30 typedef struct tagBISO_DLL{
31 BISO_DLL_NODE_S stHead; /* 链表头 */
32 BISO_DLL_NODE_S *pstTail; /* 链表尾 */
33 UINT uiCount; /* 链表节点个数 */
34 }BISO_DLL_S;
35
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)
39
40 #define BISO_DLL_Next(pList, pNode) \
41 (((pNode) == NULL) ? BISO_DLL_First(pList) : \
42 (((pNode)->pstNext == &(pList)->stHead) ? NULL : (pNode)->pstNext))
43
44 VOID BISO_DLL_Init(OUT BISO_DLL_S *pstList);
45 VOID BISO_DLL_AddTail
46 (
47 IN BISO_DLL_S *pstList,
48 IN BISO_DLL_NODE_S *pstNode
49 );
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);
53
54 #endif /* __BISO_LIST_H__ */
55