OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [services/] [curses/] [pdcurses/] [current/] [src/] [pdcurses/] [beep.c] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
/* Public Domain Curses */
2
 
3
#include <curspriv.h>
4
 
5
RCSID("$Id: beep.c,v 1.1 2009/05/10 08:29:53 jld Exp $")
6
 
7
/*man-start**************************************************************
8
 
9
  Name:                                                         beep
10
 
11
  Synopsis:
12
        int beep(void);
13
        int flash(void);
14
 
15
  Description:
16
        beep() sounds the audible bell on the terminal, if possible;
17
        if not, it calls flash().
18
 
19
        flash() "flashes" the screen, by inverting the foreground and
20
        background of every cell, pausing, and then restoring the
21
        original attributes.
22
 
23
  Return Value:
24
        These functions return OK.
25
 
26
  Portability                                X/Open    BSD    SYS V
27
        beep                                    Y       Y       Y
28
        flash                                   Y       Y       Y
29
 
30
**man-end****************************************************************/
31
 
32
int beep(void)
33
{
34
    PDC_LOG(("beep() - called\n"));
35
 
36
    if (SP->audible)
37
        PDC_beep();
38
    else
39
        flash();
40
 
41
    return OK;
42
}
43
 
44
int flash(void)
45
{
46
    int z, y, x;
47
 
48
    PDC_LOG(("flash() - called\n"));
49
 
50
    /* Reverse each cell; wait; restore the screen */
51
 
52
    for (z = 0; z < 2; z++)
53
    {
54
        for (y = 0; y < LINES; y++)
55
            for (x = 0; x < COLS; x++)
56
                curscr->_y[y][x] ^= A_REVERSE;
57
 
58
        wrefresh(curscr);
59
 
60
        if (!z)
61
            napms(50);
62
    }
63
 
64
    return OK;
65
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.