XenevaOS
Loading...
Searching...
No Matches
XenevaOS
Ports
CssLibs
libdom
src
utils
list.h
Go to the documentation of this file.
1
/*
2
* This file is part of libdom.
3
* Licensed under the MIT License,
4
* http://www.opensource.org/licenses/mit-license.php
5
* Copyright 2009 Bo Yang <struggleyb.nku@gmail.com>
6
*
7
* This file contains the list structure used to compose lists.
8
*
9
* Note: This is a implementation of a doubld-linked cyclar list.
10
*/
11
12
#ifndef dom_utils_list_h_
13
#define dom_utils_list_h_
14
15
#include <stddef.h>
16
17
struct
list_entry
{
18
struct
list_entry
*
prev
;
19
struct
list_entry
*
next
;
20
};
21
27
static
inline
void
list_init(
struct
list_entry
*
ent
)
28
{
29
ent
->prev =
ent
;
30
ent
->next =
ent
;
31
}
32
39
static
inline
void
list_append(
struct
list_entry
*
head
,
struct
list_entry
*
new
)
40
{
41
new
->next =
head
;
42
new
->
prev
=
head
->
prev
;
43
head
->
prev
->
next
=
new
;
44
head
->
prev
=
new
;
45
}
46
52
static
inline
void
list_del(
struct
list_entry
*
ent
)
53
{
54
ent
->prev->next =
ent
->next;
55
ent
->next->prev =
ent
->prev;
56
57
ent
->prev =
ent
;
58
ent
->next =
ent
;
59
}
60
61
#endif
head
int const struct list_head const struct list_head struct list_head * head
Definition
list_sort.h:13
ent
entry ent
Definition
ramdisk.c:271
list_entry
Definition
list.h:17
list_entry::next
struct list_entry * next
Definition
list.h:19
list_entry::prev
struct list_entry * prev
Definition
list.h:18
list_head::next
struct list_head * next
Definition
list.h:12
list_head::prev
struct list_head * prev
Definition
list.h:12
Generated by
1.9.8