Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:18:08

0001 #ifndef Py_INTERNAL_MODULEOBJECT_H
0002 #define Py_INTERNAL_MODULEOBJECT_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006 
0007 #ifndef Py_BUILD_CORE
0008 #  error "this header requires Py_BUILD_CORE define"
0009 #endif
0010 
0011 typedef struct {
0012     PyObject_HEAD
0013     PyObject *md_dict;
0014     PyModuleDef *md_def;
0015     void *md_state;
0016     PyObject *md_weaklist;
0017     // for logging purposes after md_dict is cleared
0018     PyObject *md_name;
0019 } PyModuleObject;
0020 
0021 static inline PyModuleDef* _PyModule_GetDef(PyObject *mod) {
0022     assert(PyModule_Check(mod));
0023     return ((PyModuleObject *)mod)->md_def;
0024 }
0025 
0026 static inline void* _PyModule_GetState(PyObject* mod) {
0027     assert(PyModule_Check(mod));
0028     return ((PyModuleObject *)mod)->md_state;
0029 }
0030 
0031 static inline PyObject* _PyModule_GetDict(PyObject *mod) {
0032     assert(PyModule_Check(mod));
0033     PyObject *dict = ((PyModuleObject *)mod) -> md_dict;
0034     // _PyModule_GetDict(mod) must not be used after calling module_clear(mod)
0035     assert(dict != NULL);
0036     return dict;
0037 }
0038 
0039 PyObject* _Py_module_getattro_impl(PyModuleObject *m, PyObject *name, int suppress);
0040 PyObject* _Py_module_getattro(PyModuleObject *m, PyObject *name);
0041 
0042 #ifdef __cplusplus
0043 }
0044 #endif
0045 #endif /* !Py_INTERNAL_MODULEOBJECT_H */