Coda Distributed File System
lib-src
base
dllist.h
Go to the documentation of this file.
1
/* BLURB lgpl
2
3
Coda File System
4
Release 8
5
6
Copyright (c) 1987-2025 Carnegie Mellon University
7
Additional copyrights listed below
8
9
This code is distributed "AS IS" without warranty of any kind under
10
the terms of the GNU Library General Public Licence Version 2, as
11
shown in the file LICENSE. The technical and financial contributors to
12
Coda are listed in the file CREDITS.
13
14
Additional copyrights
15
none currently
16
17
#*/
18
19
#ifndef _DLIST_H_
20
#define _DLIST_H_
21
22
#include "
coda_offsetof.h
"
23
24
/*
25
* doubly linked list implementation -- based on linux
26
* kernel code lists.
27
*
28
*/
29
30
struct
dllist_head
{
31
struct
dllist_head
*
next
, *
prev
;
32
};
33
34
#define INIT_LIST_HEAD(name) struct dllist_head name = { &name, &name }
35
36
#define list_entry(ptr, type, member) \
37
((type *)((char *)(ptr) - offsetof(type, member)))
38
39
#define list_entry_plusplus(ptr, type, member) \
40
((type *)((char *)(ptr) - coda_offsetof(type, member)))
41
42
#define list_for_each(ptr, head) \
43
for (ptr = (head).next; ptr != &(head); ptr = ptr->next)
44
45
#ifdef __cplusplus
46
extern
"C"
{
47
#endif
48
49
int
list_empty
(
struct
dllist_head
*
head
);
50
void
list_del
(
struct
dllist_head
*
entry
);
51
void
list_add
(
struct
dllist_head
*
entry
,
struct
dllist_head
*
head
);
52
void
list_head_init
(
struct
dllist_head
*ptr);
53
54
#ifdef __cplusplus
55
}
56
#endif
57
58
#endif
/* _DLLIST_H_ */
list_empty
int list_empty(struct dllist_head *head)
Definition:
dllist.c:50
list_head_init
void list_head_init(struct dllist_head *ptr)
Definition:
dllist.c:21
list_del
void list_del(struct dllist_head *entry)
Definition:
dllist.c:42
list_add
void list_add(struct dllist_head *entry, struct dllist_head *head)
Definition:
dllist.c:30
coda_offsetof.h
head
PROC * head
Definition:
util.c:73
dllist_head
Definition:
dllist.h:30
dllist_head::prev
struct dllist_head * prev
Definition:
dllist.h:31
dllist_head::next
struct dllist_head * next
Definition:
dllist.h:31
entry
Definition:
codamergedump.cc:54
Generated by
1.9.4