File: watchers.c.h

package info (click to toggle)
python3.13 3.13.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 123,756 kB
  • sloc: python: 710,464; ansic: 655,626; xml: 31,250; sh: 5,844; cpp: 4,327; makefile: 1,983; objc: 787; lisp: 502; javascript: 213; asm: 75; csh: 12
file content (194 lines) | stat: -rw-r--r-- 5,603 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/*[clinic input]
preserve
[clinic start generated code]*/

#include "pycore_modsupport.h"    // _PyArg_CheckPositional()

PyDoc_STRVAR(_testcapi_watch_dict__doc__,
"watch_dict($module, watcher_id, dict, /)\n"
"--\n"
"\n");

#define _TESTCAPI_WATCH_DICT_METHODDEF    \
    {"watch_dict", _PyCFunction_CAST(_testcapi_watch_dict), METH_FASTCALL, _testcapi_watch_dict__doc__},

static PyObject *
_testcapi_watch_dict_impl(PyObject *module, int watcher_id, PyObject *dict);

static PyObject *
_testcapi_watch_dict(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    int watcher_id;
    PyObject *dict;

    if (!_PyArg_CheckPositional("watch_dict", nargs, 2, 2)) {
        goto exit;
    }
    watcher_id = PyLong_AsInt(args[0]);
    if (watcher_id == -1 && PyErr_Occurred()) {
        goto exit;
    }
    dict = args[1];
    return_value = _testcapi_watch_dict_impl(module, watcher_id, dict);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_unwatch_dict__doc__,
"unwatch_dict($module, watcher_id, dict, /)\n"
"--\n"
"\n");

#define _TESTCAPI_UNWATCH_DICT_METHODDEF    \
    {"unwatch_dict", _PyCFunction_CAST(_testcapi_unwatch_dict), METH_FASTCALL, _testcapi_unwatch_dict__doc__},

static PyObject *
_testcapi_unwatch_dict_impl(PyObject *module, int watcher_id, PyObject *dict);

static PyObject *
_testcapi_unwatch_dict(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    int watcher_id;
    PyObject *dict;

    if (!_PyArg_CheckPositional("unwatch_dict", nargs, 2, 2)) {
        goto exit;
    }
    watcher_id = PyLong_AsInt(args[0]);
    if (watcher_id == -1 && PyErr_Occurred()) {
        goto exit;
    }
    dict = args[1];
    return_value = _testcapi_unwatch_dict_impl(module, watcher_id, dict);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_watch_type__doc__,
"watch_type($module, watcher_id, type, /)\n"
"--\n"
"\n");

#define _TESTCAPI_WATCH_TYPE_METHODDEF    \
    {"watch_type", _PyCFunction_CAST(_testcapi_watch_type), METH_FASTCALL, _testcapi_watch_type__doc__},

static PyObject *
_testcapi_watch_type_impl(PyObject *module, int watcher_id, PyObject *type);

static PyObject *
_testcapi_watch_type(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    int watcher_id;
    PyObject *type;

    if (!_PyArg_CheckPositional("watch_type", nargs, 2, 2)) {
        goto exit;
    }
    watcher_id = PyLong_AsInt(args[0]);
    if (watcher_id == -1 && PyErr_Occurred()) {
        goto exit;
    }
    type = args[1];
    return_value = _testcapi_watch_type_impl(module, watcher_id, type);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_unwatch_type__doc__,
"unwatch_type($module, watcher_id, type, /)\n"
"--\n"
"\n");

#define _TESTCAPI_UNWATCH_TYPE_METHODDEF    \
    {"unwatch_type", _PyCFunction_CAST(_testcapi_unwatch_type), METH_FASTCALL, _testcapi_unwatch_type__doc__},

static PyObject *
_testcapi_unwatch_type_impl(PyObject *module, int watcher_id, PyObject *type);

static PyObject *
_testcapi_unwatch_type(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    int watcher_id;
    PyObject *type;

    if (!_PyArg_CheckPositional("unwatch_type", nargs, 2, 2)) {
        goto exit;
    }
    watcher_id = PyLong_AsInt(args[0]);
    if (watcher_id == -1 && PyErr_Occurred()) {
        goto exit;
    }
    type = args[1];
    return_value = _testcapi_unwatch_type_impl(module, watcher_id, type);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_set_func_defaults_via_capi__doc__,
"set_func_defaults_via_capi($module, func, defaults, /)\n"
"--\n"
"\n");

#define _TESTCAPI_SET_FUNC_DEFAULTS_VIA_CAPI_METHODDEF    \
    {"set_func_defaults_via_capi", _PyCFunction_CAST(_testcapi_set_func_defaults_via_capi), METH_FASTCALL, _testcapi_set_func_defaults_via_capi__doc__},

static PyObject *
_testcapi_set_func_defaults_via_capi_impl(PyObject *module, PyObject *func,
                                          PyObject *defaults);

static PyObject *
_testcapi_set_func_defaults_via_capi(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    PyObject *func;
    PyObject *defaults;

    if (!_PyArg_CheckPositional("set_func_defaults_via_capi", nargs, 2, 2)) {
        goto exit;
    }
    func = args[0];
    defaults = args[1];
    return_value = _testcapi_set_func_defaults_via_capi_impl(module, func, defaults);

exit:
    return return_value;
}

PyDoc_STRVAR(_testcapi_set_func_kwdefaults_via_capi__doc__,
"set_func_kwdefaults_via_capi($module, func, defaults, /)\n"
"--\n"
"\n");

#define _TESTCAPI_SET_FUNC_KWDEFAULTS_VIA_CAPI_METHODDEF    \
    {"set_func_kwdefaults_via_capi", _PyCFunction_CAST(_testcapi_set_func_kwdefaults_via_capi), METH_FASTCALL, _testcapi_set_func_kwdefaults_via_capi__doc__},

static PyObject *
_testcapi_set_func_kwdefaults_via_capi_impl(PyObject *module, PyObject *func,
                                            PyObject *defaults);

static PyObject *
_testcapi_set_func_kwdefaults_via_capi(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
    PyObject *return_value = NULL;
    PyObject *func;
    PyObject *defaults;

    if (!_PyArg_CheckPositional("set_func_kwdefaults_via_capi", nargs, 2, 2)) {
        goto exit;
    }
    func = args[0];
    defaults = args[1];
    return_value = _testcapi_set_func_kwdefaults_via_capi_impl(module, func, defaults);

exit:
    return return_value;
}
/*[clinic end generated code: output=0e07ce7f295917a5 input=a9049054013a1b77]*/