| 1 |
/*[clinic input] |
| 2 |
preserve |
| 3 |
[clinic start generated code]*/ |
| 4 |
|
| 5 |
PyDoc_STRVAR(_testlimitedcapi_pack_full_version__doc__, |
| 6 |
"pack_full_version($module, major, minor, micro, level, serial, /)\n" |
| 7 |
"--\n" |
| 8 |
"\n"); |
| 9 |
|
| 10 |
#define _TESTLIMITEDCAPI_PACK_FULL_VERSION_METHODDEF \ |
| 11 |
{"pack_full_version", (PyCFunction)(void(*)(void))_testlimitedcapi_pack_full_version, METH_FASTCALL, _testlimitedcapi_pack_full_version__doc__}, |
| 12 |
|
| 13 |
static PyObject * |
| 14 |
_testlimitedcapi_pack_full_version_impl(PyObject *module, int major, |
| 15 |
int minor, int micro, int level, |
| 16 |
int serial); |
| 17 |
|
| 18 |
static PyObject * |
| 19 |
_testlimitedcapi_pack_full_version(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 20 |
{ |
| 21 |
PyObject *return_value = NULL; |
| 22 |
int major; |
| 23 |
int minor; |
| 24 |
int micro; |
| 25 |
int level; |
| 26 |
int serial; |
| 27 |
|
| 28 |
if (nargs != 5) { |
| 29 |
PyErr_Format(PyExc_TypeError, "pack_full_version expected 5 arguments, got %zd", nargs); |
| 30 |
goto exit; |
| 31 |
} |
| 32 |
major = PyLong_AsInt(args[0]); |
| 33 |
if (major == -1 && PyErr_Occurred()) { |
| 34 |
goto exit; |
| 35 |
} |
| 36 |
minor = PyLong_AsInt(args[1]); |
| 37 |
if (minor == -1 && PyErr_Occurred()) { |
| 38 |
goto exit; |
| 39 |
} |
| 40 |
micro = PyLong_AsInt(args[2]); |
| 41 |
if (micro == -1 && PyErr_Occurred()) { |
| 42 |
goto exit; |
| 43 |
} |
| 44 |
level = PyLong_AsInt(args[3]); |
| 45 |
if (level == -1 && PyErr_Occurred()) { |
| 46 |
goto exit; |
| 47 |
} |
| 48 |
serial = PyLong_AsInt(args[4]); |
| 49 |
if (serial == -1 && PyErr_Occurred()) { |
| 50 |
goto exit; |
| 51 |
} |
| 52 |
return_value = _testlimitedcapi_pack_full_version_impl(module, major, minor, micro, level, serial); |
| 53 |
|
| 54 |
exit: |
| 55 |
return return_value; |
| 56 |
} |
| 57 |
|
| 58 |
PyDoc_STRVAR(_testlimitedcapi_pack_version__doc__, |
| 59 |
"pack_version($module, major, minor, /)\n" |
| 60 |
"--\n" |
| 61 |
"\n"); |
| 62 |
|
| 63 |
#define _TESTLIMITEDCAPI_PACK_VERSION_METHODDEF \ |
| 64 |
{"pack_version", (PyCFunction)(void(*)(void))_testlimitedcapi_pack_version, METH_FASTCALL, _testlimitedcapi_pack_version__doc__}, |
| 65 |
|
| 66 |
static PyObject * |
| 67 |
_testlimitedcapi_pack_version_impl(PyObject *module, int major, int minor); |
| 68 |
|
| 69 |
static PyObject * |
| 70 |
_testlimitedcapi_pack_version(PyObject *module, PyObject *const *args, Py_ssize_t nargs) |
| 71 |
{ |
| 72 |
PyObject *return_value = NULL; |
| 73 |
int major; |
| 74 |
int minor; |
| 75 |
|
| 76 |
if (nargs != 2) { |
| 77 |
PyErr_Format(PyExc_TypeError, "pack_version expected 2 arguments, got %zd", nargs); |
| 78 |
goto exit; |
| 79 |
} |
| 80 |
major = PyLong_AsInt(args[0]); |
| 81 |
if (major == -1 && PyErr_Occurred()) { |
| 82 |
goto exit; |
| 83 |
} |
| 84 |
minor = PyLong_AsInt(args[1]); |
| 85 |
if (minor == -1 && PyErr_Occurred()) { |
| 86 |
goto exit; |
| 87 |
} |
| 88 |
return_value = _testlimitedcapi_pack_version_impl(module, major, minor); |
| 89 |
|
| 90 |
exit: |
| 91 |
return return_value; |
| 92 |
} |
| 93 |
/*[clinic end generated code: output=aed3e226da77f2d2 input=a9049054013a1b77]*/ |