Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
717c6f95
Kaydet (Commit)
717c6f95
authored
Agu 05, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move GNU readline interface to ../Modules/readline.c.
Add Py_input_hook (used by _tkinter and perhaps Gist).
üst
0969d362
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
78 deletions
+3
-78
myreadline.c
Parser/myreadline.c
+3
-78
No files found.
Parser/myreadline.c
Dosyayı görüntüle @
717c6f95
...
...
@@ -51,79 +51,7 @@ PERFORMANCE OF THIS SOFTWARE.
#include "mymalloc.h"
#include "intrcheck.h"
#ifdef WITH_READLINE
extern
char
*
readline
();
extern
int
rl_initialize
();
extern
int
rl_insert
();
extern
int
rl_bind_key
();
extern
void
add_history
();
extern
char
*
rl_readline_name
;
#include <setjmp.h>
#include <signal.h>
static
jmp_buf
jbuf
;
/* ARGSUSED */
static
RETSIGTYPE
onintr
(
sig
)
int
sig
;
{
longjmp
(
jbuf
,
1
);
}
void
PyOS_ReadlineInit
()
{
static
int
been_here
;
if
(
!
been_here
)
{
/* Force rebind of TAB to insert-tab */
rl_readline_name
=
"python"
;
rl_initialize
();
rl_bind_key
(
'\t'
,
rl_insert
);
been_here
++
;
}
}
char
*
PyOS_GnuReadline
(
prompt
)
char
*
prompt
;
{
int
n
;
char
*
p
;
RETSIGTYPE
(
*
old_inthandler
)();
PyOS_ReadlineInit
();
old_inthandler
=
signal
(
SIGINT
,
onintr
);
if
(
setjmp
(
jbuf
))
{
#ifdef HAVE_SIGRELSE
/* This seems necessary on SunOS 4.1 (Rasmus Hahn) */
sigrelse
(
SIGINT
);
#endif
signal
(
SIGINT
,
old_inthandler
);
return
NULL
;
}
p
=
readline
(
prompt
);
signal
(
SIGINT
,
old_inthandler
);
if
(
p
==
NULL
)
{
p
=
malloc
(
1
);
if
(
p
!=
NULL
)
*
p
=
'\0'
;
return
p
;
}
n
=
strlen
(
p
);
if
(
n
>
0
)
add_history
(
p
);
if
((
p
=
realloc
(
p
,
n
+
2
))
!=
NULL
)
{
p
[
n
]
=
'\n'
;
p
[
n
+
1
]
=
'\0'
;
}
return
p
;
}
#endif
/* !WITH_READLINE */
int
(
*
Py_input_hook
)()
=
NULL
;
/* This function restarts a fgets() after an EINTR error occurred
except if PyOS_InterruptOccurred() returns true. */
...
...
@@ -136,6 +64,8 @@ my_fgets(buf, len, fp)
{
char
*
p
;
for
(;;)
{
if
(
Py_input_hook
!=
NULL
)
(
void
)(
Py_input_hook
)();
errno
=
0
;
p
=
fgets
(
buf
,
len
,
fp
);
if
(
p
!=
NULL
)
...
...
@@ -221,11 +151,6 @@ PyOS_Readline(prompt)
char
*
prompt
;
{
if
(
PyOS_ReadlineFunctionPointer
==
NULL
)
{
#ifdef WITH_READLINE
if
(
isatty
(
fileno
(
stdin
)))
PyOS_ReadlineFunctionPointer
=
PyOS_GnuReadline
;
else
#endif
PyOS_ReadlineFunctionPointer
=
PyOS_StdioReadline
;
}
return
(
*
PyOS_ReadlineFunctionPointer
)(
prompt
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment