xref: /third_party/python/Include/cpython/import.h (revision 7db96d56)
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(void);
14PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
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};
28PyAPI_DATA(struct _inittab *) PyImport_Inittab;
29PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
30
31struct _frozen {
32    const char *name;                 /* ASCII encoded string */
33    const unsigned char *code;
34    int size;
35    int is_package;
36    PyObject *(*get_code)(void);
37};
38
39/* Embedding apps may change this pointer to point to their favorite
40   collection of frozen modules: */
41
42PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
43
44PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *);
45PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *);
46