16
16
* http://en.wikipedia.org/wiki/Double_linked_list
17
17
******************************************************************************/
18
18
19
- #ifndef __DOUBLE_LINKED_LIST_H__
20
- #define __DOUBLE_LINKED_LIST_H__
19
+ #ifndef ALGO_DOUBLE_LINKED_LIST_H__
20
+ #define ALGO_DOUBLE_LINKED_LIST_H__
21
21
22
22
struct list_head {
23
23
struct list_head *next, *prev;
@@ -39,7 +39,7 @@ struct list_head {
39
39
* the prev/next entries already!
40
40
*/
41
41
static inline void
42
- __list_add (struct list_head *n,
42
+ list_add_ (struct list_head *n,
43
43
struct list_head *prev,
44
44
struct list_head *next)
45
45
{
@@ -57,14 +57,14 @@ __list_add(struct list_head *n,
57
57
* the prev/next entries already!
58
58
*/
59
59
static inline void
60
- __list_del (struct list_head *prev, struct list_head *next)
60
+ list_del_ (struct list_head *prev, struct list_head *next)
61
61
{
62
62
next->prev = prev;
63
63
prev->next = next;
64
64
}
65
65
66
66
static inline void
67
- __list_splice (struct list_head *list, struct list_head *head)
67
+ list_splice_ (struct list_head *list, struct list_head *head)
68
68
{
69
69
struct list_head *first = list->next ;
70
70
struct list_head *last = list->prev ;
@@ -88,7 +88,7 @@ __list_splice(struct list_head *list, struct list_head *head)
88
88
static inline void
89
89
list_add (struct list_head *n, struct list_head *head)
90
90
{
91
- __list_add (n, head, head->next );
91
+ list_add_ (n, head, head->next );
92
92
}
93
93
94
94
/* *
@@ -102,7 +102,7 @@ list_add(struct list_head *n, struct list_head *head)
102
102
static inline void
103
103
list_add_tail (struct list_head *n, struct list_head *head)
104
104
{
105
- __list_add (n, head->prev , head);
105
+ list_add_ (n, head->prev , head);
106
106
}
107
107
108
108
/* *
@@ -113,7 +113,7 @@ list_add_tail(struct list_head *n, struct list_head *head)
113
113
static inline void
114
114
list_del (struct list_head *entry)
115
115
{
116
- __list_del (entry->prev , entry->next );
116
+ list_del_ (entry->prev , entry->next );
117
117
entry->next = NULL ;
118
118
entry->prev = NULL ;
119
119
}
@@ -125,7 +125,7 @@ list_del(struct list_head *entry)
125
125
static inline void
126
126
list_del_init (struct list_head *entry)
127
127
{
128
- __list_del (entry->prev , entry->next );
128
+ list_del_ (entry->prev , entry->next );
129
129
INIT_LIST_HEAD (entry);
130
130
}
131
131
@@ -137,7 +137,7 @@ list_del_init(struct list_head *entry)
137
137
static inline void
138
138
list_move (struct list_head *list, struct list_head *head)
139
139
{
140
- __list_del (list->prev , list->next );
140
+ list_del_ (list->prev , list->next );
141
141
list_add (list, head);
142
142
}
143
143
@@ -149,7 +149,7 @@ list_move(struct list_head *list, struct list_head *head)
149
149
static inline void
150
150
list_move_tail (struct list_head *list, struct list_head *head)
151
151
{
152
- __list_del (list->prev , list->next );
152
+ list_del_ (list->prev , list->next );
153
153
list_add_tail (list, head);
154
154
}
155
155
@@ -172,7 +172,7 @@ static inline void
172
172
list_splice (struct list_head *list, struct list_head *head)
173
173
{
174
174
if (!list_empty (list))
175
- __list_splice (list, head);
175
+ list_splice_ (list, head);
176
176
}
177
177
178
178
/* *
@@ -186,7 +186,7 @@ static inline void list_splice_init(struct list_head *list,
186
186
struct list_head *head)
187
187
{
188
188
if (!list_empty (list)) {
189
- __list_splice (list, head);
189
+ list_splice_ (list, head);
190
190
INIT_LIST_HEAD (list);
191
191
}
192
192
}
0 commit comments