| 1 |
/*[clinic input] |
| 2 |
preserve |
| 3 |
[clinic start generated code]*/ |
| 4 |
|
| 5 |
#include "pycore_modsupport.h" // _PyArg_CheckPositional() |
| 6 |
|
| 7 |
PyDoc_STRVAR(monitoring_use_tool_id__doc__, |
| 8 |
"use_tool_id($module, tool_id, name, /)\n" |
| 9 |
"--\n" |
| 10 |
"\n"); |
| 11 |
|
| 12 |
#define MONITORING_USE_TOOL_ID_METHODDEF \ |
| 13 |
{"use_tool_id", _PyCFunction_CAST(monitoring_use_tool_id), METH_FASTCALL, monitoring_use_tool_id__doc__}, |
| 14 |
|
| 15 |
static PyObject * |
| 16 |
monitoring_use_tool_id_impl(PyObject *module, int tool_id, PyObject *name); |
| 17 |
|
| 18 |
static PyObject * |
| 19 |
monitoring_use_tool_id(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 20 |
{ |
| 21 |
PyObject *return_value = NULL; |
| 22 |
int tool_id; |
| 23 |
PyObject *name; |
| 24 |
|
| 25 |
if (!_PyArg_CheckPositional("use_tool_id", nargs, 2, 2)) { |
| 26 |
goto exit; |
| 27 |
} |
| 28 |
tool_id = PyLong_AsInt(args[0]); |
| 29 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 30 |
goto exit; |
| 31 |
} |
| 32 |
name = args[1]; |
| 33 |
return_value = monitoring_use_tool_id_impl(module, tool_id, name); |
| 34 |
|
| 35 |
exit: |
| 36 |
return return_value; |
| 37 |
} |
| 38 |
|
| 39 |
PyDoc_STRVAR(monitoring_clear_tool_id__doc__, |
| 40 |
"clear_tool_id($module, tool_id, /)\n" |
| 41 |
"--\n" |
| 42 |
"\n"); |
| 43 |
|
| 44 |
#define MONITORING_CLEAR_TOOL_ID_METHODDEF \ |
| 45 |
{"clear_tool_id", (PyCFunction)monitoring_clear_tool_id, METH_O, monitoring_clear_tool_id__doc__}, |
| 46 |
|
| 47 |
static PyObject * |
| 48 |
monitoring_clear_tool_id_impl(PyObject *module, int tool_id); |
| 49 |
|
| 50 |
static PyObject * |
| 51 |
monitoring_clear_tool_id(PyObject *module, PyObject *arg) |
| 52 |
{ |
| 53 |
PyObject *return_value = NULL; |
| 54 |
int tool_id; |
| 55 |
|
| 56 |
tool_id = PyLong_AsInt(arg); |
| 57 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 58 |
goto exit; |
| 59 |
} |
| 60 |
return_value = monitoring_clear_tool_id_impl(module, tool_id); |
| 61 |
|
| 62 |
exit: |
| 63 |
return return_value; |
| 64 |
} |
| 65 |
|
| 66 |
PyDoc_STRVAR(monitoring_free_tool_id__doc__, |
| 67 |
"free_tool_id($module, tool_id, /)\n" |
| 68 |
"--\n" |
| 69 |
"\n"); |
| 70 |
|
| 71 |
#define MONITORING_FREE_TOOL_ID_METHODDEF \ |
| 72 |
{"free_tool_id", (PyCFunction)monitoring_free_tool_id, METH_O, monitoring_free_tool_id__doc__}, |
| 73 |
|
| 74 |
static PyObject * |
| 75 |
monitoring_free_tool_id_impl(PyObject *module, int tool_id); |
| 76 |
|
| 77 |
static PyObject * |
| 78 |
monitoring_free_tool_id(PyObject *module, PyObject *arg) |
| 79 |
{ |
| 80 |
PyObject *return_value = NULL; |
| 81 |
int tool_id; |
| 82 |
|
| 83 |
tool_id = PyLong_AsInt(arg); |
| 84 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 85 |
goto exit; |
| 86 |
} |
| 87 |
return_value = monitoring_free_tool_id_impl(module, tool_id); |
| 88 |
|
| 89 |
exit: |
| 90 |
return return_value; |
| 91 |
} |
| 92 |
|
| 93 |
PyDoc_STRVAR(monitoring_get_tool__doc__, |
| 94 |
"get_tool($module, tool_id, /)\n" |
| 95 |
"--\n" |
| 96 |
"\n"); |
| 97 |
|
| 98 |
#define MONITORING_GET_TOOL_METHODDEF \ |
| 99 |
{"get_tool", (PyCFunction)monitoring_get_tool, METH_O, monitoring_get_tool__doc__}, |
| 100 |
|
| 101 |
static PyObject * |
| 102 |
monitoring_get_tool_impl(PyObject *module, int tool_id); |
| 103 |
|
| 104 |
static PyObject * |
| 105 |
monitoring_get_tool(PyObject *module, PyObject *arg) |
| 106 |
{ |
| 107 |
PyObject *return_value = NULL; |
| 108 |
int tool_id; |
| 109 |
|
| 110 |
tool_id = PyLong_AsInt(arg); |
| 111 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 112 |
goto exit; |
| 113 |
} |
| 114 |
return_value = monitoring_get_tool_impl(module, tool_id); |
| 115 |
|
| 116 |
exit: |
| 117 |
return return_value; |
| 118 |
} |
| 119 |
|
| 120 |
PyDoc_STRVAR(monitoring_register_callback__doc__, |
| 121 |
"register_callback($module, tool_id, event, func, /)\n" |
| 122 |
"--\n" |
| 123 |
"\n"); |
| 124 |
|
| 125 |
#define MONITORING_REGISTER_CALLBACK_METHODDEF \ |
| 126 |
{"register_callback", _PyCFunction_CAST(monitoring_register_callback), METH_FASTCALL, monitoring_register_callback__doc__}, |
| 127 |
|
| 128 |
static PyObject * |
| 129 |
monitoring_register_callback_impl(PyObject *module, int tool_id, int event, |
| 130 |
PyObject *func); |
| 131 |
|
| 132 |
static PyObject * |
| 133 |
monitoring_register_callback(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 134 |
{ |
| 135 |
PyObject *return_value = NULL; |
| 136 |
int tool_id; |
| 137 |
int event; |
| 138 |
PyObject *func; |
| 139 |
|
| 140 |
if (!_PyArg_CheckPositional("register_callback", nargs, 3, 3)) { |
| 141 |
goto exit; |
| 142 |
} |
| 143 |
tool_id = PyLong_AsInt(args[0]); |
| 144 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 145 |
goto exit; |
| 146 |
} |
| 147 |
event = PyLong_AsInt(args[1]); |
| 148 |
if (event == -1 && PyErr_Occurred()) { |
| 149 |
goto exit; |
| 150 |
} |
| 151 |
func = args[2]; |
| 152 |
return_value = monitoring_register_callback_impl(module, tool_id, event, func); |
| 153 |
|
| 154 |
exit: |
| 155 |
return return_value; |
| 156 |
} |
| 157 |
|
| 158 |
PyDoc_STRVAR(monitoring_get_events__doc__, |
| 159 |
"get_events($module, tool_id, /)\n" |
| 160 |
"--\n" |
| 161 |
"\n"); |
| 162 |
|
| 163 |
#define MONITORING_GET_EVENTS_METHODDEF \ |
| 164 |
{"get_events", (PyCFunction)monitoring_get_events, METH_O, monitoring_get_events__doc__}, |
| 165 |
|
| 166 |
static int |
| 167 |
monitoring_get_events_impl(PyObject *module, int tool_id); |
| 168 |
|
| 169 |
static PyObject * |
| 170 |
monitoring_get_events(PyObject *module, PyObject *arg) |
| 171 |
{ |
| 172 |
PyObject *return_value = NULL; |
| 173 |
int tool_id; |
| 174 |
int _return_value; |
| 175 |
|
| 176 |
tool_id = PyLong_AsInt(arg); |
| 177 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 178 |
goto exit; |
| 179 |
} |
| 180 |
_return_value = monitoring_get_events_impl(module, tool_id); |
| 181 |
if ((_return_value == -1) && PyErr_Occurred()) { |
| 182 |
goto exit; |
| 183 |
} |
| 184 |
return_value = PyLong_FromLong((long)_return_value); |
| 185 |
|
| 186 |
exit: |
| 187 |
return return_value; |
| 188 |
} |
| 189 |
|
| 190 |
PyDoc_STRVAR(monitoring_set_events__doc__, |
| 191 |
"set_events($module, tool_id, event_set, /)\n" |
| 192 |
"--\n" |
| 193 |
"\n"); |
| 194 |
|
| 195 |
#define MONITORING_SET_EVENTS_METHODDEF \ |
| 196 |
{"set_events", _PyCFunction_CAST(monitoring_set_events), METH_FASTCALL, monitoring_set_events__doc__}, |
| 197 |
|
| 198 |
static PyObject * |
| 199 |
monitoring_set_events_impl(PyObject *module, int tool_id, int event_set); |
| 200 |
|
| 201 |
static PyObject * |
| 202 |
monitoring_set_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 203 |
{ |
| 204 |
PyObject *return_value = NULL; |
| 205 |
int tool_id; |
| 206 |
int event_set; |
| 207 |
|
| 208 |
if (!_PyArg_CheckPositional("set_events", nargs, 2, 2)) { |
| 209 |
goto exit; |
| 210 |
} |
| 211 |
tool_id = PyLong_AsInt(args[0]); |
| 212 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 213 |
goto exit; |
| 214 |
} |
| 215 |
event_set = PyLong_AsInt(args[1]); |
| 216 |
if (event_set == -1 && PyErr_Occurred()) { |
| 217 |
goto exit; |
| 218 |
} |
| 219 |
return_value = monitoring_set_events_impl(module, tool_id, event_set); |
| 220 |
|
| 221 |
exit: |
| 222 |
return return_value; |
| 223 |
} |
| 224 |
|
| 225 |
PyDoc_STRVAR(monitoring_get_local_events__doc__, |
| 226 |
"get_local_events($module, tool_id, code, /)\n" |
| 227 |
"--\n" |
| 228 |
"\n"); |
| 229 |
|
| 230 |
#define MONITORING_GET_LOCAL_EVENTS_METHODDEF \ |
| 231 |
{"get_local_events", _PyCFunction_CAST(monitoring_get_local_events), METH_FASTCALL, monitoring_get_local_events__doc__}, |
| 232 |
|
| 233 |
static int |
| 234 |
monitoring_get_local_events_impl(PyObject *module, int tool_id, |
| 235 |
PyObject *code); |
| 236 |
|
| 237 |
static PyObject * |
| 238 |
monitoring_get_local_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 239 |
{ |
| 240 |
PyObject *return_value = NULL; |
| 241 |
int tool_id; |
| 242 |
PyObject *code; |
| 243 |
int _return_value; |
| 244 |
|
| 245 |
if (!_PyArg_CheckPositional("get_local_events", nargs, 2, 2)) { |
| 246 |
goto exit; |
| 247 |
} |
| 248 |
tool_id = PyLong_AsInt(args[0]); |
| 249 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 250 |
goto exit; |
| 251 |
} |
| 252 |
code = args[1]; |
| 253 |
_return_value = monitoring_get_local_events_impl(module, tool_id, code); |
| 254 |
if ((_return_value == -1) && PyErr_Occurred()) { |
| 255 |
goto exit; |
| 256 |
} |
| 257 |
return_value = PyLong_FromLong((long)_return_value); |
| 258 |
|
| 259 |
exit: |
| 260 |
return return_value; |
| 261 |
} |
| 262 |
|
| 263 |
PyDoc_STRVAR(monitoring_set_local_events__doc__, |
| 264 |
"set_local_events($module, tool_id, code, event_set, /)\n" |
| 265 |
"--\n" |
| 266 |
"\n"); |
| 267 |
|
| 268 |
#define MONITORING_SET_LOCAL_EVENTS_METHODDEF \ |
| 269 |
{"set_local_events", _PyCFunction_CAST(monitoring_set_local_events), METH_FASTCALL, monitoring_set_local_events__doc__}, |
| 270 |
|
| 271 |
static PyObject * |
| 272 |
monitoring_set_local_events_impl(PyObject *module, int tool_id, |
| 273 |
PyObject *code, int event_set); |
| 274 |
|
| 275 |
static PyObject * |
| 276 |
monitoring_set_local_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 277 |
{ |
| 278 |
PyObject *return_value = NULL; |
| 279 |
int tool_id; |
| 280 |
PyObject *code; |
| 281 |
int event_set; |
| 282 |
|
| 283 |
if (!_PyArg_CheckPositional("set_local_events", nargs, 3, 3)) { |
| 284 |
goto exit; |
| 285 |
} |
| 286 |
tool_id = PyLong_AsInt(args[0]); |
| 287 |
if (tool_id == -1 && PyErr_Occurred()) { |
| 288 |
goto exit; |
| 289 |
} |
| 290 |
code = args[1]; |
| 291 |
event_set = PyLong_AsInt(args[2]); |
| 292 |
if (event_set == -1 && PyErr_Occurred()) { |
| 293 |
goto exit; |
| 294 |
} |
| 295 |
return_value = monitoring_set_local_events_impl(module, tool_id, code, event_set); |
| 296 |
|
| 297 |
exit: |
| 298 |
return return_value; |
| 299 |
} |
| 300 |
|
| 301 |
PyDoc_STRVAR(monitoring_restart_events__doc__, |
| 302 |
"restart_events($module, /)\n" |
| 303 |
"--\n" |
| 304 |
"\n"); |
| 305 |
|
| 306 |
#define MONITORING_RESTART_EVENTS_METHODDEF \ |
| 307 |
{"restart_events", (PyCFunction)monitoring_restart_events, METH_NOARGS, monitoring_restart_events__doc__}, |
| 308 |
|
| 309 |
static PyObject * |
| 310 |
monitoring_restart_events_impl(PyObject *module); |
| 311 |
|
| 312 |
static PyObject * |
| 313 |
monitoring_restart_events(PyObject *module, PyObject *Py_UNUSED(ignored)) |
| 314 |
{ |
| 315 |
return monitoring_restart_events_impl(module); |
| 316 |
} |
| 317 |
|
| 318 |
PyDoc_STRVAR(monitoring__all_events__doc__, |
| 319 |
"_all_events($module, /)\n" |
| 320 |
"--\n" |
| 321 |
"\n"); |
| 322 |
|
| 323 |
#define MONITORING__ALL_EVENTS_METHODDEF \ |
| 324 |
{"_all_events", (PyCFunction)monitoring__all_events, METH_NOARGS, monitoring__all_events__doc__}, |
| 325 |
|
| 326 |
static PyObject * |
| 327 |
monitoring__all_events_impl(PyObject *module); |
| 328 |
|
| 329 |
static PyObject * |
| 330 |
monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored)) |
| 331 |
{ |
| 332 |
return monitoring__all_events_impl(module); |
| 333 |
} |
| 334 |
/*[clinic end generated code: output=8f81876c6aba9be8 input=a9049054013a1b77]*/ |