• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 #include "pycore_modsupport.h"    // _PyArg_CheckPositional()
6 
7 PyDoc_STRVAR(readline_parse_and_bind__doc__,
8 "parse_and_bind($module, string, /)\n"
9 "--\n"
10 "\n"
11 "Execute the init line provided in the string argument.");
12 
13 #define READLINE_PARSE_AND_BIND_METHODDEF    \
14     {"parse_and_bind", (PyCFunction)readline_parse_and_bind, METH_O, readline_parse_and_bind__doc__},
15 
16 PyDoc_STRVAR(readline_read_init_file__doc__,
17 "read_init_file($module, filename=None, /)\n"
18 "--\n"
19 "\n"
20 "Execute a readline initialization file.\n"
21 "\n"
22 "The default filename is the last filename used.");
23 
24 #define READLINE_READ_INIT_FILE_METHODDEF    \
25     {"read_init_file", _PyCFunction_CAST(readline_read_init_file), METH_FASTCALL, readline_read_init_file__doc__},
26 
27 static PyObject *
28 readline_read_init_file_impl(PyObject *module, PyObject *filename_obj);
29 
30 static PyObject *
readline_read_init_file(PyObject * module,PyObject * const * args,Py_ssize_t nargs)31 readline_read_init_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
32 {
33     PyObject *return_value = NULL;
34     PyObject *filename_obj = Py_None;
35 
36     if (!_PyArg_CheckPositional("read_init_file", nargs, 0, 1)) {
37         goto exit;
38     }
39     if (nargs < 1) {
40         goto skip_optional;
41     }
42     filename_obj = args[0];
43 skip_optional:
44     return_value = readline_read_init_file_impl(module, filename_obj);
45 
46 exit:
47     return return_value;
48 }
49 
50 PyDoc_STRVAR(readline_read_history_file__doc__,
51 "read_history_file($module, filename=None, /)\n"
52 "--\n"
53 "\n"
54 "Load a readline history file.\n"
55 "\n"
56 "The default filename is ~/.history.");
57 
58 #define READLINE_READ_HISTORY_FILE_METHODDEF    \
59     {"read_history_file", _PyCFunction_CAST(readline_read_history_file), METH_FASTCALL, readline_read_history_file__doc__},
60 
61 static PyObject *
62 readline_read_history_file_impl(PyObject *module, PyObject *filename_obj);
63 
64 static PyObject *
readline_read_history_file(PyObject * module,PyObject * const * args,Py_ssize_t nargs)65 readline_read_history_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
66 {
67     PyObject *return_value = NULL;
68     PyObject *filename_obj = Py_None;
69 
70     if (!_PyArg_CheckPositional("read_history_file", nargs, 0, 1)) {
71         goto exit;
72     }
73     if (nargs < 1) {
74         goto skip_optional;
75     }
76     filename_obj = args[0];
77 skip_optional:
78     return_value = readline_read_history_file_impl(module, filename_obj);
79 
80 exit:
81     return return_value;
82 }
83 
84 PyDoc_STRVAR(readline_write_history_file__doc__,
85 "write_history_file($module, filename=None, /)\n"
86 "--\n"
87 "\n"
88 "Save a readline history file.\n"
89 "\n"
90 "The default filename is ~/.history.");
91 
92 #define READLINE_WRITE_HISTORY_FILE_METHODDEF    \
93     {"write_history_file", _PyCFunction_CAST(readline_write_history_file), METH_FASTCALL, readline_write_history_file__doc__},
94 
95 static PyObject *
96 readline_write_history_file_impl(PyObject *module, PyObject *filename_obj);
97 
98 static PyObject *
readline_write_history_file(PyObject * module,PyObject * const * args,Py_ssize_t nargs)99 readline_write_history_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
100 {
101     PyObject *return_value = NULL;
102     PyObject *filename_obj = Py_None;
103 
104     if (!_PyArg_CheckPositional("write_history_file", nargs, 0, 1)) {
105         goto exit;
106     }
107     if (nargs < 1) {
108         goto skip_optional;
109     }
110     filename_obj = args[0];
111 skip_optional:
112     return_value = readline_write_history_file_impl(module, filename_obj);
113 
114 exit:
115     return return_value;
116 }
117 
118 #if defined(HAVE_RL_APPEND_HISTORY)
119 
120 PyDoc_STRVAR(readline_append_history_file__doc__,
121 "append_history_file($module, nelements, filename=None, /)\n"
122 "--\n"
123 "\n"
124 "Append the last nelements items of the history list to file.\n"
125 "\n"
126 "The default filename is ~/.history.");
127 
128 #define READLINE_APPEND_HISTORY_FILE_METHODDEF    \
129     {"append_history_file", _PyCFunction_CAST(readline_append_history_file), METH_FASTCALL, readline_append_history_file__doc__},
130 
131 static PyObject *
132 readline_append_history_file_impl(PyObject *module, int nelements,
133                                   PyObject *filename_obj);
134 
135 static PyObject *
readline_append_history_file(PyObject * module,PyObject * const * args,Py_ssize_t nargs)136 readline_append_history_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
137 {
138     PyObject *return_value = NULL;
139     int nelements;
140     PyObject *filename_obj = Py_None;
141 
142     if (!_PyArg_CheckPositional("append_history_file", nargs, 1, 2)) {
143         goto exit;
144     }
145     nelements = PyLong_AsInt(args[0]);
146     if (nelements == -1 && PyErr_Occurred()) {
147         goto exit;
148     }
149     if (nargs < 2) {
150         goto skip_optional;
151     }
152     filename_obj = args[1];
153 skip_optional:
154     return_value = readline_append_history_file_impl(module, nelements, filename_obj);
155 
156 exit:
157     return return_value;
158 }
159 
160 #endif /* defined(HAVE_RL_APPEND_HISTORY) */
161 
162 PyDoc_STRVAR(readline_set_history_length__doc__,
163 "set_history_length($module, length, /)\n"
164 "--\n"
165 "\n"
166 "Set the maximal number of lines which will be written to the history file.\n"
167 "\n"
168 "A negative length is used to inhibit history truncation.");
169 
170 #define READLINE_SET_HISTORY_LENGTH_METHODDEF    \
171     {"set_history_length", (PyCFunction)readline_set_history_length, METH_O, readline_set_history_length__doc__},
172 
173 static PyObject *
174 readline_set_history_length_impl(PyObject *module, int length);
175 
176 static PyObject *
readline_set_history_length(PyObject * module,PyObject * arg)177 readline_set_history_length(PyObject *module, PyObject *arg)
178 {
179     PyObject *return_value = NULL;
180     int length;
181 
182     length = PyLong_AsInt(arg);
183     if (length == -1 && PyErr_Occurred()) {
184         goto exit;
185     }
186     return_value = readline_set_history_length_impl(module, length);
187 
188 exit:
189     return return_value;
190 }
191 
192 PyDoc_STRVAR(readline_get_history_length__doc__,
193 "get_history_length($module, /)\n"
194 "--\n"
195 "\n"
196 "Return the maximum number of lines that will be written to the history file.");
197 
198 #define READLINE_GET_HISTORY_LENGTH_METHODDEF    \
199     {"get_history_length", (PyCFunction)readline_get_history_length, METH_NOARGS, readline_get_history_length__doc__},
200 
201 static PyObject *
202 readline_get_history_length_impl(PyObject *module);
203 
204 static PyObject *
readline_get_history_length(PyObject * module,PyObject * Py_UNUSED (ignored))205 readline_get_history_length(PyObject *module, PyObject *Py_UNUSED(ignored))
206 {
207     return readline_get_history_length_impl(module);
208 }
209 
210 PyDoc_STRVAR(readline_set_completion_display_matches_hook__doc__,
211 "set_completion_display_matches_hook($module, function=None, /)\n"
212 "--\n"
213 "\n"
214 "Set or remove the completion display function.\n"
215 "\n"
216 "The function is called as\n"
217 "  function(substitution, [matches], longest_match_length)\n"
218 "once each time matches need to be displayed.");
219 
220 #define READLINE_SET_COMPLETION_DISPLAY_MATCHES_HOOK_METHODDEF    \
221     {"set_completion_display_matches_hook", _PyCFunction_CAST(readline_set_completion_display_matches_hook), METH_FASTCALL, readline_set_completion_display_matches_hook__doc__},
222 
223 static PyObject *
224 readline_set_completion_display_matches_hook_impl(PyObject *module,
225                                                   PyObject *function);
226 
227 static PyObject *
readline_set_completion_display_matches_hook(PyObject * module,PyObject * const * args,Py_ssize_t nargs)228 readline_set_completion_display_matches_hook(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
229 {
230     PyObject *return_value = NULL;
231     PyObject *function = Py_None;
232 
233     if (!_PyArg_CheckPositional("set_completion_display_matches_hook", nargs, 0, 1)) {
234         goto exit;
235     }
236     if (nargs < 1) {
237         goto skip_optional;
238     }
239     function = args[0];
240 skip_optional:
241     return_value = readline_set_completion_display_matches_hook_impl(module, function);
242 
243 exit:
244     return return_value;
245 }
246 
247 PyDoc_STRVAR(readline_set_startup_hook__doc__,
248 "set_startup_hook($module, function=None, /)\n"
249 "--\n"
250 "\n"
251 "Set or remove the function invoked by the rl_startup_hook callback.\n"
252 "\n"
253 "The function is called with no arguments just\n"
254 "before readline prints the first prompt.");
255 
256 #define READLINE_SET_STARTUP_HOOK_METHODDEF    \
257     {"set_startup_hook", _PyCFunction_CAST(readline_set_startup_hook), METH_FASTCALL, readline_set_startup_hook__doc__},
258 
259 static PyObject *
260 readline_set_startup_hook_impl(PyObject *module, PyObject *function);
261 
262 static PyObject *
readline_set_startup_hook(PyObject * module,PyObject * const * args,Py_ssize_t nargs)263 readline_set_startup_hook(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
264 {
265     PyObject *return_value = NULL;
266     PyObject *function = Py_None;
267 
268     if (!_PyArg_CheckPositional("set_startup_hook", nargs, 0, 1)) {
269         goto exit;
270     }
271     if (nargs < 1) {
272         goto skip_optional;
273     }
274     function = args[0];
275 skip_optional:
276     return_value = readline_set_startup_hook_impl(module, function);
277 
278 exit:
279     return return_value;
280 }
281 
282 #if defined(HAVE_RL_PRE_INPUT_HOOK)
283 
284 PyDoc_STRVAR(readline_set_pre_input_hook__doc__,
285 "set_pre_input_hook($module, function=None, /)\n"
286 "--\n"
287 "\n"
288 "Set or remove the function invoked by the rl_pre_input_hook callback.\n"
289 "\n"
290 "The function is called with no arguments after the first prompt\n"
291 "has been printed and just before readline starts reading input\n"
292 "characters.");
293 
294 #define READLINE_SET_PRE_INPUT_HOOK_METHODDEF    \
295     {"set_pre_input_hook", _PyCFunction_CAST(readline_set_pre_input_hook), METH_FASTCALL, readline_set_pre_input_hook__doc__},
296 
297 static PyObject *
298 readline_set_pre_input_hook_impl(PyObject *module, PyObject *function);
299 
300 static PyObject *
readline_set_pre_input_hook(PyObject * module,PyObject * const * args,Py_ssize_t nargs)301 readline_set_pre_input_hook(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
302 {
303     PyObject *return_value = NULL;
304     PyObject *function = Py_None;
305 
306     if (!_PyArg_CheckPositional("set_pre_input_hook", nargs, 0, 1)) {
307         goto exit;
308     }
309     if (nargs < 1) {
310         goto skip_optional;
311     }
312     function = args[0];
313 skip_optional:
314     return_value = readline_set_pre_input_hook_impl(module, function);
315 
316 exit:
317     return return_value;
318 }
319 
320 #endif /* defined(HAVE_RL_PRE_INPUT_HOOK) */
321 
322 PyDoc_STRVAR(readline_get_completion_type__doc__,
323 "get_completion_type($module, /)\n"
324 "--\n"
325 "\n"
326 "Get the type of completion being attempted.");
327 
328 #define READLINE_GET_COMPLETION_TYPE_METHODDEF    \
329     {"get_completion_type", (PyCFunction)readline_get_completion_type, METH_NOARGS, readline_get_completion_type__doc__},
330 
331 static PyObject *
332 readline_get_completion_type_impl(PyObject *module);
333 
334 static PyObject *
readline_get_completion_type(PyObject * module,PyObject * Py_UNUSED (ignored))335 readline_get_completion_type(PyObject *module, PyObject *Py_UNUSED(ignored))
336 {
337     return readline_get_completion_type_impl(module);
338 }
339 
340 PyDoc_STRVAR(readline_get_begidx__doc__,
341 "get_begidx($module, /)\n"
342 "--\n"
343 "\n"
344 "Get the beginning index of the completion scope.");
345 
346 #define READLINE_GET_BEGIDX_METHODDEF    \
347     {"get_begidx", (PyCFunction)readline_get_begidx, METH_NOARGS, readline_get_begidx__doc__},
348 
349 static PyObject *
350 readline_get_begidx_impl(PyObject *module);
351 
352 static PyObject *
readline_get_begidx(PyObject * module,PyObject * Py_UNUSED (ignored))353 readline_get_begidx(PyObject *module, PyObject *Py_UNUSED(ignored))
354 {
355     return readline_get_begidx_impl(module);
356 }
357 
358 PyDoc_STRVAR(readline_get_endidx__doc__,
359 "get_endidx($module, /)\n"
360 "--\n"
361 "\n"
362 "Get the ending index of the completion scope.");
363 
364 #define READLINE_GET_ENDIDX_METHODDEF    \
365     {"get_endidx", (PyCFunction)readline_get_endidx, METH_NOARGS, readline_get_endidx__doc__},
366 
367 static PyObject *
368 readline_get_endidx_impl(PyObject *module);
369 
370 static PyObject *
readline_get_endidx(PyObject * module,PyObject * Py_UNUSED (ignored))371 readline_get_endidx(PyObject *module, PyObject *Py_UNUSED(ignored))
372 {
373     return readline_get_endidx_impl(module);
374 }
375 
376 PyDoc_STRVAR(readline_set_completer_delims__doc__,
377 "set_completer_delims($module, string, /)\n"
378 "--\n"
379 "\n"
380 "Set the word delimiters for completion.");
381 
382 #define READLINE_SET_COMPLETER_DELIMS_METHODDEF    \
383     {"set_completer_delims", (PyCFunction)readline_set_completer_delims, METH_O, readline_set_completer_delims__doc__},
384 
385 PyDoc_STRVAR(readline_remove_history_item__doc__,
386 "remove_history_item($module, pos, /)\n"
387 "--\n"
388 "\n"
389 "Remove history item given by its zero-based position.");
390 
391 #define READLINE_REMOVE_HISTORY_ITEM_METHODDEF    \
392     {"remove_history_item", (PyCFunction)readline_remove_history_item, METH_O, readline_remove_history_item__doc__},
393 
394 static PyObject *
395 readline_remove_history_item_impl(PyObject *module, int entry_number);
396 
397 static PyObject *
readline_remove_history_item(PyObject * module,PyObject * arg)398 readline_remove_history_item(PyObject *module, PyObject *arg)
399 {
400     PyObject *return_value = NULL;
401     int entry_number;
402 
403     entry_number = PyLong_AsInt(arg);
404     if (entry_number == -1 && PyErr_Occurred()) {
405         goto exit;
406     }
407     return_value = readline_remove_history_item_impl(module, entry_number);
408 
409 exit:
410     return return_value;
411 }
412 
413 PyDoc_STRVAR(readline_replace_history_item__doc__,
414 "replace_history_item($module, pos, line, /)\n"
415 "--\n"
416 "\n"
417 "Replaces history item given by its position with contents of line.\n"
418 "\n"
419 "pos is zero-based.");
420 
421 #define READLINE_REPLACE_HISTORY_ITEM_METHODDEF    \
422     {"replace_history_item", _PyCFunction_CAST(readline_replace_history_item), METH_FASTCALL, readline_replace_history_item__doc__},
423 
424 static PyObject *
425 readline_replace_history_item_impl(PyObject *module, int entry_number,
426                                    PyObject *line);
427 
428 static PyObject *
readline_replace_history_item(PyObject * module,PyObject * const * args,Py_ssize_t nargs)429 readline_replace_history_item(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
430 {
431     PyObject *return_value = NULL;
432     int entry_number;
433     PyObject *line;
434 
435     if (!_PyArg_CheckPositional("replace_history_item", nargs, 2, 2)) {
436         goto exit;
437     }
438     entry_number = PyLong_AsInt(args[0]);
439     if (entry_number == -1 && PyErr_Occurred()) {
440         goto exit;
441     }
442     if (!PyUnicode_Check(args[1])) {
443         _PyArg_BadArgument("replace_history_item", "argument 2", "str", args[1]);
444         goto exit;
445     }
446     line = args[1];
447     return_value = readline_replace_history_item_impl(module, entry_number, line);
448 
449 exit:
450     return return_value;
451 }
452 
453 PyDoc_STRVAR(readline_add_history__doc__,
454 "add_history($module, string, /)\n"
455 "--\n"
456 "\n"
457 "Add an item to the history buffer.");
458 
459 #define READLINE_ADD_HISTORY_METHODDEF    \
460     {"add_history", (PyCFunction)readline_add_history, METH_O, readline_add_history__doc__},
461 
462 PyDoc_STRVAR(readline_set_auto_history__doc__,
463 "set_auto_history($module, enabled, /)\n"
464 "--\n"
465 "\n"
466 "Enables or disables automatic history.");
467 
468 #define READLINE_SET_AUTO_HISTORY_METHODDEF    \
469     {"set_auto_history", (PyCFunction)readline_set_auto_history, METH_O, readline_set_auto_history__doc__},
470 
471 static PyObject *
472 readline_set_auto_history_impl(PyObject *module,
473                                int _should_auto_add_history);
474 
475 static PyObject *
readline_set_auto_history(PyObject * module,PyObject * arg)476 readline_set_auto_history(PyObject *module, PyObject *arg)
477 {
478     PyObject *return_value = NULL;
479     int _should_auto_add_history;
480 
481     _should_auto_add_history = PyObject_IsTrue(arg);
482     if (_should_auto_add_history < 0) {
483         goto exit;
484     }
485     return_value = readline_set_auto_history_impl(module, _should_auto_add_history);
486 
487 exit:
488     return return_value;
489 }
490 
491 PyDoc_STRVAR(readline_get_completer_delims__doc__,
492 "get_completer_delims($module, /)\n"
493 "--\n"
494 "\n"
495 "Get the word delimiters for completion.");
496 
497 #define READLINE_GET_COMPLETER_DELIMS_METHODDEF    \
498     {"get_completer_delims", (PyCFunction)readline_get_completer_delims, METH_NOARGS, readline_get_completer_delims__doc__},
499 
500 static PyObject *
501 readline_get_completer_delims_impl(PyObject *module);
502 
503 static PyObject *
readline_get_completer_delims(PyObject * module,PyObject * Py_UNUSED (ignored))504 readline_get_completer_delims(PyObject *module, PyObject *Py_UNUSED(ignored))
505 {
506     return readline_get_completer_delims_impl(module);
507 }
508 
509 PyDoc_STRVAR(readline_set_completer__doc__,
510 "set_completer($module, function=None, /)\n"
511 "--\n"
512 "\n"
513 "Set or remove the completer function.\n"
514 "\n"
515 "The function is called as function(text, state),\n"
516 "for state in 0, 1, 2, ..., until it returns a non-string.\n"
517 "It should return the next possible completion starting with \'text\'.");
518 
519 #define READLINE_SET_COMPLETER_METHODDEF    \
520     {"set_completer", _PyCFunction_CAST(readline_set_completer), METH_FASTCALL, readline_set_completer__doc__},
521 
522 static PyObject *
523 readline_set_completer_impl(PyObject *module, PyObject *function);
524 
525 static PyObject *
readline_set_completer(PyObject * module,PyObject * const * args,Py_ssize_t nargs)526 readline_set_completer(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
527 {
528     PyObject *return_value = NULL;
529     PyObject *function = Py_None;
530 
531     if (!_PyArg_CheckPositional("set_completer", nargs, 0, 1)) {
532         goto exit;
533     }
534     if (nargs < 1) {
535         goto skip_optional;
536     }
537     function = args[0];
538 skip_optional:
539     return_value = readline_set_completer_impl(module, function);
540 
541 exit:
542     return return_value;
543 }
544 
545 PyDoc_STRVAR(readline_get_completer__doc__,
546 "get_completer($module, /)\n"
547 "--\n"
548 "\n"
549 "Get the current completer function.");
550 
551 #define READLINE_GET_COMPLETER_METHODDEF    \
552     {"get_completer", (PyCFunction)readline_get_completer, METH_NOARGS, readline_get_completer__doc__},
553 
554 static PyObject *
555 readline_get_completer_impl(PyObject *module);
556 
557 static PyObject *
readline_get_completer(PyObject * module,PyObject * Py_UNUSED (ignored))558 readline_get_completer(PyObject *module, PyObject *Py_UNUSED(ignored))
559 {
560     return readline_get_completer_impl(module);
561 }
562 
563 PyDoc_STRVAR(readline_get_history_item__doc__,
564 "get_history_item($module, index, /)\n"
565 "--\n"
566 "\n"
567 "Return the current contents of history item at one-based index.");
568 
569 #define READLINE_GET_HISTORY_ITEM_METHODDEF    \
570     {"get_history_item", (PyCFunction)readline_get_history_item, METH_O, readline_get_history_item__doc__},
571 
572 static PyObject *
573 readline_get_history_item_impl(PyObject *module, int idx);
574 
575 static PyObject *
readline_get_history_item(PyObject * module,PyObject * arg)576 readline_get_history_item(PyObject *module, PyObject *arg)
577 {
578     PyObject *return_value = NULL;
579     int idx;
580 
581     idx = PyLong_AsInt(arg);
582     if (idx == -1 && PyErr_Occurred()) {
583         goto exit;
584     }
585     return_value = readline_get_history_item_impl(module, idx);
586 
587 exit:
588     return return_value;
589 }
590 
591 PyDoc_STRVAR(readline_get_current_history_length__doc__,
592 "get_current_history_length($module, /)\n"
593 "--\n"
594 "\n"
595 "Return the current (not the maximum) length of history.");
596 
597 #define READLINE_GET_CURRENT_HISTORY_LENGTH_METHODDEF    \
598     {"get_current_history_length", (PyCFunction)readline_get_current_history_length, METH_NOARGS, readline_get_current_history_length__doc__},
599 
600 static PyObject *
601 readline_get_current_history_length_impl(PyObject *module);
602 
603 static PyObject *
readline_get_current_history_length(PyObject * module,PyObject * Py_UNUSED (ignored))604 readline_get_current_history_length(PyObject *module, PyObject *Py_UNUSED(ignored))
605 {
606     return readline_get_current_history_length_impl(module);
607 }
608 
609 PyDoc_STRVAR(readline_get_line_buffer__doc__,
610 "get_line_buffer($module, /)\n"
611 "--\n"
612 "\n"
613 "Return the current contents of the line buffer.");
614 
615 #define READLINE_GET_LINE_BUFFER_METHODDEF    \
616     {"get_line_buffer", (PyCFunction)readline_get_line_buffer, METH_NOARGS, readline_get_line_buffer__doc__},
617 
618 static PyObject *
619 readline_get_line_buffer_impl(PyObject *module);
620 
621 static PyObject *
readline_get_line_buffer(PyObject * module,PyObject * Py_UNUSED (ignored))622 readline_get_line_buffer(PyObject *module, PyObject *Py_UNUSED(ignored))
623 {
624     return readline_get_line_buffer_impl(module);
625 }
626 
627 #if defined(HAVE_RL_COMPLETION_APPEND_CHARACTER)
628 
629 PyDoc_STRVAR(readline_clear_history__doc__,
630 "clear_history($module, /)\n"
631 "--\n"
632 "\n"
633 "Clear the current readline history.");
634 
635 #define READLINE_CLEAR_HISTORY_METHODDEF    \
636     {"clear_history", (PyCFunction)readline_clear_history, METH_NOARGS, readline_clear_history__doc__},
637 
638 static PyObject *
639 readline_clear_history_impl(PyObject *module);
640 
641 static PyObject *
readline_clear_history(PyObject * module,PyObject * Py_UNUSED (ignored))642 readline_clear_history(PyObject *module, PyObject *Py_UNUSED(ignored))
643 {
644     return readline_clear_history_impl(module);
645 }
646 
647 #endif /* defined(HAVE_RL_COMPLETION_APPEND_CHARACTER) */
648 
649 PyDoc_STRVAR(readline_insert_text__doc__,
650 "insert_text($module, string, /)\n"
651 "--\n"
652 "\n"
653 "Insert text into the line buffer at the cursor position.");
654 
655 #define READLINE_INSERT_TEXT_METHODDEF    \
656     {"insert_text", (PyCFunction)readline_insert_text, METH_O, readline_insert_text__doc__},
657 
658 PyDoc_STRVAR(readline_redisplay__doc__,
659 "redisplay($module, /)\n"
660 "--\n"
661 "\n"
662 "Change what\'s displayed on the screen to reflect contents of the line buffer.");
663 
664 #define READLINE_REDISPLAY_METHODDEF    \
665     {"redisplay", (PyCFunction)readline_redisplay, METH_NOARGS, readline_redisplay__doc__},
666 
667 static PyObject *
668 readline_redisplay_impl(PyObject *module);
669 
670 static PyObject *
readline_redisplay(PyObject * module,PyObject * Py_UNUSED (ignored))671 readline_redisplay(PyObject *module, PyObject *Py_UNUSED(ignored))
672 {
673     return readline_redisplay_impl(module);
674 }
675 
676 #ifndef READLINE_APPEND_HISTORY_FILE_METHODDEF
677     #define READLINE_APPEND_HISTORY_FILE_METHODDEF
678 #endif /* !defined(READLINE_APPEND_HISTORY_FILE_METHODDEF) */
679 
680 #ifndef READLINE_SET_PRE_INPUT_HOOK_METHODDEF
681     #define READLINE_SET_PRE_INPUT_HOOK_METHODDEF
682 #endif /* !defined(READLINE_SET_PRE_INPUT_HOOK_METHODDEF) */
683 
684 #ifndef READLINE_CLEAR_HISTORY_METHODDEF
685     #define READLINE_CLEAR_HISTORY_METHODDEF
686 #endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */
687 /*[clinic end generated code: output=358ab465285c7949 input=a9049054013a1b77]*/
688