* readline.c (_rl_output_character_function), display.c:
Return int, not void, to conform with the expected arg of tputs. * readline.c (init_terminal_io): tgetflag only takes 1 arg. * readline.c (_rl_savestring): New function. * chardefs.h: To avoid conflicts and/or warnings, define savestring as a macro wrapper for _rl_savestring. * display.c (extern term_xn): It's an int flag, not a string. * charsdefs.h, rldefs.h: Remove HAVE_STRING_H-related junk.
This commit is contained in:
parent
848743c1b6
commit
f550cec5b1
5 changed files with 45 additions and 63 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
Tue Feb 15 14:07:08 1994 Per Bothner (bothner@kalessin.cygnus.com)
|
||||||
|
|
||||||
|
* readline.c (_rl_output_character_function), display.c:
|
||||||
|
Return int, not void, to conform with the expected arg of tputs.
|
||||||
|
* readline.c (init_terminal_io): tgetflag only takes 1 arg.
|
||||||
|
* readline.c (_rl_savestring): New function.
|
||||||
|
* chardefs.h: To avoid conflicts and/or warnings, define
|
||||||
|
savestring as a macro wrapper for _rl_savestring.
|
||||||
|
* display.c (extern term_xn): It's an int flag, not a string.
|
||||||
|
* charsdefs.h, rldefs.h: Remove HAVE_STRING_H-related junk.
|
||||||
|
|
||||||
Sat Feb 5 08:32:30 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
Sat Feb 5 08:32:30 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
|
||||||
|
|
||||||
* Makefile.in: Remove obsolete rules for history.info and
|
* Makefile.in: Remove obsolete rules for history.info and
|
||||||
|
|
|
@ -4,37 +4,9 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* Getting the correct definition of HAVE_STRING_H is harder than just
|
|
||||||
declaring them ourselves. CYGNUS LOCAL. */
|
|
||||||
#if defined (HAVE_STRING_H)
|
|
||||||
# include <string.h>
|
|
||||||
#else
|
|
||||||
# include <strings.h>
|
|
||||||
#endif /* HAVE_STRING_H */
|
|
||||||
#else /* not 0 */
|
|
||||||
/* We don't worry about declaring functions where we don't use the return
|
|
||||||
value (e.g. strcpy) or which return int. */
|
|
||||||
extern char *strrchr ();
|
|
||||||
#endif /* not 0 */
|
|
||||||
|
|
||||||
#ifndef savestring
|
#ifndef savestring
|
||||||
#if 0
|
#define savestring(X) _rl_savestring(X)
|
||||||
|
extern char * _rl_savestring ();
|
||||||
/* CYGNUS LOCAL--this declaration loses if xmalloc has already been
|
|
||||||
declared as void *xmalloc (), as in GDB. The whole concept of
|
|
||||||
readline using xmalloc rather than just returning NULL when it runs
|
|
||||||
out of memory is questionable, but if we do want xmalloc we need a
|
|
||||||
better way to declare it (e.g. the client declares it, or the client
|
|
||||||
calls a rl_register_xmalloc function analagous to the way signal()
|
|
||||||
works. */
|
|
||||||
|
|
||||||
extern char *xmalloc ();
|
|
||||||
#endif
|
|
||||||
# ifndef strcpy
|
|
||||||
extern char *strcpy ();
|
|
||||||
# endif
|
|
||||||
#define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef whitespace
|
#ifndef whitespace
|
||||||
|
|
|
@ -41,10 +41,10 @@ extern int readline_echoing_p;
|
||||||
extern char *term_clreol, *term_im, *term_ic, *term_ei, *term_DC;
|
extern char *term_clreol, *term_im, *term_ic, *term_ei, *term_DC;
|
||||||
/* Termcap variables. */
|
/* Termcap variables. */
|
||||||
extern char *term_up, *term_dc, *term_cr, *term_IC;
|
extern char *term_up, *term_dc, *term_cr, *term_IC;
|
||||||
extern int screenheight, screenwidth, terminal_can_insert;
|
extern int screenheight, screenwidth, terminal_can_insert, term_xn;
|
||||||
|
|
||||||
extern void _rl_output_some_chars ();
|
extern void _rl_output_some_chars ();
|
||||||
extern void _rl_output_character_function ();
|
extern int _rl_output_character_function ();
|
||||||
|
|
||||||
extern int _rl_convert_meta_chars_to_ascii;
|
extern int _rl_convert_meta_chars_to_ascii;
|
||||||
extern int _rl_horizontal_scroll_mode;
|
extern int _rl_horizontal_scroll_mode;
|
||||||
|
@ -75,11 +75,7 @@ extern char *xmalloc (), *xrealloc ();
|
||||||
|
|
||||||
update_line and the code that calls it makes a multiple line,
|
update_line and the code that calls it makes a multiple line,
|
||||||
automatically wrapping line update. Carefull attention needs
|
automatically wrapping line update. Carefull attention needs
|
||||||
to be paid to the vertical position variables.
|
to be paid to the vertical position variables. */
|
||||||
|
|
||||||
handling of terminals with autowrap on (incl. DEC braindamage)
|
|
||||||
could be improved a bit. Right now I just cheat and decrement
|
|
||||||
screenwidth by one. */
|
|
||||||
|
|
||||||
/* Keep two buffers; one which reflects the current contents of the
|
/* Keep two buffers; one which reflects the current contents of the
|
||||||
screen, and the other to draw what we think the new contents should
|
screen, and the other to draw what we think the new contents should
|
||||||
|
@ -240,7 +236,7 @@ rl_redisplay ()
|
||||||
|
|
||||||
/* PWP: now is when things get a bit hairy. The visible and invisible
|
/* PWP: now is when things get a bit hairy. The visible and invisible
|
||||||
line buffers are really multiple lines, which would wrap every
|
line buffers are really multiple lines, which would wrap every
|
||||||
(screenwidth - 1) characters. Go through each in turn, finding
|
screenwidth characters. Go through each in turn, finding
|
||||||
the changed region and updating it. The line order is top to bottom. */
|
the changed region and updating it. The line order is top to bottom. */
|
||||||
|
|
||||||
/* If we can move the cursor up and down, then use multiple lines,
|
/* If we can move the cursor up and down, then use multiple lines,
|
||||||
|
@ -363,6 +359,15 @@ update_line (old, new, current_line)
|
||||||
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
|
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
|
||||||
int lendiff, wsatend;
|
int lendiff, wsatend;
|
||||||
|
|
||||||
|
if (_rl_last_c_pos == screenwidth && term_xn && new[0])
|
||||||
|
{
|
||||||
|
putc (new[0], rl_outstream);
|
||||||
|
_rl_last_c_pos = 1;
|
||||||
|
_rl_last_v_pos++;
|
||||||
|
if (old[0])
|
||||||
|
old[0] = new[0];
|
||||||
|
}
|
||||||
|
|
||||||
/* Find first difference. */
|
/* Find first difference. */
|
||||||
for (ofd = old, nfd = new;
|
for (ofd = old, nfd = new;
|
||||||
(ofd - old < screenwidth) && *ofd && (*ofd == *nfd);
|
(ofd - old < screenwidth) && *ofd && (*ofd == *nfd);
|
||||||
|
|
|
@ -88,7 +88,7 @@ extern int rl_complete_with_tilde_expansion;
|
||||||
/* Forward declarations used in this file. */
|
/* Forward declarations used in this file. */
|
||||||
void rl_dispatch ();
|
void rl_dispatch ();
|
||||||
void free_history_entry ();
|
void free_history_entry ();
|
||||||
void _rl_output_character_function ();
|
int _rl_output_character_function ();
|
||||||
void _rl_set_screen_size ();
|
void _rl_set_screen_size ();
|
||||||
|
|
||||||
#if !defined (_GO32_)
|
#if !defined (_GO32_)
|
||||||
|
@ -224,6 +224,8 @@ static int defining_kbd_macro = 0;
|
||||||
emacs_meta_keymap or vi_escape_keymap. */
|
emacs_meta_keymap or vi_escape_keymap. */
|
||||||
int _rl_convert_meta_chars_to_ascii = 1;
|
int _rl_convert_meta_chars_to_ascii = 1;
|
||||||
|
|
||||||
|
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
|
||||||
|
the undo list. */
|
||||||
static int doing_an_undo;
|
static int doing_an_undo;
|
||||||
|
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
|
@ -1235,7 +1237,7 @@ init_terminal_io (terminal_name)
|
||||||
|
|
||||||
screenwidth = screenheight = 0;
|
screenwidth = screenheight = 0;
|
||||||
|
|
||||||
term_xn = tgetflag ("am", &buffer) && tgetflag ("xn", &buffer);
|
term_xn = tgetflag ("am") && tgetflag ("xn");
|
||||||
|
|
||||||
_rl_set_screen_size (tty, 0);
|
_rl_set_screen_size (tty, 0);
|
||||||
|
|
||||||
|
@ -1319,11 +1321,11 @@ init_terminal_io (terminal_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A function for the use of tputs () */
|
/* A function for the use of tputs () */
|
||||||
void
|
int
|
||||||
_rl_output_character_function (c)
|
_rl_output_character_function (c)
|
||||||
int c;
|
int c;
|
||||||
{
|
{
|
||||||
putc (c, out_stream);
|
return putc (c, out_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write COUNT characters from STRING to the output stream. */
|
/* Write COUNT characters from STRING to the output stream. */
|
||||||
|
@ -2277,10 +2279,6 @@ rl_transpose_chars (count)
|
||||||
/* */
|
/* */
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
|
|
||||||
/* Non-zero tells rl_delete_text and rl_insert_text to not add to
|
|
||||||
the undo list. */
|
|
||||||
static int doing_an_undo = 0;
|
|
||||||
|
|
||||||
/* The current undo list for THE_LINE. */
|
/* The current undo list for THE_LINE. */
|
||||||
UNDO_LIST *rl_undo_list = (UNDO_LIST *)NULL;
|
UNDO_LIST *rl_undo_list = (UNDO_LIST *)NULL;
|
||||||
|
|
||||||
|
@ -3063,6 +3061,15 @@ rl_getc (stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
_rl_savestring (str)
|
||||||
|
char *str;
|
||||||
|
{
|
||||||
|
char *copy = (char*) xmalloc (strlen (str) + 1);
|
||||||
|
strcpy (copy, str);
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined (STATIC_MALLOC)
|
#if defined (STATIC_MALLOC)
|
||||||
|
|
||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
|
|
|
@ -49,13 +49,15 @@
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
|
|
||||||
/* Some USG machines have BSD signal handling (sigblock, sigsetmask, etc.) */
|
/* Some USG machines have BSD signal handling (sigblock, sigsetmask, etc.) */
|
||||||
#if defined (USG) && !defined (hpux)
|
/* CYGNUS LOCAL accept __hpux as well as hpux for HP compiler in ANSI mode. */
|
||||||
|
#if defined (USG) && !(defined (hpux) || defined (__hpux))
|
||||||
# undef HAVE_BSD_SIGNALS
|
# undef HAVE_BSD_SIGNALS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* System V machines use termio. */
|
/* System V machines use termio. */
|
||||||
#if !defined (_POSIX_VERSION)
|
#if !defined (_POSIX_VERSION)
|
||||||
# if defined (USG) || defined (hpux) || defined (Xenix) || defined (sgi) || defined (DGUX)
|
/* CYGNUS LOCAL accept __hpux as well as hpux for HP compiler in ANSI mode. */
|
||||||
|
# if defined (USG) || defined (hpux) || defined (__hpux) || defined (Xenix) || defined (sgi) || defined (DGUX)
|
||||||
# undef NEW_TTY_DRIVER
|
# undef NEW_TTY_DRIVER
|
||||||
# define TERMIO_TTY_DRIVER
|
# define TERMIO_TTY_DRIVER
|
||||||
# include <termio.h>
|
# include <termio.h>
|
||||||
|
@ -150,21 +152,6 @@
|
||||||
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Decide which flavor of the header file describing the C library
|
|
||||||
string functions to include and include it. */
|
|
||||||
|
|
||||||
#if defined (USG) || defined (NeXT)
|
|
||||||
# if !defined (HAVE_STRING_H)
|
|
||||||
# define HAVE_STRING_H
|
|
||||||
# endif /* !HAVE_STRING_H */
|
|
||||||
#endif /* USG || NeXT */
|
|
||||||
|
|
||||||
#if defined (HAVE_STRING_H)
|
|
||||||
# include <string.h>
|
|
||||||
#else /* !HAVE_STRING_H */
|
|
||||||
# include <strings.h>
|
|
||||||
#endif /* !HAVE_STRING_H */
|
|
||||||
|
|
||||||
#if !defined (strchr) && !defined (__STDC__)
|
#if !defined (strchr) && !defined (__STDC__)
|
||||||
extern char *strchr (), *strrchr ();
|
extern char *strchr (), *strrchr ();
|
||||||
#endif /* !strchr && !__STDC__ */
|
#endif /* !strchr && !__STDC__ */
|
||||||
|
|
Loading…
Reference in a new issue