/* Re-coding of advent in C: privileged operations */
static char sccsid
[] = " wizard.c 4.1 82/05/11 ";
*d
=tptr
[7]+365*(tptr
[5]-77); /* day since 1977 (mod leap) */
/* bug: this will overflow in the year 2066 AD */
/* it will be attributed to Wm the C's millenial celebration */
*t
=tptr
[2]*60+tptr
[1]; /* and minutes since midnite */
delay
=(d
-saved
)*1440+(t
-savet
); /* good for about a month */
if (delay
>=latncy
|| setup
>= 0)
printf("This adventure was suspended a mere %d minutes ago.",delay
);
wizard() /* not as complex as advent/10 (for now) */
if (!yesm(16,0,7)) return(FALSE
);
register int outfd
, size
;
char fname
[80], buf
[512];
extern unsigned filesize
;
lseek(datfd
,(long)filesize
,0);
{ printf("What would you like to call the saved version?\n");
if ((*c
=getchar())=='\n') break;
if (save(cmdfile
,fname
)>=0) break;
printf("I can't use that one.\n");
lseek(outfd
,0L,2); /* end of executable file */
while ((size
=read(datfd
,buf
,512))>0)
write(outfd
,buf
,size
); /* copy the message data */
printf("That should do it. Gis revido.\n");
ran(range
) /* uses unix rng */
int range
; /* can't div by 32768 because */