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
28067821
Kaydet (Commit)
28067821
authored
Tem 06, 2000
tarafından
Skip Montanaro
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
added read_history_file and write_history_file
XXX should perhaps support history truncation as well
üst
aa7524cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
readline.c
Modules/readline.c
+50
-0
No files found.
Modules/readline.c
Dosyayı görüntüle @
28067821
...
...
@@ -94,6 +94,54 @@ The default filename is the last filename used.\
"
;
/* Exported function to load a readline history file */
static
PyObject
*
read_history_file
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
{
char
*
s
=
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"|z:read_history_file"
,
&
s
))
return
NULL
;
errno
=
read_history
(
s
);
if
(
errno
)
return
PyErr_SetFromErrno
(
PyExc_IOError
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
char
doc_read_history_file
[]
=
"\
read_history_file([filename]) -> None
\n
\
Load a readline history file.
\n
\
The default filename is ~/.history.\
"
;
/* Exported function to save a readline history file */
static
PyObject
*
write_history_file
(
self
,
args
)
PyObject
*
self
;
PyObject
*
args
;
{
char
*
s
=
NULL
;
if
(
!
PyArg_ParseTuple
(
args
,
"|z:write_history_file"
,
&
s
))
return
NULL
;
errno
=
write_history
(
s
);
if
(
errno
)
return
PyErr_SetFromErrno
(
PyExc_IOError
);
Py_INCREF
(
Py_None
);
return
Py_None
;
}
static
char
doc_write_history_file
[]
=
"\
write_history_file([filename]) -> None
\n
\
Save a readline history file.
\n
\
The default filename is ~/.history.\
"
;
/* Exported function to specify a word completer in Python */
static
PyObject
*
completer
=
NULL
;
...
...
@@ -261,6 +309,8 @@ static struct PyMethodDef readline_methods[] =
{
"get_line_buffer"
,
get_line_buffer
,
0
,
doc_get_line_buffer
},
{
"insert_text"
,
insert_text
,
1
,
doc_insert_text
},
{
"read_init_file"
,
read_init_file
,
1
,
doc_read_init_file
},
{
"read_history_file"
,
read_history_file
,
1
,
doc_read_history_file
},
{
"write_history_file"
,
write_history_file
,
1
,
doc_write_history_file
},
{
"set_completer"
,
set_completer
,
1
,
doc_set_completer
},
{
"get_begidx"
,
get_begidx
,
0
,
doc_get_begidx
},
{
"get_endidx"
,
get_endidx
,
0
,
doc_get_endidx
},
...
...
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