1/* Module definition and import interface */
2
3#ifndef Py_IMPORT_H
4#define Py_IMPORT_H
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
10PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
11PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
12 const char *name, /* UTF-8 encoded string */
13 PyObject *co
14 );
15PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
16 const char *name, /* UTF-8 encoded string */
17 PyObject *co,
18 const char *pathname /* decoded from the filesystem encoding */
19 );
20PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
21 const char *name, /* UTF-8 encoded string */
22 PyObject *co,
23 const char *pathname, /* decoded from the filesystem encoding */
24 const char *cpathname /* decoded from the filesystem encoding */
25 );
26#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
27PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
28 PyObject *name,
29 PyObject *co,
30 PyObject *pathname,
31 PyObject *cpathname
32 );
33#endif
34PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
35#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
36PyAPI_FUNC(PyObject *) PyImport_GetModule(PyObject *name);
37#endif
38#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
39PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
40 PyObject *name
41 );
42#endif
43PyAPI_FUNC(PyObject *) PyImport_AddModule(
44 const char *name /* UTF-8 encoded string */
45 );
46PyAPI_FUNC(PyObject *) PyImport_ImportModule(
47 const char *name /* UTF-8 encoded string */
48 );
49PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
50 const char *name /* UTF-8 encoded string */
51 );
52PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
53 const char *name, /* UTF-8 encoded string */
54 PyObject *globals,
55 PyObject *locals,
56 PyObject *fromlist,
57 int level
58 );
59#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
60PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
61 PyObject *name,
62 PyObject *globals,
63 PyObject *locals,
64 PyObject *fromlist,
65 int level
66 );
67#endif
68
69#define PyImport_ImportModuleEx(n, g, l, f) \
70 PyImport_ImportModuleLevel(n, g, l, f, 0)
71
72PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
73PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
74PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
75#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
76PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
77 PyObject *name
78 );
79#endif
80PyAPI_FUNC(int) PyImport_ImportFrozenModule(
81 const char *name /* UTF-8 encoded string */
82 );
83
84PyAPI_FUNC(int) PyImport_AppendInittab(
85 const char *name, /* ASCII encoded string */
86 PyObject* (*initfunc)(void)
87 );
88
89#ifndef Py_LIMITED_API
90# define Py_CPYTHON_IMPORT_H
91# include "cpython/import.h"
92# undef Py_CPYTHON_IMPORT_H
93#endif
94
95#ifdef __cplusplus
96}
97#endif
98#endif /* !Py_IMPORT_H */
99

source code of include/python3.10/import.h