1#ifndef Py_CPYTHON_IMPORT_H
2# error "this header file must not be included directly"
3#endif
4
5PyMODINIT_FUNC PyInit__imp(void);
6
7PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *);
8
9PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name);
10PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module);
11PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module);
12
13PyAPI_FUNC(void) _PyImport_AcquireLock(PyInterpreterState *interp);
14PyAPI_FUNC(int) _PyImport_ReleaseLock(PyInterpreterState *interp);
15
16PyAPI_FUNC(int) _PyImport_FixupBuiltin(
17 PyObject *mod,
18 const char *name, /* UTF-8 encoded string */
19 PyObject *modules
20 );
21PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *,
22 PyObject *, PyObject *);
23
24struct _inittab {
25 const char *name; /* ASCII encoded string */
26 PyObject* (*initfunc)(void);
27};
28// This is not used after Py_Initialize() is called.
29PyAPI_DATA(struct _inittab *) PyImport_Inittab;
30PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
31
32struct _frozen {
33 const char *name; /* ASCII encoded string */
34 const unsigned char *code;
35 int size;
36 int is_package;
37 PyObject *(*get_code)(void);
38};
39
40/* Embedding apps may change this pointer to point to their favorite
41 collection of frozen modules: */
42
43PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
44
45PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *);
46PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *);
47

source code of include/python3.12/cpython/import.h