1 |
jer 13/11/03 16:50:09 |
2 |
|
3 |
Added: libnl-3.2.23-utils.h |
4 |
Log: |
5 |
Version bump. |
6 |
|
7 |
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key A792A613) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-libs/libnl/files/libnl-3.2.23-utils.h |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libnl/files/libnl-3.2.23-utils.h?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libnl/files/libnl-3.2.23-utils.h?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: libnl-3.2.23-utils.h |
16 |
=================================================================== |
17 |
struct list_head { |
18 |
struct list_head *next; |
19 |
}; |
20 |
|
21 |
#define LIST_HEAD(name) \ |
22 |
struct list_head name = { &(name) } |
23 |
|
24 |
static inline int list_empty(const struct list_head *head) |
25 |
{ |
26 |
return head->next == head; |
27 |
} |
28 |
|
29 |
static inline void list_add(struct list_head *new, struct list_head *head) |
30 |
{ |
31 |
new->next = head->next; |
32 |
head->next = new; |
33 |
} |
34 |
|
35 |
static inline void list_del(struct list_head *entry, struct list_head *prev) |
36 |
{ |
37 |
prev->next = entry->next; |
38 |
entry->next = entry; |
39 |
} |
40 |
|
41 |
#define list_for_each_safe(pos, n, head) \ |
42 |
for (n = (head), pos = (head)->next; pos != (head); \ |
43 |
n = pos, pos = n->next) |
44 |
|
45 |
#undef offsetof |
46 |
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
47 |
|
48 |
#define container_of(ptr, type, member) ({ \ |
49 |
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ |
50 |
(type *)( (char *)__mptr - offsetof(type,member) );}) |
51 |
|
52 |
#ifdef DEBUG |
53 |
#define pynl_dbg(fmt, ...) \ |
54 |
fprintf(stderr, "%s: " fmt, __func__, __VA_ARGS__) |
55 |
#else |
56 |
#define pynl_dbg(fmt, ...) |
57 |
#endif |