Coda Distributed File System
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
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda 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
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
46extern "C" {
47#endif
48
49int list_empty(struct dllist_head *head);
50void list_del(struct dllist_head *entry);
51void list_add(struct dllist_head *entry, struct dllist_head *head);
52void list_head_init(struct dllist_head *ptr);
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif /* _DLLIST_H_ */
int list_empty(struct dllist_head *head)
Definition: dllist.c:50
void list_head_init(struct dllist_head *ptr)
Definition: dllist.c:21
void list_del(struct dllist_head *entry)
Definition: dllist.c:42
void list_add(struct dllist_head *entry, struct dllist_head *head)
Definition: dllist.c:30
PROC * head
Definition: util.c:73
Definition: dllist.h:30
struct dllist_head * prev
Definition: dllist.h:31
struct dllist_head * next
Definition: dllist.h:31
Definition: codamergedump.cc:54