/****************************************************************************
*
*      Projet  : DilibPro
*      Module  : Sgml
*      Fichier : SgmlInput.h
*      Auteur  : J. Ducloy
*
*      Derniere mise a jour Janvier 97
*
*      Interface avec Dam pour les importations sur STDIN
*
****************************************************************************/

#include "SgmlInput.h"

char     *SgmlInputKey;
SgmlNode *SgmlInputDocument;
SgmlNode *SgmlInputRecord;

SgmlNode  *SgmlInputNextRecord()
{
  SgmlInputKey=NULL;
  if ((SgmlInputRecord=DamStdin_NextSgmlRecord()))
    {
      SgmlNode *n1;
      SgmlInputDocument=SgmlLast(SgmlInputRecord);
      if((n1=SgmlFirst(SgmlInputRecord)))
	{
	  if (SgmlNext(n1)) SgmlInputKey=SgmlGetFirstData(n1);
	}
      return SgmlInputRecord;
    }
  else
    {
      SgmlInputDocument=NULL;
      return NULL;
    }
}



SgmlNode  *SgmlInputNextDocument()
{
  if(SgmlInputNextRecord()) return SgmlInputDocument;
  else return NULL;
}
