X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Ftinfo_driver.c;fp=ncurses%2Ftinfo%2Ftinfo_driver.c;h=a17accd358e543be61110f942c45e97d5f9a60c1;hp=e0f1d015788987fedd087f72fb6658d35c8cdfcf;hb=a8845f1feadb0b4d906e9040e465b93fd3f72660;hpb=9ee3995474454b7d956885e0fe5c8cac2ae25d42 diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index e0f1d015..a17accd3 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -50,7 +50,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.38 2014/04/26 18:47:20 juergen Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.39 2014/09/27 21:58:57 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -1298,6 +1298,35 @@ drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, int flag) return (code); } +static int +drv_cursorSet(TERMINAL_CONTROL_BLOCK * TCB, int vis) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + T((T_CALLED("tinfo:drv_cursorSet(%p,%d)"), (void *) SP_PARM, vis)); + + if (SP_PARM != 0 && IsTermInfo(SP_PARM)) { + switch (vis) { + case 2: + code = NCURSES_PUTP2_FLUSH("cursor_visible", cursor_visible); + break; + case 1: + code = NCURSES_PUTP2_FLUSH("cursor_normal", cursor_normal); + break; + case 0: + code = NCURSES_PUTP2_FLUSH("cursor_invisible", cursor_invisible); + break; + } + } else { + code = ERR; + } + returnCode(code); +} + static bool drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key) { @@ -1346,5 +1375,6 @@ NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = { drv_nap, /* nap */ drv_kpad, /* kpad */ drv_keyok, /* kyOk */ - drv_kyExist /* kyExist */ + drv_kyExist, /* kyExist */ + drv_cursorSet /* cursorSet */ };