Debian Codegraph @

Modules/_testlimitedcapi/clinic/file.c.h

raw
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 PyDoc_STRVAR(_testcapi_pyfile_getline__doc__,
6 "pyfile_getline($module, file, n, /)\n"
7 "--\n"
8 "\n");
9
10 #define _TESTCAPI_PYFILE_GETLINE_METHODDEF \
11 {"pyfile_getline", (PyCFunction)(void(*)(void))_testcapi_pyfile_getline, METH_FASTCALL, _testcapi_pyfile_getline__doc__},
12
13 static PyObject *
14 _testcapi_pyfile_getline_impl(PyObject *module, PyObject *file, int n);
15
16 static PyObject *
17 _testcapi_pyfile_getline(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
18 {
19 PyObject *return_value = NULL;
20 PyObject *file;
21 int n;
22
23 if (nargs != 2) {
24 PyErr_Format(PyExc_TypeError, "pyfile_getline expected 2 arguments, got %zd", nargs);
25 goto exit;
26 }
27 file = args[0];
28 n = PyLong_AsInt(args[1]);
29 if (n == -1 && PyErr_Occurred()) {
30 goto exit;
31 }
32 return_value = _testcapi_pyfile_getline_impl(module, file, n);
33
34 exit:
35 return return_value;
36 }
37
38 PyDoc_STRVAR(_testcapi_pyfile_writeobject__doc__,
39 "pyfile_writeobject($module, obj, file, flags, /)\n"
40 "--\n"
41 "\n");
42
43 #define _TESTCAPI_PYFILE_WRITEOBJECT_METHODDEF \
44 {"pyfile_writeobject", (PyCFunction)(void(*)(void))_testcapi_pyfile_writeobject, METH_FASTCALL, _testcapi_pyfile_writeobject__doc__},
45
46 static PyObject *
47 _testcapi_pyfile_writeobject_impl(PyObject *module, PyObject *obj,
48 PyObject *file, int flags);
49
50 static PyObject *
51 _testcapi_pyfile_writeobject(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
52 {
53 PyObject *return_value = NULL;
54 PyObject *obj;
55 PyObject *file;
56 int flags;
57
58 if (nargs != 3) {
59 PyErr_Format(PyExc_TypeError, "pyfile_writeobject expected 3 arguments, got %zd", nargs);
60 goto exit;
61 }
62 obj = args[0];
63 file = args[1];
64 flags = PyLong_AsInt(args[2]);
65 if (flags == -1 && PyErr_Occurred()) {
66 goto exit;
67 }
68 return_value = _testcapi_pyfile_writeobject_impl(module, obj, file, flags);
69
70 exit:
71 return return_value;
72 }
73
74 PyDoc_STRVAR(_testcapi_pyobject_asfiledescriptor__doc__,
75 "pyobject_asfiledescriptor($module, obj, /)\n"
76 "--\n"
77 "\n");
78
79 #define _TESTCAPI_PYOBJECT_ASFILEDESCRIPTOR_METHODDEF \
80 {"pyobject_asfiledescriptor", (PyCFunction)_testcapi_pyobject_asfiledescriptor, METH_O, _testcapi_pyobject_asfiledescriptor__doc__},
81 /*[clinic end generated code: output=ea572aaaa01aec7b input=a9049054013a1b77]*/