- gettextinfo (&ti);
- set_viewlength = max (ti.screenheight, 25);
- set_viewwidth = max (ti.screenwidth, 79);
- }
-#elif HAVE_LIBTERMCAP
- {
- char *termtype;
- int success;
-
- /* This code stolen from termcap.info, though modified. */
-#if !__CHECKER__
- term_buffer = xmalloc (2048);
-#endif
-
- termtype = getenv ("TERM");
- if (!termtype)
- msg (FE, _("Specify a terminal type with `setenv TERM <yourtype>'."));
-
-#if __CHECKER__
- success = tgetent (NULL, termtype);
-#else
- success = tgetent (term_buffer, termtype);
-#endif
-
- if (success <= 0)
- {
- if (success < 0)
- msg (IE, _("Could not access the termcap data base."));
- else
- msg (IE, _("Terminal type `%s' is not defined."), termtype);
- msg (MM, _("Assuming screen of size 79x25."));
- set_viewlength = 25;
- set_viewwidth = 79;
- }
- else
- {
- set_viewlength = tgetnum ("li");
- set_viewwidth = tgetnum ("co") - 1;
- }
- }
-#else /* !HAVE_LIBTERMCAP */
- set_viewlength = 25;
- set_viewwidth = 79;
-#endif /* !HAVE_LIBTERMCAP */