X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_options.c;h=017a34aac6e712e07899c9bc1c63f3198c2296d7;hp=8e31d484bfff6691e820c30cf187be4d17b47b3c;hb=fae162795e065e5901068152e91f2962b6b247f3;hpb=ef2d99350e0d3e4606171b5b1466ab92ec440205 diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index 8e31d484..017a34aa 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright 2020,2021 Thomas E. Dickey * + * Copyright 1998-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.77 2014/03/08 20:32:59 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.82 2021/02/14 00:17:35 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) @@ -87,7 +88,7 @@ NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); - if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) + if (t < 1 || t > 255 || !SP_PARM || !IsValidTIScreen(SP_PARM)) returnCode(ERR); NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); @@ -196,11 +197,13 @@ NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) if (SP_PARM != 0 && vis >= 0 && vis <= 2) { int cursor = SP_PARM->_cursor; - bool bBuiltIn = !IsTermInfo(SP_PARM); if (vis == cursor) { code = cursor; } else { - if (!bBuiltIn) { +#ifdef USE_TERM_DRIVER + code = CallDriver_1(SP_PARM, td_cursorSet, vis); +#else + if (IsValidTIScreen(SP_PARM)) { switch (vis) { case 2: code = NCURSES_PUTP2_FLUSH("cursor_visible", @@ -215,8 +218,10 @@ NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) cursor_invisible); break; } - } else + } else { code = ERR; + } +#endif if (code != ERR) code = (cursor == -1 ? 1 : cursor); SP_PARM->_cursor = vis; @@ -237,7 +242,7 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) { T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); - if (IsValidTIScreen(SP_PARM)) { + if (SP_PARM && IsValidTIScreen(SP_PARM)) { SP_PARM->_checkfd = fd; returnCode(OK); } else { @@ -356,7 +361,7 @@ _nc_keypad(SCREEN *sp, int flag) #else if (flag) { (void) NCURSES_PUTP2_FLUSH("keypad_xmit", keypad_xmit); - } else if (!flag && keypad_local) { + } else if (keypad_local) { (void) NCURSES_PUTP2_FLUSH("keypad_local", keypad_local); }