LCOV - code coverage report
Current view: top level - Modules/clinic - readline.c.h (source / functions) Hit Total Coverage
Test: CPython lcov report Lines: 118 167 70.7 %
Date: 2022-07-07 18:19:46 Functions: 18 23 78.3 %

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

Generated by: LCOV version 1.14