mirror of
https://github.com/python/cpython.git
synced 2024-12-04 23:34:42 +08:00
49d3f2514b
* Rename _PyImport_FindExtension() to _PyImport_FindExtensionUnicode(): the filename becomes a Unicode object instead of byte string * Rename _PyImport_FixupExtension() to _PyImport_FixupExtensionUnicode(): the filename becomes a Unicode object instead of byte string
74 lines
2.3 KiB
C
74 lines
2.3 KiB
C
|
|
/* Module definition and import interface */
|
|
|
|
#ifndef Py_IMPORT_H
|
|
#define Py_IMPORT_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
|
|
PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
|
|
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
|
|
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
|
|
char *name, PyObject *co, char *pathname);
|
|
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
|
|
char *name, PyObject *co, char *pathname, char *cpathname);
|
|
PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
|
|
PyAPI_FUNC(PyObject *) PyImport_AddModule(const char *name);
|
|
PyAPI_FUNC(PyObject *) PyImport_ImportModule(const char *name);
|
|
PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(const char *);
|
|
PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name,
|
|
PyObject *globals, PyObject *locals, PyObject *fromlist, int level);
|
|
|
|
#define PyImport_ImportModuleEx(n, g, l, f) \
|
|
PyImport_ImportModuleLevel(n, g, l, f, -1)
|
|
|
|
PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
|
|
PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
|
|
PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
|
|
PyAPI_FUNC(void) PyImport_Cleanup(void);
|
|
PyAPI_FUNC(int) PyImport_ImportFrozenModule(char *);
|
|
|
|
#ifdef WITH_THREAD
|
|
PyAPI_FUNC(void) _PyImport_AcquireLock(void);
|
|
PyAPI_FUNC(int) _PyImport_ReleaseLock(void);
|
|
#else
|
|
#define _PyImport_AcquireLock()
|
|
#define _PyImport_ReleaseLock() 1
|
|
#endif
|
|
|
|
PyAPI_FUNC(void) _PyImport_ReInitLock(void);
|
|
|
|
PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin(char *);
|
|
PyAPI_FUNC(PyObject *)_PyImport_FindExtensionUnicode(char *, PyObject *);
|
|
PyAPI_FUNC(int)_PyImport_FixupBuiltin(PyObject*, char *);
|
|
PyAPI_FUNC(int)_PyImport_FixupExtensionUnicode(PyObject*, char *, PyObject *);
|
|
|
|
struct _inittab {
|
|
char *name;
|
|
PyObject* (*initfunc)(void);
|
|
};
|
|
|
|
PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
|
|
PyAPI_DATA(struct _inittab *) PyImport_Inittab;
|
|
|
|
PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void));
|
|
PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
|
|
|
|
struct _frozen {
|
|
char *name;
|
|
unsigned char *code;
|
|
int size;
|
|
};
|
|
|
|
/* Embedding apps may change this pointer to point to their favorite
|
|
collection of frozen modules: */
|
|
|
|
PyAPI_DATA(struct _frozen *) PyImport_FrozenModules;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_IMPORT_H */
|