diff options
Diffstat (limited to 'Include/import.h')
| -rw-r--r-- | Include/import.h | 73 |
1 files changed, 55 insertions, 18 deletions
diff --git a/Include/import.h b/Include/import.h index b8de2fd..400e97c 100644 --- a/Include/import.h +++ b/Include/import.h @@ -8,25 +8,52 @@ extern "C" { #endif PyAPI_FUNC(long) PyImport_GetMagicNumber(void); -PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co); +PyAPI_FUNC(const char *) PyImport_GetMagicTag(void); +PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule( + char *name, /* UTF-8 encoded string */ + PyObject *co + ); PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( - char *name, PyObject *co, char *pathname); + char *name, /* UTF-8 encoded string */ + PyObject *co, + char *pathname /* decoded from the filesystem encoding */ + ); +PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames( + char *name, /* UTF-8 encoded string */ + PyObject *co, + char *pathname, /* decoded from the filesystem encoding */ + char *cpathname /* decoded from the filesystem encoding */ + ); 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); +PyAPI_FUNC(PyObject *) PyImport_AddModule( + const char *name /* UTF-8 encoded string */ + ); +PyAPI_FUNC(PyObject *) PyImport_ImportModule( + const char *name /* UTF-8 encoded string */ + ); +PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock( + const char *name /* UTF-8 encoded string */ + ); +PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel( + char *name, /* UTF-8 encoded string */ + PyObject *globals, + PyObject *locals, + PyObject *fromlist, + int level + ); #define PyImport_ImportModuleEx(n, g, l, f) \ - PyImport_ImportModuleLevel(n, g, l, f, -1) + 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 *); +PyAPI_FUNC(int) PyImport_ImportFrozenModule( + char *name /* UTF-8 encoded string */ + ); +#ifndef Py_LIMITED_API #ifdef WITH_THREAD PyAPI_FUNC(void) _PyImport_AcquireLock(void); PyAPI_FUNC(int) _PyImport_ReleaseLock(void); @@ -35,27 +62,36 @@ PyAPI_FUNC(int) _PyImport_ReleaseLock(void); #define _PyImport_ReleaseLock() 1 #endif -PyAPI_FUNC(struct filedescr *) _PyImport_FindModule( - const char *, PyObject *, char *, size_t, FILE **, PyObject **); -PyAPI_FUNC(int) _PyImport_IsScript(struct filedescr *); PyAPI_FUNC(void) _PyImport_ReInitLock(void); -PyAPI_FUNC(PyObject *)_PyImport_FindExtension(char *, char *); -PyAPI_FUNC(int)_PyImport_FixupExtension(PyObject*, char *, char *); +PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin( + char *name /* UTF-8 encoded string */ + ); +PyAPI_FUNC(PyObject *)_PyImport_FindExtensionUnicode(char *, PyObject *); +PyAPI_FUNC(int)_PyImport_FixupBuiltin( + PyObject *mod, + char *name /* UTF-8 encoded string */ + ); +PyAPI_FUNC(int)_PyImport_FixupExtensionUnicode(PyObject*, char *, PyObject *); struct _inittab { char *name; PyObject* (*initfunc)(void); }; +PyAPI_DATA(struct _inittab *) PyImport_Inittab; +PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab); +#endif /* Py_LIMITED_API */ 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); +PyAPI_FUNC(int) PyImport_AppendInittab( + const char *name, /* ASCII encoded string */ + PyObject* (*initfunc)(void) + ); +#ifndef Py_LIMITED_API struct _frozen { - char *name; + char *name; /* ASCII encoded string */ unsigned char *code; int size; }; @@ -64,6 +100,7 @@ struct _frozen { collection of frozen modules: */ PyAPI_DATA(struct _frozen *) PyImport_FrozenModules; +#endif #ifdef __cplusplus } |
