1 /*[clinic input]
2 preserve
3 [clinic start generated code]*/
4
5 PyDoc_STRVAR(test_empty_function__doc__,
6 "test_empty_function($module, /)\n"
7 "--\n"
8 "\n");
9
10 #define TEST_EMPTY_FUNCTION_METHODDEF \
11 {"test_empty_function", (PyCFunction)test_empty_function, METH_NOARGS, test_empty_function__doc__},
12
13 static PyObject *
14 test_empty_function_impl(PyObject *module);
15
16 static PyObject *
test_empty_function(PyObject * module,PyObject * Py_UNUSED (ignored))17 test_empty_function(PyObject *module, PyObject *Py_UNUSED(ignored))
18 {
19 return test_empty_function_impl(module);
20 }
21
22 PyDoc_STRVAR(objects_converter__doc__,
23 "objects_converter($module, a, b=<unrepresentable>, /)\n"
24 "--\n"
25 "\n");
26
27 #define OBJECTS_CONVERTER_METHODDEF \
28 {"objects_converter", _PyCFunction_CAST(objects_converter), METH_FASTCALL, objects_converter__doc__},
29
30 static PyObject *
31 objects_converter_impl(PyObject *module, PyObject *a, PyObject *b);
32
33 static PyObject *
objects_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)34 objects_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
35 {
36 PyObject *return_value = NULL;
37 PyObject *a;
38 PyObject *b = NULL;
39
40 if (!_PyArg_CheckPositional("objects_converter", nargs, 1, 2)) {
41 goto exit;
42 }
43 a = args[0];
44 if (nargs < 2) {
45 goto skip_optional;
46 }
47 b = args[1];
48 skip_optional:
49 return_value = objects_converter_impl(module, a, b);
50
51 exit:
52 return return_value;
53 }
54
55 PyDoc_STRVAR(bytes_object_converter__doc__,
56 "bytes_object_converter($module, a, /)\n"
57 "--\n"
58 "\n");
59
60 #define BYTES_OBJECT_CONVERTER_METHODDEF \
61 {"bytes_object_converter", (PyCFunction)bytes_object_converter, METH_O, bytes_object_converter__doc__},
62
63 static PyObject *
64 bytes_object_converter_impl(PyObject *module, PyBytesObject *a);
65
66 static PyObject *
bytes_object_converter(PyObject * module,PyObject * arg)67 bytes_object_converter(PyObject *module, PyObject *arg)
68 {
69 PyObject *return_value = NULL;
70 PyBytesObject *a;
71
72 if (!PyBytes_Check(arg)) {
73 _PyArg_BadArgument("bytes_object_converter", "argument", "bytes", arg);
74 goto exit;
75 }
76 a = (PyBytesObject *)arg;
77 return_value = bytes_object_converter_impl(module, a);
78
79 exit:
80 return return_value;
81 }
82
83 PyDoc_STRVAR(byte_array_object_converter__doc__,
84 "byte_array_object_converter($module, a, /)\n"
85 "--\n"
86 "\n");
87
88 #define BYTE_ARRAY_OBJECT_CONVERTER_METHODDEF \
89 {"byte_array_object_converter", (PyCFunction)byte_array_object_converter, METH_O, byte_array_object_converter__doc__},
90
91 static PyObject *
92 byte_array_object_converter_impl(PyObject *module, PyByteArrayObject *a);
93
94 static PyObject *
byte_array_object_converter(PyObject * module,PyObject * arg)95 byte_array_object_converter(PyObject *module, PyObject *arg)
96 {
97 PyObject *return_value = NULL;
98 PyByteArrayObject *a;
99
100 if (!PyByteArray_Check(arg)) {
101 _PyArg_BadArgument("byte_array_object_converter", "argument", "bytearray", arg);
102 goto exit;
103 }
104 a = (PyByteArrayObject *)arg;
105 return_value = byte_array_object_converter_impl(module, a);
106
107 exit:
108 return return_value;
109 }
110
111 PyDoc_STRVAR(unicode_converter__doc__,
112 "unicode_converter($module, a, /)\n"
113 "--\n"
114 "\n");
115
116 #define UNICODE_CONVERTER_METHODDEF \
117 {"unicode_converter", (PyCFunction)unicode_converter, METH_O, unicode_converter__doc__},
118
119 static PyObject *
120 unicode_converter_impl(PyObject *module, PyObject *a);
121
122 static PyObject *
unicode_converter(PyObject * module,PyObject * arg)123 unicode_converter(PyObject *module, PyObject *arg)
124 {
125 PyObject *return_value = NULL;
126 PyObject *a;
127
128 if (!PyUnicode_Check(arg)) {
129 _PyArg_BadArgument("unicode_converter", "argument", "str", arg);
130 goto exit;
131 }
132 if (PyUnicode_READY(arg) == -1) {
133 goto exit;
134 }
135 a = arg;
136 return_value = unicode_converter_impl(module, a);
137
138 exit:
139 return return_value;
140 }
141
142 PyDoc_STRVAR(bool_converter__doc__,
143 "bool_converter($module, a=True, b=True, c=True, /)\n"
144 "--\n"
145 "\n");
146
147 #define BOOL_CONVERTER_METHODDEF \
148 {"bool_converter", _PyCFunction_CAST(bool_converter), METH_FASTCALL, bool_converter__doc__},
149
150 static PyObject *
151 bool_converter_impl(PyObject *module, int a, int b, int c);
152
153 static PyObject *
bool_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)154 bool_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
155 {
156 PyObject *return_value = NULL;
157 int a = 1;
158 int b = 1;
159 int c = 1;
160
161 if (!_PyArg_CheckPositional("bool_converter", nargs, 0, 3)) {
162 goto exit;
163 }
164 if (nargs < 1) {
165 goto skip_optional;
166 }
167 a = PyObject_IsTrue(args[0]);
168 if (a < 0) {
169 goto exit;
170 }
171 if (nargs < 2) {
172 goto skip_optional;
173 }
174 b = PyObject_IsTrue(args[1]);
175 if (b < 0) {
176 goto exit;
177 }
178 if (nargs < 3) {
179 goto skip_optional;
180 }
181 c = _PyLong_AsInt(args[2]);
182 if (c == -1 && PyErr_Occurred()) {
183 goto exit;
184 }
185 skip_optional:
186 return_value = bool_converter_impl(module, a, b, c);
187
188 exit:
189 return return_value;
190 }
191
192 PyDoc_STRVAR(char_converter__doc__,
193 "char_converter($module, a=b\'A\', b=b\'\\x07\', c=b\'\\x08\', d=b\'\\t\', e=b\'\\n\',\n"
194 " f=b\'\\x0b\', g=b\'\\x0c\', h=b\'\\r\', i=b\'\"\', j=b\"\'\", k=b\'?\',\n"
195 " l=b\'\\\\\', m=b\'\\x00\', n=b\'\\xff\', /)\n"
196 "--\n"
197 "\n");
198
199 #define CHAR_CONVERTER_METHODDEF \
200 {"char_converter", _PyCFunction_CAST(char_converter), METH_FASTCALL, char_converter__doc__},
201
202 static PyObject *
203 char_converter_impl(PyObject *module, char a, char b, char c, char d, char e,
204 char f, char g, char h, char i, char j, char k, char l,
205 char m, char n);
206
207 static PyObject *
char_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)208 char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
209 {
210 PyObject *return_value = NULL;
211 char a = 'A';
212 char b = '\x07';
213 char c = '\x08';
214 char d = '\t';
215 char e = '\n';
216 char f = '\x0b';
217 char g = '\x0c';
218 char h = '\r';
219 char i = '"';
220 char j = '\'';
221 char k = '?';
222 char l = '\\';
223 char m = '\x00';
224 char n = '\xff';
225
226 if (!_PyArg_CheckPositional("char_converter", nargs, 0, 14)) {
227 goto exit;
228 }
229 if (nargs < 1) {
230 goto skip_optional;
231 }
232 if (PyBytes_Check(args[0]) && PyBytes_GET_SIZE(args[0]) == 1) {
233 a = PyBytes_AS_STRING(args[0])[0];
234 }
235 else if (PyByteArray_Check(args[0]) && PyByteArray_GET_SIZE(args[0]) == 1) {
236 a = PyByteArray_AS_STRING(args[0])[0];
237 }
238 else {
239 _PyArg_BadArgument("char_converter", "argument 1", "a byte string of length 1", args[0]);
240 goto exit;
241 }
242 if (nargs < 2) {
243 goto skip_optional;
244 }
245 if (PyBytes_Check(args[1]) && PyBytes_GET_SIZE(args[1]) == 1) {
246 b = PyBytes_AS_STRING(args[1])[0];
247 }
248 else if (PyByteArray_Check(args[1]) && PyByteArray_GET_SIZE(args[1]) == 1) {
249 b = PyByteArray_AS_STRING(args[1])[0];
250 }
251 else {
252 _PyArg_BadArgument("char_converter", "argument 2", "a byte string of length 1", args[1]);
253 goto exit;
254 }
255 if (nargs < 3) {
256 goto skip_optional;
257 }
258 if (PyBytes_Check(args[2]) && PyBytes_GET_SIZE(args[2]) == 1) {
259 c = PyBytes_AS_STRING(args[2])[0];
260 }
261 else if (PyByteArray_Check(args[2]) && PyByteArray_GET_SIZE(args[2]) == 1) {
262 c = PyByteArray_AS_STRING(args[2])[0];
263 }
264 else {
265 _PyArg_BadArgument("char_converter", "argument 3", "a byte string of length 1", args[2]);
266 goto exit;
267 }
268 if (nargs < 4) {
269 goto skip_optional;
270 }
271 if (PyBytes_Check(args[3]) && PyBytes_GET_SIZE(args[3]) == 1) {
272 d = PyBytes_AS_STRING(args[3])[0];
273 }
274 else if (PyByteArray_Check(args[3]) && PyByteArray_GET_SIZE(args[3]) == 1) {
275 d = PyByteArray_AS_STRING(args[3])[0];
276 }
277 else {
278 _PyArg_BadArgument("char_converter", "argument 4", "a byte string of length 1", args[3]);
279 goto exit;
280 }
281 if (nargs < 5) {
282 goto skip_optional;
283 }
284 if (PyBytes_Check(args[4]) && PyBytes_GET_SIZE(args[4]) == 1) {
285 e = PyBytes_AS_STRING(args[4])[0];
286 }
287 else if (PyByteArray_Check(args[4]) && PyByteArray_GET_SIZE(args[4]) == 1) {
288 e = PyByteArray_AS_STRING(args[4])[0];
289 }
290 else {
291 _PyArg_BadArgument("char_converter", "argument 5", "a byte string of length 1", args[4]);
292 goto exit;
293 }
294 if (nargs < 6) {
295 goto skip_optional;
296 }
297 if (PyBytes_Check(args[5]) && PyBytes_GET_SIZE(args[5]) == 1) {
298 f = PyBytes_AS_STRING(args[5])[0];
299 }
300 else if (PyByteArray_Check(args[5]) && PyByteArray_GET_SIZE(args[5]) == 1) {
301 f = PyByteArray_AS_STRING(args[5])[0];
302 }
303 else {
304 _PyArg_BadArgument("char_converter", "argument 6", "a byte string of length 1", args[5]);
305 goto exit;
306 }
307 if (nargs < 7) {
308 goto skip_optional;
309 }
310 if (PyBytes_Check(args[6]) && PyBytes_GET_SIZE(args[6]) == 1) {
311 g = PyBytes_AS_STRING(args[6])[0];
312 }
313 else if (PyByteArray_Check(args[6]) && PyByteArray_GET_SIZE(args[6]) == 1) {
314 g = PyByteArray_AS_STRING(args[6])[0];
315 }
316 else {
317 _PyArg_BadArgument("char_converter", "argument 7", "a byte string of length 1", args[6]);
318 goto exit;
319 }
320 if (nargs < 8) {
321 goto skip_optional;
322 }
323 if (PyBytes_Check(args[7]) && PyBytes_GET_SIZE(args[7]) == 1) {
324 h = PyBytes_AS_STRING(args[7])[0];
325 }
326 else if (PyByteArray_Check(args[7]) && PyByteArray_GET_SIZE(args[7]) == 1) {
327 h = PyByteArray_AS_STRING(args[7])[0];
328 }
329 else {
330 _PyArg_BadArgument("char_converter", "argument 8", "a byte string of length 1", args[7]);
331 goto exit;
332 }
333 if (nargs < 9) {
334 goto skip_optional;
335 }
336 if (PyBytes_Check(args[8]) && PyBytes_GET_SIZE(args[8]) == 1) {
337 i = PyBytes_AS_STRING(args[8])[0];
338 }
339 else if (PyByteArray_Check(args[8]) && PyByteArray_GET_SIZE(args[8]) == 1) {
340 i = PyByteArray_AS_STRING(args[8])[0];
341 }
342 else {
343 _PyArg_BadArgument("char_converter", "argument 9", "a byte string of length 1", args[8]);
344 goto exit;
345 }
346 if (nargs < 10) {
347 goto skip_optional;
348 }
349 if (PyBytes_Check(args[9]) && PyBytes_GET_SIZE(args[9]) == 1) {
350 j = PyBytes_AS_STRING(args[9])[0];
351 }
352 else if (PyByteArray_Check(args[9]) && PyByteArray_GET_SIZE(args[9]) == 1) {
353 j = PyByteArray_AS_STRING(args[9])[0];
354 }
355 else {
356 _PyArg_BadArgument("char_converter", "argument 10", "a byte string of length 1", args[9]);
357 goto exit;
358 }
359 if (nargs < 11) {
360 goto skip_optional;
361 }
362 if (PyBytes_Check(args[10]) && PyBytes_GET_SIZE(args[10]) == 1) {
363 k = PyBytes_AS_STRING(args[10])[0];
364 }
365 else if (PyByteArray_Check(args[10]) && PyByteArray_GET_SIZE(args[10]) == 1) {
366 k = PyByteArray_AS_STRING(args[10])[0];
367 }
368 else {
369 _PyArg_BadArgument("char_converter", "argument 11", "a byte string of length 1", args[10]);
370 goto exit;
371 }
372 if (nargs < 12) {
373 goto skip_optional;
374 }
375 if (PyBytes_Check(args[11]) && PyBytes_GET_SIZE(args[11]) == 1) {
376 l = PyBytes_AS_STRING(args[11])[0];
377 }
378 else if (PyByteArray_Check(args[11]) && PyByteArray_GET_SIZE(args[11]) == 1) {
379 l = PyByteArray_AS_STRING(args[11])[0];
380 }
381 else {
382 _PyArg_BadArgument("char_converter", "argument 12", "a byte string of length 1", args[11]);
383 goto exit;
384 }
385 if (nargs < 13) {
386 goto skip_optional;
387 }
388 if (PyBytes_Check(args[12]) && PyBytes_GET_SIZE(args[12]) == 1) {
389 m = PyBytes_AS_STRING(args[12])[0];
390 }
391 else if (PyByteArray_Check(args[12]) && PyByteArray_GET_SIZE(args[12]) == 1) {
392 m = PyByteArray_AS_STRING(args[12])[0];
393 }
394 else {
395 _PyArg_BadArgument("char_converter", "argument 13", "a byte string of length 1", args[12]);
396 goto exit;
397 }
398 if (nargs < 14) {
399 goto skip_optional;
400 }
401 if (PyBytes_Check(args[13]) && PyBytes_GET_SIZE(args[13]) == 1) {
402 n = PyBytes_AS_STRING(args[13])[0];
403 }
404 else if (PyByteArray_Check(args[13]) && PyByteArray_GET_SIZE(args[13]) == 1) {
405 n = PyByteArray_AS_STRING(args[13])[0];
406 }
407 else {
408 _PyArg_BadArgument("char_converter", "argument 14", "a byte string of length 1", args[13]);
409 goto exit;
410 }
411 skip_optional:
412 return_value = char_converter_impl(module, a, b, c, d, e, f, g, h, i, j, k, l, m, n);
413
414 exit:
415 return return_value;
416 }
417
418 PyDoc_STRVAR(unsigned_char_converter__doc__,
419 "unsigned_char_converter($module, a=12, b=34, c=56, /)\n"
420 "--\n"
421 "\n");
422
423 #define UNSIGNED_CHAR_CONVERTER_METHODDEF \
424 {"unsigned_char_converter", _PyCFunction_CAST(unsigned_char_converter), METH_FASTCALL, unsigned_char_converter__doc__},
425
426 static PyObject *
427 unsigned_char_converter_impl(PyObject *module, unsigned char a,
428 unsigned char b, unsigned char c);
429
430 static PyObject *
unsigned_char_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)431 unsigned_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
432 {
433 PyObject *return_value = NULL;
434 unsigned char a = 12;
435 unsigned char b = 34;
436 unsigned char c = 56;
437
438 if (!_PyArg_CheckPositional("unsigned_char_converter", nargs, 0, 3)) {
439 goto exit;
440 }
441 if (nargs < 1) {
442 goto skip_optional;
443 }
444 {
445 long ival = PyLong_AsLong(args[0]);
446 if (ival == -1 && PyErr_Occurred()) {
447 goto exit;
448 }
449 else if (ival < 0) {
450 PyErr_SetString(PyExc_OverflowError,
451 "unsigned byte integer is less than minimum");
452 goto exit;
453 }
454 else if (ival > UCHAR_MAX) {
455 PyErr_SetString(PyExc_OverflowError,
456 "unsigned byte integer is greater than maximum");
457 goto exit;
458 }
459 else {
460 a = (unsigned char) ival;
461 }
462 }
463 if (nargs < 2) {
464 goto skip_optional;
465 }
466 {
467 long ival = PyLong_AsLong(args[1]);
468 if (ival == -1 && PyErr_Occurred()) {
469 goto exit;
470 }
471 else if (ival < 0) {
472 PyErr_SetString(PyExc_OverflowError,
473 "unsigned byte integer is less than minimum");
474 goto exit;
475 }
476 else if (ival > UCHAR_MAX) {
477 PyErr_SetString(PyExc_OverflowError,
478 "unsigned byte integer is greater than maximum");
479 goto exit;
480 }
481 else {
482 b = (unsigned char) ival;
483 }
484 }
485 if (nargs < 3) {
486 goto skip_optional;
487 }
488 {
489 unsigned long ival = PyLong_AsUnsignedLongMask(args[2]);
490 if (ival == (unsigned long)-1 && PyErr_Occurred()) {
491 goto exit;
492 }
493 else {
494 c = (unsigned char) ival;
495 }
496 }
497 skip_optional:
498 return_value = unsigned_char_converter_impl(module, a, b, c);
499
500 exit:
501 return return_value;
502 }
503
504 PyDoc_STRVAR(short_converter__doc__,
505 "short_converter($module, a=12, /)\n"
506 "--\n"
507 "\n");
508
509 #define SHORT_CONVERTER_METHODDEF \
510 {"short_converter", _PyCFunction_CAST(short_converter), METH_FASTCALL, short_converter__doc__},
511
512 static PyObject *
513 short_converter_impl(PyObject *module, short a);
514
515 static PyObject *
short_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)516 short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
517 {
518 PyObject *return_value = NULL;
519 short a = 12;
520
521 if (!_PyArg_CheckPositional("short_converter", nargs, 0, 1)) {
522 goto exit;
523 }
524 if (nargs < 1) {
525 goto skip_optional;
526 }
527 {
528 long ival = PyLong_AsLong(args[0]);
529 if (ival == -1 && PyErr_Occurred()) {
530 goto exit;
531 }
532 else if (ival < SHRT_MIN) {
533 PyErr_SetString(PyExc_OverflowError,
534 "signed short integer is less than minimum");
535 goto exit;
536 }
537 else if (ival > SHRT_MAX) {
538 PyErr_SetString(PyExc_OverflowError,
539 "signed short integer is greater than maximum");
540 goto exit;
541 }
542 else {
543 a = (short) ival;
544 }
545 }
546 skip_optional:
547 return_value = short_converter_impl(module, a);
548
549 exit:
550 return return_value;
551 }
552
553 PyDoc_STRVAR(unsigned_short_converter__doc__,
554 "unsigned_short_converter($module, a=12, b=34, c=56, /)\n"
555 "--\n"
556 "\n");
557
558 #define UNSIGNED_SHORT_CONVERTER_METHODDEF \
559 {"unsigned_short_converter", _PyCFunction_CAST(unsigned_short_converter), METH_FASTCALL, unsigned_short_converter__doc__},
560
561 static PyObject *
562 unsigned_short_converter_impl(PyObject *module, unsigned short a,
563 unsigned short b, unsigned short c);
564
565 static PyObject *
unsigned_short_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)566 unsigned_short_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
567 {
568 PyObject *return_value = NULL;
569 unsigned short a = 12;
570 unsigned short b = 34;
571 unsigned short c = 56;
572
573 if (!_PyArg_CheckPositional("unsigned_short_converter", nargs, 0, 3)) {
574 goto exit;
575 }
576 if (nargs < 1) {
577 goto skip_optional;
578 }
579 if (!_PyLong_UnsignedShort_Converter(args[0], &a)) {
580 goto exit;
581 }
582 if (nargs < 2) {
583 goto skip_optional;
584 }
585 if (!_PyLong_UnsignedShort_Converter(args[1], &b)) {
586 goto exit;
587 }
588 if (nargs < 3) {
589 goto skip_optional;
590 }
591 c = (unsigned short)PyLong_AsUnsignedLongMask(args[2]);
592 if (c == (unsigned short)-1 && PyErr_Occurred()) {
593 goto exit;
594 }
595 skip_optional:
596 return_value = unsigned_short_converter_impl(module, a, b, c);
597
598 exit:
599 return return_value;
600 }
601
602 PyDoc_STRVAR(int_converter__doc__,
603 "int_converter($module, a=12, b=34, c=45, /)\n"
604 "--\n"
605 "\n");
606
607 #define INT_CONVERTER_METHODDEF \
608 {"int_converter", _PyCFunction_CAST(int_converter), METH_FASTCALL, int_converter__doc__},
609
610 static PyObject *
611 int_converter_impl(PyObject *module, int a, int b, int c);
612
613 static PyObject *
int_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)614 int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
615 {
616 PyObject *return_value = NULL;
617 int a = 12;
618 int b = 34;
619 int c = 45;
620
621 if (!_PyArg_CheckPositional("int_converter", nargs, 0, 3)) {
622 goto exit;
623 }
624 if (nargs < 1) {
625 goto skip_optional;
626 }
627 a = _PyLong_AsInt(args[0]);
628 if (a == -1 && PyErr_Occurred()) {
629 goto exit;
630 }
631 if (nargs < 2) {
632 goto skip_optional;
633 }
634 b = _PyLong_AsInt(args[1]);
635 if (b == -1 && PyErr_Occurred()) {
636 goto exit;
637 }
638 if (nargs < 3) {
639 goto skip_optional;
640 }
641 if (!PyUnicode_Check(args[2])) {
642 _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
643 goto exit;
644 }
645 if (PyUnicode_READY(args[2])) {
646 goto exit;
647 }
648 if (PyUnicode_GET_LENGTH(args[2]) != 1) {
649 _PyArg_BadArgument("int_converter", "argument 3", "a unicode character", args[2]);
650 goto exit;
651 }
652 c = PyUnicode_READ_CHAR(args[2], 0);
653 skip_optional:
654 return_value = int_converter_impl(module, a, b, c);
655
656 exit:
657 return return_value;
658 }
659
660 PyDoc_STRVAR(unsigned_int_converter__doc__,
661 "unsigned_int_converter($module, a=12, b=34, c=56, /)\n"
662 "--\n"
663 "\n");
664
665 #define UNSIGNED_INT_CONVERTER_METHODDEF \
666 {"unsigned_int_converter", _PyCFunction_CAST(unsigned_int_converter), METH_FASTCALL, unsigned_int_converter__doc__},
667
668 static PyObject *
669 unsigned_int_converter_impl(PyObject *module, unsigned int a, unsigned int b,
670 unsigned int c);
671
672 static PyObject *
unsigned_int_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)673 unsigned_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
674 {
675 PyObject *return_value = NULL;
676 unsigned int a = 12;
677 unsigned int b = 34;
678 unsigned int c = 56;
679
680 if (!_PyArg_CheckPositional("unsigned_int_converter", nargs, 0, 3)) {
681 goto exit;
682 }
683 if (nargs < 1) {
684 goto skip_optional;
685 }
686 if (!_PyLong_UnsignedInt_Converter(args[0], &a)) {
687 goto exit;
688 }
689 if (nargs < 2) {
690 goto skip_optional;
691 }
692 if (!_PyLong_UnsignedInt_Converter(args[1], &b)) {
693 goto exit;
694 }
695 if (nargs < 3) {
696 goto skip_optional;
697 }
698 c = (unsigned int)PyLong_AsUnsignedLongMask(args[2]);
699 if (c == (unsigned int)-1 && PyErr_Occurred()) {
700 goto exit;
701 }
702 skip_optional:
703 return_value = unsigned_int_converter_impl(module, a, b, c);
704
705 exit:
706 return return_value;
707 }
708
709 PyDoc_STRVAR(long_converter__doc__,
710 "long_converter($module, a=12, /)\n"
711 "--\n"
712 "\n");
713
714 #define LONG_CONVERTER_METHODDEF \
715 {"long_converter", _PyCFunction_CAST(long_converter), METH_FASTCALL, long_converter__doc__},
716
717 static PyObject *
718 long_converter_impl(PyObject *module, long a);
719
720 static PyObject *
long_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)721 long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
722 {
723 PyObject *return_value = NULL;
724 long a = 12;
725
726 if (!_PyArg_CheckPositional("long_converter", nargs, 0, 1)) {
727 goto exit;
728 }
729 if (nargs < 1) {
730 goto skip_optional;
731 }
732 a = PyLong_AsLong(args[0]);
733 if (a == -1 && PyErr_Occurred()) {
734 goto exit;
735 }
736 skip_optional:
737 return_value = long_converter_impl(module, a);
738
739 exit:
740 return return_value;
741 }
742
743 PyDoc_STRVAR(unsigned_long_converter__doc__,
744 "unsigned_long_converter($module, a=12, b=34, c=56, /)\n"
745 "--\n"
746 "\n");
747
748 #define UNSIGNED_LONG_CONVERTER_METHODDEF \
749 {"unsigned_long_converter", _PyCFunction_CAST(unsigned_long_converter), METH_FASTCALL, unsigned_long_converter__doc__},
750
751 static PyObject *
752 unsigned_long_converter_impl(PyObject *module, unsigned long a,
753 unsigned long b, unsigned long c);
754
755 static PyObject *
unsigned_long_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)756 unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
757 {
758 PyObject *return_value = NULL;
759 unsigned long a = 12;
760 unsigned long b = 34;
761 unsigned long c = 56;
762
763 if (!_PyArg_CheckPositional("unsigned_long_converter", nargs, 0, 3)) {
764 goto exit;
765 }
766 if (nargs < 1) {
767 goto skip_optional;
768 }
769 if (!_PyLong_UnsignedLong_Converter(args[0], &a)) {
770 goto exit;
771 }
772 if (nargs < 2) {
773 goto skip_optional;
774 }
775 if (!_PyLong_UnsignedLong_Converter(args[1], &b)) {
776 goto exit;
777 }
778 if (nargs < 3) {
779 goto skip_optional;
780 }
781 if (!PyLong_Check(args[2])) {
782 _PyArg_BadArgument("unsigned_long_converter", "argument 3", "int", args[2]);
783 goto exit;
784 }
785 c = PyLong_AsUnsignedLongMask(args[2]);
786 skip_optional:
787 return_value = unsigned_long_converter_impl(module, a, b, c);
788
789 exit:
790 return return_value;
791 }
792
793 PyDoc_STRVAR(long_long_converter__doc__,
794 "long_long_converter($module, a=12, /)\n"
795 "--\n"
796 "\n");
797
798 #define LONG_LONG_CONVERTER_METHODDEF \
799 {"long_long_converter", _PyCFunction_CAST(long_long_converter), METH_FASTCALL, long_long_converter__doc__},
800
801 static PyObject *
802 long_long_converter_impl(PyObject *module, long long a);
803
804 static PyObject *
long_long_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)805 long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
806 {
807 PyObject *return_value = NULL;
808 long long a = 12;
809
810 if (!_PyArg_CheckPositional("long_long_converter", nargs, 0, 1)) {
811 goto exit;
812 }
813 if (nargs < 1) {
814 goto skip_optional;
815 }
816 a = PyLong_AsLongLong(args[0]);
817 if (a == -1 && PyErr_Occurred()) {
818 goto exit;
819 }
820 skip_optional:
821 return_value = long_long_converter_impl(module, a);
822
823 exit:
824 return return_value;
825 }
826
827 PyDoc_STRVAR(unsigned_long_long_converter__doc__,
828 "unsigned_long_long_converter($module, a=12, b=34, c=56, /)\n"
829 "--\n"
830 "\n");
831
832 #define UNSIGNED_LONG_LONG_CONVERTER_METHODDEF \
833 {"unsigned_long_long_converter", _PyCFunction_CAST(unsigned_long_long_converter), METH_FASTCALL, unsigned_long_long_converter__doc__},
834
835 static PyObject *
836 unsigned_long_long_converter_impl(PyObject *module, unsigned long long a,
837 unsigned long long b, unsigned long long c);
838
839 static PyObject *
unsigned_long_long_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)840 unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
841 {
842 PyObject *return_value = NULL;
843 unsigned long long a = 12;
844 unsigned long long b = 34;
845 unsigned long long c = 56;
846
847 if (!_PyArg_CheckPositional("unsigned_long_long_converter", nargs, 0, 3)) {
848 goto exit;
849 }
850 if (nargs < 1) {
851 goto skip_optional;
852 }
853 if (!_PyLong_UnsignedLongLong_Converter(args[0], &a)) {
854 goto exit;
855 }
856 if (nargs < 2) {
857 goto skip_optional;
858 }
859 if (!_PyLong_UnsignedLongLong_Converter(args[1], &b)) {
860 goto exit;
861 }
862 if (nargs < 3) {
863 goto skip_optional;
864 }
865 if (!PyLong_Check(args[2])) {
866 _PyArg_BadArgument("unsigned_long_long_converter", "argument 3", "int", args[2]);
867 goto exit;
868 }
869 c = PyLong_AsUnsignedLongLongMask(args[2]);
870 skip_optional:
871 return_value = unsigned_long_long_converter_impl(module, a, b, c);
872
873 exit:
874 return return_value;
875 }
876
877 PyDoc_STRVAR(py_ssize_t_converter__doc__,
878 "py_ssize_t_converter($module, a=12, b=34, c=56, /)\n"
879 "--\n"
880 "\n");
881
882 #define PY_SSIZE_T_CONVERTER_METHODDEF \
883 {"py_ssize_t_converter", _PyCFunction_CAST(py_ssize_t_converter), METH_FASTCALL, py_ssize_t_converter__doc__},
884
885 static PyObject *
886 py_ssize_t_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
887 Py_ssize_t c);
888
889 static PyObject *
py_ssize_t_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)890 py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
891 {
892 PyObject *return_value = NULL;
893 Py_ssize_t a = 12;
894 Py_ssize_t b = 34;
895 Py_ssize_t c = 56;
896
897 if (!_PyArg_CheckPositional("py_ssize_t_converter", nargs, 0, 3)) {
898 goto exit;
899 }
900 if (nargs < 1) {
901 goto skip_optional;
902 }
903 {
904 Py_ssize_t ival = -1;
905 PyObject *iobj = _PyNumber_Index(args[0]);
906 if (iobj != NULL) {
907 ival = PyLong_AsSsize_t(iobj);
908 Py_DECREF(iobj);
909 }
910 if (ival == -1 && PyErr_Occurred()) {
911 goto exit;
912 }
913 a = ival;
914 }
915 if (nargs < 2) {
916 goto skip_optional;
917 }
918 {
919 Py_ssize_t ival = -1;
920 PyObject *iobj = _PyNumber_Index(args[1]);
921 if (iobj != NULL) {
922 ival = PyLong_AsSsize_t(iobj);
923 Py_DECREF(iobj);
924 }
925 if (ival == -1 && PyErr_Occurred()) {
926 goto exit;
927 }
928 b = ival;
929 }
930 if (nargs < 3) {
931 goto skip_optional;
932 }
933 if (!_Py_convert_optional_to_ssize_t(args[2], &c)) {
934 goto exit;
935 }
936 skip_optional:
937 return_value = py_ssize_t_converter_impl(module, a, b, c);
938
939 exit:
940 return return_value;
941 }
942
943 PyDoc_STRVAR(slice_index_converter__doc__,
944 "slice_index_converter($module, a=12, b=34, c=56, /)\n"
945 "--\n"
946 "\n");
947
948 #define SLICE_INDEX_CONVERTER_METHODDEF \
949 {"slice_index_converter", _PyCFunction_CAST(slice_index_converter), METH_FASTCALL, slice_index_converter__doc__},
950
951 static PyObject *
952 slice_index_converter_impl(PyObject *module, Py_ssize_t a, Py_ssize_t b,
953 Py_ssize_t c);
954
955 static PyObject *
slice_index_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)956 slice_index_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
957 {
958 PyObject *return_value = NULL;
959 Py_ssize_t a = 12;
960 Py_ssize_t b = 34;
961 Py_ssize_t c = 56;
962
963 if (!_PyArg_CheckPositional("slice_index_converter", nargs, 0, 3)) {
964 goto exit;
965 }
966 if (nargs < 1) {
967 goto skip_optional;
968 }
969 if (!_PyEval_SliceIndex(args[0], &a)) {
970 goto exit;
971 }
972 if (nargs < 2) {
973 goto skip_optional;
974 }
975 if (!_PyEval_SliceIndexNotNone(args[1], &b)) {
976 goto exit;
977 }
978 if (nargs < 3) {
979 goto skip_optional;
980 }
981 if (!_PyEval_SliceIndex(args[2], &c)) {
982 goto exit;
983 }
984 skip_optional:
985 return_value = slice_index_converter_impl(module, a, b, c);
986
987 exit:
988 return return_value;
989 }
990
991 PyDoc_STRVAR(size_t_converter__doc__,
992 "size_t_converter($module, a=12, /)\n"
993 "--\n"
994 "\n");
995
996 #define SIZE_T_CONVERTER_METHODDEF \
997 {"size_t_converter", _PyCFunction_CAST(size_t_converter), METH_FASTCALL, size_t_converter__doc__},
998
999 static PyObject *
1000 size_t_converter_impl(PyObject *module, size_t a);
1001
1002 static PyObject *
size_t_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)1003 size_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1004 {
1005 PyObject *return_value = NULL;
1006 size_t a = 12;
1007
1008 if (!_PyArg_CheckPositional("size_t_converter", nargs, 0, 1)) {
1009 goto exit;
1010 }
1011 if (nargs < 1) {
1012 goto skip_optional;
1013 }
1014 if (!_PyLong_Size_t_Converter(args[0], &a)) {
1015 goto exit;
1016 }
1017 skip_optional:
1018 return_value = size_t_converter_impl(module, a);
1019
1020 exit:
1021 return return_value;
1022 }
1023
1024 PyDoc_STRVAR(float_converter__doc__,
1025 "float_converter($module, a=12.5, /)\n"
1026 "--\n"
1027 "\n");
1028
1029 #define FLOAT_CONVERTER_METHODDEF \
1030 {"float_converter", _PyCFunction_CAST(float_converter), METH_FASTCALL, float_converter__doc__},
1031
1032 static PyObject *
1033 float_converter_impl(PyObject *module, float a);
1034
1035 static PyObject *
float_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)1036 float_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1037 {
1038 PyObject *return_value = NULL;
1039 float a = 12.5;
1040
1041 if (!_PyArg_CheckPositional("float_converter", nargs, 0, 1)) {
1042 goto exit;
1043 }
1044 if (nargs < 1) {
1045 goto skip_optional;
1046 }
1047 if (PyFloat_CheckExact(args[0])) {
1048 a = (float) (PyFloat_AS_DOUBLE(args[0]));
1049 }
1050 else
1051 {
1052 a = (float) PyFloat_AsDouble(args[0]);
1053 if (a == -1.0 && PyErr_Occurred()) {
1054 goto exit;
1055 }
1056 }
1057 skip_optional:
1058 return_value = float_converter_impl(module, a);
1059
1060 exit:
1061 return return_value;
1062 }
1063
1064 PyDoc_STRVAR(double_converter__doc__,
1065 "double_converter($module, a=12.5, /)\n"
1066 "--\n"
1067 "\n");
1068
1069 #define DOUBLE_CONVERTER_METHODDEF \
1070 {"double_converter", _PyCFunction_CAST(double_converter), METH_FASTCALL, double_converter__doc__},
1071
1072 static PyObject *
1073 double_converter_impl(PyObject *module, double a);
1074
1075 static PyObject *
double_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)1076 double_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1077 {
1078 PyObject *return_value = NULL;
1079 double a = 12.5;
1080
1081 if (!_PyArg_CheckPositional("double_converter", nargs, 0, 1)) {
1082 goto exit;
1083 }
1084 if (nargs < 1) {
1085 goto skip_optional;
1086 }
1087 if (PyFloat_CheckExact(args[0])) {
1088 a = PyFloat_AS_DOUBLE(args[0]);
1089 }
1090 else
1091 {
1092 a = PyFloat_AsDouble(args[0]);
1093 if (a == -1.0 && PyErr_Occurred()) {
1094 goto exit;
1095 }
1096 }
1097 skip_optional:
1098 return_value = double_converter_impl(module, a);
1099
1100 exit:
1101 return return_value;
1102 }
1103
1104 PyDoc_STRVAR(py_complex_converter__doc__,
1105 "py_complex_converter($module, a, /)\n"
1106 "--\n"
1107 "\n");
1108
1109 #define PY_COMPLEX_CONVERTER_METHODDEF \
1110 {"py_complex_converter", (PyCFunction)py_complex_converter, METH_O, py_complex_converter__doc__},
1111
1112 static PyObject *
1113 py_complex_converter_impl(PyObject *module, Py_complex a);
1114
1115 static PyObject *
py_complex_converter(PyObject * module,PyObject * arg)1116 py_complex_converter(PyObject *module, PyObject *arg)
1117 {
1118 PyObject *return_value = NULL;
1119 Py_complex a;
1120
1121 a = PyComplex_AsCComplex(arg);
1122 if (PyErr_Occurred()) {
1123 goto exit;
1124 }
1125 return_value = py_complex_converter_impl(module, a);
1126
1127 exit:
1128 return return_value;
1129 }
1130
1131 PyDoc_STRVAR(str_converter__doc__,
1132 "str_converter($module, a=\'a\', b=\'b\', c=\'c\', /)\n"
1133 "--\n"
1134 "\n");
1135
1136 #define STR_CONVERTER_METHODDEF \
1137 {"str_converter", _PyCFunction_CAST(str_converter), METH_FASTCALL, str_converter__doc__},
1138
1139 static PyObject *
1140 str_converter_impl(PyObject *module, const char *a, const char *b,
1141 const char *c, Py_ssize_t c_length);
1142
1143 static PyObject *
str_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)1144 str_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1145 {
1146 PyObject *return_value = NULL;
1147 const char *a = "a";
1148 const char *b = "b";
1149 const char *c = "c";
1150 Py_ssize_t c_length;
1151
1152 if (!_PyArg_ParseStack(args, nargs, "|sys#:str_converter",
1153 &a, &b, &c, &c_length)) {
1154 goto exit;
1155 }
1156 return_value = str_converter_impl(module, a, b, c, c_length);
1157
1158 exit:
1159 return return_value;
1160 }
1161
1162 PyDoc_STRVAR(str_converter_encoding__doc__,
1163 "str_converter_encoding($module, a, b, c, /)\n"
1164 "--\n"
1165 "\n");
1166
1167 #define STR_CONVERTER_ENCODING_METHODDEF \
1168 {"str_converter_encoding", _PyCFunction_CAST(str_converter_encoding), METH_FASTCALL, str_converter_encoding__doc__},
1169
1170 static PyObject *
1171 str_converter_encoding_impl(PyObject *module, char *a, char *b, char *c,
1172 Py_ssize_t c_length);
1173
1174 static PyObject *
str_converter_encoding(PyObject * module,PyObject * const * args,Py_ssize_t nargs)1175 str_converter_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1176 {
1177 PyObject *return_value = NULL;
1178 char *a = NULL;
1179 char *b = NULL;
1180 char *c = NULL;
1181 Py_ssize_t c_length;
1182
1183 if (!_PyArg_ParseStack(args, nargs, "esetet#:str_converter_encoding",
1184 "idna", &a, "idna", &b, "idna", &c, &c_length)) {
1185 goto exit;
1186 }
1187 return_value = str_converter_encoding_impl(module, a, b, c, c_length);
1188 /* Post parse cleanup for a */
1189 PyMem_FREE(a);
1190 /* Post parse cleanup for b */
1191 PyMem_FREE(b);
1192 /* Post parse cleanup for c */
1193 PyMem_FREE(c);
1194
1195 exit:
1196 return return_value;
1197 }
1198
1199 PyDoc_STRVAR(py_buffer_converter__doc__,
1200 "py_buffer_converter($module, a, b, /)\n"
1201 "--\n"
1202 "\n");
1203
1204 #define PY_BUFFER_CONVERTER_METHODDEF \
1205 {"py_buffer_converter", _PyCFunction_CAST(py_buffer_converter), METH_FASTCALL, py_buffer_converter__doc__},
1206
1207 static PyObject *
1208 py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b);
1209
1210 static PyObject *
py_buffer_converter(PyObject * module,PyObject * const * args,Py_ssize_t nargs)1211 py_buffer_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
1212 {
1213 PyObject *return_value = NULL;
1214 Py_buffer a = {NULL, NULL};
1215 Py_buffer b = {NULL, NULL};
1216
1217 if (!_PyArg_ParseStack(args, nargs, "z*w*:py_buffer_converter",
1218 &a, &b)) {
1219 goto exit;
1220 }
1221 return_value = py_buffer_converter_impl(module, &a, &b);
1222
1223 exit:
1224 /* Cleanup for a */
1225 if (a.obj) {
1226 PyBuffer_Release(&a);
1227 }
1228 /* Cleanup for b */
1229 if (b.obj) {
1230 PyBuffer_Release(&b);
1231 }
1232
1233 return return_value;
1234 }
1235
1236 PyDoc_STRVAR(keywords__doc__,
1237 "keywords($module, /, a, b)\n"
1238 "--\n"
1239 "\n");
1240
1241 #define KEYWORDS_METHODDEF \
1242 {"keywords", _PyCFunction_CAST(keywords), METH_FASTCALL|METH_KEYWORDS, keywords__doc__},
1243
1244 static PyObject *
1245 keywords_impl(PyObject *module, PyObject *a, PyObject *b);
1246
1247 static PyObject *
keywords(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1248 keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1249 {
1250 PyObject *return_value = NULL;
1251 static const char * const _keywords[] = {"a", "b", NULL};
1252 static _PyArg_Parser _parser = {NULL, _keywords, "keywords", 0};
1253 PyObject *argsbuf[2];
1254 PyObject *a;
1255 PyObject *b;
1256
1257 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
1258 if (!args) {
1259 goto exit;
1260 }
1261 a = args[0];
1262 b = args[1];
1263 return_value = keywords_impl(module, a, b);
1264
1265 exit:
1266 return return_value;
1267 }
1268
1269 PyDoc_STRVAR(keywords_kwonly__doc__,
1270 "keywords_kwonly($module, /, a, *, b)\n"
1271 "--\n"
1272 "\n");
1273
1274 #define KEYWORDS_KWONLY_METHODDEF \
1275 {"keywords_kwonly", _PyCFunction_CAST(keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly__doc__},
1276
1277 static PyObject *
1278 keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
1279
1280 static PyObject *
keywords_kwonly(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1281 keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1282 {
1283 PyObject *return_value = NULL;
1284 static const char * const _keywords[] = {"a", "b", NULL};
1285 static _PyArg_Parser _parser = {NULL, _keywords, "keywords_kwonly", 0};
1286 PyObject *argsbuf[2];
1287 PyObject *a;
1288 PyObject *b;
1289
1290 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
1291 if (!args) {
1292 goto exit;
1293 }
1294 a = args[0];
1295 b = args[1];
1296 return_value = keywords_kwonly_impl(module, a, b);
1297
1298 exit:
1299 return return_value;
1300 }
1301
1302 PyDoc_STRVAR(keywords_opt__doc__,
1303 "keywords_opt($module, /, a, b=None, c=None)\n"
1304 "--\n"
1305 "\n");
1306
1307 #define KEYWORDS_OPT_METHODDEF \
1308 {"keywords_opt", _PyCFunction_CAST(keywords_opt), METH_FASTCALL|METH_KEYWORDS, keywords_opt__doc__},
1309
1310 static PyObject *
1311 keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c);
1312
1313 static PyObject *
keywords_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1314 keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1315 {
1316 PyObject *return_value = NULL;
1317 static const char * const _keywords[] = {"a", "b", "c", NULL};
1318 static _PyArg_Parser _parser = {NULL, _keywords, "keywords_opt", 0};
1319 PyObject *argsbuf[3];
1320 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1321 PyObject *a;
1322 PyObject *b = Py_None;
1323 PyObject *c = Py_None;
1324
1325 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
1326 if (!args) {
1327 goto exit;
1328 }
1329 a = args[0];
1330 if (!noptargs) {
1331 goto skip_optional_pos;
1332 }
1333 if (args[1]) {
1334 b = args[1];
1335 if (!--noptargs) {
1336 goto skip_optional_pos;
1337 }
1338 }
1339 c = args[2];
1340 skip_optional_pos:
1341 return_value = keywords_opt_impl(module, a, b, c);
1342
1343 exit:
1344 return return_value;
1345 }
1346
1347 PyDoc_STRVAR(keywords_opt_kwonly__doc__,
1348 "keywords_opt_kwonly($module, /, a, b=None, *, c=None, d=None)\n"
1349 "--\n"
1350 "\n");
1351
1352 #define KEYWORDS_OPT_KWONLY_METHODDEF \
1353 {"keywords_opt_kwonly", _PyCFunction_CAST(keywords_opt_kwonly), METH_FASTCALL|METH_KEYWORDS, keywords_opt_kwonly__doc__},
1354
1355 static PyObject *
1356 keywords_opt_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
1357 PyObject *c, PyObject *d);
1358
1359 static PyObject *
keywords_opt_kwonly(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1360 keywords_opt_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1361 {
1362 PyObject *return_value = NULL;
1363 static const char * const _keywords[] = {"a", "b", "c", "d", NULL};
1364 static _PyArg_Parser _parser = {NULL, _keywords, "keywords_opt_kwonly", 0};
1365 PyObject *argsbuf[4];
1366 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1367 PyObject *a;
1368 PyObject *b = Py_None;
1369 PyObject *c = Py_None;
1370 PyObject *d = Py_None;
1371
1372 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
1373 if (!args) {
1374 goto exit;
1375 }
1376 a = args[0];
1377 if (!noptargs) {
1378 goto skip_optional_pos;
1379 }
1380 if (args[1]) {
1381 b = args[1];
1382 if (!--noptargs) {
1383 goto skip_optional_pos;
1384 }
1385 }
1386 skip_optional_pos:
1387 if (!noptargs) {
1388 goto skip_optional_kwonly;
1389 }
1390 if (args[2]) {
1391 c = args[2];
1392 if (!--noptargs) {
1393 goto skip_optional_kwonly;
1394 }
1395 }
1396 d = args[3];
1397 skip_optional_kwonly:
1398 return_value = keywords_opt_kwonly_impl(module, a, b, c, d);
1399
1400 exit:
1401 return return_value;
1402 }
1403
1404 PyDoc_STRVAR(keywords_kwonly_opt__doc__,
1405 "keywords_kwonly_opt($module, /, a, *, b=None, c=None)\n"
1406 "--\n"
1407 "\n");
1408
1409 #define KEYWORDS_KWONLY_OPT_METHODDEF \
1410 {"keywords_kwonly_opt", _PyCFunction_CAST(keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, keywords_kwonly_opt__doc__},
1411
1412 static PyObject *
1413 keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1414 PyObject *c);
1415
1416 static PyObject *
keywords_kwonly_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1417 keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1418 {
1419 PyObject *return_value = NULL;
1420 static const char * const _keywords[] = {"a", "b", "c", NULL};
1421 static _PyArg_Parser _parser = {NULL, _keywords, "keywords_kwonly_opt", 0};
1422 PyObject *argsbuf[3];
1423 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1424 PyObject *a;
1425 PyObject *b = Py_None;
1426 PyObject *c = Py_None;
1427
1428 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf);
1429 if (!args) {
1430 goto exit;
1431 }
1432 a = args[0];
1433 if (!noptargs) {
1434 goto skip_optional_kwonly;
1435 }
1436 if (args[1]) {
1437 b = args[1];
1438 if (!--noptargs) {
1439 goto skip_optional_kwonly;
1440 }
1441 }
1442 c = args[2];
1443 skip_optional_kwonly:
1444 return_value = keywords_kwonly_opt_impl(module, a, b, c);
1445
1446 exit:
1447 return return_value;
1448 }
1449
1450 PyDoc_STRVAR(posonly_keywords__doc__,
1451 "posonly_keywords($module, a, /, b)\n"
1452 "--\n"
1453 "\n");
1454
1455 #define POSONLY_KEYWORDS_METHODDEF \
1456 {"posonly_keywords", _PyCFunction_CAST(posonly_keywords), METH_FASTCALL|METH_KEYWORDS, posonly_keywords__doc__},
1457
1458 static PyObject *
1459 posonly_keywords_impl(PyObject *module, PyObject *a, PyObject *b);
1460
1461 static PyObject *
posonly_keywords(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1462 posonly_keywords(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1463 {
1464 PyObject *return_value = NULL;
1465 static const char * const _keywords[] = {"", "b", NULL};
1466 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_keywords", 0};
1467 PyObject *argsbuf[2];
1468 PyObject *a;
1469 PyObject *b;
1470
1471 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, argsbuf);
1472 if (!args) {
1473 goto exit;
1474 }
1475 a = args[0];
1476 b = args[1];
1477 return_value = posonly_keywords_impl(module, a, b);
1478
1479 exit:
1480 return return_value;
1481 }
1482
1483 PyDoc_STRVAR(posonly_kwonly__doc__,
1484 "posonly_kwonly($module, a, /, *, b)\n"
1485 "--\n"
1486 "\n");
1487
1488 #define POSONLY_KWONLY_METHODDEF \
1489 {"posonly_kwonly", _PyCFunction_CAST(posonly_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly__doc__},
1490
1491 static PyObject *
1492 posonly_kwonly_impl(PyObject *module, PyObject *a, PyObject *b);
1493
1494 static PyObject *
posonly_kwonly(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1495 posonly_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1496 {
1497 PyObject *return_value = NULL;
1498 static const char * const _keywords[] = {"", "b", NULL};
1499 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_kwonly", 0};
1500 PyObject *argsbuf[2];
1501 PyObject *a;
1502 PyObject *b;
1503
1504 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
1505 if (!args) {
1506 goto exit;
1507 }
1508 a = args[0];
1509 b = args[1];
1510 return_value = posonly_kwonly_impl(module, a, b);
1511
1512 exit:
1513 return return_value;
1514 }
1515
1516 PyDoc_STRVAR(posonly_keywords_kwonly__doc__,
1517 "posonly_keywords_kwonly($module, a, /, b, *, c)\n"
1518 "--\n"
1519 "\n");
1520
1521 #define POSONLY_KEYWORDS_KWONLY_METHODDEF \
1522 {"posonly_keywords_kwonly", _PyCFunction_CAST(posonly_keywords_kwonly), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly__doc__},
1523
1524 static PyObject *
1525 posonly_keywords_kwonly_impl(PyObject *module, PyObject *a, PyObject *b,
1526 PyObject *c);
1527
1528 static PyObject *
posonly_keywords_kwonly(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1529 posonly_keywords_kwonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1530 {
1531 PyObject *return_value = NULL;
1532 static const char * const _keywords[] = {"", "b", "c", NULL};
1533 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_keywords_kwonly", 0};
1534 PyObject *argsbuf[3];
1535 PyObject *a;
1536 PyObject *b;
1537 PyObject *c;
1538
1539 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
1540 if (!args) {
1541 goto exit;
1542 }
1543 a = args[0];
1544 b = args[1];
1545 c = args[2];
1546 return_value = posonly_keywords_kwonly_impl(module, a, b, c);
1547
1548 exit:
1549 return return_value;
1550 }
1551
1552 PyDoc_STRVAR(posonly_keywords_opt__doc__,
1553 "posonly_keywords_opt($module, a, /, b, c=None, d=None)\n"
1554 "--\n"
1555 "\n");
1556
1557 #define POSONLY_KEYWORDS_OPT_METHODDEF \
1558 {"posonly_keywords_opt", _PyCFunction_CAST(posonly_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt__doc__},
1559
1560 static PyObject *
1561 posonly_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1562 PyObject *c, PyObject *d);
1563
1564 static PyObject *
posonly_keywords_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1565 posonly_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1566 {
1567 PyObject *return_value = NULL;
1568 static const char * const _keywords[] = {"", "b", "c", "d", NULL};
1569 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_keywords_opt", 0};
1570 PyObject *argsbuf[4];
1571 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
1572 PyObject *a;
1573 PyObject *b;
1574 PyObject *c = Py_None;
1575 PyObject *d = Py_None;
1576
1577 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 4, 0, argsbuf);
1578 if (!args) {
1579 goto exit;
1580 }
1581 a = args[0];
1582 b = args[1];
1583 if (!noptargs) {
1584 goto skip_optional_pos;
1585 }
1586 if (args[2]) {
1587 c = args[2];
1588 if (!--noptargs) {
1589 goto skip_optional_pos;
1590 }
1591 }
1592 d = args[3];
1593 skip_optional_pos:
1594 return_value = posonly_keywords_opt_impl(module, a, b, c, d);
1595
1596 exit:
1597 return return_value;
1598 }
1599
1600 PyDoc_STRVAR(posonly_opt_keywords_opt__doc__,
1601 "posonly_opt_keywords_opt($module, a, b=None, /, c=None, d=None)\n"
1602 "--\n"
1603 "\n");
1604
1605 #define POSONLY_OPT_KEYWORDS_OPT_METHODDEF \
1606 {"posonly_opt_keywords_opt", _PyCFunction_CAST(posonly_opt_keywords_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt__doc__},
1607
1608 static PyObject *
1609 posonly_opt_keywords_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1610 PyObject *c, PyObject *d);
1611
1612 static PyObject *
posonly_opt_keywords_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1613 posonly_opt_keywords_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1614 {
1615 PyObject *return_value = NULL;
1616 static const char * const _keywords[] = {"", "", "c", "d", NULL};
1617 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_opt_keywords_opt", 0};
1618 PyObject *argsbuf[4];
1619 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1620 PyObject *a;
1621 PyObject *b = Py_None;
1622 PyObject *c = Py_None;
1623 PyObject *d = Py_None;
1624
1625 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 4, 0, argsbuf);
1626 if (!args) {
1627 goto exit;
1628 }
1629 a = args[0];
1630 if (nargs < 2) {
1631 goto skip_optional_posonly;
1632 }
1633 noptargs--;
1634 b = args[1];
1635 skip_optional_posonly:
1636 if (!noptargs) {
1637 goto skip_optional_pos;
1638 }
1639 if (args[2]) {
1640 c = args[2];
1641 if (!--noptargs) {
1642 goto skip_optional_pos;
1643 }
1644 }
1645 d = args[3];
1646 skip_optional_pos:
1647 return_value = posonly_opt_keywords_opt_impl(module, a, b, c, d);
1648
1649 exit:
1650 return return_value;
1651 }
1652
1653 PyDoc_STRVAR(posonly_kwonly_opt__doc__,
1654 "posonly_kwonly_opt($module, a, /, *, b, c=None, d=None)\n"
1655 "--\n"
1656 "\n");
1657
1658 #define POSONLY_KWONLY_OPT_METHODDEF \
1659 {"posonly_kwonly_opt", _PyCFunction_CAST(posonly_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_kwonly_opt__doc__},
1660
1661 static PyObject *
1662 posonly_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1663 PyObject *c, PyObject *d);
1664
1665 static PyObject *
posonly_kwonly_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1666 posonly_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1667 {
1668 PyObject *return_value = NULL;
1669 static const char * const _keywords[] = {"", "b", "c", "d", NULL};
1670 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_kwonly_opt", 0};
1671 PyObject *argsbuf[4];
1672 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
1673 PyObject *a;
1674 PyObject *b;
1675 PyObject *c = Py_None;
1676 PyObject *d = Py_None;
1677
1678 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 1, argsbuf);
1679 if (!args) {
1680 goto exit;
1681 }
1682 a = args[0];
1683 b = args[1];
1684 if (!noptargs) {
1685 goto skip_optional_kwonly;
1686 }
1687 if (args[2]) {
1688 c = args[2];
1689 if (!--noptargs) {
1690 goto skip_optional_kwonly;
1691 }
1692 }
1693 d = args[3];
1694 skip_optional_kwonly:
1695 return_value = posonly_kwonly_opt_impl(module, a, b, c, d);
1696
1697 exit:
1698 return return_value;
1699 }
1700
1701 PyDoc_STRVAR(posonly_opt_kwonly_opt__doc__,
1702 "posonly_opt_kwonly_opt($module, a, b=None, /, *, c=None, d=None)\n"
1703 "--\n"
1704 "\n");
1705
1706 #define POSONLY_OPT_KWONLY_OPT_METHODDEF \
1707 {"posonly_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_kwonly_opt__doc__},
1708
1709 static PyObject *
1710 posonly_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1711 PyObject *c, PyObject *d);
1712
1713 static PyObject *
posonly_opt_kwonly_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1714 posonly_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1715 {
1716 PyObject *return_value = NULL;
1717 static const char * const _keywords[] = {"", "", "c", "d", NULL};
1718 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_opt_kwonly_opt", 0};
1719 PyObject *argsbuf[4];
1720 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1721 PyObject *a;
1722 PyObject *b = Py_None;
1723 PyObject *c = Py_None;
1724 PyObject *d = Py_None;
1725
1726 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 2, 0, argsbuf);
1727 if (!args) {
1728 goto exit;
1729 }
1730 a = args[0];
1731 if (nargs < 2) {
1732 goto skip_optional_posonly;
1733 }
1734 noptargs--;
1735 b = args[1];
1736 skip_optional_posonly:
1737 if (!noptargs) {
1738 goto skip_optional_kwonly;
1739 }
1740 if (args[2]) {
1741 c = args[2];
1742 if (!--noptargs) {
1743 goto skip_optional_kwonly;
1744 }
1745 }
1746 d = args[3];
1747 skip_optional_kwonly:
1748 return_value = posonly_opt_kwonly_opt_impl(module, a, b, c, d);
1749
1750 exit:
1751 return return_value;
1752 }
1753
1754 PyDoc_STRVAR(posonly_keywords_kwonly_opt__doc__,
1755 "posonly_keywords_kwonly_opt($module, a, /, b, *, c, d=None, e=None)\n"
1756 "--\n"
1757 "\n");
1758
1759 #define POSONLY_KEYWORDS_KWONLY_OPT_METHODDEF \
1760 {"posonly_keywords_kwonly_opt", _PyCFunction_CAST(posonly_keywords_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_kwonly_opt__doc__},
1761
1762 static PyObject *
1763 posonly_keywords_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *b,
1764 PyObject *c, PyObject *d, PyObject *e);
1765
1766 static PyObject *
posonly_keywords_kwonly_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1767 posonly_keywords_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1768 {
1769 PyObject *return_value = NULL;
1770 static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
1771 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_keywords_kwonly_opt", 0};
1772 PyObject *argsbuf[5];
1773 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 3;
1774 PyObject *a;
1775 PyObject *b;
1776 PyObject *c;
1777 PyObject *d = Py_None;
1778 PyObject *e = Py_None;
1779
1780 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 2, 1, argsbuf);
1781 if (!args) {
1782 goto exit;
1783 }
1784 a = args[0];
1785 b = args[1];
1786 c = args[2];
1787 if (!noptargs) {
1788 goto skip_optional_kwonly;
1789 }
1790 if (args[3]) {
1791 d = args[3];
1792 if (!--noptargs) {
1793 goto skip_optional_kwonly;
1794 }
1795 }
1796 e = args[4];
1797 skip_optional_kwonly:
1798 return_value = posonly_keywords_kwonly_opt_impl(module, a, b, c, d, e);
1799
1800 exit:
1801 return return_value;
1802 }
1803
1804 PyDoc_STRVAR(posonly_keywords_opt_kwonly_opt__doc__,
1805 "posonly_keywords_opt_kwonly_opt($module, a, /, b, c=None, *, d=None,\n"
1806 " e=None)\n"
1807 "--\n"
1808 "\n");
1809
1810 #define POSONLY_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
1811 {"posonly_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_keywords_opt_kwonly_opt__doc__},
1812
1813 static PyObject *
1814 posonly_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
1815 PyObject *b, PyObject *c, PyObject *d,
1816 PyObject *e);
1817
1818 static PyObject *
posonly_keywords_opt_kwonly_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1819 posonly_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1820 {
1821 PyObject *return_value = NULL;
1822 static const char * const _keywords[] = {"", "b", "c", "d", "e", NULL};
1823 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_keywords_opt_kwonly_opt", 0};
1824 PyObject *argsbuf[5];
1825 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
1826 PyObject *a;
1827 PyObject *b;
1828 PyObject *c = Py_None;
1829 PyObject *d = Py_None;
1830 PyObject *e = Py_None;
1831
1832 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 2, 3, 0, argsbuf);
1833 if (!args) {
1834 goto exit;
1835 }
1836 a = args[0];
1837 b = args[1];
1838 if (!noptargs) {
1839 goto skip_optional_pos;
1840 }
1841 if (args[2]) {
1842 c = args[2];
1843 if (!--noptargs) {
1844 goto skip_optional_pos;
1845 }
1846 }
1847 skip_optional_pos:
1848 if (!noptargs) {
1849 goto skip_optional_kwonly;
1850 }
1851 if (args[3]) {
1852 d = args[3];
1853 if (!--noptargs) {
1854 goto skip_optional_kwonly;
1855 }
1856 }
1857 e = args[4];
1858 skip_optional_kwonly:
1859 return_value = posonly_keywords_opt_kwonly_opt_impl(module, a, b, c, d, e);
1860
1861 exit:
1862 return return_value;
1863 }
1864
1865 PyDoc_STRVAR(posonly_opt_keywords_opt_kwonly_opt__doc__,
1866 "posonly_opt_keywords_opt_kwonly_opt($module, a, b=None, /, c=None, *,\n"
1867 " d=None)\n"
1868 "--\n"
1869 "\n");
1870
1871 #define POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \
1872 {"posonly_opt_keywords_opt_kwonly_opt", _PyCFunction_CAST(posonly_opt_keywords_opt_kwonly_opt), METH_FASTCALL|METH_KEYWORDS, posonly_opt_keywords_opt_kwonly_opt__doc__},
1873
1874 static PyObject *
1875 posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
1876 PyObject *b, PyObject *c,
1877 PyObject *d);
1878
1879 static PyObject *
posonly_opt_keywords_opt_kwonly_opt(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1880 posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1881 {
1882 PyObject *return_value = NULL;
1883 static const char * const _keywords[] = {"", "", "c", "d", NULL};
1884 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_opt_keywords_opt_kwonly_opt", 0};
1885 PyObject *argsbuf[4];
1886 Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
1887 PyObject *a;
1888 PyObject *b = Py_None;
1889 PyObject *c = Py_None;
1890 PyObject *d = Py_None;
1891
1892 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf);
1893 if (!args) {
1894 goto exit;
1895 }
1896 a = args[0];
1897 if (nargs < 2) {
1898 goto skip_optional_posonly;
1899 }
1900 noptargs--;
1901 b = args[1];
1902 skip_optional_posonly:
1903 if (!noptargs) {
1904 goto skip_optional_pos;
1905 }
1906 if (args[2]) {
1907 c = args[2];
1908 if (!--noptargs) {
1909 goto skip_optional_pos;
1910 }
1911 }
1912 skip_optional_pos:
1913 if (!noptargs) {
1914 goto skip_optional_kwonly;
1915 }
1916 d = args[3];
1917 skip_optional_kwonly:
1918 return_value = posonly_opt_keywords_opt_kwonly_opt_impl(module, a, b, c, d);
1919
1920 exit:
1921 return return_value;
1922 }
1923
1924 PyDoc_STRVAR(keyword_only_parameter__doc__,
1925 "keyword_only_parameter($module, /, *, a)\n"
1926 "--\n"
1927 "\n");
1928
1929 #define KEYWORD_ONLY_PARAMETER_METHODDEF \
1930 {"keyword_only_parameter", _PyCFunction_CAST(keyword_only_parameter), METH_FASTCALL|METH_KEYWORDS, keyword_only_parameter__doc__},
1931
1932 static PyObject *
1933 keyword_only_parameter_impl(PyObject *module, PyObject *a);
1934
1935 static PyObject *
keyword_only_parameter(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1936 keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1937 {
1938 PyObject *return_value = NULL;
1939 static const char * const _keywords[] = {"a", NULL};
1940 static _PyArg_Parser _parser = {NULL, _keywords, "keyword_only_parameter", 0};
1941 PyObject *argsbuf[1];
1942 PyObject *a;
1943
1944 args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 1, argsbuf);
1945 if (!args) {
1946 goto exit;
1947 }
1948 a = args[0];
1949 return_value = keyword_only_parameter_impl(module, a);
1950
1951 exit:
1952 return return_value;
1953 }
1954
1955 PyDoc_STRVAR(posonly_vararg__doc__,
1956 "posonly_vararg($module, a, /, b, *args)\n"
1957 "--\n"
1958 "\n");
1959
1960 #define POSONLY_VARARG_METHODDEF \
1961 {"posonly_vararg", _PyCFunction_CAST(posonly_vararg), METH_FASTCALL|METH_KEYWORDS, posonly_vararg__doc__},
1962
1963 static PyObject *
1964 posonly_vararg_impl(PyObject *module, PyObject *a, PyObject *b,
1965 PyObject *args);
1966
1967 static PyObject *
posonly_vararg(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)1968 posonly_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
1969 {
1970 PyObject *return_value = NULL;
1971 static const char * const _keywords[] = {"", "b", NULL};
1972 static _PyArg_Parser _parser = {NULL, _keywords, "posonly_vararg", 0};
1973 PyObject *argsbuf[3];
1974 PyObject *a;
1975 PyObject *b;
1976 PyObject *__clinic_args = NULL;
1977
1978 args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, 2, argsbuf);
1979 if (!args) {
1980 goto exit;
1981 }
1982 a = args[0];
1983 b = args[1];
1984 __clinic_args = args[2];
1985 return_value = posonly_vararg_impl(module, a, b, __clinic_args);
1986
1987 exit:
1988 Py_XDECREF(__clinic_args);
1989 return return_value;
1990 }
1991
1992 PyDoc_STRVAR(vararg_and_posonly__doc__,
1993 "vararg_and_posonly($module, a, /, *args)\n"
1994 "--\n"
1995 "\n");
1996
1997 #define VARARG_AND_POSONLY_METHODDEF \
1998 {"vararg_and_posonly", _PyCFunction_CAST(vararg_and_posonly), METH_FASTCALL, vararg_and_posonly__doc__},
1999
2000 static PyObject *
2001 vararg_and_posonly_impl(PyObject *module, PyObject *a, PyObject *args);
2002
2003 static PyObject *
vararg_and_posonly(PyObject * module,PyObject * const * args,Py_ssize_t nargs)2004 vararg_and_posonly(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2005 {
2006 PyObject *return_value = NULL;
2007 PyObject *a;
2008 PyObject *__clinic_args = NULL;
2009
2010 if (!_PyArg_CheckPositional("vararg_and_posonly", nargs, 1, PY_SSIZE_T_MAX)) {
2011 goto exit;
2012 }
2013 a = args[0];
2014 __clinic_args = PyTuple_New(nargs - 1);
2015 if (!__clinic_args) {
2016 goto exit;
2017 }
2018 for (Py_ssize_t i = 0; i < nargs - 1; ++i) {
2019 PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[1 + i]));
2020 }
2021 return_value = vararg_and_posonly_impl(module, a, __clinic_args);
2022
2023 exit:
2024 Py_XDECREF(__clinic_args);
2025 return return_value;
2026 }
2027
2028 PyDoc_STRVAR(vararg__doc__,
2029 "vararg($module, /, a, *args)\n"
2030 "--\n"
2031 "\n");
2032
2033 #define VARARG_METHODDEF \
2034 {"vararg", _PyCFunction_CAST(vararg), METH_FASTCALL|METH_KEYWORDS, vararg__doc__},
2035
2036 static PyObject *
2037 vararg_impl(PyObject *module, PyObject *a, PyObject *args);
2038
2039 static PyObject *
vararg(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)2040 vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2041 {
2042 PyObject *return_value = NULL;
2043 static const char * const _keywords[] = {"a", NULL};
2044 static _PyArg_Parser _parser = {NULL, _keywords, "vararg", 0};
2045 PyObject *argsbuf[2];
2046 PyObject *a;
2047 PyObject *__clinic_args = NULL;
2048
2049 args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
2050 if (!args) {
2051 goto exit;
2052 }
2053 a = args[0];
2054 __clinic_args = args[1];
2055 return_value = vararg_impl(module, a, __clinic_args);
2056
2057 exit:
2058 Py_XDECREF(__clinic_args);
2059 return return_value;
2060 }
2061
2062 PyDoc_STRVAR(vararg_with_default__doc__,
2063 "vararg_with_default($module, /, a, *args, b=False)\n"
2064 "--\n"
2065 "\n");
2066
2067 #define VARARG_WITH_DEFAULT_METHODDEF \
2068 {"vararg_with_default", _PyCFunction_CAST(vararg_with_default), METH_FASTCALL|METH_KEYWORDS, vararg_with_default__doc__},
2069
2070 static PyObject *
2071 vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
2072 int b);
2073
2074 static PyObject *
vararg_with_default(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)2075 vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2076 {
2077 PyObject *return_value = NULL;
2078 static const char * const _keywords[] = {"a", "b", NULL};
2079 static _PyArg_Parser _parser = {NULL, _keywords, "vararg_with_default", 0};
2080 PyObject *argsbuf[3];
2081 Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2082 PyObject *a;
2083 PyObject *__clinic_args = NULL;
2084 int b = 0;
2085
2086 args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
2087 if (!args) {
2088 goto exit;
2089 }
2090 a = args[0];
2091 __clinic_args = args[1];
2092 if (!noptargs) {
2093 goto skip_optional_kwonly;
2094 }
2095 b = PyObject_IsTrue(args[2]);
2096 if (b < 0) {
2097 goto exit;
2098 }
2099 skip_optional_kwonly:
2100 return_value = vararg_with_default_impl(module, a, __clinic_args, b);
2101
2102 exit:
2103 Py_XDECREF(__clinic_args);
2104 return return_value;
2105 }
2106
2107 PyDoc_STRVAR(vararg_with_only_defaults__doc__,
2108 "vararg_with_only_defaults($module, /, *args, b=None)\n"
2109 "--\n"
2110 "\n");
2111
2112 #define VARARG_WITH_ONLY_DEFAULTS_METHODDEF \
2113 {"vararg_with_only_defaults", _PyCFunction_CAST(vararg_with_only_defaults), METH_FASTCALL|METH_KEYWORDS, vararg_with_only_defaults__doc__},
2114
2115 static PyObject *
2116 vararg_with_only_defaults_impl(PyObject *module, PyObject *args, PyObject *b);
2117
2118 static PyObject *
vararg_with_only_defaults(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)2119 vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2120 {
2121 PyObject *return_value = NULL;
2122 static const char * const _keywords[] = {"b", NULL};
2123 static _PyArg_Parser _parser = {NULL, _keywords, "vararg_with_only_defaults", 0};
2124 PyObject *argsbuf[2];
2125 Py_ssize_t noptargs = 0 + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
2126 PyObject *__clinic_args = NULL;
2127 PyObject *b = Py_None;
2128
2129 args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, 0, argsbuf);
2130 if (!args) {
2131 goto exit;
2132 }
2133 __clinic_args = args[0];
2134 if (!noptargs) {
2135 goto skip_optional_kwonly;
2136 }
2137 b = args[1];
2138 skip_optional_kwonly:
2139 return_value = vararg_with_only_defaults_impl(module, __clinic_args, b);
2140
2141 exit:
2142 Py_XDECREF(__clinic_args);
2143 return return_value;
2144 }
2145
2146 PyDoc_STRVAR(gh_32092_oob__doc__,
2147 "gh_32092_oob($module, /, pos1, pos2, *varargs, kw1=None, kw2=None)\n"
2148 "--\n"
2149 "\n"
2150 "Proof-of-concept of GH-32092 OOB bug.");
2151
2152 #define GH_32092_OOB_METHODDEF \
2153 {"gh_32092_oob", _PyCFunction_CAST(gh_32092_oob), METH_FASTCALL|METH_KEYWORDS, gh_32092_oob__doc__},
2154
2155 static PyObject *
2156 gh_32092_oob_impl(PyObject *module, PyObject *pos1, PyObject *pos2,
2157 PyObject *varargs, PyObject *kw1, PyObject *kw2);
2158
2159 static PyObject *
gh_32092_oob(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)2160 gh_32092_oob(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2161 {
2162 PyObject *return_value = NULL;
2163 static const char * const _keywords[] = {"pos1", "pos2", "kw1", "kw2", NULL};
2164 static _PyArg_Parser _parser = {NULL, _keywords, "gh_32092_oob", 0};
2165 PyObject *argsbuf[5];
2166 Py_ssize_t noptargs = Py_MIN(nargs, 2) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 2;
2167 PyObject *pos1;
2168 PyObject *pos2;
2169 PyObject *varargs = NULL;
2170 PyObject *kw1 = Py_None;
2171 PyObject *kw2 = Py_None;
2172
2173 args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 2, 2, 0, 2, argsbuf);
2174 if (!args) {
2175 goto exit;
2176 }
2177 pos1 = args[0];
2178 pos2 = args[1];
2179 varargs = args[2];
2180 if (!noptargs) {
2181 goto skip_optional_kwonly;
2182 }
2183 if (args[3]) {
2184 kw1 = args[3];
2185 if (!--noptargs) {
2186 goto skip_optional_kwonly;
2187 }
2188 }
2189 kw2 = args[4];
2190 skip_optional_kwonly:
2191 return_value = gh_32092_oob_impl(module, pos1, pos2, varargs, kw1, kw2);
2192
2193 exit:
2194 Py_XDECREF(varargs);
2195 return return_value;
2196 }
2197
2198 PyDoc_STRVAR(gh_32092_kw_pass__doc__,
2199 "gh_32092_kw_pass($module, /, pos, *args, kw=None)\n"
2200 "--\n"
2201 "\n"
2202 "Proof-of-concept of GH-32092 keyword args passing bug.");
2203
2204 #define GH_32092_KW_PASS_METHODDEF \
2205 {"gh_32092_kw_pass", _PyCFunction_CAST(gh_32092_kw_pass), METH_FASTCALL|METH_KEYWORDS, gh_32092_kw_pass__doc__},
2206
2207 static PyObject *
2208 gh_32092_kw_pass_impl(PyObject *module, PyObject *pos, PyObject *args,
2209 PyObject *kw);
2210
2211 static PyObject *
gh_32092_kw_pass(PyObject * module,PyObject * const * args,Py_ssize_t nargs,PyObject * kwnames)2212 gh_32092_kw_pass(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
2213 {
2214 PyObject *return_value = NULL;
2215 static const char * const _keywords[] = {"pos", "kw", NULL};
2216 static _PyArg_Parser _parser = {NULL, _keywords, "gh_32092_kw_pass", 0};
2217 PyObject *argsbuf[3];
2218 Py_ssize_t noptargs = Py_MIN(nargs, 1) + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1;
2219 PyObject *pos;
2220 PyObject *__clinic_args = NULL;
2221 PyObject *kw = Py_None;
2222
2223 args = _PyArg_UnpackKeywordsWithVararg(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, 1, argsbuf);
2224 if (!args) {
2225 goto exit;
2226 }
2227 pos = args[0];
2228 __clinic_args = args[1];
2229 if (!noptargs) {
2230 goto skip_optional_kwonly;
2231 }
2232 kw = args[2];
2233 skip_optional_kwonly:
2234 return_value = gh_32092_kw_pass_impl(module, pos, __clinic_args, kw);
2235
2236 exit:
2237 Py_XDECREF(__clinic_args);
2238 return return_value;
2239 }
2240
2241 PyDoc_STRVAR(gh_99233_refcount__doc__,
2242 "gh_99233_refcount($module, /, *args)\n"
2243 "--\n"
2244 "\n"
2245 "Proof-of-concept of GH-99233 refcount error bug.");
2246
2247 #define GH_99233_REFCOUNT_METHODDEF \
2248 {"gh_99233_refcount", _PyCFunction_CAST(gh_99233_refcount), METH_FASTCALL, gh_99233_refcount__doc__},
2249
2250 static PyObject *
2251 gh_99233_refcount_impl(PyObject *module, PyObject *args);
2252
2253 static PyObject *
gh_99233_refcount(PyObject * module,PyObject * const * args,Py_ssize_t nargs)2254 gh_99233_refcount(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2255 {
2256 PyObject *return_value = NULL;
2257 PyObject *__clinic_args = NULL;
2258
2259 if (!_PyArg_CheckPositional("gh_99233_refcount", nargs, 0, PY_SSIZE_T_MAX)) {
2260 goto exit;
2261 }
2262 __clinic_args = PyTuple_New(nargs - 0);
2263 if (!__clinic_args) {
2264 goto exit;
2265 }
2266 for (Py_ssize_t i = 0; i < nargs - 0; ++i) {
2267 PyTuple_SET_ITEM(__clinic_args, i, Py_NewRef(args[0 + i]));
2268 }
2269 return_value = gh_99233_refcount_impl(module, __clinic_args);
2270
2271 exit:
2272 Py_XDECREF(__clinic_args);
2273 return return_value;
2274 }
2275
2276 PyDoc_STRVAR(gh_99240_double_free__doc__,
2277 "gh_99240_double_free($module, a, b, /)\n"
2278 "--\n"
2279 "\n"
2280 "Proof-of-concept of GH-99240 double-free bug.");
2281
2282 #define GH_99240_DOUBLE_FREE_METHODDEF \
2283 {"gh_99240_double_free", _PyCFunction_CAST(gh_99240_double_free), METH_FASTCALL, gh_99240_double_free__doc__},
2284
2285 static PyObject *
2286 gh_99240_double_free_impl(PyObject *module, char *a, char *b);
2287
2288 static PyObject *
gh_99240_double_free(PyObject * module,PyObject * const * args,Py_ssize_t nargs)2289 gh_99240_double_free(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
2290 {
2291 PyObject *return_value = NULL;
2292 char *a = NULL;
2293 char *b = NULL;
2294
2295 if (!_PyArg_ParseStack(args, nargs, "eses:gh_99240_double_free",
2296 "idna", &a, "idna", &b)) {
2297 goto exit;
2298 }
2299 return_value = gh_99240_double_free_impl(module, a, b);
2300 /* Post parse cleanup for a */
2301 PyMem_FREE(a);
2302 /* Post parse cleanup for b */
2303 PyMem_FREE(b);
2304
2305 exit:
2306 return return_value;
2307 }
2308 /*[clinic end generated code: output=6b719efc1b8bd2c8 input=a9049054013a1b77]*/
2309