Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | /**************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 3 | * * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a * |
| 5 | * copy of this software and associated documentation files (the * |
| 6 | * "Software"), to deal in the Software without restriction, including * |
| 7 | * without limitation the rights to use, copy, modify, merge, publish, * |
| 8 | * distribute, distribute with modifications, sublicense, and/or sell * |
| 9 | * copies of the Software, and to permit persons to whom the Software is * |
| 10 | * furnished to do so, subject to the following conditions: * |
| 11 | * * |
| 12 | * The above copyright notice and this permission notice shall be included * |
| 13 | * in all copies or substantial portions of the Software. * |
| 14 | * * |
| 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 22 | * * |
| 23 | * Except as contained in this notice, the name(s) of the above copyright * |
| 24 | * holders shall not be used in advertising or otherwise to promote the * |
| 25 | * sale, use or other dealings in this Software without prior written * |
| 26 | * authorization. * |
| 27 | ****************************************************************************/ |
| 28 | |
| 29 | /* |
| 30 | * def_prog_mode() |
| 31 | * def_shell_mode() |
| 32 | * reset_prog_mode() |
| 33 | * reset_shell_mode() |
| 34 | * savetty() |
| 35 | * resetty() |
| 36 | */ |
| 37 | |
| 38 | #include <curses.priv.h> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 39 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 40 | #ifndef CUR |
| 41 | #define CUR SP_TERMTYPE |
| 42 | #endif |
| 43 | |
| 44 | MODULE_ID("$Id: lib_ttyflags.c,v 1.30 2014/04/26 18:47:20 juergen Exp $") |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 45 | |
| 46 | NCURSES_EXPORT(int) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 47 | NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 48 | { |
| 49 | int result = OK; |
| 50 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 51 | if (buf == 0 || SP_PARM == 0) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 52 | result = ERR; |
| 53 | } else { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 54 | TERMINAL *termp = TerminalOf(SP_PARM); |
| 55 | |
| 56 | if (0 == termp) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 57 | result = ERR; |
| 58 | } else { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 59 | #ifdef USE_TERM_DRIVER |
| 60 | result = CallDriver_2(SP_PARM, td_sgmode, FALSE, buf); |
| 61 | #else |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 62 | for (;;) { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 63 | if (GET_TTY(termp->Filedes, buf) != 0) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 64 | if (errno == EINTR) |
| 65 | continue; |
| 66 | result = ERR; |
| 67 | } |
| 68 | break; |
| 69 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 70 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | if (result == ERR) |
| 74 | memset(buf, 0, sizeof(*buf)); |
| 75 | |
| 76 | TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 77 | termp ? termp->Filedes : -1, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 78 | _nc_trace_ttymode(buf))); |
| 79 | } |
| 80 | return (result); |
| 81 | } |
| 82 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 83 | #if NCURSES_SP_FUNCS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | NCURSES_EXPORT(int) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 85 | _nc_get_tty_mode(TTY * buf) |
| 86 | { |
| 87 | return NCURSES_SP_NAME(_nc_get_tty_mode) (CURRENT_SCREEN, buf); |
| 88 | } |
| 89 | #endif |
| 90 | |
| 91 | NCURSES_EXPORT(int) |
| 92 | NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 93 | { |
| 94 | int result = OK; |
| 95 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 96 | if (buf == 0 || SP_PARM == 0) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 97 | result = ERR; |
| 98 | } else { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 99 | TERMINAL *termp = TerminalOf(SP_PARM); |
| 100 | |
| 101 | if (0 == termp) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | result = ERR; |
| 103 | } else { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 104 | #ifdef USE_TERM_DRIVER |
| 105 | result = CallDriver_2(SP_PARM, td_sgmode, TRUE, buf); |
| 106 | #else |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 107 | for (;;) { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 108 | if ((SET_TTY(termp->Filedes, buf) != 0) |
| 109 | #if USE_KLIBC_KBD |
| 110 | && !NC_ISATTY(termp->Filedes) |
| 111 | #endif |
| 112 | ) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 113 | if (errno == EINTR) |
| 114 | continue; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 115 | if ((errno == ENOTTY) && (SP_PARM != 0)) |
| 116 | SP_PARM->_notty = TRUE; |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 117 | result = ERR; |
| 118 | } |
| 119 | break; |
| 120 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 121 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 122 | } |
| 123 | TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 124 | termp ? termp->Filedes : -1, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 125 | _nc_trace_ttymode(buf))); |
| 126 | } |
| 127 | return (result); |
| 128 | } |
| 129 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 130 | #if NCURSES_SP_FUNCS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 131 | NCURSES_EXPORT(int) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 132 | _nc_set_tty_mode(TTY * buf) |
| 133 | { |
| 134 | return NCURSES_SP_NAME(_nc_set_tty_mode) (CURRENT_SCREEN, buf); |
| 135 | } |
| 136 | #endif |
| 137 | |
| 138 | NCURSES_EXPORT(int) |
| 139 | NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 140 | { |
| 141 | int rc = ERR; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 142 | TERMINAL *termp = TerminalOf(SP_PARM); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 143 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 144 | T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM)); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 145 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 146 | if (termp != 0) { |
| 147 | #ifdef USE_TERM_DRIVER |
| 148 | rc = CallDriver_2(SP_PARM, td_mode, FALSE, TRUE); |
| 149 | #else |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 150 | /* |
| 151 | * If XTABS was on, remove the tab and backtab capabilities. |
| 152 | */ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 153 | if (_nc_get_tty_mode(&termp->Ottyb) == OK) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 154 | #ifdef TERMIOS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 155 | if (termp->Ottyb.c_oflag & OFLAGS_TABS) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 156 | tab = back_tab = NULL; |
| 157 | #else |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 158 | if (termp->Ottyb.sg_flags & XTABS) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 159 | tab = back_tab = NULL; |
| 160 | #endif |
| 161 | rc = OK; |
| 162 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 163 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 164 | } |
| 165 | returnCode(rc); |
| 166 | } |
| 167 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 168 | #if NCURSES_SP_FUNCS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 169 | NCURSES_EXPORT(int) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 170 | def_shell_mode(void) |
| 171 | { |
| 172 | return NCURSES_SP_NAME(def_shell_mode) (CURRENT_SCREEN); |
| 173 | } |
| 174 | #endif |
| 175 | |
| 176 | NCURSES_EXPORT(int) |
| 177 | NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 178 | { |
| 179 | int rc = ERR; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 180 | TERMINAL *termp = TerminalOf(SP_PARM); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 181 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 182 | T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM)); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 183 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 184 | if (termp != 0) { |
| 185 | #ifdef USE_TERM_DRIVER |
| 186 | rc = CallDriver_2(SP_PARM, td_mode, TRUE, TRUE); |
| 187 | #else |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 188 | /* |
| 189 | * Turn off the XTABS bit in the tty structure if it was on. |
| 190 | */ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 191 | if (_nc_get_tty_mode(&termp->Nttyb) == OK) { |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 192 | #ifdef TERMIOS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 193 | termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 194 | #else |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 195 | termp->Nttyb.sg_flags &= (unsigned) (~XTABS); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 196 | #endif |
| 197 | rc = OK; |
| 198 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 199 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 200 | } |
| 201 | returnCode(rc); |
| 202 | } |
| 203 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 204 | #if NCURSES_SP_FUNCS |
| 205 | NCURSES_EXPORT(int) |
| 206 | def_prog_mode(void) |
| 207 | { |
| 208 | return NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN); |
| 209 | } |
| 210 | #endif |
| 211 | |
| 212 | NCURSES_EXPORT(int) |
| 213 | NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) |
| 214 | { |
| 215 | int rc = ERR; |
| 216 | TERMINAL *termp = TerminalOf(SP_PARM); |
| 217 | |
| 218 | T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM)); |
| 219 | |
| 220 | if (termp != 0) { |
| 221 | #ifdef USE_TERM_DRIVER |
| 222 | rc = CallDriver_2(SP_PARM, td_mode, TRUE, FALSE); |
| 223 | #else |
| 224 | if (_nc_set_tty_mode(&termp->Nttyb) == OK) { |
| 225 | if (SP_PARM) { |
| 226 | if (SP_PARM->_keypad_on) |
| 227 | _nc_keypad(SP_PARM, TRUE); |
| 228 | } |
| 229 | rc = OK; |
| 230 | } |
| 231 | #endif |
| 232 | } |
| 233 | returnCode(rc); |
| 234 | } |
| 235 | |
| 236 | #if NCURSES_SP_FUNCS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 237 | NCURSES_EXPORT(int) |
| 238 | reset_prog_mode(void) |
| 239 | { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 240 | return NCURSES_SP_NAME(reset_prog_mode) (CURRENT_SCREEN); |
| 241 | } |
| 242 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 243 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 244 | NCURSES_EXPORT(int) |
| 245 | NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) |
| 246 | { |
| 247 | int rc = ERR; |
| 248 | TERMINAL *termp = TerminalOf(SP_PARM); |
| 249 | |
| 250 | T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM)); |
| 251 | |
| 252 | if (termp != 0) { |
| 253 | #ifdef USE_TERM_DRIVER |
| 254 | rc = CallDriver_2(SP_PARM, td_mode, FALSE, FALSE); |
| 255 | #else |
| 256 | if (SP_PARM) { |
| 257 | _nc_keypad(SP_PARM, FALSE); |
| 258 | _nc_flush(); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 259 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 260 | rc = _nc_set_tty_mode(&termp->Ottyb); |
| 261 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 262 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 263 | returnCode(rc); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 264 | } |
| 265 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 266 | #if NCURSES_SP_FUNCS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 267 | NCURSES_EXPORT(int) |
| 268 | reset_shell_mode(void) |
| 269 | { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 270 | return NCURSES_SP_NAME(reset_shell_mode) (CURRENT_SCREEN); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 271 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 272 | #endif |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 273 | |
| 274 | static TTY * |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 275 | saved_tty(NCURSES_SP_DCL0) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 276 | { |
| 277 | TTY *result = 0; |
| 278 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 279 | if (SP_PARM != 0) { |
| 280 | result = (TTY *) & (SP_PARM->_saved_tty); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 281 | } else { |
| 282 | if (_nc_prescreen.saved_tty == 0) { |
| 283 | _nc_prescreen.saved_tty = typeCalloc(TTY, 1); |
| 284 | } |
| 285 | result = _nc_prescreen.saved_tty; |
| 286 | } |
| 287 | return result; |
| 288 | } |
| 289 | |
| 290 | /* |
| 291 | ** savetty() and resetty() |
| 292 | ** |
| 293 | */ |
| 294 | |
| 295 | NCURSES_EXPORT(int) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 296 | NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0) |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 297 | { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 298 | T((T_CALLED("savetty(%p)"), (void *) SP_PARM)); |
| 299 | returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 300 | } |
| 301 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 302 | #if NCURSES_SP_FUNCS |
| 303 | NCURSES_EXPORT(int) |
| 304 | savetty(void) |
| 305 | { |
| 306 | return NCURSES_SP_NAME(savetty) (CURRENT_SCREEN); |
| 307 | } |
| 308 | #endif |
| 309 | |
| 310 | NCURSES_EXPORT(int) |
| 311 | NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0) |
| 312 | { |
| 313 | T((T_CALLED("resetty(%p)"), (void *) SP_PARM)); |
| 314 | returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); |
| 315 | } |
| 316 | |
| 317 | #if NCURSES_SP_FUNCS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 318 | NCURSES_EXPORT(int) |
| 319 | resetty(void) |
| 320 | { |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 321 | return NCURSES_SP_NAME(resetty) (CURRENT_SCREEN); |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 322 | } |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 323 | #endif |