| 1 |
/*[clinic input] |
| 2 |
preserve |
| 3 |
[clinic start generated code]*/ |
| 4 |
|
| 5 |
#if defined(MS_WINDOWS) |
| 6 |
|
| 7 |
PyDoc_STRVAR(_testconsole_write_input__doc__, |
| 8 |
"write_input($module, /, file, s)\n" |
| 9 |
"--\n" |
| 10 |
"\n" |
| 11 |
"Writes UTF-16-LE encoded bytes to the console as if typed by a user."); |
| 12 |
|
| 13 |
#define _TESTCONSOLE_WRITE_INPUT_METHODDEF \ |
| 14 |
{"write_input", (PyCFunction)(void(*)(void))_testconsole_write_input, METH_VARARGS|METH_KEYWORDS, _testconsole_write_input__doc__}, |
| 15 |
|
| 16 |
static PyObject * |
| 17 |
_testconsole_write_input_impl(PyObject *module, PyObject *file, Py_buffer *s); |
| 18 |
|
| 19 |
static PyObject * |
| 20 |
_testconsole_write_input(PyObject *module, PyObject *args, PyObject *kwargs) |
| 21 |
{ |
| 22 |
PyObject *return_value = NULL; |
| 23 |
static char *_keywords[] = {"file", "s", NULL}; |
| 24 |
PyObject *file; |
| 25 |
Py_buffer s = {NULL, NULL}; |
| 26 |
|
| 27 |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oy*:write_input", _keywords, |
| 28 |
&file, &s)) |
| 29 |
goto exit; |
| 30 |
return_value = _testconsole_write_input_impl(module, file, &s); |
| 31 |
|
| 32 |
exit: |
| 33 |
/* Cleanup for s */ |
| 34 |
if (s.obj) { |
| 35 |
PyBuffer_Release(&s); |
| 36 |
} |
| 37 |
|
| 38 |
return return_value; |
| 39 |
} |
| 40 |
|
| 41 |
#endif /* defined(MS_WINDOWS) */ |
| 42 |
|
| 43 |
#if defined(MS_WINDOWS) |
| 44 |
|
| 45 |
PyDoc_STRVAR(_testconsole_read_output__doc__, |
| 46 |
"read_output($module, /, file)\n" |
| 47 |
"--\n" |
| 48 |
"\n" |
| 49 |
"Reads a str from the console as written to stdout."); |
| 50 |
|
| 51 |
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF \ |
| 52 |
{"read_output", (PyCFunction)(void(*)(void))_testconsole_read_output, METH_VARARGS|METH_KEYWORDS, _testconsole_read_output__doc__}, |
| 53 |
|
| 54 |
static PyObject * |
| 55 |
_testconsole_read_output_impl(PyObject *module, PyObject *file); |
| 56 |
|
| 57 |
static PyObject * |
| 58 |
_testconsole_read_output(PyObject *module, PyObject *args, PyObject *kwargs) |
| 59 |
{ |
| 60 |
PyObject *return_value = NULL; |
| 61 |
static char *_keywords[] = {"file", NULL}; |
| 62 |
PyObject *file; |
| 63 |
|
| 64 |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:read_output", _keywords, |
| 65 |
&file)) |
| 66 |
goto exit; |
| 67 |
return_value = _testconsole_read_output_impl(module, file); |
| 68 |
|
| 69 |
exit: |
| 70 |
return return_value; |
| 71 |
} |
| 72 |
|
| 73 |
#endif /* defined(MS_WINDOWS) */ |
| 74 |
|
| 75 |
#ifndef _TESTCONSOLE_WRITE_INPUT_METHODDEF |
| 76 |
#define _TESTCONSOLE_WRITE_INPUT_METHODDEF |
| 77 |
#endif /* !defined(_TESTCONSOLE_WRITE_INPUT_METHODDEF) */ |
| 78 |
|
| 79 |
#ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF |
| 80 |
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF |
| 81 |
#endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ |
| 82 |
/*[clinic end generated code: output=d60ce07157e3741a input=a9049054013a1b77]*/ |