games/boggle/boggle/timer.c
/*
 * Update the display of the remaining time while waiting for a character
 * If time runs out do a longjmp() to the game controlling routine, returning
 * non-zero; oth. return the character
 * Leave the cursor where it was initially
 */
Update the display of the remaining time while waiting for a character
If time runs out do a longjmp() to the game controlling routine, returning
non-zero; oth. return the character
Leave the cursor where it was initially
Update the display of the remaining time while waiting for a character If time runs out do a longjmp () to the game controlling routine returning non - zero ; oth . return the character Leave the cursor where it was initially
int
timerch()
{
	extern int tlimit;
	extern long start_t;
	extern jmp_buf env;
	long prevt, t;
	int col, remaining, row;
	getyx(stdscr, row, col);
	prevt = 0L;
	for (;;) {
		if (waitch(1000L) == 1)
			break;
		time(&t);
		if (t == prevt)
			continue;
		prevt = t;
		remaining = tlimit - (int) (t - start_t);
		if (remaining < 0) {
			longjmp(env, 1);
		}
		move(TIMER_LINE, TIMER_COL);
		printw("%d:%02d", remaining / 60, remaining % 60);
		move(row, col);
		refresh();
	}
	return (getch() & 0177);
}
int timerch ( ) { extern int tlimit ; extern long start_t ; extern jmp_buf env ; long prevt , t ; int col , remaining , row ; getyx ( stdscr , row , col ) ; prevt = 0L ; for ( ; ; ) { if ( waitch ( 1000L ) == 1 ) break ; time ( & t ) ; if ( t == prevt ) continue ; prevt = t ; remaining = tlimit - ( int ) ( t - start_t ) ; if ( remaining < 0 ) { longjmp ( env , 1 ) ; } move ( TIMER_LINE , TIMER_COL ) ; printw ( " " , remaining / 60 , remaining % 60 ) ; move ( row , col ) ; refresh ( ) ; } return ( getch ( ) & 0177 ) ; }
Update the display of the remaining time while waiting for a character
 If time runs out do a longjmp() to the game controlling routine, returning
 non-zero; oth.
Update the display of the remaining time while waiting for a character If time runs out do a longjmp () to the game controlling routine returning non - zero ; oth .
/*NOTREACHED*/