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 t

⟦4e6598e80⟧ TextFile

    Length: 1104 (0x450)
    Types: TextFile
    Names: »traps.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Kriegspiel/traps.c« 

TextFile

/* traps.c */

#include "externs.h"
#include <signal.h>

trap_sigint ()
{
	int y, x;
	char c;

	signal (SIGINT, SIG_IGN);
	getyx (stdscr, y, x);
	overwrite (stdscr, backupscreen);
	overwrite (win [PROMPT], backupwin[PROMPT]);
	overwrite (win [MESSAGE], backupwin[MESSAGE]);
	overwrite (win [INPUT], backupwin[INPUT]);
	overwrite (blankscreen, stdscr);
	wclear (win [PROMPT]);
	wclear (win [MESSAGE]);
	wclear (win [INPUT]);
	waddstr (win [PROMPT], "Quit?");
	waddstr (win [MESSAGE], "type y or n");
	waddstr (win [INPUT], ": ");
	move (win [INPUT]->_cury + win [INPUT]->_begy,
	      win [INPUT]->_curx + win [INPUT]->_begx);
	refresh ();
	c = getchar();
	while (c!='n' && c!='N' && c!='y' && c!='Y') {
		if (c == '\f')  /*  ^L */
			refresh ();
		c = getchar();
	}
	if (c == 'y' || c == 'Y') {
		send (sock, "resign\0", 7, 0);
		error ((char *) NULL);
	}
	overwrite (backupscreen, stdscr);
	overwrite (backupwin [PROMPT], win [PROMPT]);
	overwrite (backupwin [MESSAGE], win [MESSAGE]);
	overwrite (backupwin [INPUT], win [INPUT]);
	move (y, x);
	redraw ();
	refresh ();
	signal (SIGINT, trap_sigint);
}