/****************************************************************************
- * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
+ * Copyright 2020 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 *
#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.81 2020/02/02 23:34:34 tom Exp $")
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
{
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);
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",
cursor_invisible);
break;
}
- } else
+ } else {
code = ERR;
+ }
+#endif
if (code != ERR)
code = (cursor == -1 ? 1 : cursor);
SP_PARM->_cursor = vis;
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 {