/*
 * Emulate decus-C rtime function
 */

#include	<time.h>

struct TIME {
	int	year;	/* G.TIYR  year - 1900	*/
	int	month;	/* G.TIMO  Jan. = 1	*/
	int	day;	/* G.TIDA		*/
	int	hour;	/* G.TIHR  00 .. 23	*/
	int	minute;	/* G.TIMI  00 .. 59	*/
	int	second;	/* G.TISC  00 .. 59	*/
	int	tick;	/* G.TICT  00 .. tsec-1	*/
	int	tsec;	/* G.TICP  tick/second	*/
};

rtime(bp)
struct TIME	*bp;
/*
 * Store the time in the buffer
 */
{

	long	time_loc;
	struct	tm	*tp;

	time(&time_loc);
	tp = localtime(&time_loc);
	bp->year = tp->tm_year;
	bp->month = tp->tm_mon + 1;
	bp->day = tp->tm_mday;
	bp->hour = tp->tm_hour;
	bp->minute = tp->tm_min;
	bp->second = tp->tm_sec;
	bp->tick = 0;
	bp->tsec = 60;
}
