~rimskyp/helenos/gui

« back to all changes in this revision

Viewing changes to kernel/generic/include/adt/list.h

  • Committer: Pavel Rimsky
  • Date: 2010-10-16 19:27:47 UTC
  • mfrom: (355.1.291 HelenOS.mainline)
  • Revision ID: pavel@pavel-laptop-20101016192747-ymgf1isyijywbsxm
Merging changes from mainline.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#define KERN_LIST_H_
37
37
 
38
38
#include <typedefs.h>
 
39
#include <trace.h>
39
40
 
40
41
/** Doubly linked list head and link type. */
41
42
typedef struct link {
56
57
 *
57
58
 * @param link Pointer to link_t structure to be initialized.
58
59
 */
59
 
static inline void link_initialize(link_t *link)
 
60
NO_TRACE static inline void link_initialize(link_t *link)
60
61
{
61
62
        link->prev = NULL;
62
63
        link->next = NULL;
68
69
 *
69
70
 * @param head Pointer to link_t structure representing head of the list.
70
71
 */
71
 
static inline void list_initialize(link_t *head)
 
72
NO_TRACE static inline void list_initialize(link_t *head)
72
73
{
73
74
        head->prev = head;
74
75
        head->next = head;
81
82
 * @param link Pointer to link_t structure to be added.
82
83
 * @param head Pointer to link_t structure representing head of the list.
83
84
 */
84
 
static inline void list_prepend(link_t *link, link_t *head)
 
85
NO_TRACE static inline void list_prepend(link_t *link, link_t *head)
85
86
{
86
87
        link->next = head->next;
87
88
        link->prev = head;
96
97
 * @param link Pointer to link_t structure to be added.
97
98
 * @param head Pointer to link_t structure representing head of the list.
98
99
 */
99
 
static inline void list_append(link_t *link, link_t *head)
 
100
NO_TRACE static inline void list_append(link_t *link, link_t *head)
100
101
{
101
102
        link->prev = head->prev;
102
103
        link->next = head;
111
112
 * @param link  Pointer to link_t structure to be removed from the list it is
112
113
 *              contained in.
113
114
 */
114
 
static inline void list_remove(link_t *link)
 
115
NO_TRACE static inline void list_remove(link_t *link)
115
116
{
116
117
        link->next->prev = link->prev;
117
118
        link->prev->next = link->next;
124
125
 *
125
126
 * @param head Pointer to link_t structure representing head of the list.
126
127
 */
127
 
static inline bool list_empty(link_t *head)
 
128
NO_TRACE static inline bool list_empty(link_t *head)
128
129
{
129
130
        return head->next == head ? true : false;
130
131
}
142
143
 * @param part2 Pointer to link_t structure leading the second (half of the
143
144
 *              headless) list. 
144
145
 */
145
 
static inline void headless_list_split_or_concat(link_t *part1, link_t *part2)
 
146
NO_TRACE static inline void headless_list_split_or_concat(link_t *part1, link_t *part2)
146
147
{
147
148
        link_t *hlp;
148
149
 
163
164
 * @param part2 Pointer to link_t structure leading the second half of the
164
165
 *              headless list. 
165
166
 */
166
 
static inline void headless_list_split(link_t *part1, link_t *part2)
 
167
NO_TRACE static inline void headless_list_split(link_t *part1, link_t *part2)
167
168
{
168
169
        headless_list_split_or_concat(part1, part2);
169
170
}
175
176
 * @param part1 Pointer to link_t structure leading the first headless list.
176
177
 * @param part2 Pointer to link_t structure leading the second headless list.
177
178
 */
178
 
static inline void headless_list_concat(link_t *part1, link_t *part2)
 
179
NO_TRACE static inline void headless_list_concat(link_t *part1, link_t *part2)
179
180
{
180
181
        headless_list_split_or_concat(part1, part2);
181
182
}