1- use crate :: { PyInterpreterState , PyObject } ;
1+ #[ cfg( any( not( PyPy ) , Py_3_14 ) ) ]
2+ use crate :: PyObject ;
3+ #[ cfg( any( not( PyPy ) , Py_3_14 ) ) ]
4+ use std:: ffi:: c_char;
25#[ cfg( not( PyPy ) ) ]
3- use std:: ffi:: c_uchar;
4- use std:: ffi:: { c_char, c_int} ;
5-
6- // skipped PyInit__imp
7-
8- extern "C" {
9- pub fn _PyImport_IsInitialized ( state : * mut PyInterpreterState ) -> c_int ;
10- // skipped _PyImport_GetModuleId
11- pub fn _PyImport_SetModule ( name : * mut PyObject , module : * mut PyObject ) -> c_int ;
12- pub fn _PyImport_SetModuleString ( name : * const c_char , module : * mut PyObject ) -> c_int ;
13- pub fn _PyImport_AcquireLock ( ) ;
14- pub fn _PyImport_ReleaseLock ( ) -> c_int ;
15- #[ cfg( not( Py_3_9 ) ) ]
16- pub fn _PyImport_FindBuiltin ( name : * const c_char , modules : * mut PyObject ) -> * mut PyObject ;
17- #[ cfg( not( Py_3_11 ) ) ]
18- pub fn _PyImport_FindExtensionObject ( a : * mut PyObject , b : * mut PyObject ) -> * mut PyObject ;
19- pub fn _PyImport_FixupBuiltin (
20- module : * mut PyObject ,
21- name : * const c_char ,
22- modules : * mut PyObject ,
23- ) -> c_int ;
24- pub fn _PyImport_FixupExtensionObject (
25- a : * mut PyObject ,
26- b : * mut PyObject ,
27- c : * mut PyObject ,
28- d : * mut PyObject ,
29- ) -> c_int ;
30- }
6+ use std:: ffi:: { c_int, c_uchar} ;
317
328#[ cfg( not( PyPy ) ) ]
339#[ repr( C ) ]
@@ -41,9 +17,7 @@ pub struct _inittab {
4117extern "C" {
4218 #[ cfg( not( PyPy ) ) ]
4319 pub static mut PyImport_Inittab : * mut _inittab ;
44- }
4520
46- extern "C" {
4721 #[ cfg( not( PyPy ) ) ]
4822 pub fn PyImport_ExtendInittab ( newtab : * mut _inittab ) -> c_int ;
4923}
@@ -65,8 +39,15 @@ pub struct _frozen {
6539extern "C" {
6640 #[ cfg( not( PyPy ) ) ]
6741 pub static mut PyImport_FrozenModules : * const _frozen ;
68- }
6942
70- // skipped _PyImport_FrozenBootstrap
71- // skipped _PyImport_FrozenStdlib
72- // skipped _PyImport_FrozenTest
43+ #[ cfg( Py_3_14 ) ]
44+ pub fn PyImport_ImportModuleAttr (
45+ mod_name : * mut PyObject ,
46+ attr_name : * mut PyObject ,
47+ ) -> * mut PyObject ;
48+ #[ cfg( Py_3_14 ) ]
49+ pub fn PyImport_ImportModuleAttrString (
50+ mod_name : * const c_char ,
51+ attr_name : * const c_char ,
52+ ) -> * mut PyObject ;
53+ }
0 commit comments