~ubuntu-branches/ubuntu/raring/ipxe/raring

« back to all changes in this revision

Viewing changes to src/hci/mucurses/ansi_screen.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-11-14 15:47:31 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20121114154731-jhuy5d1h2jw75qe9
Tags: 1.0.0+git-4.d6b0b76-0ubuntu1
* New upstream snapshot:
  - d/p/iscsi*.patch: Dropped - included in snapshot.
  - Refreshed all other patches.
* d/p/enable-https.patch: Enable HTTPS support (LP: #1025239).

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
unsigned short _COLS = 80;
13
13
unsigned short _LINES = 24;
14
14
 
 
15
static unsigned int saved_usage;
 
16
 
15
17
static void ansiscr_reset ( struct _curses_screen *scr ) {
16
18
        /* Reset terminal attributes and clear screen */
17
19
        scr->attrs = 0;
20
22
        printf ( "\033[0m" );
21
23
}
22
24
 
 
25
static void ansiscr_init ( struct _curses_screen *scr ) {
 
26
        saved_usage = console_set_usage ( CONSOLE_USAGE_TUI );
 
27
        ansiscr_reset ( scr );
 
28
}
 
29
 
 
30
static void ansiscr_exit ( struct _curses_screen *scr ) {
 
31
        ansiscr_reset ( scr );
 
32
        console_set_usage ( saved_usage );
 
33
}
 
34
 
23
35
static void ansiscr_movetoyx ( struct _curses_screen *scr,
24
36
                               unsigned int y, unsigned int x ) {
25
37
        if ( ( x != scr->curs_x ) || ( y != scr->curs_y ) ) {
65
77
}
66
78
 
67
79
SCREEN _ansi_screen = {
68
 
        .init           = ansiscr_reset,
69
 
        .exit           = ansiscr_reset,
 
80
        .init           = ansiscr_init,
 
81
        .exit           = ansiscr_exit,
70
82
        .movetoyx       = ansiscr_movetoyx,
71
83
        .putc           = ansiscr_putc,
72
84
        .getc           = ansiscr_getc,