diff options
author | Mark H Weaver <mhw@netris.org> | 2013-03-28 05:09:53 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-03-28 05:09:53 -0400 |
commit | 26d148066f9cb20e395a7dc4fefdf2e2ef0b2fb0 (patch) | |
tree | 40f13bc6355adb822bb8cd01fee5bcd9fd5430f9 /guile-readline | |
parent | 8ae26afefee947c71314733c419519fb616bf36d (diff) | |
parent | 579127cce488ce208d62e68e679e34fbbdc17367 (diff) |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
configure.ac
libguile/deprecated.c
libguile/deprecated.h
libguile/filesys.h
libguile/fluids.c
libguile/fports.c
libguile/gc.c
libguile/guile.c
libguile/numbers.c
libguile/objcodes.c
libguile/r6rs-ports.c
libguile/smob.c
libguile/socket.c
libguile/threads.h
module/language/scheme/decompile-tree-il.scm
module/language/tree-il/peval.scm
test-suite/tests/syncase.test
Diffstat (limited to 'guile-readline')
-rw-r--r-- | guile-readline/readline.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/guile-readline/readline.c b/guile-readline/readline.c index 1e697eb5d..aac6e18c2 100644 --- a/guile-readline/readline.c +++ b/guile-readline/readline.c @@ -1,6 +1,7 @@ /* readline.c --- line editing support for Guile */ -/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007, 2008, 2009, 2010, 2013 Free Software Foundation, Inc. +/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007, 2008, + * 2009, 2010, 2013 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,19 +28,13 @@ #ifdef HAVE_RL_GETC_FUNCTION #include "libguile.h" -#include "libguile/iselect.h" #include <stdio.h> -#ifdef HAVE_UNISTD_H #include <unistd.h> -#endif #include <readline/readline.h> #include <readline/history.h> -#ifndef __MINGW32__ #include <sys/time.h> -#else -#include <io.h> -#endif +#include <sys/select.h> #include <signal.h> #include "libguile/validate.h" @@ -207,10 +202,8 @@ SCM_DEFINE (scm_readline, "%readline", 0, 4, 0, scm_dynwind_end (); -#ifndef __MINGW32__ fclose (rl_instream); fclose (rl_outstream); -#endif --in_readline; return ans; @@ -240,10 +233,8 @@ unwind_readline (void *unused) rl_free_line_state (); rl_cleanup_after_signal (); fputc ('\n', rl_outstream); /* We don't want next output on this line */ -#ifndef __MINGW32__ fclose (rl_instream); fclose (rl_outstream); -#endif --in_readline; } @@ -314,10 +305,8 @@ scm_readline_init_ports (SCM inp, SCM outp) input_port = inp; output_port = outp; -#ifndef __MINGW32__ rl_instream = stream_from_fport (inp, "r", s_scm_readline); rl_outstream = stream_from_fport (outp, "w", s_scm_readline); -#endif } @@ -489,11 +478,9 @@ static int match_paren (int x, int k) { int tmp; -#ifndef __MINGW32__ int fno; - SELECT_TYPE readset; + fd_set readset; struct timeval timeout; -#endif rl_insert (x, k); if (!SCM_READLINE_BOUNCE_PARENS) @@ -504,14 +491,12 @@ match_paren (int x, int k) && rl_line_buffer[rl_point - 2] == '\\') return 0; -#ifndef __MINGW32__ tmp = 1000 * SCM_READLINE_BOUNCE_PARENS; timeout.tv_sec = tmp / 1000000; timeout.tv_usec = tmp % 1000000; FD_ZERO (&readset); fno = fileno (rl_instream); FD_SET (fno, &readset); -#endif if (rl_point > 1) { @@ -520,12 +505,7 @@ match_paren (int x, int k) if (rl_point > -1) { rl_redisplay (); -#ifndef __MINGW32__ - scm_std_select (fno + 1, &readset, NULL, NULL, &timeout); -#else - WaitForSingleObject (GetStdHandle(STD_INPUT_HANDLE), - SCM_READLINE_BOUNCE_PARENS); -#endif + select (fno + 1, &readset, NULL, NULL, &timeout); } rl_point = tmp; } @@ -542,9 +522,7 @@ scm_init_readline () #include "guile-readline/readline.x" scm_readline_completion_function_var = scm_c_define ("*readline-completion-function*", SCM_BOOL_F); -#ifndef __MINGW32__ rl_getc_function = current_input_getc; -#endif #if defined (_RL_FUNCTION_TYPEDEF) rl_completion_entry_function = (rl_compentry_func_t*) completion_function; #else |