1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: */
6:
7: #if !defined(lint) && !defined(NOSCCS)
8: static char sccsid[] = "@(#)tstp.c 5.1.1 (2.11BSD) 1999/10/24";
9: #endif
10:
11: #include <signal.h>
12: #include "curses.ext"
13:
14: /*
15: * handle stop and start signals
16: */
17: tstp() {
18: SGTTY tty;
19: sigset_t oset, set;
20: #ifdef DEBUG
21: if (outf)
22: fflush(outf);
23: #endif
24: /*
25: * Block window change and timer signals. The latter is because
26: * applications use timers to decide when to repaint the screen.
27: */
28: (void)sigemptyset(&set);
29: (void)sigaddset(&set, SIGALRM);
30: (void)sigaddset(&set, SIGWINCH);
31: (void)sigprocmask(SIG_BLOCK, &set, &oset);
32:
33: tty = _tty;
34: mvcur(0, COLS - 1, LINES - 1, 0);
35: endwin();
36: fflush(stdout);
37:
38: /* Unblock SIGTSTP. */
39: (void)sigemptyset(&set);
40: (void)sigaddset(&set, SIGTSTP);
41: (void)sigprocmask(SIG_UNBLOCK, &set, NULL);
42:
43: /* Stop ourselves. */
44: signal(SIGTSTP, SIG_DFL);
45: kill(0, SIGTSTP);
46:
47: /* Time passes ... */
48:
49: /* Reset the SIGTSTP handler. */
50: signal(SIGTSTP, tstp);
51:
52: _tty = tty;
53: stty(_tty_ch, &_tty);
54:
55: /* Repaint the screen. */
56: wrefresh(curscr);
57:
58: /* Reset the signals. */
59: (void)sigprocmask(SIG_SETMASK, &oset, NULL);
60: }
Defined functions
tstp
defined in line
17; used 4 times
Defined variables
sccsid
defined in line
8;
never used