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(void) _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 >= 0x03030000
42 PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
43     PyObject *name
44     );
45 #endif
46 PyAPI_FUNC(PyObject *) PyImport_AddModule(
47     const char *name            /* UTF-8 encoded string */
48     );
49 PyAPI_FUNC(PyObject *) PyImport_ImportModule(
50     const char *name            /* UTF-8 encoded string */
51     );
52 PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
53     const char *name            /* UTF-8 encoded string */
54     );
55 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
56     const char *name,           /* UTF-8 encoded string */
57     PyObject *globals,
58     PyObject *locals,
59     PyObject *fromlist,
60     int level
61     );
62 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
63 PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
64     PyObject *name,
65     PyObject *globals,
66     PyObject *locals,
67     PyObject *fromlist,
68     int level
69     );
70 #endif
71 
72 #define PyImport_ImportModuleEx(n, g, l, f) \
73     PyImport_ImportModuleLevel(n, g, l, f, 0)
74 
75 PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
76 PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
77 PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
78 PyAPI_FUNC(void) PyImport_Cleanup(void);
79 #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
80 PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
81     PyObject *name
82     );
83 #endif
84 PyAPI_FUNC(int) PyImport_ImportFrozenModule(
85     const char *name            /* UTF-8 encoded string */
86     );
87 
88 #ifndef Py_LIMITED_API
89 #ifdef WITH_THREAD
90 PyAPI_FUNC(void) _PyImport_AcquireLock(void);
91 PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
92 #else
93 #define _PyImport_AcquireLock()
94 #define _PyImport_ReleaseLock() 1
95 #endif
96 
97 PyAPI_FUNC(void) _PyImport_ReInitLock(void);
98 
99 PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin(
100     const char *name            /* UTF-8 encoded string */
101     );
102 PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *);
103 PyAPI_FUNC(int) _PyImport_FixupBuiltin(
104     PyObject *mod,
105     const char *name            /* UTF-8 encoded string */
106     );
107 PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *);
108 
109 struct _inittab {
110     const char *name;           /* ASCII encoded string */
111     PyObject* (*initfunc)(void);
112 };
113 PyAPI_DATA(struct _inittab *) PyImport_Inittab;
114 PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
115 #endif /* Py_LIMITED_API */
116 
117 PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
118 
119 PyAPI_FUNC(int) PyImport_AppendInittab(
120     const char *name,           /* ASCII encoded string */
121     PyObject* (*initfunc)(void)
122     );
123 
124 #ifndef Py_LIMITED_API
125 struct _frozen {
126     const char *name;                 /* ASCII encoded string */
127     const unsigned char *code;
128     int size;
129 };
130 
131 /* Embedding apps may change this pointer to point to their favorite
132    collection of frozen modules: */
133 
134 PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
135 #endif
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 #endif /* !Py_IMPORT_H */
141