#include <lib-lib/lib-lib.h>
-#if defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM)
+#if defined(HAVE_RESIZETERM)
#include <termios.h>
#ifdef HAVE_SYS_IOCTL_H
int fd;
struct winsize w;
-#ifdef HAVE_RESIZETERM
- int SLtt_Screen_Rows, SLtt_Screen_Cols;
-#endif
+ int rows, cols;
- SLtt_Screen_Rows = -1;
- SLtt_Screen_Cols = -1;
+ rows = -1;
+ cols = -1;
if ((fd = open ("/dev/tty", O_RDONLY)) != -1) {
if (ioctl (fd, TIOCGWINSZ, &w) != -1) {
- SLtt_Screen_Rows = w.ws_row;
- SLtt_Screen_Cols = w.ws_col;
+ rows = w.ws_row;
+ cols = w.ws_col;
}
close (fd);
}
- if (SLtt_Screen_Rows <= 0) {
+ if (rows <= 0) {
if ((cp = getenv ("LINES")) != NULL) {
- SLtt_Screen_Rows = atoi (cp);
+ rows = atoi (cp);
}
else
- SLtt_Screen_Rows = 24;
+ rows = 24;
}
- if (SLtt_Screen_Cols <= 0) {
+ if (cols <= 0) {
if ((cp = getenv ("COLUMNS")) != NULL)
- SLtt_Screen_Cols = atoi (cp);
+ cols = atoi (cp);
else
- SLtt_Screen_Cols = 80;
+ cols = 80;
}
-#ifdef USE_SLANG_CURSES
- delwin (stdscr);
- SLsmg_reset_smg ();
- SLsmg_init_smg ();
- stdscr = newwin (0, 0, 0, 0);
- keypad (stdscr, TRUE);
-#else
- resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols);
-#endif
+ resizeterm (rows, cols);
}
-#endif /* defined(USE_SLANG_CURSES) || defined(HAVE_RESIZETERM) */
+#endif /* defined(HAVE_RESIZETERM) */