/*
 *	File:					MakeTime().h
 *	Description:	Returns the time in a time_t value
 *
 *	(C) 1993, Ketil Hunn
 *
 */
#ifndef MAKETIME_H
#define MAKETIME_H

#define NONE -1

#include <time.h>
#include <string.h>
#include <dos.h>

long MakeTime(struct EventNode *node)
{
	struct tm input;
	char buf[8];

	input.tm_mday=input.tm_mon=input.tm_year=input.tm_sec=0;
	input.tm_isdst=1;

	getclk(buf);
	if(node==NULL)
	{
		input.tm_hour=buf[4];
		input.tm_min= buf[5];
	}
	else
	{
		input.tm_hour=(node->hour==NONE    ? buf[4] : node->hour);
		input.tm_min =(node->minutes==NONE ? buf[5] : node->minutes);
	}
	return mktime(&input);
}
#endif
