summaryrefslogtreecommitdiffstats
path: root/Parser/myreadline.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-04-09 02:45:31 (GMT)
committerGuido van Rossum <guido@python.org>1996-04-09 02:45:31 (GMT)
commitadf876938a242dc7b476d82565b968471c2919b3 (patch)
tree23b09cc411a0fbbc0bfa1bb2fbe522799cd9e0a7 /Parser/myreadline.c
parentd17057745c1dc58ec6e245991fd049fd987c6895 (diff)
downloadcpython-adf876938a242dc7b476d82565b968471c2919b3.zip
cpython-adf876938a242dc7b476d82565b968471c2919b3.tar.gz
cpython-adf876938a242dc7b476d82565b968471c2919b3.tar.bz2
Separate readline initialization into new function PyOS_ReadlineInit().
For Dave Ascher's readline extensions.
Diffstat (limited to 'Parser/myreadline.c')
-rw-r--r--Parser/myreadline.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index dd00077..99ae6ac 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -100,14 +100,9 @@ my_fgets(buf, len, fp)
#endif /* WITH_READLINE */
-char *
-my_readline(prompt)
- char *prompt;
+void
+PyOS_ReadlineInit()
{
- int n;
- char *p;
-#ifdef WITH_READLINE
- RETSIGTYPE (*old_inthandler)();
static int been_here;
if (!been_here) {
/* Force rebind of TAB to insert-tab */
@@ -115,6 +110,18 @@ my_readline(prompt)
rl_bind_key('\t', rl_insert);
been_here++;
}
+}
+
+
+char *
+my_readline(prompt)
+ char *prompt;
+{
+ int n;
+ char *p;
+#ifdef WITH_READLINE
+ RETSIGTYPE (*old_inthandler)();
+ PyOS_ReadlineInit();
old_inthandler = signal(SIGINT, onintr);
if (setjmp(jbuf)) {
#ifdef HAVE_SIGRELSE