// This may look like C code, but it is really -*- C++ -*-
// WARNING: This file is obsolete. Use ../DLList.cc, if you can.
Copyright (C) 1988 Free Software Foundation
written by Doug Lea (dl@rocky.oswego.edu)
This file is part of the GNU C++ Library. This library is free
software; you can redistribute it and/or modify it under the terms of
the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version. This library is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
void <T>DLList::error(const char* msg)
(*lib_error_handler)("DLList", msg);
if (t != 0) do { ++l; t = t->fd; } while (t != h);
<T>DLList::<T>DLList(const <T>DLList& a)
<T>DLListNode* t = new <T>DLListNode(p->hd);
<T>DLListNode* n = new <T>DLListNode(p->hd);
<T>DLList& <T>DLList::operator = (const <T>DLList& a)
<T>DLListNode* t = new <T>DLListNode(p->hd);
<T>DLListNode* n = new <T>DLListNode(p->hd);
<T>DLListNode* p = h->fd;
<T>DLListNode* nxt = p->fd;
Pix <T>DLList::prepend(<T&> item)
<T>DLListNode* t = new <T>DLListNode(item);
Pix <T>DLList::append(<T&> item)
<T>DLListNode* t = new <T>DLListNode(item);
Pix <T>DLList::ins_after(Pix p, <T&> item)
if (p == 0) return prepend(item);
<T>DLListNode* u = (<T>DLListNode*) p;
<T>DLListNode* t = new <T>DLListNode(item, u, u->fd);
Pix <T>DLList::ins_before(Pix p, <T&> item)
if (p == 0) error("null Pix");
<T>DLListNode* u = (<T>DLListNode*) p;
<T>DLListNode* t = new <T>DLListNode(item, u->bk, u);
void <T>DLList::join(<T>DLList& b)
<T>DLListNode* l = t->bk;
int <T>DLList::owns(Pix p)
if (Pix(t) == p) return 1;
void <T>DLList::del(Pix& p, int dir)
if (p == 0) error("null Pix");
<T>DLListNode* t = (<T>DLListNode*) p;
void <T>DLList::del_after(Pix& p)
<T>DLListNode* b = (<T>DLListNode*) p;
<T>DLListNode* t = b->fd;
<T> <T>DLList::remove_front()
error("remove_front of empty list");
void <T>DLList::del_front()
error("del_front of empty list");
<T> <T>DLList::remove_rear()
error("remove_rear of empty list");
<T>DLListNode* t = h->bk;
void <T>DLList::del_rear()
error("del_rear of empty list");
<T>DLListNode* t = h->bk;
long count = MAXLONG; // Lots of chances to find h!
} while (v && count > 0 && t != h);
if (!v) error("invariant failure");