Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
/* $XConsortium: EntityList.cc /main/2 1996/07/18 16:11:54 drk $ */
/* exported interfaces */
#include "EntityList.h"
/* imported interfaces */
#include <stdio.h>
#include "SGMLName.h"
#include "SGMLDefn.h"
//---------------------------------------------------------
EntityList::EntityList()
{
head = NULL;
tail = NULL;
next = NULL;
}
//---------------------------------------------------------
EntityList::~EntityList()
{
SGMLDefn *pt = head;
while ( pt ) {
SGMLDefn *tmp = pt;
pt = pt->next;
delete tmp;
}
}
//---------------------------------------------------------
// EntityList:lookup
SGMLDefn *
EntityList::lookup(int ename ) const
{
SGMLDefn *pt = head;
while ( pt ) {
if ( pt->getName() == ename ) {
return ( pt );
}
pt = pt->next;
}
return ( NULL );
}
//---------------------------------------------------------
// EntityList::add
void
EntityList::insert( SGMLDefn *entry )
{
if ( !tail ) {
head = tail = entry;
}
else {
tail->next = entry;
tail = entry;
}
}