# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
+#if defined (__GO32__)
+# include <pc.h>
+#endif
+
#include "rltty.h"
#include "tcap.h"
extern void set_lines_and_columns ();
extern char *get_env_value ();
+/* Functions imported from display.c */
+extern void _rl_redisplay_after_sigwinch ();
+
/* **************************************************************** */
/* */
/* Terminal and Termcap */
/* */
/* **************************************************************** */
+#ifndef __DJGPP__
static char *term_buffer = (char *)NULL;
static char *term_string_buffer = (char *)NULL;
-static int tcap_initialized;
-
/* Non-zero means this terminal can't really do anything. */
static int dumb_term;
+#endif
+
+static int tcap_initialized;
#if !defined (__linux__)
# if defined (__EMX__) || defined (NEED_EXTERN_PC)
if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
screenwidth = atoi (ss);
-#if !defined(__DJGPP__)
+#if defined(__DJGPP__)
+ tty = tty;
+ if (screenwidth <= 0)
+ screenwidth = ScreenCols ();
+#else
if (screenwidth <= 0 && term_string_buffer)
screenwidth = tgetnum ("co");
#endif
if (ignore_env == 0 && (ss = get_env_value ("LINES")))
screenheight = atoi (ss);
-#if !defined(__DJGPP__)
+#if defined(__DJGPP__)
+ if (screenheight <= 0)
+ screenheight = ScreenRows ();
+#else
if (screenheight <= 0 && term_string_buffer)
screenheight = tgetnum ("li");
#endif
get_term_capabilities (bp)
char **bp;
{
-#if !defined(__DJGPP__)
+#if defined(__DJGPP__)
+ bp = bp;
+#else
register int i;
for (i = 0; i < NUM_TC_STRINGS; i++)
char *terminal_name;
{
#if defined (__GO32__)
- screenwidth = ScreenCols ();
- screenheight = ScreenRows ();
- screenchars = screenwidth * screenheight;
+ terminal_name = terminal_name;
+ screenwidth = screenheight = 0;
+ _rl_get_screen_size (rl_instream ? fileno (rl_instream) : 0, 0);
+
term_cr = "\r";
term_im = term_ei = term_ic = term_IC = (char *)NULL;
term_up = term_dc = term_DC = visible_bell = (char *)NULL;
term_forward_char = (char *)NULL;
#endif /* HACK_TERMCAP_MOTION */
terminal_can_insert = _rl_term_autowrap = 0;
- return;
+ return 0;
#else /* !__GO32__ */
char *term, *buffer;
{
if (readline_echoing_p)
{
-#if !defined (__GO32__)
switch (_rl_bell_preference)
{
case NO_BELL:
default:
break;
case VISIBLE_BELL:
+#if defined (__GO32__)
+ ScreenVisualBell ();
+ break;
+#else
if (visible_bell)
{
tputs (visible_bell, 1, _rl_output_character_function);
break;
}
+#endif
/* FALLTHROUGH */
case AUDIBLE_BELL:
fprintf (stderr, "\007");
fflush (stderr);
break;
}
-#else /* __GO32__ */
- fprintf (stderr, "\007");
- fflush (stderr);
-#endif /* __GO32__ */
return (0);
}
return (-1);
_rl_control_keypad (on)
int on;
{
-#if !defined(__DJGPP__)
+#if defined(__DJGPP__)
+ on = on;
+#else
if (on && term_ks)
tputs (term_ks, 1, _rl_output_character_function);
else if (!on && term_ke)