6 Copyright (C) 2000-2003 Kern Sibbald and John Walker
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public
19 License along with this program; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 /* ========================================================================
27 * Doubly linked list -- dlist
31 #define OFFSET(item,link) ((char *)link - (char *)item)
44 void init(int offset);
45 void prepend(void *item);
46 void append(void *item);
47 void remove(void *item);
48 void *next(void *item);
52 void * operator new(size_t);
53 void operator delete(void *);
57 * This allows us to do explicit initialization,
58 * allowing us to mix C++ classes inside malloc'ed
59 * C structures. Define before called in constructor.
61 inline void dlist::init(int offset) {
63 loffset = (int)offset;
67 inline dlist::dlist(int offset) {
71 inline void * dlist::operator new(size_t)
73 return malloc(sizeof(dlist));
76 inline void dlist::operator delete(void *item)
78 ((dlist *)item)->destroy();
83 inline void * dlist::first()
88 inline void * dlist::last()