File: file.c.h

package info (click to toggle)
python3.13 3.13.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,256 kB
  • sloc: python: 703,743; ansic: 653,888; xml: 31,250; sh: 5,844; cpp: 4,326; makefile: 1,981; objc: 787; lisp: 502; javascript: 213; asm: 75; csh: 12
file content (81 lines) | stat: -rw-r--r-- 2,407 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*[clinic input]
preserve
[clinic start generated code]*/

PyDoc_STRVAR(_testcapi_pyfile_getline__doc__,
"pyfile_getline($module, file, n, /)\n"
"--\n"
"\n");

#define _TESTCAPI_PYFILE_GETLINE_METHODDEF    \
    {"pyfile_getline", (PyCFunction)(void(*)(void))_testcapi_pyfile_getline, METH_FASTCALL, _testcapi_pyfile_getline__doc__},

static PyObject *
_testcapi_pyfile_getline_impl(PyObject *module, PyObject *file, int n);

static PyObject *
_testcapi_pyfile_getline(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    PyObject *file;
    int n;

    if (nargs != 2) {
        PyErr_Format(PyExc_TypeError, "pyfile_getline expected 2 arguments, got %zd", nargs);
        goto exit;
    }
    file = args[0];
    n = PyLong_AsInt(args[1]);
    if (n == -1 && PyErr_Occurred()) {
        goto exit;
    }
    return_value = _testcapi_pyfile_getline_impl(module, file, n);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_pyfile_writeobject__doc__,
"pyfile_writeobject($module, obj, file, flags, /)\n"
"--\n"
"\n");

#define _TESTCAPI_PYFILE_WRITEOBJECT_METHODDEF    \
    {"pyfile_writeobject", (PyCFunction)(void(*)(void))_testcapi_pyfile_writeobject, METH_FASTCALL, _testcapi_pyfile_writeobject__doc__},

static PyObject *
_testcapi_pyfile_writeobject_impl(PyObject *module, PyObject *obj,
                                  PyObject *file, int flags);

static PyObject *
_testcapi_pyfile_writeobject(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    PyObject *obj;
    PyObject *file;
    int flags;

    if (nargs != 3) {
        PyErr_Format(PyExc_TypeError, "pyfile_writeobject expected 3 arguments, got %zd", nargs);
        goto exit;
    }
    obj = args[0];
    file = args[1];
    flags = PyLong_AsInt(args[2]);
    if (flags == -1 && PyErr_Occurred()) {
        goto exit;
    }
    return_value = _testcapi_pyfile_writeobject_impl(module, obj, file, flags);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_pyobject_asfiledescriptor__doc__,
"pyobject_asfiledescriptor($module, obj, /)\n"
"--\n"
"\n");

#define _TESTCAPI_PYOBJECT_ASFILEDESCRIPTOR_METHODDEF    \
    {"pyobject_asfiledescriptor", (PyCFunction)_testcapi_pyobject_asfiledescriptor, METH_O, _testcapi_pyobject_asfiledescriptor__doc__},
/*[clinic end generated code: output=ea572aaaa01aec7b input=a9049054013a1b77]*/