1 2 /* Module definition and import interface */ 3 4 #ifndef Py_IMPORT_H 5 #define Py_IMPORT_H 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 #ifndef Py_LIMITED_API 11 PyAPI_FUNC(_PyInitError) _PyImportZip_Init(void); 12 13 PyMODINIT_FUNC PyInit__imp(void); 14 #endif /* !Py_LIMITED_API */ 15 PyAPI_FUNC(long) PyImport_GetMagicNumber(void); 16 PyAPI_FUNC(const char *) PyImport_GetMagicTag(void); 17 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule( 18 const char *name, /* UTF-8 encoded string */ 19 PyObject *co 20 ); 21 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( 22 const char *name, /* UTF-8 encoded string */ 23 PyObject *co, 24 const char *pathname /* decoded from the filesystem encoding */ 25 ); 26 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames( 27 const char *name, /* UTF-8 encoded string */ 28 PyObject *co, 29 const char *pathname, /* decoded from the filesystem encoding */ 30 const char *cpathname /* decoded from the filesystem encoding */ 31 ); 32 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 33 PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject( 34 PyObject *name, 35 PyObject *co, 36 PyObject *pathname, 37 PyObject *cpathname 38 ); 39 #endif 40 PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void); 41 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000 42 PyAPI_FUNC(PyObject *) PyImport_GetModule(PyObject *name); 43 #endif 44 #ifndef Py_LIMITED_API 45 PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *); 46 PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(struct _Py_Identifier *name); 47 PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name, 48 PyObject *modules); 49 PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module); 50 PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module); 51 #endif 52 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 53 PyAPI_FUNC(PyObject *) PyImport_AddModuleObject( 54 PyObject *name 55 ); 56 #endif 57 PyAPI_FUNC(PyObject *) PyImport_AddModule( 58 const char *name /* UTF-8 encoded string */ 59 ); 60 PyAPI_FUNC(PyObject *) PyImport_ImportModule( 61 const char *name /* UTF-8 encoded string */ 62 ); 63 PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock( 64 const char *name /* UTF-8 encoded string */ 65 ); 66 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel( 67 const char *name, /* UTF-8 encoded string */ 68 PyObject *globals, 69 PyObject *locals, 70 PyObject *fromlist, 71 int level 72 ); 73 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 74 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject( 75 PyObject *name, 76 PyObject *globals, 77 PyObject *locals, 78 PyObject *fromlist, 79 int level 80 ); 81 #endif 82 83 #define PyImport_ImportModuleEx(n, g, l, f) \ 84 PyImport_ImportModuleLevel(n, g, l, f, 0) 85 86 PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path); 87 PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); 88 PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); 89 PyAPI_FUNC(void) PyImport_Cleanup(void); 90 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 91 PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject( 92 PyObject *name 93 ); 94 #endif 95 PyAPI_FUNC(int) PyImport_ImportFrozenModule( 96 const char *name /* UTF-8 encoded string */ 97 ); 98 99 #ifndef Py_LIMITED_API 100 PyAPI_FUNC(void) _PyImport_AcquireLock(void); 101 PyAPI_FUNC(int) _PyImport_ReleaseLock(void); 102 103 PyAPI_FUNC(void) _PyImport_ReInitLock(void); 104 105 PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin( 106 const char *name, /* UTF-8 encoded string */ 107 PyObject *modules 108 ); 109 PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *); 110 PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObjectEx(PyObject *, PyObject *, 111 PyObject *); 112 PyAPI_FUNC(int) _PyImport_FixupBuiltin( 113 PyObject *mod, 114 const char *name, /* UTF-8 encoded string */ 115 PyObject *modules 116 ); 117 PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, 118 PyObject *, PyObject *); 119 120 struct _inittab { 121 const char *name; /* ASCII encoded string */ 122 PyObject* (*initfunc)(void); 123 }; 124 PyAPI_DATA(struct _inittab *) PyImport_Inittab; 125 PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); 126 #endif /* Py_LIMITED_API */ 127 128 PyAPI_DATA(PyTypeObject) PyNullImporter_Type; 129 130 PyAPI_FUNC(int) PyImport_AppendInittab( 131 const char *name, /* ASCII encoded string */ 132 PyObject* (*initfunc)(void) 133 ); 134 135 #ifndef Py_LIMITED_API 136 struct _frozen { 137 const char *name; /* ASCII encoded string */ 138 const unsigned char *code; 139 int size; 140 }; 141 142 /* Embedding apps may change this pointer to point to their favorite 143 collection of frozen modules: */ 144 145 PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules; 146 #endif 147 148 #ifdef __cplusplus 149 } 150 #endif 151 #endif /* !Py_IMPORT_H */ 152