diff options
Diffstat (limited to 'examples/rlfe')
-rw-r--r-- | examples/rlfe/Makefile.in | 2 | ||||
-rw-r--r-- | examples/rlfe/config.h.in | 4 | ||||
-rw-r--r-- | examples/rlfe/configure.in | 2 | ||||
-rw-r--r-- | examples/rlfe/extern.h | 9 | ||||
-rw-r--r-- | examples/rlfe/pty.c | 7 | ||||
-rw-r--r-- | examples/rlfe/rlfe.c | 13 |
6 files changed, 28 insertions, 9 deletions
diff --git a/examples/rlfe/Makefile.in b/examples/rlfe/Makefile.in index 70aa6b3..1b49ab9 100644 --- a/examples/rlfe/Makefile.in +++ b/examples/rlfe/Makefile.in @@ -25,7 +25,7 @@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ #LDFLAGS = -L$(READLINE_DIR) LDFLAGS = @LDFLAGS@ -LIBS = -lreadline -lhistory -lncurses @LIBS@ +LIBS = -lreadline -lhistory @LIBS@ CPP=@CPP@ CPP_DEPEND=$(CC) -MM diff --git a/examples/rlfe/config.h.in b/examples/rlfe/config.h.in index 587cee2..ad546b8 100644 --- a/examples/rlfe/config.h.in +++ b/examples/rlfe/config.h.in @@ -373,3 +373,7 @@ #undef PTYRANGE1 #define USEVARARGS + +#undef HAVE_SYS_STROPTS_H + +#undef HAVE_SYS_WAIT_H diff --git a/examples/rlfe/configure.in b/examples/rlfe/configure.in index ad68541..533f9dc 100644 --- a/examples/rlfe/configure.in +++ b/examples/rlfe/configure.in @@ -435,4 +435,6 @@ main() fi +AC_CHECK_HEADERS(sys/stropts.h sys/wait.h) + AC_OUTPUT(Makefile) diff --git a/examples/rlfe/extern.h b/examples/rlfe/extern.h index 37d4275..2fe5025 100644 --- a/examples/rlfe/extern.h +++ b/examples/rlfe/extern.h @@ -27,7 +27,14 @@ #define __attribute__(x) #endif +#if !defined (__P) +# if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) +# define __P(protos) protos +# else +# define __P(protos) () +# endif +#endif + /* pty.c */ extern int OpenPTY __P((char **)); extern void InitPTY __P((int)); - diff --git a/examples/rlfe/pty.c b/examples/rlfe/pty.c index f89d44c..5562720 100644 --- a/examples/rlfe/pty.c +++ b/examples/rlfe/pty.c @@ -20,13 +20,15 @@ * **************************************************************** */ +#include "config.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <signal.h> -#include "config.h" +#include <unistd.h> + #include "screen.h" #ifndef sun @@ -34,7 +36,7 @@ #endif /* for solaris 2.1, Unixware (SVR4.2) and possibly others */ -#ifdef HAVE_SVR4_PTYS +#if defined (HAVE_SVR4_PTYS) && defined (HAVE_SYS_STROPTS_H) # include <sys/stropts.h> #endif @@ -384,4 +386,3 @@ char **ttyn; return -1; } #endif - diff --git a/examples/rlfe/rlfe.c b/examples/rlfe/rlfe.c index 6d747dc..eacd5ab 100644 --- a/examples/rlfe/rlfe.c +++ b/examples/rlfe/rlfe.c @@ -73,6 +73,11 @@ #include <termios.h> #include "config.h" +#include "extern.h" + +#if defined (HAVE_SYS_WAIT_H) +# include <sys/wait.h> +#endif #ifdef READLINE_LIBRARY # include "readline.h" @@ -588,7 +593,7 @@ main(int argc, char** argv) } if (FD_ISSET (in_from_tty_fd, &in_set)) { - extern int readline_echoing_p; + extern int _rl_echoing_p; struct termios term_master; int do_canon = 1; int do_icrnl = 1; @@ -605,9 +610,9 @@ main(int argc, char** argv) { do_canon = (term_master.c_lflag & ICANON) != 0; do_icrnl = (term_master.c_lflag & ICRNL) != 0; - readline_echoing_p = (term_master.c_lflag & ECHO) != 0; + _rl_echoing_p = (term_master.c_lflag & ECHO) != 0; DPRINT1 ("echo,canon,crnl:%03d\n", - 100 * readline_echoing_p + 100 * _rl_echoing_p + 10 * do_canon + 1 * do_icrnl); } @@ -757,7 +762,7 @@ static void set_edit_mode () vi = 1; break; } - shellopts = index (shellopts + 1, ':'); + shellopts = strchr (shellopts + 1, ':'); } if (!vi) |