summaryrefslogtreecommitdiffstats
path: root/Include/import.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/import.h')
-rw-r--r--Include/import.h117
1 files changed, 44 insertions, 73 deletions
diff --git a/Include/import.h b/Include/import.h
index 735533e..89f51b5 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -1,3 +1,4 @@
+
/* Module definition and import interface */
#ifndef Py_IMPORT_H
@@ -7,92 +8,62 @@ extern "C" {
#endif
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
-PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
-PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
- const char *name, /* UTF-8 encoded string */
- PyObject *co
- );
+PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx(
- const char *name, /* UTF-8 encoded string */
- PyObject *co,
- const char *pathname /* decoded from the filesystem encoding */
- );
-PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
- const char *name, /* UTF-8 encoded string */
- PyObject *co,
- const char *pathname, /* decoded from the filesystem encoding */
- const char *cpathname /* decoded from the filesystem encoding */
- );
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
-PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
- PyObject *name,
- PyObject *co,
- PyObject *pathname,
- PyObject *cpathname
- );
-#endif
+ char *name, PyObject *co, char *pathname);
PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
-PyAPI_FUNC(PyObject *) PyImport_GetModule(PyObject *name);
-#endif
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
-PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
- PyObject *name
- );
-#endif
-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(
- const char *name, /* UTF-8 encoded string */
- PyObject *globals,
- PyObject *locals,
- PyObject *fromlist,
- int level
- );
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
-PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
- PyObject *name,
- PyObject *globals,
- PyObject *locals,
- PyObject *fromlist,
- int level
- );
-#endif
+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, 0)
+ 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);
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
-PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
- PyObject *name
- );
+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(int) PyImport_ImportFrozenModule(
- const char *name /* UTF-8 encoded string */
- );
+
+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(PyObject *) _PyImport_FixupExtension(char *, char *);
+
+struct _inittab {
+ char *name;
+ void (*initfunc)(void);
+};
PyAPI_DATA(PyTypeObject) PyNullImporter_Type;
+PyAPI_DATA(struct _inittab *) PyImport_Inittab;
-PyAPI_FUNC(int) PyImport_AppendInittab(
- const char *name, /* ASCII encoded string */
- PyObject* (*initfunc)(void)
- );
+PyAPI_FUNC(int) PyImport_AppendInittab(const char *name, void (*initfunc)(void));
+PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
-#ifndef Py_LIMITED_API
-# define Py_CPYTHON_IMPORT_H
-# include "cpython/import.h"
-# undef Py_CPYTHON_IMPORT_H
-#endif
+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
}