|
|
1.1 root 1: /*********************************************************************
2: * COPYRIGHT NOTICE *
3: **********************************************************************
4: * This software is copyright (C) 1982 by Pavel Curtis *
5: * *
6: * Permission is granted to reproduce and distribute *
7: * this file by any means so long as no fee is charged *
8: * above a nominal handling fee and so long as this *
9: * notice is always included in the copies. *
10: * *
11: * Other rights are reserved except as explicitly granted *
12: * by written permission of the author. *
13: * Pavel Curtis *
14: * Computer Science Dept. *
15: * 405 Upson Hall *
16: * Cornell University *
17: * Ithaca, NY 14853 *
18: * *
19: * Ph- (607) 256-4934 *
20: * *
21: * Pavel.Cornell@Udel-Relay (ARPAnet) *
22: * decvax!cornell!pavel (UUCPnet) *
23: *********************************************************************/
24:
25: /*
26: * beep.c
27: *
28: * Routines beep() and flash()
29: *
30: * $Log: lib_beep.c,v $
31: * Revision 1.8 93/04/12 14:13:21 bin
32: * Udo: third color update
33: *
34: * Revision 1.2 92/04/13 14:37:04 bin
35: * update by vlad
36: *
37: * Revision 2.1 82/10/25 14:46:29 pavel
38: * Added Copyright Notice
39: *
40: * Revision 2.0 82/10/24 15:17:31 pavel
41: * Beta-one Test Release
42: *
43: * Revision 1.3 82/08/23 22:30:22 pavel
44: * The REAL Alpha-one Release Version
45: *
46: * Revision 1.2 82/08/19 19:11:02 pavel
47: * Alpha Test Release One
48: *
49: * Revision 1.1 82/08/12 18:40:14 pavel
50: * Initial revision
51: *
52: *
53: */
54:
55: #ifdef RCSHDR
56: static char RCSid[] =
57: "$Header: /src386/usr/lib/ncurses/RCS/lib_beep.c,v 1.8 93/04/12 14:13:21 bin Exp Locker: bin $";
58: #endif
59:
60: #include "curses.h"
61: #include "curses.priv.h"
62: #include "term.h"
63:
64:
65: static
66: outc(ch)
67: char ch;
68: {
69: putc(ch, SP->_ofp);
70: }
71:
72:
73: /*
74: * beep()
75: *
76: * Sound the current terminal's audible bell if it has one. If not,
77: * flash the screen if possible.
78: *
79: */
80:
81: beep()
82: {
83: #ifdef TRACE
84: if (_tracing)
85: _tracef("beep() called");
86: #endif
87: if (bell)
88: tputs(bell, 1, outc);
89: else if (flash_screen)
90: tputs(flash_screen, 1, outc);
91: }
92:
93:
94: /*
95: * flash()
96: *
97: * Flash the current terminal's screen if possible. If not,
98: * sound the audible bell if one exists.
99: *
100: */
101:
102: flash()
103: {
104: #ifdef TRACE
105: if (_tracing)
106: _tracef("flash() called");
107: #endif
108: if (flash_screen)
109: tputs(flash_screen, 1, outc);
110: else if (bell)
111: tputs(bell, 1, outc);
112: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.