summaryrefslogtreecommitdiffstats
path: root/Modules/_testlimitedcapi.c
blob: fb5cdb6ca9e1d34e69df2efcfdfc763f4e8c2a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * Test the limited C API.
 *
 * The 'test_*' functions exported by this module are run as part of the
 * standard Python regression test, via Lib/test/test_capi.py.
 */

#include "_testlimitedcapi/parts.h"

static PyMethodDef TestMethods[] = {
    {NULL, NULL} /* sentinel */
};

static struct PyModuleDef _testlimitedcapimodule = {
    PyModuleDef_HEAD_INIT,
    .m_name = "_testlimitedcapi",
    .m_size = 0,
    .m_methods = TestMethods,
};

PyMODINIT_FUNC
PyInit__testlimitedcapi(void)
{
    PyObject *mod = PyModule_Create(&_testlimitedcapimodule);
    if (mod == NULL) {
        return NULL;
    }
#ifdef Py_GIL_DISABLED
    PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
#endif

    if (_PyTestLimitedCAPI_Init_Abstract(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_ByteArray(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Bytes(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Complex(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Dict(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Float(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_HeaptypeRelative(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_List(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Long(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Object(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_PyOS(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Set(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Sys(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_Unicode(mod) < 0) {
        return NULL;
    }
    if (_PyTestLimitedCAPI_Init_VectorcallLimited(mod) < 0) {
        return NULL;
    }
    return mod;
}