1 | n/a | /* |
---|
2 | n/a | * C extensions module to test importing multiple modules from one compiled |
---|
3 | n/a | * file (issue16421). This file defines 3 modules (_testimportmodule, |
---|
4 | n/a | * foo, bar), only the first one is called the same as the compiled file. |
---|
5 | n/a | */ |
---|
6 | n/a | #include<Python.h> |
---|
7 | n/a | |
---|
8 | n/a | static struct PyModuleDef _testimportmultiple = { |
---|
9 | n/a | PyModuleDef_HEAD_INIT, |
---|
10 | n/a | "_testimportmultiple", |
---|
11 | n/a | "_testimportmultiple doc", |
---|
12 | n/a | -1, |
---|
13 | n/a | NULL, |
---|
14 | n/a | NULL, |
---|
15 | n/a | NULL, |
---|
16 | n/a | NULL, |
---|
17 | n/a | NULL |
---|
18 | n/a | }; |
---|
19 | n/a | |
---|
20 | n/a | PyMODINIT_FUNC PyInit__testimportmultiple(void) |
---|
21 | n/a | { |
---|
22 | n/a | return PyModule_Create(&_testimportmultiple); |
---|
23 | n/a | } |
---|
24 | n/a | |
---|
25 | n/a | static struct PyModuleDef _foomodule = { |
---|
26 | n/a | PyModuleDef_HEAD_INIT, |
---|
27 | n/a | "_testimportmultiple_foo", |
---|
28 | n/a | "_testimportmultiple_foo doc", |
---|
29 | n/a | -1, |
---|
30 | n/a | NULL, |
---|
31 | n/a | NULL, |
---|
32 | n/a | NULL, |
---|
33 | n/a | NULL, |
---|
34 | n/a | NULL |
---|
35 | n/a | }; |
---|
36 | n/a | |
---|
37 | n/a | PyMODINIT_FUNC PyInit__testimportmultiple_foo(void) |
---|
38 | n/a | { |
---|
39 | n/a | return PyModule_Create(&_foomodule); |
---|
40 | n/a | } |
---|
41 | n/a | |
---|
42 | n/a | static struct PyModuleDef _barmodule = { |
---|
43 | n/a | PyModuleDef_HEAD_INIT, |
---|
44 | n/a | "_testimportmultiple_bar", |
---|
45 | n/a | "_testimportmultiple_bar doc", |
---|
46 | n/a | -1, |
---|
47 | n/a | NULL, |
---|
48 | n/a | NULL, |
---|
49 | n/a | NULL, |
---|
50 | n/a | NULL, |
---|
51 | n/a | NULL |
---|
52 | n/a | }; |
---|
53 | n/a | |
---|
54 | n/a | PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){ |
---|
55 | n/a | return PyModule_Create(&_barmodule); |
---|
56 | n/a | } |
---|
57 | n/a | |
---|