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