Optimized include/*.h: (recursively) include all headers needed by
[wine] / dlls / imagehlp / internal.c
1 /*
2  *      IMAGEHLP library
3  *
4  *      Copyright 1998  Patrik Stridvall
5  */
6
7 #include "winbase.h"
8 #include "winerror.h"
9 #include "wintypes.h"
10 #include "debug.h"
11 #include "imagehlp.h"
12
13 /***********************************************************************
14  *           InitializeListHead32
15  */
16 VOID InitializeListHead32(PLIST_ENTRY32 pListHead)
17 {
18   pListHead->Flink = pListHead;
19   pListHead->Blink = pListHead;
20 }
21
22 /***********************************************************************
23  *           InsertHeadList32
24  */
25 VOID InsertHeadList32(PLIST_ENTRY32 pListHead, PLIST_ENTRY32 pEntry)
26 {
27   pEntry->Blink = pListHead;
28   pEntry->Flink = pListHead->Flink;
29   pListHead->Flink = pEntry;
30 }
31
32 /***********************************************************************
33  *           InsertTailList32
34  */
35 VOID InsertTailList32(PLIST_ENTRY32 pListHead, PLIST_ENTRY32 pEntry)
36 {
37   pEntry->Flink = pListHead;
38   pEntry->Blink = pListHead->Blink;
39   pListHead->Blink = pEntry;
40 }
41
42 /***********************************************************************
43  *           IsListEmpty32
44  */
45 BOOLEAN IsListEmpty32(PLIST_ENTRY32 pListHead)
46 {
47   return !pListHead;
48 }
49
50 /***********************************************************************
51  *           PopEntryList32
52  */
53 PSINGLE_LIST_ENTRY32 PopEntryList32(PSINGLE_LIST_ENTRY32 pListHead)
54 {
55   pListHead->Next = NULL;
56   return pListHead;
57 }
58
59 /***********************************************************************
60  *           PushEntryList32
61  */
62 VOID PushEntryList32(
63   PSINGLE_LIST_ENTRY32 pListHead, PSINGLE_LIST_ENTRY32 pEntry)
64 {
65   pEntry->Next=pListHead;
66 }
67
68 /***********************************************************************
69  *           RemoveEntryList32
70  */
71 VOID RemoveEntryList32(PLIST_ENTRY32 pEntry)
72 {
73   pEntry->Flink->Blink = pEntry->Blink;
74   pEntry->Blink->Flink = pEntry->Flink;
75   pEntry->Flink = NULL;
76   pEntry->Blink = NULL;
77 }
78
79 /***********************************************************************
80  *           RemoveHeadList32
81  */
82 PLIST_ENTRY32 RemoveHeadList32(PLIST_ENTRY32 pListHead)
83 {
84   PLIST_ENTRY32 p = pListHead->Flink;
85   
86   if(p != pListHead)
87     {
88       RemoveEntryList32(pListHead); 
89       return p;
90     }
91   else
92     {
93       pListHead->Flink = NULL;
94       pListHead->Blink = NULL;
95       return NULL;
96     }
97 }
98
99 /***********************************************************************
100  *           RemoveTailList32
101  */
102 PLIST_ENTRY32 RemoveTailList32(PLIST_ENTRY32 pListHead)
103 {
104   RemoveHeadList32(pListHead->Blink);
105   if(pListHead != pListHead->Blink)
106     return pListHead;
107   else
108     return NULL;
109 }
110
111
112
113