soc/intel/xeon_sp/util: Enhance lock_pam0123
[coreboot2.git] / payloads / libpayload / curses / PDCurses / pdcurses / beep.c
blob9e92f45727327683308f2cfc728eeb344f3c6f81
1 /* Public Domain Curses */
3 #include <curspriv.h>
5 RCSID("$Id: beep.c,v 1.34 2008/07/13 16:08:17 wmcbrine Exp $")
7 /*man-start**************************************************************
9 Name: beep
11 Synopsis:
12 int beep(void);
13 int flash(void);
15 Description:
16 beep() sounds the audible bell on the terminal, if possible;
17 if not, it calls flash().
19 flash() "flashes" the screen, by inverting the foreground and
20 background of every cell, pausing, and then restoring the
21 original attributes.
23 Return Value:
24 These functions return OK.
26 Portability X/Open BSD SYS V
27 beep Y Y Y
28 flash Y Y Y
30 **man-end****************************************************************/
32 int beep(void)
34 PDC_LOG(("beep() - called\n"));
36 if (SP->audible)
37 PDC_beep();
38 else
39 flash();
41 return OK;
44 int flash(void)
46 int z, y, x;
48 PDC_LOG(("flash() - called\n"));
50 /* Reverse each cell; wait; restore the screen */
52 for (z = 0; z < 2; z++)
54 for (y = 0; y < LINES; y++)
55 for (x = 0; x < COLS; x++)
56 curscr->_y[y][x] ^= A_REVERSE;
58 wrefresh(curscr);
60 if (!z)
61 napms(50);
64 return OK;