/*  auxlist.c   */
/*  Copyright 1989 Mountain Math Software  */
/*  All Rights Reserved                    */
#include "auxlist.h"

Entity * ListToArray (SingleList * List)
{
	Entity * Ret = new Entity [List->Size()+1] ;
	SingleListIterator Iter(*List) ;
	Entity Val ;
	Entity * Ptr = Ret ;
	while (Val = Iter.Next()) *Ptr++ = Val ;
	*Ptr++ = 0;
	return Ret ;
}


ConstEntity * ConstListToArray (ConstSingleList * List)
{
	int Sz = 1 ;
	if (List) Sz += List->Size() ;
	ConstEntity * Ret = new ConstEntity [Sz] ;
	ConstSingleListIterator Iter(*List) ;
	ConstEntity Val ;
	ConstEntity *Ptr = Ret ;
	while (Val = Iter.Next()) *Ptr++ = Val ;
	*Ptr++ = 0;
	return Ret ;
}



