+NCURSES_EXPORT(char *)
+NCURSES_PUBLIC_VAR(ttytype) (void)
+{
+ static char empty[] = "";
+ char *result = empty;
+
+#if NCURSES_SP_FUNCS
+ if (CURRENT_SCREEN) {
+ TERMINAL *termp = TerminalOf(CURRENT_SCREEN);
+ if (termp != 0) {
+ result = TerminalType(termp).term_names;
+ }
+ }
+#else
+ if (cur_term != 0) {
+ result = TerminalType(cur_term).term_names;
+ }
+#endif
+ return result;
+}
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Lines(SCREEN *sp)
+{
+ return ptrLines(sp);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_PUBLIC_VAR(LINES) (void)
+{
+ return *_nc_ptr_Lines(CURRENT_SCREEN);
+}
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Cols(SCREEN *sp)
+{
+ return ptrCols(sp);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_PUBLIC_VAR(COLS) (void)
+{
+ return *_nc_ptr_Cols(CURRENT_SCREEN);
+}
+
+NCURSES_EXPORT(int *)
+_nc_ptr_Tabsize(SCREEN *sp)
+{
+ return ptrTabsize(sp);
+}
+
+NCURSES_EXPORT(int)
+NCURSES_PUBLIC_VAR(TABSIZE) (void)
+{
+ return *_nc_ptr_Tabsize(CURRENT_SCREEN);
+}
+#else
+NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = "";
+NCURSES_EXPORT_VAR(int) LINES = 0;
+NCURSES_EXPORT_VAR(int) COLS = 0;
+NCURSES_EXPORT_VAR(int) TABSIZE = 8;
+#endif
+
+#if NCURSES_EXT_FUNCS
+NCURSES_EXPORT(int)
+NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value)
+{
+ int code = OK;
+#if USE_REENTRANT
+ if (SP_PARM) {
+ SP_PARM->_TABSIZE = value;
+ } else {
+ code = ERR;
+ }
+#else
+ (void) SP_PARM;
+ TABSIZE = value;
+#endif
+ return code;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(int)
+set_tabsize(int value)
+{
+ return NCURSES_SP_NAME(set_tabsize) (CURRENT_SCREEN, value);
+}
+#endif
+#endif /* NCURSES_EXT_FUNCS */
+
+#if USE_SIGWINCH
+/*
+ * If we have a pending SIGWINCH, set the flag in each screen.
+ */
+NCURSES_EXPORT(int)
+_nc_handle_sigwinch(SCREEN *sp)
+{
+ SCREEN *scan;
+
+ if (_nc_globals.have_sigwinch) {
+ _nc_globals.have_sigwinch = 0;
+
+ for (each_screen(scan)) {
+ scan->_sig_winch = TRUE;
+ }
+ }
+
+ return (sp ? sp->_sig_winch : 0);
+}
+
+#endif
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f)
+{
+ START_TRACE();
+ T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f));
+#if NCURSES_SP_FUNCS
+ if (IsPreScreen(SP_PARM)) {
+ SP_PARM->_use_env = f;
+ }
+#else
+ _nc_prescreen.use_env = f;
+#endif
+ returnVoid;
+}
+
+NCURSES_EXPORT(void)
+NCURSES_SP_NAME(use_tioctl) (NCURSES_SP_DCLx bool f)
+{
+ START_TRACE();
+ T((T_CALLED("use_tioctl(%p,%d)"), (void *) SP_PARM, (int) f));
+#if NCURSES_SP_FUNCS
+ if (IsPreScreen(SP_PARM)) {
+ SP_PARM->use_tioctl = f;
+ }
+#else
+ _nc_prescreen.use_tioctl = f;
+#endif
+ returnVoid;
+}
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)