mirror of
https://github.com/reactos/reactos.git
synced 2024-11-01 04:11:30 +00:00
27 lines
685 B
C
27 lines
685 B
C
|
/*
|
||
|
* PROJECT: ReactOS Setup Library
|
||
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||
|
* PURPOSE: Linked list support macros
|
||
|
* COPYRIGHT: Copyright 2005-2018 ReactOS Team
|
||
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField) \
|
||
|
do { \
|
||
|
PLIST_ENTRY current = (ListHead)->Flink; \
|
||
|
while (current != (ListHead)) \
|
||
|
{ \
|
||
|
if (CONTAINING_RECORD(current, Type, ListEntryField)->SortField >= \
|
||
|
(NewEntry)->SortField) \
|
||
|
{ \
|
||
|
break; \
|
||
|
} \
|
||
|
current = current->Flink; \
|
||
|
} \
|
||
|
\
|
||
|
InsertTailList(current, &((NewEntry)->ListEntryField)); \
|
||
|
} while (0)
|
||
|
|
||
|
/* EOF */
|