IListBase.cxx revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#pragma ident "%Z%%M% %I% %E% SMI"
#include "splib.h"
#include "IListBase.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
void IListBase::append(Link *p)
{
Link **pp;
for (pp = &head_; *pp; pp = &(*pp)->next_)
;
*pp = p;
}
void IListBase::remove(Link *p)
{
for (Link **pp = &head_; *pp; pp = &(*pp)->next_)
if (*pp == p) {
*pp = p->next_;
break;
}
}
void IListBase::clear()
{
while (!empty())
delete get();
}
#ifdef SP_NAMESPACE
}
#endif