2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS HTTP Daemon
5 * PURPOSE: A doubly linked list implementation
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * CSH 01/09/2000 Created
9 * NOTES: The linked list does it's own heap management for
11 * TODO: - InsertBefore(), InsertAfter(), Move()
16 // **************************** CListNode ****************************
18 HANDLE
CListNode::hHeap
= NULL
;
19 INT
CListNode::nRef
= 0;
21 // Default constructor
22 CListNode::CListNode()
29 // Constructor with element and next as starter values
30 CListNode::CListNode(PVOID element
, CListNode
*next
, CListNode
*prev
)
37 void* CListNode::operator new(/*size_t*/ UINT size
)
43 hHeap
= HeapCreate(0, inf
.dwAllocationGranularity
, 0);
45 if ((p
= HeapAlloc(hHeap
, 0, size
)) != NULL
)
50 VOID
CListNode::operator delete(void* p
)
52 if (HeapFree(hHeap
, 0, p
) != FALSE
)
61 VOID
CListNode::SetElement(PVOID element
)
66 // Set pointer to next node in list
67 VOID
CListNode::SetNext(CListNode
*next
)
72 // Set pointer to previous node in list
73 VOID
CListNode::SetPrev(CListNode
*prev
)
78 // Get element of node
79 PVOID
CListNode::GetElement()
84 // Get pointer to next node in list
85 CListNode
*CListNode::GetNext()
90 // Get pointer to previous node in list
91 CListNode
*CListNode::GetPrev()