DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T d

⟦f64822ff8⟧ TextFile

    Length: 1309 (0x51d)
    Types: TextFile
    Names: »dateandtime.SYS_V.c«

Derivation

└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
    └─⟦this⟧ »./tex82/Unsupported/MFpxl/mflib/dateandtime.SYS_V.c« 
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦beba6c409⟧ »unix3.0/Unsupported.tar.Z« 
        └─⟦25c524ae4⟧ 
            └─⟦this⟧ »Unsupported/MFpxl/mflib/dateandtime.SYS_V.c« 

TextFile


#ifndef lint
static char RCSid[] = "$Header: dateandtime.c,v 1.0 86/01/31 15:01:12 richards Released $";
#endif

/*
** DATEANDTIME.C -- external procedures:
**
**	procedure dateandtime(
**			var	minutes,
**				day,
**				month,
**				year:	integer);
*/

#include <signal.h>
#include <time.h>
#include "mftypes.h"

/*
**	catchint()
**
**  Gets called when the user hits his interrupt key.  Sets the global
**  "interrupt" nonzero, then sets it up so that the next interrupt will
**  also be caught here.
**
*/

extern	integer	interrupt;		/* defined in mf.p; non-zero means */
					/*  a user-interrupt request	   */
					/*  is pending			   */
catchint()
{
	interrupt = 1;
	signal(SIGINT,catchint);
}

/*
**      dateandtime(time, day, month, year)
**
**  Stores minutes since midnight, current day, month and year into
**  *time, *day, *month and *year, respectively.
**
**  Also, set things up so that catchint() will get control on interrupts.
**
*/

dateandtime(minutes, day, month, year)
integer	*minutes, *day, *month, *year;
{
        long        clock;
	struct tm   *tmptr, *localtime();
	
	clock = time(0);
	tmptr = localtime(&clock);
	
	*minutes = tmptr->tm_hour * 60 + tmptr->tm_min;
	*day = tmptr->tm_mday;
	*month = tmptr->tm_mon + 1;
	*year = tmptr->tm_year + 1900;

	signal(SIGINT,catchint);
}