• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4 
5 #include "pycore_modsupport.h"    // _PyArg_CheckPositional()
6 
7 PyDoc_STRVAR(_testcapi_watch_dict__doc__,
8 "watch_dict($module, watcher_id, dict, /)\n"
9 "--\n"
10 "\n");
11 
12 #define _TESTCAPI_WATCH_DICT_METHODDEF    \
13     {"watch_dict", _PyCFunction_CAST(_testcapi_watch_dict), METH_FASTCALL, _testcapi_watch_dict__doc__},
14 
15 static PyObject *
16 _testcapi_watch_dict_impl(PyObject *module, int watcher_id, PyObject *dict);
17 
18 static PyObject *
_testcapi_watch_dict(PyObject * module,PyObject * const * args,Py_ssize_t nargs)19 _testcapi_watch_dict(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
20 {
21     PyObject *return_value = NULL;
22     int watcher_id;
23     PyObject *dict;
24 
25     if (!_PyArg_CheckPositional("watch_dict", nargs, 2, 2)) {
26         goto exit;
27     }
28     watcher_id = PyLong_AsInt(args[0]);
29     if (watcher_id == -1 && PyErr_Occurred()) {
30         goto exit;
31     }
32     dict = args[1];
33     return_value = _testcapi_watch_dict_impl(module, watcher_id, dict);
34 
35 exit:
36     return return_value;
37 }
38 
39 PyDoc_STRVAR(_testcapi_unwatch_dict__doc__,
40 "unwatch_dict($module, watcher_id, dict, /)\n"
41 "--\n"
42 "\n");
43 
44 #define _TESTCAPI_UNWATCH_DICT_METHODDEF    \
45     {"unwatch_dict", _PyCFunction_CAST(_testcapi_unwatch_dict), METH_FASTCALL, _testcapi_unwatch_dict__doc__},
46 
47 static PyObject *
48 _testcapi_unwatch_dict_impl(PyObject *module, int watcher_id, PyObject *dict);
49 
50 static PyObject *
_testcapi_unwatch_dict(PyObject * module,PyObject * const * args,Py_ssize_t nargs)51 _testcapi_unwatch_dict(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
52 {
53     PyObject *return_value = NULL;
54     int watcher_id;
55     PyObject *dict;
56 
57     if (!_PyArg_CheckPositional("unwatch_dict", nargs, 2, 2)) {
58         goto exit;
59     }
60     watcher_id = PyLong_AsInt(args[0]);
61     if (watcher_id == -1 && PyErr_Occurred()) {
62         goto exit;
63     }
64     dict = args[1];
65     return_value = _testcapi_unwatch_dict_impl(module, watcher_id, dict);
66 
67 exit:
68     return return_value;
69 }
70 
71 PyDoc_STRVAR(_testcapi_watch_type__doc__,
72 "watch_type($module, watcher_id, type, /)\n"
73 "--\n"
74 "\n");
75 
76 #define _TESTCAPI_WATCH_TYPE_METHODDEF    \
77     {"watch_type", _PyCFunction_CAST(_testcapi_watch_type), METH_FASTCALL, _testcapi_watch_type__doc__},
78 
79 static PyObject *
80 _testcapi_watch_type_impl(PyObject *module, int watcher_id, PyObject *type);
81 
82 static PyObject *
_testcapi_watch_type(PyObject * module,PyObject * const * args,Py_ssize_t nargs)83 _testcapi_watch_type(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
84 {
85     PyObject *return_value = NULL;
86     int watcher_id;
87     PyObject *type;
88 
89     if (!_PyArg_CheckPositional("watch_type", nargs, 2, 2)) {
90         goto exit;
91     }
92     watcher_id = PyLong_AsInt(args[0]);
93     if (watcher_id == -1 && PyErr_Occurred()) {
94         goto exit;
95     }
96     type = args[1];
97     return_value = _testcapi_watch_type_impl(module, watcher_id, type);
98 
99 exit:
100     return return_value;
101 }
102 
103 PyDoc_STRVAR(_testcapi_unwatch_type__doc__,
104 "unwatch_type($module, watcher_id, type, /)\n"
105 "--\n"
106 "\n");
107 
108 #define _TESTCAPI_UNWATCH_TYPE_METHODDEF    \
109     {"unwatch_type", _PyCFunction_CAST(_testcapi_unwatch_type), METH_FASTCALL, _testcapi_unwatch_type__doc__},
110 
111 static PyObject *
112 _testcapi_unwatch_type_impl(PyObject *module, int watcher_id, PyObject *type);
113 
114 static PyObject *
_testcapi_unwatch_type(PyObject * module,PyObject * const * args,Py_ssize_t nargs)115 _testcapi_unwatch_type(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
116 {
117     PyObject *return_value = NULL;
118     int watcher_id;
119     PyObject *type;
120 
121     if (!_PyArg_CheckPositional("unwatch_type", nargs, 2, 2)) {
122         goto exit;
123     }
124     watcher_id = PyLong_AsInt(args[0]);
125     if (watcher_id == -1 && PyErr_Occurred()) {
126         goto exit;
127     }
128     type = args[1];
129     return_value = _testcapi_unwatch_type_impl(module, watcher_id, type);
130 
131 exit:
132     return return_value;
133 }
134 
135 PyDoc_STRVAR(_testcapi_set_func_defaults_via_capi__doc__,
136 "set_func_defaults_via_capi($module, func, defaults, /)\n"
137 "--\n"
138 "\n");
139 
140 #define _TESTCAPI_SET_FUNC_DEFAULTS_VIA_CAPI_METHODDEF    \
141     {"set_func_defaults_via_capi", _PyCFunction_CAST(_testcapi_set_func_defaults_via_capi), METH_FASTCALL, _testcapi_set_func_defaults_via_capi__doc__},
142 
143 static PyObject *
144 _testcapi_set_func_defaults_via_capi_impl(PyObject *module, PyObject *func,
145                                           PyObject *defaults);
146 
147 static PyObject *
_testcapi_set_func_defaults_via_capi(PyObject * module,PyObject * const * args,Py_ssize_t nargs)148 _testcapi_set_func_defaults_via_capi(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
149 {
150     PyObject *return_value = NULL;
151     PyObject *func;
152     PyObject *defaults;
153 
154     if (!_PyArg_CheckPositional("set_func_defaults_via_capi", nargs, 2, 2)) {
155         goto exit;
156     }
157     func = args[0];
158     defaults = args[1];
159     return_value = _testcapi_set_func_defaults_via_capi_impl(module, func, defaults);
160 
161 exit:
162     return return_value;
163 }
164 
165 PyDoc_STRVAR(_testcapi_set_func_kwdefaults_via_capi__doc__,
166 "set_func_kwdefaults_via_capi($module, func, defaults, /)\n"
167 "--\n"
168 "\n");
169 
170 #define _TESTCAPI_SET_FUNC_KWDEFAULTS_VIA_CAPI_METHODDEF    \
171     {"set_func_kwdefaults_via_capi", _PyCFunction_CAST(_testcapi_set_func_kwdefaults_via_capi), METH_FASTCALL, _testcapi_set_func_kwdefaults_via_capi__doc__},
172 
173 static PyObject *
174 _testcapi_set_func_kwdefaults_via_capi_impl(PyObject *module, PyObject *func,
175                                             PyObject *defaults);
176 
177 static PyObject *
_testcapi_set_func_kwdefaults_via_capi(PyObject * module,PyObject * const * args,Py_ssize_t nargs)178 _testcapi_set_func_kwdefaults_via_capi(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
179 {
180     PyObject *return_value = NULL;
181     PyObject *func;
182     PyObject *defaults;
183 
184     if (!_PyArg_CheckPositional("set_func_kwdefaults_via_capi", nargs, 2, 2)) {
185         goto exit;
186     }
187     func = args[0];
188     defaults = args[1];
189     return_value = _testcapi_set_func_kwdefaults_via_capi_impl(module, func, defaults);
190 
191 exit:
192     return return_value;
193 }
194 /*[clinic end generated code: output=0e07ce7f295917a5 input=a9049054013a1b77]*/
195