Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/python3.12/moduleobject.h
$ cat -n /usr/include/python3.12/moduleobject.h 1 2 /* Module object interface */ 3 4 #ifndef Py_MODULEOBJECT_H 5 #define Py_MODULEOBJECT_H 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 PyAPI_DATA(PyTypeObject) PyModule_Type; 11 12 #define PyModule_Check(op) PyObject_TypeCheck((op), &PyModule_Type) 13 #define PyModule_CheckExact(op) Py_IS_TYPE((op), &PyModule_Type) 14 15 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 16 PyAPI_FUNC(PyObject *) PyModule_NewObject( 17 PyObject *name 18 ); 19 #endif 20 PyAPI_FUNC(PyObject *) PyModule_New( 21 const char *name /* UTF-8 encoded string */ 22 ); 23 PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *); 24 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 25 PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *); 26 #endif 27 PyAPI_FUNC(const char *) PyModule_GetName(PyObject *); 28 Py_DEPRECATED(3.2) PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *); 29 PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *); 30 #ifndef Py_LIMITED_API 31 PyAPI_FUNC(void) _PyModule_Clear(PyObject *); 32 PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *); 33 PyAPI_FUNC(int) _PyModuleSpec_IsInitializing(PyObject *); 34 #endif 35 PyAPI_FUNC(PyModuleDef*) PyModule_GetDef(PyObject*); 36 PyAPI_FUNC(void*) PyModule_GetState(PyObject*); 37 38 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 39 /* New in 3.5 */ 40 PyAPI_FUNC(PyObject *) PyModuleDef_Init(PyModuleDef*); 41 PyAPI_DATA(PyTypeObject) PyModuleDef_Type; 42 #endif 43 44 typedef struct PyModuleDef_Base { 45 PyObject_HEAD 46 /* The function used to re-initialize the module. 47 This is only set for legacy (single-phase init) extension modules 48 and only used for those that support multiple initializations 49 (m_size >= 0). 50 It is set by _PyImport_LoadDynamicModuleWithSpec() 51 and _imp.create_builtin(). */ 52 PyObject* (*m_init)(void); 53 /* The module's index into its interpreter's modules_by_index cache. 54 This is set for all extension modules but only used for legacy ones. 55 (See PyInterpreterState.modules_by_index for more info.) 56 It is set by PyModuleDef_Init(). */ 57 Py_ssize_t m_index; 58 /* A copy of the module's __dict__ after the first time it was loaded. 59 This is only set/used for legacy modules that do not support 60 multiple initializations. 61 It is set by _PyImport_FixupExtensionObject(). */ 62 PyObject* m_copy; 63 } PyModuleDef_Base; 64 65 #define PyModuleDef_HEAD_INIT { \ 66 PyObject_HEAD_INIT(_Py_NULL) \ 67 _Py_NULL, /* m_init */ \ 68 0, /* m_index */ \ 69 _Py_NULL, /* m_copy */ \ 70 } 71 72 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 73 /* New in 3.5 */ 74 struct PyModuleDef_Slot { 75 int slot; 76 void *value; 77 }; 78 79 #define Py_mod_create 1 80 #define Py_mod_exec 2 81 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000 82 # define Py_mod_multiple_interpreters 3 83 #endif 84 85 #ifndef Py_LIMITED_API 86 #define _Py_mod_LAST_SLOT 3 87 #endif 88 89 #endif /* New in 3.5 */ 90 91 /* for Py_mod_multiple_interpreters: */ 92 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000 93 # define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0) 94 # define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1) 95 # define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2) 96 #endif 97 98 struct PyModuleDef { 99 PyModuleDef_Base m_base; 100 const char* m_name; 101 const char* m_doc; 102 Py_ssize_t m_size; 103 PyMethodDef *m_methods; 104 PyModuleDef_Slot *m_slots; 105 traverseproc m_traverse; 106 inquiry m_clear; 107 freefunc m_free; 108 }; 109 110 111 // Internal C API 112 #ifdef Py_BUILD_CORE 113 extern int _PyModule_IsExtension(PyObject *obj); 114 #endif 115 116 #ifdef __cplusplus 117 } 118 #endif 119 #endif /* !Py_MODULEOBJECT_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™