-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurs_set.c
38 lines (35 loc) · 869 Bytes
/
curs_set.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "curses.h"
#include "term.h"
#include "screen.h"
/*AT&T
AT&T The cursor state is set to invisible, normal, or very visible
AT&T for visibility set to 0, 1 or 2. If the termial supports the
AT&T visibility requested, the previous cursor state is returned,
AT&T otherwise ERR is returned.
AT&T */
int
curs_set(int visibility)
{
int prev_state;
if((prev_state = _screen->_cursor_state) != visibility)
{
switch(visibility)
{
case 0 :
if(cursor_invisible) (void)putp(cursor_invisible);
else return(ERR);
break;
case 1 :
if(cursor_normal) (void)putp(cursor_normal);
else return(ERR);
break;
case 2 :
if(cursor_visible) (void)putp(cursor_visible);
else return(ERR);
break;
default : return(ERR);
}
_screen->_cursor_state = visibility;
}
return(prev_state);
}