mirror of
https://github.com/python/cpython.git
synced 2026-01-05 23:12:38 +00:00
Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
#ifndef Py_CPYTHON_IMPORT_H
|
|
# error "this header file must not be included directly"
|
|
#endif
|
|
|
|
struct _inittab {
|
|
const char *name; /* ASCII encoded string */
|
|
PyObject* (*initfunc)(void);
|
|
};
|
|
// This is not used after Py_Initialize() is called.
|
|
PyAPI_DATA(struct _inittab *) PyImport_Inittab;
|
|
PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
|
|
|
|
// Custom importers may use this API to initialize statically linked
|
|
// extension modules directly from a spec and init function,
|
|
// without needing to go through inittab
|
|
PyAPI_FUNC(PyObject *) PyImport_CreateModuleFromInitfunc(
|
|
PyObject *spec,
|
|
PyObject *(*initfunc)(void));
|
|
|
|
struct _frozen {
|
|
const char *name; /* ASCII encoded string */
|
|
const unsigned char *code;
|
|
int size;
|
|
int is_package;
|
|
};
|
|
|
|
/* Embedding apps may change this pointer to point to their favorite
|
|
collection of frozen modules: */
|
|
|
|
PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules;
|
|
|
|
PyAPI_FUNC(PyObject*) PyImport_ImportModuleAttr(
|
|
PyObject *mod_name,
|
|
PyObject *attr_name);
|
|
PyAPI_FUNC(PyObject*) PyImport_ImportModuleAttrString(
|
|
const char *mod_name,
|
|
const char *attr_name);
|