int endwin() { __restore_stophandler(); if (curscr != NULL) { if (curscr->flags & __WSTANDOUT) { tputs(SE, 0, __cputchar); curscr->flags &= ~__WSTANDOUT; } __mvcur(curscr->cury, curscr->curx, curscr->maxy - 1, 0, 0); } (void)tputs(VE, 0, __cputchar); (void)tputs(TE, 0, __cputchar); (void)fflush(stdout); (void)setvbuf(stdout, NULL, _IOLBF, 0); return (tcsetattr(STDIN_FILENO, __tcaction ? TCSASOFT | TCSADRAIN : TCSADRAIN, &__orig_termios) ? ERR : OK); }
int __stopwin(void) { #ifdef DEBUG __CTRACE(__CTRACE_MISC, "__stopwin\n"); #endif if (_cursesi_screen->endwin) return OK; /* Get the current terminal state (which the user may have changed). */ (void) tcgetattr(fileno(_cursesi_screen->infd), &_cursesi_screen->save_termios); __restore_stophandler(); __restore_winchhandler(); if (curscr != NULL) { __unsetattr(0); __mvcur((int) curscr->cury, (int) curscr->curx, (int) curscr->maxy - 1, 0, 0); } if (meta_off != NULL) (void) tputs(meta_off, 0, __cputchar); if ((curscr != NULL) && (curscr->flags & __KEYPAD)) (void) tputs(keypad_local, 0, __cputchar); (void) tputs(cursor_normal, 0, __cputchar); (void) tputs(exit_ca_mode, 0, __cputchar); (void) fflush(_cursesi_screen->outfd); (void) setvbuf(_cursesi_screen->outfd, NULL, _IOLBF, (size_t) 0); _cursesi_screen->endwin = 1; return (tcsetattr(fileno(_cursesi_screen->infd), __tcaction ? TCSASOFT | TCSADRAIN : TCSADRAIN, &_cursesi_screen->orig_termios) ? ERR : OK); }
int endwin(void) { __restore_stophandler(); if (curscr != NULL) { if (curscr->flags & __WSTANDOUT) { tputs(SE, 0, __cputchar); curscr->flags &= ~__WSTANDOUT; } if (__usecs) __set_scroll_region(0, curscr->maxy - 1, 0, 0); __mvcur(curscr->curx, curscr->cury, curscr->maxy - 1, 0, 0); } (void)tputs(VE, 0, __cputchar); (void)tputs(TE, 0, __cputchar); (void)fflush(stdout); (void)setvbuf(stdout, NULL, _IOLBF, 0); return (!__noterm && tcsetattr(__tty_fileno, __tcaction ? TCSASOFT | TCSADRAIN : TCSADRAIN, &__orig_termios) ? ERR : OK); }