|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T l
Length: 1135 (0x46f)
Types: TextFile
Names: »lckmsg.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Spacewar/lckmsg.c«
/*
* Spacewar - return a lock message if the system is locked (no play allowed)
*
* Copyright 1985 obo Systems, Inc.
* Copyright 1985 Dan Rosenblatt
*/
#include "spacewar.h"
#ifndef VMS
#include <sys/types.h>
#else /* BSD SYSIII SYSV */
#include <types.h>
#endif /* VMS */
#include <time.h>
static char *msg; /* NULL if normal locking applies */
/* ptr to NULL str if unlocked by SWMASTER */
/* ptr to text if locked by SWMASTER */
char *lckmsg()
{
time_t clock;
struct tm *curtm,*localtime();
#ifdef DEBUG
DBG("lckmsg()\n");
#endif
/* controlled by SWMASTER */
if (msg)
return((*msg) ? msg : NULL);
/* get current date&time */
time(&clock);
curtm = localtime(&clock);
/* OK if Sat or Sun */
if (curtm->tm_wday == 0 || curtm->tm_wday == 6)
return(NULL);
/* OK if before 8AM or after 5PM */
if (curtm->tm_hour < 8 || curtm->tm_hour >= 17)
return(NULL);
/* OK if during lunch: 1130PM to 1PM */
if (curtm->tm_hour < 13 && curtm->tm_hour*100 + curtm->tm_min >= 1130)
return(NULL);
return("A lockout exists from 0800-1130,1300-1700 Mon-Fri");
}
VOID prvlck(s)
char *s;
{
msg = s;
}