/*
 $Id: statistics.cc,v 1.1.1.1 1996/10/02 10:35:45 roitzsch Exp $
 (C)opyright 1996 by Konrad-Zuse-Center, Berlin
 All rights reserved.
 Part of the Kaskade distribution
*/

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>

#include "plotimpl.h"

ZD_DataDesc ZD_DataDef(char *name,ZD_DataDesc dep)
{
	char *namecopy;
	int lenght;
	dataDescimpl *datadesc;

	if (name==0) return 0;
	lenght=strlen(name);
	namecopy=(char*)malloc(lenght*sizeof(char));
	strcpy(namecopy,name);
	datadesc=(dataDescimpl*)malloc(sizeof(dataDescimpl));
	datadesc->name=namecopy;
	datadesc->older=dep;
	printf("$ZDDefine %s ",datadesc->name);
	if (datadesc->older==0) 
	{
	printf("\n");
	return (datadesc);
	}
	else
	printf("%s\n",datadesc->older->name);
	return (datadesc);
}

void ZD_IntWrite(ZD_DataDesc desc,int data)
{
	if (desc==0) return;

	printf("$ZDData %s %i\n",desc->name,data);
}

void ZD_RealWrite(ZD_DataDesc desc,double data)
{
	if (desc==0) return;

	printf("$ZDData %s %f\n",desc->name,data);
}


