TreeView should not send two click notifications when bTrack is true.
[wine] / dlls / imagehlp / internal.c
1 /*
2  *      IMAGEHLP library
3  *
4  *      Copyright 1998  Patrik Stridvall
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "winbase.h"
22 #include "winerror.h"
23 #include "windef.h"
24 #include "wine/debug.h"
25 #include "imagehlp.h"
26
27 /***********************************************************************
28  *              InitializeListHead
29  */
30 VOID InitializeListHead(PLIST_ENTRY pListHead)
31 {
32   pListHead->Flink = pListHead;
33   pListHead->Blink = pListHead;
34 }
35
36 /***********************************************************************
37  *              InsertHeadList
38  */
39 VOID InsertHeadList(PLIST_ENTRY pListHead, PLIST_ENTRY pEntry)
40 {
41   pEntry->Blink = pListHead;
42   pEntry->Flink = pListHead->Flink;
43   pListHead->Flink = pEntry;
44 }
45
46 /***********************************************************************
47  *              InsertTailList
48  */
49 VOID InsertTailList(PLIST_ENTRY pListHead, PLIST_ENTRY pEntry)
50 {
51   pEntry->Flink = pListHead;
52   pEntry->Blink = pListHead->Blink;
53   pListHead->Blink = pEntry;
54 }
55
56 /***********************************************************************
57  *              IsListEmpty
58  */
59 BOOLEAN IsListEmpty(PLIST_ENTRY pListHead)
60 {
61   return !pListHead;
62 }
63
64 /***********************************************************************
65  *              PopEntryList
66  */
67 PSINGLE_LIST_ENTRY PopEntryList(PSINGLE_LIST_ENTRY pListHead)
68 {
69   pListHead->Next = NULL;
70   return pListHead;
71 }
72
73 /***********************************************************************
74  *              PushEntryList
75  */
76 VOID PushEntryList(
77   PSINGLE_LIST_ENTRY pListHead, PSINGLE_LIST_ENTRY pEntry)
78 {
79   pEntry->Next=pListHead;
80 }
81
82 /***********************************************************************
83  *              RemoveEntryList
84  */
85 VOID RemoveEntryList(PLIST_ENTRY pEntry)
86 {
87   pEntry->Flink->Blink = pEntry->Blink;
88   pEntry->Blink->Flink = pEntry->Flink;
89   pEntry->Flink = NULL;
90   pEntry->Blink = NULL;
91 }
92
93 /***********************************************************************
94  *              RemoveHeadList
95  */
96 PLIST_ENTRY RemoveHeadList(PLIST_ENTRY pListHead)
97 {
98   PLIST_ENTRY p = pListHead->Flink;
99
100   if(p != pListHead)
101     {
102       RemoveEntryList(pListHead);
103       return p;
104     }
105   else
106     {
107       pListHead->Flink = NULL;
108       pListHead->Blink = NULL;
109       return NULL;
110     }
111 }
112
113 /***********************************************************************
114  *              RemoveTailList
115  */
116 PLIST_ENTRY RemoveTailList(PLIST_ENTRY pListHead)
117 {
118   RemoveHeadList(pListHead->Blink);
119   if(pListHead != pListHead->Blink)
120     return pListHead;
121   else
122     return NULL;
123 }